ETH Price: $3,422.39 (+4.24%)

Contract

0xCc2b9B55952718b210660b56cA12Eb88694dC60f
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

1 address found via
Transaction Hash
Method
Block
From
To
Zap ERC20206696742024-09-03 11:12:4781 days ago1725361967IN
0xCc2b9B55...8694dC60f
0 ETH0.000939592.09584598
Zap ERC20206684812024-09-03 7:13:2381 days ago1725347603IN
0xCc2b9B55...8694dC60f
0 ETH0.000313741.4
Zap ERC20206684242024-09-03 7:01:4781 days ago1725346907IN
0xCc2b9B55...8694dC60f
0 ETH0.001109110.79751505
Zap ETH206644892024-09-02 17:51:1182 days ago1725299471IN
0xCc2b9B55...8694dC60f
250 ETH0.064980913
Zap ETH206641262024-09-02 16:38:1182 days ago1725295091IN
0xCc2b9B55...8694dC60f
400 ETH0.0215399912.9
Zap ERC20206558052024-09-01 12:45:3583 days ago1725194735IN
0xCc2b9B55...8694dC60f
0 ETH0.002636711
Zap ERC20206554152024-09-01 11:27:1183 days ago1725190031IN
0xCc2b9B55...8694dC60f
0 ETH0.003260931.1
Zap ETH206538612024-09-01 6:14:4783 days ago1725171287IN
0xCc2b9B55...8694dC60f
2.1 ETH0.000350970.64813894
Zap ETH206512382024-08-31 21:28:3583 days ago1725139715IN
0xCc2b9B55...8694dC60f
0.000021 ETH0.000268281.12279163
Zap ETH206512312024-08-31 21:27:1183 days ago1725139631IN
0xCc2b9B55...8694dC60f
0.00000434 ETH0.000253281
Zap ERC20206435452024-08-30 19:40:3584 days ago1725046835IN
0xCc2b9B55...8694dC60f
0 ETH0.00536381.65162899
Zap ETH206394562024-08-30 5:59:1185 days ago1724997551IN
0xCc2b9B55...8694dC60f
12 ETH0.001216010.7703752
Zap ETH206394402024-08-30 5:55:5985 days ago1724997359IN
0xCc2b9B55...8694dC60f
12.05 ETH0.001265050.78784568
Zap ETH206394342024-08-30 5:54:4785 days ago1724997287IN
0xCc2b9B55...8694dC60f
12.09 ETH0.001364070.79943674
Zap ERC20206381272024-08-30 1:31:1185 days ago1724981471IN
0xCc2b9B55...8694dC60f
0 ETH0.003135180.7593365
Zap ERC20206381162024-08-30 1:28:5985 days ago1724981339IN
0xCc2b9B55...8694dC60f
0 ETH0.003359140.82638531
Zap ERC20206380982024-08-30 1:25:2385 days ago1724981123IN
0xCc2b9B55...8694dC60f
0 ETH0.003401720.8
Zap ERC20206380892024-08-30 1:23:3585 days ago1724981015IN
0xCc2b9B55...8694dC60f
0 ETH0.003304040.8
Zap ERC20206380802024-08-30 1:21:4785 days ago1724980907IN
0xCc2b9B55...8694dC60f
0 ETH0.005711380.8
Zap ERC20206373262024-08-29 22:49:2385 days ago1724971763IN
0xCc2b9B55...8694dC60f
0 ETH0.00163481.02300497
Zap ERC20206373192024-08-29 22:47:5985 days ago1724971679IN
0xCc2b9B55...8694dC60f
0 ETH0.001604260.99688594
Zap ETH206372852024-08-29 22:41:1185 days ago1724971271IN
0xCc2b9B55...8694dC60f
23.12 ETH0.000592711.1
Zap ETH206372792024-08-29 22:39:5985 days ago1724971199IN
0xCc2b9B55...8694dC60f
1.9237 ETH0.000296531.13160042
Zap ETH206372742024-08-29 22:38:5985 days ago1724971139IN
0xCc2b9B55...8694dC60f
0.9005 ETH0.000288311.10406234
Zap ERC20206372392024-08-29 22:31:4785 days ago1724970707IN
0xCc2b9B55...8694dC60f
0 ETH0.001771941.15698627
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
206644892024-09-02 17:51:1182 days ago1725299471
0xCc2b9B55...8694dC60f
250 ETH
206641262024-09-02 16:38:1182 days ago1725295091
0xCc2b9B55...8694dC60f
400 ETH
206538612024-09-01 6:14:4783 days ago1725171287
0xCc2b9B55...8694dC60f
2.1 ETH
206512382024-08-31 21:28:3583 days ago1725139715
0xCc2b9B55...8694dC60f
0.000021 ETH
206512312024-08-31 21:27:1183 days ago1725139631
0xCc2b9B55...8694dC60f
0.00000434 ETH
206394562024-08-30 5:59:1185 days ago1724997551
0xCc2b9B55...8694dC60f
12 ETH
206394402024-08-30 5:55:5985 days ago1724997359
0xCc2b9B55...8694dC60f
12.05 ETH
206394342024-08-30 5:54:4785 days ago1724997287
0xCc2b9B55...8694dC60f
12.09 ETH
206372852024-08-29 22:41:1185 days ago1724971271
0xCc2b9B55...8694dC60f
23.12 ETH
206372792024-08-29 22:39:5985 days ago1724971199
0xCc2b9B55...8694dC60f
1.9237 ETH
206372742024-08-29 22:38:5985 days ago1724971139
0xCc2b9B55...8694dC60f
0.9005 ETH
206372062024-08-29 22:25:1185 days ago1724970311
0xCc2b9B55...8694dC60f
6.459 ETH
206372002024-08-29 22:23:5985 days ago1724970239
0xCc2b9B55...8694dC60f
0.442 ETH
206371942024-08-29 22:22:4785 days ago1724970167
0xCc2b9B55...8694dC60f
2.1361 ETH
206371752024-08-29 22:18:5985 days ago1724969939
0xCc2b9B55...8694dC60f
1.5691 ETH
206371642024-08-29 22:16:4785 days ago1724969807
0xCc2b9B55...8694dC60f
27.2649 ETH
206299952024-08-28 22:13:1186 days ago1724883191
0xCc2b9B55...8694dC60f
0.5 ETH
206252482024-08-28 6:18:4787 days ago1724825927
0xCc2b9B55...8694dC60f
1.5 ETH
206189332024-08-27 9:10:1188 days ago1724749811
0xCc2b9B55...8694dC60f
23.12224704 ETH
206186972024-08-27 8:22:4788 days ago1724746967
0xCc2b9B55...8694dC60f
19.60272775 ETH
206171762024-08-27 3:16:2388 days ago1724728583
0xCc2b9B55...8694dC60f
0.03 ETH
206168262024-08-27 2:05:2388 days ago1724724323
0xCc2b9B55...8694dC60f
0.8 ETH
206163082024-08-27 0:21:2388 days ago1724718083
0xCc2b9B55...8694dC60f
0.02 ETH
206003102024-08-24 18:40:5990 days ago1724524859
0xCc2b9B55...8694dC60f
29.9 ETH
205969552024-08-24 7:25:4791 days ago1724484347
0xCc2b9B55...8694dC60f
8.4 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Zapper

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
File 1 of 13 : Zapper.sol
// SPDX-License-Identifier: BlueOak-1.0.0
pragma solidity 0.8.17;

import { Address } from "@openzeppelin/contracts/utils/Address.sol";
import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import { ReentrancyGuard } from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { ERC2771Context } from "@openzeppelin/contracts/metatx/ERC2771Context.sol";

import { IWrappedNative } from "./IWrappedNative.sol";
import { FacadeRead, RToken, Call, ZapERC20Params } from "./IRTokenZapper.sol";
import { IPermit2, SignatureTransferDetails, PermitTransferFrom } from "./IPermit2.sol";
import { VM } from "./weiroll/VM.sol";

struct ExecuteOutput {
    uint256[] dust;
}
contract ZapperExecutor is VM {
    receive() external payable {}

    function add(
        uint256 a,
        uint256 b
    ) external pure returns (uint256) {
        return a + b;
    }
    function sub(
        uint256 a,
        uint256 b
    ) external pure returns (uint256) {
        return a - b;
    }
    function fpMul(
        uint256 a,
        uint256 b,
        uint256 scale
    ) external pure returns (uint256) {
        return (a * b) / scale;
    }
    function assertLarger(
        uint256 a,
        uint256 b
    ) external pure {
        require(a > b, "!ASSERT_GT");
    }
    function assertEqual(
        uint256 a,
        uint256 b
    ) external pure {
        require(a == b, "!ASSERT_EQ");
    }


    /** @dev Main endpoint to call
     * @param commands - Weiroll code to execute
     * @param state - Intiaial Weiroll state to use
     * @param tokens - All tokens used by the Zap in order to calculate dust
     */
    function execute(
        bytes32[] calldata commands,
        bytes[] memory state,
        IERC20[] memory tokens
    )
        public
        payable
        returns (ExecuteOutput memory out)
    {
        _execute(commands, state);
        out.dust = new uint256[](tokens.length);
        for(uint256 i; i < tokens.length; i++) {
            out.dust[i] = tokens[i].balanceOf(address(this));
        }
    }

    /** @dev Workaround for weiroll not supporting a way to make untyped calls.
      * @param to - Address to call
      * @param value - Amount of ETH to send
      * @param data - Data to send
     */
    function rawCall(
        address to,
        uint256 value,
        bytes calldata data
    ) external returns (bool success, bytes memory out) {
        (success, out) = to.call{value: value}(data);
    }

    /**   @dev Utility for minting max amount of rToken.
               Should only be used off-chain to calculate the exact
               amount of an rToken that can be minted
        * @param token - rToken to mint
        * @param recipient - Recipient of the rToken
     */
    function mintMaxRToken(
        FacadeRead facade,
        RToken token,
        address recipient
    ) external {
        uint256 maxIssueableAmount = facade.maxIssuable(token, address(this));
        token.issueTo(recipient, maxIssueableAmount);
    }
}

struct ZapperOutput {
    uint256[] dust;
    uint256 amountOut;
    uint256 gasUsed;
}

contract Zapper is ReentrancyGuard {
    IWrappedNative internal immutable wrappedNative;
    IPermit2 internal immutable permit2;
    ZapperExecutor internal immutable zapperExecutor;

    constructor(
        IWrappedNative wrappedNative_,
        IPermit2 permit2_,
        ZapperExecutor executor_
    ) {
        wrappedNative = wrappedNative_;
        permit2 = permit2_;
        zapperExecutor = executor_;
    }

    function zapInner(ZapERC20Params calldata params) internal returns (ZapperOutput memory out) {
        uint256 initialBalance = params.tokenOut.balanceOf(msg.sender);
        // STEP 1: Execute
        out.dust = zapperExecutor.execute(
            params.commands,
            params.state,
            params.tokens
        ).dust;

        // STEP 2: Verify that the user has gotten the tokens they requested
        uint256 newBalance = params.tokenOut.balanceOf(msg.sender);
        require(newBalance > initialBalance, "INVALID_NEW_BALANCE");
        uint256 difference = newBalance - initialBalance;
        require(difference >= params.amountOut, "INSUFFICIENT_OUT");

        out.amountOut = difference;
        
    }

    receive() external payable {
        require(msg.sender == address(wrappedNative), "INVALID_CALLER");
    }

    function zapERC20(
        ZapERC20Params calldata params
    ) external nonReentrant returns (ZapperOutput memory out) {
        uint256 startGas = gasleft();
        require(params.amountIn != 0, "INVALID_INPUT_AMOUNT");
        require(params.amountOut != 0, "INVALID_OUTPUT_AMOUNT");
        SafeERC20.safeTransferFrom(
            params.tokenIn,
            msg.sender,
            address(zapperExecutor),
            params.amountIn
        );
        out = zapInner(params);
        out.gasUsed = startGas - gasleft();
    }

    function zapERC20WithPermit2(
        ZapERC20Params calldata params,
        PermitTransferFrom calldata permit,
        bytes calldata signature
    ) external nonReentrant returns (ZapperOutput memory out) {
        uint256 startGas = gasleft();
        require(params.amountIn != 0, "INVALID_INPUT_AMOUNT");
        require(params.amountOut != 0, "INVALID_OUTPUT_AMOUNT");

        permit2.permitTransferFrom(
            permit,
            SignatureTransferDetails({
                to: address(zapperExecutor),
                requestedAmount: params.amountIn
            }),
            msg.sender,
            signature
        );

        out = zapInner(params);
        out.gasUsed = startGas - gasleft();
    }

    function zapETH(
        ZapERC20Params calldata params
    ) external payable nonReentrant returns (ZapperOutput memory out) {
        uint256 startGas = gasleft();
        require(address(params.tokenIn) == address(wrappedNative), "INVALID_INPUT_TOKEN");
        require(params.amountIn == msg.value, "INVALID_INPUT_AMOUNT");
        require(msg.value != 0, "INVALID_INPUT_AMOUNT");
        require(params.amountOut != 0, "INVALID_OUTPUT_AMOUNT");
        wrappedNative.deposit{ value: msg.value }();
        SafeERC20.safeTransfer(
            IERC20(address(wrappedNative)),
            address(zapperExecutor),
            wrappedNative.balanceOf(address(this))
        );
        out = zapInner(params);
        out.gasUsed = startGas - gasleft();
    }
}

File 2 of 13 : ERC2771Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol)

pragma solidity ^0.8.9;

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

/**
 * @dev Context variant with ERC2771 support.
 */
abstract contract ERC2771Context is Context {
    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable
    address private immutable _trustedForwarder;

    /// @custom:oz-upgrades-unsafe-allow constructor
    constructor(address trustedForwarder) {
        _trustedForwarder = trustedForwarder;
    }

    function isTrustedForwarder(address forwarder) public view virtual returns (bool) {
        return forwarder == _trustedForwarder;
    }

    function _msgSender() internal view virtual override returns (address sender) {
        if (isTrustedForwarder(msg.sender)) {
            // The assembly code is more direct than the Solidity version using `abi.decode`.
            /// @solidity memory-safe-assembly
            assembly {
                sender := shr(96, calldataload(sub(calldatasize(), 20)))
            }
        } else {
            return super._msgSender();
        }
    }

    function _msgData() internal view virtual override returns (bytes calldata) {
        if (isTrustedForwarder(msg.sender)) {
            return msg.data[:msg.data.length - 20];
        } else {
            return super._msgData();
        }
    }
}

File 3 of 13 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.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;
    }
}

File 4 of 13 : 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 5 of 13 : 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 6 of 13 : 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 7 of 13 : 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 8 of 13 : 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 9 of 13 : IPermit2.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
/// @notice The token and amount details for a transfer signed in the permit transfer signature
struct TokenPermissions {
    // ERC20 token address
    address token;
    // the maximum amount that can be spent
    uint256 amount;
}

/// @notice The signed permit message for a single token transfer
struct PermitTransferFrom {
    TokenPermissions permitted;
    // a unique value for every token owner's signature to prevent signature replays
    uint256 nonce;
    // deadline on the permit signature
    uint256 deadline;
}

/// @notice Specifies the recipient address and amount for batched transfers.
/// @dev Recipients and amounts correspond to the index of the signed token permissions array.
/// @dev Reverts if the requested amount is greater than the permitted signed amount.
struct SignatureTransferDetails {
    // recipient address
    address to;
    // spender requested amount
    uint256 requestedAmount;
}

interface IPermit2 {
    /// @notice Transfers a token using a signed permit message
    /// @dev Reverts if the requested amount is greater than the permitted signed amount
    /// @param permit The permit data signed over by the owner
    /// @param owner The owner of the tokens to transfer
    /// @param transferDetails The spender's requested transfer details for the permitted token
    /// @param signature The signature to verify
    function permitTransferFrom(
        PermitTransferFrom memory permit,
        SignatureTransferDetails calldata transferDetails,
        address owner,
        bytes calldata signature
    ) external;

    /// @notice A mapping from owner address to token address to spender address to PackedAllowance struct, which contains details and conditions of the approval.
    /// @notice The mapping is indexed in the above order see: allowance[ownerAddress][tokenAddress][spenderAddress]
    /// @dev The packed slot holds the allowed amount, expiration at which the allowed amount is no longer valid, and current nonce thats updated on any signature based approvals.
    function allowance(
        address,
        address,
        address
    ) external view returns (uint160, uint48, uint48);
}
/// @notice Thrown when validating an inputted signature that is stale
/// @param signatureDeadline The timestamp at which a signature is no longer valid
error SignatureExpired(uint256 signatureDeadline);

/// @notice Thrown when validating that the inputted nonce has not been used
error InvalidNonce();

File 10 of 13 : IRTokenZapper.sol
// SPDX-License-Identifier: BlueOak-1.0.0
pragma solidity 0.8.17;

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

struct Call {
    address to;
    bytes data;
    uint256 value;
}

struct ZapERC20Params {
    // Token to zap
    IERC20 tokenIn;
    // Total amount to zap / pull from user
    uint256 amountIn;
    
    // Weiroll code to execute to produce 'amountOut' of 'tokenOut'
    bytes32[] commands;
    bytes[] state;
    IERC20[] tokens;

    // RTokens the user requested
    uint256 amountOut;
    // RToken to issue
    IERC20 tokenOut;
}

interface FacadeRead {
    function maxIssuable(RToken rToken, address account) external returns (uint256);
}

interface RToken {
    function issueTo(address recipient, uint256 amount) external;
}

File 11 of 13 : IWrappedNative.sol
// SPDX-License-Identifier: BlueOak-1.0.0
pragma solidity 0.8.17;

interface IWrappedNative {
    function deposit() external payable;
    function withdraw(uint256 amount) external;
    function balanceOf(address account) external view returns (uint256);
}

File 12 of 13 : CommandBuilder.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.17;

library CommandBuilder {

    uint256 constant IDX_VARIABLE_LENGTH = 0x80;
    uint256 constant IDX_VALUE_MASK = 0x7f;
    uint256 constant IDX_END_OF_ARGS = 0xff;
    uint256 constant IDX_USE_STATE = 0xfe;

    function buildInputs(
        bytes[] memory state,
        bytes4 selector,
        bytes32 indices
    ) internal view returns (bytes memory ret) {
        uint256 count; // Number of bytes in whole ABI encoded message
        uint256 free; // Pointer to first free byte in tail part of message
        bytes memory stateData; // Optionally encode the current state if the call requires it

        uint256 idx;

        // Determine the length of the encoded data
        for (uint256 i; i < 32;) {
            idx = uint8(indices[i]);
            if (idx == IDX_END_OF_ARGS) break;

            if (idx & IDX_VARIABLE_LENGTH != 0) {
                if (idx == IDX_USE_STATE) {
                    if (stateData.length == 0) {
                        stateData = abi.encode(state);
                    }
                    count += stateData.length;
                } else {
                    // Add the size of the value, rounded up to the next word boundary, plus space for pointer and length
                    uint256 arglen = state[idx & IDX_VALUE_MASK].length;
                    require(
                        arglen % 32 == 0,
                        "Dynamic state variables must be a multiple of 32 bytes"
                    );
                    count += arglen + 32;
                }
            } else {
                require(
                    state[idx & IDX_VALUE_MASK].length == 32,
                    "Static state variables must be 32 bytes"
                );
                count += 32;
            }
            unchecked{free += 32;}
            unchecked{++i;}
        }

        // Encode it
        ret = new bytes(count + 4);
        assembly {
            mstore(add(ret, 32), selector)
        }
        count = 0;
        for (uint256 i; i < 32;) {
            idx = uint8(indices[i]);
            if (idx == IDX_END_OF_ARGS) break;

            if (idx & IDX_VARIABLE_LENGTH != 0) {
                if (idx == IDX_USE_STATE) {
                    assembly {
                        mstore(add(add(ret, 36), count), free)
                    }
                    memcpy(stateData, 32, ret, free + 4, stateData.length - 32);
                    free += stateData.length - 32;
                } else {
                    uint256 arglen = state[idx & IDX_VALUE_MASK].length;

                    // Variable length data; put a pointer in the slot and write the data at the end
                    assembly {
                        mstore(add(add(ret, 36), count), free)
                    }
                    memcpy(
                        state[idx & IDX_VALUE_MASK],
                        0,
                        ret,
                        free + 4,
                        arglen
                    );
                    free += arglen;
                }
            } else {
                // Fixed length data; write it directly
                bytes memory statevar = state[idx & IDX_VALUE_MASK];
                assembly {
                    mstore(add(add(ret, 36), count), mload(add(statevar, 32)))
                }
            }
            unchecked{count += 32;}
            unchecked{++i;}
        }
    }

    function writeOutputs(
        bytes[] memory state,
        bytes1 index,
        bytes memory output
    ) internal pure returns (bytes[] memory) {
        uint256 idx = uint8(index);
        if (idx == IDX_END_OF_ARGS) return state;

        if (idx & IDX_VARIABLE_LENGTH != 0) {
            if (idx == IDX_USE_STATE) {
                state = abi.decode(output, (bytes[]));
            } else {
                // Check the first field is 0x20 (because we have only a single return value)
                uint256 argptr;
                assembly {
                    argptr := mload(add(output, 32))
                }
                require(
                    argptr == 32,
                    "Only one return value permitted (variable)"
                );

                assembly {
                    // Overwrite the first word of the return data with the length - 32
                    mstore(add(output, 32), sub(mload(output), 32))
                    // Insert a pointer to the return data, starting at the second word, into state
                    mstore(
                        add(add(state, 32), mul(and(idx, IDX_VALUE_MASK), 32)),
                        add(output, 32)
                    )
                }
            }
        } else {
            // Single word
            require(
                output.length == 32,
                "Only one return value permitted (static)"
            );

            state[idx & IDX_VALUE_MASK] = output;
        }

        return state;
    }

    function writeTuple(
        bytes[] memory state,
        bytes1 index,
        bytes memory output
    ) internal view {
        uint256 idx = uint256(uint8(index));
        if (idx == IDX_END_OF_ARGS) return;

        bytes memory entry = state[idx] = new bytes(output.length + 32);
        memcpy(output, 0, entry, 32, output.length);
        assembly {
            let l := mload(output)
            mstore(add(entry, 32), l)
        }
    }

    function memcpy(
        bytes memory src,
        uint256 srcidx,
        bytes memory dest,
        uint256 destidx,
        uint256 len
    ) internal view {
        assembly {
            pop(
                staticcall(
                    gas(),
                    4,
                    add(add(src, 32), srcidx),
                    len,
                    add(add(dest, 32), destidx),
                    len
                )
            )
        }
    }
}

File 13 of 13 : VM.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.17;

import "./CommandBuilder.sol";


abstract contract VM {
    using CommandBuilder for bytes[];

    uint256 constant FLAG_CT_DELEGATECALL = 0x00;
    uint256 constant FLAG_CT_CALL = 0x01;
    uint256 constant FLAG_CT_STATICCALL = 0x02;
    uint256 constant FLAG_CT_VALUECALL = 0x03;
    uint256 constant FLAG_CT_MASK = 0x03;
    uint256 constant FLAG_EXTENDED_COMMAND = 0x80;
    uint256 constant FLAG_TUPLE_RETURN = 0x40;

    uint256 constant SHORT_COMMAND_FILL = 0x000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;

    address immutable self;

    error ExecutionFailed(
        uint256 command_index,
        address target,
        string message
    );

    constructor() {
        self = address(this);
    }

    // function callExtension(
    //     bytes memory data
    // ) virtual internal returns (bool success, bytes memory outdata);

    function _execute(bytes32[] calldata commands, bytes[] memory state)
      internal returns (bytes[] memory)
    {
        bytes32 command;
        uint256 flags;
        bytes32 indices;

        bool success;
        bytes memory outdata;

        uint256 commandsLength = commands.length;
        for (uint256 i; i < commandsLength;) {
            command = commands[i];
            flags = uint256(uint8(bytes1(command << 32)));

            if (flags & FLAG_EXTENDED_COMMAND != 0) {
                indices = commands[i++];
            } else {
                indices = bytes32(uint256(command << 40) | SHORT_COMMAND_FILL);
            }

            if (flags & FLAG_CT_MASK == FLAG_CT_DELEGATECALL) {
                (success, outdata) = address(uint160(uint256(command))).delegatecall( // target
                    // inputs
                    state.buildInputs(
                        //selector
                        bytes4(command),
                        indices
                    )
                );
            } else if (flags & FLAG_CT_MASK == FLAG_CT_CALL) {
                    (success, outdata) = address(uint160(uint256(command))).call( // target
                        // inputs
                        state.buildInputs(
                            //selector
                            bytes4(command),
                            indices
                        )
                    );
            } else if (flags & FLAG_CT_MASK == FLAG_CT_STATICCALL) {
                (success, outdata) = address(uint160(uint256(command))).staticcall( // target
                    // inputs
                    state.buildInputs(
                        //selector
                        bytes4(command),
                        indices
                    )
                );
            } else if (flags & FLAG_CT_MASK == FLAG_CT_VALUECALL) {
                uint256 calleth;
                bytes memory v = state[uint8(bytes1(indices))];
                require(v.length == 32, "_execute: value call has no value indicated.");
                assembly {
                    calleth := mload(add(v, 0x20))
                }
                (success, outdata) = address(uint160(uint256(command))).call{ // target
                    value: calleth
                }(
                    // inputs
                    state.buildInputs(
                        //selector
                        bytes4(command),
                        bytes32(uint256(indices << 8) | CommandBuilder.IDX_END_OF_ARGS)
                    )
                );
            } else {
                revert("Invalid calltype");
            }

            if (!success) {
                if (outdata.length > 0) {
                    assembly {
                        outdata := add(outdata, 68)
                    }
                }
                revert ExecutionFailed({
                    command_index: 0,
                    target: address(uint160(uint256(command))),
                    message: outdata.length > 0 ? string(outdata) : "Unknown"
                });
            }

            if (flags & FLAG_TUPLE_RETURN != 0) {
                state.writeTuple(bytes1(command << 88), outdata);
            } else {
                state = state.writeOutputs(bytes1(command << 88), outdata);
            }
            unchecked{++i;}
        }
        return state;
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IWrappedNative","name":"wrappedNative_","type":"address"},{"internalType":"contract IPermit2","name":"permit2_","type":"address"},{"internalType":"contract ZapperExecutor","name":"executor_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"components":[{"internalType":"contract IERC20","name":"tokenIn","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"bytes32[]","name":"commands","type":"bytes32[]"},{"internalType":"bytes[]","name":"state","type":"bytes[]"},{"internalType":"contract IERC20[]","name":"tokens","type":"address[]"},{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"contract IERC20","name":"tokenOut","type":"address"}],"internalType":"struct ZapERC20Params","name":"params","type":"tuple"}],"name":"zapERC20","outputs":[{"components":[{"internalType":"uint256[]","name":"dust","type":"uint256[]"},{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"gasUsed","type":"uint256"}],"internalType":"struct ZapperOutput","name":"out","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20","name":"tokenIn","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"bytes32[]","name":"commands","type":"bytes32[]"},{"internalType":"bytes[]","name":"state","type":"bytes[]"},{"internalType":"contract IERC20[]","name":"tokens","type":"address[]"},{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"contract IERC20","name":"tokenOut","type":"address"}],"internalType":"struct ZapERC20Params","name":"params","type":"tuple"},{"components":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct TokenPermissions","name":"permitted","type":"tuple"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"internalType":"struct PermitTransferFrom","name":"permit","type":"tuple"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"zapERC20WithPermit2","outputs":[{"components":[{"internalType":"uint256[]","name":"dust","type":"uint256[]"},{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"gasUsed","type":"uint256"}],"internalType":"struct ZapperOutput","name":"out","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20","name":"tokenIn","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"bytes32[]","name":"commands","type":"bytes32[]"},{"internalType":"bytes[]","name":"state","type":"bytes[]"},{"internalType":"contract IERC20[]","name":"tokens","type":"address[]"},{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"contract IERC20","name":"tokenOut","type":"address"}],"internalType":"struct ZapERC20Params","name":"params","type":"tuple"}],"name":"zapETH","outputs":[{"components":[{"internalType":"uint256[]","name":"dust","type":"uint256[]"},{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"gasUsed","type":"uint256"}],"internalType":"struct ZapperOutput","name":"out","type":"tuple"}],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60e06040523480156200001157600080fd5b506040516200242b3803806200242b833981810160405281019062000037919062000200565b60016000819055508273ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff16815250508173ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff16815250508073ffffffffffffffffffffffffffffffffffffffff1660c08173ffffffffffffffffffffffffffffffffffffffff16815250505050506200025c565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006200011682620000e9565b9050919050565b60006200012a8262000109565b9050919050565b6200013c816200011d565b81146200014857600080fd5b50565b6000815190506200015c8162000131565b92915050565b60006200016f8262000109565b9050919050565b620001818162000162565b81146200018d57600080fd5b50565b600081519050620001a18162000176565b92915050565b6000620001b482620000e9565b9050919050565b6000620001c882620001a7565b9050919050565b620001da81620001bb565b8114620001e657600080fd5b50565b600081519050620001fa81620001cf565b92915050565b6000806000606084860312156200021c576200021b620000e4565b5b60006200022c868287016200014b565b93505060206200023f8682870162000190565b92505060406200025286828701620001e9565b9150509250925092565b60805160a05160c05161216f620002bc60003960008181610238015281816104bb0152818161069401526108ce0152600061064c015260008181603f015281816102a6015281816104160152818161049a01526104dc015261216f6000f3fe6080604052600436106100385760003560e01c80638e0a8e9d146100d2578063dd074ea01461010f578063f78a98611461013f576100cd565b366100cd577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146100cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100c290610e8a565b60405180910390fd5b005b600080fd5b3480156100de57600080fd5b506100f960048036038101906100f49190610ee2565b61017c565b6040516101069190611043565b60405180910390f35b61012960048036038101906101249190610ee2565b61028f565b6040516101369190611043565b60405180910390f35b34801561014b57600080fd5b50610166600480360381019061016191906110e9565b6105a7565b6040516101739190611043565b60405180910390f35b610184610e0c565b61018c61075c565b60005a905060008360200135036101d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101cf906111c5565b60405180910390fd5b60008360a001350361021f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161021690611231565b60405180910390fd5b61026183600001602081019061023591906112c1565b337f000000000000000000000000000000000000000000000000000000000000000086602001356107ab565b61026a83610834565b91505a81610278919061131d565b8260400181815250505061028a610ae8565b919050565b610297610e0c565b61029f61075c565b60005a90507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168360000160208101906102ee91906112c1565b73ffffffffffffffffffffffffffffffffffffffff1614610344576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161033b9061139d565b60405180910390fd5b3483602001351461038a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610381906111c5565b60405180910390fd5b600034036103cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103c4906111c5565b60405180910390fd5b60008360a0013503610414576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161040b90611231565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b15801561047c57600080fd5b505af1158015610490573d6000803e3d6000fd5b50505050506105797f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161053391906113cc565b602060405180830381865afa158015610550573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105749190611413565b610af2565b61058283610834565b91505a81610590919061131d565b826040018181525050506105a2610ae8565b919050565b6105af610e0c565b6105b761075c565b60005a90506000866020013503610603576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105fa906111c5565b60405180910390fd5b60008660a001350361064a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064190611231565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166330f28b7a8660405180604001604052807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1681526020018a602001358152503388886040518663ffffffff1660e01b81526004016106f99594939291906115ef565b600060405180830381600087803b15801561071357600080fd5b505af1158015610727573d6000803e3d6000fd5b5050505061073486610834565b91505a81610742919061131d565b82604001818152505050610754610ae8565b949350505050565b6002600054036107a1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107989061168a565b60405180910390fd5b6002600081905550565b61082e846323b872dd60e01b8585856040516024016107cc939291906116b9565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050610b78565b50505050565b61083c610e0c565b60008260c001602081019061085191906112c1565b73ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b815260040161088991906113cc565b602060405180830381865afa1580156108a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ca9190611413565b90507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166308c4b49884806040019061091891906116ff565b8680606001906109289190611762565b88806080019061093891906117c5565b6040518763ffffffff1660e01b815260040161095996959493929190611b1a565b6000604051808303816000875af1158015610978573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906109a19190611d0c565b60000151826000018190525060008360c00160208101906109c291906112c1565b73ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b81526004016109fa91906113cc565b602060405180830381865afa158015610a17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3b9190611413565b9050818111610a7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7690611da1565b60405180910390fd5b60008282610a8d919061131d565b90508460a00135811015610ad6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610acd90611e0d565b60405180910390fd5b80846020018181525050505050919050565b6001600081905550565b610b738363a9059cbb60e01b8484604051602401610b11929190611e2d565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050610b78565b505050565b6000610bda826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16610c3f9092919063ffffffff16565b9050600081511115610c3a5780806020019051810190610bfa9190611e8e565b610c39576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3090611f2d565b60405180910390fd5b5b505050565b6060610c4e8484600085610c57565b90509392505050565b606082471015610c9c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c9390611fbf565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051610cc59190612050565b60006040518083038185875af1925050503d8060008114610d02576040519150601f19603f3d011682016040523d82523d6000602084013e610d07565b606091505b5091509150610d1887838387610d24565b92505050949350505050565b60608315610d86576000835103610d7e57610d3e85610d99565b610d7d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d74906120b3565b60405180910390fd5b5b829050610d91565b610d908383610dbc565b5b949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600082511115610dcf5781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e039190612117565b60405180910390fd5b60405180606001604052806060815260200160008152602001600081525090565b600082825260208201905092915050565b7f494e56414c49445f43414c4c4552000000000000000000000000000000000000600082015250565b6000610e74600e83610e2d565b9150610e7f82610e3e565b602082019050919050565b60006020820190508181036000830152610ea381610e67565b9050919050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600060e08284031215610ed957610ed8610ebe565b5b81905092915050565b600060208284031215610ef857610ef7610eb4565b5b600082013567ffffffffffffffff811115610f1657610f15610eb9565b5b610f2284828501610ec3565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000819050919050565b610f6a81610f57565b82525050565b6000610f7c8383610f61565b60208301905092915050565b6000602082019050919050565b6000610fa082610f2b565b610faa8185610f36565b9350610fb583610f47565b8060005b83811015610fe6578151610fcd8882610f70565b9750610fd883610f88565b925050600181019050610fb9565b5085935050505092915050565b600060608301600083015184820360008601526110108282610f95565b91505060208301516110256020860182610f61565b5060408301516110386040860182610f61565b508091505092915050565b6000602082019050818103600083015261105d8184610ff3565b905092915050565b60006080828403121561107b5761107a610ebe565b5b81905092915050565b600080fd5b600080fd5b600080fd5b60008083601f8401126110a9576110a8611084565b5b8235905067ffffffffffffffff8111156110c6576110c5611089565b5b6020830191508360018202830111156110e2576110e161108e565b5b9250929050565b60008060008060c0858703121561110357611102610eb4565b5b600085013567ffffffffffffffff81111561112157611120610eb9565b5b61112d87828801610ec3565b945050602061113e87828801611065565b93505060a085013567ffffffffffffffff81111561115f5761115e610eb9565b5b61116b87828801611093565b925092505092959194509250565b7f494e56414c49445f494e5055545f414d4f554e54000000000000000000000000600082015250565b60006111af601483610e2d565b91506111ba82611179565b602082019050919050565b600060208201905081810360008301526111de816111a2565b9050919050565b7f494e56414c49445f4f55545055545f414d4f554e540000000000000000000000600082015250565b600061121b601583610e2d565b9150611226826111e5565b602082019050919050565b6000602082019050818103600083015261124a8161120e565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061127c82611251565b9050919050565b600061128e82611271565b9050919050565b61129e81611283565b81146112a957600080fd5b50565b6000813590506112bb81611295565b92915050565b6000602082840312156112d7576112d6610eb4565b5b60006112e5848285016112ac565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061132882610f57565b915061133383610f57565b925082820390508181111561134b5761134a6112ee565b5b92915050565b7f494e56414c49445f494e5055545f544f4b454e00000000000000000000000000600082015250565b6000611387601383610e2d565b915061139282611351565b602082019050919050565b600060208201905081810360008301526113b68161137a565b9050919050565b6113c681611271565b82525050565b60006020820190506113e160008301846113bd565b92915050565b6113f081610f57565b81146113fb57600080fd5b50565b60008151905061140d816113e7565b92915050565b60006020828403121561142957611428610eb4565b5b6000611437848285016113fe565b91505092915050565b600082905092915050565b61145481611271565b811461145f57600080fd5b50565b6000813590506114718161144b565b92915050565b60006114866020840184611462565b905092915050565b61149781611271565b82525050565b6000813590506114ac816113e7565b92915050565b60006114c1602084018461149d565b905092915050565b604082016114da6000830183611477565b6114e7600085018261148e565b506114f560208301836114b2565b6115026020850182610f61565b50505050565b608082016115196000830183611440565b61152660008501826114c9565b5061153460408301836114b2565b6115416040850182610f61565b5061154f60608301836114b2565b61155c6060850182610f61565b50505050565b604082016000820151611578600085018261148e565b50602082015161158b6020850182610f61565b50505050565b600082825260208201905092915050565b82818337600083830152505050565b6000601f19601f8301169050919050565b60006115ce8385611591565b93506115db8385846115a2565b6115e4836115b1565b840190509392505050565b6000610100820190506116056000830188611508565b6116126080830187611562565b61161f60c08301866113bd565b81810360e08301526116328184866115c2565b90509695505050505050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b6000611674601f83610e2d565b915061167f8261163e565b602082019050919050565b600060208201905081810360008301526116a381611667565b9050919050565b6116b381610f57565b82525050565b60006060820190506116ce60008301866113bd565b6116db60208301856113bd565b6116e860408301846116aa565b949350505050565b600080fd5b600080fd5b600080fd5b6000808335600160200384360303811261171c5761171b6116f0565b5b80840192508235915067ffffffffffffffff82111561173e5761173d6116f5565b5b60208301925060208202360383131561175a576117596116fa565b5b509250929050565b6000808335600160200384360303811261177f5761177e6116f0565b5b80840192508235915067ffffffffffffffff8211156117a1576117a06116f5565b5b6020830192506020820236038313156117bd576117bc6116fa565b5b509250929050565b600080833560016020038436030381126117e2576117e16116f0565b5b80840192508235915067ffffffffffffffff821115611804576118036116f5565b5b6020830192506020820236038313156118205761181f6116fa565b5b509250929050565b600082825260208201905092915050565b600080fd5b82818337505050565b60006118538385611828565b93507f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83111561188657611885611839565b5b60208302925061189783858461183e565b82840190509392505050565b600082825260208201905092915050565b6000819050919050565b600082825260208201905092915050565b60006118db83856118be565b93506118e88385846115a2565b6118f1836115b1565b840190509392505050565b60006119098484846118cf565b90509392505050565b600080fd5b600080fd5b600080fd5b6000808335600160200384360303811261193e5761193d61191c565b5b83810192508235915060208301925067ffffffffffffffff82111561196657611965611912565b5b60018202360383131561197c5761197b611917565b5b509250929050565b6000602082019050919050565b600061199d83856118a3565b9350836020840285016119af846118b4565b8060005b878110156119f55784840389526119ca8284611921565b6119d58682846118fc565b95506119e084611984565b935060208b019a5050506001810190506119b3565b50829750879450505050509392505050565b600082825260208201905092915050565b6000819050919050565b6000819050919050565b6000611a47611a42611a3d84611251565b611a22565b611251565b9050919050565b6000611a5982611a2c565b9050919050565b6000611a6b82611a4e565b9050919050565b611a7b81611a60565b82525050565b6000611a8d8383611a72565b60208301905092915050565b6000611aa860208401846112ac565b905092915050565b6000602082019050919050565b6000611ac98385611a07565b9350611ad482611a18565b8060005b85811015611b0d57611aea8284611a99565b611af48882611a81565b9750611aff83611ab0565b925050600181019050611ad8565b5085925050509392505050565b60006060820190508181036000830152611b3581888a611847565b90508181036020830152611b4a818688611991565b90508181036040830152611b5f818486611abd565b9050979650505050505050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611ba9826115b1565b810181811067ffffffffffffffff82111715611bc857611bc7611b71565b5b80604052505050565b6000611bdb610eaa565b9050611be78282611ba0565b919050565b600080fd5b600067ffffffffffffffff821115611c0c57611c0b611b71565b5b602082029050602081019050919050565b6000611c30611c2b84611bf1565b611bd1565b90508083825260208201905060208402830185811115611c5357611c5261108e565b5b835b81811015611c7c5780611c6888826113fe565b845260208401935050602081019050611c55565b5050509392505050565b600082601f830112611c9b57611c9a611084565b5b8151611cab848260208601611c1d565b91505092915050565b600060208284031215611cca57611cc9611b6c565b5b611cd46020611bd1565b9050600082015167ffffffffffffffff811115611cf457611cf3611bec565b5b611d0084828501611c86565b60008301525092915050565b600060208284031215611d2257611d21610eb4565b5b600082015167ffffffffffffffff811115611d4057611d3f610eb9565b5b611d4c84828501611cb4565b91505092915050565b7f494e56414c49445f4e45575f42414c414e434500000000000000000000000000600082015250565b6000611d8b601383610e2d565b9150611d9682611d55565b602082019050919050565b60006020820190508181036000830152611dba81611d7e565b9050919050565b7f494e53554646494349454e545f4f555400000000000000000000000000000000600082015250565b6000611df7601083610e2d565b9150611e0282611dc1565b602082019050919050565b60006020820190508181036000830152611e2681611dea565b9050919050565b6000604082019050611e4260008301856113bd565b611e4f60208301846116aa565b9392505050565b60008115159050919050565b611e6b81611e56565b8114611e7657600080fd5b50565b600081519050611e8881611e62565b92915050565b600060208284031215611ea457611ea3610eb4565b5b6000611eb284828501611e79565b91505092915050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b6000611f17602a83610e2d565b9150611f2282611ebb565b604082019050919050565b60006020820190508181036000830152611f4681611f0a565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b6000611fa9602683610e2d565b9150611fb482611f4d565b604082019050919050565b60006020820190508181036000830152611fd881611f9c565b9050919050565b600081519050919050565b600081905092915050565b60005b83811015612013578082015181840152602081019050611ff8565b60008484015250505050565b600061202a82611fdf565b6120348185611fea565b9350612044818560208601611ff5565b80840191505092915050565b600061205c828461201f565b915081905092915050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b600061209d601d83610e2d565b91506120a882612067565b602082019050919050565b600060208201905081810360008301526120cc81612090565b9050919050565b600081519050919050565b60006120e9826120d3565b6120f38185610e2d565b9350612103818560208601611ff5565b61210c816115b1565b840191505092915050565b6000602082019050818103600083015261213181846120de565b90509291505056fea2646970667358221220e7dfe8d395aea61c824382b25fc2d27549726bec9a45656e64daaa015318948964736f6c63430008110033000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3000000000000000000000000675d37489a7a64c051d0204e5c72a469f6558a47

Deployed Bytecode

0x6080604052600436106100385760003560e01c80638e0a8e9d146100d2578063dd074ea01461010f578063f78a98611461013f576100cd565b366100cd577f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146100cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100c290610e8a565b60405180910390fd5b005b600080fd5b3480156100de57600080fd5b506100f960048036038101906100f49190610ee2565b61017c565b6040516101069190611043565b60405180910390f35b61012960048036038101906101249190610ee2565b61028f565b6040516101369190611043565b60405180910390f35b34801561014b57600080fd5b50610166600480360381019061016191906110e9565b6105a7565b6040516101739190611043565b60405180910390f35b610184610e0c565b61018c61075c565b60005a905060008360200135036101d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101cf906111c5565b60405180910390fd5b60008360a001350361021f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161021690611231565b60405180910390fd5b61026183600001602081019061023591906112c1565b337f000000000000000000000000675d37489a7a64c051d0204e5c72a469f6558a4786602001356107ab565b61026a83610834565b91505a81610278919061131d565b8260400181815250505061028a610ae8565b919050565b610297610e0c565b61029f61075c565b60005a90507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff168360000160208101906102ee91906112c1565b73ffffffffffffffffffffffffffffffffffffffff1614610344576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161033b9061139d565b60405180910390fd5b3483602001351461038a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610381906111c5565b60405180910390fd5b600034036103cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103c4906111c5565b60405180910390fd5b60008360a0013503610414576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161040b90611231565b60405180910390fd5b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff1663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b15801561047c57600080fd5b505af1158015610490573d6000803e3d6000fd5b50505050506105797f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc27f000000000000000000000000675d37489a7a64c051d0204e5c72a469f6558a477f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161053391906113cc565b602060405180830381865afa158015610550573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105749190611413565b610af2565b61058283610834565b91505a81610590919061131d565b826040018181525050506105a2610ae8565b919050565b6105af610e0c565b6105b761075c565b60005a90506000866020013503610603576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105fa906111c5565b60405180910390fd5b60008660a001350361064a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064190611231565b60405180910390fd5b7f000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba373ffffffffffffffffffffffffffffffffffffffff166330f28b7a8660405180604001604052807f000000000000000000000000675d37489a7a64c051d0204e5c72a469f6558a4773ffffffffffffffffffffffffffffffffffffffff1681526020018a602001358152503388886040518663ffffffff1660e01b81526004016106f99594939291906115ef565b600060405180830381600087803b15801561071357600080fd5b505af1158015610727573d6000803e3d6000fd5b5050505061073486610834565b91505a81610742919061131d565b82604001818152505050610754610ae8565b949350505050565b6002600054036107a1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107989061168a565b60405180910390fd5b6002600081905550565b61082e846323b872dd60e01b8585856040516024016107cc939291906116b9565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050610b78565b50505050565b61083c610e0c565b60008260c001602081019061085191906112c1565b73ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b815260040161088991906113cc565b602060405180830381865afa1580156108a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ca9190611413565b90507f000000000000000000000000675d37489a7a64c051d0204e5c72a469f6558a4773ffffffffffffffffffffffffffffffffffffffff166308c4b49884806040019061091891906116ff565b8680606001906109289190611762565b88806080019061093891906117c5565b6040518763ffffffff1660e01b815260040161095996959493929190611b1a565b6000604051808303816000875af1158015610978573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906109a19190611d0c565b60000151826000018190525060008360c00160208101906109c291906112c1565b73ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b81526004016109fa91906113cc565b602060405180830381865afa158015610a17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3b9190611413565b9050818111610a7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7690611da1565b60405180910390fd5b60008282610a8d919061131d565b90508460a00135811015610ad6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610acd90611e0d565b60405180910390fd5b80846020018181525050505050919050565b6001600081905550565b610b738363a9059cbb60e01b8484604051602401610b11929190611e2d565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050610b78565b505050565b6000610bda826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16610c3f9092919063ffffffff16565b9050600081511115610c3a5780806020019051810190610bfa9190611e8e565b610c39576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3090611f2d565b60405180910390fd5b5b505050565b6060610c4e8484600085610c57565b90509392505050565b606082471015610c9c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c9390611fbf565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051610cc59190612050565b60006040518083038185875af1925050503d8060008114610d02576040519150601f19603f3d011682016040523d82523d6000602084013e610d07565b606091505b5091509150610d1887838387610d24565b92505050949350505050565b60608315610d86576000835103610d7e57610d3e85610d99565b610d7d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d74906120b3565b60405180910390fd5b5b829050610d91565b610d908383610dbc565b5b949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600082511115610dcf5781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e039190612117565b60405180910390fd5b60405180606001604052806060815260200160008152602001600081525090565b600082825260208201905092915050565b7f494e56414c49445f43414c4c4552000000000000000000000000000000000000600082015250565b6000610e74600e83610e2d565b9150610e7f82610e3e565b602082019050919050565b60006020820190508181036000830152610ea381610e67565b9050919050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600060e08284031215610ed957610ed8610ebe565b5b81905092915050565b600060208284031215610ef857610ef7610eb4565b5b600082013567ffffffffffffffff811115610f1657610f15610eb9565b5b610f2284828501610ec3565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000819050919050565b610f6a81610f57565b82525050565b6000610f7c8383610f61565b60208301905092915050565b6000602082019050919050565b6000610fa082610f2b565b610faa8185610f36565b9350610fb583610f47565b8060005b83811015610fe6578151610fcd8882610f70565b9750610fd883610f88565b925050600181019050610fb9565b5085935050505092915050565b600060608301600083015184820360008601526110108282610f95565b91505060208301516110256020860182610f61565b5060408301516110386040860182610f61565b508091505092915050565b6000602082019050818103600083015261105d8184610ff3565b905092915050565b60006080828403121561107b5761107a610ebe565b5b81905092915050565b600080fd5b600080fd5b600080fd5b60008083601f8401126110a9576110a8611084565b5b8235905067ffffffffffffffff8111156110c6576110c5611089565b5b6020830191508360018202830111156110e2576110e161108e565b5b9250929050565b60008060008060c0858703121561110357611102610eb4565b5b600085013567ffffffffffffffff81111561112157611120610eb9565b5b61112d87828801610ec3565b945050602061113e87828801611065565b93505060a085013567ffffffffffffffff81111561115f5761115e610eb9565b5b61116b87828801611093565b925092505092959194509250565b7f494e56414c49445f494e5055545f414d4f554e54000000000000000000000000600082015250565b60006111af601483610e2d565b91506111ba82611179565b602082019050919050565b600060208201905081810360008301526111de816111a2565b9050919050565b7f494e56414c49445f4f55545055545f414d4f554e540000000000000000000000600082015250565b600061121b601583610e2d565b9150611226826111e5565b602082019050919050565b6000602082019050818103600083015261124a8161120e565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061127c82611251565b9050919050565b600061128e82611271565b9050919050565b61129e81611283565b81146112a957600080fd5b50565b6000813590506112bb81611295565b92915050565b6000602082840312156112d7576112d6610eb4565b5b60006112e5848285016112ac565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061132882610f57565b915061133383610f57565b925082820390508181111561134b5761134a6112ee565b5b92915050565b7f494e56414c49445f494e5055545f544f4b454e00000000000000000000000000600082015250565b6000611387601383610e2d565b915061139282611351565b602082019050919050565b600060208201905081810360008301526113b68161137a565b9050919050565b6113c681611271565b82525050565b60006020820190506113e160008301846113bd565b92915050565b6113f081610f57565b81146113fb57600080fd5b50565b60008151905061140d816113e7565b92915050565b60006020828403121561142957611428610eb4565b5b6000611437848285016113fe565b91505092915050565b600082905092915050565b61145481611271565b811461145f57600080fd5b50565b6000813590506114718161144b565b92915050565b60006114866020840184611462565b905092915050565b61149781611271565b82525050565b6000813590506114ac816113e7565b92915050565b60006114c1602084018461149d565b905092915050565b604082016114da6000830183611477565b6114e7600085018261148e565b506114f560208301836114b2565b6115026020850182610f61565b50505050565b608082016115196000830183611440565b61152660008501826114c9565b5061153460408301836114b2565b6115416040850182610f61565b5061154f60608301836114b2565b61155c6060850182610f61565b50505050565b604082016000820151611578600085018261148e565b50602082015161158b6020850182610f61565b50505050565b600082825260208201905092915050565b82818337600083830152505050565b6000601f19601f8301169050919050565b60006115ce8385611591565b93506115db8385846115a2565b6115e4836115b1565b840190509392505050565b6000610100820190506116056000830188611508565b6116126080830187611562565b61161f60c08301866113bd565b81810360e08301526116328184866115c2565b90509695505050505050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b6000611674601f83610e2d565b915061167f8261163e565b602082019050919050565b600060208201905081810360008301526116a381611667565b9050919050565b6116b381610f57565b82525050565b60006060820190506116ce60008301866113bd565b6116db60208301856113bd565b6116e860408301846116aa565b949350505050565b600080fd5b600080fd5b600080fd5b6000808335600160200384360303811261171c5761171b6116f0565b5b80840192508235915067ffffffffffffffff82111561173e5761173d6116f5565b5b60208301925060208202360383131561175a576117596116fa565b5b509250929050565b6000808335600160200384360303811261177f5761177e6116f0565b5b80840192508235915067ffffffffffffffff8211156117a1576117a06116f5565b5b6020830192506020820236038313156117bd576117bc6116fa565b5b509250929050565b600080833560016020038436030381126117e2576117e16116f0565b5b80840192508235915067ffffffffffffffff821115611804576118036116f5565b5b6020830192506020820236038313156118205761181f6116fa565b5b509250929050565b600082825260208201905092915050565b600080fd5b82818337505050565b60006118538385611828565b93507f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83111561188657611885611839565b5b60208302925061189783858461183e565b82840190509392505050565b600082825260208201905092915050565b6000819050919050565b600082825260208201905092915050565b60006118db83856118be565b93506118e88385846115a2565b6118f1836115b1565b840190509392505050565b60006119098484846118cf565b90509392505050565b600080fd5b600080fd5b600080fd5b6000808335600160200384360303811261193e5761193d61191c565b5b83810192508235915060208301925067ffffffffffffffff82111561196657611965611912565b5b60018202360383131561197c5761197b611917565b5b509250929050565b6000602082019050919050565b600061199d83856118a3565b9350836020840285016119af846118b4565b8060005b878110156119f55784840389526119ca8284611921565b6119d58682846118fc565b95506119e084611984565b935060208b019a5050506001810190506119b3565b50829750879450505050509392505050565b600082825260208201905092915050565b6000819050919050565b6000819050919050565b6000611a47611a42611a3d84611251565b611a22565b611251565b9050919050565b6000611a5982611a2c565b9050919050565b6000611a6b82611a4e565b9050919050565b611a7b81611a60565b82525050565b6000611a8d8383611a72565b60208301905092915050565b6000611aa860208401846112ac565b905092915050565b6000602082019050919050565b6000611ac98385611a07565b9350611ad482611a18565b8060005b85811015611b0d57611aea8284611a99565b611af48882611a81565b9750611aff83611ab0565b925050600181019050611ad8565b5085925050509392505050565b60006060820190508181036000830152611b3581888a611847565b90508181036020830152611b4a818688611991565b90508181036040830152611b5f818486611abd565b9050979650505050505050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611ba9826115b1565b810181811067ffffffffffffffff82111715611bc857611bc7611b71565b5b80604052505050565b6000611bdb610eaa565b9050611be78282611ba0565b919050565b600080fd5b600067ffffffffffffffff821115611c0c57611c0b611b71565b5b602082029050602081019050919050565b6000611c30611c2b84611bf1565b611bd1565b90508083825260208201905060208402830185811115611c5357611c5261108e565b5b835b81811015611c7c5780611c6888826113fe565b845260208401935050602081019050611c55565b5050509392505050565b600082601f830112611c9b57611c9a611084565b5b8151611cab848260208601611c1d565b91505092915050565b600060208284031215611cca57611cc9611b6c565b5b611cd46020611bd1565b9050600082015167ffffffffffffffff811115611cf457611cf3611bec565b5b611d0084828501611c86565b60008301525092915050565b600060208284031215611d2257611d21610eb4565b5b600082015167ffffffffffffffff811115611d4057611d3f610eb9565b5b611d4c84828501611cb4565b91505092915050565b7f494e56414c49445f4e45575f42414c414e434500000000000000000000000000600082015250565b6000611d8b601383610e2d565b9150611d9682611d55565b602082019050919050565b60006020820190508181036000830152611dba81611d7e565b9050919050565b7f494e53554646494349454e545f4f555400000000000000000000000000000000600082015250565b6000611df7601083610e2d565b9150611e0282611dc1565b602082019050919050565b60006020820190508181036000830152611e2681611dea565b9050919050565b6000604082019050611e4260008301856113bd565b611e4f60208301846116aa565b9392505050565b60008115159050919050565b611e6b81611e56565b8114611e7657600080fd5b50565b600081519050611e8881611e62565b92915050565b600060208284031215611ea457611ea3610eb4565b5b6000611eb284828501611e79565b91505092915050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b6000611f17602a83610e2d565b9150611f2282611ebb565b604082019050919050565b60006020820190508181036000830152611f4681611f0a565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b6000611fa9602683610e2d565b9150611fb482611f4d565b604082019050919050565b60006020820190508181036000830152611fd881611f9c565b9050919050565b600081519050919050565b600081905092915050565b60005b83811015612013578082015181840152602081019050611ff8565b60008484015250505050565b600061202a82611fdf565b6120348185611fea565b9350612044818560208601611ff5565b80840191505092915050565b600061205c828461201f565b915081905092915050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b600061209d601d83610e2d565b91506120a882612067565b602082019050919050565b600060208201905081810360008301526120cc81612090565b9050919050565b600081519050919050565b60006120e9826120d3565b6120f38185610e2d565b9350612103818560208601611ff5565b61210c816115b1565b840191505092915050565b6000602082019050818103600083015261213181846120de565b90509291505056fea2646970667358221220e7dfe8d395aea61c824382b25fc2d27549726bec9a45656e64daaa015318948964736f6c63430008110033

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

000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3000000000000000000000000675d37489a7a64c051d0204e5c72a469f6558a47

-----Decoded View---------------
Arg [0] : wrappedNative_ (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
Arg [1] : permit2_ (address): 0x000000000022D473030F116dDEE9F6B43aC78BA3
Arg [2] : executor_ (address): 0x675D37489A7A64c051D0204e5c72a469f6558a47

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Arg [1] : 000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3
Arg [2] : 000000000000000000000000675d37489a7a64c051d0204e5c72a469f6558a47


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  ]
[ 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.