ERC223 is a modification of ERC20 token standard.
- Accidentally lost tokens inside contracts: there are two different ways to transfer ERC20 tokens depending on is the receiver address a contract or a wallet address. You should call
transfer
to send tokens to a wallet address or callapprove
on token contract thentransferFrom
on receiver contract to send tokens to contract. Accidentally call oftransfer
function to a contract address will cause a loss of tokens inside receiver contract where tokens will never be accessible. - Inability of handling incoming token transactions: ERC20 token transaction is a call of
transfer
function inside token contract. ERC20 token contract is not notifying receiver that transaction occurs. Also there is no way to handle incoming token transactions on contract and no way to reject any non-supported tokens. - ERC20 token transaction between wallet address and contract is a couple of two different transactions in fact: You should call
approve
on token contract and then calltransferFrom
on another contract when you want to deposit your tokens into it. - Ether transactions and token transactions behave different: one of the goals of developing ERC223 was to make token transactions similar to Ether transactions to avoid users mistakes when transferring tokens and make interaction with token transactions easier for contract developers.
- Provides a possibility to avoid accidentally lost tokens inside contracts that are not designed to work with sent tokens.
- Allows users to send their tokens anywhere with one function
transfer
. No difference whether the receiver is a contract or not. No need to learn how the token contract works for regular users to send tokens. - Allows contract developers to handle incoming token transactions.
- ERC223
transfer
to contract consumes half as much gas as ERC20approve
andtransferFrom
at receiver contract. - Allows to deposit tokens into contract with a single transaction. Prevents extra blockchain bloating.
- Makes token transactions similar to Ether transactions.
ERC223 tokens are backwards compatible with ERC20 tokens. It means that ERC223 supports every ERC20 functionality and contracts or services working with ERC20 tokens will work with ERC223 tokens correctly.
ERC223 tokens should be sent by calling transfer
function on token contract with no difference whether the receiver is a contract or a wallet address. If the receiver is a wallet, ERC223 token transfer will act the same to a ERC20 transfer. If the receiver is a contract, ERC223 token contract will try to call tokenFallback
function on receiver contract. If there is no tokenFallback
function on receiver contract transaction will fail. tokenFallback
function is an analogue of the fallback
function for Ether transactions. It can be used to handle incoming transactions. There is a way to attach bytes _data
to token transaction similar to _data
attached to Ether transactions. It will pass through token contract and will be handled by tokenFallback
function on receiver contract. There is also a way to call transfer
function on ERC223 token contract with no data argument or using ERC20 ABI with no data on transfer
function. In this case _data
will be an empty bytes array.
ERC223 EIP ethereum/EIPs#223 ERC20 EIP ethereum/EIPs#20