Skip to content

Latest commit

 

History

History
96 lines (63 loc) · 1.88 KB

CONTRIBUTING.md

File metadata and controls

96 lines (63 loc) · 1.88 KB

Contributing

Development

  1. The latest state of the code is on the main branch.
  2. Create a new branch for each feature or issue you are working on.
  3. Do the work, write good commit messages, and read the style guide.
  4. Submit a pull request.
  5. Pull requests should pass all CI tests before being merged.
  6. Pull requests should be reviewed by at least one other developer.
  7. Pull requests are merged into main by a maintainer after being reviewed.
  8. If you are a maintainer, please use "Squash and merge" to merge the pull request.
  9. Delete the branch after the pull request is merged.

How to compile or test the contracts

Pre Requisites

Before running any command, you need to create a .env file and set a PRIVATE_KEY, for example:

PRIVATE_KEY=1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef

Deploy

Deploy the contracts to Hardhat Network:

$ npx hardhat run scripts/deploy.ts --network goerli

Verify

Verify the contracts to XXXScan like etherscan:

$ npx hardhat verify --network polygon --contract contracts/gridex.sol:Gridex <Contract Address>

Compile

Compile the smart contracts with Hardhat:

$ npx hardhat compile

Lint Solidity

Lint the Solidity code:

$ npx hardhat check

Test

Run the Mocha tests:

$ npx hardhat test

Coverage

Generate the code coverage report:

$ npx hardhat coverage

Report Gas

See the gas usage per unit test and average gas per method call:

$ REPORT_GAS=true npx hardhat test

Report Size

Output Solidity contract size with hardhat:

$ REPORT_SIZE=true npx hardhat compile

Clean

Delete the smart contract artifacts, the coverage reports and the Hardhat cache:

$ npx hardhat clean