-
What are the benefits of setting a token standard like ERC20?
Each token smart contract is written in the same way. This allows any tokens to be easily re-used by other applications such as wallets and exchanges.
-
What functions are in the ERC20 Token Standard Interface and what do they do?
function name() public view returns (string)
Returns the name of the token.
function symbol() public view returns (string)
Returns the symbol of the token.
function decimals() public view returns (uint8)
Returns the number of decimals the token uses.
function totalSupply() public view returns (uint256)
Returns the total token supply.
function balanceOf(address _owner) public view returns (uint256 balance)
Returns the amount of tokens an address has.
function transfer(address _to, uint256 _value) public returns (bool success)
Transfers _value amount of tokens to address _to.
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success)
Transfers _value amount of tokens from address _from to address _to.
function approve(address _spender, uint256 _value) public returns (bool success)
Allows _spender to withdraw from your account multiple times, up to the _value amount.
function allowance(address _owner, address _spender) public view returns (uint256 remaining)
Returns the amount which _spender is still allowed to withdraw from _owner.