It is simple example of the usage of token-test-suite library for ERC20 token full test coverage.
You can find more in the appropriate article on Medium.
For development purposes, you will need Node.js and a package manager – npm. For the development, the following versions were used:
Node.js– v12.18.3npm– 6.14.6
Run the command $ npm install to install all the dependencies specified in package.json.
For the deployment process to be successfully performed, manually created .env file with filled-in parameters should be present at the root of the project. You need the following to be filled:
Dev settings
DEV_MNEMONICPrivate key for the deployment.INFURA_ID. Infura API key.GAS_PRICE. Set the gas price for the deployment transaction.
Contract settings
UNIQUE_TOKEN_HOLDERAddress that will receive the total supply of Unique tokenUNIQUE_TOKEN_SUPPLYTotal supply of Unique token
Use $ npm run build to compile the smart-contracts.
$ npm run dev:lint to run Solidity and JavaScript linters and check the code for stylistic bugs.
$ npm run dev:coverage to run the unit-tests coverage utility.
$ npm run dev:contract-size to run the compiled contracts size check.
$ npm run ganache to start a local Ganache node.
Run $ npm run dev:ganache to start the Ganache development network. Perform tests with $ npm run test to run all tests from the test/ directory.
Before proceeding with the deployment process, make sure you have set up the .env file.
Run $ npm run deploy --network <network_name> with <network_name> replaced with testnet/mainnet name to deploy the smart-contracts.