Minting and Burning Mechanics Flashcards
6 cards from real NFT practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 6 Minting and Burning Mechanics flashcards as text
What is the most common and standardized method for 'burning' an ERC-721 NFT, effectively removing it from circulation?
Answer: Transferring the token to the zero address (0x000...000).
The standard convention for burning a token is to transfer it to the zero address (`address(0)`). This address has no corresponding private key, meaning any assets sent there are permanently irrecoverable and inaccessible, thus effectively removing them from the circulating supply.
A developer is creating an NFT project that requires a presale minting phase for a list of 5,000 allowlisted addresses. Which minting mechanism is the most gas-efficient and secure for verifying a user's eligibility on-chain?
Answer: Requiring the user to provide a cryptographic proof and checking it against a Merkle root stored in the contract.
Using a Merkle tree is the most efficient and secure method for large allowlists. The entire list of addresses is hashed into a single 32-byte Merkle root, which is stored in the contract. A user can then provide a small 'proof' (a few hashes) to demonstrate that their address is part of the tree, without the contract needing to store the entire list, saving significant gas costs.
In a standard OpenZeppelin ERC-721 implementation, after a token with `tokenId` 123 is successfully burned, what is the expected outcome of a subsequent call to the `ownerOf(123)` function?
Answer: The transaction reverts with an 'owner query for nonexistent token' error.
The ERC-721 standard specifies that the `ownerOf` function must revert for any `tokenId` that does not exist. Since burning effectively destroys the token by removing its ownership mapping, querying for its owner afterwards will cause the transaction to fail, as is the expected behavior.
Which of the following describes a 'lazy minting' process in the context of NFTs?
Answer: The NFT's metadata is created, but the on-chain token is only minted when the first purchase or transfer occurs.
Lazy minting is a technique where the expensive on-chain minting transaction is deferred until the moment of the first sale. The NFT's data and a signed voucher from the creator are stored off-chain. The first buyer pays the gas fee to execute the minting function, which verifies the signature and creates the token on their behalf, saving the creator from having to pay gas upfront for unsold items.
A developer implements a public `mint()` function in an ERC-721 contract that increments a counter to assign a new `tokenId`. What is the primary purpose of adding a `require(totalSupply() < MAX_SUPPLY, "Max supply reached")` check at the beginning of this function?
Answer: To enforce a hard cap on the total number of NFTs that can ever be created for the collection.
This `require` statement is a crucial access control mechanism that enforces the scarcity and defined size of an NFT collection. By checking the current total supply against a predefined maximum supply, it prevents the creation of more tokens than were originally promised, which is a key factor in the collection's value proposition.
When implementing a `burn(uint256 tokenId)` function in an ERC-721 contract, which check is essential to ensure that only the rightful owner can destroy their token?
Answer: Confirming that `msg.sender` is the owner or has been approved to manage the token.
To maintain the integrity of token ownership, a burn function must verify that the caller (`msg.sender`) is either the direct owner of the token or has been granted approval by the owner (via `approve` or `setApprovalForAll`). This prevents unauthorized users from destroying assets they do not control.