You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following describes standard functions a token contract can implement.
This ERC describes a simpler version of the ERC20 standard token contract, removing transfer approvals.
Motivation
Some dapps need interfaces simpler than ERC20 as a base for their tokens. We've seen some projects take this approach already (1). The main problems with ERC20 standard token are:
Lack of reference implementation and tests
Higher complexity due to approve functionality, which not all projects need.
Returns boolean values to signal failure instead of throwing.
Function totalSupply() could just be implemented as a state variable in most cases.
Abstract
The following describes standard functions a token contract can implement.
This ERC describes a simpler version of the ERC20 standard token contract, removing transfer approvals.
Motivation
Some dapps need interfaces simpler than ERC20 as a base for their tokens. We've seen some projects take this approach already (1). The main problems with ERC20 standard token are:
approve
functionality, which not all projects need.totalSupply()
could just be implemented as a state variable in most cases.Specification
totalSupply
The total token supply
balanceOf
Get the account balance of another account with address
who
transfer
Send
value
amount of tokens to addressto
Transfer event
Triggered when tokens are transferred.
Reference Implementation and tests
https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/token/ERC20Basic.sol
https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/token/BasicToken.sol
https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/test/BasicToken.js
As you can see, the code is simpler and very concise. Comments appreciated.
Originally posted by @maraoz in ethereum/EIPs#179
The text was updated successfully, but these errors were encountered: