Discover more of Apescan's tools and services in one place.
Contract Source Code:
File 1 of 1 : TransferToNull.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IERC721A { function ownerOf(uint256 tokenId) external view returns (address); function transferFrom(address from, address to, uint256 tokenId) external; } contract TransferToNull { address public nftContractAddress; // Constructor to set the NFT contract address constructor(address _nftContractAddress) { nftContractAddress = _nftContractAddress; } // Function to transfer multiple NFTs to the null address (0x0) function transferToNull(uint256[] calldata tokenIds) external { IERC721A nft = IERC721A(nftContractAddress); for (uint256 i = 0; i < tokenIds.length; i++) { uint256 tokenId = tokenIds[i]; // Ensure the caller owns the token address owner = nft.ownerOf(tokenId); require(owner == msg.sender, "You must own the token to transfer it"); // Transfer the token to the null address (0x0) nft.transferFrom(owner, address(0), tokenId); } } }
Please enter a contract address above to load the contract details and source code.
Please DO NOT store any passwords or private keys here. A private note (up to 100 characters) can be saved and is useful for transaction tracking.
This website uses cookies to improve your experience. By continuing to use this website, you agree to its Terms and Privacy Policy.