MON Price: $0.021025 (+11.86%)

Contract

0xCC7944C237DC540585935F19Bc9aeA0003BC4224

Overview

MON Balance

Monad Chain LogoMonad Chain LogoMonad Chain Logo0 MON

MON Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

1 Internal Transaction and > 10 Token Transfers found.

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block From To
379476392025-11-25 17:40:3463 days ago1764092434  Contract Creation0 MON
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
UniswapV4Gateway

Compiler Version
v0.8.23+commit.f704f362

Optimization Enabled:
Yes with 1000 runs

Other Settings:
shanghai EvmVersion
// SPDX-License-Identifier: GPL-2.0-or-later
// Gearbox Protocol. Generalized leverage for DeFi protocols
// (c) Gearbox Foundation, 2024.
pragma solidity ^0.8.23;

import {IVersion} from "@gearbox-protocol/core-v3/contracts/interfaces/base/IVersion.sol";
import {
    IUniversalRouter,
    UniswapV4ExactInputSingleParams,
    PoolKey,
    COMMAND_V4_SWAP,
    ACTION_SWAP_IN_SINGLE,
    ACTION_SETTLE_ALL,
    ACTION_TAKE_ALL
} from "../../integrations/uniswap/IUniswapUniversalRouter.sol";
import {IUniswapV4Gateway} from "../../interfaces/uniswap/IUniswapV4Gateway.sol";

import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {IWETH} from "@gearbox-protocol/core-v3/contracts/interfaces/external/IWETH.sol";

interface IPermit2 {
    function approve(address token, address spender, uint160 amount, uint48 expiration) external;
}

/// @title UniswapV4Gateway
/// @dev This is connector contract to allow Gearbox adapters to swap through Uniswap V4 pools via Uniswap Universal Router.
///      Since Uniswap V4 works with native ETH and requires approval in Permit2, we need an intermediate contract.
contract UniswapV4Gateway is IUniswapV4Gateway, IVersion {
    using SafeERC20 for IERC20;

    bytes32 public constant override contractType = "GATEWAY::UNISWAP_V4";
    uint256 public constant override version = 3_10;

    address public immutable universalRouter;
    address public immutable poolManager;
    address public immutable permit2;
    address public immutable weth;

    constructor(address _universalRouter, address _permit2, address _weth) {
        universalRouter = _universalRouter;
        poolManager = IUniversalRouter(_universalRouter).poolManager();
        permit2 = _permit2;
        weth = _weth;
    }

    function swapExactInputSingle(
        PoolKey calldata poolKey,
        bool zeroForOne,
        uint128 amountIn,
        uint128 amountOutMinimum,
        bytes calldata hookData
    ) external returns (uint256 amountOut) {
        address tokenIn = zeroForOne ? poolKey.token0 : poolKey.token1;
        address tokenOut = zeroForOne ? poolKey.token1 : poolKey.token0;

        amountIn = uint128(_transferIn(tokenIn, msg.sender, amountIn));

        (bytes memory commands, bytes[] memory inputs) =
            _getInputData(poolKey, zeroForOne, amountIn, amountOutMinimum, hookData);

        amountOut = _swap(commands, inputs, tokenIn, tokenOut, amountIn);

        _transferOut(tokenOut, msg.sender, amountOut);
    }

    function _swap(bytes memory commands, bytes[] memory inputs, address tokenIn, address tokenOut, uint128 amountIn)
        internal
        returns (uint256 amountOut)
    {
        if (tokenIn == address(0)) {
            uint256 balanceBefore = _getBalance(tokenOut);
            IUniversalRouter(universalRouter).execute{value: amountIn}(commands, inputs);
            amountOut = _getBalance(tokenOut) - balanceBefore;
        } else {
            IERC20(tokenIn).forceApprove(permit2, amountIn);
            IPermit2(permit2).approve(address(tokenIn), universalRouter, uint160(amountIn), uint48(block.timestamp));

            uint256 balanceBefore = _getBalance(tokenOut);
            IUniversalRouter(universalRouter).execute(commands, inputs);
            amountOut = _getBalance(tokenOut) - balanceBefore;
        }
    }

    function _getInputData(
        PoolKey memory poolKey,
        bool zeroForOne,
        uint128 amountIn,
        uint128 amountOutMinimum,
        bytes calldata hookData
    ) internal pure returns (bytes memory commands, bytes[] memory inputs) {
        commands = abi.encodePacked(uint8(COMMAND_V4_SWAP));

        inputs = new bytes[](1);
        bytes memory actions =
            abi.encodePacked(uint8(ACTION_SWAP_IN_SINGLE), uint8(ACTION_SETTLE_ALL), uint8(ACTION_TAKE_ALL));

        bytes[] memory params = new bytes[](3);
        params[0] = abi.encode(
            UniswapV4ExactInputSingleParams({
                poolKey: poolKey,
                zeroForOne: zeroForOne,
                amountIn: amountIn,
                amountOutMinimum: amountOutMinimum,
                hookData: hookData
            })
        );

        params[1] = abi.encode(zeroForOne ? poolKey.token0 : poolKey.token1, amountIn);

        params[2] = abi.encode(zeroForOne ? poolKey.token1 : poolKey.token0, amountOutMinimum);

        inputs[0] = abi.encode(actions, params);
    }

    function _transferIn(address token, address from, uint256 amount) internal returns (uint256 transferredAmount) {
        if (token == address(0)) {
            uint256 balanceBefore = IERC20(weth).balanceOf(address(this));
            IERC20(weth).safeTransferFrom(from, address(this), amount);
            transferredAmount = IERC20(weth).balanceOf(address(this)) - balanceBefore;
            IWETH(weth).withdraw(transferredAmount);
        } else {
            uint256 balanceBefore = IERC20(token).balanceOf(address(this));
            IERC20(token).safeTransferFrom(from, address(this), amount);
            transferredAmount = IERC20(token).balanceOf(address(this)) - balanceBefore;
        }
        return transferredAmount;
    }

    function _getBalance(address token) internal view returns (uint256 balance) {
        if (token == address(0)) {
            return address(this).balance;
        } else {
            return IERC20(token).balanceOf(address(this));
        }
    }

    function _transferOut(address token, address to, uint256 amount) internal {
        if (token == address(0)) {
            IWETH(weth).deposit{value: amount}();
            IERC20(weth).safeTransfer(to, amount);
        } else {
            IERC20(token).safeTransfer(to, amount);
        }
    }

    receive() external payable {
        if (msg.sender != poolManager && msg.sender != weth) {
            revert UnexpectedETHTransferException();
        }
    }
}

// SPDX-License-Identifier: MIT
// Gearbox Protocol. Generalized leverage for DeFi protocols
// (c) Gearbox Foundation, 2025.
pragma solidity ^0.8.23;

import {PoolKey} from "../../integrations/uniswap/IUniswapUniversalRouter.sol";

interface IUniswapV4Gateway {
    error UnexpectedETHTransferException();

    function universalRouter() external view returns (address);

    function permit2() external view returns (address);

    function weth() external view returns (address);

    function swapExactInputSingle(
        PoolKey calldata poolKey,
        bool zeroForOne,
        uint128 amountIn,
        uint128 amountOutMinimum,
        bytes calldata hookData
    ) external returns (uint256 amount);
}

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

struct PoolKey {
    address token0;
    address token1;
    uint24 fee;
    int24 tickSpacing;
    address hooks;
}

struct UniswapV4ExactInputSingleParams {
    PoolKey poolKey;
    bool zeroForOne;
    uint128 amountIn;
    uint128 amountOutMinimum;
    bytes hookData;
}

uint256 constant COMMAND_V4_SWAP = 0x10;
uint256 constant ACTION_SWAP_IN_SINGLE = 0x06;
uint256 constant ACTION_SETTLE_ALL = 0x0c;
uint256 constant ACTION_TAKE_ALL = 0x0f;

interface IUniversalRouter {
    function poolManager() external view returns (address);
    function execute(bytes calldata commands, bytes[] calldata inputs) external payable;
}

// SPDX-License-Identifier: MIT
// Gearbox Protocol. Generalized leverage for DeFi protocols
// (c) Gearbox Foundation, 2024.
pragma solidity ^0.8.17;

/// @title Version interface
/// @notice Defines contract version and type
interface IVersion {
    /// @notice Contract version
    function version() external view returns (uint256);

    /// @notice Contract type
    function contractType() external view returns (bytes32);
}

// SPDX-License-Identifier: MIT
// Gearbox Protocol. Generalized leverage for DeFi protocols
// (c) Gearbox Foundation, 2024.
pragma solidity ^0.8.17;

interface IWETH {
    function deposit() external payable;
    function withdraw(uint256 amount) external;
}

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

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
        }
    }

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 *
 * ==== 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);
}

Settings
{
  "remappings": [
    "@1inch/=lib/@1inch/",
    "@gearbox-protocol/=lib/@gearbox-protocol/",
    "@openzeppelin/=lib/@gearbox-protocol/core-v3/lib/@openzeppelin/",
    "@redstone-finance/=node_modules/@redstone-finance/",
    "@solady/=lib/@gearbox-protocol/oracles-v3/lib/@solady/src/",
    "ds-test/=lib/@gearbox-protocol/sdk-gov/lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/@gearbox-protocol/core-v3/lib/@openzeppelin/lib/erc4626-tests/",
    "forge-std/=lib/@gearbox-protocol/core-v3/lib/forge-std/src/"
  ],
  "optimizer": {
    "runs": 1000,
    "enabled": true
  },
  "metadata": {
    "bytecodeHash": "none",
    "useLiteralContent": true
  },
  "evmVersion": "shanghai",
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_universalRouter","type":"address"},{"internalType":"address","name":"_permit2","type":"address"},{"internalType":"address","name":"_weth","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"UnexpectedETHTransferException","type":"error"},{"inputs":[],"name":"contractType","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"permit2","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"int24","name":"tickSpacing","type":"int24"},{"internalType":"address","name":"hooks","type":"address"}],"internalType":"struct PoolKey","name":"poolKey","type":"tuple"},{"internalType":"bool","name":"zeroForOne","type":"bool"},{"internalType":"uint128","name":"amountIn","type":"uint128"},{"internalType":"uint128","name":"amountOutMinimum","type":"uint128"},{"internalType":"bytes","name":"hookData","type":"bytes"}],"name":"swapExactInputSingle","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"universalRouter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"weth","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

61010060405234801562000011575f80fd5b506040516200172b3803806200172b8339810160408190526200003491620000de565b6001600160a01b03831660808190526040805163dc4c90d360e01b8152905163dc4c90d3916004808201926020929091908290030181865afa1580156200007d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620000a3919062000125565b6001600160a01b0390811660a05291821660c0521660e0525062000148565b80516001600160a01b0381168114620000d9575f80fd5b919050565b5f805f60608486031215620000f1575f80fd5b620000fc84620000c2565b92506200010c60208501620000c2565b91506200011c60408501620000c2565b90509250925092565b5f6020828403121562000136575f80fd5b6200014182620000c2565b9392505050565b60805160a05160c05160e051611556620001d55f395f818160b5015281816101a90152818161034e015281816103ce0152818161040d015281816104ba01528181610b8e0152610c0801525f8181610126015281816109ba0152610a6501525f81816081015261025101525f81816101760152818161090b01528181610a200152610af901526115565ff3fe608060405260043610610071575f3560e01c806354fd4d501161004c57806354fd4d50146101cb578063ac9d4104146101ee578063cb2ef6f71461020d578063dc4c90d314610240575f80fd5b806312261ee71461011557806335a9e4df146101655780633fc8cef314610198575f80fd5b3661011157336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015906100d85750336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614155b1561010f576040517fd27d0c4d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b005b5f80fd5b348015610120575f80fd5b506101487f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b348015610170575f80fd5b506101487f000000000000000000000000000000000000000000000000000000000000000081565b3480156101a3575f80fd5b506101487f000000000000000000000000000000000000000000000000000000000000000081565b3480156101d6575f80fd5b506101e061013681565b60405190815260200161015c565b3480156101f9575f80fd5b506101e06102083660046111c5565b610273565b348015610218575f80fd5b506101e07f474154455741593a3a554e49535741505f56340000000000000000000000000081565b34801561024b575f80fd5b506101487f000000000000000000000000000000000000000000000000000000000000000081565b5f808661028f5761028a6040890160208a01611292565b61029c565b61029c6020890189611292565b90505f876102b6576102b160208a018a611292565b6102c6565b6102c660408a0160208b01611292565b90506102dc8233896001600160801b0316610328565b96505f806102fc6102f2368d90038d018d6112bc565b8b8b8b8b8b61061b565b9150915061030d828286868d6108ee565b945061031a833387610b7e565b505050509695505050505050565b5f6001600160a01b03841661051f576040516370a0823160e01b81523060048201525f907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa15801561039b573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103bf919061135d565b90506103f66001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016853086610c4c565b6040516370a0823160e01b815230600482015281907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa15801561045a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061047e919061135d565b6104889190611374565b6040517f2e1a7d4d000000000000000000000000000000000000000000000000000000008152600481018290529092507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632e1a7d4d906024015f604051808303815f87803b158015610503575f80fd5b505af1158015610515573d5f803e3d5ffd5b5050505050610614565b6040516370a0823160e01b81523060048201525f906001600160a01b038616906370a0823190602401602060405180830381865afa158015610563573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610587919061135d565b905061059e6001600160a01b038616853086610c4c565b6040516370a0823160e01b815230600482015281906001600160a01b038716906370a0823190602401602060405180830381865afa1580156105e2573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610606919061135d565b6106109190611374565b9150505b9392505050565b6040517f10000000000000000000000000000000000000000000000000000000000000006020820152606090819060210160408051808303601f1901815260018084528383019092529350816020015b606081526020019060019003908161066b575050604080517f060000000000000000000000000000000000000000000000000000000000000060208201527f0c0000000000000000000000000000000000000000000000000000000000000060218201527f0f00000000000000000000000000000000000000000000000000000000000000602282015281516003818303810182526023830181815260a38401909452939450925f92916043015b60608152602001906001900390816107195790505090506040518060a001604052808b81526020018a15158152602001896001600160801b03168152602001886001600160801b0316815260200187878080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525050509152506040516107ae91906020016113e0565b604051602081830303815290604052815f815181106107cf576107cf61147d565b6020026020010181905250886107e95789602001516107ec565b89515b604080516001600160a01b0390921660208301526001600160801b038a1690820152606001604051602081830303815290604052816001815181106108335761083361147d565b60200260200101819052508861084a578951610850565b89602001515b604080516001600160a01b0390921660208301526001600160801b03891690820152606001604051602081830303815290604052816002815181106108975761089761147d565b602002602001018190525081816040516020016108b5929190611491565b604051602081830303815290604052835f815181106108d6576108d661147d565b60200260200101819052505050965096945050505050565b5f6001600160a01b0384166109ab575f61090784610d03565b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166324856bc3846001600160801b031689896040518463ffffffff1660e01b8152600401610961929190611491565b5f604051808303818588803b158015610978575f80fd5b505af115801561098a573d5f803e3d5ffd5b50505050508061099985610d03565b6109a39190611374565b915050610b75565b6109e86001600160a01b0385167f00000000000000000000000000000000000000000000000000000000000000006001600160801b038516610d8a565b6040517f87517c450000000000000000000000000000000000000000000000000000000081526001600160a01b0385811660048301527f0000000000000000000000000000000000000000000000000000000000000000811660248301526001600160801b038416604483015265ffffffffffff421660648301527f000000000000000000000000000000000000000000000000000000000000000016906387517c45906084015f604051808303815f87803b158015610aa6575f80fd5b505af1158015610ab8573d5f803e3d5ffd5b505050505f610ac684610d03565b6040517f24856bc30000000000000000000000000000000000000000000000000000000081529091506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906324856bc390610b30908a908a90600401611491565b5f604051808303815f87803b158015610b47575f80fd5b505af1158015610b59573d5f803e3d5ffd5b5050505080610b6785610d03565b610b719190611374565b9150505b95945050505050565b6001600160a01b038316610c38577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004015f604051808303818588803b158015610be5575f80fd5b505af1158015610bf7573d5f803e3d5ffd5b50610c339350506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016915084905083610e2d565b505050565b610c336001600160a01b0384168383610e2d565b6040516001600160a01b0380851660248301528316604482015260648101829052610cfd9085907f23b872dd00000000000000000000000000000000000000000000000000000000906084015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152610e76565b50505050565b5f6001600160a01b038216610d19575047919050565b6040516370a0823160e01b81523060048201526001600160a01b038316906370a0823190602401602060405180830381865afa158015610d5b573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610d7f919061135d565b92915050565b919050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1663095ea7b360e01b179052610df08482610f61565b610cfd576040516001600160a01b03841660248201525f6044820152610e2390859063095ea7b360e01b90606401610c99565b610cfd8482610e76565b6040516001600160a01b038316602482015260448101829052610c339084907fa9059cbb0000000000000000000000000000000000000000000000000000000090606401610c99565b5f610eca826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610ffe9092919063ffffffff16565b905080515f1480610eea575080806020019051810190610eea9190611501565b610c335760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b5f805f846001600160a01b031684604051610f7c919061151c565b5f604051808303815f865af19150503d805f8114610fb5576040519150601f19603f3d011682016040523d82523d5f602084013e610fba565b606091505b5091509150818015610fe4575080511580610fe4575080806020019051810190610fe49190611501565b8015610b755750505050506001600160a01b03163b151590565b606061100c84845f85611014565b949350505050565b60608247101561108c5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610f58565b5f80866001600160a01b031685876040516110a7919061151c565b5f6040518083038185875af1925050503d805f81146110e1576040519150601f19603f3d011682016040523d82523d5f602084013e6110e6565b606091505b50915091506110f787838387611102565b979650505050505050565b606083156111705782515f03611169576001600160a01b0385163b6111695760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610f58565b508161100c565b61100c83838151156111855781518083602001fd5b8060405162461bcd60e51b8152600401610f589190611537565b80151581146111ac575f80fd5b50565b80356001600160801b0381168114610d85575f80fd5b5f805f805f808688036101208112156111dc575f80fd5b60a08112156111e9575f80fd5b5086955060a08701356111fb8161119f565b945061120960c088016111af565b935061121760e088016111af565b925061010087013567ffffffffffffffff80821115611234575f80fd5b818901915089601f830112611247575f80fd5b813581811115611255575f80fd5b8a6020828501011115611266575f80fd5b6020830194508093505050509295509295509295565b80356001600160a01b0381168114610d85575f80fd5b5f602082840312156112a2575f80fd5b6106148261127c565b8035600281900b8114610d85575f80fd5b5f60a082840312156112cc575f80fd5b60405160a0810181811067ffffffffffffffff821117156112fb57634e487b7160e01b5f52604160045260245ffd5b6040526113078361127c565b81526113156020840161127c565b6020820152604083013562ffffff8116811461132f575f80fd5b6040820152611340606084016112ab565b60608201526113516080840161127c565b60808201529392505050565b5f6020828403121561136d575f80fd5b5051919050565b81810381811115610d7f57634e487b7160e01b5f52601160045260245ffd5b5f5b838110156113ad578181015183820152602001611395565b50505f910152565b5f81518084526113cc816020860160208601611393565b601f01601f19169290920160200192915050565b602081525f82516001600160a01b0380825116602085015280602083015116604085015262ffffff6040830151166060850152606082015160020b60808501528060808301511660a08501525050602083015161144160c084018215159052565b5060408301516001600160801b0390811660e084015260608401511661010083015260808301516101208084015261100c6101408401826113b5565b634e487b7160e01b5f52603260045260245ffd5b604081525f6114a360408301856113b5565b6020838203818501528185518084528284019150828160051b8501018388015f5b838110156114f257601f198784030185526114e08383516113b5565b948601949250908501906001016114c4565b50909998505050505050505050565b5f60208284031215611511575f80fd5b81516106148161119f565b5f825161152d818460208701611393565b9190910192915050565b602081525f61061460208301846113b556fea164736f6c6343000817000a0000000000000000000000000d97dc33264bfc1c226207428a79b26757fb9dc3000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba30000000000000000000000003bd359c1119da7da1d913d1c4d2b7c461115433a

Deployed Bytecode

0x608060405260043610610071575f3560e01c806354fd4d501161004c57806354fd4d50146101cb578063ac9d4104146101ee578063cb2ef6f71461020d578063dc4c90d314610240575f80fd5b806312261ee71461011557806335a9e4df146101655780633fc8cef314610198575f80fd5b3661011157336001600160a01b037f000000000000000000000000188d586ddcf52439676ca21a244753fa19f9ea8e16148015906100d85750336001600160a01b037f0000000000000000000000003bd359c1119da7da1d913d1c4d2b7c461115433a1614155b1561010f576040517fd27d0c4d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b005b5f80fd5b348015610120575f80fd5b506101487f000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba381565b6040516001600160a01b0390911681526020015b60405180910390f35b348015610170575f80fd5b506101487f0000000000000000000000000d97dc33264bfc1c226207428a79b26757fb9dc381565b3480156101a3575f80fd5b506101487f0000000000000000000000003bd359c1119da7da1d913d1c4d2b7c461115433a81565b3480156101d6575f80fd5b506101e061013681565b60405190815260200161015c565b3480156101f9575f80fd5b506101e06102083660046111c5565b610273565b348015610218575f80fd5b506101e07f474154455741593a3a554e49535741505f56340000000000000000000000000081565b34801561024b575f80fd5b506101487f000000000000000000000000188d586ddcf52439676ca21a244753fa19f9ea8e81565b5f808661028f5761028a6040890160208a01611292565b61029c565b61029c6020890189611292565b90505f876102b6576102b160208a018a611292565b6102c6565b6102c660408a0160208b01611292565b90506102dc8233896001600160801b0316610328565b96505f806102fc6102f2368d90038d018d6112bc565b8b8b8b8b8b61061b565b9150915061030d828286868d6108ee565b945061031a833387610b7e565b505050509695505050505050565b5f6001600160a01b03841661051f576040516370a0823160e01b81523060048201525f907f0000000000000000000000003bd359c1119da7da1d913d1c4d2b7c461115433a6001600160a01b0316906370a0823190602401602060405180830381865afa15801561039b573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103bf919061135d565b90506103f66001600160a01b037f0000000000000000000000003bd359c1119da7da1d913d1c4d2b7c461115433a16853086610c4c565b6040516370a0823160e01b815230600482015281907f0000000000000000000000003bd359c1119da7da1d913d1c4d2b7c461115433a6001600160a01b0316906370a0823190602401602060405180830381865afa15801561045a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061047e919061135d565b6104889190611374565b6040517f2e1a7d4d000000000000000000000000000000000000000000000000000000008152600481018290529092507f0000000000000000000000003bd359c1119da7da1d913d1c4d2b7c461115433a6001600160a01b031690632e1a7d4d906024015f604051808303815f87803b158015610503575f80fd5b505af1158015610515573d5f803e3d5ffd5b5050505050610614565b6040516370a0823160e01b81523060048201525f906001600160a01b038616906370a0823190602401602060405180830381865afa158015610563573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610587919061135d565b905061059e6001600160a01b038616853086610c4c565b6040516370a0823160e01b815230600482015281906001600160a01b038716906370a0823190602401602060405180830381865afa1580156105e2573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610606919061135d565b6106109190611374565b9150505b9392505050565b6040517f10000000000000000000000000000000000000000000000000000000000000006020820152606090819060210160408051808303601f1901815260018084528383019092529350816020015b606081526020019060019003908161066b575050604080517f060000000000000000000000000000000000000000000000000000000000000060208201527f0c0000000000000000000000000000000000000000000000000000000000000060218201527f0f00000000000000000000000000000000000000000000000000000000000000602282015281516003818303810182526023830181815260a38401909452939450925f92916043015b60608152602001906001900390816107195790505090506040518060a001604052808b81526020018a15158152602001896001600160801b03168152602001886001600160801b0316815260200187878080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525050509152506040516107ae91906020016113e0565b604051602081830303815290604052815f815181106107cf576107cf61147d565b6020026020010181905250886107e95789602001516107ec565b89515b604080516001600160a01b0390921660208301526001600160801b038a1690820152606001604051602081830303815290604052816001815181106108335761083361147d565b60200260200101819052508861084a578951610850565b89602001515b604080516001600160a01b0390921660208301526001600160801b03891690820152606001604051602081830303815290604052816002815181106108975761089761147d565b602002602001018190525081816040516020016108b5929190611491565b604051602081830303815290604052835f815181106108d6576108d661147d565b60200260200101819052505050965096945050505050565b5f6001600160a01b0384166109ab575f61090784610d03565b90507f0000000000000000000000000d97dc33264bfc1c226207428a79b26757fb9dc36001600160a01b03166324856bc3846001600160801b031689896040518463ffffffff1660e01b8152600401610961929190611491565b5f604051808303818588803b158015610978575f80fd5b505af115801561098a573d5f803e3d5ffd5b50505050508061099985610d03565b6109a39190611374565b915050610b75565b6109e86001600160a01b0385167f000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba36001600160801b038516610d8a565b6040517f87517c450000000000000000000000000000000000000000000000000000000081526001600160a01b0385811660048301527f0000000000000000000000000d97dc33264bfc1c226207428a79b26757fb9dc3811660248301526001600160801b038416604483015265ffffffffffff421660648301527f000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba316906387517c45906084015f604051808303815f87803b158015610aa6575f80fd5b505af1158015610ab8573d5f803e3d5ffd5b505050505f610ac684610d03565b6040517f24856bc30000000000000000000000000000000000000000000000000000000081529091506001600160a01b037f0000000000000000000000000d97dc33264bfc1c226207428a79b26757fb9dc316906324856bc390610b30908a908a90600401611491565b5f604051808303815f87803b158015610b47575f80fd5b505af1158015610b59573d5f803e3d5ffd5b5050505080610b6785610d03565b610b719190611374565b9150505b95945050505050565b6001600160a01b038316610c38577f0000000000000000000000003bd359c1119da7da1d913d1c4d2b7c461115433a6001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004015f604051808303818588803b158015610be5575f80fd5b505af1158015610bf7573d5f803e3d5ffd5b50610c339350506001600160a01b037f0000000000000000000000003bd359c1119da7da1d913d1c4d2b7c461115433a16915084905083610e2d565b505050565b610c336001600160a01b0384168383610e2d565b6040516001600160a01b0380851660248301528316604482015260648101829052610cfd9085907f23b872dd00000000000000000000000000000000000000000000000000000000906084015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152610e76565b50505050565b5f6001600160a01b038216610d19575047919050565b6040516370a0823160e01b81523060048201526001600160a01b038316906370a0823190602401602060405180830381865afa158015610d5b573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610d7f919061135d565b92915050565b919050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1663095ea7b360e01b179052610df08482610f61565b610cfd576040516001600160a01b03841660248201525f6044820152610e2390859063095ea7b360e01b90606401610c99565b610cfd8482610e76565b6040516001600160a01b038316602482015260448101829052610c339084907fa9059cbb0000000000000000000000000000000000000000000000000000000090606401610c99565b5f610eca826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610ffe9092919063ffffffff16565b905080515f1480610eea575080806020019051810190610eea9190611501565b610c335760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b5f805f846001600160a01b031684604051610f7c919061151c565b5f604051808303815f865af19150503d805f8114610fb5576040519150601f19603f3d011682016040523d82523d5f602084013e610fba565b606091505b5091509150818015610fe4575080511580610fe4575080806020019051810190610fe49190611501565b8015610b755750505050506001600160a01b03163b151590565b606061100c84845f85611014565b949350505050565b60608247101561108c5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610f58565b5f80866001600160a01b031685876040516110a7919061151c565b5f6040518083038185875af1925050503d805f81146110e1576040519150601f19603f3d011682016040523d82523d5f602084013e6110e6565b606091505b50915091506110f787838387611102565b979650505050505050565b606083156111705782515f03611169576001600160a01b0385163b6111695760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610f58565b508161100c565b61100c83838151156111855781518083602001fd5b8060405162461bcd60e51b8152600401610f589190611537565b80151581146111ac575f80fd5b50565b80356001600160801b0381168114610d85575f80fd5b5f805f805f808688036101208112156111dc575f80fd5b60a08112156111e9575f80fd5b5086955060a08701356111fb8161119f565b945061120960c088016111af565b935061121760e088016111af565b925061010087013567ffffffffffffffff80821115611234575f80fd5b818901915089601f830112611247575f80fd5b813581811115611255575f80fd5b8a6020828501011115611266575f80fd5b6020830194508093505050509295509295509295565b80356001600160a01b0381168114610d85575f80fd5b5f602082840312156112a2575f80fd5b6106148261127c565b8035600281900b8114610d85575f80fd5b5f60a082840312156112cc575f80fd5b60405160a0810181811067ffffffffffffffff821117156112fb57634e487b7160e01b5f52604160045260245ffd5b6040526113078361127c565b81526113156020840161127c565b6020820152604083013562ffffff8116811461132f575f80fd5b6040820152611340606084016112ab565b60608201526113516080840161127c565b60808201529392505050565b5f6020828403121561136d575f80fd5b5051919050565b81810381811115610d7f57634e487b7160e01b5f52601160045260245ffd5b5f5b838110156113ad578181015183820152602001611395565b50505f910152565b5f81518084526113cc816020860160208601611393565b601f01601f19169290920160200192915050565b602081525f82516001600160a01b0380825116602085015280602083015116604085015262ffffff6040830151166060850152606082015160020b60808501528060808301511660a08501525050602083015161144160c084018215159052565b5060408301516001600160801b0390811660e084015260608401511661010083015260808301516101208084015261100c6101408401826113b5565b634e487b7160e01b5f52603260045260245ffd5b604081525f6114a360408301856113b5565b6020838203818501528185518084528284019150828160051b8501018388015f5b838110156114f257601f198784030185526114e08383516113b5565b948601949250908501906001016114c4565b50909998505050505050505050565b5f60208284031215611511575f80fd5b81516106148161119f565b5f825161152d818460208701611393565b9190910192915050565b602081525f61061460208301846113b556fea164736f6c6343000817000a

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

0000000000000000000000000d97dc33264bfc1c226207428a79b26757fb9dc3000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba30000000000000000000000003bd359c1119da7da1d913d1c4d2b7c461115433a

-----Decoded View---------------
Arg [0] : _universalRouter (address): 0x0D97Dc33264bfC1c226207428A79b26757fb9dc3
Arg [1] : _permit2 (address): 0x000000000022D473030F116dDEE9F6B43aC78BA3
Arg [2] : _weth (address): 0x3bd359C1119dA7Da1D913D1C4D2B7c461115433A

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000000d97dc33264bfc1c226207428a79b26757fb9dc3
Arg [1] : 000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3
Arg [2] : 0000000000000000000000003bd359c1119da7da1d913d1c4d2b7c461115433a


Block Transaction Gas Used Reward
view all blocks produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ 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.