NFT Art NFT Minting and Smart Contracts 5 — Questions and Answers
Question 1: What is the role of an 'event' in an NFT smart contract, such as the Transfer event?
- Events trigger automatic payments to artists
- Events emit logs to the blockchain that external applications can listen to and index (Correct answer)
- Events pause the contract during upgrades
- Events store large media files on-chain
Correct answer: Events emit logs to the blockchain that external applications can listen to and index
Solidity events emit log entries on the blockchain that off-chain applications like marketplaces can monitor to track transfers and other contract activity.
Question 2: An NFT artist wants to create a collection where each token's image is generated based on its token ID. Where is this generation logic best placed for maximum decentralization?
- On a centralized company server
- Entirely on-chain within the smart contract using SVG generation (Correct answer)
- On IPFS with a single pinned file
- In the buyer's browser using JavaScript
Correct answer: Entirely on-chain within the smart contract using SVG generation
Fully on-chain SVG generation makes the artwork permanently available as long as the blockchain exists, requiring no external servers.
Question 3: What is the purpose of the 'setApprovalForAll' function in ERC-721?
- To make all tokens publicly transferable by anyone
- To authorize an operator address to manage all of the owner's NFTs (Correct answer)
- To set royalties for all tokens in a collection
- To freeze all tokens from being transferred
Correct answer: To authorize an operator address to manage all of the owner's NFTs
setApprovalForAll grants or revokes an operator's permission to transfer all tokens owned by the caller, commonly used when listing on marketplaces.
Question 4: What is a 'soulbound' NFT in the context of art and smart contracts?
- An NFT that can only be purchased with cryptocurrency earned through gaming
- A non-transferable NFT permanently bound to the original recipient's wallet (Correct answer)
- An NFT with animated artwork that reacts to music
- An NFT that grants the owner lifetime royalties
Correct answer: A non-transferable NFT permanently bound to the original recipient's wallet
Soulbound tokens (SBTs) are NFTs designed to be non-transferable, making them suitable for representing credentials, memberships, or identity-linked art.
Question 5: Why might an NFT smart contract include a 'withdraw' function?
- To remove the NFT from marketplace listings
- To allow the contract owner to retrieve ETH accumulated from mint sales (Correct answer)
- To return NFTs to the artist after a set time
- To reduce the contract's on-chain storage
Correct answer: To allow the contract owner to retrieve ETH accumulated from mint sales
ETH sent to the contract during minting accumulates in the contract's balance, and a withdraw function lets the owner transfer those proceeds to their wallet.
Question 6: What distinguishes a 'soul' wallet from a standard EOA (Externally Owned Account) when interacting with NFT contracts?
- Soul wallets can mint unlimited NFTs for free
- Soul wallets are smart contract wallets with programmable recovery and transaction logic (Correct answer)
- Soul wallets automatically receive royalties from all NFT sales
- Soul wallets bypass gas fees through a special protocol
Correct answer: Soul wallets are smart contract wallets with programmable recovery and transaction logic
Smart contract wallets like soul wallets offer features such as multi-sig, social recovery, and batched transactions that standard private-key wallets cannot.
Question 7: A collector notices that an NFT's tokenURI returns an HTTP URL instead of an IPFS URI. What is the primary concern?
- HTTP URLs load faster, making this preferable
- The metadata could change or disappear if the hosting server goes offline or the owner modifies it (Correct answer)
- HTTP URLs cannot store image data
- The NFT cannot be resold on secondary markets if using HTTP
Correct answer: The metadata could change or disappear if the hosting server goes offline or the owner modifies it
HTTP URLs are mutable and dependent on a server remaining online, meaning the artwork and metadata could be altered or lost, undermining the NFT's value.
What is the role of an 'event' in an NFT smart contract, such as the Transfer event?