1. What are the benefits of setting a token standard like ERC20?
There are several benefits.
Mainly related to allowing wallets to provide token balances for hundreds of different tokens and creating a means for exchanges to list more tokens by providing nothing more than the address of the token’s contract.
It also allows smart contracts to act very similarly to a conventional cryptocurrency like Bitcoin, or Ethereum. (can be sent, received, checked of its total supply, and checked for the amount that is available on an individual address)
2. What functions are in the ERC20 Token Standard Interface and what do they do?
ERC20 defines the functions:
balanceOf
- allows a smart contract to store and return the balance of the provided address .
totalSupply
, allows an instance of the contract to calculate and return the total amount of the token that exists in circulation.
transfer
- allows the owner of the contract send a given amount of the token to another address just like a conventional cryptocurrency transaction.
transferFrom
- allows a smart contract to automate the transfer process and send a given amount of the token on behalf of the owner.
approve
- the owner of the contract authorizes, or approves , the given address to withdraw instances of the token from the owner’s address.
allowance
- provides the number of tokens allowed to be transferred from a given address by another given address.
It also has a few optional fields like the token name, symbol, and the number of decimal places with which it will be measured.