Skip to main content

What Are the Key Functions Defined in the ERC-20 Standard?

The ERC-20 standard defines a set of six mandatory functions that a compliant smart contract must implement. These include totalSupply() to get the total number of tokens, balanceOf() to get a user's balance, and transfer() to send tokens to another address.

It also includes approve() and transferFrom() which allow a user to authorize another contract to spend tokens on their behalf. The allowance() function checks how many tokens a spender is allowed to withdraw from an owner's account.

These functions ensure all ERC-20 tokens behave in a predictable way.

What Is the Difference between ERC-20 and ERC-721 Token Standards?
What Is the Role of the ERC-20 Standard’s Approve() Function in Setting a Token Allowance?
Are There Alternative Designs to Token Allowances That Could Offer Better Security?
What Is the Function of the “Approve” Method in the ERC-20 Standard?