APE Price: $0.95 (-0.00%)

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...75879162025-01-05 13:27:1925 days ago1736083639IN
0xB508EE6c...c5a9F5B8b
0 APE0.0235423225.42069
Batch Transfer T...67160292024-12-15 16:24:1346 days ago1734279853IN
0xB508EE6c...c5a9F5B8b
0 APE0.0031888925.42069
Batch Transfer T...67159642024-12-15 16:22:1446 days ago1734279734IN
0xB508EE6c...c5a9F5B8b
0 APE0.0014158325.42069
Batch Transfer T...64682032024-12-10 8:26:3951 days ago1733819199IN
0xB508EE6c...c5a9F5B8b
0 APE0.005044425.42069
Batch Transfer T...48874992024-11-21 14:37:2470 days ago1732199844IN
0xB508EE6c...c5a9F5B8b
0 APE0.0050428825.42069
Batch Transfer T...47189592024-11-19 23:19:0772 days ago1732058347IN
0xB508EE6c...c5a9F5B8b
0 APE0.0032459625.42069
Batch Transfer T...46706842024-11-19 15:08:2972 days ago1732028909IN
0xB508EE6c...c5a9F5B8b
0 APE0.005044425.42069
Batch Transfer T...46605212024-11-19 12:48:0072 days ago1732020480IN
0xB508EE6c...c5a9F5B8b
0 APE0.0033115525.42069
Batch Transfer T...46516462024-11-19 9:58:4772 days ago1732010327IN
0xB508EE6c...c5a9F5B8b
0 APE0.0120546625.42069
Batch Transfer T...46509712024-11-19 9:45:2972 days ago1732009529IN
0xB508EE6c...c5a9F5B8b
0 APE0.0031898625.42069
Batch Transfer T...46498962024-11-19 9:25:2672 days ago1732008326IN
0xB508EE6c...c5a9F5B8b
0 APE0.0023025525.42069
Batch Transfer T...46496942024-11-19 9:22:1172 days ago1732008131IN
0xB508EE6c...c5a9F5B8b
0 APE0.0019813625.42069
Batch Transfer T...46443172024-11-19 7:45:5772 days ago1732002357IN
0xB508EE6c...c5a9F5B8b
0 APE0.0031898325.42069
Batch Transfer T...46226332024-11-19 0:25:0573 days ago1731975905IN
0xB508EE6c...c5a9F5B8b
0 APE0.0103764225.42069
Batch Transfer T...46210952024-11-18 23:53:3973 days ago1731974019IN
0xB508EE6c...c5a9F5B8b
0 APE0.0031889425.42069
Batch Transfer T...46204182024-11-18 23:43:1173 days ago1731973391IN
0xB508EE6c...c5a9F5B8b
0 APE0.0047717625.42069
Batch Transfer T...46193212024-11-18 23:23:1473 days ago1731972194IN
0xB508EE6c...c5a9F5B8b
0 APE0.0033106625.42069
Batch Transfer T...46190032024-11-18 23:17:3373 days ago1731971853IN
0xB508EE6c...c5a9F5B8b
0 APE0.0033118525.42069
Batch Transfer T...46189802024-11-18 23:17:0873 days ago1731971828IN
0xB508EE6c...c5a9F5B8b
0 APE0.0033118825.42069
Batch Transfer T...46189592024-11-18 23:16:4173 days ago1731971801IN
0xB508EE6c...c5a9F5B8b
0 APE0.0033109425.42069
Batch Transfer T...46185212024-11-18 23:08:0773 days ago1731971287IN
0xB508EE6c...c5a9F5B8b
0 APE0.0031898325.42069
Batch Transfer T...46184872024-11-18 23:07:2873 days ago1731971248IN
0xB508EE6c...c5a9F5B8b
0 APE0.0033118825.42069
Batch Transfer T...46184592024-11-18 23:06:5173 days ago1731971211IN
0xB508EE6c...c5a9F5B8b
0 APE0.0033118525.42069
Batch Transfer T...46184282024-11-18 23:06:1673 days ago1731971176IN
0xB508EE6c...c5a9F5B8b
0 APE0.0031895525.42069
Batch Transfer T...46182392024-11-18 23:02:4873 days ago1731970968IN
0xB508EE6c...c5a9F5B8b
0 APE0.0056800425.42069
View all transactions

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.