-
What are the benefits of setting a token standard like ERC20?
token standards like ERC20 allows wallets and exchanges to be programmed to support any token using that standard. by following a standard, it will allow the applications to communicated smoothly and efficiently.
-
What functions are in the ERC20 Token Standard Interface and what do they do?
name() : returns the name of the token
symbol() : returns the symbol of the token
BalanceOf() : returns the total number of tokens an address holds
transfer(): transfers _value amount of token to address _to and must fire the transfer event. the function should throw an error if the message callers balance does not have enough tokens to spend.
approve(): allows _spender to withdraw from your account multiple times, up to the _value amount. if the function is called again it overwrites the current allowance with _value.
totalSupply(): returns the total token supply
transferFrom(): transfers _value amount of tokens from address _from to address _to, and MUST fire the transfer event. transferFrom allows contracts to transfer tokens on your behalf. for example i want to let a contract transfer tokens on my behalf and/or to charge fees in sub-currencies. should throw an error unless the _from account deliberately authorized the sender of the message via some mechanism.