ERC20 standard specification
Last updated
Last updated
Standard specifies the interface with 6 functions and 2 events, but the implementation of functions is left out of specification.
The interface of the functions in the Solidity code is as follows:
1. totalSupply() public view returns (uint256 totalSupply)
– obtén el suministro total de tokens
2.- balanceOf(address _owner) public view returns (uint256 balance)
obtenga el saldo de la cuenta con dirección _propietario
3. transfer(address _to, uint256 _value) public returns (bool success)
– enviar _valor cantidad de tokens a la dirección _a
4. transferFrom(address _from, address _to, uint256 _value) public returns (bool success)
– enviar _valor cantidad de tokens desde la dirección _desde a la dirección _a
5. approve(address _spender, uint256 _value) public returns (bool success)
– permita que _spender retire dinero de su cuenta, varias veces, hasta la cantidad _value
6. allowance(address _owner, address _spender) public view returns (uint256 remaining)
– devuelve la cantidad que _spender todavía puede retirar de _owner
The events (in robustness code) are defined:
1. Transfer(address indexed _from, address indexed _to, uint256 _value)
– se activa cuando se transfieren tokens
2. Approval(address indexed _owner, address indexed _spender, uint256 _value)
– se activa cuando se llama a la función de aprobación.
CODE