Skip to content

A smart contract that abstracts away the process of offsetting CO2 on-chain. It takes you from USDC (or other tokens) to offset CO2.

License

Notifications You must be signed in to change notification settings

yieldgate/OffsetHelper

 
 

Repository files navigation

Offset Helper

This contract has the purpose to simplify the carbon offsetting process.

What it does in more exact terms is it abstracts the process of retiring TCO2, which normally looks like so:

  • user exchanges USDC for BCT/NCT tokens at one of the DEXs (Uniswap, Sushiswap, etc. depending on network)
  • user interacts with the BCT/NCT token contract to redeem the tokens for TCO2
  • user interacts with the TCO2 token contract to retire the TCO2

With the OffsetHelper contract, the user only needs to interact with the OffsetHelper contract, which will take care of the rest in a single transaction.

Deployments

Contract Polygon Mumbai
OffsetHelper 0xFAFcCd01C395e4542BEed819De61f02f5562fAEa 0x30dC279166DCFB69F52C91d6A3380dCa75D0fCa7

OffsetHelper

The OffsetHelper contract implements helper functions that simplify the carbon offsetting (retirement) process.

See ./docs/OffsetHelper.md for detailed documentation.

Development

Preqrequisites

  1. Install the required packages:
    yarn
    
  2. Copy .env.example to .env and modify values of the required environment variables:
    1. POLYGON_URL/MUMBAI_URL to specify custom RPC endpoints for Polygon Mainnet, respectively, the Mumbai Testnet.
    2. PRIVATE_KEY and POLYGONSCAN_KEY in order to deploy contract and publish source code on polygonscan.

Commands

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

About

A smart contract that abstracts away the process of offsetting CO2 on-chain. It takes you from USDC (or other tokens) to offset CO2.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 69.8%
  • Solidity 29.6%
  • Other 0.6%