If you find our work valuable, please consider giving us a star on GitHub!
This repository is a Hardhat-based boilerplate for Recycling Credit RWAs. To get started and scaffold your own project from this template, follow these steps:
-
Clone & Install:
git clone https://github.com/ecolab-web3/recyclingcredits-rwa-solidity.git cd recyclingcredits-rwa-solidity npm install -
Configure Your Environment:
- This project requires an
.envfile with a private key and RPC URL. - Rename the
.env.examplefile in the root directory to.env. - Open the new
.envfile and add your test wallet's private key.
- This project requires an
-
Understand the Contract (Recommended):
- Before deploying, take a moment to read the rest of this README and browse the
contracts/folder. - Understanding the smart contract's logic, its functions, and its purpose is a critical step for any developer.
- Before deploying, take a moment to read the rest of this README and browse the
-
Deploy the Contract:
- Fund your test wallet with some Fuji AVAX from a faucet.
- Run the deployment script:
npx hardhat run scripts/deploy.ts --network fuji
The script will deploy the contract and print its address to your terminal.
- Official Website: ecolab-web3.github.io
- Whitepaper: e-co-lab.gitbook.io/whitepaper
- Discord Community: discord.gg/mrSuw8AfjC
- Twitter: x.com/ecolab_web3
This repository contains a smart contract prototype that tokenizes Recycling Credits as Real World Assets (RWA) on the blockchain, bringing transparency, auditability, and liquidity to the circular economy.
This project has been successfully migrated to a professional Hardhat environment, rigorously tested with 100% code coverage, deployed, and verified on the Avalanche Fuji Testnet.
Please make sure your wallet (e.g., MetaMask) is connected to the Avalanche Fuji Testnet to interact with the project components.
-
Recyclers Portal (Proof Generation): This tool is for cooperatives and originators to generate the necessary data and proof hash for certification.
-
Admin Panel (Credit Minting & Role Management): This secure panel is for certifiers and admins to mint credits and manage roles.
- Network:
Avalanche Fuji Testnet - Contract Address:
0xe18e887380bD90BCEa276747DaD314DfB06c1f4f - Verification: The source code is verified. You can read and interact with it directly on Snowtrace's "Write Contract" Tab.
This project was migrated from Remix IDE to a professional Hardhat environment to ensure quality and reproducibility.
- Framework: Hardhat
- Solidity Version:
0.8.20 - Testing: A comprehensive test suite was developed using
ethers.jsandChai. The suite consists of 16 passing tests covering all contract functions and logic paths.
The project achieved 100% test coverage across all metrics, ensuring every line and logical branch of the contract was verified.
| File | % Stmts | % Branch | % Funcs | % Lines |
|---|---|---|---|---|
| RECYCLINGCREDITS_RWA.sol | 100 | 100 | 100 | 100 |
| All files | 100 | 100 | 100 | 100 |
The core idea is to transform a certified recycling credit into an ERC721 Non-Fungible Token (NFT). Each NFT represents a specific amount of post-consumer material that has been verifiably recycled, turning this right into a liquid, transferable, and transparent digital asset.
- Role-Based Access Control: The contract uses
AccessControlwith aCERTIFIER_ROLEthat is exclusively authorized to mint new credit NFTs. - Credit Minting: A user with the
CERTIFIER_ROLEcan mint new NFTs using data generated by the Recycler's Portal. - Credit Retirement: The NFT owner can "retire" their credit via the
retirefunction, creating an immutable public record of its use. - Transferability: As a standard ERC721 token, the credit can be freely traded on any NFT marketplace until it is retired.
- Security and Transparency: The contract uses standard OpenZeppelin libraries and its code is publicly verified.
This prototype is a functional foundation. For a production-ready project, the next steps focus on usability, data integrity, and security.
To allow for future feature additions or bug fixes without forcing users to migrate to a new contract, the next logical step is to implement an upgradable contract using OpenZeppelin's Upgrades Contracts.
A production version requires dedicated interfaces for each user type, building upon the existing prototypes:
- Marketplace Creation: A frontend (e.g., using React, Vue) that serves as a marketplace where companies can browse available credits and purchase them directly.
- Enhance Admin & Certifier Panel: Transform the prototype panel into a comprehensive dashboard for managing roles and minting credits.
- Enhance Recycler's Portal: Improve the prototype by adding features like a submission history and a direct communication channel to the certifiers.
To automate and decentralize the proof verification process, an oracle could be developed to read government-issued electronic invoices and submit their cryptographic hash (proofHash) to the certifyAndMint function.
Before any mainnet deployment, a full audit by a reputable third-party security firm is essential to ensure the safety of the system.
E-co.lab is a recognized participant in the Avalanche Retro9000 program, a retroactive public goods funding initiative by the Avalanche Foundation. Our project has been approved for the "L1s & Infrastructure Tooling" round and is currently live for community voting by participants in the Avalanche ecosystem.
You can view our official submission and support our mission here: E-co.lab on Retro9000
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
Please feel free to fork the repo and create a pull request, or open an issue with the tag "enhancement".
This project is licensed under the MIT License. See the LICENSE file for details.