Aim: To make ERC20 practices
basic-solidity/testtoken.sol at main · veridelisi/basic-solidity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below…
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.