PledgeChain is a Web3 micro-crowdfunding platform for local initiatives.
Core idea:
- Anyone creates a campaign in seconds.
- Donors pledge USDC through a two-step wallet flow (approve + pledge).
- Funds are escrowed in smart contracts.
- If the target is missed, donors can claim refunds.
The project now runs directly from the repository root.
app/: Next.js App Router pagescomponents/: wallet, campaign, and pledge UI componentsconstants/abi.ts: contract addresses and frontend ABIcontracts/: Solidity contracts (PledgeChain.sol,MockUSDC.sol)test/: Hardhat tests
Install dependencies:
npm installStart the web app:
npm run devOpen http://localhost:3000.
Compile contracts:
npm run hh:compileRun tests:
npm run hh:testDeploy to Base Sepolia:
npm run hh:deploy:base-sepoliaVerify on BaseScan (optional):
npm run hh:verify:base-sepolia -- <DEPLOYED_CONTRACT_ADDRESS> <USDC_TOKEN_ADDRESS>Create your local env file from .env.example and fill values:
BASE_SEPOLIA_RPC_URLDEPLOYER_PRIVATE_KEYUSDC_TOKEN_ADDRESSBASESCAN_API_KEY(optional, only for verification)
Before using real on-chain data, set deployed addresses in:
constants/abi.ts
Replace placeholder values for:
CONTRACT_ADDRESSUSDC_ADDRESS
- Wallet connect/disconnect in UI
- Dynamic campaign loading from contract
- Create campaign transaction flow
- Two-step pledge modal (approve + pledge)
- Claim funds (creator, target reached)
- Claim refund (donor, after failed campaign)
- Hardhat test suite for core escrow flows