Token Standards and Creation Flashcards
7 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 7 Token Standards and Creation flashcards as text
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.
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.
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.
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).
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.
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.
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.