Hey!
I am here to explain about ERC20 Token. When a person entered in Blockchain world, he frequently heard the term ERC20 Token, so what is this ERC20?
ERC20 is a standard, which has a set of functions that are implemented by all ERC20 Tokens. Those set of functions are following.
function totalSupply() public view returns (uint256);
function balanceOf(address tokenOwner) public view returns (uint);
function allowance(address tokenOwner, address spender)public view returns (uint);
function transfer(address to, uint tokens) public returns (bool);
function approve(address spender, uint tokens) public returns (bool);
function transferFrom(address from, address to, uint tokens) public returns (bool);
There is also a variable named Decimal, it is fixed to 18 by default for this standard. We have to set the standard because we know that we need standards when it is a matter of trading, and transactions at the global level.
ERC20 Token’s Functions-
- Total supply is count of all minted tokens. In simple words minting refers to generating tokens.
It is a call function which means you do not need to pay any fee for this function, it is just like fetching data from Blockchain. - Function balanceOf shows the balance of that address which one is provided to this function as a parameter. It is also called a function.
- Approve function takes 2 params, the 1st one is spender and 2nd is number of tokens.
By using this function you can approve anyone that he can spend number of tokens from your account.
For this function you have to pay some fee because you are writing(changing) some data on the blockchain. - Allowance is a call function that returns to you how many numbers of tokens a token spender address is allowed by the owner of tokens.
- In the Transfer function a token owner can transfer tokens from his/her address to another address, he just needs the receiver’s address and the number of tokens to be sent by the owner.
- TranferFrom function is just a use case of approve function. An approved user can transfer tokens from the owner’s address to another address.
That's all from my side.
Thank you!

Comments
Post a Comment