Skip to content

hedigardi/pledgechain

Repository files navigation

PledgeChain

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.

Project Structure

The project now runs directly from the repository root.

  • app/: Next.js App Router pages
  • components/: wallet, campaign, and pledge UI components
  • constants/abi.ts: contract addresses and frontend ABI
  • contracts/: Solidity contracts (PledgeChain.sol, MockUSDC.sol)
  • test/: Hardhat tests

Quick Start

Install dependencies:

npm install

Start the web app:

npm run dev

Open http://localhost:3000.

Smart Contract Commands

Compile contracts:

npm run hh:compile

Run tests:

npm run hh:test

Deploy to Base Sepolia:

npm run hh:deploy:base-sepolia

Verify on BaseScan (optional):

npm run hh:verify:base-sepolia -- <DEPLOYED_CONTRACT_ADDRESS> <USDC_TOKEN_ADDRESS>

Environment Variables

Create your local env file from .env.example and fill values:

  • BASE_SEPOLIA_RPC_URL
  • DEPLOYER_PRIVATE_KEY
  • USDC_TOKEN_ADDRESS
  • BASESCAN_API_KEY (optional, only for verification)

Frontend Contract Configuration

Before using real on-chain data, set deployed addresses in:

  • constants/abi.ts

Replace placeholder values for:

  • CONTRACT_ADDRESS
  • USDC_ADDRESS

Current Feature Set

  • 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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors