Contract 0xAcbeB5fc062cC66ae51EE63EaAe088cfddC9586a

 
Ad
Ad
Txn Hash Method
Block
From
To
Value
0x5eb0ad290eaa6ef1867125892fc1d37e724f3869a1c8b9c5c52251a683a832c9Transfer Ownersh...128578462021-07-19 15:28:3562 days 1 hr ago0xa0863436913b1b439ccaa6fbf89408116c1dde29 IN  0xacbeb5fc062cc66ae51ee63eaae088cfddc9586a0 Ether0.0011494440
0xeb104cf32179cf6261997edfde42391e72d9ad4ebfbab8196ae68824f188fe2f0x60008054127688052021-07-05 17:24:4075 days 23 hrs ago0xa0863436913b1b439ccaa6fbf89408116c1dde29 IN  Create: Idle_Zap_V10 Ether0.0118494355
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Idle_Zap_V1

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, GNU GPLv2 license
File 1 of 11 : IdleInterface.sol
// SPDX-License-Identifier: GPL-2.0
pragma solidity ^0.8.0;

interface IIdleToken {
    function token() external view returns (address);

    function mintIdleToken(
        uint256 _amount,
        bool _skipWholeRebalance,
        address _referral
    ) external returns (uint256 mintedTokens);

    function redeemIdleToken(uint256 _amount)
        external
        returns (uint256 redeemedTokens);

    function getGovTokens() external view returns (address[] memory);

    function tokenPrice() external view returns (uint256 price);
}

interface IIdleTokenHelper {
    function getRedeemPrice(address idleYieldToken)
        external
        view
        returns (uint256 redeemPrice);
}

File 2 of 11 : Idle_Zap_V1.sol
// ███████╗░█████╗░██████╗░██████╗░███████╗██████╗░░░░███████╗██╗
// ╚════██║██╔══██╗██╔══██╗██╔══██╗██╔════╝██╔══██╗░░░██╔════╝██║
// ░░███╔═╝███████║██████╔╝██████╔╝█████╗░░██████╔╝░░░█████╗░░██║
// ██╔══╝░░██╔══██║██╔═══╝░██╔═══╝░██╔══╝░░██╔══██╗░░░██╔══╝░░██║
// ███████╗██║░░██║██║░░░░░██║░░░░░███████╗██║░░██║██╗██║░░░░░██║
// ╚══════╝╚═╝░░╚═╝╚═╝░░░░░╚═╝░░░░░╚══════╝╚═╝░░╚═╝╚═╝╚═╝░░░░░╚═╝
// Copyright (C) 2021 zapper

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//

///@author Zapper
///@notice This contract deposits and withdraws assets to/from Idle Finance 'Best Yield' and 'Risk Adjusted' opportunities
// SPDX-License-Identifier: GPL-2.0

pragma solidity ^0.8.0;
import "../_base/ZapInBaseV3_1.sol";
import "../_base/ZapOutBaseV3_1.sol";
import "./IdleInterface.sol";

interface IWETH {
    function deposit() external payable;

    function withdraw(uint256 wad) external;
}

contract Idle_Zap_V1 is ZapInBaseV3_1, ZapOutBaseV3_1 {
    using SafeERC20 for IERC20;

    address private constant wethTokenAddress =
        0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;

    IIdleTokenHelper private constant IdleTokenHelper =
        IIdleTokenHelper(0x04Ce60ed10F6D2CfF3AA015fc7b950D13c113be5);

    // COMP, IDLE, stkAAVE
    address[] govTokens = [
        0xc00e94Cb662C3520282E6f5717214004A7f26888,
        0x875773784Af8135eA0ef43b5a374AaD105c5D39e,
        0x4da27a545c0c5B758a6BA100e3a049001de870f5
    ];

    constructor(uint256 _goodwill, uint256 _affiliateSplit)
        ZapBaseV2_1(_goodwill, _affiliateSplit)
    {
        approvedTargets[0xDef1C0ded9bec7F1a1670819833240f027b25EfF] = true;
    }

    event zapIn(address sender, address token, uint256 tokensRec);
    event zapOut(address sender, address token, uint256 tokensRec);

    /**
    @notice This function deposits assets into Idle finance with ETH or ERC20 tokens
    @param fromToken The token used for entry (address(0) if ether)
    @param amountIn The amount of fromToken to invest
    @param idleToken Address of the Idle token
    @param minIdleTokens The minimum acceptable quantity Idle tokens to receive. Reverts otherwise
    @param swapTarget Excecution target for the swap or zap
    @param swapData DEX or Zap data. Must swap to cToken underlying address
    @param affiliate Affiliate address
    @return idleTokensRec Quantity of cTokens received
     */
    function ZapIn(
        address fromToken,
        uint256 amountIn,
        address idleToken,
        uint256 minIdleTokens,
        address swapTarget,
        bytes calldata swapData,
        address affiliate
    ) external payable stopInEmergency returns (uint256 idleTokensRec) {
        uint256 toInvest = _pullTokens(fromToken, amountIn, affiliate, true);

        address toToken = getUnderlyingToken(idleToken);

        uint256 tokensBought =
            _fillQuote(fromToken, toToken, toInvest, swapTarget, swapData);

        (idleTokensRec) = enterIdle(idleToken, toToken, tokensBought);
        require(idleTokensRec > minIdleTokens, "High Slippage");

        IERC20(idleToken).safeTransfer(msg.sender, idleTokensRec);

        emit zapIn(msg.sender, idleToken, idleTokensRec);
    }

    function enterIdle(
        address idleToken,
        address underlyingToken,
        uint256 underlyingAmount
    ) internal returns (uint256 idleTokensRec) {
        uint256 initialBalance = _getBalance(idleToken);

        _approveToken(underlyingToken, idleToken, underlyingAmount);
        IIdleToken(idleToken).mintIdleToken(
            underlyingAmount,
            true,
            ZapperAdmin
        );

        idleTokensRec = _getBalance(idleToken) - initialBalance;
    }

    /**
    @notice This function withdraws assets from Idle finance, receiving tokens or ETH
    @param fromToken The Idle token being withdrawn
    @param amountIn The quantity of fromToken to withdraw
    @param toToken Address of the token to receive (0 address if ETH)
    @param minToTokens The minimum acceptable quantity tokens to receive. Reverts otherwise
    @param swapTarget Excecution target for the swap or zap
    @param swapData DEX or Zap data
    @param affiliate Affiliate address
    @return tokensRec Quantity of aTokens received
     */
    function ZapOut(
        address fromToken,
        uint256 amountIn,
        address toToken,
        uint256 minToTokens,
        address swapTarget,
        bytes calldata swapData,
        address affiliate
    ) public stopInEmergency returns (uint256 tokensRec) {
        amountIn = _pullTokens(fromToken, amountIn);

        (uint256 underlyingRec, uint256[] memory govTokensRec) =
            exitIdle(fromToken, amountIn);

        address underlyingToken = getUnderlyingToken(fromToken);

        tokensRec = _fillQuote(
            underlyingToken,
            toToken,
            underlyingRec,
            swapTarget,
            swapData
        );

        require(tokensRec >= minToTokens, "High Slippage");

        uint256 totalGoodwillPortion;

        if (toToken == address(0)) {
            totalGoodwillPortion = _subtractGoodwill(
                ETHAddress,
                tokensRec,
                affiliate,
                true
            );

            payable(msg.sender).transfer(tokensRec - totalGoodwillPortion);
        } else {
            totalGoodwillPortion = _subtractGoodwill(
                toToken,
                tokensRec,
                affiliate,
                true
            );

            IERC20(toToken).safeTransfer(
                msg.sender,
                tokensRec - totalGoodwillPortion
            );
        }

        for (uint256 i = 0; i < govTokens.length; i++) {
            if (govTokensRec[i] > 0) {
                IERC20(govTokens[i]).safeTransfer(msg.sender, govTokensRec[i]);
            }
        }

        tokensRec = tokensRec - totalGoodwillPortion;

        emit zapOut(msg.sender, toToken, tokensRec);
    }

    function exitIdle(address idleToken, uint256 idleTokenAmount)
        internal
        returns (uint256, uint256[] memory)
    {
        uint256[] memory initialGovBalance = new uint256[](govTokens.length);
        for (uint256 i = 0; i < govTokens.length; i++) {
            initialGovBalance[i] = _getBalance(govTokens[i]);
        }

        uint256 underlyingRec =
            IIdleToken(idleToken).redeemIdleToken(idleTokenAmount);

        uint256[] memory govTokensRec = new uint256[](govTokens.length);
        for (uint256 i = 0; i < govTokens.length; i++) {
            govTokensRec[i] = _getBalance(govTokens[i]) - initialGovBalance[i];
        }
        return (underlyingRec, govTokensRec);
    }

    function _fillQuote(
        address fromToken,
        address toToken,
        uint256 _amount,
        address swapTarget,
        bytes memory swapData
    ) internal returns (uint256 amountBought) {
        if (fromToken == toToken) {
            return _amount;
        }

        if (fromToken == address(0) && toToken == wethTokenAddress) {
            IWETH(wethTokenAddress).deposit{ value: _amount }();
            return _amount;
        }

        if (fromToken == wethTokenAddress && toToken == address(0)) {
            IWETH(wethTokenAddress).withdraw(_amount);
            return _amount;
        }

        uint256 valueToSend;
        if (fromToken == address(0)) {
            valueToSend = _amount;
        } else {
            _approveToken(fromToken, swapTarget);
        }

        uint256 initialBalance = _getBalance(toToken);

        require(approvedTargets[swapTarget], "Target not Authorized");
        (bool success, ) = swapTarget.call{ value: valueToSend }(swapData);
        require(success, "Error Swapping Tokens");

        amountBought = _getBalance(toToken) - initialBalance;

        require(amountBought > 0, "Swapped To Invalid Intermediate");
    }

    function getUnderlyingToken(address idleToken)
        public
        view
        returns (address)
    {
        return IIdleToken(idleToken).token();
    }

    function removeLiquidityReturn(address idleToken, uint256 idleTokenAmount)
        external
        view
        returns (uint256 underlyingRec)
    {
        return
            (IdleTokenHelper.getRedeemPrice(idleToken) * idleTokenAmount) /
            10**18;
    }
}

File 3 of 11 : ZapBaseV2_1.sol
// SPDX-License-Identifier: GPL-2.0
pragma solidity ^0.8.0;

import "../oz/0.8.0/access/Ownable.sol";
import "../oz/0.8.0/token/ERC20/utils/SafeERC20.sol";
import "../oz/0.8.0/token/ERC20/extensions/IERC20Metadata.sol";

abstract contract ZapBaseV2_1 is Ownable {
    using SafeERC20 for IERC20;
    bool public stopped = false;

    // if true, goodwill is not deducted
    mapping(address => bool) public feeWhitelist;

    uint256 public goodwill;
    // % share of goodwill (0-100 %)
    uint256 affiliateSplit;
    // restrict affiliates
    mapping(address => bool) public affiliates;
    // affiliate => token => amount
    mapping(address => mapping(address => uint256)) public affiliateBalance;
    // token => amount
    mapping(address => uint256) public totalAffiliateBalance;
    // swapTarget => approval status
    mapping(address => bool) public approvedTargets;

    address internal constant ETHAddress =
        0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;

    address internal constant ZapperAdmin =
        0x3CE37278de6388532C3949ce4e886F365B14fB56;

    constructor(uint256 _goodwill, uint256 _affiliateSplit) {
        goodwill = _goodwill;
        affiliateSplit = _affiliateSplit;
    }

    // circuit breaker modifiers
    modifier stopInEmergency {
        if (stopped) {
            revert("Paused");
        } else {
            _;
        }
    }

    function _getBalance(address token)
        internal
        view
        returns (uint256 balance)
    {
        if (token == address(0)) {
            balance = address(this).balance;
        } else {
            balance = IERC20(token).balanceOf(address(this));
        }
    }

    function _approveToken(address token, address spender) internal {
        IERC20 _token = IERC20(token);
        if (_token.allowance(address(this), spender) > 0) return;
        else {
            _token.safeApprove(spender, type(uint256).max);
        }
    }

    function _approveToken(
        address token,
        address spender,
        uint256 amount
    ) internal {
        IERC20(token).safeApprove(spender, 0);
        IERC20(token).safeApprove(spender, amount);
    }

    // - to Pause the contract
    function toggleContractActive() public onlyOwner {
        stopped = !stopped;
    }

    function set_feeWhitelist(address zapAddress, bool status)
        external
        onlyOwner
    {
        feeWhitelist[zapAddress] = status;
    }

    function set_new_goodwill(uint256 _new_goodwill) public onlyOwner {
        require(
            _new_goodwill >= 0 && _new_goodwill <= 100,
            "GoodWill Value not allowed"
        );
        goodwill = _new_goodwill;
    }

    function set_new_affiliateSplit(uint256 _new_affiliateSplit)
        external
        onlyOwner
    {
        require(
            _new_affiliateSplit <= 100,
            "Affiliate Split Value not allowed"
        );
        affiliateSplit = _new_affiliateSplit;
    }

    function set_affiliate(address _affiliate, bool _status)
        external
        onlyOwner
    {
        affiliates[_affiliate] = _status;
    }

    ///@notice Withdraw goodwill share, retaining affilliate share
    function withdrawTokens(address[] calldata tokens) external onlyOwner {
        for (uint256 i = 0; i < tokens.length; i++) {
            uint256 qty;

            if (tokens[i] == ETHAddress) {
                qty = address(this).balance - totalAffiliateBalance[tokens[i]];

                Address.sendValue(payable(owner()), qty);
            } else {
                qty =
                    IERC20(tokens[i]).balanceOf(address(this)) -
                    totalAffiliateBalance[tokens[i]];
                IERC20(tokens[i]).safeTransfer(owner(), qty);
            }
        }
    }

    ///@notice Withdraw affilliate share, retaining goodwill share
    function affilliateWithdraw(address[] calldata tokens) external {
        uint256 tokenBal;
        for (uint256 i = 0; i < tokens.length; i++) {
            tokenBal = affiliateBalance[msg.sender][tokens[i]];
            affiliateBalance[msg.sender][tokens[i]] = 0;
            totalAffiliateBalance[tokens[i]] =
                totalAffiliateBalance[tokens[i]] -
                tokenBal;

            if (tokens[i] == ETHAddress) {
                Address.sendValue(payable(msg.sender), tokenBal);
            } else {
                IERC20(tokens[i]).safeTransfer(msg.sender, tokenBal);
            }
        }
    }

    function setApprovedTargets(
        address[] calldata targets,
        bool[] calldata isApproved
    ) external onlyOwner {
        require(targets.length == isApproved.length, "Invalid Input length");

        for (uint256 i = 0; i < targets.length; i++) {
            approvedTargets[targets[i]] = isApproved[i];
        }
    }

    function _subtractGoodwill(
        address token,
        uint256 amount,
        address affiliate,
        bool enableGoodwill
    ) internal returns (uint256 totalGoodwillPortion) {
        bool whitelisted = feeWhitelist[msg.sender];
        if (enableGoodwill && !whitelisted && goodwill > 0) {
            totalGoodwillPortion = (amount * goodwill) / 10000;

            if (affiliates[affiliate]) {
                if (token == address(0)) {
                    token = ETHAddress;
                }

                uint256 affiliatePortion =
                    (totalGoodwillPortion * affiliateSplit) / 100;
                affiliateBalance[affiliate][token] += affiliatePortion;
                totalAffiliateBalance[token] += affiliatePortion;
            }
        }
    }

    receive() external payable {
        require(msg.sender != tx.origin, "Do not send ETH directly");
    }
}

File 4 of 11 : ZapInBaseV3_1.sol
// SPDX-License-Identifier: GPL-2.0

pragma solidity ^0.8.0;
import "./ZapBaseV2_1.sol";

abstract contract ZapInBaseV3_1 is ZapBaseV2_1 {
    using SafeERC20 for IERC20;

    /**
    @dev Transfer tokens (including ETH) from msg.sender to this contract
    @param token The ERC20 token to transfer to this contract (0 address if ETH)
    @return Quantity of tokens transferred to this contract
     */
    function _pullTokens(
        address token,
        uint256 amount,
        address affiliate,
        bool enableGoodwill
    ) internal returns (uint256) {
        uint256 totalGoodwillPortion;

        if (token == address(0)) {
            require(msg.value > 0, "No eth sent");

            // subtract goodwill
            totalGoodwillPortion = _subtractGoodwill(
                ETHAddress,
                msg.value,
                affiliate,
                enableGoodwill
            );

            return msg.value - totalGoodwillPortion;
        }

        require(amount > 0, "Invalid token amount");
        require(msg.value == 0, "Eth sent with token");

        //transfer token

        IERC20(token).safeTransferFrom(msg.sender, address(this), amount);

        // subtract goodwill
        totalGoodwillPortion = _subtractGoodwill(
            token,
            amount,
            affiliate,
            enableGoodwill
        );

        return amount - totalGoodwillPortion;
    }
}

File 5 of 11 : ZapOutBaseV3_1.sol
// SPDX-License-Identifier: GPL-2.0

pragma solidity ^0.8.0;
import "./ZapBaseV2_1.sol";

abstract contract ZapOutBaseV3_1 is ZapBaseV2_1 {
    using SafeERC20 for IERC20;

    /**
    @dev Transfer tokens from msg.sender to this contract
    @param token The ERC20 token to transfer to this contract
    @return Quantity of tokens transferred to this contract
     */
    function _pullTokens(address token, uint256 amount)
        internal
        returns (uint256)
    {
        IERC20(token).safeTransferFrom(msg.sender, address(this), amount);

        return amount;
    }
}

File 6 of 11 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(
        address indexed previousOwner,
        address indexed newOwner
    );

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(
            newOwner != address(0),
            "Ownable: new owner is the zero address"
        );
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

File 7 of 11 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount)
        external
        returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender)
        external
        view
        returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(
        address indexed owner,
        address indexed spender,
        uint256 value
    );
}

File 8 of 11 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

File 9 of 11 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(
            token,
            abi.encodeWithSelector(token.transfer.selector, to, value)
        );
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(
            token,
            abi.encodeWithSelector(token.transferFrom.selector, from, to, value)
        );
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        // solhint-disable-next-line max-line-length
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(
            token,
            abi.encodeWithSelector(token.approve.selector, spender, value)
        );
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(
            token,
            abi.encodeWithSelector(
                token.approve.selector,
                spender,
                newAllowance
            )
        );
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(
                oldAllowance >= value,
                "SafeERC20: decreased allowance below zero"
            );
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(
                token,
                abi.encodeWithSelector(
                    token.approve.selector,
                    spender,
                    newAllowance
                )
            );
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata =
            address(token).functionCall(
                data,
                "SafeERC20: low-level call failed"
            );
        if (returndata.length > 0) {
            // Return data is optional
            // solhint-disable-next-line max-line-length
            require(
                abi.decode(returndata, (bool)),
                "SafeERC20: ERC20 operation did not succeed"
            );
        }
    }
}

File 10 of 11 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(
            address(this).balance >= amount,
            "Address: insufficient balance"
        );

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(
            success,
            "Address: unable to send value, recipient may have reverted"
        );
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain`call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data)
        internal
        returns (bytes memory)
    {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return
            functionCallWithValue(
                target,
                data,
                value,
                "Address: low-level call with value failed"
            );
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(
            address(this).balance >= value,
            "Address: insufficient balance for call"
        );
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) =
            target.call{ value: value }(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data)
        internal
        view
        returns (bytes memory)
    {
        return
            functionStaticCall(
                target,
                data,
                "Address: low-level static call failed"
            );
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data)
        internal
        returns (bytes memory)
    {
        return
            functionDelegateCall(
                target,
                data,
                "Address: low-level delegate call failed"
            );
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) private pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 11 of 11 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/*
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

Settings
{
  "evmVersion": "istanbul",
  "libraries": {},
  "metadata": {
    "bytecodeHash": "ipfs",
    "useLiteralContent": true
  },
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "remappings": [],
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"uint256","name":"_goodwill","type":"uint256"},{"internalType":"uint256","name":"_affiliateSplit","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokensRec","type":"uint256"}],"name":"zapIn","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokensRec","type":"uint256"}],"name":"zapOut","type":"event"},{"inputs":[{"internalType":"address","name":"fromToken","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address","name":"idleToken","type":"address"},{"internalType":"uint256","name":"minIdleTokens","type":"uint256"},{"internalType":"address","name":"swapTarget","type":"address"},{"internalType":"bytes","name":"swapData","type":"bytes"},{"internalType":"address","name":"affiliate","type":"address"}],"name":"ZapIn","outputs":[{"internalType":"uint256","name":"idleTokensRec","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"fromToken","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address","name":"toToken","type":"address"},{"internalType":"uint256","name":"minToTokens","type":"uint256"},{"internalType":"address","name":"swapTarget","type":"address"},{"internalType":"bytes","name":"swapData","type":"bytes"},{"internalType":"address","name":"affiliate","type":"address"}],"name":"ZapOut","outputs":[{"internalType":"uint256","name":"tokensRec","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"affiliateBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"affiliates","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"}],"name":"affilliateWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"approvedTargets","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"feeWhitelist","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"idleToken","type":"address"}],"name":"getUnderlyingToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"goodwill","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"idleToken","type":"address"},{"internalType":"uint256","name":"idleTokenAmount","type":"uint256"}],"name":"removeLiquidityReturn","outputs":[{"internalType":"uint256","name":"underlyingRec","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"targets","type":"address[]"},{"internalType":"bool[]","name":"isApproved","type":"bool[]"}],"name":"setApprovedTargets","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_affiliate","type":"address"},{"internalType":"bool","name":"_status","type":"bool"}],"name":"set_affiliate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"zapAddress","type":"address"},{"internalType":"bool","name":"status","type":"bool"}],"name":"set_feeWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_new_affiliateSplit","type":"uint256"}],"name":"set_new_affiliateSplit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_new_goodwill","type":"uint256"}],"name":"set_new_goodwill","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stopped","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"toggleContractActive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"totalAffiliateBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"}],"name":"withdrawTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

6000805460ff60a01b1916905560e060405273c00e94cb662c3520282e6f5717214004a7f26888608090815273875773784af8135ea0ef43b5a374aad105c5d39e60a052734da27a545c0c5b758a6ba100e3a049001de870f560c0526200006b9060089060036200013b565b503480156200007957600080fd5b5060405162002931380380620029318339810160408190526200009c91620001bc565b600080546001600160a01b03191633908117825560405184928492918291907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350600291909155600355505073def1c0ded9bec7f1a1670819833240f027b25eff60005260076020527ff6019cd1944dc466e824190b288e5a63528dd4c9a6d8cbd707956fd30d2f1e0d805460ff19166001179055620001e0565b82805482825590600052602060002090810192821562000193579160200282015b828111156200019357825182546001600160a01b0319166001600160a01b039091161782556020909201916001909101906200015c565b50620001a1929150620001a5565b5090565b5b80821115620001a15760008155600101620001a6565b60008060408385031215620001cf578182fd5b505080516020909101519092909150565b61274180620001f06000396000f3fe6080604052600436106101395760003560e01c8063691bcc88116100ab5780638da5cb5b1161006f5780638da5cb5b146103de5780639735a634146103fc5780639779d1a61461041c578063d408f6571461044c578063f2fde38b1461047c578063fbec27bf1461049c57600080fd5b8063691bcc881461033d57806369a7e57b14610375578063715018a61461038857806375f12b211461039d5780637ee99283146103be57600080fd5b80633ff428c7116100fd5780633ff428c71461026757806346d4b548146102875780634f51e294146102a7578063550bfa56146102e75780635de0398e146103075780635ecb16cd1461031d57600080fd5b806301e980d41461019a5780630dc9de85146101ba5780631385d24c146101da5780631781261f146101ef57806318b135e31461023a57600080fd5b3661019557333214156101935760405162461bcd60e51b815260206004820152601860248201527f446f206e6f742073656e6420455448206469726563746c79000000000000000060448201526064015b60405180910390fd5b005b600080fd5b3480156101a657600080fd5b506101936101b5366004612566565b6104bc565b3480156101c657600080fd5b506101936101d5366004612485565b610546565b3480156101e657600080fd5b506101936107a1565b3480156101fb57600080fd5b5061022761020a36600461232c565b600560209081526000928352604080842090915290825290205481565b6040519081526020015b60405180910390f35b34801561024657600080fd5b506102276102553660046122f4565b60066020526000908152604090205481565b34801561027357600080fd5b50610193610282366004612364565b6107ec565b34801561029357600080fd5b506102276102a23660046123bc565b610841565b3480156102b357600080fd5b506102d76102c23660046122f4565b60046020526000908152604090205460ff1681565b6040519015158152602001610231565b3480156102f357600080fd5b50610193610302366004612566565b610af0565b34801561031357600080fd5b5061022760025481565b34801561032957600080fd5b50610193610338366004612485565b610b70565b34801561034957600080fd5b5061035d6103583660046122f4565b610de1565b6040516001600160a01b039091168152602001610231565b6102276103833660046123bc565b610e5a565b34801561039457600080fd5b50610193610fbb565b3480156103a957600080fd5b506000546102d790600160a01b900460ff1681565b3480156103ca57600080fd5b506102276103d9366004612391565b61102f565b3480156103ea57600080fd5b506000546001600160a01b031661035d565b34801561040857600080fd5b506101936104173660046124c5565b6110e4565b34801561042857600080fd5b506102d76104373660046122f4565b60076020526000908152604090205460ff1681565b34801561045857600080fd5b506102d76104673660046122f4565b60016020526000908152604090205460ff1681565b34801561048857600080fd5b506101936104973660046122f4565b61120e565b3480156104a857600080fd5b506101936104b7366004612364565b6112f8565b6000546001600160a01b031633146104e65760405162461bcd60e51b815260040161018a906125e5565b60648111156105415760405162461bcd60e51b815260206004820152602160248201527f416666696c696174652053706c69742056616c7565206e6f7420616c6c6f77656044820152601960fa1b606482015260840161018a565b600355565b6000805b8281101561079b573360009081526005602052604081209085858481811061058257634e487b7160e01b600052603260045260246000fd5b905060200201602081019061059791906122f4565b6001600160a01b031681526020808201929092526040908101600090812054338252600590935290812091935090818686858181106105e657634e487b7160e01b600052603260045260246000fd5b90506020020160208101906105fb91906122f4565b6001600160a01b03166001600160a01b0316815260200190815260200160002081905550816006600086868581811061064457634e487b7160e01b600052603260045260246000fd5b905060200201602081019061065991906122f4565b6001600160a01b03166001600160a01b03168152602001908152602001600020546106849190612671565b600660008686858181106106a857634e487b7160e01b600052603260045260246000fd5b90506020020160208101906106bd91906122f4565b6001600160a01b0316815260208101919091526040016000205573eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee84848381811061070c57634e487b7160e01b600052603260045260246000fd5b905060200201602081019061072191906122f4565b6001600160a01b0316141561073f5761073a338361134d565b610789565b610789338386868581811061076457634e487b7160e01b600052603260045260246000fd5b905060200201602081019061077991906122f4565b6001600160a01b03169190611466565b80610793816126b4565b91505061054a565b50505050565b6000546001600160a01b031633146107cb5760405162461bcd60e51b815260040161018a906125e5565b6000805460ff60a01b198116600160a01b9182900460ff1615909102179055565b6000546001600160a01b031633146108165760405162461bcd60e51b815260040161018a906125e5565b6001600160a01b03919091166000908152600460205260409020805460ff1916911515919091179055565b60008054600160a01b900460ff16156108855760405162461bcd60e51b815260206004820152600660248201526514185d5cd95960d21b604482015260640161018a565b61088f89896114c9565b975060008061089e8b8b6114e6565b9150915060006108ad8c610de1565b90506108f2818b858b8b8b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061175492505050565b9350888410156109345760405162461bcd60e51b815260206004820152600d60248201526c4869676820536c69707061676560981b604482015260640161018a565b60006001600160a01b038b166109a35761096573eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee86886001611a6c565b9050336108fc6109758388612671565b6040518115909202916000818181858888f1935050505015801561099d573d6000803e3d6000fd5b506109d1565b6109b08b86886001611a6c565b90506109d1336109c08388612671565b6001600160a01b038e169190611466565b60005b600854811015610a89576000848281518110610a0057634e487b7160e01b600052603260045260246000fd5b60200260200101511115610a7757610a7733858381518110610a3257634e487b7160e01b600052603260045260246000fd5b602002602001015160088481548110610a5b57634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b03169190611466565b80610a81816126b4565b9150506109d4565b50610a948186612671565b604080513381526001600160a01b038e1660208201529081018290529095507fa51973a21dd19abaad8194f70440e180b7c5784c9828663e69dcbb57d7575bea9060600160405180910390a15050505098975050505050505050565b6000546001600160a01b03163314610b1a5760405162461bcd60e51b815260040161018a906125e5565b6064811115610b6b5760405162461bcd60e51b815260206004820152601a60248201527f476f6f6457696c6c2056616c7565206e6f7420616c6c6f776564000000000000604482015260640161018a565b600255565b6000546001600160a01b03163314610b9a5760405162461bcd60e51b815260040161018a906125e5565b60005b81811015610ddc57600073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee848484818110610bdc57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610bf191906122f4565b6001600160a01b03161415610c7f5760066000858585818110610c2457634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610c3991906122f4565b6001600160a01b03168152602081019190915260400160002054610c5d9047612671565b9050610c7a610c746000546001600160a01b031690565b8261134d565b610dc9565b60066000858585818110610ca357634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610cb891906122f4565b6001600160a01b03166001600160a01b0316815260200190815260200160002054848484818110610cf957634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610d0e91906122f4565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a082319060240160206040518083038186803b158015610d4f57600080fd5b505afa158015610d63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d87919061257e565b610d919190612671565b9050610dc9610da86000546001600160a01b031690565b8286868681811061076457634e487b7160e01b600052603260045260246000fd5b5080610dd4816126b4565b915050610b9d565b505050565b6000816001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b158015610e1c57600080fd5b505afa158015610e30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e549190612310565b92915050565b60008054600160a01b900460ff1615610e9e5760405162461bcd60e51b815260206004820152600660248201526514185d5cd95960d21b604482015260640161018a565b6000610ead8a8a856001611b97565b90506000610eba89610de1565b90506000610f018c83858b8b8b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061175492505050565b9050610f0e8a8383611cde565b9350888411610f4f5760405162461bcd60e51b815260206004820152600d60248201526c4869676820536c69707061676560981b604482015260640161018a565b610f636001600160a01b038b163386611466565b604080513381526001600160a01b038c1660208201529081018590527f7f31d76771556dce5ab39ba5b60664743da2629a75c474e9445734b7ad34087d9060600160405180910390a150505098975050505050505050565b6000546001600160a01b03163314610fe55760405162461bcd60e51b815260040161018a906125e5565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b604051631b46cf8360e11b81526001600160a01b0383166004820152600090670de0b6b3a76400009083907304ce60ed10f6d2cff3aa015fc7b950d13c113be59063368d9f069060240160206040518083038186803b15801561109157600080fd5b505afa1580156110a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110c9919061257e565b6110d39190612652565b6110dd9190612632565b9392505050565b6000546001600160a01b0316331461110e5760405162461bcd60e51b815260040161018a906125e5565b8281146111545760405162461bcd60e51b8152602060048201526014602482015273092dcecc2d8d2c84092dce0eae840d8cadccee8d60631b604482015260640161018a565b60005b838110156112075782828281811061117f57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190611194919061252e565b600760008787858181106111b857634e487b7160e01b600052603260045260246000fd5b90506020020160208101906111cd91906122f4565b6001600160a01b031681526020810191909152604001600020805460ff1916911515919091179055806111ff816126b4565b915050611157565b5050505050565b6000546001600160a01b031633146112385760405162461bcd60e51b815260040161018a906125e5565b6001600160a01b03811661129d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161018a565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146113225760405162461bcd60e51b815260040161018a906125e5565b6001600160a01b03919091166000908152600160205260409020805460ff1916911515919091179055565b8047101561139d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015260640161018a565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146113ea576040519150601f19603f3d011682016040523d82523d6000602084013e6113ef565b606091505b5050905080610ddc5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d61792068617665207265766572746564000000000000606482015260840161018a565b6040516001600160a01b038316602482015260448101829052610ddc90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611da7565b60006114e06001600160a01b038416333085611e79565b50919050565b60006060600060088054905067ffffffffffffffff81111561151857634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015611541578160200160208202803683370190505b50905060005b6008548110156115cc5761158f6008828154811061157557634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b0316611eb1565b8282815181106115af57634e487b7160e01b600052603260045260246000fd5b6020908102919091010152806115c4816126b4565b915050611547565b506040516345985a8b60e11b8152600481018590526000906001600160a01b03871690638b30b51690602401602060405180830381600087803b15801561161257600080fd5b505af1158015611626573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061164a919061257e565b60085490915060009067ffffffffffffffff81111561167957634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156116a2578160200160208202803683370190505b50905060005b600854811015611745578381815181106116d257634e487b7160e01b600052603260045260246000fd5b60200260200101516116fe6008838154811061157557634e487b7160e01b600052603260045260246000fd5b6117089190612671565b82828151811061172857634e487b7160e01b600052603260045260246000fd5b60209081029190910101528061173d816126b4565b9150506116a8565b509093509150505b9250929050565b6000846001600160a01b0316866001600160a01b03161415611777575082611a63565b6001600160a01b0386161580156117aa57506001600160a01b03851673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2145b1561181f5773c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0856040518263ffffffff1660e01b81526004016000604051808303818588803b1580156117fe57600080fd5b505af1158015611812573d6000803e3d6000fd5b5050505050839050611a63565b6001600160a01b03861673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc214801561185257506001600160a01b038516155b156118c457604051632e1a7d4d60e01b81526004810185905273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc290632e1a7d4d90602401600060405180830381600087803b1580156118a457600080fd5b505af11580156118b8573d6000803e3d6000fd5b50505050839050611a63565b60006001600160a01b0387166118db5750836118e5565b6118e58785611f44565b60006118f087611eb1565b6001600160a01b03861660009081526007602052604090205490915060ff166119535760405162461bcd60e51b815260206004820152601560248201527415185c99d95d081b9bdd08105d5d1a1bdc9a5e9959605a1b604482015260640161018a565b6000856001600160a01b0316838660405161196e9190612596565b60006040518083038185875af1925050503d80600081146119ab576040519150601f19603f3d011682016040523d82523d6000602084013e6119b0565b606091505b50509050806119f95760405162461bcd60e51b81526020600482015260156024820152744572726f72205377617070696e6720546f6b656e7360581b604482015260640161018a565b81611a0389611eb1565b611a0d9190612671565b935060008411611a5f5760405162461bcd60e51b815260206004820152601f60248201527f5377617070656420546f20496e76616c696420496e7465726d65646961746500604482015260640161018a565b5050505b95945050505050565b3360009081526001602052604081205460ff16828015611a8a575080155b8015611a9857506000600254115b15611b8e5761271060025486611aae9190612652565b611ab89190612632565b6001600160a01b03851660009081526004602052604090205490925060ff1615611b8e576001600160a01b038616611b025773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee95505b6000606460035484611b149190612652565b611b1e9190612632565b6001600160a01b038087166000908152600560209081526040808320938c16835292905290812080549293508392909190611b5a90849061261a565b90915550506001600160a01b03871660009081526006602052604081208054839290611b8790849061261a565b9091555050505b50949350505050565b6000806001600160a01b038616611c1a5760003411611be65760405162461bcd60e51b815260206004820152600b60248201526a139bc8195d1a081cd95b9d60aa1b604482015260640161018a565b611c0673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee348686611a6c565b9050611c128134612671565b915050611cd6565b60008511611c615760405162461bcd60e51b8152602060048201526014602482015273125b9d985b1a59081d1bdad95b88185b5bdd5b9d60621b604482015260640161018a565b3415611ca55760405162461bcd60e51b815260206004820152601360248201527222ba341039b2b73a103bb4ba34103a37b5b2b760691b604482015260640161018a565b611cba6001600160a01b038716333088611e79565b611cc686868686611a6c565b9050611cd28186612671565b9150505b949350505050565b600080611cea85611eb1565b9050611cf7848685611fe9565b604051632befabbf60e01b81526004810184905260016024820152733ce37278de6388532c3949ce4e886f365b14fb5660448201526001600160a01b03861690632befabbf90606401602060405180830381600087803b158015611d5a57600080fd5b505af1158015611d6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d92919061257e565b5080611d9d86611eb1565b611a639190612671565b6000611dfc826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166120129092919063ffffffff16565b805190915015610ddc5780806020019051810190611e1a919061254a565b610ddc5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161018a565b6040516001600160a01b038085166024830152831660448201526064810182905261079b9085906323b872dd60e01b90608401611492565b60006001600160a01b038216611ec8575047919050565b6040516370a0823160e01b81523060048201526001600160a01b038316906370a082319060240160206040518083038186803b158015611f0757600080fd5b505afa158015611f1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e54919061257e565b919050565b604051636eb1769f60e11b81523060048201526001600160a01b038281166024830152839160009183169063dd62ed3e9060440160206040518083038186803b158015611f9057600080fd5b505afa158015611fa4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fc8919061257e565b1115611fd357505050565b610ddc6001600160a01b03821683600019612021565b611ffe6001600160a01b038416836000612021565b610ddc6001600160a01b0384168383612021565b6060611cd68484600085612145565b8015806120aa5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b15801561207057600080fd5b505afa158015612084573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120a8919061257e565b155b6121155760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b606482015260840161018a565b6040516001600160a01b038316602482015260448101829052610ddc90849063095ea7b360e01b90606401611492565b6060824710156121a65760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161018a565b843b6121f45760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161018a565b600080866001600160a01b031685876040516122109190612596565b60006040518083038185875af1925050503d806000811461224d576040519150601f19603f3d011682016040523d82523d6000602084013e612252565b606091505b509150915061226282828661226d565b979650505050505050565b6060831561227c5750816110dd565b82511561228c5782518084602001fd5b8160405162461bcd60e51b815260040161018a91906125b2565b8035611f3f816126e5565b60008083601f8401126122c2578182fd5b50813567ffffffffffffffff8111156122d9578182fd5b6020830191508360208260051b850101111561174d57600080fd5b600060208284031215612305578081fd5b81356110dd816126e5565b600060208284031215612321578081fd5b81516110dd816126e5565b6000806040838503121561233e578081fd5b8235612349816126e5565b91506020830135612359816126e5565b809150509250929050565b60008060408385031215612376578182fd5b8235612381816126e5565b91506020830135612359816126fd565b600080604083850312156123a3578182fd5b82356123ae816126e5565b946020939093013593505050565b60008060008060008060008060e0898b0312156123d7578384fd5b88356123e2816126e5565b97506020890135965060408901356123f9816126e5565b9550606089013594506080890135612410816126e5565b935060a089013567ffffffffffffffff8082111561242c578485fd5b818b0191508b601f83011261243f578485fd5b81358181111561244d578586fd5b8c602082850101111561245e578586fd5b60208301955080945050505061247660c08a016122a6565b90509295985092959890939650565b60008060208385031215612497578182fd5b823567ffffffffffffffff8111156124ad578283fd5b6124b9858286016122b1565b90969095509350505050565b600080600080604085870312156124da578384fd5b843567ffffffffffffffff808211156124f1578586fd5b6124fd888389016122b1565b90965094506020870135915080821115612515578384fd5b50612522878288016122b1565b95989497509550505050565b60006020828403121561253f578081fd5b81356110dd816126fd565b60006020828403121561255b578081fd5b81516110dd816126fd565b600060208284031215612577578081fd5b5035919050565b60006020828403121561258f578081fd5b5051919050565b600082516125a8818460208701612688565b9190910192915050565b60208152600082518060208401526125d1816040850160208701612688565b601f01601f19169190910160400192915050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000821982111561262d5761262d6126cf565b500190565b60008261264d57634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561266c5761266c6126cf565b500290565b600082821015612683576126836126cf565b500390565b60005b838110156126a357818101518382015260200161268b565b8381111561079b5750506000910152565b60006000198214156126c8576126c86126cf565b5060010190565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b03811681146126fa57600080fd5b50565b80151581146126fa57600080fdfea26469706673582212200c290e49083e3880ddbbfde4a4f62a727e419a63de2521be18de7312f36d543364736f6c6343000804003300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _goodwill (uint256): 0
Arg [1] : _affiliateSplit (uint256): 0

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000000


Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.