Deploying and testing the ERC-20 token smart contract
You are already familiar with the steps to test a smart contract, but here is another method of testing the MySimpleToken
contract.
The tests for the MySimpleToken
smart contract are in the test
folder and a file named MySimpleToken.test.js
, which contains the following test cases:
- Test case 1 to create a token with a name
- Test case 2 to create a token with a symbol
- Test case 3 to check that tokens have the correct number of decimals
- Test case 4 to check whether the token has a valid total supply
- Test case 5 to check if users are able to query account balances
- Test case 6 to transfer the right amount of tokens to/from an account
- Test case 7 to see if the smart contract emits a transfer event with the right arguments
- Test case 8 to allow for allowance approvals and queries
- Test case 9 to emit an approval event with the right arguments
- Test case 10 to allow an approved sender to transfer...