ERC20 practices in Solidity
Aim: To make ERC20 practices
Code:
4 People
You can see in solidity code.
We would like to fix the max token amount for all user. For example, the max amount will be 10000 tokens.
Go to the code.
We use transfer function for limiting the users’ token amounts.
Could you see that in practice ?
Compile and Deploy it.
You must be the owner . Please control ACCOUNT section
owner is 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4
Click the transfer function and put the Alice’s address and value.
Remember our requirements
require(balances[to] <= 10000);
require(balances[to] + value < 10000);
You can not sent 5000 tokens.
You try to sent 4999 tokens to Alice.
It is working. Alice is happy. Alice has 9999 tokens.
Dr.Engin YILMAZ
Ankara
2022