Homework on ERC20 token standard.
- What are the benefits of setting a token standard like ERC20?
It enables communication between tokens and wallets by setting standards.
- What functions are in the ERC20 Token Standard Interface and what do they do?
The balanceOf()
function provides the number of tokens held by a given address
The transfer()
function transfers a number of tokens directly from the message sender to another address, not used in paying for functions within the smart contract. To pay for these functions we have to use approve()
to allow SC use tokens defined as “allowance” and when any function is called SC is using transferFrom()
to take tokens from allowance as a payment.
The allowance()
is providing info about how many tokens are in the allowance.