Skip to content

sohailblockchain/Carbon-Credit-Tokenization

Repository files navigation

Carbon Credit Tokenization DApp

Production-ready ERC20-based Carbon Credit tokenization platform with expiring token batches and burn mechanics.

This decentralized application (DApp) allows users to:

  • Connect MetaMask wallet
  • View token balance
  • Track token expiry
  • Approve burn after expiry
  • Interact with an on-chain Carbon Credit smart contract

🌍 Project Overview

This project demonstrates a blockchain-based carbon credit token system where:

  • Carbon credits are tokenized as ERC20 tokens
  • Tokens are issued with expiry timestamps
  • Expired tokens can be approved for burning
  • Wallet holders can track their token batches

The system combines:

  • Smart contract token logic (Solidity)
  • Expiry-based batch tracking
  • On-chain burn mechanism
  • Web3 frontend integration using Ethers.js

🔗 Smart Contract Integration

Contract Address: 0x848386ee769f188777d2B0c63c8EDe41D6996ee3

The contract includes:

  • issueTokens(address to, uint256 amount, uint256 expiryTimestamp)
  • burnExpiredTokens(address holder)
  • getBatches(address user)
  • approveBurn(uint256 index)
  • Standard ERC20 functions (transfer, approve, balanceOf, totalSupply)

The token uses batch-based accounting to track:

  • Amount
  • Expiry timestamp
  • Burn approval status

🧠 Architecture

User (MetaMask) ↓ React Frontend (Ethers.js) ↓ Ethereum RPC Provider ↓ Carbon Credit Smart Contract

Frontend Layer

  • Wallet connection (MetaMask)
  • Balance retrieval
  • Token symbol detection
  • Expiry display
  • Burn approval toggle
  • Transaction execution

Smart Contract Layer

  • ERC20 standard token
  • Expiry-based token batches
  • Controlled burn functionality
  • Ownership management

🏗️ Tech Stack

  • React (Create React App)
  • Ethers.js
  • Solidity (ERC20-based token)
  • MetaMask
  • Ethereum-compatible network (e.g., Sepolia)

🚀 Features

  • ✅ Wallet connection via MetaMask
  • ✅ On-chain token balance retrieval
  • ✅ Dynamic token symbol detection
  • ✅ Expiry tracking
  • ✅ Burn approval mechanism
  • ⚠️ Burn logic placeholder (UI implemented, contract call can be finalized)

⚙️ Environment Requirements

  • Node.js 16+
  • MetaMask extension
  • Ethereum testnet (Sepolia recommended)
  • Deployed smart contract

🚀 Getting Started

1️⃣ Install Dependencies

npm install

2️⃣ Run Development Server

npm start

Open: http://localhost:3000


🔒 Security Notes

  • Ensure correct network selection in MetaMask
  • Contract address must match deployed contract
  • Burn function must be implemented carefully to prevent unauthorized destruction
  • Expiry logic should be validated on-chain (not only frontend)

📈 Use Cases

  • Carbon credit marketplaces
  • ESG compliance tracking
  • Green asset tokenization
  • Expiring compliance tokens
  • On-chain sustainability auditing

⚙️ Design Principles

  • Transparency via on-chain batch tracking
  • Expiry-based compliance enforcement
  • Smart contract controlled burn
  • Web3-native UX

📌 Future Improvements

  • Full burn function integration
  • Admin issuance dashboard
  • Batch visualization UI
  • Event indexing with The Graph
  • Backend analytics layer
  • Multi-chain deployment

👨‍💻 Author

Sohail Ahmed
Senior Blockchain Engineer | Smart Contracts | DeFi Systems


⚠️ Disclaimer

This project is for demonstration and educational purposes.
Always audit smart contracts before production deployment.

About

ERC20-based carbon credit tokenization DApp with expiry-based token batches, burn logic, and MetaMask integration using Ethers.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors