Skip to content

About

An open-source Hardhat project providing a boilerplate and reference implementation for tokenizing Recycling Credits as Real-World Assets (RWAs). This repository is a developer tool designed to accelerate the creation of circular economy applications on EVM chains.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

RWA for Recycling Credits: A Solidity Smart Contract Prototype

If you find our work valuable, please consider giving us a star on GitHub!

Language Blockchain Verified Contract License Solidity Version Framework


Quick Start

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:

  1. Clone & Install:

    git clone https://github.com/ecolab-web3/recyclingcredits-rwa-solidity.git
    cd recyclingcredits-rwa-solidity
    npm install
  2. Configure Your Environment:

    • This project requires an .env file with a private key and RPC URL.
    • Rename the .env.example file in the root directory to .env.
    • Open the new .env file and add your test wallet's private key.
  3. 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.
  4. 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 E-co.lab Links


About The Project

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.


Live Interaction & dApps

Please make sure your wallet (e.g., MetaMask) is connected to the Avalanche Fuji Testnet to interact with the project components.

dApp Prototypes

Contract Details


Development Environment & Testing

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.js and Chai. The suite consists of 16 passing tests covering all contract functions and logic paths.

Test Coverage

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

Overview

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.

Key Concepts Implemented

  • Role-Based Access Control: The contract uses AccessControl with a CERTIFIER_ROLE that is exclusively authorized to mint new credit NFTs.
  • Credit Minting: A user with the CERTIFIER_ROLE can mint new NFTs using data generated by the Recycler's Portal.
  • Credit Retirement: The NFT owner can "retire" their credit via the retire function, 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.

Next Steps

This prototype is a functional foundation. For a production-ready project, the next steps focus on usability, data integrity, and security.

1. Implement an Upgradable Contract using the Proxy Pattern

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.

2. Build a Full dApp Ecosystem: Marketplace and Portals

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.

3. Develop a Secure Oracle for Proof Verification

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.

4. Undergo a Professional Security Audit

Before any mainnet deployment, a full audit by a reputable third-party security firm is essential to ensure the safety of the system.


Ecosystem Recognition

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


Contributing

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".


License

This project is licensed under the MIT License. See the LICENSE file for details.

About

An open-source Hardhat project providing a boilerplate and reference implementation for tokenizing Recycling Credits as Real-World Assets (RWAs). This repository is a developer tool designed to accelerate the creation of circular economy applications on EVM chains.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages