- ERC-20 is a fungible token standard, which has a set of basic guidelines, that all smart contracts on the ETH network must adhere to regarding token implementation. Benefits include:
a) interoperability: since tokens created using ERC-20 follow the same guidelines, they can then be used to exchange information with other 3rd party services such as wallets, which follow ERC-20.
b) prevents confusion: users need to be in compliance with ERC-20 to create and issue new tokens, instead of each of them having to create in their own manner, this deters confusion and complexity in the network, and streamlines the process with other 3rd party services accepting ERC-20.
- There are a total 6 mandatory (f) that a user must adhere to while token implementation:
a) totalSupply: this is used to set the total supply of a token in circulation
b) balanceOf: tells/shows the total balance of a token that a user/given address has
c) transfer: transfers a certain no. of tokens from the total supply to a user/given address
d) transferFrom: transfers a certain no. of tokens between two users/given addresses who have them
e) approve: verifies a smart contract to ensure it can transfer a certain no. of tokens to a user taking into account the total supply
f) allowance: checks and verifies if a user has sufficient tokens to send a certain no. of them to another user.