It’s 2021, and it’s time to get into the world of blockchain.
What is Ethereum?
ERC-20 tokens are designed for and used solely on the Ethereum platform. Ethereum is a decentralised network of computers which uses Ether (ETH). Ether is a popular digital currency. Ethereum functions as a virtual machine that can produce smart contracts. In the event that you would like to learn more, you can do so here.
What are smart contracts?
Smart contracts are programmes stored on a blockchain which help automate the execution of an agreement. This means participants can be immediately certain of the outcome, without any intermediary’s involvement or time loss.
ERC-20 is used for all smart contracts on the Ethereum blockchain. It defines a list of standards that all Ethereum tokens should adhere to. This means that they can all be shared, exchanged for other tokens, or transferred to a crypto-wallet easily. It also ensures that token developers are more empowered. By having a universal standard accepted by the community, new tokens can be put on an exchange or transferred to a wallet automatically. Remember, the automated aspect of the Ethereum network is important in order to remain decentralised.
The Ethereum community created these standards with three optional rules, and six mandatory.
- Token Name
- Decimal (up to 18)
Let’s break down the optional rules first. So, the new token must have a token name, symbol and decimal. However, we want the decimal to be divisible so that the minimum a token-holders investment can be is 0.1. This way, everything is kept simple.
So, what do the mandatory rules mean exactly?
TotalSupply identifies the total number of tokens created. Basically, how many tokens are in circulation.
Transfer allows a certain amount of tokens to be transferred from the TotalSupply to a user’s account.
BalanceOf returns the certain amount of tokens to a user’s account.
TransferFrom functions as the way a user transfers tokens to another user.
Approve checks a transaction against the TotalSupply of tokens. It makes sure none are missing and none are extra.
Allowance verifies that the user’s account has the balance to invest. It will cancel the transaction if there are insufficient tokens.