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

skripnike/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

For current deployments, see the ./deployments folder.

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

# install dependencies
yarn install

# test the contract
yarn test

# generate documentation
yarn doc

# deploy the contract
yarn hardhat deploy --network <network>

# verify the contract
yarn hardhat verify:offsetHelper --network mumbai --address <address where Offset Helper was deployed>

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 52.8%
  • Solidity 46.7%
  • JavaScript 0.5%