Make sure you have pnpm installed. (How to install)
Before running any command, make sure to install dependencies:
$ pnpm install
Create environment files, and replace environment variables with your own values
cp ../.env.example ../.env
Compile the smart contracts and generate TypeChain artifacts:
$ pnpm clean
$ pnpm compile
Lint the Solidity code:
$ pnpm lint:sol
Run the tests:
$ pnpm test
Generate the code coverage report:
$ pnpm coverage
Generate ABI of contracts.
The generated ABI can be found within abis/
folder
We generate both human readable ABI
pnpm run clear-abi
pnpm run export-abi
See the gas usage per unit test and average gas per method call:
$ REPORT_GAS=true pnpm test
Delete the smart contract artifacts, the coverage reports and the Hardhat cache:
$ pnpm clean
Contracts written here have deploy scripts written in scripts/
directory.
The commands to run them are documented in package.json
.
To get a better grasp of how the scripts can be used to deploy / interact with contracts.
Refer DEPLOY_STEPS.md
Additionally if you are using vscode -> debug scripts are written up in launch.json
to make it easier to debug the script while running them.
Note: This package skeleton was generated using hardhat advanced generator