This project presents a decentralized solution for managing carbon credits using Solidity, Web3, and a Flask-based web interface. It simulates a real-world carbon trading ecosystem where a government authority issues credits to industries, which can then consume, monitor, or transfer these credits securely on the blockchain.
Carbon credits are essential in the fight against climate change, allowing organizations to offset their emissions through regulated credit systems. This system ensures transparency and auditability of:
- Credit issuance by a central authority (government)
- Usage logging by industries
- Credit transfers between industries
- Real-time visibility into credit balances
- Deploys the smart contract and becomes the authoritative issuer
- Issues carbon credits to any registered industry
- Monitors total credits in circulation
- Views industry balances and usage statistics through a dashboard
- View their available, used, and transferred carbon credits
- Use credits to simulate emissions
- Transfer credits to other industries within the system
- Access a real-time dashboard for balance visualization
The CarbonCreditSystem contract supports:
-
issueCarbonCredits(address _industry, uint _amount)
Government function to assign credits to industries. -
useCarbonCredits(uint _amount)
Industry function to burn credits as per emissions. -
transferCredits(address _to, address _from, uint _amount)
Allows credit movement between industries. -
getCarbonCreditBalance(address _industry)
Returns remaining carbon credits. -
getUsedCarbonCredits(address _industry)
Tracks utilized credits. -
getCarbonTransferCreditBalance(address _industry)
Tracks transferred credits.
The Flask app provides role-based access and Web3 integration:
- Login System: Admin and industry users authenticate with hardcoded credentials.
- Admin Dashboard: Displays balances of all industries, with options to issue credits.
- Industry Dashboard: Displays current balances and allows credit usage and transfers.
- Web3 Integration: Communicates with the smart contract deployed on an Ethereum-compatible testnet (e.g., BSC Testnet via Infura).
- Decentralized governance for trustless credit allocation
- Real-time dashboards for both admin and industry
- Secure credit transfers verified by smart contract logic
- Role-based access control using Flask-Login
| Component | Technology |
|---|---|
| Blockchain | Ethereum + Web3 |
| Smart Contract | Solidity |
| Web Backend | Flask |
| Cryto Wallet | Meta-Mask |
- Ensure the smart contract is deployed on a supported Ethereum-compatible network.
- Update the contract address (
add) and endpoint in the Flask app for full functionality. - Metamask or any Ethereum wallet can be used for live testing with real accounts.