- The latest state of the code is on the
main
branch. - Create a new branch for each feature or issue you are working on.
- Do the work, write good commit messages, and read the style guide.
- Submit a pull request.
- Pull requests should pass all CI tests before being merged.
- Pull requests should be reviewed by at least one other developer.
- Pull requests are merged into
main
by a maintainer after being reviewed. - If you are a maintainer, please use "Squash and merge" to merge the pull request.
- Delete the branch after the pull request is merged.
Before running any command, you need to create a .env
file and set a PRIVATE_KEY
, for example:
PRIVATE_KEY=1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
Deploy the contracts to Hardhat Network:
$ npx hardhat run scripts/deploy.ts --network goerli
Verify the contracts to XXXScan like etherscan:
$ npx hardhat verify --network polygon --contract contracts/gridex.sol:Gridex <Contract Address>
Compile the smart contracts with Hardhat:
$ npx hardhat compile
Lint the Solidity code:
$ npx hardhat check
Run the Mocha tests:
$ npx hardhat test
Generate the code coverage report:
$ npx hardhat coverage
See the gas usage per unit test and average gas per method call:
$ REPORT_GAS=true npx hardhat test
Output Solidity contract size with hardhat:
$ REPORT_SIZE=true npx hardhat compile
Delete the smart contract artifacts, the coverage reports and the Hardhat cache:
$ npx hardhat clean