Overview
ETH Balance
ETH Value
$0.00Latest 25 from a total of 46 transactions
| Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Safe Multi Call | 15476742 | 12 days ago | IN | 0.00272853 ETH | 0.00000157 | ||||
| Safe Multi Call | 14988104 | 18 days ago | IN | 0.000903 ETH | 0.00000159 | ||||
| Safe Multi Call | 13648101 | 33 days ago | IN | 0.000125 ETH | 0.00000135 | ||||
| Safe Multi Call | 13640139 | 33 days ago | IN | 0.000062 ETH | 0.00000155 | ||||
| Safe Multi Call | 13528811 | 35 days ago | IN | 0.07085011 ETH | 0.00000157 | ||||
| Safe Multi Call | 13528807 | 35 days ago | IN | 0.08461588 ETH | 0.00000157 | ||||
| Safe Multi Call | 13434315 | 36 days ago | IN | 0.0589125 ETH | 0.00000157 | ||||
| Safe Multi Call | 13434312 | 36 days ago | IN | 0.04237986 ETH | 0.00000157 | ||||
| Safe Multi Call | 13426429 | 36 days ago | IN | 0.07971419 ETH | 0.00000158 | ||||
| Safe Multi Call | 13426424 | 36 days ago | IN | 0.07980817 ETH | 0.00000158 | ||||
| Safe Multi Call | 13426370 | 36 days ago | IN | 0.00397355 ETH | 0.00000158 | ||||
| Safe Multi Call | 13287665 | 37 days ago | IN | 0.00025415 ETH | 0.00000168 | ||||
| Safe Multi Call | 13224988 | 38 days ago | IN | 0.0000222 ETH | 0.00000795 | ||||
| Safe Multi Call | 13048014 | 40 days ago | IN | 0.000025 ETH | 0.00000155 | ||||
| Safe Multi Call | 13001860 | 41 days ago | IN | 0.02179888 ETH | 0.00000155 | ||||
| Safe Multi Call | 12950998 | 41 days ago | IN | 0.000023 ETH | 0.00000156 | ||||
| Safe Multi Call | 12944605 | 41 days ago | IN | 0.00008715 ETH | 0.00000167 | ||||
| Safe Multi Call | 12706041 | 44 days ago | IN | 0.000025 ETH | 0.00000147 | ||||
| Safe Multi Call | 12618893 | 45 days ago | IN | 0.000025 ETH | 0.00000156 | ||||
| Safe Multi Call | 12600402 | 45 days ago | IN | 0.00223037 ETH | 0.00000158 | ||||
| Safe Multi Call | 12532069 | 46 days ago | IN | 0.000025 ETH | 0.00000155 | ||||
| Safe Multi Call | 12500264 | 46 days ago | IN | 0.00167509 ETH | 0.00000156 | ||||
| Safe Multi Call | 12474844 | 47 days ago | IN | 0.002242 ETH | 0.00000135 | ||||
| Safe Multi Call | 12351926 | 48 days ago | IN | 0.000025 ETH | 0.00000154 | ||||
| Safe Multi Call | 12272993 | 49 days ago | IN | 0.000026 ETH | 0.00000154 |
Latest 25 internal transactions (View All)
| Parent Transaction Hash | Block | From | To | ||||
|---|---|---|---|---|---|---|---|
| 15519936 | 11 days ago | 0.0000971 ETH | |||||
| 15519936 | 11 days ago | 0 ETH | |||||
| 15519936 | 11 days ago | 0 ETH | |||||
| 15519936 | 11 days ago | 0.0000971 ETH | |||||
| 15519936 | 11 days ago | 0 ETH | |||||
| 15519936 | 11 days ago | 0 ETH | |||||
| 15519936 | 11 days ago | 0 ETH | |||||
| 15519936 | 11 days ago | 0 ETH | |||||
| 15519936 | 11 days ago | 0 ETH | |||||
| 15519936 | 11 days ago | 0 ETH | |||||
| 15519936 | 11 days ago | 0 ETH | |||||
| 15478281 | 12 days ago | 0 ETH | |||||
| 15478281 | 12 days ago | 0 ETH | |||||
| 15478281 | 12 days ago | 0 ETH | |||||
| 15478281 | 12 days ago | 0 ETH | |||||
| 15478281 | 12 days ago | 0 ETH | |||||
| 15478281 | 12 days ago | 0 ETH | |||||
| 15478281 | 12 days ago | 0 ETH | |||||
| 15478281 | 12 days ago | 0 ETH | |||||
| 15476742 | 12 days ago | 0 ETH | |||||
| 15476742 | 12 days ago | 0 ETH | |||||
| 15476742 | 12 days ago | 0.00272853 ETH | |||||
| 15476742 | 12 days ago | 0.00272853 ETH | |||||
| 14988104 | 18 days ago | 0 ETH | |||||
| 14988104 | 18 days ago | 0 ETH |
Cross-Chain Transactions
Contract Source Code Verified (Exact Match)
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeTransferLib} from "solady/utils/SafeTransferLib.sol";
import {IRouter} from "./libs/IRouter.sol";
import { IPermit2 } from "@uniswap/permit2/src/interfaces/IPermit2.sol";
library Panic {
function panic(uint256 code) internal pure {
assembly ("memory-safe") {
mstore(0x00, 0x4e487b71) // selector for `Panic(uint256)`
mstore(0x20, code)
revert(0x1c, 0x24)
}
}
// https://docs.soliditylang.org/en/latest/control-structures.html#panic-via-assert-and-error-via-require
uint8 internal constant GENERIC = 0x00;
uint8 internal constant ASSERT_FAIL = 0x01;
uint8 internal constant ARITHMETIC_OVERFLOW = 0x11;
uint8 internal constant DIVISION_BY_ZERO = 0x12;
uint8 internal constant ENUM_CAST = 0x21;
uint8 internal constant CORRUPT_STORAGE_ARRAY = 0x22;
uint8 internal constant POP_EMPTY_ARRAY = 0x31;
uint8 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;
uint8 internal constant OUT_OF_MEMORY = 0x41;
uint8 internal constant ZERO_FUNCTION_POINTER = 0x51;
}
library Revert {
function _revert(bytes memory reason) internal pure {
assembly ("memory-safe") {
revert(add(reason, 0x20), mload(reason))
}
}
function maybeRevert(bool success, bytes memory reason) internal pure {
if (!success) {
_revert(reason);
}
}
}
library SafeApproveLib {
function safeApprove(IERC20 token, address to, uint256 amount) internal {
assembly ("memory-safe") {
mstore(0x14, to) // Store the `to` argument.
mstore(0x34, amount) // Store the `amount` argument.
// Storing `amount` clobbers the upper bits of the free memory pointer, but those bits
// can never be set without running into an OOG, so it's safe. We'll restore them to
// zero at the end.
mstore(0x00, 0x095ea7b3000000000000000000000000) // Selector for `approve(address,uint256)`, with `to`'s padding.
// Calldata starts at offset 16 and is 68 bytes long (2 * 32 + 4).
// If there is returndata (optional) we copy the first 32 bytes into the first slot of memory.
if iszero(call(gas(), token, 0x00, 0x10, 0x44, 0x00, 0x20)) {
let ptr := and(0xffffffffffffffffffffffff, mload(0x40))
returndatacopy(ptr, 0x00, returndatasize())
revert(ptr, returndatasize())
}
// We check that the call either returned exactly 1 [true] (can't just be non-zero
// data), or had no return data.
if iszero(or(and(eq(mload(0x00), 0x01), lt(0x1f, returndatasize())), iszero(returndatasize()))) {
mstore(0x00, 0x3e3f8f73) // Selector for `ApproveFailed()`
revert(0x1c, 0x04)
}
mstore(0x34, 0x00) // Restore the part of the free memory pointer that was overwritten.
}
}
function safeApproveIfBelow(IERC20 token, address spender, uint256 amount) internal {
uint256 allowance = token.allowance(address(this), spender);
if (allowance < amount) {
if (allowance != 0) {
safeApprove(token, spender, 0);
}
safeApprove(token, spender, type(uint256).max);
}
}
}
contract Multicall3Router is IRouter {
using Revert for bool;
using SafeTransferLib for address;
using SafeApproveLib for IERC20;
uint256 internal constant BASIS = 10_000;
error CallFailed(bytes returnData);
error InvalidOffset();
error InvalidTarget();
error ArrayLengthsMismatch();
event WheelxRouter(bytes32 indexed request_id);
address public immutable multicall3;
IPermit2 public immutable permit2;
// Set the Multicall3 address (e.g., 0xcA11bde05977b3631167028862bE2a173976CA11)
constructor(address _multicall3, IPermit2 _permit2) {
multicall3 = _multicall3;
permit2 = _permit2;
}
// Allow ETH transfers
receive() external payable {}
// a safer version of multicall3, which makes sure remaining eth is sent away.
function safeMultiCall(
bytes calldata calls,
address refundTo,
bytes32 request_id
) external payable returns (bytes memory) {
// perform multicall
(bool success, bytes memory returnData) = multicall3.delegatecall(calls);
if (!success) {
revert CallFailed(returnData);
}
if (address(this).balance > 0) {
// If refundTo is address(0), refund to msg.sender
address refundAddr = refundTo == address(0) ? msg.sender : refundTo;
uint256 amount = address(this).balance;
refundAddr.safeTransferETH(amount);
}
emit WheelxRouter(request_id);
return returnData;
}
function sellToPool(address sellToken, uint256 bps, address pool, uint256 offset, bytes memory data) external {
bool success;
bytes memory returnData;
uint256 value;
if (sellToken == address(0)) {
value = (address(this).balance * bps) / BASIS;
if (data.length == 0) {
if (offset != 0) revert InvalidOffset();
(success, returnData) = payable(pool).call{value: value}("");
success.maybeRevert(returnData);
return;
} else {
if ((offset += 32) > data.length) {
Panic.panic(Panic.ARRAY_OUT_OF_BOUNDS);
}
assembly ("memory-safe") {
mstore(add(data, offset), value)
}
}
} else {
uint256 amount = (IERC20(sellToken).balanceOf(address(this)) * bps) / BASIS;
if ((offset += 32) > data.length) {
Panic.panic(Panic.ARRAY_OUT_OF_BOUNDS);
}
assembly ("memory-safe") {
mstore(add(data, offset), amount)
}
if (address(sellToken) != pool) {
IERC20(sellToken).safeApproveIfBelow(pool, amount);
}
}
(success, returnData) = payable(pool).call{value: value}(data);
success.maybeRevert(returnData);
// forbid sending data to EOAs
if (returnData.length == 0 && pool.code.length == 0) revert InvalidTarget();
}
function cleanupERC20(address token, address refundTo) external {
// Check the router's balance for the token
uint256 balance = IERC20(token).balanceOf(address(this));
// Transfer the token to the refundTo address
if (balance > 0) {
IERC20(token).transfer(refundTo, balance);
}
}
function safeApproveIfBelow(address token, address spender, uint256 amount) external {
IERC20(token).safeApproveIfBelow(spender, amount);
}
function safeApprovePermit2(address token, address spender, uint256 amount) external {
// Approve the spender to spend the specified amount of tokens through permit2
IERC20(token).safeApproveIfBelow(address(permit2), amount);
(uint256 allowance, uint48 expiration,) = permit2.allowance(address(this), token, spender);
if (allowance < amount || expiration <= block.timestamp) {
permit2.approve(token, spender, type(uint160).max, type(uint48).max);
}
}
function cleanupErc20s(
address[] calldata tokens,
address[] calldata recipients,
uint256[] calldata amounts
) public virtual {
// Revert if array lengths do not match
if (
tokens.length != amounts.length ||
amounts.length != recipients.length
) {
revert ArrayLengthsMismatch();
}
for (uint256 i; i < tokens.length; i++) {
address token = tokens[i];
address recipient = recipients[i];
// Get the amount to transfer
uint256 amount = amounts[i] == 0
? IERC20(token).balanceOf(address(this))
: amounts[i];
// Transfer the token to the recipient address
token.safeTransfer(recipient, amount);
}
}
}// 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
pragma solidity ^0.8.4;
/// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values.
/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/SafeTransferLib.sol)
/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol)
/// @author Permit2 operations from (https://github.com/Uniswap/permit2/blob/main/src/libraries/Permit2Lib.sol)
///
/// @dev Note:
/// - For ETH transfers, please use `forceSafeTransferETH` for DoS protection.
/// - For ERC20s, this implementation won't check that a token has code,
/// responsibility is delegated to the caller.
library SafeTransferLib {
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* CUSTOM ERRORS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev The ETH transfer has failed.
error ETHTransferFailed();
/// @dev The ERC20 `transferFrom` has failed.
error TransferFromFailed();
/// @dev The ERC20 `transfer` has failed.
error TransferFailed();
/// @dev The ERC20 `approve` has failed.
error ApproveFailed();
/// @dev The Permit2 operation has failed.
error Permit2Failed();
/// @dev The Permit2 amount must be less than `2**160 - 1`.
error Permit2AmountOverflow();
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* CONSTANTS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev Suggested gas stipend for contract receiving ETH that disallows any storage writes.
uint256 internal constant GAS_STIPEND_NO_STORAGE_WRITES = 2300;
/// @dev Suggested gas stipend for contract receiving ETH to perform a few
/// storage reads and writes, but low enough to prevent griefing.
uint256 internal constant GAS_STIPEND_NO_GRIEF = 100000;
/// @dev The unique EIP-712 domain domain separator for the DAI token contract.
bytes32 internal constant DAI_DOMAIN_SEPARATOR =
0xdbb8cf42e1ecb028be3f3dbc922e1d878b963f411dc388ced501601c60f7c6f7;
/// @dev The address for the WETH9 contract on Ethereum mainnet.
address internal constant WETH9 = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
/// @dev The canonical Permit2 address.
/// [Github](https://github.com/Uniswap/permit2)
/// [Etherscan](https://etherscan.io/address/0x000000000022D473030F116dDEE9F6B43aC78BA3)
address internal constant PERMIT2 = 0x000000000022D473030F116dDEE9F6B43aC78BA3;
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* ETH OPERATIONS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
// If the ETH transfer MUST succeed with a reasonable gas budget, use the force variants.
//
// The regular variants:
// - Forwards all remaining gas to the target.
// - Reverts if the target reverts.
// - Reverts if the current contract has insufficient balance.
//
// The force variants:
// - Forwards with an optional gas stipend
// (defaults to `GAS_STIPEND_NO_GRIEF`, which is sufficient for most cases).
// - If the target reverts, or if the gas stipend is exhausted,
// creates a temporary contract to force send the ETH via `SELFDESTRUCT`.
// Future compatible with `SENDALL`: https://eips.ethereum.org/EIPS/eip-4758.
// - Reverts if the current contract has insufficient balance.
//
// The try variants:
// - Forwards with a mandatory gas stipend.
// - Instead of reverting, returns whether the transfer succeeded.
/// @dev Sends `amount` (in wei) ETH to `to`.
function safeTransferETH(address to, uint256 amount) internal {
/// @solidity memory-safe-assembly
assembly {
if iszero(call(gas(), to, amount, codesize(), 0x00, codesize(), 0x00)) {
mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`.
revert(0x1c, 0x04)
}
}
}
/// @dev Sends all the ETH in the current contract to `to`.
function safeTransferAllETH(address to) internal {
/// @solidity memory-safe-assembly
assembly {
// Transfer all the ETH and check if it succeeded or not.
if iszero(call(gas(), to, selfbalance(), codesize(), 0x00, codesize(), 0x00)) {
mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`.
revert(0x1c, 0x04)
}
}
}
/// @dev Force sends `amount` (in wei) ETH to `to`, with a `gasStipend`.
function forceSafeTransferETH(address to, uint256 amount, uint256 gasStipend) internal {
/// @solidity memory-safe-assembly
assembly {
if lt(selfbalance(), amount) {
mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`.
revert(0x1c, 0x04)
}
if iszero(call(gasStipend, to, amount, codesize(), 0x00, codesize(), 0x00)) {
mstore(0x00, to) // Store the address in scratch space.
mstore8(0x0b, 0x73) // Opcode `PUSH20`.
mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`.
if iszero(create(amount, 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation.
}
}
}
/// @dev Force sends all the ETH in the current contract to `to`, with a `gasStipend`.
function forceSafeTransferAllETH(address to, uint256 gasStipend) internal {
/// @solidity memory-safe-assembly
assembly {
if iszero(call(gasStipend, to, selfbalance(), codesize(), 0x00, codesize(), 0x00)) {
mstore(0x00, to) // Store the address in scratch space.
mstore8(0x0b, 0x73) // Opcode `PUSH20`.
mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`.
if iszero(create(selfbalance(), 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation.
}
}
}
/// @dev Force sends `amount` (in wei) ETH to `to`, with `GAS_STIPEND_NO_GRIEF`.
function forceSafeTransferETH(address to, uint256 amount) internal {
/// @solidity memory-safe-assembly
assembly {
if lt(selfbalance(), amount) {
mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`.
revert(0x1c, 0x04)
}
if iszero(call(GAS_STIPEND_NO_GRIEF, to, amount, codesize(), 0x00, codesize(), 0x00)) {
mstore(0x00, to) // Store the address in scratch space.
mstore8(0x0b, 0x73) // Opcode `PUSH20`.
mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`.
if iszero(create(amount, 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation.
}
}
}
/// @dev Force sends all the ETH in the current contract to `to`, with `GAS_STIPEND_NO_GRIEF`.
function forceSafeTransferAllETH(address to) internal {
/// @solidity memory-safe-assembly
assembly {
// forgefmt: disable-next-item
if iszero(call(GAS_STIPEND_NO_GRIEF, to, selfbalance(), codesize(), 0x00, codesize(), 0x00)) {
mstore(0x00, to) // Store the address in scratch space.
mstore8(0x0b, 0x73) // Opcode `PUSH20`.
mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`.
if iszero(create(selfbalance(), 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation.
}
}
}
/// @dev Sends `amount` (in wei) ETH to `to`, with a `gasStipend`.
function trySafeTransferETH(address to, uint256 amount, uint256 gasStipend)
internal
returns (bool success)
{
/// @solidity memory-safe-assembly
assembly {
success := call(gasStipend, to, amount, codesize(), 0x00, codesize(), 0x00)
}
}
/// @dev Sends all the ETH in the current contract to `to`, with a `gasStipend`.
function trySafeTransferAllETH(address to, uint256 gasStipend)
internal
returns (bool success)
{
/// @solidity memory-safe-assembly
assembly {
success := call(gasStipend, to, selfbalance(), codesize(), 0x00, codesize(), 0x00)
}
}
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* ERC20 OPERATIONS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev Sends `amount` of ERC20 `token` from `from` to `to`.
/// Reverts upon failure.
///
/// The `from` account must have at least `amount` approved for
/// the current contract to manage.
function safeTransferFrom(address token, address from, address to, uint256 amount) internal {
/// @solidity memory-safe-assembly
assembly {
let m := mload(0x40) // Cache the free memory pointer.
mstore(0x60, amount) // Store the `amount` argument.
mstore(0x40, to) // Store the `to` argument.
mstore(0x2c, shl(96, from)) // Store the `from` argument.
mstore(0x0c, 0x23b872dd000000000000000000000000) // `transferFrom(address,address,uint256)`.
// Perform the transfer, reverting upon failure.
if iszero(
and( // The arguments of `and` are evaluated from right to left.
or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.
call(gas(), token, 0, 0x1c, 0x64, 0x00, 0x20)
)
) {
mstore(0x00, 0x7939f424) // `TransferFromFailed()`.
revert(0x1c, 0x04)
}
mstore(0x60, 0) // Restore the zero slot to zero.
mstore(0x40, m) // Restore the free memory pointer.
}
}
/// @dev Sends `amount` of ERC20 `token` from `from` to `to`.
///
/// The `from` account must have at least `amount` approved for the current contract to manage.
function trySafeTransferFrom(address token, address from, address to, uint256 amount)
internal
returns (bool success)
{
/// @solidity memory-safe-assembly
assembly {
let m := mload(0x40) // Cache the free memory pointer.
mstore(0x60, amount) // Store the `amount` argument.
mstore(0x40, to) // Store the `to` argument.
mstore(0x2c, shl(96, from)) // Store the `from` argument.
mstore(0x0c, 0x23b872dd000000000000000000000000) // `transferFrom(address,address,uint256)`.
success :=
and( // The arguments of `and` are evaluated from right to left.
or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.
call(gas(), token, 0, 0x1c, 0x64, 0x00, 0x20)
)
mstore(0x60, 0) // Restore the zero slot to zero.
mstore(0x40, m) // Restore the free memory pointer.
}
}
/// @dev Sends all of ERC20 `token` from `from` to `to`.
/// Reverts upon failure.
///
/// The `from` account must have their entire balance approved for the current contract to manage.
function safeTransferAllFrom(address token, address from, address to)
internal
returns (uint256 amount)
{
/// @solidity memory-safe-assembly
assembly {
let m := mload(0x40) // Cache the free memory pointer.
mstore(0x40, to) // Store the `to` argument.
mstore(0x2c, shl(96, from)) // Store the `from` argument.
mstore(0x0c, 0x70a08231000000000000000000000000) // `balanceOf(address)`.
// Read the balance, reverting upon failure.
if iszero(
and( // The arguments of `and` are evaluated from right to left.
gt(returndatasize(), 0x1f), // At least 32 bytes returned.
staticcall(gas(), token, 0x1c, 0x24, 0x60, 0x20)
)
) {
mstore(0x00, 0x7939f424) // `TransferFromFailed()`.
revert(0x1c, 0x04)
}
mstore(0x00, 0x23b872dd) // `transferFrom(address,address,uint256)`.
amount := mload(0x60) // The `amount` is already at 0x60. We'll need to return it.
// Perform the transfer, reverting upon failure.
if iszero(
and( // The arguments of `and` are evaluated from right to left.
or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.
call(gas(), token, 0, 0x1c, 0x64, 0x00, 0x20)
)
) {
mstore(0x00, 0x7939f424) // `TransferFromFailed()`.
revert(0x1c, 0x04)
}
mstore(0x60, 0) // Restore the zero slot to zero.
mstore(0x40, m) // Restore the free memory pointer.
}
}
/// @dev Sends `amount` of ERC20 `token` from the current contract to `to`.
/// Reverts upon failure.
function safeTransfer(address token, address to, uint256 amount) internal {
/// @solidity memory-safe-assembly
assembly {
mstore(0x14, to) // Store the `to` argument.
mstore(0x34, amount) // Store the `amount` argument.
mstore(0x00, 0xa9059cbb000000000000000000000000) // `transfer(address,uint256)`.
// Perform the transfer, reverting upon failure.
if iszero(
and( // The arguments of `and` are evaluated from right to left.
or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.
call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)
)
) {
mstore(0x00, 0x90b8ec18) // `TransferFailed()`.
revert(0x1c, 0x04)
}
mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten.
}
}
/// @dev Sends all of ERC20 `token` from the current contract to `to`.
/// Reverts upon failure.
function safeTransferAll(address token, address to) internal returns (uint256 amount) {
/// @solidity memory-safe-assembly
assembly {
mstore(0x00, 0x70a08231) // Store the function selector of `balanceOf(address)`.
mstore(0x20, address()) // Store the address of the current contract.
// Read the balance, reverting upon failure.
if iszero(
and( // The arguments of `and` are evaluated from right to left.
gt(returndatasize(), 0x1f), // At least 32 bytes returned.
staticcall(gas(), token, 0x1c, 0x24, 0x34, 0x20)
)
) {
mstore(0x00, 0x90b8ec18) // `TransferFailed()`.
revert(0x1c, 0x04)
}
mstore(0x14, to) // Store the `to` argument.
amount := mload(0x34) // The `amount` is already at 0x34. We'll need to return it.
mstore(0x00, 0xa9059cbb000000000000000000000000) // `transfer(address,uint256)`.
// Perform the transfer, reverting upon failure.
if iszero(
and( // The arguments of `and` are evaluated from right to left.
or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.
call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)
)
) {
mstore(0x00, 0x90b8ec18) // `TransferFailed()`.
revert(0x1c, 0x04)
}
mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten.
}
}
/// @dev Sets `amount` of ERC20 `token` for `to` to manage on behalf of the current contract.
/// Reverts upon failure.
function safeApprove(address token, address to, uint256 amount) internal {
/// @solidity memory-safe-assembly
assembly {
mstore(0x14, to) // Store the `to` argument.
mstore(0x34, amount) // Store the `amount` argument.
mstore(0x00, 0x095ea7b3000000000000000000000000) // `approve(address,uint256)`.
// Perform the approval, reverting upon failure.
if iszero(
and( // The arguments of `and` are evaluated from right to left.
or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.
call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)
)
) {
mstore(0x00, 0x3e3f8f73) // `ApproveFailed()`.
revert(0x1c, 0x04)
}
mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten.
}
}
/// @dev Sets `amount` of ERC20 `token` for `to` to manage on behalf of the current contract.
/// If the initial attempt to approve fails, attempts to reset the approved amount to zero,
/// then retries the approval again (some tokens, e.g. USDT, requires this).
/// Reverts upon failure.
function safeApproveWithRetry(address token, address to, uint256 amount) internal {
/// @solidity memory-safe-assembly
assembly {
mstore(0x14, to) // Store the `to` argument.
mstore(0x34, amount) // Store the `amount` argument.
mstore(0x00, 0x095ea7b3000000000000000000000000) // `approve(address,uint256)`.
// Perform the approval, retrying upon failure.
if iszero(
and( // The arguments of `and` are evaluated from right to left.
or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.
call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)
)
) {
mstore(0x34, 0) // Store 0 for the `amount`.
mstore(0x00, 0x095ea7b3000000000000000000000000) // `approve(address,uint256)`.
pop(call(gas(), token, 0, 0x10, 0x44, codesize(), 0x00)) // Reset the approval.
mstore(0x34, amount) // Store back the original `amount`.
// Retry the approval, reverting upon failure.
if iszero(
and(
or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing.
call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)
)
) {
mstore(0x00, 0x3e3f8f73) // `ApproveFailed()`.
revert(0x1c, 0x04)
}
}
mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten.
}
}
/// @dev Returns the amount of ERC20 `token` owned by `account`.
/// Returns zero if the `token` does not exist.
function balanceOf(address token, address account) internal view returns (uint256 amount) {
/// @solidity memory-safe-assembly
assembly {
mstore(0x14, account) // Store the `account` argument.
mstore(0x00, 0x70a08231000000000000000000000000) // `balanceOf(address)`.
amount :=
mul( // The arguments of `mul` are evaluated from right to left.
mload(0x20),
and( // The arguments of `and` are evaluated from right to left.
gt(returndatasize(), 0x1f), // At least 32 bytes returned.
staticcall(gas(), token, 0x10, 0x24, 0x20, 0x20)
)
)
}
}
/// @dev Sends `amount` of ERC20 `token` from `from` to `to`.
/// If the initial attempt fails, try to use Permit2 to transfer the token.
/// Reverts upon failure.
///
/// The `from` account must have at least `amount` approved for the current contract to manage.
function safeTransferFrom2(address token, address from, address to, uint256 amount) internal {
if (!trySafeTransferFrom(token, from, to, amount)) {
permit2TransferFrom(token, from, to, amount);
}
}
/// @dev Sends `amount` of ERC20 `token` from `from` to `to` via Permit2.
/// Reverts upon failure.
function permit2TransferFrom(address token, address from, address to, uint256 amount)
internal
{
/// @solidity memory-safe-assembly
assembly {
let m := mload(0x40)
mstore(add(m, 0x74), shr(96, shl(96, token)))
mstore(add(m, 0x54), amount)
mstore(add(m, 0x34), to)
mstore(add(m, 0x20), shl(96, from))
// `transferFrom(address,address,uint160,address)`.
mstore(m, 0x36c78516000000000000000000000000)
let p := PERMIT2
let exists := eq(chainid(), 1)
if iszero(exists) { exists := iszero(iszero(extcodesize(p))) }
if iszero(and(call(gas(), p, 0, add(m, 0x10), 0x84, codesize(), 0x00), exists)) {
mstore(0x00, 0x7939f4248757f0fd) // `TransferFromFailed()` or `Permit2AmountOverflow()`.
revert(add(0x18, shl(2, iszero(iszero(shr(160, amount))))), 0x04)
}
}
}
/// @dev Permit a user to spend a given amount of
/// another user's tokens via native EIP-2612 permit if possible, falling
/// back to Permit2 if native permit fails or is not implemented on the token.
function permit2(
address token,
address owner,
address spender,
uint256 amount,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
bool success;
/// @solidity memory-safe-assembly
assembly {
for {} shl(96, xor(token, WETH9)) {} {
mstore(0x00, 0x3644e515) // `DOMAIN_SEPARATOR()`.
if iszero(
and( // The arguments of `and` are evaluated from right to left.
lt(iszero(mload(0x00)), eq(returndatasize(), 0x20)), // Returns 1 non-zero word.
// Gas stipend to limit gas burn for tokens that don't refund gas when
// an non-existing function is called. 5K should be enough for a SLOAD.
staticcall(5000, token, 0x1c, 0x04, 0x00, 0x20)
)
) { break }
// After here, we can be sure that token is a contract.
let m := mload(0x40)
mstore(add(m, 0x34), spender)
mstore(add(m, 0x20), shl(96, owner))
mstore(add(m, 0x74), deadline)
if eq(mload(0x00), DAI_DOMAIN_SEPARATOR) {
mstore(0x14, owner)
mstore(0x00, 0x7ecebe00000000000000000000000000) // `nonces(address)`.
mstore(add(m, 0x94), staticcall(gas(), token, 0x10, 0x24, add(m, 0x54), 0x20))
mstore(m, 0x8fcbaf0c000000000000000000000000) // `IDAIPermit.permit`.
// `nonces` is already at `add(m, 0x54)`.
// `1` is already stored at `add(m, 0x94)`.
mstore(add(m, 0xb4), and(0xff, v))
mstore(add(m, 0xd4), r)
mstore(add(m, 0xf4), s)
success := call(gas(), token, 0, add(m, 0x10), 0x104, codesize(), 0x00)
break
}
mstore(m, 0xd505accf000000000000000000000000) // `IERC20Permit.permit`.
mstore(add(m, 0x54), amount)
mstore(add(m, 0x94), and(0xff, v))
mstore(add(m, 0xb4), r)
mstore(add(m, 0xd4), s)
success := call(gas(), token, 0, add(m, 0x10), 0xe4, codesize(), 0x00)
break
}
}
if (!success) simplePermit2(token, owner, spender, amount, deadline, v, r, s);
}
/// @dev Simple permit on the Permit2 contract.
function simplePermit2(
address token,
address owner,
address spender,
uint256 amount,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
/// @solidity memory-safe-assembly
assembly {
let m := mload(0x40)
mstore(m, 0x927da105) // `allowance(address,address,address)`.
{
let addressMask := shr(96, not(0))
mstore(add(m, 0x20), and(addressMask, owner))
mstore(add(m, 0x40), and(addressMask, token))
mstore(add(m, 0x60), and(addressMask, spender))
mstore(add(m, 0xc0), and(addressMask, spender))
}
let p := mul(PERMIT2, iszero(shr(160, amount)))
if iszero(
and( // The arguments of `and` are evaluated from right to left.
gt(returndatasize(), 0x5f), // Returns 3 words: `amount`, `expiration`, `nonce`.
staticcall(gas(), p, add(m, 0x1c), 0x64, add(m, 0x60), 0x60)
)
) {
mstore(0x00, 0x6b836e6b8757f0fd) // `Permit2Failed()` or `Permit2AmountOverflow()`.
revert(add(0x18, shl(2, iszero(p))), 0x04)
}
mstore(m, 0x2b67b570) // `Permit2.permit` (PermitSingle variant).
// `owner` is already `add(m, 0x20)`.
// `token` is already at `add(m, 0x40)`.
mstore(add(m, 0x60), amount)
mstore(add(m, 0x80), 0xffffffffffff) // `expiration = type(uint48).max`.
// `nonce` is already at `add(m, 0xa0)`.
// `spender` is already at `add(m, 0xc0)`.
mstore(add(m, 0xe0), deadline)
mstore(add(m, 0x100), 0x100) // `signature` offset.
mstore(add(m, 0x120), 0x41) // `signature` length.
mstore(add(m, 0x140), r)
mstore(add(m, 0x160), s)
mstore(add(m, 0x180), shl(248, v))
if iszero(call(gas(), p, 0, add(m, 0x1c), 0x184, codesize(), 0x00)) {
mstore(0x00, 0x6b836e6b) // `Permit2Failed()`.
revert(0x1c, 0x04)
}
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IRouter {
function safeMultiCall(bytes calldata calls, address refundTo, bytes32 request_id) external payable returns (bytes memory returnData);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {ISignatureTransfer} from "./ISignatureTransfer.sol";
import {IAllowanceTransfer} from "./IAllowanceTransfer.sol";
/// @notice Permit2 handles signature-based transfers in SignatureTransfer and allowance-based transfers in AllowanceTransfer.
/// @dev Users must approve Permit2 before calling any of the transfer functions.
interface IPermit2 is ISignatureTransfer, IAllowanceTransfer {
// IPermit2 unifies the two interfaces so users have maximal flexibility with their approval.
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {IEIP712} from "./IEIP712.sol";
/// @title SignatureTransfer
/// @notice Handles ERC20 token transfers through signature based actions
/// @dev Requires user's token approval on the Permit2 contract
interface ISignatureTransfer is IEIP712 {
/// @notice Thrown when the requested amount for a transfer is larger than the permissioned amount
/// @param maxAmount The maximum amount a spender can request to transfer
error InvalidAmount(uint256 maxAmount);
/// @notice Thrown when the number of tokens permissioned to a spender does not match the number of tokens being transferred
/// @dev If the spender does not need to transfer the number of tokens permitted, the spender can request amount 0 to be transferred
error LengthMismatch();
/// @notice Emits an event when the owner successfully invalidates an unordered nonce.
event UnorderedNonceInvalidation(address indexed owner, uint256 word, uint256 mask);
/// @notice The token and amount details for a transfer signed in the permit transfer signature
struct TokenPermissions {
// ERC20 token address
address token;
// the maximum amount that can be spent
uint256 amount;
}
/// @notice The signed permit message for a single token transfer
struct PermitTransferFrom {
TokenPermissions permitted;
// a unique value for every token owner's signature to prevent signature replays
uint256 nonce;
// deadline on the permit signature
uint256 deadline;
}
/// @notice Specifies the recipient address and amount for batched transfers.
/// @dev Recipients and amounts correspond to the index of the signed token permissions array.
/// @dev Reverts if the requested amount is greater than the permitted signed amount.
struct SignatureTransferDetails {
// recipient address
address to;
// spender requested amount
uint256 requestedAmount;
}
/// @notice Used to reconstruct the signed permit message for multiple token transfers
/// @dev Do not need to pass in spender address as it is required that it is msg.sender
/// @dev Note that a user still signs over a spender address
struct PermitBatchTransferFrom {
// the tokens and corresponding amounts permitted for a transfer
TokenPermissions[] permitted;
// a unique value for every token owner's signature to prevent signature replays
uint256 nonce;
// deadline on the permit signature
uint256 deadline;
}
/// @notice A map from token owner address and a caller specified word index to a bitmap. Used to set bits in the bitmap to prevent against signature replay protection
/// @dev Uses unordered nonces so that permit messages do not need to be spent in a certain order
/// @dev The mapping is indexed first by the token owner, then by an index specified in the nonce
/// @dev It returns a uint256 bitmap
/// @dev The index, or wordPosition is capped at type(uint248).max
function nonceBitmap(address, uint256) external view returns (uint256);
/// @notice Transfers a token using a signed permit message
/// @dev Reverts if the requested amount is greater than the permitted signed amount
/// @param permit The permit data signed over by the owner
/// @param owner The owner of the tokens to transfer
/// @param transferDetails The spender's requested transfer details for the permitted token
/// @param signature The signature to verify
function permitTransferFrom(
PermitTransferFrom memory permit,
SignatureTransferDetails calldata transferDetails,
address owner,
bytes calldata signature
) external;
/// @notice Transfers a token using a signed permit message
/// @notice Includes extra data provided by the caller to verify signature over
/// @dev The witness type string must follow EIP712 ordering of nested structs and must include the TokenPermissions type definition
/// @dev Reverts if the requested amount is greater than the permitted signed amount
/// @param permit The permit data signed over by the owner
/// @param owner The owner of the tokens to transfer
/// @param transferDetails The spender's requested transfer details for the permitted token
/// @param witness Extra data to include when checking the user signature
/// @param witnessTypeString The EIP-712 type definition for remaining string stub of the typehash
/// @param signature The signature to verify
function permitWitnessTransferFrom(
PermitTransferFrom memory permit,
SignatureTransferDetails calldata transferDetails,
address owner,
bytes32 witness,
string calldata witnessTypeString,
bytes calldata signature
) external;
/// @notice Transfers multiple tokens using a signed permit message
/// @param permit The permit data signed over by the owner
/// @param owner The owner of the tokens to transfer
/// @param transferDetails Specifies the recipient and requested amount for the token transfer
/// @param signature The signature to verify
function permitTransferFrom(
PermitBatchTransferFrom memory permit,
SignatureTransferDetails[] calldata transferDetails,
address owner,
bytes calldata signature
) external;
/// @notice Transfers multiple tokens using a signed permit message
/// @dev The witness type string must follow EIP712 ordering of nested structs and must include the TokenPermissions type definition
/// @notice Includes extra data provided by the caller to verify signature over
/// @param permit The permit data signed over by the owner
/// @param owner The owner of the tokens to transfer
/// @param transferDetails Specifies the recipient and requested amount for the token transfer
/// @param witness Extra data to include when checking the user signature
/// @param witnessTypeString The EIP-712 type definition for remaining string stub of the typehash
/// @param signature The signature to verify
function permitWitnessTransferFrom(
PermitBatchTransferFrom memory permit,
SignatureTransferDetails[] calldata transferDetails,
address owner,
bytes32 witness,
string calldata witnessTypeString,
bytes calldata signature
) external;
/// @notice Invalidates the bits specified in mask for the bitmap at the word position
/// @dev The wordPos is maxed at type(uint248).max
/// @param wordPos A number to index the nonceBitmap at
/// @param mask A bitmap masked against msg.sender's current bitmap at the word position
function invalidateUnorderedNonces(uint256 wordPos, uint256 mask) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {IEIP712} from "./IEIP712.sol";
/// @title AllowanceTransfer
/// @notice Handles ERC20 token permissions through signature based allowance setting and ERC20 token transfers by checking allowed amounts
/// @dev Requires user's token approval on the Permit2 contract
interface IAllowanceTransfer is IEIP712 {
/// @notice Thrown when an allowance on a token has expired.
/// @param deadline The timestamp at which the allowed amount is no longer valid
error AllowanceExpired(uint256 deadline);
/// @notice Thrown when an allowance on a token has been depleted.
/// @param amount The maximum amount allowed
error InsufficientAllowance(uint256 amount);
/// @notice Thrown when too many nonces are invalidated.
error ExcessiveInvalidation();
/// @notice Emits an event when the owner successfully invalidates an ordered nonce.
event NonceInvalidation(
address indexed owner, address indexed token, address indexed spender, uint48 newNonce, uint48 oldNonce
);
/// @notice Emits an event when the owner successfully sets permissions on a token for the spender.
event Approval(
address indexed owner, address indexed token, address indexed spender, uint160 amount, uint48 expiration
);
/// @notice Emits an event when the owner successfully sets permissions using a permit signature on a token for the spender.
event Permit(
address indexed owner,
address indexed token,
address indexed spender,
uint160 amount,
uint48 expiration,
uint48 nonce
);
/// @notice Emits an event when the owner sets the allowance back to 0 with the lockdown function.
event Lockdown(address indexed owner, address token, address spender);
/// @notice The permit data for a token
struct PermitDetails {
// ERC20 token address
address token;
// the maximum amount allowed to spend
uint160 amount;
// timestamp at which a spender's token allowances become invalid
uint48 expiration;
// an incrementing value indexed per owner,token,and spender for each signature
uint48 nonce;
}
/// @notice The permit message signed for a single token allowance
struct PermitSingle {
// the permit data for a single token alownce
PermitDetails details;
// address permissioned on the allowed tokens
address spender;
// deadline on the permit signature
uint256 sigDeadline;
}
/// @notice The permit message signed for multiple token allowances
struct PermitBatch {
// the permit data for multiple token allowances
PermitDetails[] details;
// address permissioned on the allowed tokens
address spender;
// deadline on the permit signature
uint256 sigDeadline;
}
/// @notice The saved permissions
/// @dev This info is saved per owner, per token, per spender and all signed over in the permit message
/// @dev Setting amount to type(uint160).max sets an unlimited approval
struct PackedAllowance {
// amount allowed
uint160 amount;
// permission expiry
uint48 expiration;
// an incrementing value indexed per owner,token,and spender for each signature
uint48 nonce;
}
/// @notice A token spender pair.
struct TokenSpenderPair {
// the token the spender is approved
address token;
// the spender address
address spender;
}
/// @notice Details for a token transfer.
struct AllowanceTransferDetails {
// the owner of the token
address from;
// the recipient of the token
address to;
// the amount of the token
uint160 amount;
// the token to be transferred
address token;
}
/// @notice A mapping from owner address to token address to spender address to PackedAllowance struct, which contains details and conditions of the approval.
/// @notice The mapping is indexed in the above order see: allowance[ownerAddress][tokenAddress][spenderAddress]
/// @dev The packed slot holds the allowed amount, expiration at which the allowed amount is no longer valid, and current nonce thats updated on any signature based approvals.
function allowance(address user, address token, address spender)
external
view
returns (uint160 amount, uint48 expiration, uint48 nonce);
/// @notice Approves the spender to use up to amount of the specified token up until the expiration
/// @param token The token to approve
/// @param spender The spender address to approve
/// @param amount The approved amount of the token
/// @param expiration The timestamp at which the approval is no longer valid
/// @dev The packed allowance also holds a nonce, which will stay unchanged in approve
/// @dev Setting amount to type(uint160).max sets an unlimited approval
function approve(address token, address spender, uint160 amount, uint48 expiration) external;
/// @notice Permit a spender to a given amount of the owners token via the owner's EIP-712 signature
/// @dev May fail if the owner's nonce was invalidated in-flight by invalidateNonce
/// @param owner The owner of the tokens being approved
/// @param permitSingle Data signed over by the owner specifying the terms of approval
/// @param signature The owner's signature over the permit data
function permit(address owner, PermitSingle memory permitSingle, bytes calldata signature) external;
/// @notice Permit a spender to the signed amounts of the owners tokens via the owner's EIP-712 signature
/// @dev May fail if the owner's nonce was invalidated in-flight by invalidateNonce
/// @param owner The owner of the tokens being approved
/// @param permitBatch Data signed over by the owner specifying the terms of approval
/// @param signature The owner's signature over the permit data
function permit(address owner, PermitBatch memory permitBatch, bytes calldata signature) external;
/// @notice Transfer approved tokens from one address to another
/// @param from The address to transfer from
/// @param to The address of the recipient
/// @param amount The amount of the token to transfer
/// @param token The token address to transfer
/// @dev Requires the from address to have approved at least the desired amount
/// of tokens to msg.sender.
function transferFrom(address from, address to, uint160 amount, address token) external;
/// @notice Transfer approved tokens in a batch
/// @param transferDetails Array of owners, recipients, amounts, and tokens for the transfers
/// @dev Requires the from addresses to have approved at least the desired amount
/// of tokens to msg.sender.
function transferFrom(AllowanceTransferDetails[] calldata transferDetails) external;
/// @notice Enables performing a "lockdown" of the sender's Permit2 identity
/// by batch revoking approvals
/// @param approvals Array of approvals to revoke.
function lockdown(TokenSpenderPair[] calldata approvals) external;
/// @notice Invalidate nonces for a given (token, spender) pair
/// @param token The token to invalidate nonces for
/// @param spender The spender to invalidate nonces for
/// @param newNonce The new nonce to set. Invalidates all nonces less than it.
/// @dev Can't invalidate more than 2**16 nonces per transaction.
function invalidateNonces(address token, address spender, uint48 newNonce) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IEIP712 {
function DOMAIN_SEPARATOR() external view returns (bytes32);
}{
"remappings": [
"@permit2/=lib/permit2/src/",
"@arbitrum/=node_modules/@arbitrum/",
"@axelar-network/=node_modules/@axelar-network/",
"@chainlink/=node_modules/@chainlink/",
"@eth-optimism/=node_modules/@eth-optimism/",
"@hyperlane-xyz/=node_modules/@hyperlane-xyz/core/contracts/",
"@layerzerolabs/=node_modules/@layerzerolabs/",
"@offchainlabs/=node_modules/@offchainlabs/",
"@openzeppelin/=node_modules/@openzeppelin/",
"@scroll-tech/=node_modules/@scroll-tech/",
"@uniswap/=node_modules/@uniswap/",
"@zksync/=node_modules/@zksync/",
"fx-portal/=node_modules/fx-portal/",
"hardhat-deploy/=node_modules/hardhat-deploy/",
"solady/=lib/solady/src/",
"solidity-bytes-utils/=node_modules/solidity-bytes-utils/"
],
"optimizer": {
"enabled": true,
"runs": 10000
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "none",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "london",
"viaIR": false
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_multicall3","type":"address"},{"internalType":"contract IPermit2","name":"_permit2","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ArrayLengthsMismatch","type":"error"},{"inputs":[{"internalType":"bytes","name":"returnData","type":"bytes"}],"name":"CallFailed","type":"error"},{"inputs":[],"name":"InvalidOffset","type":"error"},{"inputs":[],"name":"InvalidTarget","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"request_id","type":"bytes32"}],"name":"WheelxRouter","type":"event"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"refundTo","type":"address"}],"name":"cleanupERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"address[]","name":"recipients","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"cleanupErc20s","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"multicall3","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"permit2","outputs":[{"internalType":"contract IPermit2","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"safeApproveIfBelow","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"safeApprovePermit2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"calls","type":"bytes"},{"internalType":"address","name":"refundTo","type":"address"},{"internalType":"bytes32","name":"request_id","type":"bytes32"}],"name":"safeMultiCall","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"sellToken","type":"address"},{"internalType":"uint256","name":"bps","type":"uint256"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"uint256","name":"offset","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"sellToPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
60c060405234801561001057600080fd5b5060405161139338038061139383398101604081905261002f9161005e565b6001600160a01b039182166080521660a052610098565b6001600160a01b038116811461005b57600080fd5b50565b6000806040838503121561007157600080fd5b825161007c81610046565b602084015190925061008d81610046565b809150509250929050565b60805160a0516112bb6100d86000396000818160c50152818161065e015281816106db01526107dc01526000818161018001526101e901526112bb6000f3fe60806040526004361061007e5760003560e01c80635e069ba51161004e5780635e069ba51461014e57806394b41e521461016e578063e13157f5146101a2578063ed856306146101c257600080fd5b8062fcbae21461008a57806312261ee7146100b35780633b2253c81461010c5780633dad0c9c1461012e57600080fd5b3661008557005b600080fd5b61009d610098366004610d65565b6101e2565b6040516100aa9190610e12565b60405180910390f35b3480156100bf57600080fd5b506100e77f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100aa565b34801561011857600080fd5b5061012c610127366004610eaf565b61033c565b005b34801561013a57600080fd5b5061012c610149366004610f49565b6104e8565b34801561015a57600080fd5b5061012c610169366004610f82565b610621565b34801561017a57600080fd5b506100e77f000000000000000000000000000000000000000000000000000000000000000081565b3480156101ae57600080fd5b5061012c6101bd366004610f82565b610642565b3480156101ce57600080fd5b5061012c6101dd366004610ff2565b610840565b60606000807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16878760405161022e9291906110fa565b600060405180830381855af49150503d8060008114610269576040519150601f19603f3d011682016040523d82523d6000602084013e61026e565b606091505b5091509150816102b557806040517fa5fa8d2b0000000000000000000000000000000000000000000000000000000081526004016102ac9190610e12565b60405180910390fd5b471561030757600073ffffffffffffffffffffffffffffffffffffffff8616156102df57856102e1565b335b90504761030473ffffffffffffffffffffffffffffffffffffffff831682610b61565b50505b60405184907fe926533395b9a173f397bf1aecc14c7895c310340a69efcb84cf7997a9a0ca6b90600090a29695505050505050565b848114158061034b5750808314155b15610382576040517f3b800a4600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b858110156104df5760008787838181106103a1576103a161110a565b90506020020160208101906103b69190611139565b905060008686848181106103cc576103cc61110a565b90506020020160208101906103e19190611139565b905060008585858181106103f7576103f761110a565b90506020020135600014610423578585858181106104175761041761110a565b905060200201356104b1565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8416906370a0823190602401602060405180830381865afa15801561048d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104b1919061115d565b90506104d473ffffffffffffffffffffffffffffffffffffffff84168383610b81565b505050600101610385565b50505050505050565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8416906370a0823190602401602060405180830381865afa158015610555573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610579919061115d565b9050801561061c576040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af11580156105f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061061a9190611176565b505b505050565b61061c73ffffffffffffffffffffffffffffffffffffffff84168383610bd0565b61068373ffffffffffffffffffffffffffffffffffffffff84167f000000000000000000000000000000000000000000000000000000000000000083610bd0565b6040517f927da10500000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8481166024830152838116604483015260009182917f0000000000000000000000000000000000000000000000000000000000000000169063927da10590606401606060405180830381865afa158015610722573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074691906111b3565b50915073ffffffffffffffffffffffffffffffffffffffff169150828210806107775750428165ffffffffffff1611155b15610839576040517f87517c4500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff868116600483015285811660248301526044820181905265ffffffffffff60648301527f000000000000000000000000000000000000000000000000000000000000000016906387517c4590608401600060405180830381600087803b15801561082057600080fd5b505af1158015610834573d6000803e3d6000fd5b505050505b5050505050565b600060608173ffffffffffffffffffffffffffffffffffffffff88166109595761271061086d8847611227565b6108779190611244565b9050835160000361092f5784156108ba576040517f01da157200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60405173ffffffffffffffffffffffffffffffffffffffff8716908290600081818185875af1925050503d8060008114610910576040519150601f19603f3d011682016040523d82523d6000602084013e610915565b606091505b50909350915061092783151583610cb1565b505050610839565b835161093c60208761127f565b955085111561094f5761094f6032610cbf565b8085850152610a82565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009061271090899073ffffffffffffffffffffffffffffffffffffffff8c16906370a0823190602401602060405180830381865afa1580156109cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f0919061115d565b6109fa9190611227565b610a049190611244565b8551909150610a1460208861127f565b9650861115610a2757610a276032610cbf565b80868601528673ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614610a8057610a8073ffffffffffffffffffffffffffffffffffffffff8a168883610bd0565b505b8573ffffffffffffffffffffffffffffffffffffffff168185604051610aa89190611292565b60006040518083038185875af1925050503d8060008114610ae5576040519150601f19603f3d011682016040523d82523d6000602084013e610aea565b606091505b509093509150610afc83151583610cb1565b8151158015610b20575073ffffffffffffffffffffffffffffffffffffffff86163b155b15610b57576040517f82d5d76a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505050505050565b60003860003884865af1610b7d5763b12d13eb6000526004601cfd5b5050565b81601452806034526fa9059cbb00000000000000000000000060005260206000604460106000875af13d156001600051141716610bc6576390b8ec186000526004601cfd5b6000603452505050565b6040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff83811660248301526000919085169063dd62ed3e90604401602060405180830381865afa158015610c46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6a919061115d565b90508181101561061a578015610c8657610c8684846000610cd1565b61061a84847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610cd1565b81610b7d57610b7d81610d38565b634e487b71600052806020526024601cfd5b81601452806034526f095ea7b300000000000000000000000060005260206000604460106000875af1610d18576040516bffffffffffffffffffffffff163d6000823e3d81fd5b3d153d601f106001600051141617610bc657633e3f8f736000526004601cfd5b805160208201fd5b73ffffffffffffffffffffffffffffffffffffffff81168114610d6257600080fd5b50565b60008060008060608587031215610d7b57600080fd5b843567ffffffffffffffff80821115610d9357600080fd5b818701915087601f830112610da757600080fd5b813581811115610db657600080fd5b886020828501011115610dc857600080fd5b60209283019650945050850135610dde81610d40565b9396929550929360400135925050565b60005b83811015610e09578181015183820152602001610df1565b50506000910152565b6020815260008251806020840152610e31816040850160208701610dee565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60008083601f840112610e7557600080fd5b50813567ffffffffffffffff811115610e8d57600080fd5b6020830191508360208260051b8501011115610ea857600080fd5b9250929050565b60008060008060008060608789031215610ec857600080fd5b863567ffffffffffffffff80821115610ee057600080fd5b610eec8a838b01610e63565b90985096506020890135915080821115610f0557600080fd5b610f118a838b01610e63565b90965094506040890135915080821115610f2a57600080fd5b50610f3789828a01610e63565b979a9699509497509295939492505050565b60008060408385031215610f5c57600080fd5b8235610f6781610d40565b91506020830135610f7781610d40565b809150509250929050565b600080600060608486031215610f9757600080fd5b8335610fa281610d40565b92506020840135610fb281610d40565b929592945050506040919091013590565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080600080600060a0868803121561100a57600080fd5b853561101581610d40565b945060208601359350604086013561102c81610d40565b925060608601359150608086013567ffffffffffffffff8082111561105057600080fd5b818801915088601f83011261106457600080fd5b81358181111561107657611076610fc3565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156110bc576110bc610fc3565b816040528281528b60208487010111156110d557600080fd5b8260208601602083013760006020848301015280955050505050509295509295909350565b8183823760009101908152919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006020828403121561114b57600080fd5b813561115681610d40565b9392505050565b60006020828403121561116f57600080fd5b5051919050565b60006020828403121561118857600080fd5b8151801515811461115657600080fd5b805165ffffffffffff811681146111ae57600080fd5b919050565b6000806000606084860312156111c857600080fd5b83516111d381610d40565b92506111e160208501611198565b91506111ef60408501611198565b90509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808202811582820484141761123e5761123e6111f8565b92915050565b60008261127a577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b8082018082111561123e5761123e6111f8565b600082516112a4818460208701610dee565b919091019291505056fea164736f6c6343000819000a000000000000000000000000ca11bde05977b3631167028862be2a173976ca11000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3
Deployed Bytecode
0x60806040526004361061007e5760003560e01c80635e069ba51161004e5780635e069ba51461014e57806394b41e521461016e578063e13157f5146101a2578063ed856306146101c257600080fd5b8062fcbae21461008a57806312261ee7146100b35780633b2253c81461010c5780633dad0c9c1461012e57600080fd5b3661008557005b600080fd5b61009d610098366004610d65565b6101e2565b6040516100aa9190610e12565b60405180910390f35b3480156100bf57600080fd5b506100e77f000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba381565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100aa565b34801561011857600080fd5b5061012c610127366004610eaf565b61033c565b005b34801561013a57600080fd5b5061012c610149366004610f49565b6104e8565b34801561015a57600080fd5b5061012c610169366004610f82565b610621565b34801561017a57600080fd5b506100e77f000000000000000000000000ca11bde05977b3631167028862be2a173976ca1181565b3480156101ae57600080fd5b5061012c6101bd366004610f82565b610642565b3480156101ce57600080fd5b5061012c6101dd366004610ff2565b610840565b60606000807f000000000000000000000000ca11bde05977b3631167028862be2a173976ca1173ffffffffffffffffffffffffffffffffffffffff16878760405161022e9291906110fa565b600060405180830381855af49150503d8060008114610269576040519150601f19603f3d011682016040523d82523d6000602084013e61026e565b606091505b5091509150816102b557806040517fa5fa8d2b0000000000000000000000000000000000000000000000000000000081526004016102ac9190610e12565b60405180910390fd5b471561030757600073ffffffffffffffffffffffffffffffffffffffff8616156102df57856102e1565b335b90504761030473ffffffffffffffffffffffffffffffffffffffff831682610b61565b50505b60405184907fe926533395b9a173f397bf1aecc14c7895c310340a69efcb84cf7997a9a0ca6b90600090a29695505050505050565b848114158061034b5750808314155b15610382576040517f3b800a4600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b858110156104df5760008787838181106103a1576103a161110a565b90506020020160208101906103b69190611139565b905060008686848181106103cc576103cc61110a565b90506020020160208101906103e19190611139565b905060008585858181106103f7576103f761110a565b90506020020135600014610423578585858181106104175761041761110a565b905060200201356104b1565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8416906370a0823190602401602060405180830381865afa15801561048d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104b1919061115d565b90506104d473ffffffffffffffffffffffffffffffffffffffff84168383610b81565b505050600101610385565b50505050505050565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8416906370a0823190602401602060405180830381865afa158015610555573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610579919061115d565b9050801561061c576040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af11580156105f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061061a9190611176565b505b505050565b61061c73ffffffffffffffffffffffffffffffffffffffff84168383610bd0565b61068373ffffffffffffffffffffffffffffffffffffffff84167f000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba383610bd0565b6040517f927da10500000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8481166024830152838116604483015260009182917f000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3169063927da10590606401606060405180830381865afa158015610722573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074691906111b3565b50915073ffffffffffffffffffffffffffffffffffffffff169150828210806107775750428165ffffffffffff1611155b15610839576040517f87517c4500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff868116600483015285811660248301526044820181905265ffffffffffff60648301527f000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba316906387517c4590608401600060405180830381600087803b15801561082057600080fd5b505af1158015610834573d6000803e3d6000fd5b505050505b5050505050565b600060608173ffffffffffffffffffffffffffffffffffffffff88166109595761271061086d8847611227565b6108779190611244565b9050835160000361092f5784156108ba576040517f01da157200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60405173ffffffffffffffffffffffffffffffffffffffff8716908290600081818185875af1925050503d8060008114610910576040519150601f19603f3d011682016040523d82523d6000602084013e610915565b606091505b50909350915061092783151583610cb1565b505050610839565b835161093c60208761127f565b955085111561094f5761094f6032610cbf565b8085850152610a82565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009061271090899073ffffffffffffffffffffffffffffffffffffffff8c16906370a0823190602401602060405180830381865afa1580156109cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f0919061115d565b6109fa9190611227565b610a049190611244565b8551909150610a1460208861127f565b9650861115610a2757610a276032610cbf565b80868601528673ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614610a8057610a8073ffffffffffffffffffffffffffffffffffffffff8a168883610bd0565b505b8573ffffffffffffffffffffffffffffffffffffffff168185604051610aa89190611292565b60006040518083038185875af1925050503d8060008114610ae5576040519150601f19603f3d011682016040523d82523d6000602084013e610aea565b606091505b509093509150610afc83151583610cb1565b8151158015610b20575073ffffffffffffffffffffffffffffffffffffffff86163b155b15610b57576040517f82d5d76a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505050505050565b60003860003884865af1610b7d5763b12d13eb6000526004601cfd5b5050565b81601452806034526fa9059cbb00000000000000000000000060005260206000604460106000875af13d156001600051141716610bc6576390b8ec186000526004601cfd5b6000603452505050565b6040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff83811660248301526000919085169063dd62ed3e90604401602060405180830381865afa158015610c46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6a919061115d565b90508181101561061a578015610c8657610c8684846000610cd1565b61061a84847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610cd1565b81610b7d57610b7d81610d38565b634e487b71600052806020526024601cfd5b81601452806034526f095ea7b300000000000000000000000060005260206000604460106000875af1610d18576040516bffffffffffffffffffffffff163d6000823e3d81fd5b3d153d601f106001600051141617610bc657633e3f8f736000526004601cfd5b805160208201fd5b73ffffffffffffffffffffffffffffffffffffffff81168114610d6257600080fd5b50565b60008060008060608587031215610d7b57600080fd5b843567ffffffffffffffff80821115610d9357600080fd5b818701915087601f830112610da757600080fd5b813581811115610db657600080fd5b886020828501011115610dc857600080fd5b60209283019650945050850135610dde81610d40565b9396929550929360400135925050565b60005b83811015610e09578181015183820152602001610df1565b50506000910152565b6020815260008251806020840152610e31816040850160208701610dee565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60008083601f840112610e7557600080fd5b50813567ffffffffffffffff811115610e8d57600080fd5b6020830191508360208260051b8501011115610ea857600080fd5b9250929050565b60008060008060008060608789031215610ec857600080fd5b863567ffffffffffffffff80821115610ee057600080fd5b610eec8a838b01610e63565b90985096506020890135915080821115610f0557600080fd5b610f118a838b01610e63565b90965094506040890135915080821115610f2a57600080fd5b50610f3789828a01610e63565b979a9699509497509295939492505050565b60008060408385031215610f5c57600080fd5b8235610f6781610d40565b91506020830135610f7781610d40565b809150509250929050565b600080600060608486031215610f9757600080fd5b8335610fa281610d40565b92506020840135610fb281610d40565b929592945050506040919091013590565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080600080600060a0868803121561100a57600080fd5b853561101581610d40565b945060208601359350604086013561102c81610d40565b925060608601359150608086013567ffffffffffffffff8082111561105057600080fd5b818801915088601f83011261106457600080fd5b81358181111561107657611076610fc3565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156110bc576110bc610fc3565b816040528281528b60208487010111156110d557600080fd5b8260208601602083013760006020848301015280955050505050509295509295909350565b8183823760009101908152919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006020828403121561114b57600080fd5b813561115681610d40565b9392505050565b60006020828403121561116f57600080fd5b5051919050565b60006020828403121561118857600080fd5b8151801515811461115657600080fd5b805165ffffffffffff811681146111ae57600080fd5b919050565b6000806000606084860312156111c857600080fd5b83516111d381610d40565b92506111e160208501611198565b91506111ef60408501611198565b90509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808202811582820484141761123e5761123e6111f8565b92915050565b60008261127a577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b8082018082111561123e5761123e6111f8565b600082516112a4818460208701610dee565b919091019291505056fea164736f6c6343000819000a
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000ca11bde05977b3631167028862be2a173976ca11000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3
-----Decoded View---------------
Arg [0] : _multicall3 (address): 0xcA11bde05977b3631167028862bE2a173976CA11
Arg [1] : _permit2 (address): 0x000000000022D473030F116dDEE9F6B43aC78BA3
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000ca11bde05977b3631167028862be2a173976ca11
Arg [1] : 000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
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.