Skip to content

Cross-chain crowdfunding platform on Stacks with USDCx escrow. Built for Programming USDCx on Stacks Builder Challenge.

Notifications You must be signed in to change notification settings

man-croft/impact-x

Repository files navigation

Impact-X: Cross-Chain Crowdfunding for Bitcoin Builders

Unlock Ethereum liquidity to fund the next generation of Bitcoin & Stacks builders.

Impact-X is a decentralized crowdfunding platform that bridges the gap between Ethereum capital and Stacks innovation. Creators launch campaigns on Stacks and accept USDC donations from Ethereum wallets via Circle's xReserve protocol.

Features

  • Dual Wallet Support: Connect both Stacks (Leather/Xverse) and Ethereum (MetaMask/Rainbow/etc.) wallets
  • Cross-Chain Donations: Donate USDC from Ethereum, receive USDCx on Stacks (~15 min bridge time)
  • Clarity Smart Contracts: Campaign data stored on Stacks blockchain with IPFS metadata
  • 5% Platform Fee: Only charged on successfully funded campaigns
  • Modern UI: Glassmorphism design with warm color palette

Quick Start

Prerequisites

  • Node.js 18+
  • npm or yarn
  • A Stacks wallet (Leather or Xverse)
  • An Ethereum wallet (MetaMask recommended)

1. Install Dependencies

cd frontend
npm install

2. Configure Environment

Copy the example environment file:

cp .env.example .env

The .env is pre-configured with:

  • WalletConnect Project ID
  • Testnet network settings

3. Run Development Server

npm run dev

Open http://localhost:5173 in your browser.

4. Deploy Smart Contract (Required for full functionality)

See DEPLOYMENT.md for detailed instructions.

Quick version:

cd contracts
clarinet check                    # Verify contract compiles
clarinet deployments generate --testnet
clarinet deployments apply -p deployments/default.testnet-plan.yaml

Then update the contract address in frontend/src/lib/stacks.ts.

Get Test Tokens

For testing on Sepolia + Stacks Testnet:

Token Faucet
Sepolia ETH (for gas) https://cloud.google.com/application/web3/faucet/ethereum/sepolia
Sepolia USDC https://faucet.circle.com
Stacks STX (testnet) https://explorer.hiro.so/sandbox/faucet?chain=testnet

Project Structure

impact-x/
├── contracts/                    # Clarity smart contracts
│   ├── Clarinet.toml            # Clarinet configuration
│   └── contracts/
│       └── campaign-registry.clar
├── frontend/                     # React frontend
│   ├── src/
│   │   ├── components/          # Reusable UI components
│   │   │   ├── Layout.tsx       # App shell with navbar
│   │   │   ├── CampaignCard.tsx # Campaign grid cards
│   │   │   ├── DonateModal.tsx  # Bridge donation flow
│   │   │   ├── ProgressBar.tsx  # Funding progress
│   │   │   └── WalletConnect.tsx # Wallet buttons
│   │   ├── hooks/               # Custom React hooks
│   │   │   ├── useBridge.ts     # Bridge transaction hook
│   │   │   └── useStacksWallet.ts
│   │   ├── lib/                 # Utilities and integrations
│   │   │   ├── bridge.ts        # xReserve depositToRemote
│   │   │   ├── stacks.ts        # Contract interactions
│   │   │   ├── constants.ts     # Network configs
│   │   │   ├── helpers.ts       # Address encoding
│   │   │   └── ipfs.ts          # Metadata storage
│   │   └── pages/               # Route pages
│   │       ├── Home.tsx         # Campaign listing
│   │       ├── Campaign.tsx     # Campaign details
│   │       ├── Create.tsx       # Campaign creation
│   │       └── MyCampaigns.tsx  # Creator dashboard
│   ├── .env.example
│   └── package.json
├── DEPLOYMENT.md                 # Deployment guide
└── README.md

How It Works

For Creators (Stacks Side)

  1. Connect your Stacks wallet
  2. Create a campaign with title, description, goal, and deadline
  3. Share your campaign page
  4. When goal is met, claim your funds (minus 2% platform fee)

For Backers (Ethereum Side)

  1. Connect your Ethereum wallet (via RainbowKit)
  2. Find a campaign you want to support
  3. Enter donation amount in USDC
  4. Approve USDC spend → Bridge via xReserve
  5. Funds arrive on Stacks in ~15 minutes

Bridge Flow

Ethereum USDC → Circle xReserve → Stacks USDCx
     ↓              ↓                 ↓
  Approve      depositToRemote     Mint to recipient

Smart Contract

Active Contract: campaign-registry-v2.clar (V2 with true escrow)

The V2 contract provides enhanced features over V1:

  • True SIP-010 token escrow (funds held in contract, not manual registration)
  • Automatic refunds for failed campaigns
  • Improved donation tracking

Contract Functions

Function Description
create-campaign Create a new fundraising campaign
donate Deposit USDCx tokens into campaign escrow
claim-funds Withdraw funds when goal is met (5% fee deducted)
request-refund Claim refund if campaign failed (goal not met after deadline)
get-campaign Read campaign details
get-campaign-count Get total number of campaigns
get-backer-count Get number of backers for a campaign

Note: campaign-registry.clar (V1) is deprecated. V1 used an optimistic "register-deposit" pattern instead of true escrow.

Tech Stack

Layer Technology
Frontend React 18 + TypeScript + Vite
Styling TailwindCSS (Glassmorphism)
Ethereum Wallet RainbowKit + wagmi + viem
Stacks Wallet @stacks/connect
Bridge Circle xReserve (depositToRemote)
Smart Contract Clarity
Metadata IPFS (localStorage fallback)

Contract Addresses

Testnet

Contract Address
USDC (Sepolia) 0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238
xReserve (Sepolia) 0x008888878f94C0d87defdf0B07f46B93C1934442
USDCx (Stacks) ST1F55GGV1M3YWM4CVNA95Q29TZ2D5SXQPSPYEVK4.usdcx-token

Mainnet

Contract Address
USDC (Ethereum) 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
xReserve (Ethereum) 0x8888888199b2Df864bf678259607d6D5EBb4e3Ce
USDCx (Stacks) SP120SBRBQJ00MCWS7TM5R8WJNTTKD5K0HFRC2CNE.usdcx

Bridge Timing & Fees

Network Action Time Min Amount
Testnet Deposit (ETH→Stacks) ~15 min 1 USDC
Testnet Withdraw (Stacks→ETH) ~25 min 4.80 USDCx
Mainnet Deposit ~15 min 10 USDC
Mainnet Withdraw ~60 min 4.80 USDCx

Development

Available Scripts

npm run dev      # Start development server
npm run build    # Build for production
npm run preview  # Preview production build
npm run lint     # Run ESLint

Build for Production

cd frontend
npm run build

Output will be in frontend/dist/.

Submission Checklist

  • Frontend with React + TypeScript + TailwindCSS
  • Stacks wallet integration (@stacks/connect)
  • Ethereum wallet integration (RainbowKit)
  • Circle xReserve bridge integration
  • Clarity smart contract (campaign-registry.clar)
  • IPFS metadata storage
  • Responsive glassmorphism UI
  • Campaign CRUD operations
  • Donation flow with bridge
  • Clarinet configuration for deployment

License

MIT

Links

About

Cross-chain crowdfunding platform on Stacks with USDCx escrow. Built for Programming USDCx on Stacks Builder Challenge.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published