Now we can start writing the functions defined by the ERC20 standard. A set of 6 mandatory functions for the creation of the token and its subsequent integration into marketplaces and crypto wallets. All ERC20 tokens have at least these 6 functions:
1. totalSupply: This function specifies the total number of token supply. Once this limit is reached, the contract will refuse to create more tokens.
2. balanceOf: This function is used so that the contract returns the number of tokens that a wallet has.
3. allowance: Function that checks if a user has enough tokens so that they can send them to another user.
4. transfer: The function that allows you to obtain a number of tokens from the initial supply and give them to a user.
5. approve: Function that checks if the contract can send a number of tokens to a user taking into account the total supply of tokens.
6. transferFrom: This feature enables the transfer of tokens between different users.
In addition to this, we will implement 2 additional events. A first event that notifies when a quantity of tokens passes from a source to a destination and a second event that notifies the approval of the allocation function.
visit: https://www.blockchainx.tech/erc20-token-development/