ETH Price: $4,175.64 (-0.48%)

Contract

0xBBbfD134E9b44BfB5123898BA36b01dE7ab93d98

Overview

ETH Balance

0 ETH

ETH Value

$0.00

More Info

Private Name Tags

Multichain Info

N/A
Transaction Hash
Method
Block
From
To
Permit2Transfer ...119671172025-09-24 10:32:087 mins ago1758709928IN
0xBBbfD134...E7ab93d98
0 ETH0.000001720.00100026
Permit2Transfer ...119665812025-09-24 10:23:1216 mins ago1758709392IN
0xBBbfD134...E7ab93d98
0 ETH0.00000180.00100026
Transfer And Mul...119665152025-09-24 10:22:0617 mins ago1758709326IN
0xBBbfD134...E7ab93d98
0 ETH0.000001660.00100026
Permit2Transfer ...119664082025-09-24 10:20:1919 mins ago1758709219IN
0xBBbfD134...E7ab93d98
0 ETH0.000001520.00100026
Transfer And Mul...119663912025-09-24 10:20:0219 mins ago1758709202IN
0xBBbfD134...E7ab93d98
0 ETH0.000001650.00100026
Permit2Transfer ...119659822025-09-24 10:13:1326 mins ago1758708793IN
0xBBbfD134...E7ab93d98
0 ETH0.000001520.00100026
Permit2Transfer ...119656252025-09-24 10:07:1632 mins ago1758708436IN
0xBBbfD134...E7ab93d98
0 ETH0.00000170.00100026
Transfer And Mul...119634502025-09-24 9:31:011 hr ago1758706261IN
0xBBbfD134...E7ab93d98
0 ETH0.000001450.00043896
Permit2Transfer ...119633552025-09-24 9:29:261 hr ago1758706166IN
0xBBbfD134...E7ab93d98
0 ETH0.000001730.00100026
Permit2Transfer ...119632732025-09-24 9:28:041 hr ago1758706084IN
0xBBbfD134...E7ab93d98
0 ETH0.000001720.00100026
Transfer And Mul...119632652025-09-24 9:27:561 hr ago1758706076IN
0xBBbfD134...E7ab93d98
0 ETH0.000001550.00087776
Permit2Transfer ...119631222025-09-24 9:25:331 hr ago1758705933IN
0xBBbfD134...E7ab93d98
0 ETH0.000001730.00100026
Transfer And Mul...119631062025-09-24 9:25:171 hr ago1758705917IN
0xBBbfD134...E7ab93d98
0 ETH0.000001810.00100026
Transfer And Mul...119630352025-09-24 9:24:061 hr ago1758705846IN
0xBBbfD134...E7ab93d98
0 ETH0.000001630.00100026
Transfer And Mul...119627812025-09-24 9:19:521 hr ago1758705592IN
0xBBbfD134...E7ab93d98
0 ETH0.000001590.001
Transfer And Mul...119627002025-09-24 9:18:311 hr ago1758705511IN
0xBBbfD134...E7ab93d98
0 ETH0.000001510.00055026
Transfer And Mul...119596482025-09-24 8:27:392 hrs ago1758702459IN
0xBBbfD134...E7ab93d98
0 ETH0.000001350.00000026
Transfer And Mul...119595982025-09-24 8:26:492 hrs ago1758702409IN
0xBBbfD134...E7ab93d98
0 ETH0.000001350.00000026
Transfer And Mul...119595962025-09-24 8:26:472 hrs ago1758702407IN
0xBBbfD134...E7ab93d98
0 ETH0.000001350.00000026
Transfer And Mul...119595312025-09-24 8:25:422 hrs ago1758702342IN
0xBBbfD134...E7ab93d98
0 ETH0.000001350.00000026
Transfer And Mul...119583762025-09-24 8:06:272 hrs ago1758701187IN
0xBBbfD134...E7ab93d98
0 ETH0.000001720.0015
Transfer And Mul...119581742025-09-24 8:03:052 hrs ago1758700985IN
0xBBbfD134...E7ab93d98
0 ETH0.000001630.0011
Transfer And Mul...119575262025-09-24 7:52:172 hrs ago1758700337IN
0xBBbfD134...E7ab93d98
0 ETH0.000001360.00000026
Transfer And Mul...119573602025-09-24 7:49:312 hrs ago1758700171IN
0xBBbfD134...E7ab93d98
0 ETH0.00000160.00100026
Transfer And Mul...119571062025-09-24 7:45:172 hrs ago1758699917IN
0xBBbfD134...E7ab93d98
0 ETH0.000001610.00100026
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
119671172025-09-24 10:32:087 mins ago1758709928
0xBBbfD134...E7ab93d98
0 ETH
119671172025-09-24 10:32:087 mins ago1758709928
0xBBbfD134...E7ab93d98
0 ETH
119665812025-09-24 10:23:1216 mins ago1758709392
0xBBbfD134...E7ab93d98
0 ETH
119665812025-09-24 10:23:1216 mins ago1758709392
0xBBbfD134...E7ab93d98
0 ETH
119665152025-09-24 10:22:0617 mins ago1758709326
0xBBbfD134...E7ab93d98
0 ETH
119665152025-09-24 10:22:0617 mins ago1758709326
0xBBbfD134...E7ab93d98
0 ETH
119664082025-09-24 10:20:1919 mins ago1758709219
0xBBbfD134...E7ab93d98
0 ETH
119664082025-09-24 10:20:1919 mins ago1758709219
0xBBbfD134...E7ab93d98
0 ETH
119663912025-09-24 10:20:0219 mins ago1758709202
0xBBbfD134...E7ab93d98
0 ETH
119663912025-09-24 10:20:0219 mins ago1758709202
0xBBbfD134...E7ab93d98
0 ETH
119659822025-09-24 10:13:1326 mins ago1758708793
0xBBbfD134...E7ab93d98
0 ETH
119659822025-09-24 10:13:1326 mins ago1758708793
0xBBbfD134...E7ab93d98
0 ETH
119656252025-09-24 10:07:1632 mins ago1758708436
0xBBbfD134...E7ab93d98
0 ETH
119656252025-09-24 10:07:1632 mins ago1758708436
0xBBbfD134...E7ab93d98
0 ETH
119634502025-09-24 9:31:011 hr ago1758706261
0xBBbfD134...E7ab93d98
0 ETH
119634502025-09-24 9:31:011 hr ago1758706261
0xBBbfD134...E7ab93d98
0 ETH
119633552025-09-24 9:29:261 hr ago1758706166
0xBBbfD134...E7ab93d98
0 ETH
119633552025-09-24 9:29:261 hr ago1758706166
0xBBbfD134...E7ab93d98
0 ETH
119632732025-09-24 9:28:041 hr ago1758706084
0xBBbfD134...E7ab93d98
0 ETH
119632732025-09-24 9:28:041 hr ago1758706084
0xBBbfD134...E7ab93d98
0 ETH
119632652025-09-24 9:27:561 hr ago1758706076
0xBBbfD134...E7ab93d98
0 ETH
119632652025-09-24 9:27:561 hr ago1758706076
0xBBbfD134...E7ab93d98
0 ETH
119631222025-09-24 9:25:331 hr ago1758705933
0xBBbfD134...E7ab93d98
0 ETH
119631222025-09-24 9:25:331 hr ago1758705933
0xBBbfD134...E7ab93d98
0 ETH
119631062025-09-24 9:25:171 hr ago1758705917
0xBBbfD134...E7ab93d98
0 ETH
View All Internal Transactions

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ApprovalProxy

Compiler Version
v0.8.28+commit.7893614a

Optimization Enabled:
No with 200 runs

Other Settings:
cancun EvmVersion
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;

import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IERC20Permit} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {Ownable} from "solady/src/auth/Ownable.sol";
import {SignatureCheckerLib} from "solady/src/utils/SignatureCheckerLib.sol";
import {IPermit2} from "permit2-relay/src/interfaces/IPermit2.sol";
import {ISignatureTransfer} from "permit2-relay/src/interfaces/ISignatureTransfer.sol";
import {TrustlessPermit} from "trustlessPermit/TrustlessPermit.sol";
import {IRelayRouter} from "./interfaces/IRelayRouter.sol";
import {Call3Value, Permit, Result} from "./utils/RelayStructs.sol";

contract ApprovalProxy is Ownable {
    using SafeERC20 for IERC20;
    using SignatureCheckerLib for address;
    using TrustlessPermit for address;

    /// @notice Revert if the array lengths do not match
    error ArrayLengthsMismatch();

    /// @notice Revert if the native transfer fails
    error NativeTransferFailed();

    /// @notice Revert if the refundTo address is zero address
    error RefundToCannotBeZeroAddress();

    /// @notice Emit event when the router is updated
    event RouterUpdated(address newRouter);

    /// @notice Emit event when the Permit2 address is updated
    event Permit2Updated(address newPermit2);

    /// @notice The address of the router contract
    address public router;

    /// @notice The Permit2 contract
    IPermit2 private PERMIT2;

    bytes32 public constant _CALL3VALUE_TYPEHASH =
        keccak256(
            "Call3Value(address target,bool allowFailure,uint256 value,bytes callData)"
        );
    string public constant _RELAYER_WITNESS_TYPE_STRING =
        "RelayerWitness witness)Call3Value(address target,bool allowFailure,uint256 value,bytes callData)RelayerWitness(address relayer,address refundTo,address nftRecipient,Call3Value[] call3Values)TokenPermissions(address token,uint256 amount)";
    bytes32 public constant _EIP_712_RELAYER_WITNESS_TYPE_HASH =
        keccak256(
            "RelayerWitness(address relayer,address refundTo,address nftRecipient,Call3Value[] call3Values)Call3Value(address target,bool allowFailure,uint256 value,bytes callData)"
        );

    receive() external payable {}

    constructor(address _owner, address _router, address _permit2) {
        _initializeOwner(_owner);
        router = _router;
        PERMIT2 = IPermit2(_permit2);
    }

    /// @notice Withdraw function in case funds get stuck in contract
    function withdraw() external onlyOwner {
        _send(msg.sender, address(this).balance);
    }

    /// @notice Set the router address
    /// @param _router The address of the router contract
    function setRouter(address _router) external onlyOwner {
        router = _router;

        emit RouterUpdated(_router);
    }

    /// @notice Set the Permit2 address
    /// @param _permit2 The address of the Permit2 contract
    function setPermit2(address _permit2) external onlyOwner {
        PERMIT2 = IPermit2(_permit2);

        emit Permit2Updated(_permit2);
    }

    /// @notice Transfer tokens to RelayRouter and perform multicall in a single tx
    /// @dev    This contract must be approved to transfer msg.sender's tokens to the RelayRouter. If leftover ETH
    ///         is expected as part of the multicall, be sure to set refundTo to the expected recipient. If the multicall
    ///         includes ERC721/ERC1155 mints or transfers, be sure to set nftRecipient to the expected recipient.
    /// @param tokens An array of token addresses to transfer
    /// @param amounts An array of token amounts to transfer
    /// @param calls The calls to perform
    /// @param refundTo The address to refund any leftover ETH to
    /// @param nftRecipient The address to set as recipient of ERC721/ERC1155 mints
    function transferAndMulticall(
        address[] calldata tokens,
        uint256[] calldata amounts,
        Call3Value[] calldata calls,
        address refundTo,
        address nftRecipient
    ) external payable returns (Result[] memory returnData) {
        // Revert if array lengths do not match
        if ((tokens.length != amounts.length)) {
            revert ArrayLengthsMismatch();
        }

        // Revert if refundTo is zero address
        if (refundTo == address(0)) {
            revert RefundToCannotBeZeroAddress();
        }

        // Transfer the tokens to the router
        for (uint256 i = 0; i < tokens.length; i++) {
            IERC20(tokens[i]).safeTransferFrom(msg.sender, router, amounts[i]);
        }

        // Call multicall on the router
        // @dev msg.sender for the calls to targets will be the router
        returnData = IRelayRouter(router).multicall{value: msg.value}(
            calls,
            refundTo,
            nftRecipient
        );
    }

    /// @notice Use ERC2612 permit to transfer tokens to RelayRouter and execute multicall in a single tx
    /// @dev    Approved spender must be address(this) to transfer user's tokens to the RelayRouter. If leftover ETH
    ///         is expected as part of the multicall, be sure to set refundTo to the expected recipient. If the multicall
    ///         includes ERC721/ERC1155 mints or transfers, be sure to set nftRecipient to the expected recipient.
    /// @param permits An array of permits
    /// @param calls The calls to perform
    /// @param refundTo The address to refund any leftover ETH to
    /// @param nftRecipient The address to set as recipient of ERC721/ERC1155 mints
    /// @return returnData The return data from the multicall
    function permitTransferAndMulticall(
        Permit[] calldata permits,
        Call3Value[] calldata calls,
        address refundTo,
        address nftRecipient
    ) external payable returns (Result[] memory returnData) {
        // Revert if refundTo is zero address
        if (refundTo == address(0)) {
            revert RefundToCannotBeZeroAddress();
        }

        for (uint256 i = 0; i < permits.length; i++) {
            Permit memory permit = permits[i];

            // Revert if the permit owner is not the msg.sender
            if (permit.owner != msg.sender) {
                revert Unauthorized();
            }

            // Use the permit. Calling `trustlessPermit` allows tx to
            // continue even if permit gets frontrun
            permit.token.trustlessPermit(
                permit.owner,
                address(this),
                permit.value,
                permit.deadline,
                permit.v,
                permit.r,
                permit.s
            );

            // Transfer the tokens to the router
            IERC20(permit.token).safeTransferFrom(
                permit.owner,
                router,
                permit.value
            );
        }

        // Call multicall on the router
        // @dev msg.sender for the calls to targets will be the router
        returnData = IRelayRouter(router).multicall{value: msg.value}(
            calls,
            refundTo,
            nftRecipient
        );
    }

    /// @notice Use Permit2 to transfer tokens to RelayRouter and perform an arbitrary multicall.
    ///         Pass in an empty permitSignature to only perform the multicall.
    /// @dev    msg.value will persist across all calls in the multicall. If leftover ETH is expected
    ///         as part of the multicall, be sure to set refundTo to the expected recipient. If the multicall
    ///         includes ERC721/ERC1155 mints or transfers, be sure to set nftRecipient to the expected recipient.
    /// @param user The address of the user
    /// @param permit The permit details
    /// @param calls The calls to perform
    /// @param refundTo The address to refund any leftover ETH to
    /// @param nftRecipient The address to set as recipient of ERC721/ERC1155 mints
    /// @param permitSignature The signature for the permit
    function permit2TransferAndMulticall(
        address user,
        ISignatureTransfer.PermitBatchTransferFrom memory permit,
        Call3Value[] calldata calls,
        address refundTo,
        address nftRecipient,
        bytes memory permitSignature
    ) external payable returns (Result[] memory returnData) {
        // Revert if refundTo is zero address
        if (refundTo == address(0)) {
            revert RefundToCannotBeZeroAddress();
        }

        // If a permit signature is provided, use it to transfer tokens from user to router
        if (permitSignature.length != 0) {
            _handleBatchPermit(
                user,
                refundTo,
                nftRecipient,
                permit,
                calls,
                permitSignature
            );
        }

        // Perform the multicall and send leftover to refundTo
        returnData = IRelayRouter(router).multicall{value: msg.value}(
            calls,
            refundTo,
            nftRecipient
        );
    }

    /// @notice Internal function to handle a permit batch transfer
    /// @param user The address of the user
    /// @param refundTo The address to refund any leftover ETH to
    /// @param nftRecipient The address to set as recipient of ERC721/ERC1155 mints
    /// @param permit The permit details
    /// @param calls The calls to perform
    /// @param permitSignature The signature for the permit
    function _handleBatchPermit(
        address user,
        address refundTo,
        address nftRecipient,
        ISignatureTransfer.PermitBatchTransferFrom memory permit,
        Call3Value[] calldata calls,
        bytes memory permitSignature
    ) internal {
        // Create an array of keccak256 hashes of the call3Values
        bytes32[] memory call3ValuesHashes = new bytes32[](calls.length);
        for (uint256 i = 0; i < calls.length; i++) {
            // Encode the call3Value and hash it
            // @dev callData must be hashed before encoding since it is a dynamic type
            call3ValuesHashes[i] = keccak256(
                abi.encode(
                    _CALL3VALUE_TYPEHASH,
                    calls[i].target,
                    calls[i].allowFailure,
                    calls[i].value,
                    keccak256(calls[i].callData)
                )
            );
        }

        // Create the witness that should be signed over
        bytes32 witness = keccak256(
            abi.encode(
                _EIP_712_RELAYER_WITNESS_TYPE_HASH,
                msg.sender,
                refundTo,
                nftRecipient,
                keccak256(abi.encodePacked(call3ValuesHashes))
            )
        );

        // Create the SignatureTransferDetails array
        ISignatureTransfer.SignatureTransferDetails[]
            memory signatureTransferDetails = new ISignatureTransfer.SignatureTransferDetails[](
                permit.permitted.length
            );
        for (uint256 i = 0; i < permit.permitted.length; i++) {
            uint256 amount = permit.permitted[i].amount;

            signatureTransferDetails[i] = ISignatureTransfer
                .SignatureTransferDetails({
                    to: address(router),
                    requestedAmount: amount
                });
        }

        // Use the SignatureTransferDetails and permit signature to transfer tokens to the router
        PERMIT2.permitWitnessTransferFrom(
            permit,
            signatureTransferDetails,
            // When using a permit signature, cannot deposit on behalf of someone else other than `user`
            user,
            witness,
            _RELAYER_WITNESS_TYPE_STRING,
            permitSignature
        );
    }

    function _send(address to, uint256 value) internal {
        bool success;
        assembly {
            // Save gas by avoiding copying the return data to memory.
            // Provide at most 100k gas to the internal call, which is
            // more than enough to cover common use-cases of logic for
            // receiving native tokens (eg. SCW payable fallbacks).
            success := call(100000, to, value, 0, 0, 0, 0)
        }

        if (!success) {
            revert NativeTransferFailed();
        }
    }
}

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

pragma solidity ^0.8.20;

/**
 * @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 value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

    /**
     * @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the
     * allowance mechanism. `value` 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 value) external returns (bool);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.20;

/**
 * @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.
 *
 * ==== Security Considerations
 *
 * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
 * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
 * considered as an intention to spend the allowance in any specific way. The second is that because permits have
 * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
 * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
 * generally recommended is:
 *
 * ```solidity
 * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
 *     try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
 *     doThing(..., value);
 * }
 *
 * function doThing(..., uint256 value) public {
 *     token.safeTransferFrom(msg.sender, address(this), value);
 *     ...
 * }
 * ```
 *
 * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
 * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
 * {SafeERC20-safeTransferFrom}).
 *
 * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
 * contracts should have entry points that don't rely on permit.
 */
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].
     *
     * CAUTION: See Security Considerations above.
     */
    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);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";
import {IERC20Permit} from "../extensions/IERC20Permit.sol";
import {Address} from "../../../utils/Address.sol";

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

    /**
     * @dev An operation with an ERC20 token failed.
     */
    error SafeERC20FailedOperation(address token);

    /**
     * @dev Indicates a failed `decreaseAllowance` request.
     */
    error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);

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

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
    }

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

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
     * value, non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
        unchecked {
            uint256 currentAllowance = token.allowance(address(this), spender);
            if (currentAllowance < requestedDecrease) {
                revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
            }
            forceApprove(token, spender, currentAllowance - requestedDecrease);
        }
    }

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

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

    /**
     * @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);
        if (returndata.length != 0 && !abi.decode(returndata, (bool))) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)

pragma solidity ^0.8.20;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev The ETH balance of the account is not enough to perform the operation.
     */
    error AddressInsufficientBalance(address account);

    /**
     * @dev There's no code at `target` (it is not a contract).
     */
    error AddressEmptyCode(address target);

    /**
     * @dev A call to an address target failed. The target may have reverted.
     */
    error FailedInnerCall();

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

        (bool success, ) = recipient.call{value: amount}("");
        if (!success) {
            revert FailedInnerCall();
        }
    }

    /**
     * @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 or custom error, it is bubbled
     * up by this function (like regular Solidity function calls). However, if
     * the call reverted with no returned reason, this function reverts with a
     * {FailedInnerCall} error.
     *
     * 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.
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0);
    }

    /**
     * @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`.
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        if (address(this).balance < value) {
            revert AddressInsufficientBalance(address(this));
        }
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
     * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
     * unsuccessful call.
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata
    ) internal view returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            // only check if target is a contract if the call was successful and the return data is empty
            // otherwise we already know that it was a contract
            if (returndata.length == 0 && target.code.length == 0) {
                revert AddressEmptyCode(target);
            }
            return returndata;
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
     * revert reason or with a default {FailedInnerCall} error.
     */
    function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            return returndata;
        }
    }

    /**
     * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
     */
    function _revert(bytes memory returndata) 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 FailedInnerCall();
        }
    }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {IEIP712} from "./IEIP712.sol";

/// @title AllowanceTransfer
/// @notice Handles ERC20 token permissions through signature based allowance setting and ERC20 token transfers by checking allowed amounts
/// @dev Requires user's token approval on the Permit2 contract
interface IAllowanceTransfer is IEIP712 {
    /// @notice Thrown when an allowance on a token has expired.
    /// @param deadline The timestamp at which the allowed amount is no longer valid
    error AllowanceExpired(uint256 deadline);

    /// @notice Thrown when an allowance on a token has been depleted.
    /// @param amount The maximum amount allowed
    error InsufficientAllowance(uint256 amount);

    /// @notice Thrown when too many nonces are invalidated.
    error ExcessiveInvalidation();

    /// @notice Emits an event when the owner successfully invalidates an ordered nonce.
    event NonceInvalidation(
        address indexed owner, address indexed token, address indexed spender, uint48 newNonce, uint48 oldNonce
    );

    /// @notice Emits an event when the owner successfully sets permissions on a token for the spender.
    event Approval(
        address indexed owner, address indexed token, address indexed spender, uint160 amount, uint48 expiration
    );

    /// @notice Emits an event when the owner successfully sets permissions using a permit signature on a token for the spender.
    event Permit(
        address indexed owner,
        address indexed token,
        address indexed spender,
        uint160 amount,
        uint48 expiration,
        uint48 nonce
    );

    /// @notice Emits an event when the owner sets the allowance back to 0 with the lockdown function.
    event Lockdown(address indexed owner, address token, address spender);

    /// @notice The permit data for a token
    struct PermitDetails {
        // ERC20 token address
        address token;
        // the maximum amount allowed to spend
        uint160 amount;
        // timestamp at which a spender's token allowances become invalid
        uint48 expiration;
        // an incrementing value indexed per owner,token,and spender for each signature
        uint48 nonce;
    }

    /// @notice The permit message signed for a single token allowance
    struct PermitSingle {
        // the permit data for a single token alownce
        PermitDetails details;
        // address permissioned on the allowed tokens
        address spender;
        // deadline on the permit signature
        uint256 sigDeadline;
    }

    /// @notice The permit message signed for multiple token allowances
    struct PermitBatch {
        // the permit data for multiple token allowances
        PermitDetails[] details;
        // address permissioned on the allowed tokens
        address spender;
        // deadline on the permit signature
        uint256 sigDeadline;
    }

    /// @notice The saved permissions
    /// @dev This info is saved per owner, per token, per spender and all signed over in the permit message
    /// @dev Setting amount to type(uint160).max sets an unlimited approval
    struct PackedAllowance {
        // amount allowed
        uint160 amount;
        // permission expiry
        uint48 expiration;
        // an incrementing value indexed per owner,token,and spender for each signature
        uint48 nonce;
    }

    /// @notice A token spender pair.
    struct TokenSpenderPair {
        // the token the spender is approved
        address token;
        // the spender address
        address spender;
    }

    /// @notice Details for a token transfer.
    struct AllowanceTransferDetails {
        // the owner of the token
        address from;
        // the recipient of the token
        address to;
        // the amount of the token
        uint160 amount;
        // the token to be transferred
        address token;
    }

    /// @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 user, address token, address spender)
        external
        view
        returns (uint160 amount, uint48 expiration, uint48 nonce);

    /// @notice Approves the spender to use up to amount of the specified token up until the expiration
    /// @param token The token to approve
    /// @param spender The spender address to approve
    /// @param amount The approved amount of the token
    /// @param expiration The timestamp at which the approval is no longer valid
    /// @dev The packed allowance also holds a nonce, which will stay unchanged in approve
    /// @dev Setting amount to type(uint160).max sets an unlimited approval
    function approve(address token, address spender, uint160 amount, uint48 expiration) external;

    /// @notice Permit a spender to a given amount of the owners token via the owner's EIP-712 signature
    /// @dev May fail if the owner's nonce was invalidated in-flight by invalidateNonce
    /// @param owner The owner of the tokens being approved
    /// @param permitSingle Data signed over by the owner specifying the terms of approval
    /// @param signature The owner's signature over the permit data
    function permit(address owner, PermitSingle memory permitSingle, bytes calldata signature) external;

    /// @notice Permit a spender to the signed amounts of the owners tokens via the owner's EIP-712 signature
    /// @dev May fail if the owner's nonce was invalidated in-flight by invalidateNonce
    /// @param owner The owner of the tokens being approved
    /// @param permitBatch Data signed over by the owner specifying the terms of approval
    /// @param signature The owner's signature over the permit data
    function permit(address owner, PermitBatch memory permitBatch, bytes calldata signature) external;

    /// @notice Transfer approved tokens from one address to another
    /// @param from The address to transfer from
    /// @param to The address of the recipient
    /// @param amount The amount of the token to transfer
    /// @param token The token address to transfer
    /// @dev Requires the from address to have approved at least the desired amount
    /// of tokens to msg.sender.
    function transferFrom(address from, address to, uint160 amount, address token) external;

    /// @notice Transfer approved tokens in a batch
    /// @param transferDetails Array of owners, recipients, amounts, and tokens for the transfers
    /// @dev Requires the from addresses to have approved at least the desired amount
    /// of tokens to msg.sender.
    function transferFrom(AllowanceTransferDetails[] calldata transferDetails) external;

    /// @notice Enables performing a "lockdown" of the sender's Permit2 identity
    /// by batch revoking approvals
    /// @param approvals Array of approvals to revoke.
    function lockdown(TokenSpenderPair[] calldata approvals) external;

    /// @notice Invalidate nonces for a given (token, spender) pair
    /// @param token The token to invalidate nonces for
    /// @param spender The spender to invalidate nonces for
    /// @param newNonce The new nonce to set. Invalidates all nonces less than it.
    /// @dev Can't invalidate more than 2**16 nonces per transaction.
    function invalidateNonces(address token, address spender, uint48 newNonce) external;
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IEIP712 {
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 8 of 14 : IPermit2.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {ISignatureTransfer} from "./ISignatureTransfer.sol";
import {IAllowanceTransfer} from "./IAllowanceTransfer.sol";

/// @notice Permit2 handles signature-based transfers in SignatureTransfer and allowance-based transfers in AllowanceTransfer.
/// @dev Users must approve Permit2 before calling any of the transfer functions.
interface IPermit2 is ISignatureTransfer, IAllowanceTransfer {
// IPermit2 unifies the two interfaces so users have maximal flexibility with their approval.
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {IEIP712} from "./IEIP712.sol";

/// @title SignatureTransfer
/// @notice Handles ERC20 token transfers through signature based actions
/// @dev Requires user's token approval on the Permit2 contract
interface ISignatureTransfer is IEIP712 {
    /// @notice Thrown when the requested amount for a transfer is larger than the permissioned amount
    /// @param maxAmount The maximum amount a spender can request to transfer
    error InvalidAmount(uint256 maxAmount);

    /// @notice Thrown when the number of tokens permissioned to a spender does not match the number of tokens being transferred
    /// @dev If the spender does not need to transfer the number of tokens permitted, the spender can request amount 0 to be transferred
    error LengthMismatch();

    /// @notice Emits an event when the owner successfully invalidates an unordered nonce.
    event UnorderedNonceInvalidation(address indexed owner, uint256 word, uint256 mask);

    /// @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;
    }

    /// @notice Used to reconstruct the signed permit message for multiple token transfers
    /// @dev Do not need to pass in spender address as it is required that it is msg.sender
    /// @dev Note that a user still signs over a spender address
    struct PermitBatchTransferFrom {
        // the tokens and corresponding amounts permitted for a transfer
        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 A map from token owner address and a caller specified word index to a bitmap. Used to set bits in the bitmap to prevent against signature replay protection
    /// @dev Uses unordered nonces so that permit messages do not need to be spent in a certain order
    /// @dev The mapping is indexed first by the token owner, then by an index specified in the nonce
    /// @dev It returns a uint256 bitmap
    /// @dev The index, or wordPosition is capped at type(uint248).max
    function nonceBitmap(address, uint256) external view returns (uint256);

    /// @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 Transfers a token using a signed permit message
    /// @notice Includes extra data provided by the caller to verify signature over
    /// @dev The witness type string must follow EIP712 ordering of nested structs and must include the TokenPermissions type definition
    /// @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 witness Extra data to include when checking the user signature
    /// @param witnessTypeString The EIP-712 type definition for remaining string stub of the typehash
    /// @param signature The signature to verify
    function permitWitnessTransferFrom(
        PermitTransferFrom memory permit,
        SignatureTransferDetails calldata transferDetails,
        address owner,
        bytes32 witness,
        string calldata witnessTypeString,
        bytes calldata signature
    ) external;

    /// @notice Transfers multiple tokens using a signed permit message
    /// @param permit The permit data signed over by the owner
    /// @param owner The owner of the tokens to transfer
    /// @param transferDetails Specifies the recipient and requested amount for the token transfer
    /// @param signature The signature to verify
    function permitTransferFrom(
        PermitBatchTransferFrom memory permit,
        SignatureTransferDetails[] calldata transferDetails,
        address owner,
        bytes calldata signature
    ) external;

    /// @notice Transfers multiple tokens using a signed permit message
    /// @dev The witness type string must follow EIP712 ordering of nested structs and must include the TokenPermissions type definition
    /// @notice Includes extra data provided by the caller to verify signature over
    /// @param permit The permit data signed over by the owner
    /// @param owner The owner of the tokens to transfer
    /// @param transferDetails Specifies the recipient and requested amount for the token transfer
    /// @param witness Extra data to include when checking the user signature
    /// @param witnessTypeString The EIP-712 type definition for remaining string stub of the typehash
    /// @param signature The signature to verify
    function permitWitnessTransferFrom(
        PermitBatchTransferFrom memory permit,
        SignatureTransferDetails[] calldata transferDetails,
        address owner,
        bytes32 witness,
        string calldata witnessTypeString,
        bytes calldata signature
    ) external;

    /// @notice Invalidates the bits specified in mask for the bitmap at the word position
    /// @dev The wordPos is maxed at type(uint248).max
    /// @param wordPos A number to index the nonceBitmap at
    /// @param mask A bitmap masked against msg.sender's current bitmap at the word position
    function invalidateUnorderedNonces(uint256 wordPos, uint256 mask) external;
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

/// @notice Simple single owner authorization mixin.
/// @author Solady (https://github.com/vectorized/solady/blob/main/src/auth/Ownable.sol)
///
/// @dev Note:
/// This implementation does NOT auto-initialize the owner to `msg.sender`.
/// You MUST call the `_initializeOwner` in the constructor / initializer.
///
/// While the ownable portion follows
/// [EIP-173](https://eips.ethereum.org/EIPS/eip-173) for compatibility,
/// the nomenclature for the 2-step ownership handover may be unique to this codebase.
abstract contract Ownable {
    /*´:°•.°+.*•´.*:°.°*.°•´.°:°•.°•.*•´.*:°.°*.°•´.°:°•.°+.*•´.*:*/
    /*                       CUSTOM ERRORS                        */
    /*.•°:°.´+°.*°.°:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•°°.*°.°:*.´+°.•*/

    /// @dev The caller is not authorized to call the function.
    error Unauthorized();

    /// @dev The `newOwner` cannot be the zero address.
    error NewOwnerIsZeroAddress();

    /// @dev The `pendingOwner` does not have a valid handover request.
    error NoHandoverRequest();

    /// @dev Cannot double-initialize.
    error AlreadyInitialized();

    /*´:°•.°+.*•´.*:°.°*.°•´.°:°•.°•.*•´.*:°.°*.°•´.°:°•.°+.*•´.*:*/
    /*                           EVENTS                           */
    /*.•°:°.´+°.*°.°:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•°°.*°.°:*.´+°.•*/

    /// @dev The ownership is transferred from `oldOwner` to `newOwner`.
    /// This event is intentionally kept the same as OpenZeppelin's Ownable to be
    /// compatible with indexers and [EIP-173](https://eips.ethereum.org/EIPS/eip-173),
    /// despite it not being as lightweight as a single argument event.
    event OwnershipTransferred(address indexed oldOwner, address indexed newOwner);

    /// @dev An ownership handover to `pendingOwner` has been requested.
    event OwnershipHandoverRequested(address indexed pendingOwner);

    /// @dev The ownership handover to `pendingOwner` has been canceled.
    event OwnershipHandoverCanceled(address indexed pendingOwner);

    /// @dev `keccak256(bytes("OwnershipTransferred(address,address)"))`.
    uint256 private constant _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE =
        0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0;

    /// @dev `keccak256(bytes("OwnershipHandoverRequested(address)"))`.
    uint256 private constant _OWNERSHIP_HANDOVER_REQUESTED_EVENT_SIGNATURE =
        0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d;

    /// @dev `keccak256(bytes("OwnershipHandoverCanceled(address)"))`.
    uint256 private constant _OWNERSHIP_HANDOVER_CANCELED_EVENT_SIGNATURE =
        0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92;

    /*´:°•.°+.*•´.*:°.°*.°•´.°:°•.°•.*•´.*:°.°*.°•´.°:°•.°+.*•´.*:*/
    /*                          STORAGE                           */
    /*.•°:°.´+°.*°.°:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•°°.*°.°:*.´+°.•*/

    /// @dev The owner slot is given by:
    /// `bytes32(~uint256(uint32(bytes4(keccak256("_OWNER_SLOT_NOT")))))`.
    /// It is intentionally chosen to be a high value
    /// to avoid collision with lower slots.
    /// The choice of manual storage layout is to enable compatibility
    /// with both regular and upgradeable contracts.
    bytes32 internal constant _OWNER_SLOT =
        0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927;

    /// The ownership handover slot of `newOwner` is given by:
    /// ```
    ///     mstore(0x00, or(shl(96, user), _HANDOVER_SLOT_SEED))
    ///     let handoverSlot := keccak256(0x00, 0x20)
    /// ```
    /// It stores the expiry timestamp of the two-step ownership handover.
    uint256 private constant _HANDOVER_SLOT_SEED = 0x389a75e1;

    /*´:°•.°+.*•´.*:°.°*.°•´.°:°•.°•.*•´.*:°.°*.°•´.°:°•.°+.*•´.*:*/
    /*                     INTERNAL FUNCTIONS                     */
    /*.•°:°.´+°.*°.°:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•°°.*°.°:*.´+°.•*/

    /// @dev Override to return true to make `_initializeOwner` prevent double-initialization.
    function _guardInitializeOwner() internal pure virtual returns (bool guard) {}

    /// @dev Initializes the owner directly without authorization guard.
    /// This function must be called upon initialization,
    /// regardless of whether the contract is upgradeable or not.
    /// This is to enable generalization to both regular and upgradeable contracts,
    /// and to save gas in case the initial owner is not the caller.
    /// For performance reasons, this function will not check if there
    /// is an existing owner.
    function _initializeOwner(address newOwner) internal virtual {
        if (_guardInitializeOwner()) {
            /// @solidity memory-safe-assembly
            assembly {
                let ownerSlot := _OWNER_SLOT
                if sload(ownerSlot) {
                    mstore(0x00, 0x0dc149f0) // `AlreadyInitialized()`.
                    revert(0x1c, 0x04)
                }
                // Clean the upper 96 bits.
                newOwner := shr(96, shl(96, newOwner))
                // Store the new value.
                sstore(ownerSlot, or(newOwner, shl(255, iszero(newOwner))))
                // Emit the {OwnershipTransferred} event.
                log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, 0, newOwner)
            }
        } else {
            /// @solidity memory-safe-assembly
            assembly {
                // Clean the upper 96 bits.
                newOwner := shr(96, shl(96, newOwner))
                // Store the new value.
                sstore(_OWNER_SLOT, newOwner)
                // Emit the {OwnershipTransferred} event.
                log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, 0, newOwner)
            }
        }
    }

    /// @dev Sets the owner directly without authorization guard.
    function _setOwner(address newOwner) internal virtual {
        if (_guardInitializeOwner()) {
            /// @solidity memory-safe-assembly
            assembly {
                let ownerSlot := _OWNER_SLOT
                // Clean the upper 96 bits.
                newOwner := shr(96, shl(96, newOwner))
                // Emit the {OwnershipTransferred} event.
                log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, sload(ownerSlot), newOwner)
                // Store the new value.
                sstore(ownerSlot, or(newOwner, shl(255, iszero(newOwner))))
            }
        } else {
            /// @solidity memory-safe-assembly
            assembly {
                let ownerSlot := _OWNER_SLOT
                // Clean the upper 96 bits.
                newOwner := shr(96, shl(96, newOwner))
                // Emit the {OwnershipTransferred} event.
                log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, sload(ownerSlot), newOwner)
                // Store the new value.
                sstore(ownerSlot, newOwner)
            }
        }
    }

    /// @dev Throws if the sender is not the owner.
    function _checkOwner() internal view virtual {
        /// @solidity memory-safe-assembly
        assembly {
            // If the caller is not the stored owner, revert.
            if iszero(eq(caller(), sload(_OWNER_SLOT))) {
                mstore(0x00, 0x82b42900) // `Unauthorized()`.
                revert(0x1c, 0x04)
            }
        }
    }

    /// @dev Returns how long a two-step ownership handover is valid for in seconds.
    /// Override to return a different value if needed.
    /// Made internal to conserve bytecode. Wrap it in a public function if needed.
    function _ownershipHandoverValidFor() internal view virtual returns (uint64) {
        return 48 * 3600;
    }

    /*´:°•.°+.*•´.*:°.°*.°•´.°:°•.°•.*•´.*:°.°*.°•´.°:°•.°+.*•´.*:*/
    /*                  PUBLIC UPDATE FUNCTIONS                   */
    /*.•°:°.´+°.*°.°:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•°°.*°.°:*.´+°.•*/

    /// @dev Allows the owner to transfer the ownership to `newOwner`.
    function transferOwnership(address newOwner) public payable virtual onlyOwner {
        /// @solidity memory-safe-assembly
        assembly {
            if iszero(shl(96, newOwner)) {
                mstore(0x00, 0x7448fbae) // `NewOwnerIsZeroAddress()`.
                revert(0x1c, 0x04)
            }
        }
        _setOwner(newOwner);
    }

    /// @dev Allows the owner to renounce their ownership.
    function renounceOwnership() public payable virtual onlyOwner {
        _setOwner(address(0));
    }

    /// @dev Request a two-step ownership handover to the caller.
    /// The request will automatically expire in 48 hours (172800 seconds) by default.
    function requestOwnershipHandover() public payable virtual {
        unchecked {
            uint256 expires = block.timestamp + _ownershipHandoverValidFor();
            /// @solidity memory-safe-assembly
            assembly {
                // Compute and set the handover slot to `expires`.
                mstore(0x0c, _HANDOVER_SLOT_SEED)
                mstore(0x00, caller())
                sstore(keccak256(0x0c, 0x20), expires)
                // Emit the {OwnershipHandoverRequested} event.
                log2(0, 0, _OWNERSHIP_HANDOVER_REQUESTED_EVENT_SIGNATURE, caller())
            }
        }
    }

    /// @dev Cancels the two-step ownership handover to the caller, if any.
    function cancelOwnershipHandover() public payable virtual {
        /// @solidity memory-safe-assembly
        assembly {
            // Compute and set the handover slot to 0.
            mstore(0x0c, _HANDOVER_SLOT_SEED)
            mstore(0x00, caller())
            sstore(keccak256(0x0c, 0x20), 0)
            // Emit the {OwnershipHandoverCanceled} event.
            log2(0, 0, _OWNERSHIP_HANDOVER_CANCELED_EVENT_SIGNATURE, caller())
        }
    }

    /// @dev Allows the owner to complete the two-step ownership handover to `pendingOwner`.
    /// Reverts if there is no existing ownership handover requested by `pendingOwner`.
    function completeOwnershipHandover(address pendingOwner) public payable virtual onlyOwner {
        /// @solidity memory-safe-assembly
        assembly {
            // Compute and set the handover slot to 0.
            mstore(0x0c, _HANDOVER_SLOT_SEED)
            mstore(0x00, pendingOwner)
            let handoverSlot := keccak256(0x0c, 0x20)
            // If the handover does not exist, or has expired.
            if gt(timestamp(), sload(handoverSlot)) {
                mstore(0x00, 0x6f5e8818) // `NoHandoverRequest()`.
                revert(0x1c, 0x04)
            }
            // Set the handover slot to 0.
            sstore(handoverSlot, 0)
        }
        _setOwner(pendingOwner);
    }

    /*´:°•.°+.*•´.*:°.°*.°•´.°:°•.°•.*•´.*:°.°*.°•´.°:°•.°+.*•´.*:*/
    /*                   PUBLIC READ FUNCTIONS                    */
    /*.•°:°.´+°.*°.°:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•°°.*°.°:*.´+°.•*/

    /// @dev Returns the owner of the contract.
    function owner() public view virtual returns (address result) {
        /// @solidity memory-safe-assembly
        assembly {
            result := sload(_OWNER_SLOT)
        }
    }

    /// @dev Returns the expiry timestamp for the two-step ownership handover to `pendingOwner`.
    function ownershipHandoverExpiresAt(address pendingOwner)
        public
        view
        virtual
        returns (uint256 result)
    {
        /// @solidity memory-safe-assembly
        assembly {
            // Compute the handover slot.
            mstore(0x0c, _HANDOVER_SLOT_SEED)
            mstore(0x00, pendingOwner)
            // Load the handover slot.
            result := sload(keccak256(0x0c, 0x20))
        }
    }

    /*´:°•.°+.*•´.*:°.°*.°•´.°:°•.°•.*•´.*:°.°*.°•´.°:°•.°+.*•´.*:*/
    /*                         MODIFIERS                          */
    /*.•°:°.´+°.*°.°:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•°°.*°.°:*.´+°.•*/

    /// @dev Marks a function as only callable by the owner.
    modifier onlyOwner() virtual {
        _checkOwner();
        _;
    }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

/// @notice Signature verification helper that supports both ECDSA signatures from EOAs
/// and ERC1271 signatures from smart contract wallets like Argent and Gnosis safe.
/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/SignatureCheckerLib.sol)
/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/SignatureChecker.sol)
///
/// @dev Note:
/// - The signature checking functions use the ecrecover precompile (0x1).
/// - The `bytes memory signature` variants use the identity precompile (0x4)
///   to copy memory internally.
/// - Unlike ECDSA signatures, contract signatures are revocable.
/// - As of Solady version 0.0.134, all `bytes signature` variants accept both
///   regular 65-byte `(r, s, v)` and EIP-2098 `(r, vs)` short form signatures.
///   See: https://eips.ethereum.org/EIPS/eip-2098
///   This is for calldata efficiency on smart accounts prevalent on L2s.
///
/// WARNING! Do NOT use signatures as unique identifiers:
/// - Use a nonce in the digest to prevent replay attacks on the same contract.
/// - Use EIP-712 for the digest to prevent replay attacks across different chains and contracts.
///   EIP-712 also enables readable signing of typed data for better user safety.
/// This implementation does NOT check if a signature is non-malleable.
library SignatureCheckerLib {
    /*´:°•.°+.*•´.*:°.°*.°•´.°:°•.°•.*•´.*:°.°*.°•´.°:°•.°+.*•´.*:*/
    /*               SIGNATURE CHECKING OPERATIONS                */
    /*.•°:°.´+°.*°.°:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•°°.*°.°:*.´+°.•*/

    /// @dev Returns whether `signature` is valid for `signer` and `hash`.
    /// If `signer` is a smart contract, the signature is validated with ERC1271.
    /// Otherwise, the signature is validated with `ECDSA.recover`.
    function isValidSignatureNow(address signer, bytes32 hash, bytes memory signature)
        internal
        view
        returns (bool isValid)
    {
        /// @solidity memory-safe-assembly
        assembly {
            // Clean the upper 96 bits of `signer` in case they are dirty.
            for { signer := shr(96, shl(96, signer)) } signer {} {
                let m := mload(0x40)
                mstore(0x00, hash)
                mstore(0x40, mload(add(signature, 0x20))) // `r`.
                if eq(mload(signature), 64) {
                    let vs := mload(add(signature, 0x40))
                    mstore(0x20, add(shr(255, vs), 27)) // `v`.
                    mstore(0x60, shr(1, shl(1, vs))) // `s`.
                    let t :=
                        staticcall(
                            gas(), // Amount of gas left for the transaction.
                            1, // Address of `ecrecover`.
                            0x00, // Start of input.
                            0x80, // Size of input.
                            0x01, // Start of output.
                            0x20 // Size of output.
                        )
                    // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.
                    if iszero(or(iszero(returndatasize()), xor(signer, mload(t)))) {
                        isValid := 1
                        mstore(0x60, 0) // Restore the zero slot.
                        mstore(0x40, m) // Restore the free memory pointer.
                        break
                    }
                }
                if eq(mload(signature), 65) {
                    mstore(0x20, byte(0, mload(add(signature, 0x60)))) // `v`.
                    mstore(0x60, mload(add(signature, 0x40))) // `s`.
                    let t :=
                        staticcall(
                            gas(), // Amount of gas left for the transaction.
                            1, // Address of `ecrecover`.
                            0x00, // Start of input.
                            0x80, // Size of input.
                            0x01, // Start of output.
                            0x20 // Size of output.
                        )
                    // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.
                    if iszero(or(iszero(returndatasize()), xor(signer, mload(t)))) {
                        isValid := 1
                        mstore(0x60, 0) // Restore the zero slot.
                        mstore(0x40, m) // Restore the free memory pointer.
                        break
                    }
                }
                mstore(0x60, 0) // Restore the zero slot.
                mstore(0x40, m) // Restore the free memory pointer.

                let f := shl(224, 0x1626ba7e)
                mstore(m, f) // `bytes4(keccak256("isValidSignature(bytes32,bytes)"))`.
                mstore(add(m, 0x04), hash)
                let d := add(m, 0x24)
                mstore(d, 0x40) // The offset of the `signature` in the calldata.
                // Copy the `signature` over.
                let n := add(0x20, mload(signature))
                pop(staticcall(gas(), 4, signature, n, add(m, 0x44), n))
                // forgefmt: disable-next-item
                isValid := and(
                    // Whether the returndata is the magic value `0x1626ba7e` (left-aligned).
                    eq(mload(d), f),
                    // Whether the staticcall does not revert.
                    // This must be placed at the end of the `and` clause,
                    // as the arguments are evaluated from right to left.
                    staticcall(
                        gas(), // Remaining gas.
                        signer, // The `signer` address.
                        m, // Offset of calldata in memory.
                        add(returndatasize(), 0x44), // Length of calldata in memory.
                        d, // Offset of returndata.
                        0x20 // Length of returndata to write.
                    )
                )
                break
            }
        }
    }

    /// @dev Returns whether `signature` is valid for `signer` and `hash`.
    /// If `signer` is a smart contract, the signature is validated with ERC1271.
    /// Otherwise, the signature is validated with `ECDSA.recover`.
    function isValidSignatureNowCalldata(address signer, bytes32 hash, bytes calldata signature)
        internal
        view
        returns (bool isValid)
    {
        /// @solidity memory-safe-assembly
        assembly {
            // Clean the upper 96 bits of `signer` in case they are dirty.
            for { signer := shr(96, shl(96, signer)) } signer {} {
                let m := mload(0x40)
                mstore(0x00, hash)
                if eq(signature.length, 64) {
                    let vs := calldataload(add(signature.offset, 0x20))
                    mstore(0x20, add(shr(255, vs), 27)) // `v`.
                    mstore(0x40, calldataload(signature.offset)) // `r`.
                    mstore(0x60, shr(1, shl(1, vs))) // `s`.
                    let t :=
                        staticcall(
                            gas(), // Amount of gas left for the transaction.
                            1, // Address of `ecrecover`.
                            0x00, // Start of input.
                            0x80, // Size of input.
                            0x01, // Start of output.
                            0x20 // Size of output.
                        )
                    // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.
                    if iszero(or(iszero(returndatasize()), xor(signer, mload(t)))) {
                        isValid := 1
                        mstore(0x60, 0) // Restore the zero slot.
                        mstore(0x40, m) // Restore the free memory pointer.
                        break
                    }
                }
                if eq(signature.length, 65) {
                    mstore(0x20, byte(0, calldataload(add(signature.offset, 0x40)))) // `v`.
                    calldatacopy(0x40, signature.offset, 0x40) // `r`, `s`.
                    let t :=
                        staticcall(
                            gas(), // Amount of gas left for the transaction.
                            1, // Address of `ecrecover`.
                            0x00, // Start of input.
                            0x80, // Size of input.
                            0x01, // Start of output.
                            0x20 // Size of output.
                        )
                    // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.
                    if iszero(or(iszero(returndatasize()), xor(signer, mload(t)))) {
                        isValid := 1
                        mstore(0x60, 0) // Restore the zero slot.
                        mstore(0x40, m) // Restore the free memory pointer.
                        break
                    }
                }
                mstore(0x60, 0) // Restore the zero slot.
                mstore(0x40, m) // Restore the free memory pointer.

                let f := shl(224, 0x1626ba7e)
                mstore(m, f) // `bytes4(keccak256("isValidSignature(bytes32,bytes)"))`.
                mstore(add(m, 0x04), hash)
                let d := add(m, 0x24)
                mstore(d, 0x40) // The offset of the `signature` in the calldata.
                mstore(add(m, 0x44), signature.length)
                // Copy the `signature` over.
                calldatacopy(add(m, 0x64), signature.offset, signature.length)
                // forgefmt: disable-next-item
                isValid := and(
                    // Whether the returndata is the magic value `0x1626ba7e` (left-aligned).
                    eq(mload(d), f),
                    // Whether the staticcall does not revert.
                    // This must be placed at the end of the `and` clause,
                    // as the arguments are evaluated from right to left.
                    staticcall(
                        gas(), // Remaining gas.
                        signer, // The `signer` address.
                        m, // Offset of calldata in memory.
                        add(signature.length, 0x64), // Length of calldata in memory.
                        d, // Offset of returndata.
                        0x20 // Length of returndata to write.
                    )
                )
                break
            }
        }
    }

    /// @dev Returns whether the signature (`r`, `vs`) is valid for `signer` and `hash`.
    /// If `signer` is a smart contract, the signature is validated with ERC1271.
    /// Otherwise, the signature is validated with `ECDSA.recover`.
    function isValidSignatureNow(address signer, bytes32 hash, bytes32 r, bytes32 vs)
        internal
        view
        returns (bool isValid)
    {
        /// @solidity memory-safe-assembly
        assembly {
            // Clean the upper 96 bits of `signer` in case they are dirty.
            for { signer := shr(96, shl(96, signer)) } signer {} {
                let m := mload(0x40)
                mstore(0x00, hash)
                mstore(0x20, add(shr(255, vs), 27)) // `v`.
                mstore(0x40, r) // `r`.
                mstore(0x60, shr(1, shl(1, vs))) // `s`.
                let t :=
                    staticcall(
                        gas(), // Amount of gas left for the transaction.
                        1, // Address of `ecrecover`.
                        0x00, // Start of input.
                        0x80, // Size of input.
                        0x01, // Start of output.
                        0x20 // Size of output.
                    )
                // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.
                if iszero(or(iszero(returndatasize()), xor(signer, mload(t)))) {
                    isValid := 1
                    mstore(0x60, 0) // Restore the zero slot.
                    mstore(0x40, m) // Restore the free memory pointer.
                    break
                }

                let f := shl(224, 0x1626ba7e)
                mstore(m, f) // `bytes4(keccak256("isValidSignature(bytes32,bytes)"))`.
                mstore(add(m, 0x04), hash)
                let d := add(m, 0x24)
                mstore(d, 0x40) // The offset of the `signature` in the calldata.
                mstore(add(m, 0x44), 65) // Length of the signature.
                mstore(add(m, 0x64), r) // `r`.
                mstore(add(m, 0x84), mload(0x60)) // `s`.
                mstore8(add(m, 0xa4), mload(0x20)) // `v`.
                // forgefmt: disable-next-item
                isValid := and(
                    // Whether the returndata is the magic value `0x1626ba7e` (left-aligned).
                    eq(mload(d), f),
                    // Whether the staticcall does not revert.
                    // This must be placed at the end of the `and` clause,
                    // as the arguments are evaluated from right to left.
                    staticcall(
                        gas(), // Remaining gas.
                        signer, // The `signer` address.
                        m, // Offset of calldata in memory.
                        0xa5, // Length of calldata in memory.
                        d, // Offset of returndata.
                        0x20 // Length of returndata to write.
                    )
                )
                mstore(0x60, 0) // Restore the zero slot.
                mstore(0x40, m) // Restore the free memory pointer.
                break
            }
        }
    }

    /// @dev Returns whether the signature (`v`, `r`, `s`) is valid for `signer` and `hash`.
    /// If `signer` is a smart contract, the signature is validated with ERC1271.
    /// Otherwise, the signature is validated with `ECDSA.recover`.
    function isValidSignatureNow(address signer, bytes32 hash, uint8 v, bytes32 r, bytes32 s)
        internal
        view
        returns (bool isValid)
    {
        /// @solidity memory-safe-assembly
        assembly {
            // Clean the upper 96 bits of `signer` in case they are dirty.
            for { signer := shr(96, shl(96, signer)) } signer {} {
                let m := mload(0x40)
                mstore(0x00, hash)
                mstore(0x20, and(v, 0xff)) // `v`.
                mstore(0x40, r) // `r`.
                mstore(0x60, s) // `s`.
                let t :=
                    staticcall(
                        gas(), // Amount of gas left for the transaction.
                        1, // Address of `ecrecover`.
                        0x00, // Start of input.
                        0x80, // Size of input.
                        0x01, // Start of output.
                        0x20 // Size of output.
                    )
                // `returndatasize()` will be `0x20` upon success, and `0x00` otherwise.
                if iszero(or(iszero(returndatasize()), xor(signer, mload(t)))) {
                    isValid := 1
                    mstore(0x60, 0) // Restore the zero slot.
                    mstore(0x40, m) // Restore the free memory pointer.
                    break
                }

                let f := shl(224, 0x1626ba7e)
                mstore(m, f) // `bytes4(keccak256("isValidSignature(bytes32,bytes)"))`.
                mstore(add(m, 0x04), hash)
                let d := add(m, 0x24)
                mstore(d, 0x40) // The offset of the `signature` in the calldata.
                mstore(add(m, 0x44), 65) // Length of the signature.
                mstore(add(m, 0x64), r) // `r`.
                mstore(add(m, 0x84), s) // `s`.
                mstore8(add(m, 0xa4), v) // `v`.
                // forgefmt: disable-next-item
                isValid := and(
                    // Whether the returndata is the magic value `0x1626ba7e` (left-aligned).
                    eq(mload(d), f),
                    // Whether the staticcall does not revert.
                    // This must be placed at the end of the `and` clause,
                    // as the arguments are evaluated from right to left.
                    staticcall(
                        gas(), // Remaining gas.
                        signer, // The `signer` address.
                        m, // Offset of calldata in memory.
                        0xa5, // Length of calldata in memory.
                        d, // Offset of returndata.
                        0x20 // Length of returndata to write.
                    )
                )
                mstore(0x60, 0) // Restore the zero slot.
                mstore(0x40, m) // Restore the free memory pointer.
                break
            }
        }
    }

    /*´:°•.°+.*•´.*:°.°*.°•´.°:°•.°•.*•´.*:°.°*.°•´.°:°•.°+.*•´.*:*/
    /*                     ERC1271 OPERATIONS                     */
    /*.•°:°.´+°.*°.°:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•°°.*°.°:*.´+°.•*/

    // Note: These ERC1271 operations do NOT have an ECDSA fallback.
    // These functions are intended to be used with the regular `isValidSignatureNow` functions
    // or other signature verification functions (e.g. P256).

    /// @dev Returns whether `signature` is valid for `hash` for an ERC1271 `signer` contract.
    function isValidERC1271SignatureNow(address signer, bytes32 hash, bytes memory signature)
        internal
        view
        returns (bool isValid)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let m := mload(0x40)
            let f := shl(224, 0x1626ba7e)
            mstore(m, f) // `bytes4(keccak256("isValidSignature(bytes32,bytes)"))`.
            mstore(add(m, 0x04), hash)
            let d := add(m, 0x24)
            mstore(d, 0x40) // The offset of the `signature` in the calldata.
            // Copy the `signature` over.
            let n := add(0x20, mload(signature))
            pop(staticcall(gas(), 4, signature, n, add(m, 0x44), n))
            // forgefmt: disable-next-item
            isValid := and(
                // Whether the returndata is the magic value `0x1626ba7e` (left-aligned).
                eq(mload(d), f),
                // Whether the staticcall does not revert.
                // This must be placed at the end of the `and` clause,
                // as the arguments are evaluated from right to left.
                staticcall(
                    gas(), // Remaining gas.
                    signer, // The `signer` address.
                    m, // Offset of calldata in memory.
                    add(returndatasize(), 0x44), // Length of calldata in memory.
                    d, // Offset of returndata.
                    0x20 // Length of returndata to write.
                )
            )
        }
    }

    /// @dev Returns whether `signature` is valid for `hash` for an ERC1271 `signer` contract.
    function isValidERC1271SignatureNowCalldata(
        address signer,
        bytes32 hash,
        bytes calldata signature
    ) internal view returns (bool isValid) {
        /// @solidity memory-safe-assembly
        assembly {
            let m := mload(0x40)
            let f := shl(224, 0x1626ba7e)
            mstore(m, f) // `bytes4(keccak256("isValidSignature(bytes32,bytes)"))`.
            mstore(add(m, 0x04), hash)
            let d := add(m, 0x24)
            mstore(d, 0x40) // The offset of the `signature` in the calldata.
            mstore(add(m, 0x44), signature.length)
            // Copy the `signature` over.
            calldatacopy(add(m, 0x64), signature.offset, signature.length)
            // forgefmt: disable-next-item
            isValid := and(
                // Whether the returndata is the magic value `0x1626ba7e` (left-aligned).
                eq(mload(d), f),
                // Whether the staticcall does not revert.
                // This must be placed at the end of the `and` clause,
                // as the arguments are evaluated from right to left.
                staticcall(
                    gas(), // Remaining gas.
                    signer, // The `signer` address.
                    m, // Offset of calldata in memory.
                    add(signature.length, 0x64), // Length of calldata in memory.
                    d, // Offset of returndata.
                    0x20 // Length of returndata to write.
                )
            )
        }
    }

    /// @dev Returns whether the signature (`r`, `vs`) is valid for `hash`
    /// for an ERC1271 `signer` contract.
    function isValidERC1271SignatureNow(address signer, bytes32 hash, bytes32 r, bytes32 vs)
        internal
        view
        returns (bool isValid)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let m := mload(0x40)
            let f := shl(224, 0x1626ba7e)
            mstore(m, f) // `bytes4(keccak256("isValidSignature(bytes32,bytes)"))`.
            mstore(add(m, 0x04), hash)
            let d := add(m, 0x24)
            mstore(d, 0x40) // The offset of the `signature` in the calldata.
            mstore(add(m, 0x44), 65) // Length of the signature.
            mstore(add(m, 0x64), r) // `r`.
            mstore(add(m, 0x84), shr(1, shl(1, vs))) // `s`.
            mstore8(add(m, 0xa4), add(shr(255, vs), 27)) // `v`.
            // forgefmt: disable-next-item
            isValid := and(
                // Whether the returndata is the magic value `0x1626ba7e` (left-aligned).
                eq(mload(d), f),
                // Whether the staticcall does not revert.
                // This must be placed at the end of the `and` clause,
                // as the arguments are evaluated from right to left.
                staticcall(
                    gas(), // Remaining gas.
                    signer, // The `signer` address.
                    m, // Offset of calldata in memory.
                    0xa5, // Length of calldata in memory.
                    d, // Offset of returndata.
                    0x20 // Length of returndata to write.
                )
            )
        }
    }

    /// @dev Returns whether the signature (`v`, `r`, `s`) is valid for `hash`
    /// for an ERC1271 `signer` contract.
    function isValidERC1271SignatureNow(address signer, bytes32 hash, uint8 v, bytes32 r, bytes32 s)
        internal
        view
        returns (bool isValid)
    {
        /// @solidity memory-safe-assembly
        assembly {
            let m := mload(0x40)
            let f := shl(224, 0x1626ba7e)
            mstore(m, f) // `bytes4(keccak256("isValidSignature(bytes32,bytes)"))`.
            mstore(add(m, 0x04), hash)
            let d := add(m, 0x24)
            mstore(d, 0x40) // The offset of the `signature` in the calldata.
            mstore(add(m, 0x44), 65) // Length of the signature.
            mstore(add(m, 0x64), r) // `r`.
            mstore(add(m, 0x84), s) // `s`.
            mstore8(add(m, 0xa4), v) // `v`.
            // forgefmt: disable-next-item
            isValid := and(
                // Whether the returndata is the magic value `0x1626ba7e` (left-aligned).
                eq(mload(d), f),
                // Whether the staticcall does not revert.
                // This must be placed at the end of the `and` clause,
                // as the arguments are evaluated from right to left.
                staticcall(
                    gas(), // Remaining gas.
                    signer, // The `signer` address.
                    m, // Offset of calldata in memory.
                    0xa5, // Length of calldata in memory.
                    d, // Offset of returndata.
                    0x20 // Length of returndata to write.
                )
            )
        }
    }

    /*´:°•.°+.*•´.*:°.°*.°•´.°:°•.°•.*•´.*:°.°*.°•´.°:°•.°+.*•´.*:*/
    /*                     ERC6492 OPERATIONS                     */
    /*.•°:°.´+°.*°.°:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•°°.*°.°:*.´+°.•*/

    // Note: These ERC6492 operations do NOT have an ECDSA fallback.
    // These functions are intended to be used with the regular `isValidSignatureNow` functions
    // or other signature verification functions (e.g. P256).
    // The calldata variants are excluded for brevity.

    /// @dev Returns whether `signature` is valid for `hash`.
    /// If the signature is postfixed with the ERC6492 magic number, it will attempt to
    /// deploy / prepare the `signer` smart account before doing a regular ERC1271 check.
    /// Note: This function is NOT reentrancy safe.
    function isValidERC6492SignatureNowAllowSideEffects(
        address signer,
        bytes32 hash,
        bytes memory signature
    ) internal returns (bool isValid) {
        /// @solidity memory-safe-assembly
        assembly {
            function callIsValidSignature(signer_, hash_, signature_) -> _isValid {
                let m_ := mload(0x40)
                let f_ := shl(224, 0x1626ba7e)
                mstore(m_, f_) // `bytes4(keccak256("isValidSignature(bytes32,bytes)"))`.
                mstore(add(m_, 0x04), hash_)
                let d_ := add(m_, 0x24)
                mstore(d_, 0x40) // The offset of the `signature` in the calldata.
                let n_ := add(0x20, mload(signature_))
                pop(staticcall(gas(), 4, signature_, n_, add(m_, 0x44), n_))
                _isValid :=
                    and(
                        eq(mload(d_), f_),
                        staticcall(gas(), signer_, m_, add(returndatasize(), 0x44), d_, 0x20)
                    )
            }
            for { let n := mload(signature) } 1 {} {
                if iszero(eq(mload(add(signature, n)), mul(0x6492, div(not(isValid), 0xffff)))) {
                    isValid := callIsValidSignature(signer, hash, signature)
                    break
                }
                let o := add(signature, 0x20) // Signature bytes.
                let d := add(o, mload(add(o, 0x20))) // Factory calldata.
                if iszero(extcodesize(signer)) {
                    if iszero(call(gas(), mload(o), 0, add(d, 0x20), mload(d), codesize(), 0x00)) {
                        break
                    }
                }
                let s := add(o, mload(add(o, 0x40))) // Inner signature.
                isValid := callIsValidSignature(signer, hash, s)
                if iszero(isValid) {
                    if call(gas(), mload(o), 0, add(d, 0x20), mload(d), codesize(), 0x00) {
                        isValid := callIsValidSignature(signer, hash, s)
                    }
                }
                break
            }
        }
    }

    /// @dev Returns whether `signature` is valid for `hash`.
    /// If the signature is postfixed with the ERC6492 magic number, it will attempt
    /// to use a reverting verifier to deploy / prepare the `signer` smart account
    /// and do a `isValidSignature` check via the reverting verifier.
    /// Note: This function is reentrancy safe.
    /// The reverting verifier must be deployed.
    /// Otherwise, the function will return false if `signer` is not yet deployed / prepared.
    /// See: https://gist.github.com/Vectorized/846a474c855eee9e441506676800a9ad
    function isValidERC6492SignatureNow(address signer, bytes32 hash, bytes memory signature)
        internal
        returns (bool isValid)
    {
        /// @solidity memory-safe-assembly
        assembly {
            function callIsValidSignature(signer_, hash_, signature_) -> _isValid {
                let m_ := mload(0x40)
                let f_ := shl(224, 0x1626ba7e)
                mstore(m_, f_) // `bytes4(keccak256("isValidSignature(bytes32,bytes)"))`.
                mstore(add(m_, 0x04), hash_)
                let d_ := add(m_, 0x24)
                mstore(d_, 0x40) // The offset of the `signature` in the calldata.
                let n_ := add(0x20, mload(signature_))
                pop(staticcall(gas(), 4, signature_, n_, add(m_, 0x44), n_))
                _isValid :=
                    and(
                        eq(mload(d_), f_),
                        staticcall(gas(), signer_, m_, add(returndatasize(), 0x44), d_, 0x20)
                    )
            }
            for { let n := mload(signature) } 1 {} {
                if iszero(eq(mload(add(signature, n)), mul(0x6492, div(not(isValid), 0xffff)))) {
                    isValid := callIsValidSignature(signer, hash, signature)
                    break
                }
                if extcodesize(signer) {
                    let o := add(signature, 0x20) // Signature bytes.
                    isValid := callIsValidSignature(signer, hash, add(o, mload(add(o, 0x40))))
                    if isValid { break }
                }
                let m := mload(0x40)
                mstore(m, signer)
                mstore(add(m, 0x20), hash)
                let willBeZeroIfRevertingVerifierExists :=
                    call(
                        gas(), // Remaining gas.
                        0x00007bd799e4A591FeA53f8A8a3E9f931626Ba7e, // Reverting verifier.
                        0, // Send zero ETH.
                        m, // Start of memory.
                        add(returndatasize(), 0x40), // Length of calldata in memory.
                        staticcall(gas(), 4, add(signature, 0x20), n, add(m, 0x40), n), // 1.
                        0x00 // Length of returndata to write.
                    )
                isValid := gt(returndatasize(), willBeZeroIfRevertingVerifierExists)
                break
            }
        }
    }

    /*´:°•.°+.*•´.*:°.°*.°•´.°:°•.°•.*•´.*:°.°*.°•´.°:°•.°+.*•´.*:*/
    /*                     HASHING OPERATIONS                     */
    /*.•°:°.´+°.*°.°:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•°°.*°.°:*.´+°.•*/

    /// @dev Returns an Ethereum Signed Message, created from a `hash`.
    /// This produces a hash corresponding to the one signed with the
    /// [`eth_sign`](https://eth.wiki/json-rpc/API#eth_sign)
    /// JSON-RPC method as part of EIP-191.
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 result) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x20, hash) // Store into scratch space for keccak256.
            mstore(0x00, "\x00\x00\x00\x00\x19Ethereum Signed Message:\n32") // 28 bytes.
            result := keccak256(0x04, 0x3c) // `32 * 2 - (32 - 28) = 60 = 0x3c`.
        }
    }

    /// @dev Returns an Ethereum Signed Message, created from `s`.
    /// This produces a hash corresponding to the one signed with the
    /// [`eth_sign`](https://eth.wiki/json-rpc/API#eth_sign)
    /// JSON-RPC method as part of EIP-191.
    /// Note: Supports lengths of `s` up to 999999 bytes.
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32 result) {
        /// @solidity memory-safe-assembly
        assembly {
            let sLength := mload(s)
            let o := 0x20
            mstore(o, "\x19Ethereum Signed Message:\n") // 26 bytes, zero-right-padded.
            mstore(0x00, 0x00)
            // Convert the `s.length` to ASCII decimal representation: `base10(s.length)`.
            for { let temp := sLength } 1 {} {
                o := sub(o, 1)
                mstore8(o, add(48, mod(temp, 10)))
                temp := div(temp, 10)
                if iszero(temp) { break }
            }
            let n := sub(0x3a, o) // Header length: `26 + 32 - o`.
            // Throw an out-of-offset error (consumes all gas) if the header exceeds 32 bytes.
            returndatacopy(returndatasize(), returndatasize(), gt(n, 0x20))
            mstore(s, or(mload(0x00), mload(n))) // Temporarily store the header.
            result := keccak256(add(s, sub(0x20, n)), add(n, sLength))
            mstore(s, sLength) // Restore the length.
        }
    }

    /*´:°•.°+.*•´.*:°.°*.°•´.°:°•.°•.*•´.*:°.°*.°•´.°:°•.°+.*•´.*:*/
    /*                   EMPTY CALLDATA HELPERS                   */
    /*.•°:°.´+°.*°.°:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•°°.*°.°:*.´+°.•*/

    /// @dev Returns an empty calldata bytes.
    function emptySignature() internal pure returns (bytes calldata signature) {
        /// @solidity memory-safe-assembly
        assembly {
            signature.length := 0
        }
    }
}

File 12 of 14 : TrustlessPermit.sol
pragma solidity ^0.8.17;

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

library TrustlessPermit {
    function trustlessPermit(
        address token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        // Try permit() before allowance check to advance nonce if possible
        try IERC20Permit(token).permit(owner, spender, value, deadline, v, r, s) {
            return;
        } catch {
            // Permit potentially got frontran. Continue anyways if allowance is sufficient.
            if (IERC20(token).allowance(owner, spender) >= value) {
                return;
            }
        }
        revert("Permit failure");
    }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;

import {Call3Value, Result} from "../utils/RelayStructs.sol";

interface IRelayRouter {
    function multicall(
        Call3Value[] calldata calls,
        address refundTo,
        address nftRecipient
    ) external payable returns (Result[] memory returnData);

    function cleanupErc20s(
        address[] calldata tokens,
        address[] calldata recipients,
        uint256[] calldata amounts
    ) external;

    function cleanupNative(uint256 amount, address recipient) external;
}

File 14 of 14 : RelayStructs.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;

struct Call3Value {
    address target;
    bool allowFailure;
    uint256 value;
    bytes callData;
}

struct Permit {
    address token;
    address owner;
    uint256 value;
    uint256 nonce;
    uint256 deadline;
    uint8 v;
    bytes32 r;
    bytes32 s;
}

struct Result {
    bool success;
    bytes returnData;
}

struct RelayerWitness {
    address relayer;
    Call3Value[] call3Values;
}

Settings
{
  "evmVersion": "cancun",
  "libraries": {},
  "metadata": {
    "appendCBOR": true,
    "bytecodeHash": "ipfs",
    "useLiteralContent": false
  },
  "optimizer": {
    "enabled": false,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "remappings": [
    "@openzeppelin/=lib/openzeppelin-contracts/",
    "@openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
    "solady/=lib/solady/",
    "multicaller/=lib/Multicaller/",
    "v2-core/=lib/v2-core/",
    "v2-periphery/=lib/v2-periphery/",
    "tstorish/=lib/tstorish/",
    "permit2-relay/=lib/permit2-relay/",
    "solmate/=lib/solmate/",
    "@matterlabs/zksync-contracts/=/lib/v2-testnet-contracts/",
    "@uniswap/v3-core/=lib/v3-core/",
    "@uniswap/v2-core/=lib/v2-core/",
    "0x-settler/=lib/0x-settler/",
    "seaport-1.5/=lib/seaport-1.5/",
    "trustlessPermit/=lib/trustlessPermit/",
    "@rari-capital/solmate/=lib/seaport-1.5/lib/solmate/",
    "Multicaller/=lib/Multicaller/src/",
    "ds-test/=lib/seaport-1.5/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "forge-gas-snapshot/=lib/0x-settler/lib/forge-gas-snapshot/src/",
    "forge-std/=lib/forge-std/src/",
    "halmos-cheatcodes/=lib/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/",
    "murky/=lib/seaport-1.5/lib/murky/src/",
    "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "permit2/=lib/0x-settler/lib/permit2/",
    "seaport-core/=lib/seaport-core/src/",
    "seaport-sol/=lib/seaport-sol/src/",
    "seaport-types/=lib/seaport-1.5/lib/seaport-types/",
    "seaport/=lib/seaport-1.5/contracts/",
    "solarray/=lib/seaport-1.5/lib/solarray/src/",
    "v3-core/=lib/v3-core/"
  ],
  "viaIR": true
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_router","type":"address"},{"internalType":"address","name":"_permit2","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"AlreadyInitialized","type":"error"},{"inputs":[],"name":"ArrayLengthsMismatch","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"NativeTransferFailed","type":"error"},{"inputs":[],"name":"NewOwnerIsZeroAddress","type":"error"},{"inputs":[],"name":"NoHandoverRequest","type":"error"},{"inputs":[],"name":"RefundToCannotBeZeroAddress","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipHandoverCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipHandoverRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newPermit2","type":"address"}],"name":"Permit2Updated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newRouter","type":"address"}],"name":"RouterUpdated","type":"event"},{"inputs":[],"name":"_CALL3VALUE_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_EIP_712_RELAYER_WITNESS_TYPE_HASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_RELAYER_WITNESS_TYPE_STRING","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cancelOwnershipHandover","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"pendingOwner","type":"address"}],"name":"completeOwnershipHandover","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"result","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pendingOwner","type":"address"}],"name":"ownershipHandoverExpiresAt","outputs":[{"internalType":"uint256","name":"result","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"components":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct ISignatureTransfer.TokenPermissions[]","name":"permitted","type":"tuple[]"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"internalType":"struct ISignatureTransfer.PermitBatchTransferFrom","name":"permit","type":"tuple"},{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bool","name":"allowFailure","type":"bool"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"callData","type":"bytes"}],"internalType":"struct Call3Value[]","name":"calls","type":"tuple[]"},{"internalType":"address","name":"refundTo","type":"address"},{"internalType":"address","name":"nftRecipient","type":"address"},{"internalType":"bytes","name":"permitSignature","type":"bytes"}],"name":"permit2TransferAndMulticall","outputs":[{"components":[{"internalType":"bool","name":"success","type":"bool"},{"internalType":"bytes","name":"returnData","type":"bytes"}],"internalType":"struct Result[]","name":"returnData","type":"tuple[]"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct Permit[]","name":"permits","type":"tuple[]"},{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bool","name":"allowFailure","type":"bool"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"callData","type":"bytes"}],"internalType":"struct Call3Value[]","name":"calls","type":"tuple[]"},{"internalType":"address","name":"refundTo","type":"address"},{"internalType":"address","name":"nftRecipient","type":"address"}],"name":"permitTransferAndMulticall","outputs":[{"components":[{"internalType":"bool","name":"success","type":"bool"},{"internalType":"bytes","name":"returnData","type":"bytes"}],"internalType":"struct Result[]","name":"returnData","type":"tuple[]"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"requestOwnershipHandover","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"router","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_permit2","type":"address"}],"name":"setPermit2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_router","type":"address"}],"name":"setRouter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bool","name":"allowFailure","type":"bool"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"callData","type":"bytes"}],"internalType":"struct Call3Value[]","name":"calls","type":"tuple[]"},{"internalType":"address","name":"refundTo","type":"address"},{"internalType":"address","name":"nftRecipient","type":"address"}],"name":"transferAndMulticall","outputs":[{"components":[{"internalType":"bool","name":"success","type":"bool"},{"internalType":"bytes","name":"returnData","type":"bytes"}],"internalType":"struct Result[]","name":"returnData","type":"tuple[]"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

6080604052346100305761001a610014610111565b916101f5565b610022610035565b612d846102c58239612d8490f35b61003b565b60405190565b5f80fd5b601f801991011690565b634e487b7160e01b5f52604160045260245ffd5b906100679061003f565b810190811060018060401b0382111761007f57604052565b610049565b90610097610090610035565b928361005d565b565b5f80fd5b60018060a01b031690565b6100b19061009d565b90565b6100bd816100a8565b036100c457565b5f80fd5b905051906100d5826100b4565b565b909160608284031261010c576101096100f2845f85016100c8565b9361010081602086016100c8565b936040016100c8565b90565b610099565b61012f6130498038038061012481610084565b9283398101906100d7565b909192565b5f1b90565b9061014a60018060a01b0391610134565b9181191691161790565b90565b61016b6101666101709261009d565b610154565b61009d565b90565b61017c90610157565b90565b61018890610173565b90565b90565b906101a361019e6101aa9261017f565b61018b565b8254610139565b9055565b6101b790610157565b90565b6101c3906101ae565b90565b6101cf906101ae565b90565b90565b906101ea6101e56101f1926101c6565b6101d2565b8254610139565b9055565b9161020f6102149261020961021b9561021d565b5f61018e565b6101ba565b60016101d5565b565b6102256102b9565b5f1461027d57638b78c6d8199081546102705760601b60601c90811560ff1b821790555f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a35b565b630dc149f05f526004601cfd5b60601b60601c80638b78c6d819555f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a361026e565b5f90565b6102c16102b5565b9056fe60806040526004361015610015575b36610e5357005b61001f5f3561012e565b8063101ec30a146101295780632569296214610124578063308750561461011f578063337390821461011a5780633806a3cf146101155780633ccfd60b1461011057806354d1f13d1461010b578063715018a6146101065780638da5cb5b14610101578063a0a6ce7f146100fc578063c0d78655146100f7578063c99a0d65146100f2578063cf641c61146100ed578063f04e283e146100e8578063f2fde38b146100e3578063f887ea40146100de5763fee81cf40361000e57610e1e565b610dc7565b610d5b565b610d32565b610cfd565b610c99565b610c12565b610be0565b610aee565b610aa3565b610a7a565b610a47565b610a12565b6107e5565b6104b5565b6101e5565b6101a3565b60e01c90565b60405190565b5f80fd5b5f80fd5b5f80fd5b60018060a01b031690565b61015a90610146565b90565b61016681610151565b0361016d57565b5f80fd5b9050359061017e8261015d565b565b9060208282031261019957610196915f01610171565b90565b61013e565b5f0190565b346101d1576101bb6101b6366004610180565b610f3e565b6101c3610134565b806101cd8161019e565b0390f35b61013a565b5f9103126101e057565b61013e565b6101f03660046101d6565b6101f8610f80565b610200610134565b8061020a8161019e565b0390f35b5f80fd5b5f80fd5b5f80fd5b909182601f830112156102545781359167ffffffffffffffff831161024f57602001926020830284011161024a57565b610216565b610212565b61020e565b909182601f830112156102935781359167ffffffffffffffff831161028e57602001926020830284011161028957565b610216565b610212565b61020e565b909182601f830112156102d25781359167ffffffffffffffff83116102cd5760200192602083028401116102c857565b610216565b610212565b61020e565b91909160a081840312610378575f81013567ffffffffffffffff8111610373578361030391830161021a565b929093602083013567ffffffffffffffff811161036e5781610326918501610259565b92909360408101359167ffffffffffffffff83116103695761034d84610366948401610298565b93909461035d8160608601610171565b93608001610171565b90565b610142565b610142565b610142565b61013e565b5190565b60209181520190565b60200190565b151590565b61039e90610390565b9052565b5190565b60209181520190565b90825f9392825e0152565b601f801991011690565b6103e36103ec6020936103f1936103da816103a2565b938480936103a6565b958691016103af565b6103ba565b0190565b61042091602060408201926104105f8201515f850190610395565b01519060208184039101526103c4565b90565b9061042d916103f5565b90565b60200190565b9061044a6104438361037d565b8092610381565b908161045b6020830284019461038a565b925f915b83831061046e57505050505090565b9091929394602061049061048a83856001950387528951610423565b97610430565b930193019193929061045f565b6104b29160208201915f818403910152610436565b90565b6104e66104d56104c63660046102d7565b969590959491949392936114ed565b6104dd610134565b9182918261049d565b0390f35b5f80fd5b634e487b7160e01b5f52604160045260245ffd5b9061050c906103ba565b810190811067ffffffffffffffff82111761052657604052565b6104ee565b9061053e610537610134565b9283610502565b565b5f80fd5b67ffffffffffffffff811161055c5760208091020190565b6104ee565b90565b61056d81610561565b0361057457565b5f80fd5b9050359061058582610564565b565b91906040838203126105c1576105ba906105a1604061052b565b936105ae825f8301610171565b5f860152602001610578565b6020830152565b6104ea565b909291926105db6105d682610544565b61052b565b93818552604060208601920283019281841161061a57915b8383106106005750505050565b602060409161060f8486610587565b8152019201916105f3565b610216565b9080601f8301121561063d5781602061063a933591016105c6565b90565b61020e565b9190916060818403126106a757610659606061052b565b925f8201359167ffffffffffffffff83116106a25761067d8261069b94830161061f565b5f86015261068e8260208301610578565b6020860152604001610578565b6040830152565b610540565b6104ea565b5f80fd5b67ffffffffffffffff81116106ce576106ca6020916103ba565b0190565b6104ee565b90825f939282370152565b909291926106f36106ee826106b0565b61052b565b9381855260208501908284011161070f5761070d926106d3565b565b6106ac565b9080601f830112156107325781602061072f933591016106de565b90565b61020e565b909160c0828403126107e05761074f835f8401610171565b92602083013567ffffffffffffffff81116107db5781610770918501610642565b92604081013567ffffffffffffffff81116107d65782610791918301610298565b9290936107a18260608501610171565b926107af8360808301610171565b9260a082013567ffffffffffffffff81116107d1576107ce9201610714565b90565b610142565b610142565b610142565b61013e565b6108136108026107f6366004610737565b9594909493919361169a565b61080a610134565b9182918261049d565b0390f35b67ffffffffffffffff8111610835576108316020916103ba565b0190565b6104ee565b9061084c61084783610817565b61052b565b918252565b60e07f7432353620616d6f756e74290000000000000000000000000000000000000000917f52656c617965725769746e657373207769746e6573732943616c6c3356616c755f8201527f652861646472657373207461726765742c626f6f6c20616c6c6f774661696c7560208201527f72652c75696e743235362076616c75652c62797465732063616c6c446174612960408201527f52656c617965725769746e65737328616464726573732072656c617965722c6160608201527f64647265737320726566756e64546f2c61646472657373206e6674526563697060808201527f69656e742c43616c6c3356616c75655b5d2063616c6c3356616c75657329546f60a08201527f6b656e5065726d697373696f6e73286164647265737320746f6b656e2c75696e60c08201520152565b61098c60ec61083a565b9061099960208301610851565b565b6109a3610982565b90565b6109ae61099b565b90565b6109b96109a6565b90565b5190565b60209181520190565b6109e86109f16020936109f6936109df816109bc565b938480936109c0565b958691016103af565b6103ba565b0190565b610a0f9160208201915f8184039101526109c9565b90565b34610a4257610a223660046101d6565b610a3e610a2d6109b1565b610a35610134565b918291826109fa565b0390f35b61013a565b34610a7557610a573660046101d6565b610a5f6117e3565b610a67610134565b80610a718161019e565b0390f35b61013a565b610a853660046101d6565b610a8d6117ed565b610a95610134565b80610a9f8161019e565b0390f35b610aae3660046101d6565b610ab661184b565b610abe610134565b80610ac88161019e565b0390f35b610ad590610151565b9052565b9190610aec905f60208501940190610acc565b565b34610b1e57610afe3660046101d6565b610b1a610b09611859565b610b11610134565b91829182610ad9565b0390f35b61013a565b909182601f83011215610b5e5781359167ffffffffffffffff8311610b5957602001926101008302840111610b5457565b610216565b610212565b61020e565b9190608083820312610bdb575f83013567ffffffffffffffff8111610bd65781610b8e918501610b23565b92909360208101359167ffffffffffffffff8311610bd157610bb584610bce948401610298565b939094610bc58160408601610171565b93606001610171565b90565b610142565b610142565b61013e565b610c0e610bfd610bf1366004610b63565b949390939291926119c1565b610c05610134565b9182918261049d565b0390f35b34610c4057610c2a610c25366004610180565b611c59565b610c32610134565b80610c3c8161019e565b0390f35b61013a565b7fe23dc67d94bc5ccc95cdaa7f8c7e41f4c3b78d9d1e7baad8604a2773456e2b3c90565b610c71610c45565b90565b90565b610c8090610c74565b9052565b9190610c97905f60208501940190610c77565b565b34610cc957610ca93660046101d6565b610cc5610cb4610c69565b610cbc610134565b91829182610c84565b0390f35b61013a565b7ffd3926a097b5d365885a8c0afe16fa80ed4d377e8627017476dfe9729e8a6cde90565b610cfa610cce565b90565b34610d2d57610d0d3660046101d6565b610d29610d18610cf2565b610d20610134565b91829182610c84565b0390f35b61013a565b610d45610d40366004610180565b611caa565b610d4d610134565b80610d578161019e565b0390f35b610d6e610d69366004610180565b611ce9565b610d76610134565b80610d808161019e565b0390f35b1c90565b60018060a01b031690565b610da3906008610da89302610d84565b610d88565b90565b90610db69154610d93565b90565b610dc45f5f90610dab565b90565b34610df757610dd73660046101d6565b610df3610de2610db9565b610dea610134565b91829182610ad9565b0390f35b61013a565b610e0590610561565b9052565b9190610e1c905f60208501940190610dfc565b565b34610e4e57610e4a610e39610e34366004610180565b611cf8565b610e41610134565b91829182610e09565b0390f35b61013a565b5f80fd5b610e6890610e63611d14565b610ef0565b565b90565b610e81610e7c610e8692610146565b610e6a565b610146565b90565b610e9290610e6d565b90565b610e9e90610e89565b90565b5f1b90565b90610eb760018060a01b0391610ea1565b9181191691161790565b610eca90610e89565b90565b90565b90610ee5610ee0610eec92610ec1565b610ecd565b8254610ea6565b9055565b610f03610efc82610e95565b6001610ed0565b610f397faecfd826d6b270962e6ff81f57b75e8527073ef343cbb38af801b8a972c7846191610f30610134565b91829182610ad9565b0390a1565b610f4790610e57565b565b67ffffffffffffffff1690565b610f6a610f65610f6f92610f49565b610e6a565b610561565b90565b90610f7d9101610561565b90565b610f9a42610f94610f8f611d53565b610f56565b90610f72565b63389a75e1600c52335f526020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a2565b606090565b5090565b5090565b90565b610ff6610ff1610ffb92610fdf565b610e6a565b610146565b90565b61100790610fe2565b90565b61101e61101961102392610fdf565b610e6a565b610561565b90565b60016110329101610561565b90565b634e487b7160e01b5f52603260045260245ffd5b9190811015611059576020020190565b611035565b356110688161015d565b90565b61107490610e6d565b90565b6110809061106b565b90565b5f1c90565b61109461109991611083565b610d88565b90565b6110a69054611088565b90565b91908110156110b9576020020190565b611035565b356110c881610564565b90565b6110d490610e6d565b90565b6110e0906110cb565b90565b6110ec90610e6d565b90565b6110f8906110e3565b90565b5f80fd5b60e01b90565b67ffffffffffffffff811161111d5760208091020190565b6104ee565b61112b81610390565b0361113257565b5f80fd5b9050519061114382611122565b565b9092919261115a611155826106b0565b61052b565b9381855260208501908284011161117657611174926103af565b565b6106ac565b9080601f830112156111995781602061119693519101611145565b90565b61020e565b9190916040818403126111f0576111b5604061052b565b926111c2815f8401611136565b5f850152602082015167ffffffffffffffff81116111eb576111e4920161117b565b6020830152565b610540565b6104ea565b92919061120961120482611105565b61052b565b93818552602080860192028101918383116112605781905b83821061122f575050505050565b815167ffffffffffffffff811161125b57602091611250878493870161119e565b815201910190611221565b61020e565b610216565b9080601f8301121561128357816020611280935191016111f5565b90565b61020e565b906020828203126112b8575f82015167ffffffffffffffff81116112b3576112b09201611265565b90565b610142565b61013e565b60209181520190565b90565b506112d8906020810190610171565b90565b6112e490610151565b9052565b905035906112f582611122565b565b506113069060208101906112e8565b90565b50611318906020810190610578565b90565b61132490610561565b9052565b5f80fd5b5f80fd5b5f80fd5b903560016020038236030381121561137557016020813591019167ffffffffffffffff821161137057600182023603831361136b57565b61132c565b611328565b611330565b91906113948161138d81611399956103a6565b80956106d3565b6103ba565b0190565b61140d916113ff60808201926113c16113b85f8301836112c9565b5f8501906112db565b6113db6113d160208301836112f7565b6020850190610395565b6113f56113eb6040830183611309565b604085019061131b565b6060810190611334565b91606081850391015261137a565b90565b9061141a9161139d565b90565b9035600160800382360303811215611433570190565b611330565b60200190565b9181611449916112bd565b908161145a602083028401946112c6565b92835f925b84841061146f5750505050505090565b909192939495602061149a611494838560019503885261148f8b8861141d565b611410565b98611438565b94019401929493919061145f565b6114d46114c96040936114db9698979560608501918583035f87015261143e565b966020830190610acc565b0190610acc565b565b6114e5610134565b3d5f823e3d90fd5b9396979297959195949094611500610fd2565b5061150c858790610fd7565b61152861152261151d8a8d90610fdb565b610561565b91610561565b0361167e578261154861154261153d5f610ffe565b610151565b91610151565b14611662576115565f61100a565b5b8061157461156e611569898b90610fd7565b610561565b91610561565b10156115ce576115c9906115c461159d6115986115938a8c8691611049565b61105e565b611077565b8a8d6115be6115b933926115b05f61109c565b949088916110a9565b6110be565b92611dda565b611026565b611557565b50935093509461161a9196505f94506115f66115f16115ec8761109c565b6110d7565b6110ef565b6116256330be5567943492959293969861160e610134565b998a98899788966110ff565b8652600486016114a8565b03925af190811561165d575f9161163b575b5090565b61165791503d805f833e61164f8183610502565b810190611288565b5f611637565b6114dd565b5f63fc62e08f60e01b81528061167a6004820161019e565b0390fd5b5f631dc0052360e11b8152806116966004820161019e565b0390fd5b959190949293956116a9610fd2565b50866116c56116bf6116ba5f610ffe565b610151565b91610151565b14611793575f95836116d9611731956103a2565b6116eb6116e58a61100a565b91610561565b03611779575b50505061170d6117086117038761109c565b6110d7565b6110ef565b61173c6330be55679434929592939698611725610134565b998a98899788966110ff565b8652600486016114a8565b03925af1908115611774575f91611752575b5090565b61176e91503d805f833e6117668183610502565b810190611288565b5f61174e565b6114dd565b61178b929189908786928a9495612436565b5f80806116f1565b5f63fc62e08f60e01b8152806117ab6004820161019e565b0390fd5b6117b7611d14565b6117bf6117cd565b565b6117ca906110e3565b90565b6117e1336117da306117c1565b3190612750565b565b6117eb6117af565b565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b61182e611d14565b611836611838565b565b6118496118445f610ffe565b61278f565b565b611853611826565b565b5f90565b611861611855565b50638b78c6d8195490565b5090565b919081101561188157610100020190565b611035565b60ff1690565b61189581611886565b0361189c57565b5f80fd5b905035906118ad8261188c565b565b6118b881610c74565b036118bf57565b5f80fd5b905035906118d0826118af565b565b91906101008382031261197a57611973906118ee61010061052b565b936118fb825f8301610171565b5f86015261190c8260208301610171565b602086015261191e8260408301610578565b60408601526119308260608301610578565b60608601526119428260808301610578565b60808601526119548260a083016118a0565b60a08601526119668260c083016118c3565b60c086015260e0016118c3565b60e0830152565b6104ea565b61198a9036906118d2565b90565b6119979051610151565b90565b6119a49051610561565b90565b6119b19051611886565b90565b6119be9051610c74565b90565b9391959290946119cf610fd2565b50826119eb6119e56119e05f610ffe565b610151565b91610151565b14611bb6576119f95f61100a565b5b80611a17611a11611a0c898b9061186c565b610561565b91610561565b1015611b2457611a31611a2c87898491611870565b61197f565b90611a3e6020830161198d565b611a50611a4a33610151565b91610151565b03611b0957611aff82611ac4611a6a5f611b04960161198d565b611a766020840161198d565b611a7f306117c1565b611a8b6040860161199a565b611a976080870161199a565b90611aa460a088016119a7565b92611ab160c089016119b4565b94611abe60e08a016119b4565b96612959565b611ad7611ad25f830161198d565b611077565b90611ae46020820161198d565b611af96040611af25f61109c565b930161199a565b92611dda565b611026565b6119fa565b5f6282b42960e81b815280611b206004820161019e565b0390fd5b5091945091945f9350611b6e90611b4a611b45611b408761109c565b6110d7565b6110ef565b611b796330be55679434929592939698611b62610134565b998a98899788966110ff565b8652600486016114a8565b03925af1908115611bb1575f91611b8f575b5090565b611bab91503d805f833e611ba38183610502565b810190611288565b5f611b8b565b6114dd565b5f63fc62e08f60e01b815280611bce6004820161019e565b0390fd5b611be390611bde611d14565b611c14565b565b611bee906110e3565b90565b90565b90611c09611c04611c1092611be5565b611bf1565b8254610ea6565b9055565b611c1e815f611bf4565b611c547f7aed1d3e8155a07ccf395e44ea3109a0e2d6c9b29bbbe9f142d9790596f4dc8091611c4b610134565b91829182610ad9565b0390a1565b611c6290611bd2565b565b611c7590611c70611d14565b611c77565b565b63389a75e1600c52805f526020600c209081544211611c9d575f611c9b925561278f565b565b636f5e88185f526004601cfd5b611cb390611c64565b565b611cc690611cc1611d14565b611cc8565b565b8060601b15611cdc57611cda9061278f565b565b637448fbae5f526004601cfd5b611cf290611cb5565b565b5f90565b611d00611cf4565b5063389a75e1600c525f526020600c205490565b638b78c6d819543303611d2357565b6382b429005f526004601cfd5b5f90565b90565b611d4b611d46611d5092611d34565b610e6a565b610f49565b90565b611d5b611d30565b50611d686202a300611d37565b90565b611d74906110e3565b90565b63ffffffff1690565b63ffffffff60e01b1690565b611da0611d9b611da592611d77565b6110ff565b611d80565b90565b604090611dd1611dd89496959396611dc760608401985f850190610acc565b6020830190610acc565b0190610dfc565b565b600492611e14611e289593611e239394611dfb6323b872dd92949192611d8c565b93611e04610134565b9788956020870190815201611da8565b60208201810382520383610502565b612afc565b565b5090565b67ffffffffffffffff8111611e465760208091020190565b6104ee565b90611e5d611e5883611e2e565b61052b565b918252565b369037565b90611e8c611e7483611e4b565b92602080611e828693611e2e565b9201910390611e62565b565b5f80fd5b5f80fd5b5f80fd5b903590600160800381360303821215611eb1570190565b611e8e565b90821015611ed0576020611ecd9202810190611e9a565b90565b611035565b35611edf81611122565b90565b903590600160200381360303821215611f24570180359067ffffffffffffffff8211611f1f57602001916001820236038313611f1a57565b611e96565b611e92565b611e8e565b611f349136916106de565b90565b60200190565b611f4690610390565b9052565b90959492611f9594611f84611f8e92611f7a608096611f7060a088019c5f890190610c77565b6020870190610acc565b6040850190611f3d565b6060830190610dfc565b0190610c77565b565b5190565b90611fa582611f97565b811015611fb6576020809102010190565b611035565b90611fc590610c74565b9052565b905090565b60200190565b611fdd90610c74565b9052565b90611fee81602093611fd4565b0190565b60200190565b9061201561200f61200884611f97565b8093611fc9565b92611fce565b905f5b8181106120255750505090565b90919261203e6120386001928651611fe1565b94611ff2565b9101919091612018565b61205191611ff8565b90565b9095949261209f9461208e6120989261208460809661207a60a088019c5f890190610c77565b6020870190610acc565b6040850190610acc565b6060830190610acc565b0190610c77565b565b5190565b67ffffffffffffffff81116120bd5760208091020190565b6104ee565b906120d46120cf836120a5565b61052b565b918252565b6120e3604061052b565b90565b5f90565b5f90565b6120f66120d9565b90602080836121036120e6565b81520161210e6120ea565b81525050565b61211c6120ee565b90565b5f5b82811061212d57505050565b602090612138612114565b8184015201612121565b9061216761214f836120c2565b9260208061215d86936120a5565b920191039061211f565b565b90612173826120a1565b811015612184576020809102010190565b611035565b612193604061052b565b90565b906121a090610151565b9052565b906121ae90610561565b9052565b5190565b906121c0826121b2565b8110156121d1576020809102010190565b611035565b60018060a01b031690565b6121ed6121f291611083565b6121d6565b90565b6121ff90546121e1565b90565b61220b906110e3565b90565b5f91031261221857565b61013e565b60209181520190565b60200190565b9060208061224e936122445f8201515f8601906112db565b015191019061131b565b565b9061225d8160409361222c565b0190565b60200190565b9061228461227e612277846120a1565b809361221d565b92612226565b905f5b8181106122945750505090565b9091926122ad6122a76001928651612250565b94612261565b9101919091612287565b906122f3906040806122d6606084015f8701518582035f870152612267565b946122e96020820151602086019061131b565b015191019061131b565b90565b60209181520190565b60200190565b906020806123279361231d5f8201515f8601906112db565b015191019061131b565b565b9061233681604093612305565b0190565b60200190565b9061235d612357612350846121b2565b80936122f6565b926122ff565b905f5b81811061236d5750505090565b9091926123866123806001928651612329565b9461233a565b9101919091612360565b60209181520190565b6123b86123c16020936123c6936123af816103a2565b93848093612390565b958691016103af565b6103ba565b0190565b9490612433969461240e61240361242596956123f56124189560c08c01908c5f8184039101526122b7565b908a820360208c0152612340565b946040890190610acc565b6060870190610c77565b84820360808601526109c9565b9160a0818403910152612399565b90565b96949392919695909561245261244d858790611e2a565b611e67565b9561245c5f61100a565b5b8061247a61247461246f898b90611e2a565b610561565b91610561565b1015612567576125629061255d88612538612493610cce565b612529858c6125016124fb6124f16124b75f6124b1868c8991611eb6565b0161105e565b986124e860406124e26124d760206124d18a878d91611eb6565b01611ed5565b988890859091611eb6565b016110be565b94908c91611eb6565b6060810190611ee2565b90611f29565b61251361250d826103a2565b91611f37565b209161251d610134565b96879560208701611f4a565b60208201810382520382610502565b61254a612544826103a2565b91611f37565b206125588b91849092611f9b565b611fbb565b611026565b61245d565b50945094909592506125d56125e4929761257f610c45565b9261259e6125ad33979392612592610134565b92839160208301612048565b60208201810382520382610502565b6125bf6125b9826103a2565b91611f37565b20916125c9610134565b96879560208701612054565b60208201810382520382610502565b6125f66125f0826103a2565b91611f37565b209161260c6126075f8701516120a1565b612142565b926126165f61100a565b5b8061263561262f61262a5f8b01516120a1565b610561565b91610561565b10156126a5576126a09061269961265c60206126555f8c01518590612169565b510161199a565b6126866126685f61109c565b9161267d612674612189565b935f8501612196565b602083016121a4565b87839161269383836121b6565b526121b6565b5150611026565b612617565b5092919490936126bd6126b860016121f5565b612202565b9163fe8ec1a790939594906126d06109a6565b9295843b15612747575f966126f9948894612704936126ed610134565b9b8c9a8b998a986110ff565b8852600488016123ca565b03925af1801561274257612716575b50565b612735905f3d811161273b575b61272d8183610502565b81019061220e565b5f612713565b503d612723565b6114dd565b6110fb565b5f90565b5f808061276d94819461276161274c565b50620186a0f115610390565b61277357565b5f633d2cec6f60e21b81528061278b6004820161019e565b0390fd5b612797612b8d565b5f146127dc57638b78c6d8199060601b60601c8082547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3801560ff1b1790555b565b638b78c6d8199060601b60601c908181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3556127da565b61282090610e6d565b90565b61282c90612817565b90565b612838906110e3565b90565b61284490611886565b9052565b949290979695939160e08601985f870161286191610acc565b6020860161286e91610acc565b6040850161287b91610dfc565b6060840161288891610dfc565b608083016128959161283b565b60a082016128a291610c77565b60c0016128ae91610c77565b565b905051906128bd82610564565b565b906020828203126128d8576128d5915f016128b0565b90565b61013e565b9160206128fe9294936128f760408201965f830190610acc565b0190610acc565b565b5f7f5065726d6974206661696c757265000000000000000000000000000000000000910152565b612934600e6020926109c0565b61293d81612900565b0190565b6129569060208101905f818303910152612927565b90565b9490969193929561297161296c87612823565b61282f565b9063d505accf92899387968a90929396853b15612ad9575f976129a89589956129b39461299c610134565b9c8d9b8c9a8b996110ff565b895260048901612848565b03925af19081612aad575b50155f14612aa75760016129f4575b50505050506129da610134565b62461bcd60e51b8152806129f060048201612941565b0390fd5b612a07612a02602093611077565b611d6b565b612a2963dd62ed3e959295612a34612a1d610134565b978895869485946110ff565b8452600484016128dd565b03915afa918215612aa2575f92612a6a575b50612a53612a5991610561565b91610561565b1015612a6857808080806129cd565b565b612a59919250612a93612a539160203d8111612a9b575b612a8b8183610502565b8101906128bf565b929150612a46565b503d612a81565b6114dd565b50505050565b612acc905f3d8111612ad2575b612ac48183610502565b81019061220e565b5f6129be565b503d612aba565b6110fb565b90602082820312612af757612af4915f01611136565b90565b61013e565b90612b0f90612b0a83611d6b565b612b9d565b612b18816103a2565b612b2a612b245f61100a565b91610561565b14159081612b62575b50612b3b5750565b612b47612b5e91611d6b565b5f918291635274afe760e01b835260048301610ad9565b0390fd5b612b879150612b81906020612b76826103a2565b818301019101612ade565b15610390565b5f612b33565b612b9561274c565b90565b606090565b90612bbb91612baa612b98565b5090612bb55f61100a565b91612c0a565b90565b612bc7906110e3565b90565b90612bdc612bd7836106b0565b61052b565b918252565b3d5f14612bfc57612bf13d612bca565b903d5f602084013e5b565b612c04612b98565b90612bfa565b9091612c14612b98565b50612c1e30612bbe565b31612c31612c2b83610561565b91610561565b10612c5d575f8091612c5a948491602082019151925af190612c51612be1565b90919091612c84565b90565b612c80612c6930612bbe565b5f91829163cd78605960e01b835260048301610ad9565b0390fd5b90612c9890612c91612b98565b5015610390565b5f14612ca45750612d08565b612cad826103a2565b612cbf612cb95f61100a565b91610561565b1480612ced575b612cce575090565b612ce9905f918291639996b31560e01b835260048301610ad9565b0390fd5b50803b612d02612cfc5f61100a565b91610561565b14612cc6565b612d11816103a2565b612d23612d1d5f61100a565b91610561565b115f14612d3257805190602001fd5b5f630a12f52160e11b815280612d4a6004820161019e565b0390fdfea26469706673582212205d531075184abe78c1cd0300d04ce89130960603fd0ba8d85a6fa8ed16c6c95d64736f6c634300081c0033000000000000000000000000f3d63166f0ca56c3c1a3508fce03ff0cf3fb691e000000000000000000000000f5042e6ffac5a625d4e7848e0b01373d8eb9e222000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3

Deployed Bytecode

0x60806040526004361015610015575b36610e5357005b61001f5f3561012e565b8063101ec30a146101295780632569296214610124578063308750561461011f578063337390821461011a5780633806a3cf146101155780633ccfd60b1461011057806354d1f13d1461010b578063715018a6146101065780638da5cb5b14610101578063a0a6ce7f146100fc578063c0d78655146100f7578063c99a0d65146100f2578063cf641c61146100ed578063f04e283e146100e8578063f2fde38b146100e3578063f887ea40146100de5763fee81cf40361000e57610e1e565b610dc7565b610d5b565b610d32565b610cfd565b610c99565b610c12565b610be0565b610aee565b610aa3565b610a7a565b610a47565b610a12565b6107e5565b6104b5565b6101e5565b6101a3565b60e01c90565b60405190565b5f80fd5b5f80fd5b5f80fd5b60018060a01b031690565b61015a90610146565b90565b61016681610151565b0361016d57565b5f80fd5b9050359061017e8261015d565b565b9060208282031261019957610196915f01610171565b90565b61013e565b5f0190565b346101d1576101bb6101b6366004610180565b610f3e565b6101c3610134565b806101cd8161019e565b0390f35b61013a565b5f9103126101e057565b61013e565b6101f03660046101d6565b6101f8610f80565b610200610134565b8061020a8161019e565b0390f35b5f80fd5b5f80fd5b5f80fd5b909182601f830112156102545781359167ffffffffffffffff831161024f57602001926020830284011161024a57565b610216565b610212565b61020e565b909182601f830112156102935781359167ffffffffffffffff831161028e57602001926020830284011161028957565b610216565b610212565b61020e565b909182601f830112156102d25781359167ffffffffffffffff83116102cd5760200192602083028401116102c857565b610216565b610212565b61020e565b91909160a081840312610378575f81013567ffffffffffffffff8111610373578361030391830161021a565b929093602083013567ffffffffffffffff811161036e5781610326918501610259565b92909360408101359167ffffffffffffffff83116103695761034d84610366948401610298565b93909461035d8160608601610171565b93608001610171565b90565b610142565b610142565b610142565b61013e565b5190565b60209181520190565b60200190565b151590565b61039e90610390565b9052565b5190565b60209181520190565b90825f9392825e0152565b601f801991011690565b6103e36103ec6020936103f1936103da816103a2565b938480936103a6565b958691016103af565b6103ba565b0190565b61042091602060408201926104105f8201515f850190610395565b01519060208184039101526103c4565b90565b9061042d916103f5565b90565b60200190565b9061044a6104438361037d565b8092610381565b908161045b6020830284019461038a565b925f915b83831061046e57505050505090565b9091929394602061049061048a83856001950387528951610423565b97610430565b930193019193929061045f565b6104b29160208201915f818403910152610436565b90565b6104e66104d56104c63660046102d7565b969590959491949392936114ed565b6104dd610134565b9182918261049d565b0390f35b5f80fd5b634e487b7160e01b5f52604160045260245ffd5b9061050c906103ba565b810190811067ffffffffffffffff82111761052657604052565b6104ee565b9061053e610537610134565b9283610502565b565b5f80fd5b67ffffffffffffffff811161055c5760208091020190565b6104ee565b90565b61056d81610561565b0361057457565b5f80fd5b9050359061058582610564565b565b91906040838203126105c1576105ba906105a1604061052b565b936105ae825f8301610171565b5f860152602001610578565b6020830152565b6104ea565b909291926105db6105d682610544565b61052b565b93818552604060208601920283019281841161061a57915b8383106106005750505050565b602060409161060f8486610587565b8152019201916105f3565b610216565b9080601f8301121561063d5781602061063a933591016105c6565b90565b61020e565b9190916060818403126106a757610659606061052b565b925f8201359167ffffffffffffffff83116106a25761067d8261069b94830161061f565b5f86015261068e8260208301610578565b6020860152604001610578565b6040830152565b610540565b6104ea565b5f80fd5b67ffffffffffffffff81116106ce576106ca6020916103ba565b0190565b6104ee565b90825f939282370152565b909291926106f36106ee826106b0565b61052b565b9381855260208501908284011161070f5761070d926106d3565b565b6106ac565b9080601f830112156107325781602061072f933591016106de565b90565b61020e565b909160c0828403126107e05761074f835f8401610171565b92602083013567ffffffffffffffff81116107db5781610770918501610642565b92604081013567ffffffffffffffff81116107d65782610791918301610298565b9290936107a18260608501610171565b926107af8360808301610171565b9260a082013567ffffffffffffffff81116107d1576107ce9201610714565b90565b610142565b610142565b610142565b61013e565b6108136108026107f6366004610737565b9594909493919361169a565b61080a610134565b9182918261049d565b0390f35b67ffffffffffffffff8111610835576108316020916103ba565b0190565b6104ee565b9061084c61084783610817565b61052b565b918252565b60e07f7432353620616d6f756e74290000000000000000000000000000000000000000917f52656c617965725769746e657373207769746e6573732943616c6c3356616c755f8201527f652861646472657373207461726765742c626f6f6c20616c6c6f774661696c7560208201527f72652c75696e743235362076616c75652c62797465732063616c6c446174612960408201527f52656c617965725769746e65737328616464726573732072656c617965722c6160608201527f64647265737320726566756e64546f2c61646472657373206e6674526563697060808201527f69656e742c43616c6c3356616c75655b5d2063616c6c3356616c75657329546f60a08201527f6b656e5065726d697373696f6e73286164647265737320746f6b656e2c75696e60c08201520152565b61098c60ec61083a565b9061099960208301610851565b565b6109a3610982565b90565b6109ae61099b565b90565b6109b96109a6565b90565b5190565b60209181520190565b6109e86109f16020936109f6936109df816109bc565b938480936109c0565b958691016103af565b6103ba565b0190565b610a0f9160208201915f8184039101526109c9565b90565b34610a4257610a223660046101d6565b610a3e610a2d6109b1565b610a35610134565b918291826109fa565b0390f35b61013a565b34610a7557610a573660046101d6565b610a5f6117e3565b610a67610134565b80610a718161019e565b0390f35b61013a565b610a853660046101d6565b610a8d6117ed565b610a95610134565b80610a9f8161019e565b0390f35b610aae3660046101d6565b610ab661184b565b610abe610134565b80610ac88161019e565b0390f35b610ad590610151565b9052565b9190610aec905f60208501940190610acc565b565b34610b1e57610afe3660046101d6565b610b1a610b09611859565b610b11610134565b91829182610ad9565b0390f35b61013a565b909182601f83011215610b5e5781359167ffffffffffffffff8311610b5957602001926101008302840111610b5457565b610216565b610212565b61020e565b9190608083820312610bdb575f83013567ffffffffffffffff8111610bd65781610b8e918501610b23565b92909360208101359167ffffffffffffffff8311610bd157610bb584610bce948401610298565b939094610bc58160408601610171565b93606001610171565b90565b610142565b610142565b61013e565b610c0e610bfd610bf1366004610b63565b949390939291926119c1565b610c05610134565b9182918261049d565b0390f35b34610c4057610c2a610c25366004610180565b611c59565b610c32610134565b80610c3c8161019e565b0390f35b61013a565b7fe23dc67d94bc5ccc95cdaa7f8c7e41f4c3b78d9d1e7baad8604a2773456e2b3c90565b610c71610c45565b90565b90565b610c8090610c74565b9052565b9190610c97905f60208501940190610c77565b565b34610cc957610ca93660046101d6565b610cc5610cb4610c69565b610cbc610134565b91829182610c84565b0390f35b61013a565b7ffd3926a097b5d365885a8c0afe16fa80ed4d377e8627017476dfe9729e8a6cde90565b610cfa610cce565b90565b34610d2d57610d0d3660046101d6565b610d29610d18610cf2565b610d20610134565b91829182610c84565b0390f35b61013a565b610d45610d40366004610180565b611caa565b610d4d610134565b80610d578161019e565b0390f35b610d6e610d69366004610180565b611ce9565b610d76610134565b80610d808161019e565b0390f35b1c90565b60018060a01b031690565b610da3906008610da89302610d84565b610d88565b90565b90610db69154610d93565b90565b610dc45f5f90610dab565b90565b34610df757610dd73660046101d6565b610df3610de2610db9565b610dea610134565b91829182610ad9565b0390f35b61013a565b610e0590610561565b9052565b9190610e1c905f60208501940190610dfc565b565b34610e4e57610e4a610e39610e34366004610180565b611cf8565b610e41610134565b91829182610e09565b0390f35b61013a565b5f80fd5b610e6890610e63611d14565b610ef0565b565b90565b610e81610e7c610e8692610146565b610e6a565b610146565b90565b610e9290610e6d565b90565b610e9e90610e89565b90565b5f1b90565b90610eb760018060a01b0391610ea1565b9181191691161790565b610eca90610e89565b90565b90565b90610ee5610ee0610eec92610ec1565b610ecd565b8254610ea6565b9055565b610f03610efc82610e95565b6001610ed0565b610f397faecfd826d6b270962e6ff81f57b75e8527073ef343cbb38af801b8a972c7846191610f30610134565b91829182610ad9565b0390a1565b610f4790610e57565b565b67ffffffffffffffff1690565b610f6a610f65610f6f92610f49565b610e6a565b610561565b90565b90610f7d9101610561565b90565b610f9a42610f94610f8f611d53565b610f56565b90610f72565b63389a75e1600c52335f526020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a2565b606090565b5090565b5090565b90565b610ff6610ff1610ffb92610fdf565b610e6a565b610146565b90565b61100790610fe2565b90565b61101e61101961102392610fdf565b610e6a565b610561565b90565b60016110329101610561565b90565b634e487b7160e01b5f52603260045260245ffd5b9190811015611059576020020190565b611035565b356110688161015d565b90565b61107490610e6d565b90565b6110809061106b565b90565b5f1c90565b61109461109991611083565b610d88565b90565b6110a69054611088565b90565b91908110156110b9576020020190565b611035565b356110c881610564565b90565b6110d490610e6d565b90565b6110e0906110cb565b90565b6110ec90610e6d565b90565b6110f8906110e3565b90565b5f80fd5b60e01b90565b67ffffffffffffffff811161111d5760208091020190565b6104ee565b61112b81610390565b0361113257565b5f80fd5b9050519061114382611122565b565b9092919261115a611155826106b0565b61052b565b9381855260208501908284011161117657611174926103af565b565b6106ac565b9080601f830112156111995781602061119693519101611145565b90565b61020e565b9190916040818403126111f0576111b5604061052b565b926111c2815f8401611136565b5f850152602082015167ffffffffffffffff81116111eb576111e4920161117b565b6020830152565b610540565b6104ea565b92919061120961120482611105565b61052b565b93818552602080860192028101918383116112605781905b83821061122f575050505050565b815167ffffffffffffffff811161125b57602091611250878493870161119e565b815201910190611221565b61020e565b610216565b9080601f8301121561128357816020611280935191016111f5565b90565b61020e565b906020828203126112b8575f82015167ffffffffffffffff81116112b3576112b09201611265565b90565b610142565b61013e565b60209181520190565b90565b506112d8906020810190610171565b90565b6112e490610151565b9052565b905035906112f582611122565b565b506113069060208101906112e8565b90565b50611318906020810190610578565b90565b61132490610561565b9052565b5f80fd5b5f80fd5b5f80fd5b903560016020038236030381121561137557016020813591019167ffffffffffffffff821161137057600182023603831361136b57565b61132c565b611328565b611330565b91906113948161138d81611399956103a6565b80956106d3565b6103ba565b0190565b61140d916113ff60808201926113c16113b85f8301836112c9565b5f8501906112db565b6113db6113d160208301836112f7565b6020850190610395565b6113f56113eb6040830183611309565b604085019061131b565b6060810190611334565b91606081850391015261137a565b90565b9061141a9161139d565b90565b9035600160800382360303811215611433570190565b611330565b60200190565b9181611449916112bd565b908161145a602083028401946112c6565b92835f925b84841061146f5750505050505090565b909192939495602061149a611494838560019503885261148f8b8861141d565b611410565b98611438565b94019401929493919061145f565b6114d46114c96040936114db9698979560608501918583035f87015261143e565b966020830190610acc565b0190610acc565b565b6114e5610134565b3d5f823e3d90fd5b9396979297959195949094611500610fd2565b5061150c858790610fd7565b61152861152261151d8a8d90610fdb565b610561565b91610561565b0361167e578261154861154261153d5f610ffe565b610151565b91610151565b14611662576115565f61100a565b5b8061157461156e611569898b90610fd7565b610561565b91610561565b10156115ce576115c9906115c461159d6115986115938a8c8691611049565b61105e565b611077565b8a8d6115be6115b933926115b05f61109c565b949088916110a9565b6110be565b92611dda565b611026565b611557565b50935093509461161a9196505f94506115f66115f16115ec8761109c565b6110d7565b6110ef565b6116256330be5567943492959293969861160e610134565b998a98899788966110ff565b8652600486016114a8565b03925af190811561165d575f9161163b575b5090565b61165791503d805f833e61164f8183610502565b810190611288565b5f611637565b6114dd565b5f63fc62e08f60e01b81528061167a6004820161019e565b0390fd5b5f631dc0052360e11b8152806116966004820161019e565b0390fd5b959190949293956116a9610fd2565b50866116c56116bf6116ba5f610ffe565b610151565b91610151565b14611793575f95836116d9611731956103a2565b6116eb6116e58a61100a565b91610561565b03611779575b50505061170d6117086117038761109c565b6110d7565b6110ef565b61173c6330be55679434929592939698611725610134565b998a98899788966110ff565b8652600486016114a8565b03925af1908115611774575f91611752575b5090565b61176e91503d805f833e6117668183610502565b810190611288565b5f61174e565b6114dd565b61178b929189908786928a9495612436565b5f80806116f1565b5f63fc62e08f60e01b8152806117ab6004820161019e565b0390fd5b6117b7611d14565b6117bf6117cd565b565b6117ca906110e3565b90565b6117e1336117da306117c1565b3190612750565b565b6117eb6117af565b565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b61182e611d14565b611836611838565b565b6118496118445f610ffe565b61278f565b565b611853611826565b565b5f90565b611861611855565b50638b78c6d8195490565b5090565b919081101561188157610100020190565b611035565b60ff1690565b61189581611886565b0361189c57565b5f80fd5b905035906118ad8261188c565b565b6118b881610c74565b036118bf57565b5f80fd5b905035906118d0826118af565b565b91906101008382031261197a57611973906118ee61010061052b565b936118fb825f8301610171565b5f86015261190c8260208301610171565b602086015261191e8260408301610578565b60408601526119308260608301610578565b60608601526119428260808301610578565b60808601526119548260a083016118a0565b60a08601526119668260c083016118c3565b60c086015260e0016118c3565b60e0830152565b6104ea565b61198a9036906118d2565b90565b6119979051610151565b90565b6119a49051610561565b90565b6119b19051611886565b90565b6119be9051610c74565b90565b9391959290946119cf610fd2565b50826119eb6119e56119e05f610ffe565b610151565b91610151565b14611bb6576119f95f61100a565b5b80611a17611a11611a0c898b9061186c565b610561565b91610561565b1015611b2457611a31611a2c87898491611870565b61197f565b90611a3e6020830161198d565b611a50611a4a33610151565b91610151565b03611b0957611aff82611ac4611a6a5f611b04960161198d565b611a766020840161198d565b611a7f306117c1565b611a8b6040860161199a565b611a976080870161199a565b90611aa460a088016119a7565b92611ab160c089016119b4565b94611abe60e08a016119b4565b96612959565b611ad7611ad25f830161198d565b611077565b90611ae46020820161198d565b611af96040611af25f61109c565b930161199a565b92611dda565b611026565b6119fa565b5f6282b42960e81b815280611b206004820161019e565b0390fd5b5091945091945f9350611b6e90611b4a611b45611b408761109c565b6110d7565b6110ef565b611b796330be55679434929592939698611b62610134565b998a98899788966110ff565b8652600486016114a8565b03925af1908115611bb1575f91611b8f575b5090565b611bab91503d805f833e611ba38183610502565b810190611288565b5f611b8b565b6114dd565b5f63fc62e08f60e01b815280611bce6004820161019e565b0390fd5b611be390611bde611d14565b611c14565b565b611bee906110e3565b90565b90565b90611c09611c04611c1092611be5565b611bf1565b8254610ea6565b9055565b611c1e815f611bf4565b611c547f7aed1d3e8155a07ccf395e44ea3109a0e2d6c9b29bbbe9f142d9790596f4dc8091611c4b610134565b91829182610ad9565b0390a1565b611c6290611bd2565b565b611c7590611c70611d14565b611c77565b565b63389a75e1600c52805f526020600c209081544211611c9d575f611c9b925561278f565b565b636f5e88185f526004601cfd5b611cb390611c64565b565b611cc690611cc1611d14565b611cc8565b565b8060601b15611cdc57611cda9061278f565b565b637448fbae5f526004601cfd5b611cf290611cb5565b565b5f90565b611d00611cf4565b5063389a75e1600c525f526020600c205490565b638b78c6d819543303611d2357565b6382b429005f526004601cfd5b5f90565b90565b611d4b611d46611d5092611d34565b610e6a565b610f49565b90565b611d5b611d30565b50611d686202a300611d37565b90565b611d74906110e3565b90565b63ffffffff1690565b63ffffffff60e01b1690565b611da0611d9b611da592611d77565b6110ff565b611d80565b90565b604090611dd1611dd89496959396611dc760608401985f850190610acc565b6020830190610acc565b0190610dfc565b565b600492611e14611e289593611e239394611dfb6323b872dd92949192611d8c565b93611e04610134565b9788956020870190815201611da8565b60208201810382520383610502565b612afc565b565b5090565b67ffffffffffffffff8111611e465760208091020190565b6104ee565b90611e5d611e5883611e2e565b61052b565b918252565b369037565b90611e8c611e7483611e4b565b92602080611e828693611e2e565b9201910390611e62565b565b5f80fd5b5f80fd5b5f80fd5b903590600160800381360303821215611eb1570190565b611e8e565b90821015611ed0576020611ecd9202810190611e9a565b90565b611035565b35611edf81611122565b90565b903590600160200381360303821215611f24570180359067ffffffffffffffff8211611f1f57602001916001820236038313611f1a57565b611e96565b611e92565b611e8e565b611f349136916106de565b90565b60200190565b611f4690610390565b9052565b90959492611f9594611f84611f8e92611f7a608096611f7060a088019c5f890190610c77565b6020870190610acc565b6040850190611f3d565b6060830190610dfc565b0190610c77565b565b5190565b90611fa582611f97565b811015611fb6576020809102010190565b611035565b90611fc590610c74565b9052565b905090565b60200190565b611fdd90610c74565b9052565b90611fee81602093611fd4565b0190565b60200190565b9061201561200f61200884611f97565b8093611fc9565b92611fce565b905f5b8181106120255750505090565b90919261203e6120386001928651611fe1565b94611ff2565b9101919091612018565b61205191611ff8565b90565b9095949261209f9461208e6120989261208460809661207a60a088019c5f890190610c77565b6020870190610acc565b6040850190610acc565b6060830190610acc565b0190610c77565b565b5190565b67ffffffffffffffff81116120bd5760208091020190565b6104ee565b906120d46120cf836120a5565b61052b565b918252565b6120e3604061052b565b90565b5f90565b5f90565b6120f66120d9565b90602080836121036120e6565b81520161210e6120ea565b81525050565b61211c6120ee565b90565b5f5b82811061212d57505050565b602090612138612114565b8184015201612121565b9061216761214f836120c2565b9260208061215d86936120a5565b920191039061211f565b565b90612173826120a1565b811015612184576020809102010190565b611035565b612193604061052b565b90565b906121a090610151565b9052565b906121ae90610561565b9052565b5190565b906121c0826121b2565b8110156121d1576020809102010190565b611035565b60018060a01b031690565b6121ed6121f291611083565b6121d6565b90565b6121ff90546121e1565b90565b61220b906110e3565b90565b5f91031261221857565b61013e565b60209181520190565b60200190565b9060208061224e936122445f8201515f8601906112db565b015191019061131b565b565b9061225d8160409361222c565b0190565b60200190565b9061228461227e612277846120a1565b809361221d565b92612226565b905f5b8181106122945750505090565b9091926122ad6122a76001928651612250565b94612261565b9101919091612287565b906122f3906040806122d6606084015f8701518582035f870152612267565b946122e96020820151602086019061131b565b015191019061131b565b90565b60209181520190565b60200190565b906020806123279361231d5f8201515f8601906112db565b015191019061131b565b565b9061233681604093612305565b0190565b60200190565b9061235d612357612350846121b2565b80936122f6565b926122ff565b905f5b81811061236d5750505090565b9091926123866123806001928651612329565b9461233a565b9101919091612360565b60209181520190565b6123b86123c16020936123c6936123af816103a2565b93848093612390565b958691016103af565b6103ba565b0190565b9490612433969461240e61240361242596956123f56124189560c08c01908c5f8184039101526122b7565b908a820360208c0152612340565b946040890190610acc565b6060870190610c77565b84820360808601526109c9565b9160a0818403910152612399565b90565b96949392919695909561245261244d858790611e2a565b611e67565b9561245c5f61100a565b5b8061247a61247461246f898b90611e2a565b610561565b91610561565b1015612567576125629061255d88612538612493610cce565b612529858c6125016124fb6124f16124b75f6124b1868c8991611eb6565b0161105e565b986124e860406124e26124d760206124d18a878d91611eb6565b01611ed5565b988890859091611eb6565b016110be565b94908c91611eb6565b6060810190611ee2565b90611f29565b61251361250d826103a2565b91611f37565b209161251d610134565b96879560208701611f4a565b60208201810382520382610502565b61254a612544826103a2565b91611f37565b206125588b91849092611f9b565b611fbb565b611026565b61245d565b50945094909592506125d56125e4929761257f610c45565b9261259e6125ad33979392612592610134565b92839160208301612048565b60208201810382520382610502565b6125bf6125b9826103a2565b91611f37565b20916125c9610134565b96879560208701612054565b60208201810382520382610502565b6125f66125f0826103a2565b91611f37565b209161260c6126075f8701516120a1565b612142565b926126165f61100a565b5b8061263561262f61262a5f8b01516120a1565b610561565b91610561565b10156126a5576126a09061269961265c60206126555f8c01518590612169565b510161199a565b6126866126685f61109c565b9161267d612674612189565b935f8501612196565b602083016121a4565b87839161269383836121b6565b526121b6565b5150611026565b612617565b5092919490936126bd6126b860016121f5565b612202565b9163fe8ec1a790939594906126d06109a6565b9295843b15612747575f966126f9948894612704936126ed610134565b9b8c9a8b998a986110ff565b8852600488016123ca565b03925af1801561274257612716575b50565b612735905f3d811161273b575b61272d8183610502565b81019061220e565b5f612713565b503d612723565b6114dd565b6110fb565b5f90565b5f808061276d94819461276161274c565b50620186a0f115610390565b61277357565b5f633d2cec6f60e21b81528061278b6004820161019e565b0390fd5b612797612b8d565b5f146127dc57638b78c6d8199060601b60601c8082547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3801560ff1b1790555b565b638b78c6d8199060601b60601c908181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3556127da565b61282090610e6d565b90565b61282c90612817565b90565b612838906110e3565b90565b61284490611886565b9052565b949290979695939160e08601985f870161286191610acc565b6020860161286e91610acc565b6040850161287b91610dfc565b6060840161288891610dfc565b608083016128959161283b565b60a082016128a291610c77565b60c0016128ae91610c77565b565b905051906128bd82610564565b565b906020828203126128d8576128d5915f016128b0565b90565b61013e565b9160206128fe9294936128f760408201965f830190610acc565b0190610acc565b565b5f7f5065726d6974206661696c757265000000000000000000000000000000000000910152565b612934600e6020926109c0565b61293d81612900565b0190565b6129569060208101905f818303910152612927565b90565b9490969193929561297161296c87612823565b61282f565b9063d505accf92899387968a90929396853b15612ad9575f976129a89589956129b39461299c610134565b9c8d9b8c9a8b996110ff565b895260048901612848565b03925af19081612aad575b50155f14612aa75760016129f4575b50505050506129da610134565b62461bcd60e51b8152806129f060048201612941565b0390fd5b612a07612a02602093611077565b611d6b565b612a2963dd62ed3e959295612a34612a1d610134565b978895869485946110ff565b8452600484016128dd565b03915afa918215612aa2575f92612a6a575b50612a53612a5991610561565b91610561565b1015612a6857808080806129cd565b565b612a59919250612a93612a539160203d8111612a9b575b612a8b8183610502565b8101906128bf565b929150612a46565b503d612a81565b6114dd565b50505050565b612acc905f3d8111612ad2575b612ac48183610502565b81019061220e565b5f6129be565b503d612aba565b6110fb565b90602082820312612af757612af4915f01611136565b90565b61013e565b90612b0f90612b0a83611d6b565b612b9d565b612b18816103a2565b612b2a612b245f61100a565b91610561565b14159081612b62575b50612b3b5750565b612b47612b5e91611d6b565b5f918291635274afe760e01b835260048301610ad9565b0390fd5b612b879150612b81906020612b76826103a2565b818301019101612ade565b15610390565b5f612b33565b612b9561274c565b90565b606090565b90612bbb91612baa612b98565b5090612bb55f61100a565b91612c0a565b90565b612bc7906110e3565b90565b90612bdc612bd7836106b0565b61052b565b918252565b3d5f14612bfc57612bf13d612bca565b903d5f602084013e5b565b612c04612b98565b90612bfa565b9091612c14612b98565b50612c1e30612bbe565b31612c31612c2b83610561565b91610561565b10612c5d575f8091612c5a948491602082019151925af190612c51612be1565b90919091612c84565b90565b612c80612c6930612bbe565b5f91829163cd78605960e01b835260048301610ad9565b0390fd5b90612c9890612c91612b98565b5015610390565b5f14612ca45750612d08565b612cad826103a2565b612cbf612cb95f61100a565b91610561565b1480612ced575b612cce575090565b612ce9905f918291639996b31560e01b835260048301610ad9565b0390fd5b50803b612d02612cfc5f61100a565b91610561565b14612cc6565b612d11816103a2565b612d23612d1d5f61100a565b91610561565b115f14612d3257805190602001fd5b5f630a12f52160e11b815280612d4a6004820161019e565b0390fdfea26469706673582212205d531075184abe78c1cd0300d04ce89130960603fd0ba8d85a6fa8ed16c6c95d64736f6c634300081c0033

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

000000000000000000000000f3d63166f0ca56c3c1a3508fce03ff0cf3fb691e000000000000000000000000f5042e6ffac5a625d4e7848e0b01373d8eb9e222000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3

-----Decoded View---------------
Arg [0] : _owner (address): 0xf3d63166F0Ca56C3c1A3508FcE03Ff0Cf3Fb691e
Arg [1] : _router (address): 0xF5042e6ffaC5a625D4E7848e0b01373D8eB9e222
Arg [2] : _permit2 (address): 0x000000000022D473030F116dDEE9F6B43aC78BA3

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000f3d63166f0ca56c3c1a3508fce03ff0cf3fb691e
Arg [1] : 000000000000000000000000f5042e6ffac5a625d4e7848e0b01373d8eb9e222
Arg [2] : 000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3


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
Loading...
Loading
[ Download: CSV Export  ]

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