Homework on ERC20 token standard.
1. What are the benefits of setting a token standard like ERC20?
Using a standard enables all developers to code under the same rules. This allows all participants of the network to create fully compatible tokens so that exchanges can easily add and give support to.
2. What functions are in the ERC20 Token Standard Interface and what do they do?
-
totalSupply() gives the total supply of the token.
-
balanceOf() gives the balance of a specific address as output
-
allowance() gives as output, the number of tokens allowed to be transferred from a given address
-
transfer() takes in the address of the receiver and the funds which are to be sent to the account
-
approve() function. You can approve someone to spend from your account.
-
transferFrom() function. It takes the address of the sender, the address of the receiver, as well as the number of tokens to be transferred. Also gives an output of the success or failure of the transfer.