ETH Price: $4,521.62 (+1.61%)

Contract

0xc6a85231F6F67d7Bf89f0B2e0C8Fe3Cc7c82Fe3b

Overview

ETH Balance

0 ETH

ETH Value

$0.00

More Info

Private Name Tags

Multichain Info

N/A
Transaction Hash
Method
Block
From
To

There are no matching entries

> 10 Internal Transactions and > 10 Token Transfers found.

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
132196042025-10-08 22:26:5551 mins ago1759962415
0xc6a85231...c7c82Fe3b
0.0097755 ETH
132196042025-10-08 22:26:5551 mins ago1759962415
0xc6a85231...c7c82Fe3b
0.0097755 ETH
132195292025-10-08 22:25:4052 mins ago1759962340
0xc6a85231...c7c82Fe3b
0.009975 ETH
132195292025-10-08 22:25:4052 mins ago1759962340
0xc6a85231...c7c82Fe3b
0.009975 ETH
132194572025-10-08 22:24:2853 mins ago1759962268
0xc6a85231...c7c82Fe3b
0.013965 ETH
132194572025-10-08 22:24:2853 mins ago1759962268
0xc6a85231...c7c82Fe3b
0.013965 ETH
132193892025-10-08 22:23:2054 mins ago1759962200
0xc6a85231...c7c82Fe3b
0.02380923 ETH
132193892025-10-08 22:23:2054 mins ago1759962200
0xc6a85231...c7c82Fe3b
0.02380923 ETH
132191612025-10-08 22:19:3258 mins ago1759961972
0xc6a85231...c7c82Fe3b
0.012768 ETH
132191612025-10-08 22:19:3258 mins ago1759961972
0xc6a85231...c7c82Fe3b
0.012768 ETH
132190372025-10-08 22:17:281 hr ago1759961848
0xc6a85231...c7c82Fe3b
0.01199742 ETH
132190372025-10-08 22:17:281 hr ago1759961848
0xc6a85231...c7c82Fe3b
0.01199742 ETH
132189272025-10-08 22:15:381 hr ago1759961738
0xc6a85231...c7c82Fe3b
0.0229425 ETH
132189272025-10-08 22:15:381 hr ago1759961738
0xc6a85231...c7c82Fe3b
0.0229425 ETH
132188632025-10-08 22:14:341 hr ago1759961674
0xc6a85231...c7c82Fe3b
0.02294722 ETH
132188632025-10-08 22:14:341 hr ago1759961674
0xc6a85231...c7c82Fe3b
0.02294722 ETH
132187032025-10-08 22:11:541 hr ago1759961514
0xc6a85231...c7c82Fe3b
0.00099246 ETH
132187032025-10-08 22:11:541 hr ago1759961514
0xc6a85231...c7c82Fe3b
0.00099246 ETH
132182012025-10-08 22:03:321 hr ago1759961012
0xc6a85231...c7c82Fe3b
0.00022117 ETH
132182012025-10-08 22:03:321 hr ago1759961012
0xc6a85231...c7c82Fe3b
0.00022117 ETH
132174312025-10-08 21:50:421 hr ago1759960242
0xc6a85231...c7c82Fe3b
0.00008822 ETH
132174312025-10-08 21:50:421 hr ago1759960242
0xc6a85231...c7c82Fe3b
0.00008822 ETH
132168352025-10-08 21:40:461 hr ago1759959646
0xc6a85231...c7c82Fe3b
0.00084787 ETH
132168352025-10-08 21:40:461 hr ago1759959646
0xc6a85231...c7c82Fe3b
0.00084787 ETH
132166142025-10-08 21:37:051 hr ago1759959425
0xc6a85231...c7c82Fe3b
0.00088068 ETH
View All Internal Transactions

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SwapHelpers

Compiler Version
v0.8.28+commit.7893614a

Optimization Enabled:
Yes with 200 runs

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

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

/**
 * @notice Helper contract to update swap data on-chain
 */
contract SwapHelpers {
    using SafeERC20 for IERC20;

    uint256 public constant VERSION = 5;
    IERC20 private constant _ETH = IERC20(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE);

    error IncorrectValue(uint256 expected, uint256 actual);
    error TransferFailed(address receiver);

    function swapWithLimit(
        address primary,
        address operator,
        IERC20 tokenIn,
        IERC20 tokenOut,
        uint256 amountIn,
        uint256 maxAmountOut,
        address receiver,
        address feeReceiver,
        bytes memory data,
        uint256[] memory pointers
    )
        public
        payable
        returns (uint256 amountOut)
    {
        uint256 balanceBefore = _balance(tokenOut, receiver);
        _swap(primary, operator, tokenIn, amountIn, data, pointers);
        amountOut = _balance(tokenOut, address(this));
        if (maxAmountOut > 0 && amountOut > maxAmountOut) {
            uint256 fee = amountOut - maxAmountOut;
            _transfer(tokenOut, feeReceiver, fee);
            amountOut = maxAmountOut;
        }
        _transfer(tokenOut, receiver, amountOut);
        uint256 balanceAfter = _balance(tokenOut, receiver);
        amountOut = balanceAfter - balanceBefore;
    }

    function swap(
        address primary,
        address operator,
        IERC20 tokenIn,
        IERC20 tokenOut,
        uint256 amountIn,
        address receiver,
        bytes memory data,
        uint256[] memory pointers
    )
        public
        payable
        returns (uint256 amountOut)
    {
        uint256 balanceBefore = _balance(tokenOut, receiver);
        _swap(primary, operator, tokenIn, amountIn, data, pointers);
        _transfer(tokenOut, receiver, _balance(tokenOut, address(this)));
        uint256 balanceAfter = _balance(tokenOut, receiver);
        amountOut = balanceAfter - balanceBefore;
    }

    function swap(
        address primary,
        IERC20 tokenIn,
        IERC20 tokenOut,
        uint256 amountIn,
        address receiver,
        bytes memory data,
        uint256[] memory pointers
    )
        external
        payable
        returns (uint256)
    {
        return swap(primary, primary, tokenIn, tokenOut, amountIn, receiver, data, pointers);
    }

    function insertAmount(
        bytes memory data,
        uint256[] memory pointers,
        uint256 amount
    )
        public
        pure
        returns (bytes memory)
    {
        uint256 length = pointers.length;
        assembly {
            for { let i := 0 } lt(i, length) { i := add(i, 1) } {
                let pointer := mload(add(pointers, mul(32, add(i, 1))))
                mstore(add(data, add(36, pointer)), amount)
            }
        }
        return data;
    }

    function _swap(
        address primary,
        address operator,
        IERC20 tokenIn,
        uint256 amountIn,
        bytes memory data,
        uint256[] memory pointers
    )
        internal
    {
        if (pointers.length != 0) insertAmount(data, pointers, amountIn);
        if (tokenIn == _ETH) {
            if (msg.value != amountIn) revert IncorrectValue(amountIn, msg.value);
        } else {
            if (msg.value != 0) revert IncorrectValue(0, msg.value);
            tokenIn.safeTransferFrom(msg.sender, address(this), amountIn);
            tokenIn.forceApprove(operator, amountIn);
        }
        (bool success, bytes memory response) = primary.call{ value: msg.value }(data);
        if (!success) {
            assembly {
                revert(add(response, 0x20), mload(response))
            }
        }
    }
    
    function _transfer(
        IERC20 token,
        address receiver,
        uint256 amount
    )
        internal
    {
        if (token == _ETH) {
            (bool success,) = receiver.call{ value: amount }("");
            if (!success) revert TransferFailed(receiver);
        } else {
            token.safeTransfer(receiver, amount);
        }
    }

    function _balance(
        IERC20 token,
        address account
    )
        internal
        view
        returns (uint256 balance)
    {
        balance = token == _ETH
            ? account.balance
            : token.balanceOf(account);
    }

    receive() external payable { }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol)

pragma solidity ^0.8.20;

import {IERC20} from "./IERC20.sol";
import {IERC165} from "./IERC165.sol";

/**
 * @title IERC1363
 * @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].
 *
 * Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract
 * after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.
 */
interface IERC1363 is IERC20, IERC165 {
    /*
     * Note: the ERC-165 identifier for this interface is 0xb0202a11.
     * 0xb0202a11 ===
     *   bytes4(keccak256('transferAndCall(address,uint256)')) ^
     *   bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
     *   bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
     *   bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^
     *   bytes4(keccak256('approveAndCall(address,uint256)')) ^
     *   bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
     */

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferAndCall(address to, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @param data Additional data with no specified format, sent in call to `to`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param from The address which you want to send tokens from.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferFromAndCall(address from, address to, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param from The address which you want to send tokens from.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @param data Additional data with no specified format, sent in call to `to`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
     * @param spender The address which will spend the funds.
     * @param value The amount of tokens to be spent.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function approveAndCall(address spender, uint256 value) external returns (bool);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
     * @param spender The address which will spend the funds.
     * @param value The amount of tokens to be spent.
     * @param data Additional data with no specified format, sent in call to `spender`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);
}

File 3 of 7 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)

pragma solidity ^0.8.20;

import {IERC165} from "../utils/introspection/IERC165.sol";

File 4 of 7 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)

pragma solidity ^0.8.20;

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

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

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC-20 standard as defined in the ERC.
 */
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.2.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";
import {IERC1363} from "../../../interfaces/IERC1363.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC-20 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 {
    /**
     * @dev An operation with an ERC-20 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.
     *
     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
     * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
     */
    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.
     *
     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
     * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
     */
    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.
     *
     * NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function
     * only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being
     * set here.
     */
    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 Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no
     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * Reverts if the returned value is other than `true`.
     */
    function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
        if (to.code.length == 0) {
            safeTransfer(token, to, value);
        } else if (!token.transferAndCall(to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target
     * has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * Reverts if the returned value is other than `true`.
     */
    function transferFromAndCallRelaxed(
        IERC1363 token,
        address from,
        address to,
        uint256 value,
        bytes memory data
    ) internal {
        if (to.code.length == 0) {
            safeTransferFrom(token, from, to, value);
        } else if (!token.transferFromAndCall(from, to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no
     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.
     * Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}
     * once without retrying, and relies on the returned value to be true.
     *
     * Reverts if the returned value is other than `true`.
     */
    function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
        if (to.code.length == 0) {
            forceApprove(token, to, value);
        } else if (!token.approveAndCall(to, value, data)) {
            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 {_callOptionalReturnBool} that reverts if call fails to meet the requirements.
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        uint256 returnSize;
        uint256 returnValue;
        assembly ("memory-safe") {
            let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
            // bubble errors
            if iszero(success) {
                let ptr := mload(0x40)
                returndatacopy(ptr, 0, returndatasize())
                revert(ptr, returndatasize())
            }
            returnSize := returndatasize()
            returnValue := mload(0)
        }

        if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {
            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 silently catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        bool success;
        uint256 returnSize;
        uint256 returnValue;
        assembly ("memory-safe") {
            success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
            returnSize := returndatasize()
            returnValue := mload(0)
        }
        return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC-165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[ERC].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

Settings
{
  "evmVersion": "cancun",
  "libraries": {},
  "metadata": {
    "appendCBOR": false,
    "bytecodeHash": "none",
    "useLiteralContent": false
  },
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "remappings": [
    "@layerzerolabs/oapp-evm/=lib/devtools/packages/oapp-evm/",
    "@layerzerolabs/lz-evm-protocol-v2/=lib/layerzero-v2/packages/layerzero-v2/evm/protocol/",
    "@layerzerolabs/lz-evm-oapp-v2/=lib/layerzero-v2/packages/layerzero-v2/evm/oapp/",
    "@uniswap/v4-core/=lib/v4-core/",
    "@uniswap/v4-periphery/=lib/v4-periphery/",
    "devtools/=lib/devtools/packages/toolbox-foundry/src/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "enso-weiroll/=lib/enso-weiroll/contracts/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
    "layerzero-v2/=lib/layerzero-v2/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/",
    "safe-contracts/=lib/safe-tools/lib/safe-contracts/contracts/",
    "safe-tools/=lib/safe-tools/src/",
    "solady/=lib/solady/src/",
    "solmate/=lib/solady/lib/solmate/src/",
    "@ensdomains/=lib/v4-core/node_modules/@ensdomains/",
    "@openzeppelin/=lib/v4-core/lib/openzeppelin-contracts/",
    "forge-gas-snapshot/=lib/v4-periphery/lib/permit2/lib/forge-gas-snapshot/src/",
    "hardhat/=lib/v4-core/node_modules/hardhat/",
    "permit2/=lib/v4-periphery/lib/permit2/",
    "v4-core/=lib/v4-core/src/",
    "v4-periphery/=lib/v4-periphery/"
  ],
  "viaIR": true
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"uint256","name":"expected","type":"uint256"},{"internalType":"uint256","name":"actual","type":"uint256"}],"name":"IncorrectValue","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"TransferFailed","type":"error"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"uint256[]","name":"pointers","type":"uint256[]"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"insertAmount","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"primary","type":"address"},{"internalType":"address","name":"operator","type":"address"},{"internalType":"contract IERC20","name":"tokenIn","type":"address"},{"internalType":"contract IERC20","name":"tokenOut","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"uint256[]","name":"pointers","type":"uint256[]"}],"name":"swap","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"primary","type":"address"},{"internalType":"contract IERC20","name":"tokenIn","type":"address"},{"internalType":"contract IERC20","name":"tokenOut","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"uint256[]","name":"pointers","type":"uint256[]"}],"name":"swap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"primary","type":"address"},{"internalType":"address","name":"operator","type":"address"},{"internalType":"contract IERC20","name":"tokenIn","type":"address"},{"internalType":"contract IERC20","name":"tokenOut","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"maxAmountOut","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"feeReceiver","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"uint256[]","name":"pointers","type":"uint256[]"}],"name":"swapWithLimit","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}]

608080604052346015576108ee908161001a8239f35b5f80fdfe6080604052600436101561001a575b3615610018575f80fd5b005b5f3560e01c806301f9f42314610069578063346387bf146100645780637cbb0c4f1461005f57806383d1eb841461005a5763ffa1ad740361000e57610430565b61039f565b610310565b610270565b6101003660031901126101135760043561008281610117565b6024359061008f82610117565b6044359061009c82610117565b6100a4610151565b6084356100af610128565b9060c43567ffffffffffffffff8111610113576100d09036906004016101c2565b9260e4359567ffffffffffffffff87116101135761010f976100f96100ff983690600401610208565b9661046c565b6040519081529081906020820190565b0390f35b5f80fd5b6001600160a01b0381160361011357565b60a4359061013582610117565b565b60c4359061013582610117565b60e4359061013582610117565b6064359061013582610117565b6044359061013582610117565b634e487b7160e01b5f52604160045260245ffd5b90601f8019910116810190811067ffffffffffffffff8211176101a157604052565b61016b565b67ffffffffffffffff81116101a157601f01601f191660200190565b81601f82011215610113578035906101d9826101a6565b926101e7604051948561017f565b8284526020838301011161011357815f926020809301838601378301015290565b9080601f830112156101135781359167ffffffffffffffff83116101a1578260051b906040519361023c602084018661017f565b845260208085019282010192831161011357602001905b8282106102605750505090565b8135815260209182019101610253565b6101403660031901126101135760043561028981610117565b6024359061029682610117565b61029e61015e565b906102a7610151565b60843560a4356102b5610137565b906102be610144565b926101043567ffffffffffffffff8111610113576102e09036906004016101c2565b94610124359767ffffffffffffffff89116101135761010f9961030a6100ff9a3690600401610208565b986104ac565b346101135760603660031901126101135760043567ffffffffffffffff8111610113576103419036906004016101c2565b6024359067ffffffffffffffff82116101135761037360409161036a6020943690600401610208565b60443591610518565b815192839181835280519182918282860152018484015e5f828201840152601f01601f19168101030190f35b60e0366003190112610113576004356103b781610117565b602435906103c482610117565b604435906103d182610117565b6064356084356103e081610117565b60a43567ffffffffffffffff8111610113576104009036906004016101c2565b9160c4359467ffffffffffffffff86116101135761010f966104296100ff973690600401610208565b958061046c565b34610113575f36600319011261011357602060405160058152f35b9190820391821161045857565b634e487b7160e01b5f52601160045260245ffd5b956104a4959461048b936104a999936104858888610544565b99610610565b61049f6104983083610544565b83836106df565b610544565b61044b565b90565b97986104a99961049f956104a4999597946104d1946104cb8b8b610544565b9c610610565b6104db3085610544565b918115158061050f575b6104f3575b505083836106df565b61050182610508939461044b565b90856106df565b5f806104ea565b508183116104e5565b918151915f5b83811061052c575050505090565b600101600581901b820151850160240183905261051e565b6001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee810361056d57503190565b6040516370a0823160e01b81526001600160a01b039092166004830152602090829060249082905afa9081156105d6575f916105a7575090565b90506020813d6020116105ce575b816105c26020938361017f565b81010312610113575190565b3d91506105b5565b6040513d5f823e3d90fd5b3d1561060b573d906105f2826101a6565b91610600604051938461017f565b82523d5f602084013e565b606090565b93949190918381516106cd575b50506001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0361068c57505080340361067657505f9182915b6020825192019034905af16106656105e1565b901561066e5750565b602081519101fd5b635928816d60e11b5f526004523460245260445ffd5b939193929092346106b5575f9485946106b0926106ab83303384610782565b6107c6565b610652565b635928816d60e11b5f9081526004523460245260445ffd5b6106d79187610518565b505f8361061d565b9091906001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0361074057505f80808093855af16107176105e1565b50156107205750565b6339f1c8d960e01b5f9081526001600160a01b0391909116600452602490fd5b60405163a9059cbb60e01b60208201526001600160a01b03939093166024840152604480840192909252908252610135919061077d60648361017f565b610896565b6040516323b872dd60e01b60208201526001600160a01b0392831660248201529290911660448301526064808301939093529181526101359161077d60848361017f565b60405163095ea7b360e01b60208083019182526001600160a01b0385166024840152604480840196909652948252929390925f9061080560648661017f565b84519082855af15f51903d8161086a575b501590505b61082457505050565b60405163095ea7b360e01b60208201526001600160a01b039390931660248401525f60448085019190915283526101359261077d9061086460648261017f565b82610896565b1515905061088a575061081b6001600160a01b0382163b15155b5f610816565b600161081b9114610884565b905f602091828151910182855af1156105d6575f513d6108e557506001600160a01b0381163b155b6108c55750565b635274afe760e01b5f9081526001600160a01b0391909116600452602490fd5b600114156108be56

Deployed Bytecode

0x6080604052600436101561001a575b3615610018575f80fd5b005b5f3560e01c806301f9f42314610069578063346387bf146100645780637cbb0c4f1461005f57806383d1eb841461005a5763ffa1ad740361000e57610430565b61039f565b610310565b610270565b6101003660031901126101135760043561008281610117565b6024359061008f82610117565b6044359061009c82610117565b6100a4610151565b6084356100af610128565b9060c43567ffffffffffffffff8111610113576100d09036906004016101c2565b9260e4359567ffffffffffffffff87116101135761010f976100f96100ff983690600401610208565b9661046c565b6040519081529081906020820190565b0390f35b5f80fd5b6001600160a01b0381160361011357565b60a4359061013582610117565b565b60c4359061013582610117565b60e4359061013582610117565b6064359061013582610117565b6044359061013582610117565b634e487b7160e01b5f52604160045260245ffd5b90601f8019910116810190811067ffffffffffffffff8211176101a157604052565b61016b565b67ffffffffffffffff81116101a157601f01601f191660200190565b81601f82011215610113578035906101d9826101a6565b926101e7604051948561017f565b8284526020838301011161011357815f926020809301838601378301015290565b9080601f830112156101135781359167ffffffffffffffff83116101a1578260051b906040519361023c602084018661017f565b845260208085019282010192831161011357602001905b8282106102605750505090565b8135815260209182019101610253565b6101403660031901126101135760043561028981610117565b6024359061029682610117565b61029e61015e565b906102a7610151565b60843560a4356102b5610137565b906102be610144565b926101043567ffffffffffffffff8111610113576102e09036906004016101c2565b94610124359767ffffffffffffffff89116101135761010f9961030a6100ff9a3690600401610208565b986104ac565b346101135760603660031901126101135760043567ffffffffffffffff8111610113576103419036906004016101c2565b6024359067ffffffffffffffff82116101135761037360409161036a6020943690600401610208565b60443591610518565b815192839181835280519182918282860152018484015e5f828201840152601f01601f19168101030190f35b60e0366003190112610113576004356103b781610117565b602435906103c482610117565b604435906103d182610117565b6064356084356103e081610117565b60a43567ffffffffffffffff8111610113576104009036906004016101c2565b9160c4359467ffffffffffffffff86116101135761010f966104296100ff973690600401610208565b958061046c565b34610113575f36600319011261011357602060405160058152f35b9190820391821161045857565b634e487b7160e01b5f52601160045260245ffd5b956104a4959461048b936104a999936104858888610544565b99610610565b61049f6104983083610544565b83836106df565b610544565b61044b565b90565b97986104a99961049f956104a4999597946104d1946104cb8b8b610544565b9c610610565b6104db3085610544565b918115158061050f575b6104f3575b505083836106df565b61050182610508939461044b565b90856106df565b5f806104ea565b508183116104e5565b918151915f5b83811061052c575050505090565b600101600581901b820151850160240183905261051e565b6001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee810361056d57503190565b6040516370a0823160e01b81526001600160a01b039092166004830152602090829060249082905afa9081156105d6575f916105a7575090565b90506020813d6020116105ce575b816105c26020938361017f565b81010312610113575190565b3d91506105b5565b6040513d5f823e3d90fd5b3d1561060b573d906105f2826101a6565b91610600604051938461017f565b82523d5f602084013e565b606090565b93949190918381516106cd575b50506001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0361068c57505080340361067657505f9182915b6020825192019034905af16106656105e1565b901561066e5750565b602081519101fd5b635928816d60e11b5f526004523460245260445ffd5b939193929092346106b5575f9485946106b0926106ab83303384610782565b6107c6565b610652565b635928816d60e11b5f9081526004523460245260445ffd5b6106d79187610518565b505f8361061d565b9091906001600160a01b03811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0361074057505f80808093855af16107176105e1565b50156107205750565b6339f1c8d960e01b5f9081526001600160a01b0391909116600452602490fd5b60405163a9059cbb60e01b60208201526001600160a01b03939093166024840152604480840192909252908252610135919061077d60648361017f565b610896565b6040516323b872dd60e01b60208201526001600160a01b0392831660248201529290911660448301526064808301939093529181526101359161077d60848361017f565b60405163095ea7b360e01b60208083019182526001600160a01b0385166024840152604480840196909652948252929390925f9061080560648661017f565b84519082855af15f51903d8161086a575b501590505b61082457505050565b60405163095ea7b360e01b60208201526001600160a01b039390931660248401525f60448085019190915283526101359261077d9061086460648261017f565b82610896565b1515905061088a575061081b6001600160a01b0382163b15155b5f610816565b600161081b9114610884565b905f602091828151910182855af1156105d6575f513d6108e557506001600160a01b0381163b155b6108c55750565b635274afe760e01b5f9081526001600160a01b0391909116600452602490fd5b600114156108be56

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
0xc6a85231F6F67d7Bf89f0B2e0C8Fe3Cc7c82Fe3b
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.