-
It’s important to standardize tokens (like ERC20) in order to facilitate interoperability between wallets and smart contracts. Supporting a single standard for one token type accelerates adoption because, otherwise, each programmer would code functions using different naming conventions and developers would need to spend a lot of time and resources adding individual support for each smart contract.
-
A few basic functions in ERC20 tokens include:
totalSupply () - specifies how many tokens can be in circulation
balanceOf () - reveals how many tokens belong to a specific address
transfer () - sends tokens from one address to another (can also be useful for burning tokens, by sending them to the 0 address; also useful for minting new tokens from the 0 address as the source)
allowance () - provides the number of tokens allowed to be transferred from a given address by another address (I read “Understanding ERC-20 token contracts” but am not 100% clear on the purpose of this function or how it works - can someone provide an easy-to-follow example of when this function would be needed?)