1. Developer Overview
RECEN provides a comprehensive developer ecosystem for building on top of the renewable energy certificate platform. Our open smart contract architecture allows developers to integrate REC issuance, trading, and verification into their own applications.
2. Technology Stack
Frontend: Next.js 16 (App Router), React 19, TypeScript, Tailwind CSS v4, shadcn/ui.
Web3: wagmi v2, viem, RainbowKit for wallet connection.
Smart Contracts: Solidity 0.8.27, OpenZeppelin, Hardhat 2, deployed on Ethereum Sepolia Testnet.
Tokens: ERC-721 (RECNFT) for certificates, ERC-20 (USDT, RECEN) for payments.
3. Getting Started
Clone the repository, install dependencies with npm install, and create a .env.local file with the required environment variables (WalletConnect Project ID, contract addresses, RPC URL).
Run npm run dev to start the development server. The platform connects to Sepolia Testnet by default.
To compile smart contracts: npx hardhat compile. To deploy: npx hardhat run scripts/deploy.ts --network sepolia.
4. Smart Contract Architecture
RECNFT.sol: ERC-721 + ERC-721Enumerable. Stores certificate metadata on-chain (name, energyType, recAmount, co2Saved, imageURI, issuer, issuedAt). Anyone can mint. Includes tokensOfOwner() for efficient enumeration.
RECMarketplace.sol: Handles listings, purchases (USDT/RECEN), and fee collection. Fixed pricing model with configurable fees. Owner can adjust prices and fee rates.
MockUSDT.sol / MockRECEN.sol: Test ERC-20 tokens with public mint functions for Sepolia testing.
5. Integration Guide
To integrate RECEN into your DApp: (1) Import ABIs from src/lib/contract.ts; (2) Use wagmi hooks (useReadContract, useWriteContract) for contract interactions; (3) Contract addresses are available via environment variables (NEXT_PUBLIC_REC_CONTRACT_ADDRESS, etc.).
For backend integration: Use ethers.js or viem to interact with contracts directly. All contract ABIs are generated in the artifacts/ directory after Hardhat compilation.
6. API Reference
For detailed contract function signatures, parameters, and return values, see the API Documentation page at /docs/api.
7. Contributing
We welcome contributions from the developer community. Please submit issues and pull requests through our GitHub repository. For major changes, please open an issue first to discuss the proposed changes.