Contract 0xF20296d47E91198Ca51326efa6543dcD7D3c2431 1

Txn Hash Method
Block
From
To
Value [Txn Fee]
0x2b078bc553b84667d60df6ceaebfae0205847e88a999408802ee1f55d7411d940x60806040253571882023-01-24 14:45:206 days 9 hrs ago0x52786c3b943d134b3698d71041dc27973f01ac80 IN  Create: OneInch0 AVAX0.041751625
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
OneInch

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 12 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-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 2 of 12 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";

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

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

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

File 3 of 12 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.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 4 of 12 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-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;

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

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

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

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

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

    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");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 5 of 12 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.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
     * ====
     *
     * [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://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

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

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

import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

import "./errors.sol";
import {IDefiOp} from "./interfaces/IDefiOp.sol";

abstract contract DefiOp is IDefiOp {
    using SafeERC20 for IERC20;

    address public owner;
    address public factory;

    function init(address owner_) external {
        if (owner != address(0)) {
            revert AlreadyInitialised();
        }
        owner = owner_;
        factory = msg.sender;

        _postInit();
    }

    function _postInit() internal virtual {}

    /**
     * @notice Withdraw ERC20 to owner
     * @dev This function withdraw all token amount to owner address
     * @param token ERC20 token address
     */
    function withdrawERC20(address token) external onlyOwner {
        _withdrawERC20(IERC20(token));
    }

    /**
     * @notice Withdraw native coin to owner (e.g ETH, AVAX, ...)
     * @dev This function withdraw all native coins to owner address
     */
    function withdrawNative() public onlyOwner {
        _withdrawETH();
    }

    receive() external payable {}

    // internal functions
    function _withdrawERC20(IERC20 token) internal {
        uint256 tokenAmount = token.balanceOf(address(this));
        if (tokenAmount > 0) {
            token.safeTransfer(owner, tokenAmount);
        }
    }

    function _withdrawETH() internal {
        uint256 balance = address(this).balance;
        if (balance > 0) {
            (bool success, ) = owner.call{value: balance}("");
            require(success, "Transfer failed");
        }
    }

    modifier onlyOwner() {
        if (msg.sender != owner) revert OnlyOwner();
        _;
    }
}

File 7 of 12 : errors.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.17;

// common
error AlreadyInitialised();
error OnlyOwner();
error NotEnougthNativeBalance(uint256 balance, uint256 requiredBalance);
error NotEnougthBalance(
    uint256 balance,
    uint256 requiredBalance,
    address token
);
error UnsupportedToken();

// bridges
error CannotBridgeToSameNetwork();
error UnsupportedDestinationChain(uint64 chainId);

File 8 of 12 : IOneInch.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.17;

struct SwapDescription {
    address srcToken;
    address dstToken;
    address payable srcReceiver;
    address payable dstReceiver;
    uint256 amount;
    uint256 minReturnAmount;
    uint256 flags;
    bytes permit;
}

interface IAggregationRouterV4 {
    function swap(
        address caller,
        SwapDescription calldata desc,
        bytes calldata data
    ) external payable returns (uint256 returnAmount, uint256 gasLeft);
}

File 9 of 12 : IDefiOp.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.17;

interface IDefiOp {
    function init(address owner_) external;

    function withdrawERC20(address token) external;

    function withdrawNative() external;
}

File 10 of 12 : ISwapFactory.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.17;

interface ISwapFactory {
    function isTokenWhitelisted(address token) external view returns (bool);
    function whitelistedTokens() external view returns (address[] memory);
}

File 11 of 12 : OneInch.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.17;

import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

import "../errors.sol";
import {Swap} from "./Swap.sol";
import {ISwapFactory} from "../interfaces/ISwapFactory.sol";
import {IAggregationRouterV4, SwapDescription} from "../interfaces/external/IOneInch.sol";

struct AggregationRouterV4CallData {
    address caller;
    SwapDescription desc;
    bytes data;
}

contract OneInch is Swap {
    using SafeERC20 for IERC20;

    IAggregationRouterV4 public constant ROUTER =
        IAggregationRouterV4(0x1111111254fb6c44bAC0beD2854e76F90643097d);

    function approveTokens() public {
        address[] memory wt = ISwapFactory(factory).whitelistedTokens();
        IERC20 token;
        for (uint256 i = 0; i < wt.length; i++) {
            token = IERC20(wt[i]);
            if (token.allowance(address(this), address(ROUTER)) == 0) {
                token.safeApprove(address(ROUTER), type(uint256).max);
            }
        }
    }

    function use1inch(AggregationRouterV4CallData calldata data)
        external
        checkToken(data.desc.srcToken)
        checkToken(data.desc.dstToken)
        onlyOwner
    {
        if (data.desc.dstReceiver != owner) revert OnlyOwner();
        ROUTER.swap(data.caller, data.desc, data.data);
    }

    function _postInit() internal override {
        approveTokens();
    }
}

File 12 of 12 : Swap.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.17;

import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";

import "../errors.sol";
import {ISwapFactory} from "../interfaces/ISwapFactory.sol";
import {DefiOp} from "../DefiOp.sol";

abstract contract Swap is DefiOp {
    modifier checkToken(address token) {
        if (!ISwapFactory(factory).isTokenWhitelisted(token))
            revert UnsupportedToken();
        _;
    }
}

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

Contract ABI

[{"inputs":[],"name":"AlreadyInitialised","type":"error"},{"inputs":[],"name":"OnlyOwner","type":"error"},{"inputs":[],"name":"UnsupportedToken","type":"error"},{"inputs":[],"name":"ROUTER","outputs":[{"internalType":"contract IAggregationRouterV4","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"approveTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner_","type":"address"}],"name":"init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"caller","type":"address"},{"components":[{"internalType":"address","name":"srcToken","type":"address"},{"internalType":"address","name":"dstToken","type":"address"},{"internalType":"address payable","name":"srcReceiver","type":"address"},{"internalType":"address payable","name":"dstReceiver","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"minReturnAmount","type":"uint256"},{"internalType":"uint256","name":"flags","type":"uint256"},{"internalType":"bytes","name":"permit","type":"bytes"}],"internalType":"struct SwapDescription","name":"desc","type":"tuple"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct AggregationRouterV4CallData","name":"data","type":"tuple"}],"name":"use1inch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"withdrawERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawNative","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

608060405234801561001057600080fd5b50611d5f806100206000396000f3fe60806040526004361061007f5760003560e01c8063c45a01551161004e578063c45a015514610121578063e5807c8a1461014c578063f4f3b20014610175578063fd68f2231461019e57610086565b806319ab453c1461008b57806332fe7b26146100b457806350431ce4146100df5780638da5cb5b146100f657610086565b3661008657005b600080fd5b34801561009757600080fd5b506100b260048036038101906100ad919061109a565b6101b5565b005b3480156100c057600080fd5b506100c96102c7565b6040516100d69190611126565b60405180910390f35b3480156100eb57600080fd5b506100f46102df565b005b34801561010257600080fd5b5061010b61036e565b6040516101189190611150565b60405180910390f35b34801561012d57600080fd5b50610136610392565b6040516101439190611150565b60405180910390f35b34801561015857600080fd5b50610173600480360381019061016e919061118f565b6103b8565b005b34801561018157600080fd5b5061019c6004803603810190610197919061109a565b610796565b005b3480156101aa57600080fd5b506101b3610827565b005b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461023b576040517f3c3282e700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506102c46109fe565b50565b731111111254fb6c44bac0bed2854e76f90643097d81565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610364576040517f5fc483c500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61036c610a08565b565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b8080602001906103c891906111e7565b60000160208101906103da919061109a565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b5af090f826040518263ffffffff1660e01b81526004016104359190611150565b602060405180830381865afa158015610452573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104769190611248565b6104ac576040517f6a17288200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8180602001906104bc91906111e7565b60200160208101906104ce919061109a565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b5af090f826040518263ffffffff1660e01b81526004016105299190611150565b602060405180830381865afa158015610546573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061056a9190611248565b6105a0576040517f6a17288200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610625576040517f5fc483c500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1683806020019061066c91906111e7565b606001602081019061067e91906112b3565b73ffffffffffffffffffffffffffffffffffffffff16146106cb576040517f5fc483c500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b731111111254fb6c44bac0bed2854e76f90643097d73ffffffffffffffffffffffffffffffffffffffff16637c02520084600001602081019061070e919061109a565b85806020019061071e91906111e7565b86806040019061072e91906112e0565b6040518563ffffffff1660e01b815260040161074d94939291906115eb565b60408051808303816000875af115801561076b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078f9190611647565b5050505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461081b576040517f5fc483c500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61082481610ae8565b50565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635e1762a06040518163ffffffff1660e01b8152600401600060405180830381865afa158015610896573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906108bf91906117e4565b9050600080600090505b82518110156109f9578281815181106108e5576108e461182d565b5b6020026020010151915060008273ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30731111111254fb6c44bac0bed2854e76f90643097d6040518363ffffffff1660e01b815260040161094092919061185c565b602060405180830381865afa15801561095d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109819190611885565b036109e6576109e5731111111254fb6c44bac0bed2854e76f90643097d7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8473ffffffffffffffffffffffffffffffffffffffff16610bbf9092919063ffffffff16565b5b80806109f1906118e1565b9150506108c9565b505050565b610a06610827565b565b60004790506000811115610ae55760008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1682604051610a5d9061195a565b60006040518083038185875af1925050503d8060008114610a9a576040519150601f19603f3d011682016040523d82523d6000602084013e610a9f565b606091505b5050905080610ae3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ada906119cc565b60405180910390fd5b505b50565b60008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610b239190611150565b602060405180830381865afa158015610b40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b649190611885565b90506000811115610bbb57610bba60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16828473ffffffffffffffffffffffffffffffffffffffff16610d0e9092919063ffffffff16565b5b5050565b6000811480610c49575060008373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30856040518363ffffffff1660e01b8152600401610c0692919061185c565b602060405180830381865afa158015610c23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c479190611885565b145b610c88576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c7f90611a5e565b60405180910390fd5b610d098363095ea7b360e01b8484604051602401610ca7929190611a8d565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050610d94565b505050565b610d8f8363a9059cbb60e01b8484604051602401610d2d929190611a8d565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050610d94565b505050565b6000610df6826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16610e5b9092919063ffffffff16565b9050600081511115610e565780806020019051810190610e169190611248565b610e55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4c90611b28565b60405180910390fd5b5b505050565b6060610e6a8484600085610e73565b90509392505050565b606082471015610eb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eaf90611bba565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051610ee19190611c40565b60006040518083038185875af1925050503d8060008114610f1e576040519150601f19603f3d011682016040523d82523d6000602084013e610f23565b606091505b5091509150610f3487838387610f40565b92505050949350505050565b60608315610fa2576000835103610f9a57610f5a85610fb5565b610f99576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f9090611ca3565b60405180910390fd5b5b829050610fad565b610fac8383610fd8565b5b949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600082511115610feb5781518083602001fd5b806040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161101f9190611d07565b60405180910390fd5b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006110678261103c565b9050919050565b6110778161105c565b811461108257600080fd5b50565b6000813590506110948161106e565b92915050565b6000602082840312156110b0576110af611032565b5b60006110be84828501611085565b91505092915050565b6000819050919050565b60006110ec6110e76110e28461103c565b6110c7565b61103c565b9050919050565b60006110fe826110d1565b9050919050565b6000611110826110f3565b9050919050565b61112081611105565b82525050565b600060208201905061113b6000830184611117565b92915050565b61114a8161105c565b82525050565b60006020820190506111656000830184611141565b92915050565b600080fd5b6000606082840312156111865761118561116b565b5b81905092915050565b6000602082840312156111a5576111a4611032565b5b600082013567ffffffffffffffff8111156111c3576111c2611037565b5b6111cf84828501611170565b91505092915050565b600080fd5b600080fd5b600080fd5b60008235600161010003833603038112611204576112036111d8565b5b80830191505092915050565b60008115159050919050565b61122581611210565b811461123057600080fd5b50565b6000815190506112428161121c565b92915050565b60006020828403121561125e5761125d611032565b5b600061126c84828501611233565b91505092915050565b60006112808261103c565b9050919050565b61129081611275565b811461129b57600080fd5b50565b6000813590506112ad81611287565b92915050565b6000602082840312156112c9576112c8611032565b5b60006112d78482850161129e565b91505092915050565b600080833560016020038436030381126112fd576112fc6111d8565b5b80840192508235915067ffffffffffffffff82111561131f5761131e6111dd565b5b60208301925060018202360383131561133b5761133a6111e2565b5b509250929050565b60006113526020840184611085565b905092915050565b6113638161105c565b82525050565b6000611378602084018461129e565b905092915050565b61138981611275565b82525050565b6000819050919050565b6113a28161138f565b81146113ad57600080fd5b50565b6000813590506113bf81611399565b92915050565b60006113d460208401846113b0565b905092915050565b6113e58161138f565b82525050565b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112611417576114166113f5565b5b83810192508235915060208301925067ffffffffffffffff82111561143f5761143e6113eb565b5b600182023603831315611455576114546113f0565b5b509250929050565b600082825260208201905092915050565b82818337600083830152505050565b6000601f19601f8301169050919050565b600061149a838561145d565b93506114a783858461146e565b6114b08361147d565b840190509392505050565b600061010083016114cf6000840184611343565b6114dc600086018261135a565b506114ea6020840184611343565b6114f7602086018261135a565b506115056040840184611369565b6115126040860182611380565b506115206060840184611369565b61152d6060860182611380565b5061153b60808401846113c5565b61154860808601826113dc565b5061155660a08401846113c5565b61156360a08601826113dc565b5061157160c08401846113c5565b61157e60c08601826113dc565b5061158c60e08401846113fa565b85830360e087015261159f83828461148e565b925050508091505092915050565b600082825260208201905092915050565b60006115ca83856115ad565b93506115d783858461146e565b6115e08361147d565b840190509392505050565b60006060820190506116006000830187611141565b818103602083015261161281866114bb565b905081810360408301526116278184866115be565b905095945050505050565b60008151905061164181611399565b92915050565b6000806040838503121561165e5761165d611032565b5b600061166c85828601611632565b925050602061167d85828601611632565b9150509250929050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6116c48261147d565b810181811067ffffffffffffffff821117156116e3576116e261168c565b5b80604052505050565b60006116f6611028565b905061170282826116bb565b919050565b600067ffffffffffffffff8211156117225761172161168c565b5b602082029050602081019050919050565b600080fd5b6000815190506117478161106e565b92915050565b600061176061175b84611707565b6116ec565b9050808382526020820190506020840283018581111561178357611782611733565b5b835b818110156117ac57806117988882611738565b845260208401935050602081019050611785565b5050509392505050565b600082601f8301126117cb576117ca611687565b5b81516117db84826020860161174d565b91505092915050565b6000602082840312156117fa576117f9611032565b5b600082015167ffffffffffffffff81111561181857611817611037565b5b611824848285016117b6565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006040820190506118716000830185611141565b61187e6020830184611141565b9392505050565b60006020828403121561189b5761189a611032565b5b60006118a984828501611632565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006118ec8261138f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361191e5761191d6118b2565b5b600182019050919050565b600081905092915050565b50565b6000611944600083611929565b915061194f82611934565b600082019050919050565b600061196582611937565b9150819050919050565b600082825260208201905092915050565b7f5472616e73666572206661696c65640000000000000000000000000000000000600082015250565b60006119b6600f8361196f565b91506119c182611980565b602082019050919050565b600060208201905081810360008301526119e5816119a9565b9050919050565b7f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60008201527f20746f206e6f6e2d7a65726f20616c6c6f77616e636500000000000000000000602082015250565b6000611a4860368361196f565b9150611a53826119ec565b604082019050919050565b60006020820190508181036000830152611a7781611a3b565b9050919050565b611a878161138f565b82525050565b6000604082019050611aa26000830185611141565b611aaf6020830184611a7e565b9392505050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b6000611b12602a8361196f565b9150611b1d82611ab6565b604082019050919050565b60006020820190508181036000830152611b4181611b05565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b6000611ba460268361196f565b9150611baf82611b48565b604082019050919050565b60006020820190508181036000830152611bd381611b97565b9050919050565b600081519050919050565b60005b83811015611c03578082015181840152602081019050611be8565b60008484015250505050565b6000611c1a82611bda565b611c248185611929565b9350611c34818560208601611be5565b80840191505092915050565b6000611c4c8284611c0f565b915081905092915050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b6000611c8d601d8361196f565b9150611c9882611c57565b602082019050919050565b60006020820190508181036000830152611cbc81611c80565b9050919050565b600081519050919050565b6000611cd982611cc3565b611ce3818561196f565b9350611cf3818560208601611be5565b611cfc8161147d565b840191505092915050565b60006020820190508181036000830152611d218184611cce565b90509291505056fea26469706673582212207086d56992345ba46ff4140b0782ed8addb67f24cb67263c9b22afc15040070c64736f6c63430008110033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.