← All NFT Flashcard Decks

Skills Flashcards

7 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 7 Skills flashcards as text
  1. What is the role of the SafeMath library in older Solidity contracts?

    Answer: To prevent integer overflow and underflow errors

    SafeMath provided checked arithmetic to avoid overflow/underflow, though Solidity 0.8+ now has this built in.

  2. Which Solidity data structure is most gas-efficient for mapping token IDs to owner addresses?

    Answer: mapping(uint256 => address)

    A mapping provides O(1) lookups without iterating, making it efficient for token-to-owner relationships.

  3. What does a 'proxy pattern' enable in smart contract development?

    Answer: Upgrading contract logic while preserving state and address

    Proxy patterns separate storage from logic, allowing the logic contract to be upgraded without losing data or changing the address.

  4. When testing an NFT contract, what is the purpose of a 'testnet' like Sepolia?

    Answer: To deploy and test contracts using valueless test ETH before mainnet

    Testnets let developers deploy and validate contracts with free test ETH, avoiding real-money risk before mainnet launch.

  5. Which function in ERC-721 transfers a token while checking the recipient can handle NFTs?

    Answer: safeTransferFrom()

    safeTransferFrom verifies the recipient is capable of receiving ERC-721 tokens, preventing tokens from being locked.

  6. What is a common reason to use 'royalties' (EIP-2981) in an NFT contract?

    Answer: To pay creators a percentage on secondary sales

    EIP-2981 standardizes royalty information so creators can earn a percentage when their NFT resells.

  7. What is the benefit of writing automated tests for an NFT contract before deployment?

    Answer: Tests catch logic errors and vulnerabilities since deployed contracts are immutable

    Because deployed smart contracts are immutable, thorough tests catch bugs before they become permanent and costly.