UNIT 5 ERC Token
UNIT 5 ERC Token
• totalSupply: A method that defines the total supply of your tokens, When this limit is
reached the smart contract will refuse to create new tokens.
• balanceOf: A method that returns the number of tokens a wallet address has.
• transfer: A method that takes a certain amount of tokens from the total supply and
gives it to a user.
• transferFrom: Another type of transfer method which is used to
transfer tokens between users.
• approve: This method verifies whether a smart contract is allowed to
allocate a certain amount of tokens to a user, considering the total
supply.
• allowance: This method is exactly the same as the approved method
except that it checks if one user has enough balance to send a certain
amount of tokens to another
• C20 standard defines a set of functions to be implemented by all ERC20 tokens so as to
allow integration with other contracts, wallets, or marketplaces. This set of functions is
rather short and basic.
• In addition to standard ERC20 functions, many ERC20 tokens also feature additional fields and some have become a de-facto part of the ERC