Skip to content

CO2NEX ECO Wallet - Solidity contracts: tokens, escrow, leaf gamification

License

CO2NEX-Wallet/co2nex-wallet-smart-contracts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

63 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌍 CO2NEX Wallet Smart Contracts β€” v1.0.0-alpha

Version License Polygon Hardhat OpenZeppelin Status


🌱 CO2NEX Wallet Smart Contracts power the next generation of environmental finance β€” tokenizing Carbon Credits, Water Credits, Biodiversity Offsets, and more using ERC-1155 on the Polygon blockchain, with built-in escrow and Ethereum interoperability bridges.

  • Project: CO2NEX Wallet Smart Contracts
  • Version: v1.0.0-alpha
  • Network: Polygon, Ethereum
  • License: MIT
  • Status: Alpha β€” Internal Testing Only

πŸ’¬ Community Support & Discussions

GitHub Discussions Ask Questions Feature Requests Announcements

πŸ“’ Join the CO2NEX Smart Contract Discussions!

  • πŸš€ Collaborate on improvements
  • 🀝 Get support and ask questions
  • πŸ’‘ Share ideas and feedback
  • πŸ”” Stay updated with announcements and releases

Engage with developers, contributors, and the climate tech blockchain community to build the future of transparent, tokenized climate action.


πŸ’Έ Support CO2NEX

If you love what we're building β€” open-source blockchain solutions for environmental impact β€” you can support the project:

πŸͺ™ Crypto Donations

  • ETH: 0x9d1Df1C2CABB2338301b6eA25b10760f3F437fF5
  • USDC / USDT ERC20: 0x9d1Df1C2CABB2338301b6eA25b10760f3F437fF5
  • Polygon (MATIC): 0x3a27102ac1AF27cD3eE29688a413dc7d1333A00D
  • Polygon - USDC / USDT: 0x3a27102ac1AF27cD3eE29688a413dc7d1333A00D
  • Bitcoin (BTC): bc1qh7ry3889lc9y9x8hn5uy25c6705eym3ks02jet
  • BNB: 0xEa6E44e3C7a16E08Ffc5b89f61933C7E39132c5B

❀️ GitHub Sponsor

Become a sponsor and help fund CO2NEX development:
πŸ‘‰ GitHub Sponsors


🌍 Tags for SEO / SERP

#CO2NEX #BlockchainClimateAction #SmartContracts #Polygon #Ethereum #HIBCToken #ESG #CarbonCredits #Web3 #ClimateTech #SustainabilityBlockchain #TokenizedClimate #TrustlessEscrow #Solidity #ERC1155 #GreenTech #OpenSourceBlockchain #CarbonMarkets


πŸ”— Quick Links



πŸ” SEO Keywords

CO2NEX, Carbon Credits Blockchain, Polygon Smart Contracts, ERC-1155 Escrow, Tokenized Environmental Assets, Sustainable Blockchain, Ethereum Bridge, Carbon Credit Token, HIBC Token, Web3 Climate Solutions


πŸ—οΈ Project Structure

co2nex-wallet-smart-contracts
β”œβ”€β”€ contracts
β”‚   β”œβ”€β”€ CO2NEX1155.sol           # ERC-1155 token contract
β”‚   β”œβ”€β”€ Escrow1155.sol           # Escrow contract
β”‚   └── Migrations.sol           # (Optional) deployment helper
β”œβ”€β”€ scripts
β”‚   β”œβ”€β”€ deploy.js                # Deploy contracts
β”‚   β”œβ”€β”€ mint.js                  # Mint tokens
β”‚   └── interact.js              # Run contract interactions
β”œβ”€β”€ test
β”‚   β”œβ”€β”€ token1155.test.js        # ERC-1155 unit tests
β”‚   └── escrow1155.test.js       # Escrow unit tests
β”œβ”€β”€ .devcontainer
β”‚   └── devcontainer.json        # VSCode remote container setup
β”œβ”€β”€ .gitignore
β”œβ”€β”€ hardhat.config.js
β”œβ”€β”€ package.json
β”œβ”€β”€ README.md
β”œβ”€β”€ .env.example

πŸ’Ž Contract System

Contract Purpose
CO2NEX1155.sol ERC-1155 Multi-Asset Token for HIBC credits
Escrow1155.sol Secure escrow for tokenized credit transactions
Migrations.sol Deployment helper (optional)

πŸͺ™ Token IDs & Asset Types

Token ID Asset Type
1 Carbon Credits
2 Water Credits
3 Biodiversity Credits
βœ… Fully Extendable

πŸš€ Quick Start

1️⃣ Clone Repository

git clone https://github.com/CO2NEX/co2nex-wallet-smart-contracts.git
cd co2nex-wallet-smart-contracts

2️⃣ Install Dependencies

npm install

3️⃣ Create Environment File

cp .env.example .env

Then edit .env with your values:

POLYGON_RPC_URL=https://polygon-rpc.com
ETHEREUM_RPC_URL=https://mainnet.infura.io/v3/YOUR_INFURA_KEY
PRIVATE_KEY=YOUR_WALLET_PRIVATE_KEY

4️⃣ Compile Smart Contracts

npx hardhat compile

5️⃣ Deploy to Local Hardhat Network

npx hardhat run scripts/deploy.js --network localhost

➑️ Deploy to Polygon Mainnet/Testnet

npx hardhat run scripts/deploy.js --network polygon

πŸ” Escrow Flow β€” How It Works

  1. Buyer:

    • Calls createDeal() passing the seller, token ID, and amount.
    • Tokens are transferred from buyer to the escrow contract.
  2. Escrow Holds Tokens:

    • Tokens are securely held in the Escrow1155 contract until release.
  3. Release Deal:

    • Buyer OR contract owner calls releaseDeal(dealId).
    • Tokens are transferred to the seller.

πŸ§ͺ Testing

Run all unit tests:

npx hardhat test

Test files:

  • test/token1155.test.js
  • test/escrow1155.test.js

🌐 Network Configuration

  • Local Development: Hardhat
  • Mainnet/Testnet: Polygon (MATIC) + Ethereum bridge-ready

βš™οΈ Tooling

  • Solidity: ^0.8.24
  • Hardhat: Development environment
  • OpenZeppelin: Security libraries
  • Node.js: Scripting

πŸ›οΈ Devcontainer

Runs perfectly in GitHub Codespaces or Gitpod with pre-configured VSCode settings.


🏷️ Tags

CO2NEX, Polygon Blockchain, ERC1155, Carbon Credit Token, HIBC, Escrow Smart Contract, Environmental Assets, Sustainability Blockchain, Crypto Carbon Trading, Hardhat, Web3


πŸ“œ License

MIT License β€” open-source for environmental impact.


⚠️ Status

Version: v1.0.0-alpha
Not Production Ready β€” Internal Testing Only.


🌍 CO2NEX Team

"Building the world's first tokenized climate finance infrastructure β€” for a cleaner planet."