Skip to content

DeFi-Coder-News-Letter/FCO2-carbon-credit

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

STATUS: Experimental

FutureCarbonCredit FCO2 Carbon Credit

A an ERC20 token backing by carbon credits - allows certified issuance, transfer and retirement.

How It Works

  1. The project admin purchases carbon credits from a certifier such as Gold Standard
  2. The project admin upload the certificate purchase details to IPFS using a service like Pinata and gets the file address called the ipfs Hash. For example: the ipfs hash QmUEGNbwdjLjk7C2hh2WDFwkNjixszwH3B1sFWqLseXTPi can be used to look up a certificate receipt at any ipfs gateway like https://gateway.pinata.cloud/ipfs/QmUEGNbwdjLjk7C2hh2WDFwkNjixszwH3B1sFWqLseXTPi or https://cloudflare-ipfs.com/ipfs/QmUEGNbwdjLjk7C2hh2WDFwkNjixszwH3B1sFWqLseXTPi
  3. The project admin uses a smart contract like Etherscan dApp explorer to call the depositCarbonCreditsFromCertificate function on the Carbon Credit ERC20 token with the value of the certificate. Note that the token has 18 decimals of precision so it should be the value of carbon credits times 10^18.
  4. The project admin now has the value of the certificate in their account. Other people can view the event log to see the carbon certificate ipfs hash and look it up on ipfs to verify the certificate.
  5. A contributor contributes work to a Climate Impact Project on CoMakery
  6. The admin pays the contributor in carbon credits
  7. The contributor transfers some of their tokens to an exchange to sell
  8. The contributor retires the remaining carbon credit tokens to offset some of their own carbon footprint.
  9. The contributor has impacted the climate and a new carbon credit certificate is issued to the Project Admin
  10. The Project Admin deposits the carbon credit certificate in the CoMakery Climate Project and the cycle continues.

Deployment

(1) Copy the .env file with

cp .env.example .env

(2) Then fill in the .env values

for your Infura Ethereum node API key and Ethereum private key.

(3) Install truffle globally

npm install -g truffle

(4) Deploy the smart contracts

Deploy to ropsten testnet or another Ethereum blockchain network like mainnet with:

truffle deploy --compile-all --reset --network ropsten-infura

(5) Write down your the contract address

So you can find the address on Etherscan or other networks. It will appear in the deploy output and look like this:

   Replacing 'CarbonCredit'
   ------------------------
   ...
   > contract address:    0x85ACf61EE09C3FC771013Cd2f5ddF891DA1C8D01
   ...

(6) Publish the verified code to Etherscan

Use the Verify On Etherscan library.

You will need to create an account on Etherscan. Change the --network arugument to the network you deployed to (e.g. ropsten, mainnet, etc):

API_KEY=<your_etherscan_api_key> npx verify-on-etherscan --network ropsten  ./build/contracts/*

About

A an ERC20 token backed by carbon credits - allows certified issuance, transfer and retirement

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%