Smart contracts for Toucan (Polygon) - Regen bridge.
Regen Ledger is a blockchain dedicated for Earth sustainability and Regenerative Finance. Regen Ledger provides a registry for all type of eco credits. Vintages are represented as batches and grouped into credit classes.
Toucan is a digitized carbon registry implemented on Polygon blockchain. The carbon vintages are implemented as ERC20 smart contracts, called TCO2.
This repository provides smart contracts for a one way bridge from TCO2 carbon credits to Regen Ledger Eco Credits Batches. In parallel we are working for a fully decentralized 2-way bridge.
- burning TCO2 whitelisted tokens and issuing bridge events.
(TODO, more description will come)
- node > 16.0
git submodule update --init --recursive
yarn
To update the submodule to its latest version
git submodule update --remote --merge
- get some Polygon Mumbai testnet tokens from faucet.
yarn build
The bridge deploy script expects two environment variables. 1) address of the bridge controller: BRIDGE_CONTROLLER_ADDRESS
and 2) address of the Toucan contract registry: TOUCAN_CONTRACT_REGISTRY_ADDRESS
Before you deploy you should set up your signer wallet. You can either pass a mnemonic via the environment variable MNEMONIC
or create a mnemonic.txt
file with the seed phrase in the root of the repository.
The mnemonic is not required for local deployments. The script will automatically default to the first signer account from Hardhat.
yarn hardhat run scripts/toucan-bridge.js --network <network>
Add a Polygonscan API key in your .env
file, then run:
yarn hardhat verify <contract_address> --contract contracts/ToucanRegenBridge.sol:ToucanRegenBridge <issuer_address> <nct_address> --network <network>
See the LICENSE file.