Skip to content
RED SAGSkills
easyBlockchain Developer interview question

What is the ERC-20 standard and what are its key functions and events?

What the interviewer wants to hear

  • Standard interface for fungible tokens
  • balanceOf, totalSupply, transfer
  • approve, allowance, transferFrom for delegated spending
  • Transfer and Approval events
  • Why standards matter for wallets and exchanges

Model answer

ERC-20 is a standard interface for fungible tokens, meaning every unit is the same, like rupees or shares. Because every token follows the same interface, wallets, exchanges and DeFi apps can support any new token without custom code. The key read functions are totalSupply, balanceOf(account) and allowance(owner, spender), plus optional name, symbol and decimals. transfer(to, amount) moves tokens from the caller. For contracts to spend tokens on a user's behalf, the user calls approve(spender, amount), and the spender later calls transferFrom(from, to, amount). The standard events are Transfer and Approval, which wallets and indexers use to track balances. In practice I build tokens on OpenZeppelin's audited implementation. I also handle non-standard tokens carefully, for example ones that do not return a bool, using SafeERC20.

Can you answer it under time pressure?

Take a timed easy round and get scored on every answer.

Start mock interview

More easy Blockchain Developer questions