Skip to content

ToucanProtocol/regen-bridge

 
 

Repository files navigation

Toucan Bridge

Smart contracts for Toucan (Polygon) - Regen bridge.

Summary

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 two way bridge for TCO2 carbon credits between Regen Ledger Eco Credits Batches and an EVM network (currently Polygon).

Functionality

  • burning TCO2 whitelisted tokens and issuing bridge events.

(TODO, more description will come)

Setup

Dependencies

  • node > 16.0

Installation

git submodule update --init --recursive
yarn

To update the submodule to its latest version

git submodule update --remote --merge

Contributing

  • get some Polygon Mumbai testnet tokens from faucet.

Build

yarn build

Deploy

Copy .env.example to .env and set the desired configuration in .env.

Testnets/Matic

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.

yarn hardhat run scripts/deploy.js --network [matic|mumbai]

Locally

The mnemonic is not required for local deployments. The script will automatically default to the first signer account from Hardhat.

Run a Hardhat node in one terminal:

yarn hardhat node

In another terminal deploy the bridge and all Toucan-related contracts:

yarn hardhat run scripts/deploy-local.js --network localhost

Verify in Polygonscan

Add a Polygonscan API key in your .env file, then run:

yarn hardhat verify <contract_address> --network <network> --constructor-args ./scripts/arguments-<network>.js

License

See the LICENSE file.

About

Toucan - Regen Ledger bridge smart contracts

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 79.0%
  • Solidity 20.8%
  • Shell 0.2%