ETH Price: $3,405.91 (+1.53%)

Contract

0x002162B2aEe2dD657FB131b28CC34deE6797b66f
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

> 10 Internal Transactions and > 10 Token Transfers found.

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block
From
To
204179762024-07-30 7:45:23150 days ago1722325523
0x002162B2...E6797b66f
0.44 ETH
204179762024-07-30 7:45:23150 days ago1722325523
0x002162B2...E6797b66f
0.44 ETH
204165352024-07-30 2:55:23150 days ago1722308123
0x002162B2...E6797b66f
0.4 ETH
204165352024-07-30 2:55:23150 days ago1722308123
0x002162B2...E6797b66f
0.4 ETH
204158432024-07-30 0:35:11150 days ago1722299711
0x002162B2...E6797b66f
0.1 ETH
204158432024-07-30 0:35:11150 days ago1722299711
0x002162B2...E6797b66f
0.1 ETH
204156682024-07-29 23:59:47150 days ago1722297587
0x002162B2...E6797b66f
0.001 ETH
204156682024-07-29 23:59:47150 days ago1722297587
0x002162B2...E6797b66f
0.001 ETH
204156122024-07-29 23:48:35150 days ago1722296915
0x002162B2...E6797b66f
0.0006 ETH
204156122024-07-29 23:48:35150 days ago1722296915
0x002162B2...E6797b66f
0.0006 ETH
204121002024-07-29 12:04:23151 days ago1722254663
0x002162B2...E6797b66f
0.36945818 ETH
204121002024-07-29 12:04:23151 days ago1722254663
0x002162B2...E6797b66f
0.36945818 ETH
204096262024-07-29 3:46:47151 days ago1722224807
0x002162B2...E6797b66f
0.2299 ETH
204096262024-07-29 3:46:47151 days ago1722224807
0x002162B2...E6797b66f
0.2299 ETH
204088212024-07-29 1:05:11151 days ago1722215111
0x002162B2...E6797b66f
0.057 ETH
204088212024-07-29 1:05:11151 days ago1722215111
0x002162B2...E6797b66f
0.057 ETH
204070302024-07-28 19:05:59151 days ago1722193559
0x002162B2...E6797b66f
12.28768855 ETH
204070302024-07-28 19:05:59151 days ago1722193559
0x002162B2...E6797b66f
12.28768855 ETH
204066172024-07-28 17:43:23151 days ago1722188603
0x002162B2...E6797b66f
0.1 ETH
204066172024-07-28 17:43:23151 days ago1722188603
0x002162B2...E6797b66f
0.1 ETH
204064362024-07-28 17:06:59151 days ago1722186419
0x002162B2...E6797b66f
0.73 ETH
204064362024-07-28 17:06:59151 days ago1722186419
0x002162B2...E6797b66f
0.73 ETH
204060222024-07-28 15:44:11151 days ago1722181451
0x002162B2...E6797b66f
0.1535 ETH
204060222024-07-28 15:44:11151 days ago1722181451
0x002162B2...E6797b66f
0.1535 ETH
204045782024-07-28 10:54:23152 days ago1722164063
0x002162B2...E6797b66f
0.25 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SwapAdapter

Compiler Version
v0.8.21+commit.d9974bed

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 12 : SwapAdapter.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.21;

import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable2Step.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./lib/DexExecutor.sol";
import "./lib/Helper.sol";

// Be careful this contract contains unsafe call !.
// Do not approve token or just approve the right amount before call it.
// Clear approve in the same transaction if calling failed.
contract SwapAdapter is Ownable2Step, ReentrancyGuard {
    using Address for address;
    using SafeERC20 for IERC20;

    struct Param {
        address srcToken;
        address dstToken;
        address receiver;
        address leftReceiver;
        uint256 minAmount;
        SwapData[] swaps;
    }

    struct SwapData {
        uint8 dexType;
        address callTo;
        address approveTo;
        uint256 fromAmount;
        bytes callData;
    }

    event SwapComplete(
        address indexed from,
        address indexed srcToken,
        uint256 indexed inputAmount,
        address outToken,
        uint256 outAmount,
        address receiver
    );

    constructor(address _owner) {
        require(_owner != Helper.ZERO_ADDRESS, "ButterAgg: zero addr");
        _transferOwnership(_owner);
    }

    // Not recommended for EOA call with token approve
    // Approve the amount you want to trade.
    // DexType 0 - AGG, 1 - UNIV2, 2 - UNIV3, 3 - CURVE
    function swap(Param calldata params) external payable nonReentrant returns (uint256 outAmount) {
        require(params.swaps.length > 0, "ButterAgg: empty swap data");

        (uint256 amount, uint256 initInputTokenBalance) = _depositToken(params.srcToken);
        uint256 finalTokenAmount = Helper._getBalance(params.dstToken, address(this));
        (uint256 amountAdjust, uint256 firstAdjust, bool isUp) = _reBuildSwaps(amount, params.swaps);
        bool isFirst = true;
        SwapData[] memory _swaps = params.swaps;
        for (uint256 i = 0; i < _swaps.length; i++) {
            if (_swaps[i].dexType > 0 && amountAdjust > 0) {
                if (isFirst) {
                    isUp ? _swaps[i].fromAmount += firstAdjust : _swaps[i].fromAmount -= firstAdjust;
                    isFirst = false;
                } else {
                    isUp ? _swaps[i].fromAmount += amountAdjust : _swaps[i].fromAmount -= amountAdjust;
                }
            }
            bool isNative = Helper._isNative(params.srcToken);
            if (!isNative) {
                IERC20(params.srcToken).safeApprove(_swaps[i].approveTo, 0);
                IERC20(params.srcToken).safeApprove(_swaps[i].approveTo, _swaps[i].fromAmount);
            }
            DexExecutor.execute(
                _swaps[i].dexType,
                _swaps[i].callTo,
                params.srcToken,
                params.dstToken,
                _swaps[i].fromAmount,
                _swaps[i].callData
            );
            if (!isNative) {
                IERC20(params.srcToken).safeApprove(_swaps[i].approveTo, 0);
            }
        }
        outAmount = Helper._getBalance(params.dstToken, address(this)) - finalTokenAmount;
        require(outAmount >= params.minAmount, "ButterAgg: swap received too low");
        uint256 left = Helper._getBalance(params.srcToken, address(this)) - initInputTokenBalance;
        if (left > 0) {
            Helper._transfer(params.srcToken, params.leftReceiver, left);
        }
        address receiver = params.receiver == address(0) ? msg.sender : params.receiver;
        Helper._transfer(params.dstToken, receiver, outAmount);
        emit SwapComplete(msg.sender, params.srcToken, amount, params.dstToken, outAmount, receiver);
    }

    function _depositToken(address _token) private returns (uint256 amount, uint256 initInputTokenBalance) {
        initInputTokenBalance = Helper._getBalance(_token, address(this));
        if (Helper._isNative(_token)) {
            initInputTokenBalance -= msg.value;
            amount = msg.value;
        } else {
            amount = IERC20(_token).allowance(msg.sender, address(this));
            SafeERC20.safeTransferFrom(IERC20(_token), msg.sender, address(this), amount);
        }
        require(amount > 0, "ButterAgg: zero input");
    }

    function _reBuildSwaps(
        uint256 _amount,
        SwapData[] memory _swaps
    ) private pure returns (uint256 amountAdjust, uint256 firstAdjust, bool isUp) {
        uint256 total = 0;
        uint256 count = 0;
        for (uint256 i = 0; i < _swaps.length; i++) {
            total += _swaps[i].fromAmount;
            if (_swaps[i].dexType > 0) {
                count++;
            }
        }
        if (total > _amount) {
            require(count > 0, "ButterAgg: cannot adjust");
            isUp = false;
            uint256 margin = total - _amount;
            amountAdjust = margin / count;
            firstAdjust = amountAdjust + (margin - amountAdjust * count);
        } else if (total < _amount) {
            if (count > 0) {
                isUp = true;
                uint256 margin = _amount - total;
                amountAdjust = margin / count;
                firstAdjust = amountAdjust + (margin - amountAdjust * count);
            }
        }
    }

    function rescueFunds(address _token, address _receiver, uint256 _amount) external onlyOwner {
        require(_receiver != address(0));
        Helper._transfer(_token, _receiver, _amount);
    }

    receive() external payable {}
}

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

pragma solidity ^0.8.0;

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

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

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

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

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

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

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

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

File 3 of 12 : Ownable2Step.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol)

pragma solidity ^0.8.0;

import "./Ownable.sol";

/**
 * @dev Contract module which provides access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership} and {acceptOwnership}.
 *
 * This module is used through inheritance. It will make available all functions
 * from parent (Ownable).
 */
abstract contract Ownable2Step is Ownable {
    address private _pendingOwner;

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

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

    /**
     * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual override onlyOwner {
        _pendingOwner = newOwner;
        emit OwnershipTransferStarted(owner(), newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual override {
        delete _pendingOwner;
        super._transferOwnership(newOwner);
    }

    /**
     * @dev The new owner accepts the ownership transfer.
     */
    function acceptOwnership() public virtual {
        address sender = _msgSender();
        require(pendingOwner() == sender, "Ownable2Step: caller is not the new owner");
        _transferOwnership(sender);
    }
}

File 4 of 12 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == _ENTERED;
    }
}

File 5 of 12 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

// EIP-2612 is Final as of 2022-11-01. This file is deprecated.

import "./IERC20Permit.sol";

File 6 of 12 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

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

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

File 8 of 12 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

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

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

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    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));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    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");
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
     * Revert on invalid signature.
     */
    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @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");
        require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
    }

    /**
     * @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).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // 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 cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return
            success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
    }
}

File 9 of 12 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @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
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 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://consensys.net/diligence/blog/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.8.0/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 functionCallWithValue(target, data, 0, "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");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, 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) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, 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) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // 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
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

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

pragma solidity ^0.8.0;

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

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

File 11 of 12 : DexExecutor.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;

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

library DexExecutor {
    using SafeERC20 for IERC20;

    enum DexType {
        AGG,
        UNIV2,
        UNIV3,
        CURVE,
        FILL,
        MIX
    }

    function execute(
        uint8 _dexType,
        address _router,
        address _srcToken,
        address _dstToken,
        uint256 _amount,
        bytes memory _swap
    ) internal {
        bool _result;
        bool _isNative = Helper._isNative(_srcToken);
        DexType dexType = DexType(_dexType);
        if (dexType == DexType.AGG) {
            (_result) = _makeAggSwap(_router, _amount, _isNative, _swap);
        } else if (dexType == DexType.UNIV2) {
            (_result) = _makeUniV2Swap(_router, _dstToken, _amount, _isNative, _swap);
        } else if (dexType == DexType.UNIV3) {
            (_result) = _makeUniV3Swap(_router, _dstToken, _amount, _isNative, _swap);
        } else if (dexType == DexType.CURVE) {
            (_result) = _makeCurveSwap(_router, _amount, _isNative, _swap);
        } else if (dexType == DexType.FILL) {
            (_result) = _makeAggFill(_router, _amount, _isNative, _swap);
        } else if (dexType == DexType.MIX) {
            (_result) = _makeMixSwap(_srcToken, _amount, _swap);
        } else {
            require(false, "DexExecutor: unsupported dex type");
        }
        require(_result, "DexExecutor: swap fail");
    }

    struct MixSwap {
        uint256 offset;
        address srcToken;
        address callTo;
        address approveTo;
        bytes callData;
    }

    function _makeMixSwap(address _srcToken, uint256 _amount, bytes memory _swap) internal returns (bool _result) {
        MixSwap[] memory mixSwaps = abi.decode(_swap, (MixSwap[]));
        for (uint256 i = 0; i < mixSwaps.length; i++) {
            if (i != 0) {
                _amount = Helper._getBalance(mixSwaps[i].srcToken, address(this));
                _srcToken = mixSwaps[i].srcToken;
            }
            bytes memory callDatas = mixSwaps[i].callData;
            uint256 offset = mixSwaps[i].offset;
            if (offset != 0) {
                assembly {
                    mstore(add(callDatas, offset), _amount)
                }
            }
            if (Helper._isNative(_srcToken)) {
                (_result, ) = mixSwaps[i].callTo.call{value: _amount}(callDatas);
            } else {
                if (i != 0) {
                    IERC20(_srcToken).safeIncreaseAllowance(mixSwaps[i].approveTo, _amount);
                }

                (_result, ) = mixSwaps[i].callTo.call(callDatas);

                if (i != 0) {
                    IERC20(_srcToken).safeApprove(mixSwaps[i].approveTo, 0);
                }
            }
            if (!_result) {
                break;
            }
        }
    }

    function _makeAggSwap(
        address _router,
        uint256 _amount,
        bool _isNative,
        bytes memory _swap
    ) internal returns (bool _result) {
        if (_isNative) {
            (_result, ) = _router.call{value: _amount}(_swap);
        } else {
            (_result, ) = _router.call(_swap);
        }
    }

    function _makeAggFill(
        address _router,
        uint256 _amount,
        bool _isNative,
        bytes memory _swap
    ) internal returns (bool _result) {
        (uint256 offset, bytes memory callDatas) = abi.decode(_swap, (uint256, bytes));
        assembly {
            mstore(add(callDatas, offset), _amount)
        }
        if (_isNative) {
            (_result, ) = _router.call{value: _amount}(callDatas);
        } else {
            (_result, ) = _router.call(callDatas);
        }
    }

    function _makeUniV2Swap(
        address _router,
        address _dstToken,
        uint256 _amount,
        bool _isNative,
        bytes memory _swap
    ) internal returns (bool _result) {
        (uint256 amountOutMin, address[] memory path) = abi.decode(_swap, (uint256, address[]));
        if (_isNative) {
            (_result, ) = _router.call{value: _amount}(
                abi.encodeWithSignature(
                    "swapExactETHForTokens(uint256,address[],address,uint256)",
                    amountOutMin,
                    path,
                    address(this),
                    block.timestamp + 100
                )
            );
        } else if (Helper._isNative(_dstToken)) {
            (_result, ) = _router.call(
                abi.encodeWithSignature(
                    "swapExactTokensForETH(uint256,uint256,address[],address,uint256)",
                    _amount,
                    amountOutMin,
                    path,
                    address(this),
                    block.timestamp + 100
                )
            );
        } else {
            (_result, ) = _router.call(
                abi.encodeWithSignature(
                    "swapExactTokensForTokens(uint256,uint256,address[],address,uint256)",
                    _amount,
                    amountOutMin,
                    path,
                    address(this),
                    block.timestamp + 100
                )
            );
        }
    }

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

    function _makeUniV3Swap(
        address _router,
        address _dstToken,
        uint256 _amount,
        bool _isNative,
        bytes memory _swap
    ) internal returns (bool _result) {
        (uint256 amountOutMin, bytes memory path) = abi.decode(_swap, (uint256, bytes));

        address receiver = Helper._isNative(_dstToken) ? _router : address(this);
        ExactInputParams memory params = ExactInputParams(path, receiver, _amount, amountOutMin);
        bytes memory swapData = abi.encodeWithSignature("exactInput((bytes,address,uint256,uint256))", params);
        uint256 value = _isNative ? _amount : 0;
        if (Helper._isNative(_dstToken)) {
            bytes[] memory c = new bytes[](2);
            c[0] = swapData;
            c[1] = abi.encodeWithSignature("unwrapWETH9(uint256,address)", amountOutMin, address(this));
            (_result, ) = _router.call{value: value}(abi.encodeWithSignature("multicall(bytes[])", c));
        } else {
            (_result, ) = _router.call{value: value}(swapData);
        }
    }

    function _makeCurveSwap(
        address _router,
        uint256 _amount,
        bool _isNative,
        bytes memory _swap
    ) internal returns (bool _result) {
        (uint256 expected, address[9] memory routes, uint256[3][4] memory swap_params, address[4] memory pools) = abi
            .decode(_swap, (uint256, address[9], uint256[3][4], address[4]));
        uint256 value = _isNative ? _amount : 0;

        (_result, ) = _router.call{value: value}(
            abi.encodeWithSignature(
                "exchange_multiple(address[9],uint256[3][4],uint256,uint256,address[4],address)",
                routes,
                swap_params,
                _amount,
                expected,
                pools,
                address(this)
            )
        );
    }
}

File 12 of 12 : Helper.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol";

library Helper {
    using SafeERC20 for IERC20;
    address internal constant ZERO_ADDRESS = address(0);
    address internal constant NATIVE_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;

    struct CallbackParam {
        address target;
        address approveTo;
        uint256 offset;
        uint256 extraNativeAmount;
        address receiver;
        bytes data;
    }

    struct SwapParam {
        uint8 dexType;
        address executor;
        address approveTo;
        address receiver;
        address dstToken;
        uint256 minReturnAmount;
        bytes data;
    }

    function _isNative(address token) internal pure returns (bool) {
        return (token == ZERO_ADDRESS || token == NATIVE_ADDRESS);
    }

    function _getBalance(address _token, address _account) internal view returns (uint256) {
        if (_isNative(_token)) {
            return _account.balance;
        } else {
            return IERC20(_token).balanceOf(_account);
        }
    }

    function _transfer(address _token, address _to, uint256 _amount) internal {
        if (_isNative(_token)) {
            Address.sendValue(payable(_to), _amount);
        } else {
            IERC20(_token).safeTransfer(_to, _amount);
        }
    }

    function _safeWithdraw(address _wToken, uint _value) internal returns (bool) {
        (bool success, bytes memory data) = _wToken.call(abi.encodeWithSelector(0x2e1a7d4d, _value));
        return (success && (data.length == 0 || abi.decode(data, (bool))));
    }

    function _getFirst4Bytes(bytes memory data) internal pure returns (bytes4 outBytes4) {
        if (data.length == 0) {
            return 0x0;
        }
        assembly {
            outBytes4 := mload(add(data, 32))
        }
    }

    function _makeSwap(
        uint256 _amount,
        address _srcToken,
        SwapParam memory _swap
    ) internal returns (bool _result, address _dstToken, uint256 _returnAmount) {
        _dstToken = _swap.dstToken;
        uint256 nativeValue = 0;
        bool isNative = Helper._isNative(_srcToken);
        if (isNative) {
            nativeValue = _amount;
        } else {
            IERC20(_srcToken).safeApprove(_swap.approveTo, 0);
            IERC20(_srcToken).safeApprove(_swap.approveTo, _amount);
        }
        _returnAmount = Helper._getBalance(_dstToken, address(this));

        (_result, ) = _swap.executor.call{value: nativeValue}(_swap.data);

        _returnAmount = Helper._getBalance(_dstToken, address(this)) - _returnAmount;

        if (!isNative) {
            IERC20(_srcToken).safeApprove(_swap.approveTo, 0);
        }
    }

    function _callBack(
        uint256 _amount,
        address _token,
        CallbackParam memory _callParam
    ) internal returns (bool _result, uint256 _callAmount) {
        _callAmount = Helper._getBalance(_token, address(this));
        uint256 offset = _callParam.offset;
        bytes memory callDatas = _callParam.data;
        if (offset != 0) {
            assembly {
                mstore(add(callDatas, offset), _amount)
            }
        }
        if (Helper._isNative(_token)) {
            (_result, ) = _callParam.target.call{value: _amount}(callDatas);
        } else {
            if (_amount != 0) IERC20(_token).safeIncreaseAllowance(_callParam.approveTo, _amount);
            // this contract not save money make sure send value can cover this
            (_result, ) = _callParam.target.call{value: _callParam.extraNativeAmount}(callDatas);
            if (_amount != 0) IERC20(_token).safeApprove(_callParam.approveTo, 0);
        }
        _callAmount = _callAmount - Helper._getBalance(_token, address(this));
    }

    function _permit(bytes memory _data) internal {
        (
            address token,
            address owner,
            address spender,
            uint256 value,
            uint256 deadline,
            uint8 v,
            bytes32 r,
            bytes32 s
        ) = abi.decode(_data, (address, address, address, uint256, uint256, uint8, bytes32, bytes32));

        SafeERC20.safePermit(IERC20Permit(token), owner, spender, value, deadline, v, r, s);
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"srcToken","type":"address"},{"indexed":true,"internalType":"uint256","name":"inputAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"outToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"outAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"receiver","type":"address"}],"name":"SwapComplete","type":"event"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"rescueFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"srcToken","type":"address"},{"internalType":"address","name":"dstToken","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"leftReceiver","type":"address"},{"internalType":"uint256","name":"minAmount","type":"uint256"},{"components":[{"internalType":"uint8","name":"dexType","type":"uint8"},{"internalType":"address","name":"callTo","type":"address"},{"internalType":"address","name":"approveTo","type":"address"},{"internalType":"uint256","name":"fromAmount","type":"uint256"},{"internalType":"bytes","name":"callData","type":"bytes"}],"internalType":"struct SwapAdapter.SwapData[]","name":"swaps","type":"tuple[]"}],"internalType":"struct SwapAdapter.Param","name":"params","type":"tuple"}],"name":"swap","outputs":[{"internalType":"uint256","name":"outAmount","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60806040523480156200001157600080fd5b5060405162002a8638038062002a8683398101604081905262000034916200011f565b6200003f33620000b1565b60016002556001600160a01b0381166200009f5760405162461bcd60e51b815260206004820152601460248201527f4275747465724167673a207a65726f2061646472000000000000000000000000604482015260640160405180910390fd5b620000aa81620000b1565b5062000151565b600180546001600160a01b0319169055620000cc81620000cf565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156200013257600080fd5b81516001600160a01b03811681146200014a57600080fd5b9392505050565b61292580620001616000396000f3fe6080604052600436106100745760003560e01c80638da5cb5b1161004e5780638da5cb5b146100cc578063e30c397814610103578063efa0646514610121578063f2fde38b1461014257600080fd5b80636ccae05414610080578063715018a6146100a257806379ba5097146100b757600080fd5b3661007b57005b600080fd5b34801561008c57600080fd5b506100a061009b366004611df9565b610162565b005b3480156100ae57600080fd5b506100a061018d565b3480156100c357600080fd5b506100a06101a1565b3480156100d857600080fd5b506000546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b34801561010f57600080fd5b506001546001600160a01b03166100e6565b61013461012f366004611e3a565b610220565b6040519081526020016100fa565b34801561014e57600080fd5b506100a061015d366004611e7b565b610777565b61016a6107e8565b6001600160a01b03821661017d57600080fd5b610188838383610842565b505050565b6101956107e8565b61019f600061086e565b565b60015433906001600160a01b031681146102145760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b60648201526084015b60405180910390fd5b61021d8161086e565b50565b600061022a610887565b600061023960a0840184611e98565b9050116102885760405162461bcd60e51b815260206004820152601a60248201527f4275747465724167673a20656d70747920737761702064617461000000000000604482015260640161020b565b6000806102a061029b6020860186611e7b565b6108de565b909250905060006102c06102ba6040870160208801611e7b565b306109d8565b9050600080806102e5866102d760a08b018b611e98565b6102e09161203a565b610a6c565b91945092509050600160006102fd60a08b018b611e98565b6103069161203a565b905060005b81518110156105be57600082828151811061032857610328612129565b60200260200101516000015160ff161180156103445750600086115b156104355782156103c6578361038a578482828151811061036757610367612129565b602002602001015160600181815161037f9190612155565b9150818152506103bc565b8482828151811061039d5761039d612129565b60200260200101516060018181516103b59190612168565b9150818152505b5060009250610435565b8361040157858282815181106103de576103de612129565b60200260200101516060018181516103f69190612155565b915081815250610433565b8582828151811061041457610414612129565b602002602001015160600181815161042c9190612168565b9150818152505b505b600061044c61044760208e018e611e7b565b610be4565b9050806104eb5761049983838151811061046857610468612129565b60200260200101516040015160008e60000160208101906104899190611e7b565b6001600160a01b03169190610c1d565b6104eb8383815181106104ae576104ae612129565b6020026020010151604001518484815181106104cc576104cc612129565b6020026020010151606001518e60000160208101906104899190611e7b565b61059183838151811061050057610500612129565b60200260200101516000015184848151811061051e5761051e612129565b6020026020010151602001518e600001602081019061053d9190611e7b565b8f60200160208101906105509190611e7b565b87878151811061056257610562612129565b60200260200101516060015188888151811061058057610580612129565b602002602001015160800151610d65565b806105ab576105ab83838151811061046857610468612129565b50806105b68161217b565b91505061030b565b50856105d36102ba60408d0160208e01611e7b565b6105dd9190612155565b985089608001358910156106335760405162461bcd60e51b815260206004820181905260248201527f4275747465724167673a207377617020726563656976656420746f6f206c6f77604482015260640161020b565b6000876106466102ba60208e018e611e7b565b6106509190612155565b9050801561067e5761067e61066860208d018d611e7b565b61067860808e0160608f01611e7b565b83610842565b60008061069160608e0160408f01611e7b565b6001600160a01b0316146106b4576106af60608d0160408e01611e7b565b6106b6565b335b90506106d26106cb60408e0160208f01611e7b565b828d610842565b896106e060208e018e611e7b565b6001600160a01b0316336001600160a01b03167f3d665fb91a05a4c30e7e5da7d4eb00bda6b3a5f9b69ffc766b80912c4438db198f60200160208101906107279190611e7b565b8f86604051610756939291906001600160a01b0393841681526020810192909252909116604082015260600190565b60405180910390a4505050505050505050506107726001600255565b919050565b61077f6107e8565b600180546001600160a01b0383166001600160a01b031990911681179091556107b06000546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b6000546001600160a01b0316331461019f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161020b565b61084b83610be4565b1561085a576101888282610f15565b6101886001600160a01b038416838361102e565b600180546001600160a01b031916905561021d8161105e565b60028054036108d85760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161020b565b60028055565b6000806108eb83306109d8565b90506108f683610be4565b1561090f576109053482612155565b905034915061098b565b604051636eb1769f60e11b81523360048201523060248201526001600160a01b0384169063dd62ed3e90604401602060405180830381865afa158015610959573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061097d9190612194565b915061098b833330856110ae565b600082116109d35760405162461bcd60e51b8152602060048201526015602482015274109d5d1d195c9059d9ce881e995c9bc81a5b9c1d5d605a1b604482015260640161020b565b915091565b60006109e383610be4565b156109f957506001600160a01b03811631610a66565b6040516370a0823160e01b81526001600160a01b0383811660048301528416906370a0823190602401602060405180830381865afa158015610a3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a639190612194565b90505b92915050565b600080808080805b8651811015610af157868181518110610a8f57610a8f612129565b60200260200101516060015183610aa69190612168565b92506000878281518110610abc57610abc612129565b60200260200101516000015160ff161115610adf5781610adb8161217b565b9250505b80610ae98161217b565b915050610a74565b5086821115610b8d5760008111610b4a5760405162461bcd60e51b815260206004820152601860248201527f4275747465724167673a2063616e6e6f742061646a7573740000000000000000604482015260640161020b565b6000925082610b598884612155565b9050610b6582826121ad565b9550610b7182876121cf565b610b7b9082612155565b610b859087612168565b945050610bdb565b86821015610bdb578015610bdb57600192506000610bab8389612155565b9050610bb782826121ad565b9550610bc382876121cf565b610bcd9082612155565b610bd79087612168565b9450505b50509250925092565b60006001600160a01b0382161580610a6657506001600160a01b03821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1492915050565b801580610c975750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015610c71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c959190612194565b155b610d025760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b606482015260840161020b565b6040516001600160a01b03831660248201526044810182905261018890849063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526110ec565b600080610d7186610be4565b905060008860ff166005811115610d8a57610d8a6121e6565b90506000816005811115610da057610da06121e6565b03610db857610db1888684876111c1565b9250610ec4565b6001816005811115610dcc57610dcc6121e6565b03610dde57610db18887878588611297565b6002816005811115610df257610df26121e6565b03610e0457610db188878785886114ca565b6003816005811115610e1857610e186121e6565b03610e2957610db188868487611747565b6004816005811115610e3d57610e3d6121e6565b03610e4e57610db18886848761182b565b6005816005811115610e6257610e626121e6565b03610e7257610db1878686611923565b60405162461bcd60e51b815260206004820152602160248201527f4465784578656375746f723a20756e737570706f7274656420646578207479706044820152606560f81b606482015260840161020b565b82610f0a5760405162461bcd60e51b815260206004820152601660248201527511195e115e1958dd5d1bdc8e881cddd85c0819985a5b60521b604482015260640161020b565b505050505050505050565b80471015610f655760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015260640161020b565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610fb2576040519150601f19603f3d011682016040523d82523d6000602084013e610fb7565b606091505b50509050806101885760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d61792068617665207265766572746564000000000000606482015260840161020b565b6040516001600160a01b03831660248201526044810182905261018890849063a9059cbb60e01b90606401610d2e565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040516001600160a01b03808516602483015283166044820152606481018290526110e69085906323b872dd60e01b90608401610d2e565b50505050565b6000611141826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611ba49092919063ffffffff16565b905080516000148061116257508080602001905181019061116291906121fc565b6101885760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161020b565b6000821561122f57846001600160a01b031684836040516111e29190612242565b60006040518083038185875af1925050503d806000811461121f576040519150601f19603f3d011682016040523d82523d6000602084013e611224565b606091505b50508091505061128f565b846001600160a01b0316826040516112479190612242565b6000604051808303816000865af19150503d8060008114611284576040519150601f19603f3d011682016040523d82523d6000602084013e611289565b606091505b50909150505b949350505050565b6000806000838060200190518101906112b0919061225e565b915091508415611368576001600160a01b038816868383306112d3426064612168565b6040516024016112e69493929190612347565b60408051601f198184030181529181526020820180516001600160e01b0316637ff36ab560e01b1790525161131b9190612242565b60006040518083038185875af1925050503d8060008114611358576040519150601f19603f3d011682016040523d82523d6000602084013e61135d565b606091505b5050809350506114bf565b61137187610be4565b15611415576001600160a01b0388168683833061138f426064612168565b6040516024016113a395949392919061237c565b60408051601f198184030181529181526020820180516001600160e01b03166318cbafe560e01b179052516113d89190612242565b6000604051808303816000865af19150503d8060008114611358576040519150601f19603f3d011682016040523d82523d6000602084013e61135d565b6001600160a01b0388168683833061142e426064612168565b60405160240161144295949392919061237c565b60408051601f198184030181529181526020820180516001600160e01b03166338ed173960e01b179052516114779190612242565b6000604051808303816000865af19150503d80600081146114b4576040519150601f19603f3d011682016040523d82523d6000602084013e6114b9565b606091505b50909350505b505095945050505050565b6000806000838060200190518101906114e391906123fd565b9150915060006114f288610be4565b6114fc57306114fe565b885b905060006040518060800160405280848152602001836001600160a01b03168152602001898152602001858152509050600081604051602401611541919061246f565b60408051601f198184030181529190526020810180516001600160e01b031663b858183f60e01b179052905060008861157b57600061157d565b895b90506115888b610be4565b156116d75760408051600280825260608201909252600091816020015b60608152602001906001900390816115a557905050905082816000815181106115d0576115d0612129565b60209081029190910101526040516024810188905230604482015260640160408051601f198184030181529190526020810180516001600160e01b031663125012df60e21b17905281518290600190811061162d5761162d612129565b60200260200101819052508c6001600160a01b0316828260405160240161165491906124bd565b60408051601f198184030181529181526020820180516001600160e01b0316631592ca1b60e31b179052516116899190612242565b60006040518083038185875af1925050503d80600081146116c6576040519150601f19603f3d011682016040523d82523d6000602084013e6116cb565b606091505b50508098505050611738565b8b6001600160a01b031681836040516116f09190612242565b60006040518083038185875af1925050503d806000811461172d576040519150601f19603f3d011682016040523d82523d6000602084013e611732565b606091505b50909750505b50505050505095945050505050565b60008060008060008580602001905181019061176391906125e1565b935093509350935060008761177957600061177b565b885b9050896001600160a01b03168185858c8987306040516024016117a3969594939291906126f2565b60408051601f198184030181529181526020820180516001600160e01b0316630651cb3560e01b179052516117d89190612242565b60006040518083038185875af1925050503d8060008114611815576040519150601f19603f3d011682016040523d82523d6000602084013e61181a565b606091505b50909b9a5050505050505050505050565b60008060008380602001905181019061184491906123fd565b91509150858282015284156118b957866001600160a01b0316868260405161186c9190612242565b60006040518083038185875af1925050503d80600081146118a9576040519150601f19603f3d011682016040523d82523d6000602084013e6118ae565b606091505b505080935050611919565b866001600160a01b0316816040516118d19190612242565b6000604051808303816000865af19150503d806000811461190e576040519150601f19603f3d011682016040523d82523d6000602084013e611913565b606091505b50909350505b5050949350505050565b6000808280602001905181019061193a91906127b1565b905060005b8151811015611b9b5780156119985761197582828151811061196357611963612129565b602002602001015160200151306109d8565b945081818151811061198957611989612129565b60200260200101516020015195505b60008282815181106119ac576119ac612129565b602002602001015160800151905060008383815181106119ce576119ce612129565b6020026020010151600001519050806000146119ea5786818301525b6119f388610be4565b15611a7b57838381518110611a0a57611a0a612129565b6020026020010151604001516001600160a01b03168783604051611a2e9190612242565b60006040518083038185875af1925050503d8060008114611a6b576040519150601f19603f3d011682016040523d82523d6000602084013e611a70565b606091505b505080955050611b7a565b8215611abc57611abc848481518110611a9657611a96612129565b602002602001015160600151888a6001600160a01b0316611bb39092919063ffffffff16565b838381518110611ace57611ace612129565b6020026020010151604001516001600160a01b031682604051611af19190612242565b6000604051808303816000865af19150503d8060008114611b2e576040519150601f19603f3d011682016040523d82523d6000602084013e611b33565b606091505b50909550508215611b7a57611b7a848481518110611b5357611b53612129565b60200260200101516060015160008a6001600160a01b0316610c1d9092919063ffffffff16565b84611b86575050611b9b565b50508080611b939061217b565b91505061193f565b50509392505050565b606061128f8484600085611c60565b604051636eb1769f60e11b81523060048201526001600160a01b0383811660248301526000919085169063dd62ed3e90604401602060405180830381865afa158015611c03573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c279190612194565b90506110e68463095ea7b360e01b85611c408686612168565b6040516001600160a01b0390921660248301526044820152606401610d2e565b606082471015611cc15760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161020b565b600080866001600160a01b03168587604051611cdd9190612242565b60006040518083038185875af1925050503d8060008114611d1a576040519150601f19603f3d011682016040523d82523d6000602084013e611d1f565b606091505b5091509150611d3087838387611d3b565b979650505050505050565b60608315611daa578251600003611da3576001600160a01b0385163b611da35760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161020b565b508161128f565b61128f8383815115611dbf5781518083602001fd5b8060405162461bcd60e51b815260040161020b91906128dc565b6001600160a01b038116811461021d57600080fd5b803561077281611dd9565b600080600060608486031215611e0e57600080fd5b8335611e1981611dd9565b92506020840135611e2981611dd9565b929592945050506040919091013590565b600060208284031215611e4c57600080fd5b81356001600160401b03811115611e6257600080fd5b820160c08185031215611e7457600080fd5b9392505050565b600060208284031215611e8d57600080fd5b8135611e7481611dd9565b6000808335601e19843603018112611eaf57600080fd5b8301803591506001600160401b03821115611ec957600080fd5b6020019150600581901b3603821315611ee157600080fd5b9250929050565b634e487b7160e01b600052604160045260246000fd5b60405160a081016001600160401b0381118282101715611f2057611f20611ee8565b60405290565b604051608081016001600160401b0381118282101715611f2057611f20611ee8565b604051606081016001600160401b0381118282101715611f2057611f20611ee8565b604051601f8201601f191681016001600160401b0381118282101715611f9257611f92611ee8565b604052919050565b60006001600160401b03821115611fb357611fb3611ee8565b5060051b60200190565b60006001600160401b03821115611fd657611fd6611ee8565b50601f01601f191660200190565b600082601f830112611ff557600080fd5b813561200861200382611fbd565b611f6a565b81815284602083860101111561201d57600080fd5b816020850160208301376000918101602001919091529392505050565b600061204861200384611f9a565b80848252602080830192508560051b85013681111561206657600080fd5b855b8181101561211d5780356001600160401b03808211156120885760008081fd5b818901915060a0823603121561209e5760008081fd5b6120a6611efe565b823560ff811681146120b85760008081fd5b8152828601356120c781611dd9565b8187015260406120d8848201611dee565b9082015260608381013590820152608080840135838111156120fa5760008081fd5b61210636828701611fe4565b918301919091525087525050938201938201612068565b50919695505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115610a6657610a6661213f565b80820180821115610a6657610a6661213f565b60006001820161218d5761218d61213f565b5060010190565b6000602082840312156121a657600080fd5b5051919050565b6000826121ca57634e487b7160e01b600052601260045260246000fd5b500490565b8082028115828204841417610a6657610a6661213f565b634e487b7160e01b600052602160045260246000fd5b60006020828403121561220e57600080fd5b81518015158114611e7457600080fd5b60005b83811015612239578181015183820152602001612221565b50506000910152565b6000825161225481846020870161221e565b9190910192915050565b6000806040838503121561227157600080fd5b825191506020808401516001600160401b0381111561228f57600080fd5b8401601f810186136122a057600080fd5b80516122ae61200382611f9a565b81815260059190911b820183019083810190888311156122cd57600080fd5b928401925b828410156122f45783516122e581611dd9565b825292840192908401906122d2565b80955050505050509250929050565b600081518084526020808501945080840160005b8381101561233c5781516001600160a01b031687529582019590820190600101612317565b509495945050505050565b8481526080602082015260006123606080830186612303565b6001600160a01b03949094166040830152506060015292915050565b85815284602082015260a06040820152600061239b60a0830186612303565b6001600160a01b0394909416606083015250608001529392505050565b600082601f8301126123c957600080fd5b81516123d761200382611fbd565b8181528460208386010111156123ec57600080fd5b61128f82602083016020870161221e565b6000806040838503121561241057600080fd5b8251915060208301516001600160401b0381111561242d57600080fd5b612439858286016123b8565b9150509250929050565b6000815180845261245b81602086016020860161221e565b601f01601f19169290920160200192915050565b60208152600082516080602084015261248b60a0840182612443565b905060018060a01b03602085015116604084015260408401516060840152606084015160808401528091505092915050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561251257603f19888603018452612500858351612443565b945092850192908501906001016124e4565b5092979650505050505050565b60006040516101208082018281106001600160401b038211171561254557612545611ee8565b604052909150819083018481111561255c57600080fd5b835b8181101561257f57805161257181611dd9565b83526020928301920161255e565b50505092915050565b600082601f83011261259957600080fd5b6125a1611f26565b8060808401858111156125b357600080fd5b845b818110156125d65780516125c881611dd9565b8452602093840193016125b5565b509095945050505050565b60008060008061034085870312156125f857600080fd5b84519350602086603f87011261260d57600080fd5b6126198782880161251f565b93508661015f87011261262b57600080fd5b612633611f26565b806102c088018981111561264657600080fd5b61014089015b818110156126a9578a601f8201126126645760008081fd5b61266c611f48565b80606083018d81111561267f5760008081fd5b835b818110156126985780518452928801928801612681565b50508552509284019260600161264c565b508195506126b78a82612588565b94505050505092959194509250565b8060005b60048110156110e65781516001600160a01b03168452602093840193909101906001016126ca565b6103808101818860005b60098110156127245781516001600160a01b03168352602092830192909101906001016126fc565b50505061012082018760005b60048110156127775781518360005b600381101561275e57825182526020928301929091019060010161273f565b5050506060929092019160209190910190600101612730565b505050856102a0830152846102c08301526127966102e08301856126c6565b6001600160a01b038316610360830152979650505050505050565b600060208083850312156127c457600080fd5b82516001600160401b03808211156127db57600080fd5b818501915085601f8301126127ef57600080fd5b81516127fd61200382611f9a565b81815260059190911b8301840190848101908883111561281c57600080fd5b8585015b838110156128cf578051858111156128385760008081fd5b860160a0818c03601f19018113156128505760008081fd5b612858611efe565b89830151815260408084015161286d81611dd9565b828c015260608481015161288081611dd9565b808385015250608091508185015161289781611dd9565b908301529183015191888311156128ae5760008081fd5b6128bc8e8c858701016123b8565b9082015285525050918601918601612820565b5098975050505050505050565b602081526000611e74602083018461244356fea26469706673582212201e2a9d895b137d910759e863445d141dde443a0c6449d18752118c5b7c3ecb5764736f6c63430008150033000000000000000000000000df3f1ee5baf55055980887aad79f6fe6e3302d93

Deployed Bytecode

0x6080604052600436106100745760003560e01c80638da5cb5b1161004e5780638da5cb5b146100cc578063e30c397814610103578063efa0646514610121578063f2fde38b1461014257600080fd5b80636ccae05414610080578063715018a6146100a257806379ba5097146100b757600080fd5b3661007b57005b600080fd5b34801561008c57600080fd5b506100a061009b366004611df9565b610162565b005b3480156100ae57600080fd5b506100a061018d565b3480156100c357600080fd5b506100a06101a1565b3480156100d857600080fd5b506000546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b34801561010f57600080fd5b506001546001600160a01b03166100e6565b61013461012f366004611e3a565b610220565b6040519081526020016100fa565b34801561014e57600080fd5b506100a061015d366004611e7b565b610777565b61016a6107e8565b6001600160a01b03821661017d57600080fd5b610188838383610842565b505050565b6101956107e8565b61019f600061086e565b565b60015433906001600160a01b031681146102145760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b60648201526084015b60405180910390fd5b61021d8161086e565b50565b600061022a610887565b600061023960a0840184611e98565b9050116102885760405162461bcd60e51b815260206004820152601a60248201527f4275747465724167673a20656d70747920737761702064617461000000000000604482015260640161020b565b6000806102a061029b6020860186611e7b565b6108de565b909250905060006102c06102ba6040870160208801611e7b565b306109d8565b9050600080806102e5866102d760a08b018b611e98565b6102e09161203a565b610a6c565b91945092509050600160006102fd60a08b018b611e98565b6103069161203a565b905060005b81518110156105be57600082828151811061032857610328612129565b60200260200101516000015160ff161180156103445750600086115b156104355782156103c6578361038a578482828151811061036757610367612129565b602002602001015160600181815161037f9190612155565b9150818152506103bc565b8482828151811061039d5761039d612129565b60200260200101516060018181516103b59190612168565b9150818152505b5060009250610435565b8361040157858282815181106103de576103de612129565b60200260200101516060018181516103f69190612155565b915081815250610433565b8582828151811061041457610414612129565b602002602001015160600181815161042c9190612168565b9150818152505b505b600061044c61044760208e018e611e7b565b610be4565b9050806104eb5761049983838151811061046857610468612129565b60200260200101516040015160008e60000160208101906104899190611e7b565b6001600160a01b03169190610c1d565b6104eb8383815181106104ae576104ae612129565b6020026020010151604001518484815181106104cc576104cc612129565b6020026020010151606001518e60000160208101906104899190611e7b565b61059183838151811061050057610500612129565b60200260200101516000015184848151811061051e5761051e612129565b6020026020010151602001518e600001602081019061053d9190611e7b565b8f60200160208101906105509190611e7b565b87878151811061056257610562612129565b60200260200101516060015188888151811061058057610580612129565b602002602001015160800151610d65565b806105ab576105ab83838151811061046857610468612129565b50806105b68161217b565b91505061030b565b50856105d36102ba60408d0160208e01611e7b565b6105dd9190612155565b985089608001358910156106335760405162461bcd60e51b815260206004820181905260248201527f4275747465724167673a207377617020726563656976656420746f6f206c6f77604482015260640161020b565b6000876106466102ba60208e018e611e7b565b6106509190612155565b9050801561067e5761067e61066860208d018d611e7b565b61067860808e0160608f01611e7b565b83610842565b60008061069160608e0160408f01611e7b565b6001600160a01b0316146106b4576106af60608d0160408e01611e7b565b6106b6565b335b90506106d26106cb60408e0160208f01611e7b565b828d610842565b896106e060208e018e611e7b565b6001600160a01b0316336001600160a01b03167f3d665fb91a05a4c30e7e5da7d4eb00bda6b3a5f9b69ffc766b80912c4438db198f60200160208101906107279190611e7b565b8f86604051610756939291906001600160a01b0393841681526020810192909252909116604082015260600190565b60405180910390a4505050505050505050506107726001600255565b919050565b61077f6107e8565b600180546001600160a01b0383166001600160a01b031990911681179091556107b06000546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b6000546001600160a01b0316331461019f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161020b565b61084b83610be4565b1561085a576101888282610f15565b6101886001600160a01b038416838361102e565b600180546001600160a01b031916905561021d8161105e565b60028054036108d85760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161020b565b60028055565b6000806108eb83306109d8565b90506108f683610be4565b1561090f576109053482612155565b905034915061098b565b604051636eb1769f60e11b81523360048201523060248201526001600160a01b0384169063dd62ed3e90604401602060405180830381865afa158015610959573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061097d9190612194565b915061098b833330856110ae565b600082116109d35760405162461bcd60e51b8152602060048201526015602482015274109d5d1d195c9059d9ce881e995c9bc81a5b9c1d5d605a1b604482015260640161020b565b915091565b60006109e383610be4565b156109f957506001600160a01b03811631610a66565b6040516370a0823160e01b81526001600160a01b0383811660048301528416906370a0823190602401602060405180830381865afa158015610a3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a639190612194565b90505b92915050565b600080808080805b8651811015610af157868181518110610a8f57610a8f612129565b60200260200101516060015183610aa69190612168565b92506000878281518110610abc57610abc612129565b60200260200101516000015160ff161115610adf5781610adb8161217b565b9250505b80610ae98161217b565b915050610a74565b5086821115610b8d5760008111610b4a5760405162461bcd60e51b815260206004820152601860248201527f4275747465724167673a2063616e6e6f742061646a7573740000000000000000604482015260640161020b565b6000925082610b598884612155565b9050610b6582826121ad565b9550610b7182876121cf565b610b7b9082612155565b610b859087612168565b945050610bdb565b86821015610bdb578015610bdb57600192506000610bab8389612155565b9050610bb782826121ad565b9550610bc382876121cf565b610bcd9082612155565b610bd79087612168565b9450505b50509250925092565b60006001600160a01b0382161580610a6657506001600160a01b03821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1492915050565b801580610c975750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015610c71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c959190612194565b155b610d025760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b606482015260840161020b565b6040516001600160a01b03831660248201526044810182905261018890849063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526110ec565b600080610d7186610be4565b905060008860ff166005811115610d8a57610d8a6121e6565b90506000816005811115610da057610da06121e6565b03610db857610db1888684876111c1565b9250610ec4565b6001816005811115610dcc57610dcc6121e6565b03610dde57610db18887878588611297565b6002816005811115610df257610df26121e6565b03610e0457610db188878785886114ca565b6003816005811115610e1857610e186121e6565b03610e2957610db188868487611747565b6004816005811115610e3d57610e3d6121e6565b03610e4e57610db18886848761182b565b6005816005811115610e6257610e626121e6565b03610e7257610db1878686611923565b60405162461bcd60e51b815260206004820152602160248201527f4465784578656375746f723a20756e737570706f7274656420646578207479706044820152606560f81b606482015260840161020b565b82610f0a5760405162461bcd60e51b815260206004820152601660248201527511195e115e1958dd5d1bdc8e881cddd85c0819985a5b60521b604482015260640161020b565b505050505050505050565b80471015610f655760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015260640161020b565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610fb2576040519150601f19603f3d011682016040523d82523d6000602084013e610fb7565b606091505b50509050806101885760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d61792068617665207265766572746564000000000000606482015260840161020b565b6040516001600160a01b03831660248201526044810182905261018890849063a9059cbb60e01b90606401610d2e565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040516001600160a01b03808516602483015283166044820152606481018290526110e69085906323b872dd60e01b90608401610d2e565b50505050565b6000611141826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611ba49092919063ffffffff16565b905080516000148061116257508080602001905181019061116291906121fc565b6101885760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161020b565b6000821561122f57846001600160a01b031684836040516111e29190612242565b60006040518083038185875af1925050503d806000811461121f576040519150601f19603f3d011682016040523d82523d6000602084013e611224565b606091505b50508091505061128f565b846001600160a01b0316826040516112479190612242565b6000604051808303816000865af19150503d8060008114611284576040519150601f19603f3d011682016040523d82523d6000602084013e611289565b606091505b50909150505b949350505050565b6000806000838060200190518101906112b0919061225e565b915091508415611368576001600160a01b038816868383306112d3426064612168565b6040516024016112e69493929190612347565b60408051601f198184030181529181526020820180516001600160e01b0316637ff36ab560e01b1790525161131b9190612242565b60006040518083038185875af1925050503d8060008114611358576040519150601f19603f3d011682016040523d82523d6000602084013e61135d565b606091505b5050809350506114bf565b61137187610be4565b15611415576001600160a01b0388168683833061138f426064612168565b6040516024016113a395949392919061237c565b60408051601f198184030181529181526020820180516001600160e01b03166318cbafe560e01b179052516113d89190612242565b6000604051808303816000865af19150503d8060008114611358576040519150601f19603f3d011682016040523d82523d6000602084013e61135d565b6001600160a01b0388168683833061142e426064612168565b60405160240161144295949392919061237c565b60408051601f198184030181529181526020820180516001600160e01b03166338ed173960e01b179052516114779190612242565b6000604051808303816000865af19150503d80600081146114b4576040519150601f19603f3d011682016040523d82523d6000602084013e6114b9565b606091505b50909350505b505095945050505050565b6000806000838060200190518101906114e391906123fd565b9150915060006114f288610be4565b6114fc57306114fe565b885b905060006040518060800160405280848152602001836001600160a01b03168152602001898152602001858152509050600081604051602401611541919061246f565b60408051601f198184030181529190526020810180516001600160e01b031663b858183f60e01b179052905060008861157b57600061157d565b895b90506115888b610be4565b156116d75760408051600280825260608201909252600091816020015b60608152602001906001900390816115a557905050905082816000815181106115d0576115d0612129565b60209081029190910101526040516024810188905230604482015260640160408051601f198184030181529190526020810180516001600160e01b031663125012df60e21b17905281518290600190811061162d5761162d612129565b60200260200101819052508c6001600160a01b0316828260405160240161165491906124bd565b60408051601f198184030181529181526020820180516001600160e01b0316631592ca1b60e31b179052516116899190612242565b60006040518083038185875af1925050503d80600081146116c6576040519150601f19603f3d011682016040523d82523d6000602084013e6116cb565b606091505b50508098505050611738565b8b6001600160a01b031681836040516116f09190612242565b60006040518083038185875af1925050503d806000811461172d576040519150601f19603f3d011682016040523d82523d6000602084013e611732565b606091505b50909750505b50505050505095945050505050565b60008060008060008580602001905181019061176391906125e1565b935093509350935060008761177957600061177b565b885b9050896001600160a01b03168185858c8987306040516024016117a3969594939291906126f2565b60408051601f198184030181529181526020820180516001600160e01b0316630651cb3560e01b179052516117d89190612242565b60006040518083038185875af1925050503d8060008114611815576040519150601f19603f3d011682016040523d82523d6000602084013e61181a565b606091505b50909b9a5050505050505050505050565b60008060008380602001905181019061184491906123fd565b91509150858282015284156118b957866001600160a01b0316868260405161186c9190612242565b60006040518083038185875af1925050503d80600081146118a9576040519150601f19603f3d011682016040523d82523d6000602084013e6118ae565b606091505b505080935050611919565b866001600160a01b0316816040516118d19190612242565b6000604051808303816000865af19150503d806000811461190e576040519150601f19603f3d011682016040523d82523d6000602084013e611913565b606091505b50909350505b5050949350505050565b6000808280602001905181019061193a91906127b1565b905060005b8151811015611b9b5780156119985761197582828151811061196357611963612129565b602002602001015160200151306109d8565b945081818151811061198957611989612129565b60200260200101516020015195505b60008282815181106119ac576119ac612129565b602002602001015160800151905060008383815181106119ce576119ce612129565b6020026020010151600001519050806000146119ea5786818301525b6119f388610be4565b15611a7b57838381518110611a0a57611a0a612129565b6020026020010151604001516001600160a01b03168783604051611a2e9190612242565b60006040518083038185875af1925050503d8060008114611a6b576040519150601f19603f3d011682016040523d82523d6000602084013e611a70565b606091505b505080955050611b7a565b8215611abc57611abc848481518110611a9657611a96612129565b602002602001015160600151888a6001600160a01b0316611bb39092919063ffffffff16565b838381518110611ace57611ace612129565b6020026020010151604001516001600160a01b031682604051611af19190612242565b6000604051808303816000865af19150503d8060008114611b2e576040519150601f19603f3d011682016040523d82523d6000602084013e611b33565b606091505b50909550508215611b7a57611b7a848481518110611b5357611b53612129565b60200260200101516060015160008a6001600160a01b0316610c1d9092919063ffffffff16565b84611b86575050611b9b565b50508080611b939061217b565b91505061193f565b50509392505050565b606061128f8484600085611c60565b604051636eb1769f60e11b81523060048201526001600160a01b0383811660248301526000919085169063dd62ed3e90604401602060405180830381865afa158015611c03573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c279190612194565b90506110e68463095ea7b360e01b85611c408686612168565b6040516001600160a01b0390921660248301526044820152606401610d2e565b606082471015611cc15760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161020b565b600080866001600160a01b03168587604051611cdd9190612242565b60006040518083038185875af1925050503d8060008114611d1a576040519150601f19603f3d011682016040523d82523d6000602084013e611d1f565b606091505b5091509150611d3087838387611d3b565b979650505050505050565b60608315611daa578251600003611da3576001600160a01b0385163b611da35760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161020b565b508161128f565b61128f8383815115611dbf5781518083602001fd5b8060405162461bcd60e51b815260040161020b91906128dc565b6001600160a01b038116811461021d57600080fd5b803561077281611dd9565b600080600060608486031215611e0e57600080fd5b8335611e1981611dd9565b92506020840135611e2981611dd9565b929592945050506040919091013590565b600060208284031215611e4c57600080fd5b81356001600160401b03811115611e6257600080fd5b820160c08185031215611e7457600080fd5b9392505050565b600060208284031215611e8d57600080fd5b8135611e7481611dd9565b6000808335601e19843603018112611eaf57600080fd5b8301803591506001600160401b03821115611ec957600080fd5b6020019150600581901b3603821315611ee157600080fd5b9250929050565b634e487b7160e01b600052604160045260246000fd5b60405160a081016001600160401b0381118282101715611f2057611f20611ee8565b60405290565b604051608081016001600160401b0381118282101715611f2057611f20611ee8565b604051606081016001600160401b0381118282101715611f2057611f20611ee8565b604051601f8201601f191681016001600160401b0381118282101715611f9257611f92611ee8565b604052919050565b60006001600160401b03821115611fb357611fb3611ee8565b5060051b60200190565b60006001600160401b03821115611fd657611fd6611ee8565b50601f01601f191660200190565b600082601f830112611ff557600080fd5b813561200861200382611fbd565b611f6a565b81815284602083860101111561201d57600080fd5b816020850160208301376000918101602001919091529392505050565b600061204861200384611f9a565b80848252602080830192508560051b85013681111561206657600080fd5b855b8181101561211d5780356001600160401b03808211156120885760008081fd5b818901915060a0823603121561209e5760008081fd5b6120a6611efe565b823560ff811681146120b85760008081fd5b8152828601356120c781611dd9565b8187015260406120d8848201611dee565b9082015260608381013590820152608080840135838111156120fa5760008081fd5b61210636828701611fe4565b918301919091525087525050938201938201612068565b50919695505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115610a6657610a6661213f565b80820180821115610a6657610a6661213f565b60006001820161218d5761218d61213f565b5060010190565b6000602082840312156121a657600080fd5b5051919050565b6000826121ca57634e487b7160e01b600052601260045260246000fd5b500490565b8082028115828204841417610a6657610a6661213f565b634e487b7160e01b600052602160045260246000fd5b60006020828403121561220e57600080fd5b81518015158114611e7457600080fd5b60005b83811015612239578181015183820152602001612221565b50506000910152565b6000825161225481846020870161221e565b9190910192915050565b6000806040838503121561227157600080fd5b825191506020808401516001600160401b0381111561228f57600080fd5b8401601f810186136122a057600080fd5b80516122ae61200382611f9a565b81815260059190911b820183019083810190888311156122cd57600080fd5b928401925b828410156122f45783516122e581611dd9565b825292840192908401906122d2565b80955050505050509250929050565b600081518084526020808501945080840160005b8381101561233c5781516001600160a01b031687529582019590820190600101612317565b509495945050505050565b8481526080602082015260006123606080830186612303565b6001600160a01b03949094166040830152506060015292915050565b85815284602082015260a06040820152600061239b60a0830186612303565b6001600160a01b0394909416606083015250608001529392505050565b600082601f8301126123c957600080fd5b81516123d761200382611fbd565b8181528460208386010111156123ec57600080fd5b61128f82602083016020870161221e565b6000806040838503121561241057600080fd5b8251915060208301516001600160401b0381111561242d57600080fd5b612439858286016123b8565b9150509250929050565b6000815180845261245b81602086016020860161221e565b601f01601f19169290920160200192915050565b60208152600082516080602084015261248b60a0840182612443565b905060018060a01b03602085015116604084015260408401516060840152606084015160808401528091505092915050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561251257603f19888603018452612500858351612443565b945092850192908501906001016124e4565b5092979650505050505050565b60006040516101208082018281106001600160401b038211171561254557612545611ee8565b604052909150819083018481111561255c57600080fd5b835b8181101561257f57805161257181611dd9565b83526020928301920161255e565b50505092915050565b600082601f83011261259957600080fd5b6125a1611f26565b8060808401858111156125b357600080fd5b845b818110156125d65780516125c881611dd9565b8452602093840193016125b5565b509095945050505050565b60008060008061034085870312156125f857600080fd5b84519350602086603f87011261260d57600080fd5b6126198782880161251f565b93508661015f87011261262b57600080fd5b612633611f26565b806102c088018981111561264657600080fd5b61014089015b818110156126a9578a601f8201126126645760008081fd5b61266c611f48565b80606083018d81111561267f5760008081fd5b835b818110156126985780518452928801928801612681565b50508552509284019260600161264c565b508195506126b78a82612588565b94505050505092959194509250565b8060005b60048110156110e65781516001600160a01b03168452602093840193909101906001016126ca565b6103808101818860005b60098110156127245781516001600160a01b03168352602092830192909101906001016126fc565b50505061012082018760005b60048110156127775781518360005b600381101561275e57825182526020928301929091019060010161273f565b5050506060929092019160209190910190600101612730565b505050856102a0830152846102c08301526127966102e08301856126c6565b6001600160a01b038316610360830152979650505050505050565b600060208083850312156127c457600080fd5b82516001600160401b03808211156127db57600080fd5b818501915085601f8301126127ef57600080fd5b81516127fd61200382611f9a565b81815260059190911b8301840190848101908883111561281c57600080fd5b8585015b838110156128cf578051858111156128385760008081fd5b860160a0818c03601f19018113156128505760008081fd5b612858611efe565b89830151815260408084015161286d81611dd9565b828c015260608481015161288081611dd9565b808385015250608091508185015161289781611dd9565b908301529183015191888311156128ae5760008081fd5b6128bc8e8c858701016123b8565b9082015285525050918601918601612820565b5098975050505050505050565b602081526000611e74602083018461244356fea26469706673582212201e2a9d895b137d910759e863445d141dde443a0c6449d18752118c5b7c3ecb5764736f6c63430008150033

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

000000000000000000000000df3f1ee5baf55055980887aad79f6fe6e3302d93

-----Decoded View---------------
Arg [0] : _owner (address): 0xdf3f1Ee5BAF55055980887AaD79F6fE6e3302D93

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000df3f1ee5baf55055980887aad79f6fe6e3302d93


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

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