Skip to content

ivedmohan/BuildBack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

24 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

BuildBack ๐Ÿš€

Community-driven hackathon crowdfunding platform on Avalanche

BuildBack is a prediction market meets crowdfunding platform where supporters fund builders directly while predicting hackathon winners. It's less gambling, more community-driven funding for innovation.

๐ŸŽฏ How It Works

  1. Builders Register - Project teams submit their hackathon projects
  2. Admin Approves - Hackathon organizers review and approve submissions
  3. Community Supports - Users fund projects with USDC or AVAX
    • ๐Ÿ’ฐ 10% goes directly to the project creator (instant funding)
    • ๐Ÿ† 88% goes to the prize pool (for supporters of winners)
    • ๐Ÿ”ง 2% platform fee (helps maintain BuildBack)
  4. Admin Declares Winners - After the hackathon, organizers settle results
  5. Supporters Claim Rewards - If you supported winning projects, claim your share!

โœจ Key Features

  • Dual Token Support: Back projects with USDC or AVAX
  • Multiple Winners: Prize pool can be split across multiple projects
  • Direct Developer Funding: 10% of contributions go straight to builders
  • Admin Controlled Phases: Manual control over registration, backing, and settlement
  • Emergency Refunds: Built-in safety mechanism if hackathon is cancelled
  • Transparent & On-Chain: All transactions on Avalanche Fuji testnet

๐Ÿ—๏ธ Architecture

Smart Contracts

  • BuildBack.sol - Main hackathon contract with dual-token rewards
  • BuildBackFactory.sol - Factory for creating multiple hackathon instances
  • Built with Solidity 0.8.20 + OpenZeppelin 5.0.0

Frontend

  • React 18 + Vite - Modern, fast development
  • Wagmi v2 + RainbowKit - Web3 wallet integration
  • Shadcn UI + Tailwind - Beautiful, accessible components
  • Framer Motion - Smooth animations

๐Ÿ“ฆ Deployed Contracts (Avalanche Fuji)

  • Factory Address: 0x3B2510eB4F0208eF58d045F7Bcd16669842f9fBa
  • USDC Address: 0x5425890298aed601595a70AB815c96711a31Bc65
  • Chain ID: 43113

๐Ÿš€ Getting Started

Prerequisites

Node.js v18+
pnpm or npm

Smart Contracts

cd contract
npm install
npx hardhat test              # Run tests
npx hardhat compile           # Compile contracts
npx hardhat run scripts/deploy-factory.ts --network fuji  # Deploy

Frontend

cd frontend
pnpm install
pnpm dev                      # Start dev server (localhost:8080)
pnpm build                    # Build for production

๐ŸŽฎ Usage

For Hackathon Organizers (Admin)

  1. Create Hackathon - Deploy via factory or use existing
  2. Manage Projects:
    • Approve submitted projects
    • Control registration phases
    • Enable/disable backing
  3. Settle Event - Declare winners with percentage splits
  4. Withdraw Fees - Claim 2% platform fee after settlement

For Project Teams (Builders)

  1. Register Project - Submit name + description
  2. Wait for Approval - Admin reviews your submission
  3. Receive Funding - Get 10% of all contributions instantly!
  4. Build - Create your awesome project

For Supporters (Community)

  1. Browse Hackathons - View active events
  2. Support Projects - Fund projects you believe in (USDC or AVAX)
    • 10% goes to builder
    • 88% to prize pool
  3. Claim Rewards - If your projects win, claim your share!

๐Ÿงช Testing

All 26 tests passing โœ…

cd contract
npx hardhat test

# Output:
# โœ“ Project registration
# โœ“ USDC backing with developer share
# โœ“ AVAX backing with developer share
# โœ“ Multiple winners settlement
# โœ“ Reward calculations
# โœ“ Emergency refunds
# โœ“ Fee withdrawals

๐Ÿ”’ Security Features

  • ReentrancyGuard - Prevents reentrancy attacks
  • Pausable - Emergency stop mechanism
  • Ownable - Admin-only functions
  • SafeERC20 - Safe token transfers
  • Input Validation - Strict checks on all parameters

๐Ÿ“Š Distribution Breakdown

When you support a project with 100 USDC:

โ†’ 10 USDC  โ†’ Project Creator (instant)
โ†’ 88 USDC  โ†’ Prize Pool (for winners' supporters)
โ†’ 2 USDC   โ†’ Platform Fee

If the project wins 50% of the prize pool:

  • All supporters of that project split their share proportionally
  • You can claim your rewards after settlement

๐ŸŒ Live Demo

Frontend: https://buildback-qln7uzbtw-ved-mohans-projects-486ed2df.vercel.app

Testnet: Avalanche Fuji

๐Ÿ“ Smart Contract Functions

User Functions

  • registerProject(name, description) - Submit your project
  • backProject(projectId, amount) - Support with USDC
  • backProjectWithAVAX(projectId) - Support with AVAX
  • claimReward() - Claim winnings if you backed winners
  • emergencyRefund() - Get funds back if hackathon cancelled

Admin Functions (Owner Only)

  • approveProject(projectId) - Approve submitted projects
  • enableBacking() / disableBacking() - Control backing phase
  • closeRegistration() - Close project submissions
  • settleEvent(Winner[]) - Declare winners with %splits
  • withdrawFees() - Claim 2% platform fees
  • pause() / unpause() - Emergency controls

๐Ÿ› ๏ธ Tech Stack

Smart Contracts:

  • Solidity 0.8.20
  • Hardhat
  • OpenZeppelin Contracts 5.0.0
  • TypeScript

Frontend:

  • React 18
  • Vite 5.4
  • Wagmi v2
  • RainbowKit 2.2
  • Shadcn UI
  • Tailwind CSS
  • Framer Motion

Blockchain:

  • Avalanche Fuji Testnet
  • USDC (6 decimals)
  • Native AVAX (18 decimals)

๐Ÿ“„ License

MIT

๐Ÿค Contributing

Contributions welcome! Please feel free to submit a Pull Request.

๐Ÿ“ง Contact


Built with โค๏ธ for the builder community

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors