A hardhat repo that is a collection of Solidity contract examples that integrate with or demonstrate the use of Toucan's contracts and infrastructure. Some of these may be used in production and we'll provide links to their prod repos below.
The OffsetHelper
contract implements helper functions that simplify the carbon offsetting (retirement) process. It's production version (with actualized related documentation) which is actively maintained can be found here. You can still use the version found in this repo as an example for inspiration purposes.
- Install the required packages:
yarn
- Copy
.env.example
to.env
and modify values of the required environment variables:POLYGON_URL
/MUMBAI_URL
to specify custom RPC endpoints for Polygon Mainnet, respectively, the Mumbai Testnet.PRIVATE_KEY
andPOLYGONSCAN_KEY
in order to deploy contract and publish source code on polygonscan.
Use the following commands to compile, test and deploy the contracts:
yarn compile
yarn test # test using a polygon fork
yarn coverage # test using a polygon fork with coverage report
yarn deploy
Documentation can be auto-generated from the contract's natspec in ./docs/ using
yarn doc
Deploy the contract locally with:
yarn hardhat --network hardhat deployOffsetHelper --verify false