B
blockchainx424
Member
- PG Coin
- 2,743
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:
- totalSupply: This function specifies the total number of token supply. Once this limit is reached, the contract will refuse to create more tokens.
- balanceOf: This function is used so that the contract returns the number of tokens that a wallet has.
- allowance: Function that checks if a user has enough tokens so that they can send them to another user.
- transfer: The function that allows you to obtain a number of tokens from the initial supply and give them to a user.
- approve: Function that checks if the contract can send a number of tokens to a user taking into account the total supply of tokens.
- transferFrom: This feature enables the transfer of tokens between different users.