false
true
0

Contract Address Details

0x00000000Ff0027b3f3d2B0412D4a4cEd4e3366DA

Contract Name
VaultSwapper
Creator
0x62349c–642e7b at 0x1f542f–c4f0fc
Balance
0 PLS ( )
Tokens
Fetching tokens...
Transactions
Fetching transactions...
Transfers
Fetching transfers...
Gas Used
Fetching gas used...
Last Balance Update
26347951
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
This contract has been partially verified via Sourcify. View contract in Sourcify repository
Contract name:
VaultSwapper




Optimization enabled
true
Compiler version
v0.8.6+commit.11564f7e




Optimization runs
200
EVM Version
istanbul




Verified at
2026-04-22T01:58:49.401644Z

VaultSwapper.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.6;
import "IERC20.sol";
import "SafeERC20.sol";
import "Initializable.sol";

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

    function deposit() external returns (uint256);

    function deposit(uint256 amount) external returns (uint256);

    function deposit(uint256 amount, address recipient)
        external
        returns (uint256);

    function withdraw() external returns (uint256);

    function withdraw(uint256 maxShares) external returns (uint256);

    function withdraw(uint256 maxShares, address recipient)
        external
        returns (uint256);

    function token() external view returns (address);

    function pricePerShare() external view returns (uint256);

    function totalAssets() external view returns (uint256);

    function permit(
        address owner,
        address spender,
        uint256 amount,
        uint256 expiry,
        bytes calldata signature
    ) external returns (bool);
}

interface StableSwap {
    function remove_liquidity_one_coin(
        uint256 amount,
        int128 i,
        uint256 min_amount
    ) external;

    function add_liquidity(uint256[2] calldata amounts, uint256 min_mint_amount)
        external;

    function add_liquidity(uint256[3] calldata amounts, uint256 min_mint_amount)
        external;

    function add_liquidity(uint256[4] calldata amounts, uint256 min_mint_amount)
        external;

    function calc_withdraw_one_coin(uint256 _token_amount, int128 i)
        external
        view
        returns (uint256);

    function calc_token_amount(uint256[2] calldata amounts, bool is_deposit)
        external
        view
        returns (uint256);

    function calc_token_amount(uint256[3] calldata amounts, bool is_deposit)
        external
        view
        returns (uint256);

    function calc_token_amount(uint256[4] calldata amounts, bool is_deposit)
        external
        view
        returns (uint256);
}

interface Registry {
    function get_pool_from_lp_token(address lp) external view returns (address);

    function get_lp_token(address pool) external view returns (address);

    function get_n_coins(address) external view returns (uint256[2] memory);

    function get_coins(address) external view returns (address[8] memory);
}

contract VaultSwapper is Initializable {
    Registry constant registry =
        Registry(0x90E00ACe148ca3b23Ac1bC8C240C2a7Dd9c2d7f5);
    uint256 constant private MIN_AMOUNT_OUT = 1;
    uint256 constant private MAX_DONATION = 10_000;
    uint256 constant private DEFAULT_DONATION = 30;
    uint256 constant private UNKNOWN_ORIGIN = 0;
    address public owner;

    event Orgin(uint256 origin);
    struct Swap {
        bool deposit;
        address pool;
        uint128 n;
    }

    function initialize(address _owner) initializer public {
        owner = _owner;
    }

    function set_owner(address new_owner) public {
        require(owner == msg.sender);
        require(new_owner != address(0));
        owner = new_owner;
    }

    /*
        @notice Swap with apoval using eip-2612
        @param from_vault The vault tokens should be taken from
        @param to_vault The vault tokens should be deposited to
        @param amount The amount of tokens you whish to use from the from_vault
        @param min_amount_out The minimal amount of tokens you would expect from the to_vault
        @param expiry signature expiry
        @param signature signature
    */
    function metapool_swap_with_signature(
        address from_vault,
        address to_vault,
        uint256 amount,
        uint256 min_amount_out,
        uint256 expiry,
        bytes calldata signature
    ) public {
        metapool_swap_with_signature(
            from_vault,
            to_vault,
            amount,
            min_amount_out,
            expiry,
            signature,
            DEFAULT_DONATION,
            UNKNOWN_ORIGIN
        );
    }

    function metapool_swap_with_signature(
        address from_vault,
        address to_vault,
        uint256 amount,
        uint256 min_amount_out,
        uint256 expiry,
        bytes calldata signature,
        uint256 donation,
        uint256 origin
    ) public {
        assert(
            Vault(from_vault).permit(
                msg.sender,
                address(this),
                amount,
                expiry,
                signature
            )
        );
        metapool_swap(from_vault, to_vault, amount, min_amount_out, donation, origin);
    }

    /**
        @notice swap tokens from one meta pool vault to an other
        @dev Remove funds from a vault, move one side of 
        the asset from one curve pool to an other and 
        deposit into the new vault.
        @param from_vault The vault tokens should be taken from
        @param to_vault The vault tokens should be deposited to
        @param amount The amount of tokens you whish to use from the from_vault
        @param min_amount_out The minimal amount of tokens you would expect from the to_vault
    */
    function metapool_swap(
        address from_vault,
        address to_vault,
        uint256 amount,
        uint256 min_amount_out
    ) public {
        metapool_swap(from_vault, to_vault, amount, min_amount_out, DEFAULT_DONATION, UNKNOWN_ORIGIN);
    }

    function metapool_swap(
        address from_vault,
        address to_vault,
        uint256 amount,
        uint256 min_amount_out,
        uint256 donation,
        uint256 origin
    ) public {
        address underlying = Vault(from_vault).token();
        address target = Vault(to_vault).token();

        address underlying_pool = registry.get_pool_from_lp_token(underlying);
        address target_pool = registry.get_pool_from_lp_token(target);

        Vault(from_vault).transferFrom(msg.sender, address(this), amount);
        uint256 underlying_amount = Vault(from_vault).withdraw(
            amount,
            address(this)
        );
        StableSwap(underlying_pool).remove_liquidity_one_coin(
            underlying_amount,
            1,
            1
        );

        IERC20 underlying_coin = IERC20(registry.get_coins(underlying_pool)[1]);
        uint256 liquidity_amount = underlying_coin.balanceOf(address(this));

        underlying_coin.approve(target_pool, liquidity_amount);

        StableSwap(target_pool).add_liquidity(
            [0, liquidity_amount],
            MIN_AMOUNT_OUT
        );

        uint256 target_amount = IERC20(target).balanceOf(address(this));
        if(donation != 0) {
            uint256 donating = (target_amount * donation) / MAX_DONATION;
            SafeERC20.safeTransfer(IERC20(target), owner, donating);
            target_amount -= donating;
        }

        approve(target, to_vault, target_amount);

        uint256 out = Vault(to_vault).deposit(target_amount, msg.sender);

        require(out >= min_amount_out, "out too low");
        if (origin != UNKNOWN_ORIGIN) {
            emit Orgin(origin);
        }
    }

    /**
        @notice estimate the amount of tokens out
        @param from_vault The vault tokens should be taken from
        @param to_vault The vault tokens should be deposited to
        @param amount The amount of tokens you whish to use from the from_vault
        @return the amount of token shared expected in the to_vault
     */
    function metapool_estimate_out(
        address from_vault,
        address to_vault,
        uint256 amount,
        uint256 donation
    ) public view returns (uint256) {
        address underlying = Vault(from_vault).token();
        address target = Vault(to_vault).token();

        address underlying_pool = registry.get_pool_from_lp_token(underlying);
        address target_pool = registry.get_pool_from_lp_token(target);

        uint256 pricePerShareFrom = Vault(from_vault).pricePerShare();
        uint256 pricePerShareTo = Vault(to_vault).pricePerShare();

        uint256 amount_out = (pricePerShareFrom * amount) /
            (10**Vault(from_vault).decimals());
        amount_out = StableSwap(underlying_pool).calc_withdraw_one_coin(
            amount_out,
            1
        );
        amount_out = StableSwap(target_pool).calc_token_amount(
            [0, amount_out],
            true
        );
        amount_out -= (amount_out * (MAX_DONATION - donation) / MAX_DONATION);
        return
            (amount_out * (10**Vault(to_vault).decimals())) / pricePerShareTo;
    }

    function swap_with_signature(
        address from_vault,
        address to_vault,
        uint256 amount,
        uint256 min_amount_out,
        Swap[] calldata instructions,
        uint256 expiry,
        bytes calldata signature
    ) public {
        swap_with_signature(
            from_vault,
            to_vault,
            amount,
            min_amount_out,
            instructions,
            expiry,
            signature,
            DEFAULT_DONATION,
            UNKNOWN_ORIGIN
        );
    }

    function swap_with_signature(
        address from_vault,
        address to_vault,
        uint256 amount,
        uint256 min_amount_out,
        Swap[] calldata instructions,
        uint256 expiry,
        bytes calldata signature,
        uint256 donation,
        uint256 origin
    ) public {
        assert(
            Vault(from_vault).permit(
                msg.sender,
                address(this),
                amount,
                expiry,
                signature
            )
        );
        swap(
            from_vault,
            to_vault,
            amount,
            min_amount_out,
            instructions,
            donation,
            origin
        );
    }

    function swap(
        address from_vault,
        address to_vault,
        uint256 amount,
        uint256 min_amount_out,
        Swap[] calldata instructions
    ) public {
        swap(from_vault, to_vault, amount, min_amount_out, instructions, DEFAULT_DONATION, UNKNOWN_ORIGIN);
    }

    function swap(
        address from_vault,
        address to_vault,
        uint256 amount,
        uint256 min_amount_out,
        Swap[] calldata instructions,
        uint256 donation,
        uint256 origin
    ) public {
        address token = Vault(from_vault).token();
        address target = Vault(to_vault).token();

        Vault(from_vault).transferFrom(msg.sender, address(this), amount);

        amount = Vault(from_vault).withdraw(amount, address(this));
        uint256 n_coins;
        for (uint256 i = 0; i < instructions.length; i++) {
            if (instructions[i].deposit) {
                n_coins = registry.get_n_coins(instructions[i].pool)[0];
                uint256[] memory list = new uint256[](n_coins);
                list[instructions[i].n] = amount;
                approve(token, instructions[i].pool, amount);

                if (n_coins == 2) {
                    StableSwap(instructions[i].pool).add_liquidity(
                        [list[0], list[1]],
                        1
                    );
                } else if (n_coins == 3) {
                    StableSwap(instructions[i].pool).add_liquidity(
                        [list[0], list[1], list[2]],
                        1
                    );
                } else if (n_coins == 4) {
                    StableSwap(instructions[i].pool).add_liquidity(
                        [list[0], list[1], list[2], list[3]],
                        1
                    );
                }

                token = registry.get_lp_token(instructions[i].pool);
                amount = IERC20(token).balanceOf(address(this));
            } else {
                token = registry.get_coins(instructions[i].pool)[
                    instructions[i].n
                ];
                amount = remove_liquidity_one_coin(
                    token,
                    instructions[i].pool,
                    amount,
                    instructions[i].n
                );
            }
        }

        require(target == token, "!path");

        if(donation != 0) {
            uint256 donating = (amount * donation) / MAX_DONATION;
            SafeERC20.safeTransfer(IERC20(target), owner, donating);
            amount -= donating;
        }
        approve(target, to_vault, amount);
        uint256 out  = Vault(to_vault).deposit(amount, msg.sender);

        require(out >= min_amount_out, "out too low");
        if (origin != UNKNOWN_ORIGIN){
            emit Orgin(origin);
        }
    }

    function remove_liquidity_one_coin(
        address token,
        address pool,
        uint256 amount,
        uint128 n
    ) internal returns (uint256) {
        uint256 amountBefore = IERC20(token).balanceOf(address(this));
        pool.call(
            abi.encodeWithSignature(
                "remove_liquidity_one_coin(uint256,int128,uint256)",
                amount,
                int128(n),
                1
            )
        );

        uint256 newAmount = IERC20(token).balanceOf(address(this));

        if (newAmount > amountBefore) {
            return newAmount;
        }

        pool.call(
            abi.encodeWithSignature(
                "remove_liquidity_one_coin(uint256,uint256,uint256)",
                amount,
                uint256(n),
                1
            )
        );
        return IERC20(token).balanceOf(address(this));
    }

    function estimate_out(
        address from_vault,
        address to_vault,
        uint256 amount,
        Swap[] calldata instructions,
        uint256 donation
    ) public view returns (uint256) {
        uint256 pricePerShareFrom = Vault(from_vault).pricePerShare();
        uint256 pricePerShareTo = Vault(to_vault).pricePerShare();
        amount =
            (amount * pricePerShareFrom) /
            (10**Vault(from_vault).decimals());
        for (uint256 i = 0; i < instructions.length; i++) {
            uint256 n_coins = registry.get_n_coins(instructions[i].pool)[0];
            if (instructions[i].deposit) {
                n_coins = registry.get_n_coins(instructions[i].pool)[0];
                uint256[] memory list = new uint256[](n_coins);
                list[instructions[i].n] = amount;

                if (n_coins == 2) {
                    amount = StableSwap(instructions[i].pool).calc_token_amount(
                            [list[0], list[1]],
                            true
                        );
                } else if (n_coins == 3) {
                    amount = StableSwap(instructions[i].pool).calc_token_amount(
                            [list[0], list[1], list[2]],
                            true
                        );
                } else if (n_coins == 4) {
                    amount = StableSwap(instructions[i].pool).calc_token_amount(
                            [list[0], list[1], list[2], list[3]],
                            true
                        );
                }
            } else {
                amount = calc_withdraw_one_coin(
                    instructions[i].pool,
                    amount,
                    instructions[i].n
                );
            }
        }
        amount -= (amount * (MAX_DONATION - donation) / MAX_DONATION);
        return (amount * (10**Vault(to_vault).decimals())) / pricePerShareTo;
    }

    function approve(
        address target,
        address to_vault,
        uint256 amount
    ) internal {
        if (IERC20(target).allowance(address(this), to_vault) < amount) {
            SafeERC20.safeApprove(IERC20(target), to_vault, 0);
            SafeERC20.safeApprove(IERC20(target), to_vault, type(uint256).max);
        }
    }

    function calc_withdraw_one_coin(
        address pool,
        uint256 amount,
        uint128 n
    ) internal view returns (uint256) {
        (bool success, bytes memory returnData) = pool.staticcall(
            abi.encodeWithSignature(
                "calc_withdraw_one_coin(uint256,uint256)",
                amount,
                uint256(n)
            )
        );
        if (success) {
            return abi.decode(returnData, (uint256));
        }
        (success, returnData) = pool.staticcall(
            abi.encodeWithSignature(
                "calc_withdraw_one_coin(uint256,int128)",
                amount,
                int128(n)
            )
        );

        require(success, "!success");

        return abi.decode(returnData, (uint256));
    }
}
        

/

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        require(_initializing || !_initialized, "Initializable: contract is already initialized");

        bool isTopLevelCall = !_initializing;
        if (isTopLevelCall) {
            _initializing = true;
            _initialized = true;
        }

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }
}
          

/

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "IERC20.sol";
import "Address.sol";

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

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

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

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

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

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

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

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

/

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

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

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

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

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

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

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

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

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

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

        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

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

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

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}
          

/

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

Compiler Settings

{"remappings":[],"optimizer":{"runs":200,"enabled":true},"metadata":{"bytecodeHash":"ipfs"},"libraries":{},"evmVersion":"istanbul","compilationTarget":{"VaultSwapper.sol":"VaultSwapper"}}
              

Contract ABI

[{"type":"event","name":"Orgin","inputs":[{"type":"uint256","name":"origin","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"estimate_out","inputs":[{"type":"address","name":"from_vault","internalType":"address"},{"type":"address","name":"to_vault","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"tuple[]","name":"instructions","internalType":"struct VaultSwapper.Swap[]","components":[{"type":"bool","name":"deposit","internalType":"bool"},{"type":"address","name":"pool","internalType":"address"},{"type":"uint128","name":"n","internalType":"uint128"}]},{"type":"uint256","name":"donation","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialize","inputs":[{"type":"address","name":"_owner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"metapool_estimate_out","inputs":[{"type":"address","name":"from_vault","internalType":"address"},{"type":"address","name":"to_vault","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"donation","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"metapool_swap","inputs":[{"type":"address","name":"from_vault","internalType":"address"},{"type":"address","name":"to_vault","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"min_amount_out","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"metapool_swap","inputs":[{"type":"address","name":"from_vault","internalType":"address"},{"type":"address","name":"to_vault","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"min_amount_out","internalType":"uint256"},{"type":"uint256","name":"donation","internalType":"uint256"},{"type":"uint256","name":"origin","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"metapool_swap_with_signature","inputs":[{"type":"address","name":"from_vault","internalType":"address"},{"type":"address","name":"to_vault","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"min_amount_out","internalType":"uint256"},{"type":"uint256","name":"expiry","internalType":"uint256"},{"type":"bytes","name":"signature","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"metapool_swap_with_signature","inputs":[{"type":"address","name":"from_vault","internalType":"address"},{"type":"address","name":"to_vault","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"min_amount_out","internalType":"uint256"},{"type":"uint256","name":"expiry","internalType":"uint256"},{"type":"bytes","name":"signature","internalType":"bytes"},{"type":"uint256","name":"donation","internalType":"uint256"},{"type":"uint256","name":"origin","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"set_owner","inputs":[{"type":"address","name":"new_owner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"swap","inputs":[{"type":"address","name":"from_vault","internalType":"address"},{"type":"address","name":"to_vault","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"min_amount_out","internalType":"uint256"},{"type":"tuple[]","name":"instructions","internalType":"struct VaultSwapper.Swap[]","components":[{"type":"bool","name":"deposit","internalType":"bool"},{"type":"address","name":"pool","internalType":"address"},{"type":"uint128","name":"n","internalType":"uint128"}]}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"swap","inputs":[{"type":"address","name":"from_vault","internalType":"address"},{"type":"address","name":"to_vault","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"min_amount_out","internalType":"uint256"},{"type":"tuple[]","name":"instructions","internalType":"struct VaultSwapper.Swap[]","components":[{"type":"bool","name":"deposit","internalType":"bool"},{"type":"address","name":"pool","internalType":"address"},{"type":"uint128","name":"n","internalType":"uint128"}]},{"type":"uint256","name":"donation","internalType":"uint256"},{"type":"uint256","name":"origin","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"swap_with_signature","inputs":[{"type":"address","name":"from_vault","internalType":"address"},{"type":"address","name":"to_vault","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"min_amount_out","internalType":"uint256"},{"type":"tuple[]","name":"instructions","internalType":"struct VaultSwapper.Swap[]","components":[{"type":"bool","name":"deposit","internalType":"bool"},{"type":"address","name":"pool","internalType":"address"},{"type":"uint128","name":"n","internalType":"uint128"}]},{"type":"uint256","name":"expiry","internalType":"uint256"},{"type":"bytes","name":"signature","internalType":"bytes"},{"type":"uint256","name":"donation","internalType":"uint256"},{"type":"uint256","name":"origin","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"swap_with_signature","inputs":[{"type":"address","name":"from_vault","internalType":"address"},{"type":"address","name":"to_vault","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"min_amount_out","internalType":"uint256"},{"type":"tuple[]","name":"instructions","internalType":"struct VaultSwapper.Swap[]","components":[{"type":"bool","name":"deposit","internalType":"bool"},{"type":"address","name":"pool","internalType":"address"},{"type":"uint128","name":"n","internalType":"uint128"}]},{"type":"uint256","name":"expiry","internalType":"uint256"},{"type":"bytes","name":"signature","internalType":"bytes"}]}]
              

Contract Creation Code

Verify & Publish
0x608060405234801561001057600080fd5b50613886806100206000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c806398959a351161008c578063c4ffbe9c11610066578063c4ffbe9c146101b2578063db4d77cb146101c5578063e01bfd5c146101d8578063e6bbed20146101eb57600080fd5b806398959a351461016b578063ae39235c1461017e578063c4d66de81461019f57600080fd5b80630144f20a146100d457806310f2e0c8146100e957806321b46c5f146100fc5780636c1b7c821461010f5780637cb97b2b146101225780638da5cb5b14610135575b600080fd5b6100e76100e2366004612ede565b6101fe565b005b6100e76100f7366004612e98565b610218565b6100e761010a36600461300c565b61022e565b6100e761011d366004612f59565b6102df565b6100e7610130366004612de4565b6102ff565b60005461014e906201000090046001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100e7610179366004613164565b610359565b61019161018c366004612e98565b610375565b604051908152602001610162565b6100e76101ad366004612de4565b6108e5565b6100e76101c03660046131e9565b6109c0565b6101916101d3366004612e1e565b610a62565b6100e76101e63660046130da565b611274565b6100e76101f9366004613281565b611d51565b610210868686868686601e6000611274565b505050505050565b61022884848484601e6000611d51565b50505050565b604051639fd5a6cf60e01b81526001600160a01b038c1690639fd5a6cf9061026490339030908e908b908b908b9060040161350f565b602060405180830381600087803b15801561027e57600080fd5b505af1158015610292573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102b6919061342b565b6102c2576102c26137d2565b6102d28b8b8b8b8b8b8888611274565b5050505050505050505050565b6102f4898989898989898989601e600061022e565b505050505050505050565b6000546201000090046001600160a01b0316331461031c57600080fd5b6001600160a01b03811661032f57600080fd5b600080546001600160a01b03909216620100000262010000600160b01b0319909216919091179055565b61036c87878787878787601e60006109c0565b50505050505050565b600080856001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156103b157600080fd5b505afa1580156103c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103e99190612e01565b90506000856001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b15801561042657600080fd5b505afa15801561043a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061045e9190612e01565b60405163bdf475c360e01b81526001600160a01b03841660048201529091506000907390e00ace148ca3b23ac1bc8c240c2a7dd9c2d7f59063bdf475c39060240160206040518083038186803b1580156104b757600080fd5b505afa1580156104cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104ef9190612e01565b60405163bdf475c360e01b81526001600160a01b03841660048201529091506000907390e00ace148ca3b23ac1bc8c240c2a7dd9c2d7f59063bdf475c39060240160206040518083038186803b15801561054857600080fd5b505afa15801561055c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105809190612e01565b90506000896001600160a01b03166399530b066040518163ffffffff1660e01b815260040160206040518083038186803b1580156105bd57600080fd5b505afa1580156105d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f59190613471565b90506000896001600160a01b03166399530b066040518163ffffffff1660e01b815260040160206040518083038186803b15801561063257600080fd5b505afa158015610646573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061066a9190613471565b905060008b6001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156106a757600080fd5b505afa1580156106bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106df9190613471565b6106ea90600a6136ab565b6106f48b85613755565b6106fe9190613646565b60405163cc2b27d760e01b815260048101829052600160248201529091506001600160a01b0386169063cc2b27d79060440160206040518083038186803b15801561074857600080fd5b505afa15801561075c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107809190613471565b6040805180820182526000815260208101839052905163ed8e84f360e01b81529192506001600160a01b0386169163ed8e84f3916107c39160019060040161356b565b60206040518083038186803b1580156107db57600080fd5b505afa1580156107ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108139190613471565b90506127106108228a82613774565b61082c9083613755565b6108369190613646565b6108409082613774565b9050818b6001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561087c57600080fd5b505afa158015610890573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b49190613471565b6108bf90600a6136ab565b6108c99083613755565b6108d39190613646565b9750505050505050505b949350505050565b600054610100900460ff16806108fe575060005460ff16155b6109665760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b600054610100900460ff16158015610988576000805461ffff19166101011790555b6000805462010000600160b01b031916620100006001600160a01b0385160217905580156109bc576000805461ff00191690555b5050565b604051639fd5a6cf60e01b81526001600160a01b038a1690639fd5a6cf906109f690339030908c908b908b908b9060040161350f565b602060405180830381600087803b158015610a1057600080fd5b505af1158015610a24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a48919061342b565b610a5457610a546137d2565b6102f4898989898686611d51565b600080876001600160a01b03166399530b066040518163ffffffff1660e01b815260040160206040518083038186803b158015610a9e57600080fd5b505afa158015610ab2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad69190613471565b90506000876001600160a01b03166399530b066040518163ffffffff1660e01b815260040160206040518083038186803b158015610b1357600080fd5b505afa158015610b27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b4b9190613471565b9050886001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015610b8657600080fd5b505afa158015610b9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bbe9190613471565b610bc990600a6136ab565b610bd38389613755565b610bdd9190613646565b965060005b858110156111a85760007390e00ace148ca3b23ac1bc8c240c2a7dd9c2d7f563940494f1898985818110610c1857610c186137fe565b9050606002016020016020810190610c309190612de4565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401604080518083038186803b158015610c6e57600080fd5b505afa158015610c82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca69190613379565b519050878783818110610cbb57610cbb6137fe565b610cd1926020606090920201908101915061340e565b15611135577390e00ace148ca3b23ac1bc8c240c2a7dd9c2d7f563940494f1898985818110610d0257610d026137fe565b9050606002016020016020810190610d1a9190612de4565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401604080518083038186803b158015610d5857600080fd5b505afa158015610d6c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d909190613379565b5190506000816001600160401b03811115610dad57610dad613814565b604051908082528060200260200182016040528015610dd6578160200160208202803683370190505b50905089818a8a86818110610ded57610ded6137fe565b9050606002016040016020810190610e059190613448565b6001600160801b031681518110610e1e57610e1e6137fe565b6020026020010181815250508160021415610f2a57888884818110610e4557610e456137fe565b9050606002016020016020810190610e5d9190612de4565b6001600160a01b031663ed8e84f3604051806040016040528084600081518110610e8957610e896137fe565b6020026020010151815260200184600181518110610ea957610ea96137fe565b602002602001015181525060016040518363ffffffff1660e01b8152600401610ed392919061356b565b60206040518083038186803b158015610eeb57600080fd5b505afa158015610eff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f239190613471565b995061112f565b8160031415610ff357888884818110610f4557610f456137fe565b9050606002016020016020810190610f5d9190612de4565b6001600160a01b0316633883e119604051806060016040528084600081518110610f8957610f896137fe565b6020026020010151815260200184600181518110610fa957610fa96137fe565b6020026020010151815260200184600281518110610fc957610fc96137fe565b602002602001015181525060016040518363ffffffff1660e01b8152600401610ed39291906135a3565b816004141561112f5788888481811061100e5761100e6137fe565b90506060020160200160208101906110269190612de4565b6001600160a01b031663cf701ff7604051806080016040528084600081518110611052576110526137fe565b6020026020010151815260200184600181518110611072576110726137fe565b6020026020010151815260200184600281518110611092576110926137fe565b60200260200101518152602001846003815181106110b2576110b26137fe565b602002602001015181525060016040518363ffffffff1660e01b81526004016110dc9291906135db565b60206040518083038186803b1580156110f457600080fd5b505afa158015611108573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061112c9190613471565b99505b50611195565b61119288888481811061114a5761114a6137fe565b90506060020160200160208101906111629190612de4565b8a8a8a86818110611175576111756137fe565b905060600201604001602081019061118d9190613448565b6124bf565b98505b50806111a0816137b7565b915050610be2565b506127106111b68582613774565b6111c09089613755565b6111ca9190613646565b6111d49088613774565b965080886001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561121057600080fd5b505afa158015611224573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112489190613471565b61125390600a6136ab565b61125d9089613755565b6112679190613646565b9998505050505050505050565b6000886001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156112af57600080fd5b505afa1580156112c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112e79190612e01565b90506000886001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b15801561132457600080fd5b505afa158015611338573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061135c9190612e01565b6040516323b872dd60e01b8152336004820152306024820152604481018a90529091506001600160a01b038b16906323b872dd90606401602060405180830381600087803b1580156113ad57600080fd5b505af11580156113c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113e5919061342b565b50604051627b8a6760e11b8152600481018990523060248201526001600160a01b038b169062f714ce90604401602060405180830381600087803b15801561142c57600080fd5b505af1158015611440573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114649190613471565b97506000805b86811015611ba257878782818110611484576114846137fe565b61149a926020606090920201908101915061340e565b15611a29577390e00ace148ca3b23ac1bc8c240c2a7dd9c2d7f563940494f18989848181106114cb576114cb6137fe565b90506060020160200160208101906114e39190612de4565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401604080518083038186803b15801561152157600080fd5b505afa158015611535573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115599190613379565b5191506000826001600160401b0381111561157657611576613814565b60405190808252806020026020018201604052801561159f578160200160208202803683370190505b5090508a818a8a858181106115b6576115b66137fe565b90506060020160400160208101906115ce9190613448565b6001600160801b0316815181106115e7576115e76137fe565b602002602001018181525050611627858a8a85818110611609576116096137fe565b90506060020160200160208101906116219190612de4565b8d612685565b826002141561170757888883818110611642576116426137fe565b905060600201602001602081019061165a9190612de4565b6001600160a01b0316630b4c7e4d604051806040016040528084600081518110611686576116866137fe565b60200260200101518152602001846001815181106116a6576116a66137fe565b602002602001015181525060016040518363ffffffff1660e01b81526004016116d0929190613588565b600060405180830381600087803b1580156116ea57600080fd5b505af11580156116fe573d6000803e3d6000fd5b505050506118ec565b82600314156117d057888883818110611722576117226137fe565b905060600201602001602081019061173a9190612de4565b6001600160a01b0316634515cef3604051806060016040528084600081518110611766576117666137fe565b6020026020010151815260200184600181518110611786576117866137fe565b60200260200101518152602001846002815181106117a6576117a66137fe565b602002602001015181525060016040518363ffffffff1660e01b81526004016116d09291906135c0565b82600414156118ec578888838181106117eb576117eb6137fe565b90506060020160200160208101906118039190612de4565b6001600160a01b031663029b2f3460405180608001604052808460008151811061182f5761182f6137fe565b602002602001015181526020018460018151811061184f5761184f6137fe565b602002602001015181526020018460028151811061186f5761186f6137fe565b602002602001015181526020018460038151811061188f5761188f6137fe565b602002602001015181525060016040518363ffffffff1660e01b81526004016118b99291906135f8565b600060405180830381600087803b1580156118d357600080fd5b505af11580156118e7573d6000803e3d6000fd5b505050505b7390e00ace148ca3b23ac1bc8c240c2a7dd9c2d7f563379510498a8a85818110611918576119186137fe565b90506060020160200160208101906119309190612de4565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160206040518083038186803b15801561196f57600080fd5b505afa158015611983573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119a79190612e01565b6040516370a0823160e01b81523060048201529095506001600160a01b038616906370a082319060240160206040518083038186803b1580156119e957600080fd5b505afa1580156119fd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a219190613471565b9a5050611b90565b7390e00ace148ca3b23ac1bc8c240c2a7dd9c2d7f5639ac90d3d898984818110611a5557611a556137fe565b9050606002016020016020810190611a6d9190612de4565b6040516001600160e01b031960e084901b1681526001600160a01b0390911660048201526024016101006040518083038186803b158015611aad57600080fd5b505afa158015611ac1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ae591906132da565b888883818110611af757611af76137fe565b9050606002016040016020810190611b0f9190613448565b6001600160801b031660088110611b2857611b286137fe565b60200201519350611b8d84898984818110611b4557611b456137fe565b9050606002016020016020810190611b5d9190612de4565b8c8b8b86818110611b7057611b706137fe565b9050606002016040016020810190611b889190613448565b61272b565b99505b80611b9a816137b7565b91505061146a565b50826001600160a01b0316826001600160a01b031614611bec5760405162461bcd60e51b8152602060048201526005602482015264042e0c2e8d60db1b604482015260640161095d565b8415611c3b576000612710611c01878c613755565b611c0b9190613646565b9050611c2d83600060029054906101000a90046001600160a01b031683612a04565b611c37818b613774565b9950505b611c46828b8b612685565b604051636e553f6560e01b8152600481018a90523360248201526000906001600160a01b038c1690636e553f6590604401602060405180830381600087803b158015611c9157600080fd5b505af1158015611ca5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cc99190613471565b905088811015611d095760405162461bcd60e51b815260206004820152600b60248201526a6f757420746f6f206c6f7760a81b604482015260640161095d565b8415611d43576040518581527f1d88ab38501b182d34894ae870cff002e62604457d0afd3e89469f3167adc8999060200160405180910390a15b505050505050505050505050565b6000866001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b158015611d8c57600080fd5b505afa158015611da0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dc49190612e01565b90506000866001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b158015611e0157600080fd5b505afa158015611e15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e399190612e01565b60405163bdf475c360e01b81526001600160a01b03841660048201529091506000907390e00ace148ca3b23ac1bc8c240c2a7dd9c2d7f59063bdf475c39060240160206040518083038186803b158015611e9257600080fd5b505afa158015611ea6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611eca9190612e01565b60405163bdf475c360e01b81526001600160a01b03841660048201529091506000907390e00ace148ca3b23ac1bc8c240c2a7dd9c2d7f59063bdf475c39060240160206040518083038186803b158015611f2357600080fd5b505afa158015611f37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f5b9190612e01565b6040516323b872dd60e01b8152336004820152306024820152604481018a90529091506001600160a01b038b16906323b872dd90606401602060405180830381600087803b158015611fac57600080fd5b505af1158015611fc0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fe4919061342b565b50604051627b8a6760e11b8152600481018990523060248201526000906001600160a01b038c169062f714ce90604401602060405180830381600087803b15801561202e57600080fd5b505af1158015612042573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120669190613471565b604051630d2680e960e11b81526004810182905260016024820181905260448201529091506001600160a01b03841690631a4d01d290606401600060405180830381600087803b1580156120b957600080fd5b505af11580156120cd573d6000803e3d6000fd5b5050604051639ac90d3d60e01b81526001600160a01b0386166004820152600092507390e00ace148ca3b23ac1bc8c240c2a7dd9c2d7f59150639ac90d3d906024016101006040518083038186803b15801561212857600080fd5b505afa15801561213c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061216091906132da565b602001516040516370a0823160e01b81523060048201529091506000906001600160a01b038316906370a082319060240160206040518083038186803b1580156121a957600080fd5b505afa1580156121bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121e19190613471565b60405163095ea7b360e01b81526001600160a01b038681166004830152602482018390529192509083169063095ea7b390604401602060405180830381600087803b15801561222f57600080fd5b505af1158015612243573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612267919061342b565b5060408051808201825260008152602081018390529051630b4c7e4d60e01b81526001600160a01b03861691630b4c7e4d916122a99190600190600401613588565b600060405180830381600087803b1580156122c357600080fd5b505af11580156122d7573d6000803e3d6000fd5b50506040516370a0823160e01b8152306004820152600092506001600160a01b03891691506370a082319060240160206040518083038186803b15801561231d57600080fd5b505afa158015612331573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123559190613471565b905089156123a657600061271061236c8c84613755565b6123769190613646565b905061239888600060029054906101000a90046001600160a01b031683612a04565b6123a28183613774565b9150505b6123b1878e83612685565b604051636e553f6560e01b8152600481018290523360248201526000906001600160a01b038f1690636e553f6590604401602060405180830381600087803b1580156123fc57600080fd5b505af1158015612410573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124349190613471565b90508b8110156124745760405162461bcd60e51b815260206004820152600b60248201526a6f757420746f6f206c6f7760a81b604482015260640161095d565b89156124ae576040518a81527f1d88ab38501b182d34894ae870cff002e62604457d0afd3e89469f3167adc8999060200160405180910390a15b505050505050505050505050505050565b6000806000856001600160a01b031685856001600160801b03166040516024016124f3929190918252602082015260400190565b60408051601f198184030181529181526020820180516001600160e01b03166327d8462f60e11b1790525161252891906134f3565b600060405180830381855afa9150503d8060008114612563576040519150601f19603f3d011682016040523d82523d6000602084013e612568565b606091505b5091509150811561259057808060200190518101906125879190613471565b9250505061267e565b60405160248101869052600f85900b60448201526001600160a01b0387169060640160408051601f198184030181529181526020820180516001600160e01b031663cc2b27d760e01b179052516125e791906134f3565b600060405180830381855afa9150503d8060008114612622576040519150601f19603f3d011682016040523d82523d6000602084013e612627565b606091505b509092509050816126655760405162461bcd60e51b8152602060048201526008602482015267217375636365737360c01b604482015260640161095d565b808060200190518101906126799190613471565b925050505b9392505050565b604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015282919085169063dd62ed3e9060440160206040518083038186803b1580156126cf57600080fd5b505afa1580156126e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127079190613471565b10156127265761271983836000612a67565b6127268383600019612a67565b505050565b6040516370a0823160e01b815230600482015260009081906001600160a01b038716906370a082319060240160206040518083038186803b15801561276f57600080fd5b505afa158015612783573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127a79190613471565b60405160248101869052600f85900b6044820152600160648201529091506001600160a01b0386169060840160408051601f198184030181529181526020820180516001600160e01b0316630d2680e960e11b1790525161280891906134f3565b6000604051808303816000865af19150503d8060008114612845576040519150601f19603f3d011682016040523d82523d6000602084013e61284a565b606091505b50506040516370a0823160e01b8152306004820152600091506001600160a01b038816906370a082319060240160206040518083038186803b15801561288f57600080fd5b505afa1580156128a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128c79190613471565b9050818111156128da5791506108dd9050565b604051602481018690526001600160801b0385166044820152600160648201526001600160a01b0387169060840160408051601f198184030181529181526020820180516001600160e01b031663f1dc3cc960e01b1790525161293d91906134f3565b6000604051808303816000865af19150503d806000811461297a576040519150601f19603f3d011682016040523d82523d6000602084013e61297f565b606091505b50506040516370a0823160e01b81523060048201526001600160a01b03891691506370a082319060240160206040518083038186803b1580156129c157600080fd5b505afa1580156129d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129f99190613471565b979650505050505050565b6040516001600160a01b03831660248201526044810182905261272690849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612b8b565b801580612af05750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b158015612ab657600080fd5b505afa158015612aca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612aee9190613471565b155b612b5b5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b606482015260840161095d565b6040516001600160a01b03831660248201526044810182905261272690849063095ea7b360e01b90606401612a30565b6000612be0826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612c5d9092919063ffffffff16565b8051909150156127265780806020019051810190612bfe919061342b565b6127265760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161095d565b60606108dd848460008585843b612cb65760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161095d565b600080866001600160a01b03168587604051612cd291906134f3565b60006040518083038185875af1925050503d8060008114612d0f576040519150601f19603f3d011682016040523d82523d6000602084013e612d14565b606091505b50915091506129f982828660608315612d2e57508161267e565b825115612d3e5782518084602001fd5b8160405162461bcd60e51b815260040161095d9190613613565b60008083601f840112612d6a57600080fd5b5081356001600160401b03811115612d8157600080fd5b602083019150836020606083028501011115612d9c57600080fd5b9250929050565b60008083601f840112612db557600080fd5b5081356001600160401b03811115612dcc57600080fd5b602083019150836020828501011115612d9c57600080fd5b600060208284031215612df657600080fd5b813561267e8161382a565b600060208284031215612e1357600080fd5b815161267e8161382a565b60008060008060008060a08789031215612e3757600080fd5b8635612e428161382a565b95506020870135612e528161382a565b94506040870135935060608701356001600160401b03811115612e7457600080fd5b612e8089828a01612d58565b979a9699509497949695608090950135949350505050565b60008060008060808587031215612eae57600080fd5b8435612eb98161382a565b93506020850135612ec98161382a565b93969395505050506040820135916060013590565b60008060008060008060a08789031215612ef757600080fd5b8635612f028161382a565b95506020870135612f128161382a565b9450604087013593506060870135925060808701356001600160401b03811115612f3b57600080fd5b612f4789828a01612d58565b979a9699509497509295939492505050565b600080600080600080600080600060e08a8c031215612f7757600080fd5b8935612f828161382a565b985060208a0135612f928161382a565b975060408a0135965060608a0135955060808a01356001600160401b0380821115612fbc57600080fd5b612fc88d838e01612d58565b909750955060a08c0135945060c08c0135915080821115612fe857600080fd5b50612ff58c828d01612da3565b915080935050809150509295985092959850929598565b60008060008060008060008060008060006101208c8e03121561302e57600080fd5b6130388c3561382a565b8b359a5061304960208d013561382a565b60208c0135995060408c0135985060608c013597506001600160401b038060808e0135111561307757600080fd5b6130878e60808f01358f01612d58565b909850965060a08d0135955060c08d01358110156130a457600080fd5b506130b58d60c08e01358e01612da3565b9b9e9a9d50989b979a96999598949794969560e0860135956101000135945092505050565b60008060008060008060008060e0898b0312156130f657600080fd5b88356131018161382a565b975060208901356131118161382a565b9650604089013595506060890135945060808901356001600160401b0381111561313a57600080fd5b6131468b828c01612d58565b999c989b5096999598969760a08701359660c0013595509350505050565b600080600080600080600060c0888a03121561317f57600080fd5b873561318a8161382a565b9650602088013561319a8161382a565b955060408801359450606088013593506080880135925060a08801356001600160401b038111156131ca57600080fd5b6131d68a828b01612da3565b989b979a50959850939692959293505050565b60008060008060008060008060006101008a8c03121561320857600080fd5b89356132138161382a565b985060208a01356132238161382a565b975060408a0135965060608a0135955060808a0135945060a08a01356001600160401b0381111561325357600080fd5b61325f8c828d01612da3565b9a9d999c50979a96999598959660c08101359660e09091013595509350505050565b60008060008060008060c0878903121561329a57600080fd5b86356132a58161382a565b955060208701356132b58161382a565b95989597505050506040840135936060810135936080820135935060a0909101359150565b60006101008083850312156132ee57600080fd5b83601f8401126132fd57600080fd5b6040518181018181106001600160401b038211171561332c57634e487b7160e01b600052604160045260246000fd5b604052808483810187101561334057600080fd5b600093505b600884101561336e5780516133598161382a565b82526001939093019260209182019101613345565b509095945050505050565b60006040828403121561338b57600080fd5b82601f83011261339a57600080fd5b604051604081018181106001600160401b03821117156133ca57634e487b7160e01b600052604160045260246000fd5b80604052508083856040860111156133e157600080fd5b60005b60028110156134035781518352602092830192909101906001016133e4565b509195945050505050565b60006020828403121561342057600080fd5b813561267e81613842565b60006020828403121561343d57600080fd5b815161267e81613842565b60006020828403121561345a57600080fd5b81356001600160801b038116811461267e57600080fd5b60006020828403121561348357600080fd5b5051919050565b8060005b600281101561022857815184526020938401939091019060010161348e565b8060005b60038110156102285781518452602093840193909101906001016134b1565b8060005b60048110156102285781518452602093840193909101906001016134d4565b6000825161350581846020870161378b565b9190910192915050565b6001600160a01b03878116825286166020820152604081018590526060810184905260a06080820181905281018290526000828460c0840137600060c0848401015260c0601f19601f8501168301019050979650505050505050565b60608101613579828561348a565b82151560408301529392505050565b60608101613596828561348a565b8260408301529392505050565b608081016135b182856134ad565b82151560608301529392505050565b608081016135ce82856134ad565b8260608301529392505050565b60a081016135e982856134d0565b82151560808301529392505050565b60a0810161360682856134d0565b8260808301529392505050565b602081526000825180602084015261363281604085016020870161378b565b601f01601f19169190910160400192915050565b60008261366357634e487b7160e01b600052601260045260246000fd5b500490565b600181815b808511156136a3578160001904821115613689576136896137e8565b8085161561369657918102915b93841c939080029061366d565b509250929050565b600061267e83836000826136c15750600161374f565b816136ce5750600061374f565b81600181146136e457600281146136ee5761370a565b600191505061374f565b60ff8411156136ff576136ff6137e8565b50506001821b61374f565b5060208310610133831016604e8410600b841016171561372d575081810a61374f565b6137378383613668565b806000190482111561374b5761374b6137e8565b0290505b92915050565b600081600019048311821515161561376f5761376f6137e8565b500290565b600082821015613786576137866137e8565b500390565b60005b838110156137a657818101518382015260200161378e565b838111156102285750506000910152565b60006000198214156137cb576137cb6137e8565b5060010190565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461383f57600080fd5b50565b801515811461383f57600080fdfea2646970667358221220aaf5b1a876f839a03158246f47a03c5f22d8a97c703b4a8a25733bc7325e7e9664736f6c63430008060033

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c806398959a351161008c578063c4ffbe9c11610066578063c4ffbe9c146101b2578063db4d77cb146101c5578063e01bfd5c146101d8578063e6bbed20146101eb57600080fd5b806398959a351461016b578063ae39235c1461017e578063c4d66de81461019f57600080fd5b80630144f20a146100d457806310f2e0c8146100e957806321b46c5f146100fc5780636c1b7c821461010f5780637cb97b2b146101225780638da5cb5b14610135575b600080fd5b6100e76100e2366004612ede565b6101fe565b005b6100e76100f7366004612e98565b610218565b6100e761010a36600461300c565b61022e565b6100e761011d366004612f59565b6102df565b6100e7610130366004612de4565b6102ff565b60005461014e906201000090046001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100e7610179366004613164565b610359565b61019161018c366004612e98565b610375565b604051908152602001610162565b6100e76101ad366004612de4565b6108e5565b6100e76101c03660046131e9565b6109c0565b6101916101d3366004612e1e565b610a62565b6100e76101e63660046130da565b611274565b6100e76101f9366004613281565b611d51565b610210868686868686601e6000611274565b505050505050565b61022884848484601e6000611d51565b50505050565b604051639fd5a6cf60e01b81526001600160a01b038c1690639fd5a6cf9061026490339030908e908b908b908b9060040161350f565b602060405180830381600087803b15801561027e57600080fd5b505af1158015610292573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102b6919061342b565b6102c2576102c26137d2565b6102d28b8b8b8b8b8b8888611274565b5050505050505050505050565b6102f4898989898989898989601e600061022e565b505050505050505050565b6000546201000090046001600160a01b0316331461031c57600080fd5b6001600160a01b03811661032f57600080fd5b600080546001600160a01b03909216620100000262010000600160b01b0319909216919091179055565b61036c87878787878787601e60006109c0565b50505050505050565b600080856001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156103b157600080fd5b505afa1580156103c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103e99190612e01565b90506000856001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b15801561042657600080fd5b505afa15801561043a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061045e9190612e01565b60405163bdf475c360e01b81526001600160a01b03841660048201529091506000907390e00ace148ca3b23ac1bc8c240c2a7dd9c2d7f59063bdf475c39060240160206040518083038186803b1580156104b757600080fd5b505afa1580156104cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104ef9190612e01565b60405163bdf475c360e01b81526001600160a01b03841660048201529091506000907390e00ace148ca3b23ac1bc8c240c2a7dd9c2d7f59063bdf475c39060240160206040518083038186803b15801561054857600080fd5b505afa15801561055c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105809190612e01565b90506000896001600160a01b03166399530b066040518163ffffffff1660e01b815260040160206040518083038186803b1580156105bd57600080fd5b505afa1580156105d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f59190613471565b90506000896001600160a01b03166399530b066040518163ffffffff1660e01b815260040160206040518083038186803b15801561063257600080fd5b505afa158015610646573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061066a9190613471565b905060008b6001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156106a757600080fd5b505afa1580156106bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106df9190613471565b6106ea90600a6136ab565b6106f48b85613755565b6106fe9190613646565b60405163cc2b27d760e01b815260048101829052600160248201529091506001600160a01b0386169063cc2b27d79060440160206040518083038186803b15801561074857600080fd5b505afa15801561075c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107809190613471565b6040805180820182526000815260208101839052905163ed8e84f360e01b81529192506001600160a01b0386169163ed8e84f3916107c39160019060040161356b565b60206040518083038186803b1580156107db57600080fd5b505afa1580156107ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108139190613471565b90506127106108228a82613774565b61082c9083613755565b6108369190613646565b6108409082613774565b9050818b6001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561087c57600080fd5b505afa158015610890573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b49190613471565b6108bf90600a6136ab565b6108c99083613755565b6108d39190613646565b9750505050505050505b949350505050565b600054610100900460ff16806108fe575060005460ff16155b6109665760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b600054610100900460ff16158015610988576000805461ffff19166101011790555b6000805462010000600160b01b031916620100006001600160a01b0385160217905580156109bc576000805461ff00191690555b5050565b604051639fd5a6cf60e01b81526001600160a01b038a1690639fd5a6cf906109f690339030908c908b908b908b9060040161350f565b602060405180830381600087803b158015610a1057600080fd5b505af1158015610a24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a48919061342b565b610a5457610a546137d2565b6102f4898989898686611d51565b600080876001600160a01b03166399530b066040518163ffffffff1660e01b815260040160206040518083038186803b158015610a9e57600080fd5b505afa158015610ab2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad69190613471565b90506000876001600160a01b03166399530b066040518163ffffffff1660e01b815260040160206040518083038186803b158015610b1357600080fd5b505afa158015610b27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b4b9190613471565b9050886001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015610b8657600080fd5b505afa158015610b9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bbe9190613471565b610bc990600a6136ab565b610bd38389613755565b610bdd9190613646565b965060005b858110156111a85760007390e00ace148ca3b23ac1bc8c240c2a7dd9c2d7f563940494f1898985818110610c1857610c186137fe565b9050606002016020016020810190610c309190612de4565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401604080518083038186803b158015610c6e57600080fd5b505afa158015610c82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca69190613379565b519050878783818110610cbb57610cbb6137fe565b610cd1926020606090920201908101915061340e565b15611135577390e00ace148ca3b23ac1bc8c240c2a7dd9c2d7f563940494f1898985818110610d0257610d026137fe565b9050606002016020016020810190610d1a9190612de4565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401604080518083038186803b158015610d5857600080fd5b505afa158015610d6c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d909190613379565b5190506000816001600160401b03811115610dad57610dad613814565b604051908082528060200260200182016040528015610dd6578160200160208202803683370190505b50905089818a8a86818110610ded57610ded6137fe565b9050606002016040016020810190610e059190613448565b6001600160801b031681518110610e1e57610e1e6137fe565b6020026020010181815250508160021415610f2a57888884818110610e4557610e456137fe565b9050606002016020016020810190610e5d9190612de4565b6001600160a01b031663ed8e84f3604051806040016040528084600081518110610e8957610e896137fe565b6020026020010151815260200184600181518110610ea957610ea96137fe565b602002602001015181525060016040518363ffffffff1660e01b8152600401610ed392919061356b565b60206040518083038186803b158015610eeb57600080fd5b505afa158015610eff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f239190613471565b995061112f565b8160031415610ff357888884818110610f4557610f456137fe565b9050606002016020016020810190610f5d9190612de4565b6001600160a01b0316633883e119604051806060016040528084600081518110610f8957610f896137fe565b6020026020010151815260200184600181518110610fa957610fa96137fe565b6020026020010151815260200184600281518110610fc957610fc96137fe565b602002602001015181525060016040518363ffffffff1660e01b8152600401610ed39291906135a3565b816004141561112f5788888481811061100e5761100e6137fe565b90506060020160200160208101906110269190612de4565b6001600160a01b031663cf701ff7604051806080016040528084600081518110611052576110526137fe565b6020026020010151815260200184600181518110611072576110726137fe565b6020026020010151815260200184600281518110611092576110926137fe565b60200260200101518152602001846003815181106110b2576110b26137fe565b602002602001015181525060016040518363ffffffff1660e01b81526004016110dc9291906135db565b60206040518083038186803b1580156110f457600080fd5b505afa158015611108573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061112c9190613471565b99505b50611195565b61119288888481811061114a5761114a6137fe565b90506060020160200160208101906111629190612de4565b8a8a8a86818110611175576111756137fe565b905060600201604001602081019061118d9190613448565b6124bf565b98505b50806111a0816137b7565b915050610be2565b506127106111b68582613774565b6111c09089613755565b6111ca9190613646565b6111d49088613774565b965080886001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561121057600080fd5b505afa158015611224573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112489190613471565b61125390600a6136ab565b61125d9089613755565b6112679190613646565b9998505050505050505050565b6000886001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156112af57600080fd5b505afa1580156112c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112e79190612e01565b90506000886001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b15801561132457600080fd5b505afa158015611338573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061135c9190612e01565b6040516323b872dd60e01b8152336004820152306024820152604481018a90529091506001600160a01b038b16906323b872dd90606401602060405180830381600087803b1580156113ad57600080fd5b505af11580156113c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113e5919061342b565b50604051627b8a6760e11b8152600481018990523060248201526001600160a01b038b169062f714ce90604401602060405180830381600087803b15801561142c57600080fd5b505af1158015611440573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114649190613471565b97506000805b86811015611ba257878782818110611484576114846137fe565b61149a926020606090920201908101915061340e565b15611a29577390e00ace148ca3b23ac1bc8c240c2a7dd9c2d7f563940494f18989848181106114cb576114cb6137fe565b90506060020160200160208101906114e39190612de4565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401604080518083038186803b15801561152157600080fd5b505afa158015611535573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115599190613379565b5191506000826001600160401b0381111561157657611576613814565b60405190808252806020026020018201604052801561159f578160200160208202803683370190505b5090508a818a8a858181106115b6576115b66137fe565b90506060020160400160208101906115ce9190613448565b6001600160801b0316815181106115e7576115e76137fe565b602002602001018181525050611627858a8a85818110611609576116096137fe565b90506060020160200160208101906116219190612de4565b8d612685565b826002141561170757888883818110611642576116426137fe565b905060600201602001602081019061165a9190612de4565b6001600160a01b0316630b4c7e4d604051806040016040528084600081518110611686576116866137fe565b60200260200101518152602001846001815181106116a6576116a66137fe565b602002602001015181525060016040518363ffffffff1660e01b81526004016116d0929190613588565b600060405180830381600087803b1580156116ea57600080fd5b505af11580156116fe573d6000803e3d6000fd5b505050506118ec565b82600314156117d057888883818110611722576117226137fe565b905060600201602001602081019061173a9190612de4565b6001600160a01b0316634515cef3604051806060016040528084600081518110611766576117666137fe565b6020026020010151815260200184600181518110611786576117866137fe565b60200260200101518152602001846002815181106117a6576117a66137fe565b602002602001015181525060016040518363ffffffff1660e01b81526004016116d09291906135c0565b82600414156118ec578888838181106117eb576117eb6137fe565b90506060020160200160208101906118039190612de4565b6001600160a01b031663029b2f3460405180608001604052808460008151811061182f5761182f6137fe565b602002602001015181526020018460018151811061184f5761184f6137fe565b602002602001015181526020018460028151811061186f5761186f6137fe565b602002602001015181526020018460038151811061188f5761188f6137fe565b602002602001015181525060016040518363ffffffff1660e01b81526004016118b99291906135f8565b600060405180830381600087803b1580156118d357600080fd5b505af11580156118e7573d6000803e3d6000fd5b505050505b7390e00ace148ca3b23ac1bc8c240c2a7dd9c2d7f563379510498a8a85818110611918576119186137fe565b90506060020160200160208101906119309190612de4565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160206040518083038186803b15801561196f57600080fd5b505afa158015611983573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119a79190612e01565b6040516370a0823160e01b81523060048201529095506001600160a01b038616906370a082319060240160206040518083038186803b1580156119e957600080fd5b505afa1580156119fd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a219190613471565b9a5050611b90565b7390e00ace148ca3b23ac1bc8c240c2a7dd9c2d7f5639ac90d3d898984818110611a5557611a556137fe565b9050606002016020016020810190611a6d9190612de4565b6040516001600160e01b031960e084901b1681526001600160a01b0390911660048201526024016101006040518083038186803b158015611aad57600080fd5b505afa158015611ac1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ae591906132da565b888883818110611af757611af76137fe565b9050606002016040016020810190611b0f9190613448565b6001600160801b031660088110611b2857611b286137fe565b60200201519350611b8d84898984818110611b4557611b456137fe565b9050606002016020016020810190611b5d9190612de4565b8c8b8b86818110611b7057611b706137fe565b9050606002016040016020810190611b889190613448565b61272b565b99505b80611b9a816137b7565b91505061146a565b50826001600160a01b0316826001600160a01b031614611bec5760405162461bcd60e51b8152602060048201526005602482015264042e0c2e8d60db1b604482015260640161095d565b8415611c3b576000612710611c01878c613755565b611c0b9190613646565b9050611c2d83600060029054906101000a90046001600160a01b031683612a04565b611c37818b613774565b9950505b611c46828b8b612685565b604051636e553f6560e01b8152600481018a90523360248201526000906001600160a01b038c1690636e553f6590604401602060405180830381600087803b158015611c9157600080fd5b505af1158015611ca5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cc99190613471565b905088811015611d095760405162461bcd60e51b815260206004820152600b60248201526a6f757420746f6f206c6f7760a81b604482015260640161095d565b8415611d43576040518581527f1d88ab38501b182d34894ae870cff002e62604457d0afd3e89469f3167adc8999060200160405180910390a15b505050505050505050505050565b6000866001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b158015611d8c57600080fd5b505afa158015611da0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dc49190612e01565b90506000866001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b158015611e0157600080fd5b505afa158015611e15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e399190612e01565b60405163bdf475c360e01b81526001600160a01b03841660048201529091506000907390e00ace148ca3b23ac1bc8c240c2a7dd9c2d7f59063bdf475c39060240160206040518083038186803b158015611e9257600080fd5b505afa158015611ea6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611eca9190612e01565b60405163bdf475c360e01b81526001600160a01b03841660048201529091506000907390e00ace148ca3b23ac1bc8c240c2a7dd9c2d7f59063bdf475c39060240160206040518083038186803b158015611f2357600080fd5b505afa158015611f37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f5b9190612e01565b6040516323b872dd60e01b8152336004820152306024820152604481018a90529091506001600160a01b038b16906323b872dd90606401602060405180830381600087803b158015611fac57600080fd5b505af1158015611fc0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fe4919061342b565b50604051627b8a6760e11b8152600481018990523060248201526000906001600160a01b038c169062f714ce90604401602060405180830381600087803b15801561202e57600080fd5b505af1158015612042573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120669190613471565b604051630d2680e960e11b81526004810182905260016024820181905260448201529091506001600160a01b03841690631a4d01d290606401600060405180830381600087803b1580156120b957600080fd5b505af11580156120cd573d6000803e3d6000fd5b5050604051639ac90d3d60e01b81526001600160a01b0386166004820152600092507390e00ace148ca3b23ac1bc8c240c2a7dd9c2d7f59150639ac90d3d906024016101006040518083038186803b15801561212857600080fd5b505afa15801561213c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061216091906132da565b602001516040516370a0823160e01b81523060048201529091506000906001600160a01b038316906370a082319060240160206040518083038186803b1580156121a957600080fd5b505afa1580156121bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121e19190613471565b60405163095ea7b360e01b81526001600160a01b038681166004830152602482018390529192509083169063095ea7b390604401602060405180830381600087803b15801561222f57600080fd5b505af1158015612243573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612267919061342b565b5060408051808201825260008152602081018390529051630b4c7e4d60e01b81526001600160a01b03861691630b4c7e4d916122a99190600190600401613588565b600060405180830381600087803b1580156122c357600080fd5b505af11580156122d7573d6000803e3d6000fd5b50506040516370a0823160e01b8152306004820152600092506001600160a01b03891691506370a082319060240160206040518083038186803b15801561231d57600080fd5b505afa158015612331573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123559190613471565b905089156123a657600061271061236c8c84613755565b6123769190613646565b905061239888600060029054906101000a90046001600160a01b031683612a04565b6123a28183613774565b9150505b6123b1878e83612685565b604051636e553f6560e01b8152600481018290523360248201526000906001600160a01b038f1690636e553f6590604401602060405180830381600087803b1580156123fc57600080fd5b505af1158015612410573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124349190613471565b90508b8110156124745760405162461bcd60e51b815260206004820152600b60248201526a6f757420746f6f206c6f7760a81b604482015260640161095d565b89156124ae576040518a81527f1d88ab38501b182d34894ae870cff002e62604457d0afd3e89469f3167adc8999060200160405180910390a15b505050505050505050505050505050565b6000806000856001600160a01b031685856001600160801b03166040516024016124f3929190918252602082015260400190565b60408051601f198184030181529181526020820180516001600160e01b03166327d8462f60e11b1790525161252891906134f3565b600060405180830381855afa9150503d8060008114612563576040519150601f19603f3d011682016040523d82523d6000602084013e612568565b606091505b5091509150811561259057808060200190518101906125879190613471565b9250505061267e565b60405160248101869052600f85900b60448201526001600160a01b0387169060640160408051601f198184030181529181526020820180516001600160e01b031663cc2b27d760e01b179052516125e791906134f3565b600060405180830381855afa9150503d8060008114612622576040519150601f19603f3d011682016040523d82523d6000602084013e612627565b606091505b509092509050816126655760405162461bcd60e51b8152602060048201526008602482015267217375636365737360c01b604482015260640161095d565b808060200190518101906126799190613471565b925050505b9392505050565b604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015282919085169063dd62ed3e9060440160206040518083038186803b1580156126cf57600080fd5b505afa1580156126e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127079190613471565b10156127265761271983836000612a67565b6127268383600019612a67565b505050565b6040516370a0823160e01b815230600482015260009081906001600160a01b038716906370a082319060240160206040518083038186803b15801561276f57600080fd5b505afa158015612783573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127a79190613471565b60405160248101869052600f85900b6044820152600160648201529091506001600160a01b0386169060840160408051601f198184030181529181526020820180516001600160e01b0316630d2680e960e11b1790525161280891906134f3565b6000604051808303816000865af19150503d8060008114612845576040519150601f19603f3d011682016040523d82523d6000602084013e61284a565b606091505b50506040516370a0823160e01b8152306004820152600091506001600160a01b038816906370a082319060240160206040518083038186803b15801561288f57600080fd5b505afa1580156128a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128c79190613471565b9050818111156128da5791506108dd9050565b604051602481018690526001600160801b0385166044820152600160648201526001600160a01b0387169060840160408051601f198184030181529181526020820180516001600160e01b031663f1dc3cc960e01b1790525161293d91906134f3565b6000604051808303816000865af19150503d806000811461297a576040519150601f19603f3d011682016040523d82523d6000602084013e61297f565b606091505b50506040516370a0823160e01b81523060048201526001600160a01b03891691506370a082319060240160206040518083038186803b1580156129c157600080fd5b505afa1580156129d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129f99190613471565b979650505050505050565b6040516001600160a01b03831660248201526044810182905261272690849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612b8b565b801580612af05750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b158015612ab657600080fd5b505afa158015612aca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612aee9190613471565b155b612b5b5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b606482015260840161095d565b6040516001600160a01b03831660248201526044810182905261272690849063095ea7b360e01b90606401612a30565b6000612be0826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612c5d9092919063ffffffff16565b8051909150156127265780806020019051810190612bfe919061342b565b6127265760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161095d565b60606108dd848460008585843b612cb65760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161095d565b600080866001600160a01b03168587604051612cd291906134f3565b60006040518083038185875af1925050503d8060008114612d0f576040519150601f19603f3d011682016040523d82523d6000602084013e612d14565b606091505b50915091506129f982828660608315612d2e57508161267e565b825115612d3e5782518084602001fd5b8160405162461bcd60e51b815260040161095d9190613613565b60008083601f840112612d6a57600080fd5b5081356001600160401b03811115612d8157600080fd5b602083019150836020606083028501011115612d9c57600080fd5b9250929050565b60008083601f840112612db557600080fd5b5081356001600160401b03811115612dcc57600080fd5b602083019150836020828501011115612d9c57600080fd5b600060208284031215612df657600080fd5b813561267e8161382a565b600060208284031215612e1357600080fd5b815161267e8161382a565b60008060008060008060a08789031215612e3757600080fd5b8635612e428161382a565b95506020870135612e528161382a565b94506040870135935060608701356001600160401b03811115612e7457600080fd5b612e8089828a01612d58565b979a9699509497949695608090950135949350505050565b60008060008060808587031215612eae57600080fd5b8435612eb98161382a565b93506020850135612ec98161382a565b93969395505050506040820135916060013590565b60008060008060008060a08789031215612ef757600080fd5b8635612f028161382a565b95506020870135612f128161382a565b9450604087013593506060870135925060808701356001600160401b03811115612f3b57600080fd5b612f4789828a01612d58565b979a9699509497509295939492505050565b600080600080600080600080600060e08a8c031215612f7757600080fd5b8935612f828161382a565b985060208a0135612f928161382a565b975060408a0135965060608a0135955060808a01356001600160401b0380821115612fbc57600080fd5b612fc88d838e01612d58565b909750955060a08c0135945060c08c0135915080821115612fe857600080fd5b50612ff58c828d01612da3565b915080935050809150509295985092959850929598565b60008060008060008060008060008060006101208c8e03121561302e57600080fd5b6130388c3561382a565b8b359a5061304960208d013561382a565b60208c0135995060408c0135985060608c013597506001600160401b038060808e0135111561307757600080fd5b6130878e60808f01358f01612d58565b909850965060a08d0135955060c08d01358110156130a457600080fd5b506130b58d60c08e01358e01612da3565b9b9e9a9d50989b979a96999598949794969560e0860135956101000135945092505050565b60008060008060008060008060e0898b0312156130f657600080fd5b88356131018161382a565b975060208901356131118161382a565b9650604089013595506060890135945060808901356001600160401b0381111561313a57600080fd5b6131468b828c01612d58565b999c989b5096999598969760a08701359660c0013595509350505050565b600080600080600080600060c0888a03121561317f57600080fd5b873561318a8161382a565b9650602088013561319a8161382a565b955060408801359450606088013593506080880135925060a08801356001600160401b038111156131ca57600080fd5b6131d68a828b01612da3565b989b979a50959850939692959293505050565b60008060008060008060008060006101008a8c03121561320857600080fd5b89356132138161382a565b985060208a01356132238161382a565b975060408a0135965060608a0135955060808a0135945060a08a01356001600160401b0381111561325357600080fd5b61325f8c828d01612da3565b9a9d999c50979a96999598959660c08101359660e09091013595509350505050565b60008060008060008060c0878903121561329a57600080fd5b86356132a58161382a565b955060208701356132b58161382a565b95989597505050506040840135936060810135936080820135935060a0909101359150565b60006101008083850312156132ee57600080fd5b83601f8401126132fd57600080fd5b6040518181018181106001600160401b038211171561332c57634e487b7160e01b600052604160045260246000fd5b604052808483810187101561334057600080fd5b600093505b600884101561336e5780516133598161382a565b82526001939093019260209182019101613345565b509095945050505050565b60006040828403121561338b57600080fd5b82601f83011261339a57600080fd5b604051604081018181106001600160401b03821117156133ca57634e487b7160e01b600052604160045260246000fd5b80604052508083856040860111156133e157600080fd5b60005b60028110156134035781518352602092830192909101906001016133e4565b509195945050505050565b60006020828403121561342057600080fd5b813561267e81613842565b60006020828403121561343d57600080fd5b815161267e81613842565b60006020828403121561345a57600080fd5b81356001600160801b038116811461267e57600080fd5b60006020828403121561348357600080fd5b5051919050565b8060005b600281101561022857815184526020938401939091019060010161348e565b8060005b60038110156102285781518452602093840193909101906001016134b1565b8060005b60048110156102285781518452602093840193909101906001016134d4565b6000825161350581846020870161378b565b9190910192915050565b6001600160a01b03878116825286166020820152604081018590526060810184905260a06080820181905281018290526000828460c0840137600060c0848401015260c0601f19601f8501168301019050979650505050505050565b60608101613579828561348a565b82151560408301529392505050565b60608101613596828561348a565b8260408301529392505050565b608081016135b182856134ad565b82151560608301529392505050565b608081016135ce82856134ad565b8260608301529392505050565b60a081016135e982856134d0565b82151560808301529392505050565b60a0810161360682856134d0565b8260808301529392505050565b602081526000825180602084015261363281604085016020870161378b565b601f01601f19169190910160400192915050565b60008261366357634e487b7160e01b600052601260045260246000fd5b500490565b600181815b808511156136a3578160001904821115613689576136896137e8565b8085161561369657918102915b93841c939080029061366d565b509250929050565b600061267e83836000826136c15750600161374f565b816136ce5750600061374f565b81600181146136e457600281146136ee5761370a565b600191505061374f565b60ff8411156136ff576136ff6137e8565b50506001821b61374f565b5060208310610133831016604e8410600b841016171561372d575081810a61374f565b6137378383613668565b806000190482111561374b5761374b6137e8565b0290505b92915050565b600081600019048311821515161561376f5761376f6137e8565b500290565b600082821015613786576137866137e8565b500390565b60005b838110156137a657818101518382015260200161378e565b838111156102285750506000910152565b60006000198214156137cb576137cb6137e8565b5060010190565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461383f57600080fd5b50565b801515811461383f57600080fdfea2646970667358221220aaf5b1a876f839a03158246f47a03c5f22d8a97c703b4a8a25733bc7325e7e9664736f6c63430008060033