mint(), ownership or
approve / transferFrompattern of ERC20).
contract MyContract is IERC223Recipientto make a contract capable of accepting ERC223 token transactions. A contract that does not support IERC223Recipient interface can receive tokens if this contract implements a permissive fallback function (this method of token receiving is not recommended). If a contract does not implement IERC223Recipient
tokenReceivedfunction and does not implement a permissive fallback function then this contract can not receive ERC223 tokens.
contract MyToken is ERC223Mintableto make your token mintable. The address used to deploy this contract will receive Minter functionality and will be allowed to assign new minters and increase the token totalSupply.
contract MyToken is ERC223Burnableto make your token burnable. Allows any address to burn its tokens by calling the
burnfunction of the contract. There is no possibility to burn someone else’s tokens in this implementation.
transferto send tokens to a wallet address or call
approveon the token contract and then
transferFromon the receiving contract to send tokens to the contract. Accidentally calling
transferon a contract address will result in a loss of tokens in the receiving contract.
transferfunction in the token contract. ERC20 token contract does not notify the receiver that the transaction occurs. Also, there is no way to handle incoming token transactions on the contract and no way to reject any non-supported tokens.
approveon one token contract and then call
transferFromon another contract when you want to deposit your tokens into it. In fact, address-to-contract transfer is a couple of two different transactions in ERC20. It also costs twice more gas compared to ERC223 transfers. In ERC223, the address-to-contract transfer is a single transaction, just like the address-to-address transfer.
transferfunction. No difference if the receiver is a contract or not. No need to learn how the token contract works for an ordinary user to send tokens.
transferfunction on token contract with no difference if the receiver is a contract or a wallet address.
tokenReceivedfunction on the receiver contract. If there is no
tokenReceivedfunction on the receiver contract, the transaction will fail.
tokenReceivedfunction is analogue of
fallbackfunction for Ether transactions. It can be used to handle incoming transactions.
bytes _datato token transactions, similar to the _data attached to Ether transactions. It will pass through token contract and will be handled by
tokenReceivedfunction on the receiver contract. There is also a way to call
transferfunction on ERC223 token contract with no data argument or using ERC20 ABI with no data on
transferfunction. In this case
_datawill be empty bytes array.
transfer ()function whenever they want to transfer their tokens. It doesn’t matter if the user is depositing to a contract or sending to an externally owned account.
approve ()then call
deposit ()(which is internally calling
transferFrom ()to withdraw approved tokens). Token transaction will automatically be handled at the exchange contract.
tokenReceivedwhen performing a transaction to a contract.