APE Price: $1.15 (+9.45%)

Contract

0xB508EE6cbddF4a1414abdDB26D467eAc5a9F5B8b

Overview

APE Balance

Apechain LogoApechain LogoApechain Logo0 APE

APE Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Batch Transfer T...43629912024-11-15 22:22:198 hrs ago1731709339IN
0xB508EE6c...c5a9F5B8b
0 APE0.0056800425.42069
Batch Transfer T...43622762024-11-15 22:09:068 hrs ago1731708546IN
0xB508EE6c...c5a9F5B8b
0 APE0.0045006825.42069
Batch Transfer T...43612432024-11-15 21:54:308 hrs ago1731707670IN
0xB508EE6c...c5a9F5B8b
0 APE0.0034276725.42069
Batch Transfer T...43609632024-11-15 21:50:208 hrs ago1731707420IN
0xB508EE6c...c5a9F5B8b
0 APE0.0045258225.42069
Batch Transfer T...43606332024-11-15 21:45:318 hrs ago1731707131IN
0xB508EE6c...c5a9F5B8b
0 APE0.0045248825.42069
Batch Transfer T...43605482024-11-15 21:44:078 hrs ago1731707047IN
0xB508EE6c...c5a9F5B8b
0 APE0.0029958225.42069
Batch Transfer T...43605112024-11-15 21:43:258 hrs ago1731707005IN
0xB508EE6c...c5a9F5B8b
0 APE0.0029994325.42069
Batch Transfer T...43604302024-11-15 21:42:088 hrs ago1731706928IN
0xB508EE6c...c5a9F5B8b
0 APE0.0025567125.42069
Batch Transfer T...43603912024-11-15 21:41:178 hrs ago1731706877IN
0xB508EE6c...c5a9F5B8b
0 APE0.0025567125.42069
Batch Transfer T...43603822024-11-15 21:40:578 hrs ago1731706857IN
0xB508EE6c...c5a9F5B8b
0 APE0.000755625.42069
Batch Transfer T...43603442024-11-15 21:40:108 hrs ago1731706810IN
0xB508EE6c...c5a9F5B8b
0 APE0.0007556325.42069
Batch Transfer T...43585582024-11-15 21:09:539 hrs ago1731704993IN
0xB508EE6c...c5a9F5B8b
0 APE0.0043348325.42069
0x6080604043573902024-11-15 20:54:309 hrs ago1731704070IN
 Create: ERC721BatchTransfer
0 APE0.0141891425.42069

Parent Transaction Hash Block From To
View All Internal Transactions

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ERC721BatchTransfer

Compiler Version
v0.8.27+commit.40a35a09

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 1 : ERC721BatchTransfer.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.4;

interface IERC721 {
    function ownerOf(uint256 tokenId) external view returns (address owner);

    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;
}

/// @title ERC721 Batch Transfer
/// @author  (https://github.com/chimmykk) 
/// @notice Transfer ERC721 tokens in batches to a single wallet or multiple wallets.
/// @notice To use any of the methods in this contract the user has to approve this contract
///         to control their tokens using either `setApproveForAll` or `approve` functions from
//          the ERC721 contract.
// using hardhat instead of forge
contract ERC721BatchTransfer {
    /// @dev 0x5f6f132c
    error InvalidArguments();
    /// @dev 0x4c084f14
    error NotOwnerOfToken();
    /// @dev 0x48f5c3ed
    error InvalidCaller();

    event BatchTransferToSingle(
        address indexed contractAddress,
        address indexed to,
        uint256 amount
    );

    event BatchTransferToMultiple(
        address indexed contractAddress,
        uint256 amount
    );

    // solhint-disable-next-line no-empty-blocks
    constructor() {}

    modifier noZero() {
        if (msg.sender == address(0)) revert InvalidCaller();
        _;
    }

    /// @notice Transfer multiple tokens to the same wallet using the ERC721.transferFrom method
    /// @notice If you don't know what that means, use the `safeBatchTransferToSingleWallet` method instead
    /// @param erc721Contract the address of the nft contract
    /// @param to the address that will receive the nfts
    /// @param tokenIds the list of tokens that will be transferred
    function batchTransferToSingleWallet(
        IERC721 erc721Contract,
        address to,
        uint256[] calldata tokenIds
    ) external noZero {
        uint256 length = tokenIds.length;
        for (uint256 i; i < length; ) {
            uint256 tokenId = tokenIds[i];
            address owner = erc721Contract.ownerOf(tokenId);
            if (msg.sender != owner) {
                revert NotOwnerOfToken();
            }
            erc721Contract.transferFrom(owner, to, tokenId);
            unchecked {
                ++i;
            }
        }
        emit BatchTransferToSingle(address(erc721Contract), to, length);
    }

    /// @notice transfer multiple tokens to the same wallet using the `ERC721.safeTransferFrom` method
    /// @param erc721Contract the address of the nft contract
    /// @param to the address that will receive the nfts
    /// @param tokenIds the list of tokens that will be transferred
    function safeBatchTransferToSingleWallet(
        IERC721 erc721Contract,
        address to,
        uint256[] calldata tokenIds
    ) external noZero {
        uint256 length = tokenIds.length;
        for (uint256 i; i < length; ) {
            uint256 tokenId = tokenIds[i];
            address owner = erc721Contract.ownerOf(tokenId);
            if (msg.sender != owner) {
                revert NotOwnerOfToken();
            }
            erc721Contract.safeTransferFrom(owner, to, tokenId);
            unchecked {
                ++i;
            }
        }
        emit BatchTransferToSingle(address(erc721Contract), to, length);
    }

    /// @notice Transfer multiple tokens to multiple wallets using the ERC721.transferFrom method
    /// @notice If you don't know what that means, use the `safeBatchTransferToMultipleWallets` method instead
    /// @notice The tokens in `tokenIds` will be transferred to the addresses in the same position in `tos`
    /// @notice E.g.: if tos = [0x..1, 0x..2, 0x..3] and tokenIds = [1, 2, 3], then:
    ///         0x..1 will receive token 1;
    ///         0x..2 will receive token 2;
    //          0x..3 will receive token 3;
    /// @param erc721Contract the address of the nft contract
    /// @param tos the list of addresses that will receive the nfts
    /// @param tokenIds the list of tokens that will be transferred
    function batchTransferToMultipleWallets(
        IERC721 erc721Contract,
        address[] calldata tos,
        uint256[] calldata tokenIds
    ) external noZero {
        uint256 length = tokenIds.length;
        if (tos.length != length) revert InvalidArguments();

        for (uint256 i; i < length; ) {
            uint256 tokenId = tokenIds[i];
            address owner = erc721Contract.ownerOf(tokenId);
            address to = tos[i];
            if (msg.sender != owner) {
                revert NotOwnerOfToken();
            }
            erc721Contract.transferFrom(owner, to, tokenId);
            unchecked {
                ++i;
            }
        }

        emit BatchTransferToMultiple(address(erc721Contract), length);
    }

    /// @notice Transfer multiple tokens to multiple wallets using the ERC721.safeTransferFrom method
    /// @notice The tokens in `tokenIds` will be transferred to the addresses in the same position in `tos`
    /// @notice E.g.: if tos = [0x..1, 0x..2, 0x..3] and tokenIds = [1, 2, 3], then:
    ///         0x..1 will receive token 1;
    ///         0x..2 will receive token 2;
    //          0x..3 will receive token 3;
    /// @param erc721Contract the address of the nft contract
    /// @param tos the list of addresses that will receive the nfts
    /// @param tokenIds the list of tokens that will be transferred
    function safeBatchTransferToMultipleWallets(
        IERC721 erc721Contract,
        address[] calldata tos,
        uint256[] calldata tokenIds
    ) external noZero {
        uint256 length = tokenIds.length;
        if (tos.length != length) revert InvalidArguments();

        for (uint256 i; i < length; ) {
            uint256 tokenId = tokenIds[i];
            address owner = erc721Contract.ownerOf(tokenId);
            address to = tos[i];
            if (msg.sender != owner) {
                revert NotOwnerOfToken();
            }
            erc721Contract.safeTransferFrom(owner, to, tokenId);
            unchecked {
                ++i;
            }
        }

        emit BatchTransferToMultiple(address(erc721Contract), length);
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "evmVersion": "paris",
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidArguments","type":"error"},{"inputs":[],"name":"InvalidCaller","type":"error"},{"inputs":[],"name":"NotOwnerOfToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"contractAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"BatchTransferToMultiple","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"contractAddress","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"BatchTransferToSingle","type":"event"},{"inputs":[{"internalType":"contract IERC721","name":"erc721Contract","type":"address"},{"internalType":"address[]","name":"tos","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"batchTransferToMultipleWallets","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC721","name":"erc721Contract","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"batchTransferToSingleWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC721","name":"erc721Contract","type":"address"},{"internalType":"address[]","name":"tos","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"safeBatchTransferToMultipleWallets","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC721","name":"erc721Contract","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"safeBatchTransferToSingleWallet","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6080604052348015600f57600080fd5b506109228061001f6000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c806321e5fa7314610051578063645550ad1461006657806376d5cd3014610079578063b58adcb21461008c575b600080fd5b61006461005f366004610784565b61009f565b005b61006461007436600461080c565b610289565b610064610087366004610784565b610430565b61006461009a36600461080c565b6105ce565b336100bd576040516348f5c3ed60e01b815260040160405180910390fd5b808381146100de576040516317dbc4cb60e21b815260040160405180910390fd5b60005b8181101561023d5760008484838181106100fd576100fd610871565b9050602002013590506000886001600160a01b0316636352211e836040518263ffffffff1660e01b815260040161013691815260200190565b602060405180830381865afa158015610153573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101779190610887565b9050600088888581811061018d5761018d610871565b90506020020160208101906101a291906108ab565b9050336001600160a01b038316146101cd5760405163130213c560e21b815260040160405180910390fd5b604051632142170760e11b81526001600160a01b038b16906342842e0e906101fd908590859088906004016108c8565b600060405180830381600087803b15801561021757600080fd5b505af115801561022b573d6000803e3d6000fd5b505050508360010193505050506100e1565b50856001600160a01b03167ff208cd4c9596892c9808e2e5af6672a78a6d9339e63099e7a0a7c46ab36cfb698260405161027991815260200190565b60405180910390a2505050505050565b336102a7576040516348f5c3ed60e01b815260040160405180910390fd5b8060005b818110156103db5760008484838181106102c7576102c7610871565b9050602002013590506000876001600160a01b0316636352211e836040518263ffffffff1660e01b815260040161030091815260200190565b602060405180830381865afa15801561031d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103419190610887565b9050336001600160a01b0382161461036c5760405163130213c560e21b815260040160405180910390fd5b6040516323b872dd60e01b81526001600160a01b038916906323b872dd9061039c9084908b9087906004016108c8565b600060405180830381600087803b1580156103b657600080fd5b505af11580156103ca573d6000803e3d6000fd5b5050505082600101925050506102ab565b50836001600160a01b0316856001600160a01b03167f731fa37880446004f33e9142d3adb387777d7566aad46269d636504e9b4344a68360405161042191815260200190565b60405180910390a35050505050565b3361044e576040516348f5c3ed60e01b815260040160405180910390fd5b8083811461046f576040516317dbc4cb60e21b815260040160405180910390fd5b60005b8181101561023d57600084848381811061048e5761048e610871565b9050602002013590506000886001600160a01b0316636352211e836040518263ffffffff1660e01b81526004016104c791815260200190565b602060405180830381865afa1580156104e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105089190610887565b9050600088888581811061051e5761051e610871565b905060200201602081019061053391906108ab565b9050336001600160a01b0383161461055e5760405163130213c560e21b815260040160405180910390fd5b6040516323b872dd60e01b81526001600160a01b038b16906323b872dd9061058e908590859088906004016108c8565b600060405180830381600087803b1580156105a857600080fd5b505af11580156105bc573d6000803e3d6000fd5b50505050836001019350505050610472565b336105ec576040516348f5c3ed60e01b815260040160405180910390fd5b8060005b818110156103db57600084848381811061060c5761060c610871565b9050602002013590506000876001600160a01b0316636352211e836040518263ffffffff1660e01b815260040161064591815260200190565b602060405180830381865afa158015610662573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106869190610887565b9050336001600160a01b038216146106b15760405163130213c560e21b815260040160405180910390fd5b604051632142170760e11b81526001600160a01b038916906342842e0e906106e19084908b9087906004016108c8565b600060405180830381600087803b1580156106fb57600080fd5b505af115801561070f573d6000803e3d6000fd5b5050505082600101925050506105f0565b6001600160a01b038116811461073557600080fd5b50565b60008083601f84011261074a57600080fd5b50813567ffffffffffffffff81111561076257600080fd5b6020830191508360208260051b850101111561077d57600080fd5b9250929050565b60008060008060006060868803121561079c57600080fd5b85356107a781610720565b9450602086013567ffffffffffffffff8111156107c357600080fd5b6107cf88828901610738565b909550935050604086013567ffffffffffffffff8111156107ef57600080fd5b6107fb88828901610738565b969995985093965092949392505050565b6000806000806060858703121561082257600080fd5b843561082d81610720565b9350602085013561083d81610720565b9250604085013567ffffffffffffffff81111561085957600080fd5b61086587828801610738565b95989497509550505050565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561089957600080fd5b81516108a481610720565b9392505050565b6000602082840312156108bd57600080fd5b81356108a481610720565b6001600160a01b03938416815291909216602082015260408101919091526060019056fea26469706673582212204ca90c4c4886648f1408d5a27bd043a068270b995e0b5866c96c9ce5aa3b1abd64736f6c634300081b0033

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061004c5760003560e01c806321e5fa7314610051578063645550ad1461006657806376d5cd3014610079578063b58adcb21461008c575b600080fd5b61006461005f366004610784565b61009f565b005b61006461007436600461080c565b610289565b610064610087366004610784565b610430565b61006461009a36600461080c565b6105ce565b336100bd576040516348f5c3ed60e01b815260040160405180910390fd5b808381146100de576040516317dbc4cb60e21b815260040160405180910390fd5b60005b8181101561023d5760008484838181106100fd576100fd610871565b9050602002013590506000886001600160a01b0316636352211e836040518263ffffffff1660e01b815260040161013691815260200190565b602060405180830381865afa158015610153573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101779190610887565b9050600088888581811061018d5761018d610871565b90506020020160208101906101a291906108ab565b9050336001600160a01b038316146101cd5760405163130213c560e21b815260040160405180910390fd5b604051632142170760e11b81526001600160a01b038b16906342842e0e906101fd908590859088906004016108c8565b600060405180830381600087803b15801561021757600080fd5b505af115801561022b573d6000803e3d6000fd5b505050508360010193505050506100e1565b50856001600160a01b03167ff208cd4c9596892c9808e2e5af6672a78a6d9339e63099e7a0a7c46ab36cfb698260405161027991815260200190565b60405180910390a2505050505050565b336102a7576040516348f5c3ed60e01b815260040160405180910390fd5b8060005b818110156103db5760008484838181106102c7576102c7610871565b9050602002013590506000876001600160a01b0316636352211e836040518263ffffffff1660e01b815260040161030091815260200190565b602060405180830381865afa15801561031d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103419190610887565b9050336001600160a01b0382161461036c5760405163130213c560e21b815260040160405180910390fd5b6040516323b872dd60e01b81526001600160a01b038916906323b872dd9061039c9084908b9087906004016108c8565b600060405180830381600087803b1580156103b657600080fd5b505af11580156103ca573d6000803e3d6000fd5b5050505082600101925050506102ab565b50836001600160a01b0316856001600160a01b03167f731fa37880446004f33e9142d3adb387777d7566aad46269d636504e9b4344a68360405161042191815260200190565b60405180910390a35050505050565b3361044e576040516348f5c3ed60e01b815260040160405180910390fd5b8083811461046f576040516317dbc4cb60e21b815260040160405180910390fd5b60005b8181101561023d57600084848381811061048e5761048e610871565b9050602002013590506000886001600160a01b0316636352211e836040518263ffffffff1660e01b81526004016104c791815260200190565b602060405180830381865afa1580156104e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105089190610887565b9050600088888581811061051e5761051e610871565b905060200201602081019061053391906108ab565b9050336001600160a01b0383161461055e5760405163130213c560e21b815260040160405180910390fd5b6040516323b872dd60e01b81526001600160a01b038b16906323b872dd9061058e908590859088906004016108c8565b600060405180830381600087803b1580156105a857600080fd5b505af11580156105bc573d6000803e3d6000fd5b50505050836001019350505050610472565b336105ec576040516348f5c3ed60e01b815260040160405180910390fd5b8060005b818110156103db57600084848381811061060c5761060c610871565b9050602002013590506000876001600160a01b0316636352211e836040518263ffffffff1660e01b815260040161064591815260200190565b602060405180830381865afa158015610662573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106869190610887565b9050336001600160a01b038216146106b15760405163130213c560e21b815260040160405180910390fd5b604051632142170760e11b81526001600160a01b038916906342842e0e906106e19084908b9087906004016108c8565b600060405180830381600087803b1580156106fb57600080fd5b505af115801561070f573d6000803e3d6000fd5b5050505082600101925050506105f0565b6001600160a01b038116811461073557600080fd5b50565b60008083601f84011261074a57600080fd5b50813567ffffffffffffffff81111561076257600080fd5b6020830191508360208260051b850101111561077d57600080fd5b9250929050565b60008060008060006060868803121561079c57600080fd5b85356107a781610720565b9450602086013567ffffffffffffffff8111156107c357600080fd5b6107cf88828901610738565b909550935050604086013567ffffffffffffffff8111156107ef57600080fd5b6107fb88828901610738565b969995985093965092949392505050565b6000806000806060858703121561082257600080fd5b843561082d81610720565b9350602085013561083d81610720565b9250604085013567ffffffffffffffff81111561085957600080fd5b61086587828801610738565b95989497509550505050565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561089957600080fd5b81516108a481610720565b9392505050565b6000602082840312156108bd57600080fd5b81356108a481610720565b6001600160a01b03938416815291909216602082015260408101919091526060019056fea26469706673582212204ca90c4c4886648f1408d5a27bd043a068270b995e0b5866c96c9ce5aa3b1abd64736f6c634300081b0033

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
[ 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.