Developers

Last updated: April 17, 2026

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 BSC Mainnet (Chain ID 56).

Tokens: ERC-1155 (RECNFT1155) for certificates, BEP-20 (USDT, RECEN, both 18 decimals) 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, BSC RPC URL).

Run npm run dev to start the development server. The platform connects to BSC Mainnet by default.

To compile smart contracts: npx hardhat compile. To deploy: npx hardhat run scripts/deploy-mainnet.ts --network bscMainnet (ensure mainnet-wallet.json is present with a funded deployer key).

4. Smart Contract Architecture

RECNFT1155.sol: ERC-1155 based REC certificate. Stores per-token metadata on-chain (name, energyType, co2PerUnit, imageURI, issuer, issuedAt). Anyone can mint. mergeRECs() consolidates multiple same-type batches into one with CO₂-weighted averages.

RECMarketplace1155.sol: Handles listings, partial-quantity purchases (USDT/RECEN), and differential fees (3%/3% USDT, 1.5%/1.5% RECEN). Guarded by OpenZeppelin ReentrancyGuard with checks-effects-interactions ordering.

Payment tokens (USDT, RECEN) are external BEP-20 contracts on BSC Mainnet — not deployed by RECEN.

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, NEXT_PUBLIC_MARKETPLACE_ADDRESS, NEXT_PUBLIC_USDT_ADDRESS, NEXT_PUBLIC_RECEN_ADDRESS).

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.