ERC20 Token Standard
Simple explanation
Adding feature for smart contract to send, receive, check for total supply, check if the amount is available to transfer. This will gives us knowledge of the total supply of coins in circulation, wallet balance of a particular token and the ability to transfer a token.
Fuctions defined by the standard
'balanceOf ' Allows smart contract to store and return the balance of the provided address. Accepts address as parameters and it will be public
'totalSupply' Allows an instance of the contract to calculate and return the total amount of the token that exists in circulation
'Transfer' Lets you transfer tokens between accounts
'transferFrom' Allows smart contracts to automate the transfer process and send a given amount of tokens on behalf of the owner. A transfer is sending tokens (money) between the accounts. The contract can send a certain amount of tokens to another address.
'approve' The owner of the contract author authorizes or approves the given address to withdraw tokens. Variable
msg
is a field provided by wallets and external apps to interact with the contract. You can find this interaction inmsg.sender
field'Allowance' and a few optional fields like token name, symbol, number of decimal places in which it will be measured
Optional fields
Token name
Token Symbol
Number of Decimals
Source: https://news.earn.com/the-anatomy-of-erc20-6ab09d4206a5
Further reading
Implementation: https://eips.ethereum.org/EIPS/eip-20
Original proposal: https://github.com/ethereum/EIPs/issues/20
Last updated