How amandeep4567/carbon-crunch works
Project type and purpose
• Carbon-Crunch is a full-stack decentralized application (dApp) built with Next.js (React) for the front end and Hardhat/Ethers.js for blockchain integration.
• It tokenizes carbon credits into ERC-20/ERC-721-like tokens, features “stacking” mechanisms (staking) and user-facing games to boost engagement and liquidity in the Carbon Market.
File structure
• Top-level directories:
• Components/ – React UI components
• Context/ – React Context providers for on-chain data and sale parameters
• pages/ – Next.js page routes (_app.js, index.js)
• public/ & styles/ – static assets (CSS, fonts, JS libraries)
• contracts/ – Solidity smart contracts
• scripts/ – deployment scripts (scripts/deploy.js)
• test/ – Hardhat tests (test/Lock.js)
• Utils/ – shared JavaScript helpers (e.g., formatting, API calls)
• Configuration files: hardhat.config.js, next.config.js, package.json
README for additional insights
• The README highlights three pillars: tokenized credits, user games, stacking/discounts.
• No pre-drawn architecture is provided, so we’ll capture front-end, blockchain, testing, and deployment flows.
Elements
– Labels: “User Browser”, “Next.js Frontend”, “React Context”, “Ethers.js RPC Provider”, “Ethereum Node”, “Smart Contracts”
• User → Frontend (UI events)
• Frontend → Context → Ethers.js (function calls)
• Ethers.js → Ethereum Node (JSON-RPC)
• Ethereum Node ↔ Smart Contracts (state changes, events)
• Deployment Script → Ethereum Node → Smart Contracts
• UI components in blue rectangles
• Context and utils in green rectangles
• Blockchain integration (Ethers.js, Hardhat) in orange
• Smart contracts and Ethereum node in gray
Detail without overthinking
• Both runtime interactions (user flows) and development/deployment processes.
• The goal is a comprehensive, accurate depiction of how the dApp’s front end, blockchain contracts, and deployment pipeline fit and work together.