ETH Price: $1,980.37 (-4.57%)

Contract

0x676c0EB0d8d16aeabE1A99db07913B5Dffd89f0B
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

> 10 Token Transfers found.

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
EthereumZap

Compiler Version
v0.8.18+commit.87f61d96

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../../interfaces/external/IERC20Querier.sol";
import "../../interfaces/external/IWETH9.sol";
import "../../interfaces/IZap.sol";
import "../../interfaces/IZapEvent.sol";
import "../../interfaces/uniswapV3/ISwapRouter.sol";
import "../../libraries/constants/ZapConstants.sol";
import "../../libraries/constants/Constants.sol";
import "../../libraries/uniswapV3/TransferHelper.sol";
import "../../libraries/ParameterVerificationHelper.sol";
import "../../libraries/PoolHelper.sol";
import "./EthereumZapInitializer.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";

/// @dev verified, public contract
/// @dev ceratin functions only owner callable
contract EthereumZap is IZap, IZapEvent, Ownable, EthereumZapInitializer {
    using SafeMath for uint256;

    uint24 public override slippageToleranceNumerator;

    address public WETH;

    constructor(address _constants, uint24 _slippageToleranceNumerator) EthereumZapInitializer(_constants) {
        // initialize pre-defined swapPath and swapTradeFeeNumerator
        initializeSwapTradeFeeNumerator();
        initializeSwapPath();
        slippageToleranceNumerator = _slippageToleranceNumerator;
        WETH = Constants.WETH_ADDRESS();
    }

    function getSwapInfo(address inputToken, address outputToken)
        public
        view
        override
        returns (bool isPathDefined, address[] memory swapPathArray, uint24[] memory swapTradeFeeArray)
    {
        // parameter verification
        ParameterVerificationHelper.verifyNotZeroAddress(inputToken);
        ParameterVerificationHelper.verifyNotZeroAddress(outputToken);

        // verify inputToken is not outputToken
        require(inputToken != outputToken, "inputToken == outputToken");

        // get swapPath
        address[] memory _swapPathArray = swapPath[inputToken][outputToken];
        uint256 pathLength = _swapPathArray.length;

        if (pathLength >= 2) {
            // statement for "single swap path" & "multiple swap path"
            bool _isPathDefined = true;
            uint24[] memory _swapTradeFeeArray = new uint24[](pathLength - 1);

            for (uint256 i = 0; i < (pathLength - 1); i++) {
                uint24 tradeFee = swapTradeFeeNumerator[_swapPathArray[i]][_swapPathArray[i + 1]];
                if (tradeFee == 0) {
                    // path not defined if tradeFee is 0
                    _isPathDefined = false;
                }
                _swapTradeFeeArray[i] = tradeFee;
            }
            return (_isPathDefined, _swapPathArray, _swapTradeFeeArray);
        } else {
            // statement for "path is not defined"
            return (false, new address[](0), new uint24[](0));
        }
    }

    function setSlippageToleranceNumerator(uint24 slippageTolerance) public onlyOwner {
        // parameter verification
        ParameterVerificationHelper.verifyGreaterThanZero(slippageTolerance);

        // verify slippageTolerance is less than SLIPPAGE_TOLERANCE_DENOMINATOR
        require(slippageTolerance < ZapConstants.SLIPPAGE_TOLERANCE_DENOMINATOR, "slippageTolerance too big");

        // update slippageToleranceNumerator
        slippageToleranceNumerator = slippageTolerance;

        // emit UpdateSlippageTolerance event
        emit UpdateSlippageTolerance(slippageTolerance);
    }

    function setSwapTradeFeeNumerator(address inputToken, address outputToken, uint24 swapTradeFee) public onlyOwner {
        // parameter verification
        ParameterVerificationHelper.verifyNotZeroAddress(inputToken);
        ParameterVerificationHelper.verifyNotZeroAddress(outputToken);
        ParameterVerificationHelper.verifyGreaterThanZero(swapTradeFee);

        // verify inputToken is not outputToken
        require(inputToken != outputToken, "inputToken == outputToken");

        // verify pool is exist
        address poolAddress =
            PoolHelper.getPoolAddress(Constants.UNISWAP_V3_FACTORY_ADDRESS(), inputToken, outputToken, swapTradeFee);
        require(poolAddress != address(0), "pool not exist");

        // update swapTradeFeeNumerator
        swapTradeFeeNumerator[inputToken][outputToken] = swapTradeFee;

        // emit UpdateSwapTradeFee event
        emit UpdateSwapTradeFee(inputToken, outputToken, swapTradeFee);
    }

    function setSwapPath(address inputToken, address outputToken, address[] memory newSwapPath) public onlyOwner {
        // parameter verification
        ParameterVerificationHelper.verifyNotZeroAddress(inputToken);
        ParameterVerificationHelper.verifyNotZeroAddress(outputToken);
        uint256 pathLength = newSwapPath.length;
        for (uint256 i = 0; i < pathLength; i++) {
            ParameterVerificationHelper.verifyNotZeroAddress(newSwapPath[i]);
        }

        // verify inputToken is not outputToken
        require(inputToken != outputToken, "inputToken == outputToken");

        // verify input path is valid swap path
        require(pathLength >= 2, "path too short");

        // verify first token in newSwapPath is inputToken
        require(newSwapPath[0] == inputToken, "path not start from inputToken");

        // verify last token in newSwapPath is outputToken
        require(newSwapPath[(pathLength - 1)] == outputToken, "path not end with outputToken");

        // verify each swap’s fee is defined
        for (uint256 i = 0; i < (pathLength - 1); i++) {
            uint24 tradeFee = swapTradeFeeNumerator[newSwapPath[i]][newSwapPath[i + 1]];
            require(tradeFee != 0, "tradefee not defined");
        }

        // update Swap Path
        swapPath[inputToken][outputToken] = newSwapPath;

        // emit UpdateSwapPath event
        emit UpdateSwapPath(inputToken, outputToken, newSwapPath);
    }

    function getTokenExchangeRate(address inputToken, address outputToken)
        public
        view
        override
        returns (address token0, address token1, uint256 tokenPriceWith18Decimals)
    {
        // parameter verification
        ParameterVerificationHelper.verifyNotZeroAddress(inputToken);
        ParameterVerificationHelper.verifyNotZeroAddress(outputToken);

        // verify inputToken is not outputToken
        require(inputToken != outputToken, "inputToken == outputToken");

        // verify swap trade fee is defined
        uint24 tradeFee = swapTradeFeeNumerator[inputToken][outputToken];
        require(tradeFee != 0, "tradeFee not define");

        // verify pool is exist
        address poolAddress =
            PoolHelper.getPoolAddress(Constants.UNISWAP_V3_FACTORY_ADDRESS(), inputToken, outputToken, tradeFee);
        require(poolAddress != address(0), "pool not exist");

        // query pool info
        (token0, token1,,,,,) = PoolHelper.getPoolInfo(poolAddress);

        // calculate token price with 18 decimal precision
        tokenPriceWith18Decimals =
            PoolHelper.getTokenPriceWithDecimalsByPool(poolAddress, ZapConstants.DECIMALS_PRECISION);
    }

    function getMinimumSwapOutAmount(address inputToken, address outputToken, uint256 inputAmount)
        public
        view
        override
        returns (uint256 minimumSwapOutAmount)
    {
        uint256 estimateSwapOutAmount = getEstimateSwapOutAmount(inputToken, outputToken, inputAmount);

        // calculate price include slippage tolerance
        uint256 _minimumSwapOutAmount = estimateSwapOutAmount.mul(
            uint256(ZapConstants.SLIPPAGE_TOLERANCE_DENOMINATOR).sub(slippageToleranceNumerator)
        ).div(ZapConstants.SLIPPAGE_TOLERANCE_DENOMINATOR);

        minimumSwapOutAmount = _minimumSwapOutAmount;
    }

    function getEstimateSwapOutAmount(address inputToken, address outputToken, uint256 inputAmount)
        public
        view
        returns (uint256 estimateSwapOutAmount)
    {
        // parameter verification
        ParameterVerificationHelper.verifyNotZeroAddress(inputToken);
        ParameterVerificationHelper.verifyNotZeroAddress(outputToken);
        ParameterVerificationHelper.verifyGreaterThanZero(inputAmount);

        // variable verification
        require(slippageToleranceNumerator > 0, "slippageToleranceNumerator is 0");

        // verify inputToken is not outputToken
        require(inputToken != outputToken, "inputToken == outputToken");

        // verify swap info is defined
        (bool isPathDefined, address[] memory swapPathArray, uint24[] memory swapTradeFeeArray) =
            getSwapInfo(inputToken, outputToken);
        require(isPathDefined == true, "path not define");

        // get swap path length as loop end index
        uint256 pathLength = swapPathArray.length;

        // intput token decimal adjustment
        uint256 calcAmount = inputAmount.mul(10 ** (PoolHelper.getTokenDecimalAdjustment(inputToken)));
        // Loop calculate minimum swap out amount
        for (uint256 i = 0; i < (pathLength - 1); i++) {
            address tokenIn = swapPathArray[i];
            address tokenOut = swapPathArray[i + 1];
            (
                address token0,
                address token1,
                uint256 tokenPriceWith18Decimals // (token1/token0) * 10**DECIMALS_PRECISION
            ) = getTokenExchangeRate(tokenIn, tokenOut);

            // deduct trade fee
            calcAmount = calcAmount.mul(uint256(ZapConstants.SWAP_TRADE_FEE_DENOMINATOR).sub(swapTradeFeeArray[i])).div(
                ZapConstants.SWAP_TRADE_FEE_DENOMINATOR
            );

            // get swap out amount without slippage
            require(tokenIn == token0 || tokenIn == token1);
            if (tokenIn == token0) {
                calcAmount = calcAmount.mul(tokenPriceWith18Decimals).div(10 ** ZapConstants.DECIMALS_PRECISION);
            } else {
                calcAmount = calcAmount.mul(10 ** ZapConstants.DECIMALS_PRECISION).div(tokenPriceWith18Decimals);
            }
        }

        // output token decimal adjustment
        estimateSwapOutAmount = calcAmount.div(10 ** (PoolHelper.getTokenDecimalAdjustment(outputToken)));
    }

    /// @notice caller need to approve inputToken to Zap contract in inputAmount amount
    function swapToken(bool isETH, address inputToken, address outputToken, uint256 inputAmount, address recipient)
        public
        payable
        override
        returns (uint256 outputAmount)
    {
        //todo: need to verify the minimumSwapOutAmount number
        // get minimum swap out amount
        uint256 minimumSwapOutAmount = getMinimumSwapOutAmount(inputToken, outputToken, inputAmount);

        outputAmount =
            swapTokenWithMinimumOutput(isETH, inputToken, outputToken, inputAmount, minimumSwapOutAmount, recipient);
    }

    /// @notice caller need to approve inputToken to Zap contract in inputAmount amount
    function swapTokenWithMinimumOutput(
        bool isETH,
        address inputToken,
        address outputToken,
        uint256 inputAmount,
        uint256 minimumSwapOutAmount,
        address recipient
    ) public payable override returns (uint256 outputAmount) {
        // parameter verification
        ParameterVerificationHelper.verifyNotZeroAddress(inputToken);
        ParameterVerificationHelper.verifyNotZeroAddress(outputToken);
        ParameterVerificationHelper.verifyNotZeroAddress(recipient);
        ParameterVerificationHelper.verifyGreaterThanZero(inputAmount);
        // verify inputToken is not outputToken
        require(inputToken != outputToken, "inputToken == outputToken");

        // verify swap info is defined
        (bool isPathDefined, address[] memory swapPathArray, uint24[] memory swapTradeFeeArray) =
            getSwapInfo(inputToken, outputToken);

        require(isPathDefined == true, "path not define");

        if (isETH) {
            // verify input ETH is the same as inputAmount
            ParameterVerificationHelper.verifyMsgValueEqualsInputAmount(inputAmount);
            require(inputToken == WETH, "input ETH must have swap path from WETH");

            // prepare WETH for swap
            IWETH9(WETH).deposit{value: inputAmount}();
        } else {
            // verify caller inputToken allowance is more or equal to inputAmount
            require(
                IERC20Querier(inputToken).allowance(msg.sender, address(this)) >= inputAmount, "allowance insufficient"
            );

            // transfer inputToken in inputAmount from caller to Zap contract
            TransferHelper.safeTransferFrom(inputToken, msg.sender, address(this), inputAmount);
        }

        // approve inputToken to SmartRouter in inputAmount amount
        TransferHelper.safeApprove(inputToken, Constants.SWAP_ROUTER_ADDRESS(), inputAmount);

        uint256 pathLength = swapPathArray.length;
        if (pathLength == 2) {
            // statement for "single swap path", swap by exactInputSingle function
            outputAmount = ISwapRouter(Constants.SWAP_ROUTER_ADDRESS()).exactInputSingle(
                ISwapRouter.ExactInputSingleParams(
                    inputToken, outputToken, swapTradeFeeArray[0], recipient, inputAmount, minimumSwapOutAmount, 0
                )
            );
            // emit SingleSwap event
            emit SingleSwap(
                recipient, isETH, inputToken, inputAmount, outputToken, outputAmount, swapPathArray, swapTradeFeeArray
            );
        } else {
            // statement for "multiple swap path", swap by exactInput function
            bytes memory path = abi.encodePacked(swapPathArray[0]);
            for (uint256 i = 0; i < (pathLength - 1); i++) {
                path = abi.encodePacked(path, swapTradeFeeArray[i], swapPathArray[i + 1]);
            }

            outputAmount = ISwapRouter(Constants.SWAP_ROUTER_ADDRESS()).exactInput(
                ISwapRouter.ExactInputParams(path, recipient, inputAmount, minimumSwapOutAmount)
            );
            // emit MultiSwap event
            emit MultiSwap(
                recipient, isETH, inputToken, inputAmount, outputToken, outputAmount, swapPathArray, swapTradeFeeArray
            );
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

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() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(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");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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);

    /**
     * @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 `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, 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 `from` to `to` 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 from, address to, uint256 amount) external returns (bool);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

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) {
        return msg.data;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/SafeMath.sol)

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        unchecked {
            require(b <= a, errorMessage);
            return a - b;
        }
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a / b;
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface IERC20Querier is IERC20 {
    function decimals() external view returns (uint256);

    function name() external view returns (string memory);

    function symbol() external view returns (string memory);
}

// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;

/// @title Interface for WETH9
import "./IERC20Querier.sol";

interface IWETH9 is IERC20Querier {
    /// @notice Deposit ether to get wrapped ether
    function deposit() external payable;

    /// @notice Withdraw wrapped ether to get ether
    function withdraw(uint256 amount) external;
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

interface IConstants {
    /// @dev Uniswap v3 Related
    function UNISWAP_V3_FACTORY_ADDRESS() external view returns (address);
    function NONFUNGIBLE_POSITION_MANAGER_ADDRESS() external view returns (address);
    function SWAP_ROUTER_ADDRESS() external view returns (address);

    /// @dev Distribute reward token address
    function DISTRIBUTE_REWARD_ADDRESS() external view returns (address);

    /// @dev Token address (combine each chain)
    function WETH_ADDRESS() external view returns (address);
    function WBTC_ADDRESS() external view returns (address);
    function ARB_ADDRESS() external view returns (address);
    function USDC_ADDRESS() external view returns (address);
    function USDCE_ADDRESS() external view returns (address);
    function USDT_ADDRESS() external view returns (address);
    function RDNT_ADDRESS() external view returns (address);
    function LINK_ADDRESS() external view returns (address);
    function DEGEN_ADDRESS() external view returns (address);
    function BRETT_ADDRESS() external view returns (address);
    function TOSHI_ADDRESS() external view returns (address);
    function CIRCLE_ADDRESS() external view returns (address);
    function ROOST_ADDRESS() external view returns (address);
    function AERO_ADDRESS() external view returns (address);
    function INT_ADDRESS() external view returns (address);
    function HIGHER_ADDRESS() external view returns (address);
    function KEYCAT_ADDRESS() external view returns (address);

    /// @dev Black hole address
    function BLACK_HOLE_ADDRESS() external view returns (address);
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

interface IZap {
    /// @dev get zap data
    function slippageToleranceNumerator() external view returns (uint24);

    function getSwapInfo(address inputToken, address outputToken)
        external
        view
        returns (bool isPathDefined, address[] memory swapPathArray, uint24[] memory swapTradeFeeArray);

    function getTokenExchangeRate(address inputToken, address outputToken)
        external
        view
        returns (address token0, address token1, uint256 tokenPriceWith18Decimals);

    function getMinimumSwapOutAmount(address inputToken, address outputToken, uint256 inputAmount)
        external
        view
        returns (uint256 minimumSwapOutAmount);

    /// @dev swapToken
    function swapToken(bool isETH, address inputToken, address outputToken, uint256 inputAmount, address recipient)
        external
        payable
        returns (uint256 outputAmount);

    function swapTokenWithMinimumOutput(
        bool isETH,
        address inputToken,
        address outputToken,
        uint256 inputAmount,
        uint256 minimumSwapOutAmount,
        address recipient
    ) external payable returns (uint256 outputAmount);
}

File 10 of 19 : IZapEvent.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

interface IZapEvent {
    event UpdateSlippageTolerance(uint24 slippageTolerance);

    event UpdateSwapTradeFee(
        address indexed inputToken,
        address indexed outputToken,
        uint24 swapTradeFee
    );

    event UpdateSwapPath(
        address indexed inputToken,
        address indexed outputToken,
        address[] newSwapPath
    );

    event SingleSwap(
        address indexed recipient,
        bool isETH,
        address inputToken,
        uint256 inputAmount,
        address outputToken,
        uint256 outputAmount,
        address[] swapPath,
        uint24[] swapTradeFee
    );

    event MultiSwap(
        address indexed recipient,
        bool isETH,
        address inputToken,
        uint256 inputAmount,
        address outputToken,
        uint256 outputAmount,
        address[] swapPath,
        uint24[] swapTradeFee
    );
}

// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.7.5;
pragma abicoder v2;

interface ISwapRouter {
    struct ExactInputSingleParams {
        address tokenIn;
        address tokenOut;
        uint24 fee;
        address recipient;
        // uint256 deadline;
        uint256 amountIn;
        uint256 amountOutMinimum;
        uint160 sqrtPriceLimitX96;
    }

    /// @notice Swaps `amountIn` of one token for as much as possible of another token
    /// @param params The parameters necessary for the swap, encoded as `ExactInputSingleParams` in calldata
    /// @return amountOut The amount of the received token
    function exactInputSingle(ExactInputSingleParams calldata params) external payable returns (uint256 amountOut);

    struct ExactInputParams {
        bytes path;
        address recipient;
        // uint256 deadline;
        uint256 amountIn;
        uint256 amountOutMinimum;
    }

    /// @notice Swaps `amountIn` of one token for as much as possible of another along the specified path
    /// @param params The parameters necessary for the multi-hop swap, encoded as `ExactInputParams` in calldata
    /// @return amountOut The amount of the received token
    function exactInput(ExactInputParams calldata params) external payable returns (uint256 amountOut);
}

File 12 of 19 : IUniswapV3Factory.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

interface IUniswapV3Factory {
    /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist
    /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order
    /// @param tokenA The contract address of either token0 or token1
    /// @param tokenB The contract address of the other token
    /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip
    /// @return pool The pool address
    function getPool(
        address tokenA,
        address tokenB,
        uint24 fee
    ) external view returns (address pool);
}

// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

interface IUniswapV3Pool {
    /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas
    /// when accessed externally.
    /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value
    /// tick The current tick of the pool, i.e. according to the last tick transition that was run.
    /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick
    /// boundary.
    /// observationIndex The index of the last oracle observation that was written,
    /// observationCardinality The current maximum number of observations stored in the pool,
    /// observationCardinalityNext The next maximum number of observations, to be updated when the observation.
    /// feeProtocol The protocol fee for both tokens of the pool.
    /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0
    /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.
    /// unlocked Whether the pool is currently locked to reentrancy
    function slot0()
        external
        view
        returns (
            uint160 sqrtPriceX96,
            int24 tick,
            uint16 observationIndex,
            uint16 observationCardinality,
            uint16 observationCardinalityNext,
            uint8 feeProtocol,
            bool unlocked
        );

    /// @notice The first of the two tokens of the pool, sorted by address
    /// @return The token contract address
    function token0() external view returns (address);

    /// @notice The second of the two tokens of the pool, sorted by address
    /// @return The token contract address
    function token1() external view returns (address);

    /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6
    /// @return The fee
    function fee() external view returns (uint24);

    /// @notice The pool tick spacing
    /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive
    /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...
    /// This value is an int24 to avoid casting even though it is always positive.
    /// @return The tick spacing
    function tickSpacing() external view returns (int24);
}

File 14 of 19 : Constants.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

library Constants {
    /// @dev Base uniswap V3
    address public constant UNISWAP_V3_FACTORY_ADDRESS = address(0x33128a8fC17869897dcE68Ed026d694621f6FDfD);
    address public constant NONFUNGIBLE_POSITION_MANAGER_ADDRESS = address(0x03a520b32C04BF3bEEf7BEb72E919cf822Ed34f1);
    address public constant SWAP_ROUTER_ADDRESS = address(0x2626664c2603336E57B271c5C0b26F421741e481); //swap router v2

    /// @dev Base token address
    address public constant WETH_ADDRESS = address(0x4200000000000000000000000000000000000006);
    address public constant USDC_ADDRESS = address(0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913);
    address public constant DEGEN_ADDRESS = address(0x4ed4E862860beD51a9570b96d89aF5E1B0Efefed);
    address public constant BRETT_ADDRESS = address(0x532f27101965dd16442E59d40670FaF5eBB142E4);
    address public constant TOSHI_ADDRESS = address(0xAC1Bd2486aAf3B5C0fc3Fd868558b082a531B2B4);
    address public constant CIRCLE_ADDRESS = address(0x5baBfc2F240bc5De90Eb7e19D789412dB1dEc402);
    address public constant ROOST_ADDRESS = address(0xE1aBD004250AC8D1F199421d647e01d094FAa180);
    address public constant AERO_ADDRESS = address(0x940181a94A35A4569E4529A3CDfB74e38FD98631);
    address public constant INT_ADDRESS = address(0x968D6A288d7B024D5012c0B25d67A889E4E3eC19);
    address public constant HIGHER_ADDRESS = address(0x0578d8A44db98B23BF096A382e016e29a5Ce0ffe);
    address public constant KEYCAT_ADDRESS = address(0x9a26F5433671751C3276a065f57e5a02D2817973);

    /// @dev black hole address
    address public constant BLACK_HOLE_ADDRESS = address(0x000000000000000000000000000000000000dEaD);
}

File 15 of 19 : ZapConstants.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

library ZapConstants {
    /// @dev decimal precision
    uint256 public constant DECIMALS_PRECISION = 18;

    /// @dev denominator
    uint24 public constant SLIPPAGE_TOLERANCE_DENOMINATOR = 1000000;
    uint24 public constant SWAP_TRADE_FEE_DENOMINATOR = 1000000;
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

library ParameterVerificationHelper {
    function verifyNotZeroAddress(address inputAddress) internal pure {
        require(inputAddress != address(0), "input zero address");
    }

    function verifyGreaterThanZero(uint256 inputNumber) internal pure {
        require(inputNumber > 0, "input 0");
    }

    function verifyGreaterThanZero(int24 inputNumber) internal pure {
        require(inputNumber > 0, "input 0");
    }

    function verifyGreaterThanOne(int24 inputNumber) internal pure {
        require(inputNumber > 1, "input <= 1");
    }

    function verifyGreaterThanOrEqualToZero(int24 inputNumber) internal pure {
        require(inputNumber >= 0, "input less than 0");
    }

    function verifyPairTokensHaveWeth(
        address token0Address,
        address token1Address,
        address wethAddress
    ) internal pure {
        require(
            token0Address == wethAddress || token1Address == wethAddress,
            "pair token not have WETH"
        );
    }

    function verifyMsgValueEqualsInputAmount(
        uint256 inputAmount
    ) internal view {
        require(msg.value == inputAmount, "msg.value != inputAmount");
    }

    function verifyPairTokensHaveInputToken(
        address token0Address,
        address token1Address,
        address inputToken
    ) internal pure {
        require(
            token0Address == inputToken || token1Address == inputToken,
            "pair token not have inputToken"
        );
    }
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../interfaces/external/IERC20Querier.sol";
import "../interfaces/uniswapV3/IUniswapV3Factory.sol";
import "../interfaces/uniswapV3/IUniswapV3Pool.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";

library PoolHelper {
    using SafeMath for uint256;

    function getPoolAddress(address uniswapV3FactoryAddress, address tokenA, address tokenB, uint24 poolFee)
        internal
        view
        returns (address poolAddress)
    {
        return IUniswapV3Factory(uniswapV3FactoryAddress).getPool(tokenA, tokenB, poolFee);
    }

    function getPoolInfo(address poolAddress)
        internal
        view
        returns (
            address token0,
            address token1,
            uint24 poolFee,
            int24 tick,
            uint160 sqrtPriceX96,
            uint256 decimal0,
            uint256 decimal1
        )
    {
        (sqrtPriceX96, tick,,,,,) = IUniswapV3Pool(poolAddress).slot0();
        token0 = IUniswapV3Pool(poolAddress).token0();
        token1 = IUniswapV3Pool(poolAddress).token1();
        poolFee = IUniswapV3Pool(poolAddress).fee();
        decimal0 = IERC20Querier(token0).decimals();
        decimal1 = IERC20Querier(token1).decimals();
    }

    /// @dev formula explanation
    /*
    [Original formula (without decimal precision)]
    (token1 * (10^decimal1)) / (token0 * (10^decimal0)) = (sqrtPriceX96 / (2^96))^2   
    tokenPrice = token1/token0 = (sqrtPriceX96 / (2^96))^2 * (10^decimal0) / (10^decimal1)

    [Formula with decimal precision & decimal adjustment]
    tokenPriceWithDecimalAdj = tokenPrice * (10^decimalPrecision)
        = (sqrtPriceX96 * (10^decimalPrecision) / (2^96))^2 
            / 10^(decimalPrecision + decimal1 - decimal0)
    */
    function getTokenPriceWithDecimalsByPool(address poolAddress, uint256 decimalPrecision)
        internal
        view
        returns (uint256 tokenPriceWithDecimals)
    {
        (,,,, uint160 sqrtPriceX96, uint256 decimal0, uint256 decimal1) = getPoolInfo(poolAddress);

        // when decimalPrecision is 18,
        // calculation restriction: 79228162514264337594 <= sqrtPriceX96 <= type(uint160).max
        uint256 scaledPriceX96 = uint256(sqrtPriceX96).mul(10 ** decimalPrecision).div(2 ** 96);
        uint256 tokenPriceWithoutDecimalAdj = scaledPriceX96.mul(scaledPriceX96);
        uint256 decimalAdj = decimalPrecision.add(decimal1).sub(decimal0);
        uint256 result = tokenPriceWithoutDecimalAdj.div(10 ** decimalAdj);
        require(result > 0, "token price too small");
        tokenPriceWithDecimals = result;
    }

    function getTokenDecimalAdjustment(address token) internal view returns (uint256 decimalAdjustment) {
        uint256 tokenDecimalStandard = 18;
        uint256 decimal = IERC20Querier(token).decimals();
        return tokenDecimalStandard.sub(decimal);
    }
}

// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.6.0;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

library TransferHelper {
    /// @notice Transfers tokens from the targeted address to the given destination
    /// @notice Errors with 'STF' if transfer fails
    /// @param token The contract address of the token to be transferred
    /// @param from The originating address from which the tokens will be transferred
    /// @param to The destination address of the transfer
    /// @param value The amount to be transferred
    function safeTransferFrom(address token, address from, address to, uint256 value) internal {
        (bool success, bytes memory data) =
            token.call(abi.encodeWithSelector(IERC20.transferFrom.selector, from, to, value));

        require(success && (data.length == 0 || abi.decode(data, (bool))), "STF");
    }

    /// @notice Transfers tokens from msg.sender to a recipient
    /// @dev Errors with ST if transfer fails
    /// @param token The contract address of the token which will be transferred
    /// @param to The recipient of the transfer
    /// @param value The value of the transfer
    function safeTransfer(address token, address to, uint256 value) internal {
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.transfer.selector, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), "ST");
    }

    /// @notice Approves the stipulated contract to spend the given allowance in the given token
    /// @dev Errors with 'SA' if transfer fails
    /// @param token The contract address of the token to be approved
    /// @param to The target of the approval
    /// @param value The amount of the given token the target will be allowed to spend
    function safeApprove(address token, address to, uint256 value) internal {
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.approve.selector, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), "SA");
    }

    /// @notice Transfers ETH to the recipient address
    /// @dev Fails with `STE`
    /// @param to The destination of the transfer
    /// @param value The value to be transferred
    function safeTransferETH(address to, uint256 value) internal {
        (bool success,) = to.call{value: value}(new bytes(0));
        require(success, "STE");
    }
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

// import "./libraries/constants/Constants.sol";
import "../../interfaces/IConstants.sol";

contract EthereumZapInitializer {
    IConstants public Constants;

    /// @dev Uniswap-Transaction-related Variable
    uint256 public transactionDeadlineDuration = 300;

    // inputToken => outputToken => swapPath
    mapping(address => mapping(address => address[])) internal swapPath;

    // inputToken => outputToken => swapTradeFeeNumerator
    mapping(address => mapping(address => uint24)) internal swapTradeFeeNumerator;

    constructor(address _constants) {
        Constants = IConstants(_constants);
    }

    function initializeSwapTradeFeeNumerator() internal {
        address WETH = Constants.WETH_ADDRESS();
        address ARB = Constants.ARB_ADDRESS();
        address WBTC = Constants.WBTC_ADDRESS();
        address USDC = Constants.USDC_ADDRESS();
        address USDT = Constants.USDT_ADDRESS();
        address RDNT = Constants.RDNT_ADDRESS();
        address LINK = Constants.LINK_ADDRESS();

        /// @dev Ethereum mainnet initialization trade fee 0.01%
        swapTradeFeeNumerator[USDC][USDT] = 100;
        swapTradeFeeNumerator[USDT][USDC] = 100;

        /// @dev Ethereum mainnet initialization trade fee 0.05%
        swapTradeFeeNumerator[WETH][ARB] = 500;
        swapTradeFeeNumerator[WETH][WBTC] = 500;
        swapTradeFeeNumerator[WETH][USDC] = 500;
        swapTradeFeeNumerator[WETH][USDT] = 500;
        swapTradeFeeNumerator[ARB][WETH] = 500;
        swapTradeFeeNumerator[WBTC][WETH] = 500;
        swapTradeFeeNumerator[USDC][ARB] = 500;
        swapTradeFeeNumerator[USDC][WETH] = 500;
        swapTradeFeeNumerator[USDC][WBTC] = 500;
        swapTradeFeeNumerator[USDT][WETH] = 500;

        /// @dev Ethereum mainnet initialization trade fee 0.30%
        swapTradeFeeNumerator[WETH][RDNT] = 3000;
        swapTradeFeeNumerator[WETH][LINK] = 3000;
        swapTradeFeeNumerator[RDNT][WETH] = 3000;
        swapTradeFeeNumerator[LINK][WETH] = 3000;
    }

    function initializeSwapPath() internal {
        address WETH = Constants.WETH_ADDRESS();
        address ARB = Constants.ARB_ADDRESS();
        address WBTC = Constants.WBTC_ADDRESS();
        address USDC = Constants.USDC_ADDRESS();
        address USDT = Constants.USDT_ADDRESS();
        address RDNT = Constants.RDNT_ADDRESS();
        address LINK = Constants.LINK_ADDRESS();

        /// @dev Ethereum mainnet initialization single swap
        // trade fee 0.01%
        swapPath[USDC][USDT] = [USDC, USDT];
        swapPath[USDT][USDC] = [USDT, USDC];

        /// @dev Ethereum mainnet initialization single swap
        // trade fee 0.05%
        swapPath[WETH][ARB] = [WETH, ARB];
        swapPath[WETH][WBTC] = [WETH, WBTC];
        swapPath[WETH][USDC] = [WETH, USDC];
        swapPath[WETH][USDT] = [WETH, USDT];
        swapPath[ARB][WETH] = [ARB, WETH];
        swapPath[WBTC][WETH] = [WBTC, WETH];
        swapPath[USDT][WETH] = [USDT, WETH];

        /// @dev Ethereum mainnet initialization single swap
        // trade fee 0.30%
        swapPath[WETH][RDNT] = [WETH, RDNT];
        swapPath[WETH][LINK] = [WETH, LINK];
        swapPath[RDNT][WETH] = [RDNT, WETH];
        swapPath[LINK][WETH] = [LINK, WETH];

        /// @dev Ethereum mainnet initialization multi swap
        swapPath[ARB][WBTC] = [ARB, WETH, WBTC];
        swapPath[ARB][USDC] = [ARB, WETH, USDC];
        swapPath[ARB][USDT] = [ARB, WETH, USDT];
        swapPath[ARB][RDNT] = [ARB, WETH, RDNT];
        swapPath[ARB][LINK] = [ARB, WETH, LINK];

        swapPath[WBTC][ARB] = [WBTC, WETH, ARB];
        swapPath[WBTC][USDC] = [WBTC, WETH, USDC];
        swapPath[WBTC][USDT] = [WBTC, WETH, USDT];
        swapPath[WBTC][RDNT] = [WBTC, WETH, RDNT];
        swapPath[WBTC][LINK] = [WBTC, WETH, LINK];

        swapPath[USDC][ARB] = [USDC, ARB];
        swapPath[USDC][WETH] = [USDC, WETH];
        swapPath[USDC][WBTC] = [USDC, WBTC];
        swapPath[USDC][RDNT] = [USDC, WETH, RDNT];
        swapPath[USDC][LINK] = [USDC, WETH, LINK];

        swapPath[USDT][ARB] = [USDT, ARB];
        swapPath[USDT][WBTC] = [USDT, WBTC];
        swapPath[USDT][RDNT] = [USDT, WETH, RDNT];
        swapPath[USDT][LINK] = [USDT, WETH, LINK];

        swapPath[RDNT][ARB] = [RDNT, WETH, ARB];
        swapPath[RDNT][WBTC] = [RDNT, WETH, WBTC];
        swapPath[RDNT][USDC] = [RDNT, WETH, USDC];
        swapPath[RDNT][USDT] = [RDNT, WETH, USDT];
        swapPath[RDNT][LINK] = [RDNT, WETH, LINK];

        swapPath[LINK][ARB] = [LINK, WETH, ARB];
        swapPath[LINK][WBTC] = [LINK, WETH, WBTC];
        swapPath[LINK][USDC] = [LINK, WETH, USDC];
        swapPath[LINK][USDT] = [LINK, WETH, USDT];
        swapPath[LINK][RDNT] = [LINK, WETH, RDNT];
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_constants","type":"address"},{"internalType":"uint24","name":"_slippageToleranceNumerator","type":"uint24"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"bool","name":"isETH","type":"bool"},{"indexed":false,"internalType":"address","name":"inputToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"inputAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"outputToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"outputAmount","type":"uint256"},{"indexed":false,"internalType":"address[]","name":"swapPath","type":"address[]"},{"indexed":false,"internalType":"uint24[]","name":"swapTradeFee","type":"uint24[]"}],"name":"MultiSwap","type":"event"},{"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":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"bool","name":"isETH","type":"bool"},{"indexed":false,"internalType":"address","name":"inputToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"inputAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"outputToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"outputAmount","type":"uint256"},{"indexed":false,"internalType":"address[]","name":"swapPath","type":"address[]"},{"indexed":false,"internalType":"uint24[]","name":"swapTradeFee","type":"uint24[]"}],"name":"SingleSwap","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint24","name":"slippageTolerance","type":"uint24"}],"name":"UpdateSlippageTolerance","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"inputToken","type":"address"},{"indexed":true,"internalType":"address","name":"outputToken","type":"address"},{"indexed":false,"internalType":"address[]","name":"newSwapPath","type":"address[]"}],"name":"UpdateSwapPath","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"inputToken","type":"address"},{"indexed":true,"internalType":"address","name":"outputToken","type":"address"},{"indexed":false,"internalType":"uint24","name":"swapTradeFee","type":"uint24"}],"name":"UpdateSwapTradeFee","type":"event"},{"inputs":[],"name":"Constants","outputs":[{"internalType":"contract IConstants","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"inputToken","type":"address"},{"internalType":"address","name":"outputToken","type":"address"},{"internalType":"uint256","name":"inputAmount","type":"uint256"}],"name":"getEstimateSwapOutAmount","outputs":[{"internalType":"uint256","name":"estimateSwapOutAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"inputToken","type":"address"},{"internalType":"address","name":"outputToken","type":"address"},{"internalType":"uint256","name":"inputAmount","type":"uint256"}],"name":"getMinimumSwapOutAmount","outputs":[{"internalType":"uint256","name":"minimumSwapOutAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"inputToken","type":"address"},{"internalType":"address","name":"outputToken","type":"address"}],"name":"getSwapInfo","outputs":[{"internalType":"bool","name":"isPathDefined","type":"bool"},{"internalType":"address[]","name":"swapPathArray","type":"address[]"},{"internalType":"uint24[]","name":"swapTradeFeeArray","type":"uint24[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"inputToken","type":"address"},{"internalType":"address","name":"outputToken","type":"address"}],"name":"getTokenExchangeRate","outputs":[{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"uint256","name":"tokenPriceWith18Decimals","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint24","name":"slippageTolerance","type":"uint24"}],"name":"setSlippageToleranceNumerator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"inputToken","type":"address"},{"internalType":"address","name":"outputToken","type":"address"},{"internalType":"address[]","name":"newSwapPath","type":"address[]"}],"name":"setSwapPath","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"inputToken","type":"address"},{"internalType":"address","name":"outputToken","type":"address"},{"internalType":"uint24","name":"swapTradeFee","type":"uint24"}],"name":"setSwapTradeFeeNumerator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"slippageToleranceNumerator","outputs":[{"internalType":"uint24","name":"","type":"uint24"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"isETH","type":"bool"},{"internalType":"address","name":"inputToken","type":"address"},{"internalType":"address","name":"outputToken","type":"address"},{"internalType":"uint256","name":"inputAmount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"swapToken","outputs":[{"internalType":"uint256","name":"outputAmount","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bool","name":"isETH","type":"bool"},{"internalType":"address","name":"inputToken","type":"address"},{"internalType":"address","name":"outputToken","type":"address"},{"internalType":"uint256","name":"inputAmount","type":"uint256"},{"internalType":"uint256","name":"minimumSwapOutAmount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"swapTokenWithMinimumOutput","outputs":[{"internalType":"uint256","name":"outputAmount","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"transactionDeadlineDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405261012c6002553480156200001757600080fd5b5060405162004510380380620045108339810160408190526200003a9162001be2565b8162000046336200012c565b600180546001600160a01b0319166001600160a01b0392909216919091179055620000706200017c565b6200007a62000b5a565b6005805462ffffff191662ffffff83161790556001546040805163040141e560e01b815290516001600160a01b039092169163040141e5916004808201926020929091908290030181865afa158015620000d8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000fe919062001c25565b600560036101000a8154816001600160a01b0302191690836001600160a01b03160217905550505062001c4a565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001546040805163040141e560e01b815290516000926001600160a01b03169163040141e59160048083019260209291908290030181865afa158015620001c7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001ed919062001c25565b90506000600160009054906101000a90046001600160a01b03166001600160a01b031663fc3766296040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000245573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200026b919062001c25565b90506000600160009054906101000a90046001600160a01b03166001600160a01b031663bdd5915f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015620002c3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620002e9919062001c25565b90506000600160009054906101000a90046001600160a01b03166001600160a01b031663bb09d9b76040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000341573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000367919062001c25565b90506000600160009054906101000a90046001600160a01b03166001600160a01b031663c18920586040518163ffffffff1660e01b8152600401602060405180830381865afa158015620003bf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620003e5919062001c25565b90506000600160009054906101000a90046001600160a01b03166001600160a01b0316637cbd8b706040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200043d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000463919062001c25565b90506000600160009054906101000a90046001600160a01b03166001600160a01b031663ed08d8eb6040518163ffffffff1660e01b8152600401602060405180830381865afa158015620004bb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620004e1919062001c25565b9050606460046000866001600160a01b03166001600160a01b031681526020019081526020016000206000856001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548162ffffff021916908362ffffff160217905550606460046000856001600160a01b03166001600160a01b031681526020019081526020016000206000866001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548162ffffff021916908362ffffff1602179055506101f460046000896001600160a01b03166001600160a01b031681526020019081526020016000206000886001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548162ffffff021916908362ffffff1602179055506101f460046000896001600160a01b03166001600160a01b031681526020019081526020016000206000876001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548162ffffff021916908362ffffff1602179055506101f460046000896001600160a01b03166001600160a01b031681526020019081526020016000206000866001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548162ffffff021916908362ffffff1602179055506101f460046000896001600160a01b03166001600160a01b031681526020019081526020016000206000856001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548162ffffff021916908362ffffff1602179055506101f460046000886001600160a01b03166001600160a01b031681526020019081526020016000206000896001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548162ffffff021916908362ffffff1602179055506101f460046000876001600160a01b03166001600160a01b031681526020019081526020016000206000896001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548162ffffff021916908362ffffff1602179055506101f460046000866001600160a01b03166001600160a01b031681526020019081526020016000206000886001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548162ffffff021916908362ffffff1602179055506101f460046000866001600160a01b03166001600160a01b031681526020019081526020016000206000896001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548162ffffff021916908362ffffff1602179055506101f460046000866001600160a01b03166001600160a01b031681526020019081526020016000206000876001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548162ffffff021916908362ffffff1602179055506101f460046000856001600160a01b03166001600160a01b031681526020019081526020016000206000896001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548162ffffff021916908362ffffff160217905550610bb860046000896001600160a01b03166001600160a01b031681526020019081526020016000206000846001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548162ffffff021916908362ffffff160217905550610bb860046000896001600160a01b03166001600160a01b031681526020019081526020016000206000836001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548162ffffff021916908362ffffff160217905550610bb860046000846001600160a01b03166001600160a01b031681526020019081526020016000206000896001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548162ffffff021916908362ffffff160217905550610bb860046000836001600160a01b03166001600160a01b031681526020019081526020016000206000896001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548162ffffff021916908362ffffff16021790555050505050505050565b6001546040805163040141e560e01b815290516000926001600160a01b03169163040141e59160048083019260209291908290030181865afa15801562000ba5573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000bcb919062001c25565b90506000600160009054906101000a90046001600160a01b03166001600160a01b031663fc3766296040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000c23573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000c49919062001c25565b90506000600160009054906101000a90046001600160a01b03166001600160a01b031663bdd5915f6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000ca1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000cc7919062001c25565b90506000600160009054906101000a90046001600160a01b03166001600160a01b031663bb09d9b76040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000d1f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000d45919062001c25565b90506000600160009054906101000a90046001600160a01b03166001600160a01b031663c18920586040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000d9d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000dc3919062001c25565b90506000600160009054906101000a90046001600160a01b03166001600160a01b0316637cbd8b706040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000e1b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000e41919062001c25565b90506000600160009054906101000a90046001600160a01b03166001600160a01b031663ed08d8eb6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000e99573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000ebf919062001c25565b6040805180820182526001600160a01b038088168083529087166020808401829052600092835260038152848320918352529190912091925062000f069190600262001b44565b506040805180820182526001600160a01b038086168083529087166020808401829052600092835260038152848320918352529190912062000f4a91600262001b44565b506040805180820182526001600160a01b03808a168083529089166020808401829052600092835260038152848320918352529190912062000f8e91600262001b44565b506040805180820182526001600160a01b03808a168083529088166020808401829052600092835260038152848320918352529190912062000fd291600262001b44565b506040805180820182526001600160a01b03808a16808352908716602080840182905260009283526003815284832091835252919091206200101691600262001b44565b506040805180820182526001600160a01b03808a16808352908616602080840182905260009283526003815284832091835252919091206200105a91600262001b44565b506040805180820182526001600160a01b03808916808352908a16602080840182905260009283526003815284832091835252919091206200109e91600262001b44565b506040805180820182526001600160a01b03808816808352908a1660208084018290526000928352600381528483209183525291909120620010e291600262001b44565b506040805180820182526001600160a01b03808616808352908a16602080840182905260009283526003815284832091835252919091206200112691600262001b44565b506040805180820182526001600160a01b03808a16808352908516602080840182905260009283526003815284832091835252919091206200116a91600262001b44565b506040805180820182526001600160a01b03808a1680835290841660208084018290526000928352600381528483209183525291909120620011ae91600262001b44565b506040805180820182526001600160a01b03808516808352908a1660208084018290526000928352600381528483209183525291909120620011f291600262001b44565b506040805180820182526001600160a01b03808416808352908a16602080840182905260009283526003815284832091835252919091206200123691600262001b44565b50604080516060810182526001600160a01b038089168083528a821660208085019190915291891683850181905260009182526003808452858320918352925292909220620012889290919062001b44565b50604080516060810182526001600160a01b038089168083528a821660208085019190915291881683850181905260009182526003808452858320918352925292909220620012da9290919062001b44565b50604080516060810182526001600160a01b038089168083528a8216602080850191909152918716838501819052600091825260038084528583209183529252929092206200132c9290919062001b44565b50604080516060810182526001600160a01b038089168083528a8216602080850191909152918616838501819052600091825260038084528583209183529252929092206200137e9290919062001b44565b50604080516060810182526001600160a01b038089168083528a821660208085019190915291851683850181905260009182526003808452858320918352925292909220620013d09290919062001b44565b50604080516060810182526001600160a01b038088168083528a8216602080850191909152918a1683850181905260009182526003808452858320918352925292909220620014229290919062001b44565b50604080516060810182526001600160a01b038088168083528a821660208085019190915291881683850181905260009182526003808452858320918352925292909220620014749290919062001b44565b50604080516060810182526001600160a01b038088168083528a821660208085019190915291871683850181905260009182526003808452858320918352925292909220620014c69290919062001b44565b50604080516060810182526001600160a01b038088168083528a821660208085019190915291861683850181905260009182526003808452858320918352925292909220620015189290919062001b44565b50604080516060810182526001600160a01b038088168083528a8216602080850191909152918516838501819052600091825260038084528583209183529252929092206200156a9290919062001b44565b506040805180820182526001600160a01b0380871680835290891660208084018290526000928352600381528483209183525291909120620015ae91600262001b44565b506040805180820182526001600160a01b03808716808352908a1660208084018290526000928352600381528483209183525291909120620015f291600262001b44565b506040805180820182526001600160a01b03808716808352908816602080840182905260009283526003815284832091835252919091206200163691600262001b44565b50604080516060810182526001600160a01b038087168083528a821660208085019190915291861683850181905260009182526003808452858320918352925292909220620016889290919062001b44565b50604080516060810182526001600160a01b038087168083528a821660208085019190915291851683850181905260009182526003808452858320918352925292909220620016da9290919062001b44565b506040805180820182526001600160a01b03808616808352908916602080840182905260009283526003815284832091835252919091206200171e91600262001b44565b506040805180820182526001600160a01b03808616808352908816602080840182905260009283526003815284832091835252919091206200176291600262001b44565b50604080516060810182526001600160a01b038086168083528a821660208085019190915291861683850181905260009182526003808452858320918352925292909220620017b49290919062001b44565b50604080516060810182526001600160a01b038086168083528a821660208085019190915291851683850181905260009182526003808452858320918352925292909220620018069290919062001b44565b50604080516060810182526001600160a01b038085168083528a8216602080850191909152918a1683850181905260009182526003808452858320918352925292909220620018589290919062001b44565b50604080516060810182526001600160a01b038085168083528a821660208085019190915291891683850181905260009182526003808452858320918352925292909220620018aa9290919062001b44565b50604080516060810182526001600160a01b038085168083528a821660208085019190915291881683850181905260009182526003808452858320918352925292909220620018fc9290919062001b44565b50604080516060810182526001600160a01b038085168083528a8216602080850191909152918716838501819052600091825260038084528583209183529252929092206200194e9290919062001b44565b50604080516060810182526001600160a01b038085168083528a821660208085019190915291851683850181905260009182526003808452858320918352925292909220620019a09290919062001b44565b50604080516060810182526001600160a01b038084168083528a8216602080850191909152918a1683850181905260009182526003808452858320918352925292909220620019f29290919062001b44565b50604080516060810182526001600160a01b038084168083528a82166020808501919091529189168385018190526000918252600380845285832091835292529290922062001a449290919062001b44565b50604080516060810182526001600160a01b038084168083528a82166020808501919091529188168385018190526000918252600380845285832091835292529290922062001a969290919062001b44565b50604080516060810182526001600160a01b038084168083528a82166020808501919091529187168385018190526000918252600380845285832091835292529290922062001ae89290919062001b44565b50604080516060810182526001600160a01b038084168083528a82166020808501919091529186168385018190526000918252600380845285832091835292529290922062001b3a9290919062001b44565b5050505050505050565b82805482825590600052602060002090810192821562001b9c579160200282015b8281111562001b9c57825182546001600160a01b0319166001600160a01b0390911617825560209092019160019091019062001b65565b5062001baa92915062001bae565b5090565b5b8082111562001baa576000815560010162001baf565b80516001600160a01b038116811462001bdd57600080fd5b919050565b6000806040838503121562001bf657600080fd5b62001c018362001bc5565b9150602083015162ffffff8116811462001c1a57600080fd5b809150509250929050565b60006020828403121562001c3857600080fd5b62001c438262001bc5565b9392505050565b6128b68062001c5a6000396000f3fe6080604052600436106100f35760003560e01c80638da5cb5b1161008a578063cb612cfb11610059578063cb612cfb146102a4578063da02e718146102ba578063e1454fd0146102da578063f2fde38b1461032057600080fd5b80638da5cb5b14610210578063ac94e8ca1461022e578063ad5c46481461024e578063ae39ecfc1461027557600080fd5b806352c076c3116100c657806352c076c3146101735780635cb7d1f4146101a3578063666fc8b3146101db578063715018a6146101fb57600080fd5b80630ddb88ae146100f857806336d02ea11461011a5780633b4cdc431461013a5780634aec7a3114610160575b600080fd5b34801561010457600080fd5b5061011861011336600461209e565b610340565b005b34801561012657600080fd5b5061011861013536600461219b565b61069a565b61014d6101483660046121f4565b61082a565b6040519081526020015b60405180910390f35b61014d61016e36600461225c565b610853565b34801561017f57600080fd5b5060055461018f9062ffffff1681565b60405162ffffff9091168152602001610157565b3480156101af57600080fd5b506001546101c3906001600160a01b031681565b6040516001600160a01b039091168152602001610157565b3480156101e757600080fd5b5061014d6101f63660046122cc565b610f9c565b34801561020757600080fd5b50610118611252565b34801561021c57600080fd5b506000546001600160a01b03166101c3565b34801561023a57600080fd5b5061011861024936600461230d565b611266565b34801561025a57600080fd5b506005546101c390630100000090046001600160a01b031681565b34801561028157600080fd5b50610295610290366004612331565b61131f565b604051610157939291906123e3565b3480156102b057600080fd5b5061014d60025481565b3480156102c657600080fd5b5061014d6102d53660046122cc565b611563565b3480156102e657600080fd5b506102fa6102f5366004612331565b6115a8565b604080516001600160a01b03948516815293909216602084015290820152606001610157565b34801561032c57600080fd5b5061011861033b366004612410565b61175e565b6103486117d7565b61035183611831565b61035a82611831565b805160005b8181101561039b5761038983828151811061037c5761037c61242d565b6020026020010151611831565b8061039381612459565b91505061035f565b50826001600160a01b0316846001600160a01b0316036103d65760405162461bcd60e51b81526004016103cd90612472565b60405180910390fd5b60028110156104185760405162461bcd60e51b815260206004820152600e60248201526d1c185d1a081d1bdbc81cda1bdc9d60921b60448201526064016103cd565b836001600160a01b0316826000815181106104355761043561242d565b60200260200101516001600160a01b0316146104935760405162461bcd60e51b815260206004820152601e60248201527f70617468206e6f742073746172742066726f6d20696e707574546f6b656e000060448201526064016103cd565b6001600160a01b038316826104a96001846124a9565b815181106104b9576104b961242d565b60200260200101516001600160a01b0316146105175760405162461bcd60e51b815260206004820152601d60248201527f70617468206e6f7420656e642077697468206f7574707574546f6b656e00000060448201526064016103cd565b60005b6105256001836124a9565b811015610612576000600460008584815181106105445761054461242d565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060008584600161057c91906124bc565b8151811061058c5761058c61242d565b6020908102919091018101516001600160a01b0316825281019190915260400160009081205462ffffff1691508190036105ff5760405162461bcd60e51b81526020600482015260146024820152731d1c985919599959481b9bdd081919599a5b995960621b60448201526064016103cd565b508061060a81612459565b91505061051a565b506001600160a01b0380851660009081526003602090815260408083209387168352928152919020835161064892850190611fe9565b50826001600160a01b0316846001600160a01b03167f1b8a2f263025a93091ad02833d5c0dffaa83d6e6d8d21e11f0e0b5c48f63dd578460405161068c91906124cf565b60405180910390a350505050565b6106a26117d7565b6106ab83611831565b6106b482611831565b6106c28162ffffff1661187c565b816001600160a01b0316836001600160a01b0316036106f35760405162461bcd60e51b81526004016103cd90612472565b6000610777600160009054906101000a90046001600160a01b03166001600160a01b031663e3d11ba06040518163ffffffff1660e01b8152600401602060405180830381865afa15801561074b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076f91906124e2565b8585856118b6565b90506001600160a01b0381166107c05760405162461bcd60e51b815260206004820152600e60248201526d1c1bdbdb081b9bdd08195e1a5cdd60921b60448201526064016103cd565b6001600160a01b03848116600081815260046020908152604080832094881680845294825291829020805462ffffff191662ffffff881690811790915591519182527f036c706ce028591ddd5006239a630c0bb9bce2ece55d1120c8519913fe74fc63910161068c565b600080610838868686611563565b9050610848878787878588610853565b979650505050505050565b600061085e86611831565b61086785611831565b61087082611831565b6108798461187c565b846001600160a01b0316866001600160a01b0316036108aa5760405162461bcd60e51b81526004016103cd90612472565b60008060006108b9898961131f565b919450925090506001831515146109045760405162461bcd60e51b815260206004820152600f60248201526e70617468206e6f7420646566696e6560881b60448201526064016103cd565b89156109f55761091387611940565b6005546001600160a01b038a8116630100000090920416146109875760405162461bcd60e51b815260206004820152602760248201527f696e70757420455448206d7573742068617665207377617020706174682066726044820152660deda40ae8aa8960cb1b60648201526084016103cd565b600560039054906101000a90046001600160a01b03166001600160a01b031663d0e30db0886040518263ffffffff1660e01b81526004016000604051808303818588803b1580156109d757600080fd5b505af11580156109eb573d6000803e3d6000fd5b5050505050610ab8565b604051636eb1769f60e11b815233600482015230602482015287906001600160a01b038b169063dd62ed3e90604401602060405180830381865afa158015610a41573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6591906124ff565b1015610aac5760405162461bcd60e51b8152602060048201526016602482015275185b1b1bddd85b98d9481a5b9cdd59999a58da595b9d60521b60448201526064016103cd565b610ab88933308a61198f565b610b3989600160009054906101000a90046001600160a01b03166001600160a01b0316639194da636040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3391906124e2565b89611a99565b81516002819003610d4c57600160009054906101000a90046001600160a01b03166001600160a01b0316639194da636040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bbb91906124e2565b6001600160a01b03166304e45aaf6040518060e001604052808d6001600160a01b031681526020018c6001600160a01b0316815260200185600081518110610c0557610c0561242d565b602002602001015162ffffff168152602001896001600160a01b031681526020018b81526020018a815260200160006001600160a01b03168152506040518263ffffffff1660e01b8152600401610cb5919081516001600160a01b03908116825260208084015182169083015260408084015162ffffff16908301526060808401518216908301526080808401519083015260a0838101519083015260c092830151169181019190915260e00190565b6020604051808303816000875af1158015610cd4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf891906124ff565b9450856001600160a01b03167f0ff70a757dde6555c17e755d4725dbec5d2662e928b64e2a2772a047db1d9f0d8c8c8b8d8a8989604051610d3f9796959493929190612518565b60405180910390a2610f8e565b600083600081518110610d6157610d6161242d565b6020026020010151604051602001610d91919060609190911b6bffffffffffffffffffffffff1916815260140190565b604051602081830303815290604052905060005b610db06001846124a9565b811015610e2e5781848281518110610dca57610dca61242d565b602002602001015186836001610de091906124bc565b81518110610df057610df061242d565b6020026020010151604051602001610e0a9392919061259e565b60405160208183030381529060405291508080610e2690612459565b915050610da5565b50600160009054906101000a90046001600160a01b03166001600160a01b0316639194da636040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ea691906124e2565b6001600160a01b031663b858183f60405180608001604052808481526020018a6001600160a01b031681526020018c81526020018b8152506040518263ffffffff1660e01b8152600401610efa91906125ea565b6020604051808303816000875af1158015610f19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3d91906124ff565b9550866001600160a01b03167fe2fbd4605def93f01b1643f166a5a181f02f79d949cd5fccb5b0e5416b32ee6e8d8d8c8e8b8a8a604051610f849796959493929190612518565b60405180910390a2505b505050509695505050505050565b6000610fa784611831565b610fb083611831565b610fb98261187c565b60055462ffffff1661100d5760405162461bcd60e51b815260206004820152601f60248201527f736c697070616765546f6c6572616e63654e756d657261746f7220697320300060448201526064016103cd565b826001600160a01b0316846001600160a01b03160361103e5760405162461bcd60e51b81526004016103cd90612472565b600080600061104d878761131f565b919450925090506001831515146110985760405162461bcd60e51b815260206004820152600f60248201526e70617468206e6f7420646566696e6560881b60448201526064016103cd565b815160006110ba6110a88a611b99565b6110b390600a612734565b8890611c18565b905060005b6110ca6001846124a9565b8110156112265760008582815181106110e5576110e561242d565b602002602001015190506000868360016110ff91906124bc565b8151811061110f5761110f61242d565b60200260200101519050600080600061112885856115a8565b925092509250611183620f424062ffffff1661117d6111768c8a815181106111525761115261242d565b602002602001015162ffffff16620f424062ffffff16611c2d90919063ffffffff16565b8a90611c18565b90611c39565b9650826001600160a01b0316856001600160a01b031614806111b65750816001600160a01b0316856001600160a01b0316145b6111bf57600080fd5b826001600160a01b0316856001600160a01b0316036111f8576111f16111e76012600a612734565b61117d8984611c18565b965061120e565b61120b8161117d6111766012600a612734565b96505b5050505050808061121e90612459565b9150506110bf565b5061124561123389611b99565b61123e90600a612734565b8290611c39565b9998505050505050505050565b61125a6117d7565b6112646000611c45565b565b61126e6117d7565b61127c8162ffffff1661187c565b620f424062ffffff8216106112d35760405162461bcd60e51b815260206004820152601960248201527f736c697070616765546f6c6572616e636520746f6f206269670000000000000060448201526064016103cd565b6005805462ffffff191662ffffff83169081179091556040519081527f6dee1c9db313684d98cb20b5cbbd22b75f01ce5241372a0bb9328b9ff7f53ab29060200160405180910390a150565b600060608061132d85611831565b61133684611831565b836001600160a01b0316856001600160a01b0316036113675760405162461bcd60e51b81526004016103cd90612472565b6001600160a01b0380861660009081526003602090815260408083209388168352928152828220805484518184028101840190955280855292939290918301828280156113dd57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116113bf575b505050505090506000815190506002811061153d576001600061140082846124a9565b67ffffffffffffffff81111561141857611418612088565b604051908082528060200260200182016040528015611441578160200160208202803683370190505b50905060005b6114526001856124a9565b81101561152c576000600460008784815181106114715761147161242d565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000206000878460016114a991906124bc565b815181106114b9576114b961242d565b6020908102919091018101516001600160a01b0316825281019190915260400160009081205462ffffff1691508190036114f257600093505b808383815181106115055761150561242d565b62ffffff90921660209283029190910190910152508061152481612459565b915050611447565b5090955091935090915061155c9050565b5050604080516000808252602082018181528284019093529450925090505b9250925092565b600080611571858585610f9c565b60055490915060009061159e90620f42409061117d9061159790839062ffffff16611c2d565b8590611c18565b9695505050505050565b60008060006115b685611831565b6115bf84611831565b836001600160a01b0316856001600160a01b0316036115f05760405162461bcd60e51b81526004016103cd90612472565b6001600160a01b03808616600090815260046020908152604080832093881683529290529081205462ffffff16908190036116635760405162461bcd60e51b81526020600482015260136024820152727472616465466565206e6f7420646566696e6560681b60448201526064016103cd565b60006116e7600160009054906101000a90046001600160a01b03166001600160a01b031663e3d11ba06040518163ffffffff1660e01b8152600401602060405180830381865afa1580156116bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116df91906124e2565b8888856118b6565b90506001600160a01b0381166117305760405162461bcd60e51b815260206004820152600e60248201526d1c1bdbdb081b9bdd08195e1a5cdd60921b60448201526064016103cd565b61173981611c95565b50949950929750611753935084925060129150611f119050565b925050509250925092565b6117666117d7565b6001600160a01b0381166117cb5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103cd565b6117d481611c45565b50565b6000546001600160a01b031633146112645760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103cd565b6001600160a01b0381166117d45760405162461bcd60e51b8152602060048201526012602482015271696e707574207a65726f206164647265737360701b60448201526064016103cd565b600081116117d45760405162461bcd60e51b81526020600482015260076024820152660696e70757420360cc1b60448201526064016103cd565b604051630b4c774160e11b81526001600160a01b038481166004830152838116602483015262ffffff8316604483015260009190861690631698ee8290606401602060405180830381865afa158015611913573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061193791906124e2565b95945050505050565b8034146117d45760405162461bcd60e51b815260206004820152601860248201527f6d73672e76616c756520213d20696e707574416d6f756e74000000000000000060448201526064016103cd565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b17905291516000928392908816916119f39190612740565b6000604051808303816000865af19150503d8060008114611a30576040519150601f19603f3d011682016040523d82523d6000602084013e611a35565b606091505b5091509150818015611a5f575080511580611a5f575080806020019051810190611a5f919061275c565b611a915760405162461bcd60e51b815260206004820152600360248201526229aa2360e91b60448201526064016103cd565b505050505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663095ea7b360e01b1790529151600092839290871691611af59190612740565b6000604051808303816000865af19150503d8060008114611b32576040519150601f19603f3d011682016040523d82523d6000602084013e611b37565b606091505b5091509150818015611b61575080511580611b61575080806020019051810190611b61919061275c565b611b925760405162461bcd60e51b8152602060048201526002602482015261534160f01b60448201526064016103cd565b5050505050565b600080601290506000836001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611be0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c0491906124ff565b9050611c108282611c2d565b949350505050565b6000611c248284612779565b90505b92915050565b6000611c2482846124a9565b6000611c248284612790565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000806000806000806000876001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015611cde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d0291906127c4565b505060408051630dfe168160e01b8152905194995094975050506001600160a01b038b1692630dfe168192600480830193506020928290030181865afa158015611d50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d7491906124e2565b9650876001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015611db4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dd891906124e2565b9550876001600160a01b031663ddca3f436040518163ffffffff1660e01b8152600401602060405180830381865afa158015611e18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e3c9190612863565b9450866001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611e7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea091906124ff565b9150856001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611ee0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f0491906124ff565b9050919395979092949650565b600080600080611f2086611c95565b965096509650505050506000611f54600160601b61117d88600a611f449190612734565b6001600160a01b03881690611c18565b90506000611f628280611c18565b90506000611f7a85611f748a87611fdd565b90611c2d565b90506000611f93611f8c83600a612734565b8490611c39565b9050600081116112455760405162461bcd60e51b81526020600482015260156024820152741d1bdad95b881c1c9a58d9481d1bdbc81cdb585b1b605a1b60448201526064016103cd565b6000611c2482846124bc565b82805482825590600052602060002090810192821561203e579160200282015b8281111561203e57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190612009565b5061204a92915061204e565b5090565b5b8082111561204a576000815560010161204f565b6001600160a01b03811681146117d457600080fd5b803561208381612063565b919050565b634e487b7160e01b600052604160045260246000fd5b6000806000606084860312156120b357600080fd5b83356120be81612063565b92506020848101356120cf81612063565b9250604085013567ffffffffffffffff808211156120ec57600080fd5b818701915087601f83011261210057600080fd5b81358181111561211257612112612088565b8060051b604051601f19603f8301168101818110858211171561213757612137612088565b60405291825284820192508381018501918a83111561215557600080fd5b938501935b8285101561217a5761216b85612078565b8452938501939285019261215a565b8096505050505050509250925092565b62ffffff811681146117d457600080fd5b6000806000606084860312156121b057600080fd5b83356121bb81612063565b925060208401356121cb81612063565b915060408401356121db8161218a565b809150509250925092565b80151581146117d457600080fd5b600080600080600060a0868803121561220c57600080fd5b8535612217816121e6565b9450602086013561222781612063565b9350604086013561223781612063565b925060608601359150608086013561224e81612063565b809150509295509295909350565b60008060008060008060c0878903121561227557600080fd5b8635612280816121e6565b9550602087013561229081612063565b945060408701356122a081612063565b9350606087013592506080870135915060a08701356122be81612063565b809150509295509295509295565b6000806000606084860312156122e157600080fd5b83356122ec81612063565b925060208401356122fc81612063565b929592945050506040919091013590565b60006020828403121561231f57600080fd5b813561232a8161218a565b9392505050565b6000806040838503121561234457600080fd5b823561234f81612063565b9150602083013561235f81612063565b809150509250929050565b600081518084526020808501945080840160005b838110156123a35781516001600160a01b03168752958201959082019060010161237e565b509495945050505050565b600081518084526020808501945080840160005b838110156123a357815162ffffff16875295820195908201906001016123c2565b83151581526060602082015260006123fe606083018561236a565b828103604084015261159e81856123ae565b60006020828403121561242257600080fd5b813561232a81612063565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161246b5761246b612443565b5060010190565b60208082526019908201527f696e707574546f6b656e203d3d206f7574707574546f6b656e00000000000000604082015260600190565b81810381811115611c2757611c27612443565b80820180821115611c2757611c27612443565b602081526000611c24602083018461236a565b6000602082840312156124f457600080fd5b815161232a81612063565b60006020828403121561251157600080fd5b5051919050565b87151581526001600160a01b03878116602083015260408201879052851660608201526080810184905260e060a0820181905260009061255a9083018561236a565b82810360c084015261256c81856123ae565b9a9950505050505050505050565b60005b8381101561259557818101518382015260200161257d565b50506000910152565b600084516125b081846020890161257a565b60e89490941b6001600160e81b0319169190930190815260609190911b6bffffffffffffffffffffffff1916600382015260170192915050565b60208152600082516080602084015280518060a08501526126128160c086016020850161257a565b60208501516001600160a01b0316604085810191909152850151606080860191909152909401516080840152505060c0601f909201601f1916010190565b600181815b8085111561268b57816000190482111561267157612671612443565b8085161561267e57918102915b93841c9390800290612655565b509250929050565b6000826126a257506001611c27565b816126af57506000611c27565b81600181146126c557600281146126cf576126eb565b6001915050611c27565b60ff8411156126e0576126e0612443565b50506001821b611c27565b5060208310610133831016604e8410600b841016171561270e575081810a611c27565b6127188383612650565b806000190482111561272c5761272c612443565b029392505050565b6000611c248383612693565b6000825161275281846020870161257a565b9190910192915050565b60006020828403121561276e57600080fd5b815161232a816121e6565b8082028115828204841417611c2757611c27612443565b6000826127ad57634e487b7160e01b600052601260045260246000fd5b500490565b805161ffff8116811461208357600080fd5b600080600080600080600060e0888a0312156127df57600080fd5b87516127ea81612063565b8097505060208801518060020b811461280257600080fd5b9550612810604089016127b2565b945061281e606089016127b2565b935061282c608089016127b2565b925060a088015160ff8116811461284257600080fd5b60c0890151909250612853816121e6565b8091505092959891949750929550565b60006020828403121561287557600080fd5b815161232a8161218a56fea26469706673582212207313969d270f4b1e4b567d80279635defe6ae8a77ed377d77f56996984875f6364736f6c63430008120033000000000000000000000000ac709f816af2ee3a2ac7b70bfa6a8a110c6c76340000000000000000000000000000000000000000000000000000000000001388

Deployed Bytecode

0x6080604052600436106100f35760003560e01c80638da5cb5b1161008a578063cb612cfb11610059578063cb612cfb146102a4578063da02e718146102ba578063e1454fd0146102da578063f2fde38b1461032057600080fd5b80638da5cb5b14610210578063ac94e8ca1461022e578063ad5c46481461024e578063ae39ecfc1461027557600080fd5b806352c076c3116100c657806352c076c3146101735780635cb7d1f4146101a3578063666fc8b3146101db578063715018a6146101fb57600080fd5b80630ddb88ae146100f857806336d02ea11461011a5780633b4cdc431461013a5780634aec7a3114610160575b600080fd5b34801561010457600080fd5b5061011861011336600461209e565b610340565b005b34801561012657600080fd5b5061011861013536600461219b565b61069a565b61014d6101483660046121f4565b61082a565b6040519081526020015b60405180910390f35b61014d61016e36600461225c565b610853565b34801561017f57600080fd5b5060055461018f9062ffffff1681565b60405162ffffff9091168152602001610157565b3480156101af57600080fd5b506001546101c3906001600160a01b031681565b6040516001600160a01b039091168152602001610157565b3480156101e757600080fd5b5061014d6101f63660046122cc565b610f9c565b34801561020757600080fd5b50610118611252565b34801561021c57600080fd5b506000546001600160a01b03166101c3565b34801561023a57600080fd5b5061011861024936600461230d565b611266565b34801561025a57600080fd5b506005546101c390630100000090046001600160a01b031681565b34801561028157600080fd5b50610295610290366004612331565b61131f565b604051610157939291906123e3565b3480156102b057600080fd5b5061014d60025481565b3480156102c657600080fd5b5061014d6102d53660046122cc565b611563565b3480156102e657600080fd5b506102fa6102f5366004612331565b6115a8565b604080516001600160a01b03948516815293909216602084015290820152606001610157565b34801561032c57600080fd5b5061011861033b366004612410565b61175e565b6103486117d7565b61035183611831565b61035a82611831565b805160005b8181101561039b5761038983828151811061037c5761037c61242d565b6020026020010151611831565b8061039381612459565b91505061035f565b50826001600160a01b0316846001600160a01b0316036103d65760405162461bcd60e51b81526004016103cd90612472565b60405180910390fd5b60028110156104185760405162461bcd60e51b815260206004820152600e60248201526d1c185d1a081d1bdbc81cda1bdc9d60921b60448201526064016103cd565b836001600160a01b0316826000815181106104355761043561242d565b60200260200101516001600160a01b0316146104935760405162461bcd60e51b815260206004820152601e60248201527f70617468206e6f742073746172742066726f6d20696e707574546f6b656e000060448201526064016103cd565b6001600160a01b038316826104a96001846124a9565b815181106104b9576104b961242d565b60200260200101516001600160a01b0316146105175760405162461bcd60e51b815260206004820152601d60248201527f70617468206e6f7420656e642077697468206f7574707574546f6b656e00000060448201526064016103cd565b60005b6105256001836124a9565b811015610612576000600460008584815181106105445761054461242d565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060008584600161057c91906124bc565b8151811061058c5761058c61242d565b6020908102919091018101516001600160a01b0316825281019190915260400160009081205462ffffff1691508190036105ff5760405162461bcd60e51b81526020600482015260146024820152731d1c985919599959481b9bdd081919599a5b995960621b60448201526064016103cd565b508061060a81612459565b91505061051a565b506001600160a01b0380851660009081526003602090815260408083209387168352928152919020835161064892850190611fe9565b50826001600160a01b0316846001600160a01b03167f1b8a2f263025a93091ad02833d5c0dffaa83d6e6d8d21e11f0e0b5c48f63dd578460405161068c91906124cf565b60405180910390a350505050565b6106a26117d7565b6106ab83611831565b6106b482611831565b6106c28162ffffff1661187c565b816001600160a01b0316836001600160a01b0316036106f35760405162461bcd60e51b81526004016103cd90612472565b6000610777600160009054906101000a90046001600160a01b03166001600160a01b031663e3d11ba06040518163ffffffff1660e01b8152600401602060405180830381865afa15801561074b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076f91906124e2565b8585856118b6565b90506001600160a01b0381166107c05760405162461bcd60e51b815260206004820152600e60248201526d1c1bdbdb081b9bdd08195e1a5cdd60921b60448201526064016103cd565b6001600160a01b03848116600081815260046020908152604080832094881680845294825291829020805462ffffff191662ffffff881690811790915591519182527f036c706ce028591ddd5006239a630c0bb9bce2ece55d1120c8519913fe74fc63910161068c565b600080610838868686611563565b9050610848878787878588610853565b979650505050505050565b600061085e86611831565b61086785611831565b61087082611831565b6108798461187c565b846001600160a01b0316866001600160a01b0316036108aa5760405162461bcd60e51b81526004016103cd90612472565b60008060006108b9898961131f565b919450925090506001831515146109045760405162461bcd60e51b815260206004820152600f60248201526e70617468206e6f7420646566696e6560881b60448201526064016103cd565b89156109f55761091387611940565b6005546001600160a01b038a8116630100000090920416146109875760405162461bcd60e51b815260206004820152602760248201527f696e70757420455448206d7573742068617665207377617020706174682066726044820152660deda40ae8aa8960cb1b60648201526084016103cd565b600560039054906101000a90046001600160a01b03166001600160a01b031663d0e30db0886040518263ffffffff1660e01b81526004016000604051808303818588803b1580156109d757600080fd5b505af11580156109eb573d6000803e3d6000fd5b5050505050610ab8565b604051636eb1769f60e11b815233600482015230602482015287906001600160a01b038b169063dd62ed3e90604401602060405180830381865afa158015610a41573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6591906124ff565b1015610aac5760405162461bcd60e51b8152602060048201526016602482015275185b1b1bddd85b98d9481a5b9cdd59999a58da595b9d60521b60448201526064016103cd565b610ab88933308a61198f565b610b3989600160009054906101000a90046001600160a01b03166001600160a01b0316639194da636040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3391906124e2565b89611a99565b81516002819003610d4c57600160009054906101000a90046001600160a01b03166001600160a01b0316639194da636040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bbb91906124e2565b6001600160a01b03166304e45aaf6040518060e001604052808d6001600160a01b031681526020018c6001600160a01b0316815260200185600081518110610c0557610c0561242d565b602002602001015162ffffff168152602001896001600160a01b031681526020018b81526020018a815260200160006001600160a01b03168152506040518263ffffffff1660e01b8152600401610cb5919081516001600160a01b03908116825260208084015182169083015260408084015162ffffff16908301526060808401518216908301526080808401519083015260a0838101519083015260c092830151169181019190915260e00190565b6020604051808303816000875af1158015610cd4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf891906124ff565b9450856001600160a01b03167f0ff70a757dde6555c17e755d4725dbec5d2662e928b64e2a2772a047db1d9f0d8c8c8b8d8a8989604051610d3f9796959493929190612518565b60405180910390a2610f8e565b600083600081518110610d6157610d6161242d565b6020026020010151604051602001610d91919060609190911b6bffffffffffffffffffffffff1916815260140190565b604051602081830303815290604052905060005b610db06001846124a9565b811015610e2e5781848281518110610dca57610dca61242d565b602002602001015186836001610de091906124bc565b81518110610df057610df061242d565b6020026020010151604051602001610e0a9392919061259e565b60405160208183030381529060405291508080610e2690612459565b915050610da5565b50600160009054906101000a90046001600160a01b03166001600160a01b0316639194da636040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ea691906124e2565b6001600160a01b031663b858183f60405180608001604052808481526020018a6001600160a01b031681526020018c81526020018b8152506040518263ffffffff1660e01b8152600401610efa91906125ea565b6020604051808303816000875af1158015610f19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3d91906124ff565b9550866001600160a01b03167fe2fbd4605def93f01b1643f166a5a181f02f79d949cd5fccb5b0e5416b32ee6e8d8d8c8e8b8a8a604051610f849796959493929190612518565b60405180910390a2505b505050509695505050505050565b6000610fa784611831565b610fb083611831565b610fb98261187c565b60055462ffffff1661100d5760405162461bcd60e51b815260206004820152601f60248201527f736c697070616765546f6c6572616e63654e756d657261746f7220697320300060448201526064016103cd565b826001600160a01b0316846001600160a01b03160361103e5760405162461bcd60e51b81526004016103cd90612472565b600080600061104d878761131f565b919450925090506001831515146110985760405162461bcd60e51b815260206004820152600f60248201526e70617468206e6f7420646566696e6560881b60448201526064016103cd565b815160006110ba6110a88a611b99565b6110b390600a612734565b8890611c18565b905060005b6110ca6001846124a9565b8110156112265760008582815181106110e5576110e561242d565b602002602001015190506000868360016110ff91906124bc565b8151811061110f5761110f61242d565b60200260200101519050600080600061112885856115a8565b925092509250611183620f424062ffffff1661117d6111768c8a815181106111525761115261242d565b602002602001015162ffffff16620f424062ffffff16611c2d90919063ffffffff16565b8a90611c18565b90611c39565b9650826001600160a01b0316856001600160a01b031614806111b65750816001600160a01b0316856001600160a01b0316145b6111bf57600080fd5b826001600160a01b0316856001600160a01b0316036111f8576111f16111e76012600a612734565b61117d8984611c18565b965061120e565b61120b8161117d6111766012600a612734565b96505b5050505050808061121e90612459565b9150506110bf565b5061124561123389611b99565b61123e90600a612734565b8290611c39565b9998505050505050505050565b61125a6117d7565b6112646000611c45565b565b61126e6117d7565b61127c8162ffffff1661187c565b620f424062ffffff8216106112d35760405162461bcd60e51b815260206004820152601960248201527f736c697070616765546f6c6572616e636520746f6f206269670000000000000060448201526064016103cd565b6005805462ffffff191662ffffff83169081179091556040519081527f6dee1c9db313684d98cb20b5cbbd22b75f01ce5241372a0bb9328b9ff7f53ab29060200160405180910390a150565b600060608061132d85611831565b61133684611831565b836001600160a01b0316856001600160a01b0316036113675760405162461bcd60e51b81526004016103cd90612472565b6001600160a01b0380861660009081526003602090815260408083209388168352928152828220805484518184028101840190955280855292939290918301828280156113dd57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116113bf575b505050505090506000815190506002811061153d576001600061140082846124a9565b67ffffffffffffffff81111561141857611418612088565b604051908082528060200260200182016040528015611441578160200160208202803683370190505b50905060005b6114526001856124a9565b81101561152c576000600460008784815181106114715761147161242d565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000206000878460016114a991906124bc565b815181106114b9576114b961242d565b6020908102919091018101516001600160a01b0316825281019190915260400160009081205462ffffff1691508190036114f257600093505b808383815181106115055761150561242d565b62ffffff90921660209283029190910190910152508061152481612459565b915050611447565b5090955091935090915061155c9050565b5050604080516000808252602082018181528284019093529450925090505b9250925092565b600080611571858585610f9c565b60055490915060009061159e90620f42409061117d9061159790839062ffffff16611c2d565b8590611c18565b9695505050505050565b60008060006115b685611831565b6115bf84611831565b836001600160a01b0316856001600160a01b0316036115f05760405162461bcd60e51b81526004016103cd90612472565b6001600160a01b03808616600090815260046020908152604080832093881683529290529081205462ffffff16908190036116635760405162461bcd60e51b81526020600482015260136024820152727472616465466565206e6f7420646566696e6560681b60448201526064016103cd565b60006116e7600160009054906101000a90046001600160a01b03166001600160a01b031663e3d11ba06040518163ffffffff1660e01b8152600401602060405180830381865afa1580156116bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116df91906124e2565b8888856118b6565b90506001600160a01b0381166117305760405162461bcd60e51b815260206004820152600e60248201526d1c1bdbdb081b9bdd08195e1a5cdd60921b60448201526064016103cd565b61173981611c95565b50949950929750611753935084925060129150611f119050565b925050509250925092565b6117666117d7565b6001600160a01b0381166117cb5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103cd565b6117d481611c45565b50565b6000546001600160a01b031633146112645760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103cd565b6001600160a01b0381166117d45760405162461bcd60e51b8152602060048201526012602482015271696e707574207a65726f206164647265737360701b60448201526064016103cd565b600081116117d45760405162461bcd60e51b81526020600482015260076024820152660696e70757420360cc1b60448201526064016103cd565b604051630b4c774160e11b81526001600160a01b038481166004830152838116602483015262ffffff8316604483015260009190861690631698ee8290606401602060405180830381865afa158015611913573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061193791906124e2565b95945050505050565b8034146117d45760405162461bcd60e51b815260206004820152601860248201527f6d73672e76616c756520213d20696e707574416d6f756e74000000000000000060448201526064016103cd565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b17905291516000928392908816916119f39190612740565b6000604051808303816000865af19150503d8060008114611a30576040519150601f19603f3d011682016040523d82523d6000602084013e611a35565b606091505b5091509150818015611a5f575080511580611a5f575080806020019051810190611a5f919061275c565b611a915760405162461bcd60e51b815260206004820152600360248201526229aa2360e91b60448201526064016103cd565b505050505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663095ea7b360e01b1790529151600092839290871691611af59190612740565b6000604051808303816000865af19150503d8060008114611b32576040519150601f19603f3d011682016040523d82523d6000602084013e611b37565b606091505b5091509150818015611b61575080511580611b61575080806020019051810190611b61919061275c565b611b925760405162461bcd60e51b8152602060048201526002602482015261534160f01b60448201526064016103cd565b5050505050565b600080601290506000836001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611be0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c0491906124ff565b9050611c108282611c2d565b949350505050565b6000611c248284612779565b90505b92915050565b6000611c2482846124a9565b6000611c248284612790565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000806000806000806000876001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e060405180830381865afa158015611cde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d0291906127c4565b505060408051630dfe168160e01b8152905194995094975050506001600160a01b038b1692630dfe168192600480830193506020928290030181865afa158015611d50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d7491906124e2565b9650876001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015611db4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dd891906124e2565b9550876001600160a01b031663ddca3f436040518163ffffffff1660e01b8152600401602060405180830381865afa158015611e18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e3c9190612863565b9450866001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611e7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea091906124ff565b9150856001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611ee0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f0491906124ff565b9050919395979092949650565b600080600080611f2086611c95565b965096509650505050506000611f54600160601b61117d88600a611f449190612734565b6001600160a01b03881690611c18565b90506000611f628280611c18565b90506000611f7a85611f748a87611fdd565b90611c2d565b90506000611f93611f8c83600a612734565b8490611c39565b9050600081116112455760405162461bcd60e51b81526020600482015260156024820152741d1bdad95b881c1c9a58d9481d1bdbc81cdb585b1b605a1b60448201526064016103cd565b6000611c2482846124bc565b82805482825590600052602060002090810192821561203e579160200282015b8281111561203e57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190612009565b5061204a92915061204e565b5090565b5b8082111561204a576000815560010161204f565b6001600160a01b03811681146117d457600080fd5b803561208381612063565b919050565b634e487b7160e01b600052604160045260246000fd5b6000806000606084860312156120b357600080fd5b83356120be81612063565b92506020848101356120cf81612063565b9250604085013567ffffffffffffffff808211156120ec57600080fd5b818701915087601f83011261210057600080fd5b81358181111561211257612112612088565b8060051b604051601f19603f8301168101818110858211171561213757612137612088565b60405291825284820192508381018501918a83111561215557600080fd5b938501935b8285101561217a5761216b85612078565b8452938501939285019261215a565b8096505050505050509250925092565b62ffffff811681146117d457600080fd5b6000806000606084860312156121b057600080fd5b83356121bb81612063565b925060208401356121cb81612063565b915060408401356121db8161218a565b809150509250925092565b80151581146117d457600080fd5b600080600080600060a0868803121561220c57600080fd5b8535612217816121e6565b9450602086013561222781612063565b9350604086013561223781612063565b925060608601359150608086013561224e81612063565b809150509295509295909350565b60008060008060008060c0878903121561227557600080fd5b8635612280816121e6565b9550602087013561229081612063565b945060408701356122a081612063565b9350606087013592506080870135915060a08701356122be81612063565b809150509295509295509295565b6000806000606084860312156122e157600080fd5b83356122ec81612063565b925060208401356122fc81612063565b929592945050506040919091013590565b60006020828403121561231f57600080fd5b813561232a8161218a565b9392505050565b6000806040838503121561234457600080fd5b823561234f81612063565b9150602083013561235f81612063565b809150509250929050565b600081518084526020808501945080840160005b838110156123a35781516001600160a01b03168752958201959082019060010161237e565b509495945050505050565b600081518084526020808501945080840160005b838110156123a357815162ffffff16875295820195908201906001016123c2565b83151581526060602082015260006123fe606083018561236a565b828103604084015261159e81856123ae565b60006020828403121561242257600080fd5b813561232a81612063565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161246b5761246b612443565b5060010190565b60208082526019908201527f696e707574546f6b656e203d3d206f7574707574546f6b656e00000000000000604082015260600190565b81810381811115611c2757611c27612443565b80820180821115611c2757611c27612443565b602081526000611c24602083018461236a565b6000602082840312156124f457600080fd5b815161232a81612063565b60006020828403121561251157600080fd5b5051919050565b87151581526001600160a01b03878116602083015260408201879052851660608201526080810184905260e060a0820181905260009061255a9083018561236a565b82810360c084015261256c81856123ae565b9a9950505050505050505050565b60005b8381101561259557818101518382015260200161257d565b50506000910152565b600084516125b081846020890161257a565b60e89490941b6001600160e81b0319169190930190815260609190911b6bffffffffffffffffffffffff1916600382015260170192915050565b60208152600082516080602084015280518060a08501526126128160c086016020850161257a565b60208501516001600160a01b0316604085810191909152850151606080860191909152909401516080840152505060c0601f909201601f1916010190565b600181815b8085111561268b57816000190482111561267157612671612443565b8085161561267e57918102915b93841c9390800290612655565b509250929050565b6000826126a257506001611c27565b816126af57506000611c27565b81600181146126c557600281146126cf576126eb565b6001915050611c27565b60ff8411156126e0576126e0612443565b50506001821b611c27565b5060208310610133831016604e8410600b841016171561270e575081810a611c27565b6127188383612650565b806000190482111561272c5761272c612443565b029392505050565b6000611c248383612693565b6000825161275281846020870161257a565b9190910192915050565b60006020828403121561276e57600080fd5b815161232a816121e6565b8082028115828204841417611c2757611c27612443565b6000826127ad57634e487b7160e01b600052601260045260246000fd5b500490565b805161ffff8116811461208357600080fd5b600080600080600080600060e0888a0312156127df57600080fd5b87516127ea81612063565b8097505060208801518060020b811461280257600080fd5b9550612810604089016127b2565b945061281e606089016127b2565b935061282c608089016127b2565b925060a088015160ff8116811461284257600080fd5b60c0890151909250612853816121e6565b8091505092959891949750929550565b60006020828403121561287557600080fd5b815161232a8161218a56fea26469706673582212207313969d270f4b1e4b567d80279635defe6ae8a77ed377d77f56996984875f6364736f6c63430008120033

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

000000000000000000000000ac709f816af2ee3a2ac7b70bfa6a8a110c6c76340000000000000000000000000000000000000000000000000000000000001388

-----Decoded View---------------
Arg [0] : _constants (address): 0xac709f816aF2ee3a2ac7B70bfa6A8a110C6c7634
Arg [1] : _slippageToleranceNumerator (uint24): 5000

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000ac709f816af2ee3a2ac7b70bfa6a8a110c6c7634
Arg [1] : 0000000000000000000000000000000000000000000000000000000000001388


Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.