โ† All Blockchain Technology Flashcard Decks

Token Standards and Creation Flashcards

21 cards from real Blockchain Technology practice questions. Tap to flip, then mark Knew It or Still Learning โ€” missed cards come back until you master them.

Read the first 20 Token Standards and Creation flashcards as text
  1. Which ERC-20 function returns the number of tokens a spender is still allowed to withdraw from an owner's account?

    Answer: allowance(owner, spender)

    allowance(owner, spender) returns the remaining amount the spender is permitted to withdraw.

  2. In ERC-20, what is the well-known race-condition risk associated with the approve() function?

    Answer: A spender can front-run a changed approval and spend both the old and new amounts

    Changing an existing non-zero allowance lets a spender front-run and use both old and new amounts.

  3. What does the ERC-20 decimals() function actually control?

    Answer: Only the display formatting of token amounts off-chain

    decimals() is purely informational for UI display; the contract stores integer values regardless.

  4. Which event must an ERC-20 token emit when tokens move between addresses?

    Answer: Transfer(from, to, value)

    The Transfer event is required on every token movement, including minting (from the zero address).

  5. Why is it best practice to emit a Transfer event from the zero address when minting ERC-20 tokens?

    Answer: So off-chain indexers can track supply changes consistently

    Emitting Transfer from address(0) lets explorers and indexers treat minting as a standard balance change.

  6. What problem does the ERC-2612 'permit' extension solve for ERC-20 tokens?

    Answer: It allows gasless approvals via off-chain signed messages

    ERC-2612 permit lets users approve spenders with a signature, removing the need for a separate approve transaction.

  7. If an ERC-20 transfer() returns false instead of reverting, what is the recommended way to handle it safely in a calling contract?

    Answer: Use a SafeERC20 wrapper that checks the return value and reverts on failure

    SafeERC20 wrappers verify the boolean return and revert, handling non-compliant tokens correctly.

  8. What is the key difference between ERC-721 and ERC-1155 token standards?

    Answer: ERC-1155 supports both fungible and non-fungible tokens in one contract, ERC-721 only non-fungible

    ERC-1155 is a multi-token standard handling fungible, non-fungible, and semi-fungible tokens together.

  9. Which ERC-721 function returns the owner of a specific token ID?

    Answer: ownerOf(tokenId)

    ownerOf(tokenId) returns the address that currently owns the given NFT.

  10. What is the primary purpose of the ERC-721 tokenURI() function?

    Answer: Return a URI pointing to the token's JSON metadata

    tokenURI() returns a link to metadata describing the NFT, often including name, image, and attributes.

  11. Why does ERC-1155 enable significant gas savings for transferring many tokens?

    Answer: It supports batch operations like safeBatchTransferFrom in a single transaction

    Batch transfer functions let multiple token types and amounts move in one transaction, reducing overhead.

  12. What safety check distinguishes safeTransferFrom from transferFrom in ERC-721?

    Answer: It verifies the recipient contract implements onERC721Received

    safeTransferFrom calls onERC721Received to ensure contract recipients can handle NFTs, preventing locked tokens.

  13. In ERC-1155 metadata, what does the {id} substitution placeholder in a URI represent?

    Answer: The lowercase hex token ID padded to 64 characters

    Clients replace {id} with the 64-character zero-padded lowercase hex token ID to fetch per-token metadata.

  14. Which interface must a contract implement to be recognized as ERC-721 compliant via ERC-165?

    Answer: supportsInterface returning true for the ERC-721 interface ID

    ERC-165's supportsInterface lets contracts advertise that they implement the ERC-721 interface ID.

  15. When deploying a token contract, why is using OpenZeppelin's audited contracts generally preferred over writing from scratch?

    Answer: They reduce the risk of security bugs through community-reviewed, tested code

    Audited libraries lower the chance of introducing vulnerabilities compared to custom implementations.

  16. What is a 'mintable' token, and what access-control risk does it introduce?

    Answer: A token whose supply can be increased; the minter role must be tightly controlled to prevent inflation abuse

    Mintable tokens allow new supply creation, so unrestricted minting permissions can be exploited to dilute holders.

  17. What does making a token 'burnable' allow?

    Answer: Holders or authorized roles to permanently destroy tokens, reducing total supply

    Burning sends tokens out of circulation (often to address zero), decreasing totalSupply.

  18. Why might a token contract include a 'pausable' feature?

    Answer: To halt transfers during an emergency or exploit, buying time to respond

    Pausable lets an admin freeze token activity temporarily if a vulnerability or attack is detected.

  19. What is the main trade-off of deploying an upgradeable (proxy-based) token contract?

    Answer: It adds flexibility but introduces centralization and proxy-related security risks

    Upgradeable proxies allow logic changes but rely on an admin and add storage-layout and trust risks.

  20. During token creation, what does setting an initial supply in the constructor and minting it to the deployer accomplish?

    Answer: It allocates the entire starting supply to the deployer's address at deployment

    Constructor minting credits the deployer with the initial supply, which can then be distributed.

How this page was made: written with AI tools and published by Nathan Beja, founder of Practice Test Geeks, who is responsible for its content. We have not yet matched this exam's facts to an official source, so confirm fees, dates and rules with the exam body. Not reviewed by a subject-matter expert. Editorial policy