Forkchoice Ethereum Mainnet

Address Contract Verified

Address 0x8b543Dff08Ed4BA13ee96F533638Ef54591AeE71
Balance 0 ETH
Nonce 1
Code Size 1155 bytes
Indexed Transactions 0 (1 on-chain, 1.4% indexed)
External Etherscan · Sourcify

Contract Bytecode

1155 bytes
0x6080604081815260049182361015610015575f80fd5b5f925f3560e01c91826323b872dd146100a957505063f3d1372f14610038575f80fd5b346100a557817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100a5576020905173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000111111125421ca6dc452d289314280a0f8842a65168152f35b5080fd5b90929150346103cc576101207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103cc5782359273ffffffffffffffffffffffffffffffffffffffff8085168095036103cc576024928335908282168092036103cc5760807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9c3601126103cc576101049687359167ffffffffffffffff948584116103cc57366023850112156103cc5783870135918683116103cc57368984870101116103cc57817f000000000000000000000000111111125421ca6dc452d289314280a0f8842a651633036104265750885194898601868110888211176103fb578a528552602090602086019a6044358c528a5194608086018681108a8211176103d0578c52605386527f5769746e657373207769746e65737329546f6b656e5065726d697373696f6e7360208701527f286164647265737320746f6b656e2c75696e7432353620616d6f756e742957698c8701527f746e65737328627974657333322073616c74290000000000000000000000000060608701526e22d473030f116ddee9f6b43ac78ba397883b156103cc577f137c29fe000000000000000000000000000000000000000000000000000000009d8d519e8f52606435908582168092036103cc578f999897969492958e9661014095938f8d0152608435888d015260a43560448d015260c43560648d0152511660848b01525160a48a015260c489015260e43560e4890152870152835193846101448801525f5b8581106103af5750505092848093601f8085805f9b998c98610164968a88828b0101527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09687910116880196610160898903016101248a0152870152610184970187860137868682860101520116010301925af180156103a55761036a578580f35b909192938095501161037b57505052005b6041907f4e487b71000000000000000000000000000000000000000000000000000000005f52525ffd5b84513d5f823e3d90fd5b81810183015197810161016401979097528c968b935082016102e8565b5f80fd5b8b60418c7f4e487b71000000000000000000000000000000000000000000000000000000005f52525ffd5b8960418a7f4e487b71000000000000000000000000000000000000000000000000000000005f52525ffd5b807f497131ed00000000000000000000000000000000000000000000000000000000899252fdfea2646970667358221220c7ff0743455249887fe1377e19028c1d7281188ce1353255a38967c6977ed15964736f6c63430008170033

Verified Source Code Full Match

Compiler: v0.8.23+commit.f704f362 EVM: shanghai Optimization: Yes (1000000 runs)
ImmutableOwner.sol 19 lines
// SPDX-License-Identifier: MIT

pragma solidity 0.8.23;

/// @title A helper contract with helper modifiers to allow access to original contract creator only
contract ImmutableOwner {
    error IOAccessDenied();

    address public immutable IMMUTABLE_OWNER;

    modifier onlyImmutableOwner {
        if (msg.sender != IMMUTABLE_OWNER) revert IOAccessDenied();
        _;
    }

    constructor(address _immutableOwner) {
        IMMUTABLE_OWNER = _immutableOwner;
    }
}
Permit2WitnessProxy.sol 52 lines
// SPDX-License-Identifier: MIT

pragma solidity 0.8.23;

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

import "../interfaces/IPermit2WitnessTransferFrom.sol";
import "./ImmutableOwner.sol";

/* solhint-disable func-name-mixedcase */

contract Permit2WitnessProxy is ImmutableOwner {
    error Permit2WitnessProxyBadSelector();

    struct Witness {
        bytes32 salt;
    }

    string private constant _WITNESS_TYPE_STRING =
		"Witness witness)TokenPermissions(address token,uint256 amount)Witness(bytes32 salt)";

    IPermit2WitnessTransferFrom private constant _PERMIT2 = IPermit2WitnessTransferFrom(0x000000000022D473030F116dDEE9F6B43aC78BA3);

    constructor(address _immutableOwner) ImmutableOwner(_immutableOwner) {
        if (Permit2WitnessProxy.func_801zDya.selector != IERC20.transferFrom.selector) revert Permit2WitnessProxyBadSelector();
    }

    /// @notice Proxy transfer method for `Permit2.permitWitnessTransferFrom`. Selector must match `IERC20.transferFrom`
    // keccak256("func_801zDya(address,address,uint256,address,uint256,uint256,uint256,bytes32,bytes)") == 0x23b872dd (IERC20.transferFrom)
    function func_801zDya(
        address from,
        address to,
        uint256 amount,
        IPermit2WitnessTransferFrom.PermitTransferFrom calldata permit,
        bytes32 witness,
        bytes calldata sig
    ) external onlyImmutableOwner {
        _PERMIT2.permitWitnessTransferFrom(
            permit,
            IPermit2WitnessTransferFrom.SignatureTransferDetails({
                to: to,
                requestedAmount: amount
            }),
            from,
            witness,
            _WITNESS_TYPE_STRING,
            sig
        );
    }
}

/* solhint-enable func-name-mixedcase */
IERC20.sol 79 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

interface IPermit2WitnessTransferFrom {
    struct TokenPermissions {
        // ERC20 token address
        address token;
        // the maximum amount that can be spent
        uint256 amount;
    }

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

    struct SignatureTransferDetails {
        // recipient address
        address to;
        // spender requested amount
        uint256 requestedAmount;
    }

    function permitWitnessTransferFrom(
        PermitTransferFrom calldata permit,
        SignatureTransferDetails calldata transferDetails,
        address owner,
        bytes32 witness,
        string calldata witnessTypeString,
        bytes calldata signature
    ) external;
}

Read Contract

IMMUTABLE_OWNER 0xf3d1372f → address

Write Contract 1 functions

These functions modify contract state and require a wallet transaction to execute.

func_801zDya 0x4bde8ec5
address from
address to
uint256 amount
tuple permit
bytes32 witness
bytes sig

Recent Transactions

This address has 1 on-chain transactions, but only 1.4% of the chain is indexed. Transactions will appear as indexing progresses. View on Etherscan →