Skip to content

Decentralized marketplace for micro-tasks on Base L2. Post tasks, hire workers, and build reputation onchain with secure ETH payments and dispute resolution.

Notifications You must be signed in to change notification settings

xam-dev-ux/BaseBounty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

23 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

BaseBounty 🎯

Decentralized Marketplace for Micro-Tasks on Base L2

BaseBounty is a fully decentralized platform where anyone can post small jobs with ETH payments, and workers can apply, complete tasks, and build onchain reputation. Built on Base L2 for low costs and integrated with Farcaster Mini Apps.

🌟 Features

Core Functionality

  • Post Bounties: Create tasks with ETH payments and deadlines
  • Apply & Work: Browse tasks, apply, and submit completed work
  • Secure Payments: Funds locked in smart contract, released on approval
  • Dispute Resolution: Community-based voting system for disagreements
  • Onchain Reputation: Ratings and reputation tracked permanently on Base
  • Multi-Category: Design, development, writing, translation, research, and more

Technical Highlights

  • Smart contract optimized for Base L2 gas costs
  • Reentrancy protection and comprehensive security measures
  • 2% platform fee for sustainable ecosystem
  • Full test coverage (>80%)
  • Farcaster Mini App integration
  • Responsive dark-mode UI with Tailwind CSS

πŸ—οΈ Architecture

BaseBounty/
β”œβ”€β”€ contracts/           # Solidity smart contracts
β”‚   β”œβ”€β”€ BaseBounty.sol  # Main contract (250+ lines)
β”‚   └── test/           # Comprehensive test suite
β”œβ”€β”€ frontend/           # React + TypeScript frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/ # UI components
β”‚   β”‚   β”œβ”€β”€ hooks/      # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ context/    # Web3 context
β”‚   β”‚   β”œβ”€β”€ types/      # TypeScript types
β”‚   β”‚   └── utils/      # Contract ABI and helpers
β”‚   └── public/
β”‚       └── .well-known/
β”‚           └── farcaster.json  # Mini App manifest
β”œβ”€β”€ scripts/            # Deploy, verify, interact scripts
└── README.md

πŸš€ Quick Start

Prerequisites

  • Node.js v18+
  • npm or yarn
  • MetaMask or compatible Web3 wallet
  • ETH on Base network

Installation

  1. Clone the repository
git clone https://github.com/yourusername/basebounty.git
cd basebounty
  1. Install dependencies
# Install root dependencies (Hardhat)
npm install

# Install frontend dependencies
cd frontend
npm install
cd ..
  1. Configure environment
# Copy environment template
cp .env.example .env

# Edit .env with your values
PRIVATE_KEY=your_private_key_here
BASESCAN_API_KEY=your_basescan_api_key
PLATFORM_WALLET=your_platform_wallet_address
  1. Compile contracts
npm run compile
  1. Run tests
npm test

πŸ“ Smart Contract

Deploy to Base Mainnet

  1. Make sure you have ETH on Base

    • Bridge ETH to Base via bridge.base.org
    • Minimum recommended: 0.01 ETH for deployment
  2. Deploy contract

npm run deploy:base
  1. Copy contract address from the output

  2. Verify on Basescan

npm run verify:base -- <CONTRACT_ADDRESS> <PLATFORM_WALLET>

Test Locally

# Start local Hardhat node
npm run node

# In another terminal, deploy to local network
npm run deploy:local

# Run interaction script
CONTRACT_ADDRESS=0x... npm run interact

Contract Functions

For Creators

  • createBounty() - Create new bounty with ETH payment
  • acceptWork() - Accept submitted work and release payment
  • rejectWork() - Reject work with reason
  • cancelBounty() - Cancel if no applications
  • rateUser() - Rate worker after completion

For Workers

  • applyToBounty() - Apply to bounty with cover letter
  • submitWork() - Submit completed work (URL/IPFS)
  • createDispute() - Create dispute if work unfairly rejected
  • rateUser() - Rate creator after completion

For Community

  • voteOnDispute() - Vote on active disputes
  • resolveDispute() - Execute dispute resolution after timeout

🎨 Frontend

Local Development

  1. Set up environment
cd frontend
cp .env.example .env
  1. Update .env
VITE_CONTRACT_ADDRESS=your_deployed_contract_address
VITE_BASE_RPC_URL=https://mainnet.base.org
  1. Start development server
npm run dev
  1. Open browser

Build for Production

cd frontend
npm run build

🚒 Deploy to Vercel

Step-by-Step Deployment

  1. Push code to GitHub
git init
git add .
git commit -m "Initial commit"
git branch -M main
git remote add origin https://github.com/yourusername/basebounty.git
git push -u origin main
  1. Connect to Vercel

    • Go to vercel.com
    • Click "New Project"
    • Import your GitHub repository
  2. Configure Build Settings

    • Framework Preset: Vite
    • Root Directory: frontend
    • Build Command: npm run build
    • Output Directory: dist
  3. Add Environment Variables

    • VITE_CONTRACT_ADDRESS - Your deployed contract address
    • VITE_BASE_RPC_URL - https://mainnet.base.org (optional)
  4. Deploy

    • Click "Deploy"
    • Wait for deployment to complete
    • Copy your Vercel URL (e.g., https://basebounty.vercel.app)
  5. Update URLs in code

    • Update URLs in frontend/public/.well-known/farcaster.json
    • Update URLs in frontend/index.html meta tags
    • Replace https://basebounty.vercel.app with your actual URL
  6. Redeploy

    • Push changes to GitHub
    • Vercel will automatically redeploy

πŸ“± Farcaster Mini App Setup

Prerequisites

  • Deployed frontend on Vercel
  • Farcaster account

Configuration Steps

  1. Install Farcaster SDK (already done)
cd frontend
npm install @farcaster/miniapp-sdk
  1. SDK Integration (already done)

    • SDK is imported and initialized in App.tsx
    • sdk.actions.ready() called on component mount
  2. Create Required Images

You need to create these images and place them in frontend/public/:

  • logo.png (512x512px)

    • App icon shown in lists
    • Clean, simple design representing tasks/bounties
    • Transparent or solid background
  • splash.png (1080x1920px)

    • Vertical splash screen shown while loading
    • Include BaseBounty branding
    • Background color: #10b981 (emerald green)
  • embed.png (1200x630px)

    • OG image for social sharing
    • Horizontal orientation
    • Include key value proposition
  • hero.png (any size, ~1200x600px recommended)

    • Hero image for landing
    • Showcase main features
  • screenshots/ (3 images, ~1170x2532px each)

    • 1.png - Bounty list view
    • 2.png - Bounty detail with applications
    • 3.png - User profile with reputation

Design Tips:

  • Use consistent color scheme (emerald green #10b981, dark grays)
  • Keep text readable on mobile
  • Show actual UI elements
  • Use tools like Figma, Canva, or Photoshop
  1. Generate Account Association

After deploying to Vercel:

  1. Go to https://www.base.dev/preview
  2. Click on "Account association" tool
  3. Enter your Vercel domain: https://basebounty.vercel.app
  4. Click "Verify" and follow instructions
  5. Copy the generated header, payload, and signature
  6. Update frontend/public/.well-known/farcaster.json:
{
  "accountAssociation": {
    "header": "eyJ...",
    "payload": "eyJ...",
    "signature": "MHg..."
  },
  "miniapp": {
    ...
  }
}
  1. Commit and push changes to trigger redeploy

  2. Test Your Mini App

  3. Go to https://www.base.dev/preview

  4. Enter your Vercel URL

  5. Test all features:

    • Mini App launches correctly
    • Splash screen displays
    • App loads without errors
    • Wallet connection works
    • All interactions function
  6. Publish on Base App

  7. Create a post on Base App

  8. Include your Vercel URL in the post

  9. Your Mini App will automatically appear as an interactive card

  10. Users can launch your Mini App directly from Base

πŸ’° Gas Costs (Base L2)

Typical transaction costs on Base:

Action Estimated Gas Cost (~0.1 gwei)
Create Bounty ~150k gas ~$0.01-0.02
Apply to Bounty ~80k gas ~$0.005-0.01
Submit Work ~60k gas ~$0.003-0.006
Accept/Reject ~100k gas ~$0.006-0.012
Create Dispute ~120k gas ~$0.007-0.014
Vote on Dispute ~70k gas ~$0.004-0.008
Rate User ~90k gas ~$0.005-0.01

Costs are significantly lower than Ethereum mainnet (100-1000x cheaper)

πŸ“Š Bounty Categories

  • Design - Logos, graphics, UI/UX, illustrations
  • Development - Coding, smart contracts, bug fixes, features
  • Writing - Articles, blog posts, documentation, copywriting
  • Translation - Language translation, localization
  • Research - Market research, data gathering, analysis
  • Marketing - Social media, content creation, campaigns
  • Data Entry - Data input, spreadsheet work, organization
  • Review - Code review, content review, testing
  • Other - Miscellaneous tasks

πŸ”’ Security Features

  • Reentrancy Protection: Guards on all state-changing functions
  • Checks-Effects-Interactions: Proper pattern implementation
  • Access Control: Only authorized users can perform actions
  • Input Validation: Comprehensive validation of all inputs
  • Custom Errors: Gas-efficient error handling
  • Locked Funds: Payments secured in contract until completion
  • Dispute System: Fair resolution mechanism
  • Deadline Enforcement: Prevents expired bounty manipulation

πŸ§ͺ Testing

Run the comprehensive test suite:

# Run all tests
npm test

# Run with gas reporting
npm run test:gas

# Run with coverage
npx hardhat coverage

Tests cover:

  • Bounty creation and validation
  • Application process
  • Work submission and review
  • Payment distribution
  • Dispute creation and voting
  • Rating system
  • Edge cases and error conditions

πŸ› οΈ Development

Project Structure

contracts/
β”œβ”€β”€ BaseBounty.sol          # Main smart contract
└── test/
    └── BaseBounty.test.js  # Test suite

frontend/src/
β”œβ”€β”€ components/             # React components
β”‚   β”œβ”€β”€ Header.tsx
β”‚   β”œβ”€β”€ BountyList.tsx
β”‚   β”œβ”€β”€ BountyDetail.tsx
β”‚   β”œβ”€β”€ CreateBountyForm.tsx
β”‚   └── UserProfile.tsx
β”œβ”€β”€ context/
β”‚   └── Web3Context.tsx    # Web3 connection management
β”œβ”€β”€ hooks/
β”‚   β”œβ”€β”€ useBounties.ts     # Fetch bounties
β”‚   └── useReputation.ts   # User reputation
β”œβ”€β”€ types/
β”‚   └── index.ts           # TypeScript definitions
└── utils/
    └── BaseBountyABI.json # Contract ABI

scripts/
β”œβ”€β”€ deploy.js              # Deploy contract
β”œβ”€β”€ verify.js              # Verify on Basescan
└── interact.js            # Interact with contract

Tech Stack

Smart Contract

  • Solidity 0.8.20
  • Hardhat
  • Ethers.js v6
  • Base L2 optimizations

Frontend

  • React 18
  • TypeScript
  • Vite
  • Tailwind CSS
  • Ethers.js v6
  • @farcaster/miniapp-sdk

Deployment

  • Vercel (frontend)
  • Base Mainnet (contract)

πŸ› Troubleshooting

Common Issues

1. "Invalid Amount" error when creating bounty

  • Ensure payment is at least 0.000001 ETH
  • Check you have enough ETH for payment + gas

2. "Please switch to Base network"

  • MetaMask: Click network dropdown β†’ Add Base Mainnet
  • Or use the "Switch to Base" button in the app

3. "Failed to connect wallet"

  • Ensure MetaMask is installed
  • Refresh the page
  • Try disconnecting and reconnecting

4. ".well-known/farcaster.json not found"

  • Verify file exists in frontend/public/.well-known/
  • Check vercel.json has correct rewrites
  • Clear Vercel cache and redeploy

5. "Transaction failed" errors

  • Check you're on Base network
  • Verify contract address is correct
  • Ensure you have enough ETH for gas
  • Check transaction on Basescan for specific error

6. Mini App not displaying in Farcaster

  • Verify manifest URL is accessible
  • Check accountAssociation is filled
  • Test at base.dev/preview first
  • Ensure all image URLs are valid

Get Help

  • Open an issue on GitHub
  • Check contract on Basescan
  • Review transaction logs
  • Test on Base Sepolia first

πŸ“š Additional Resources

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License.

πŸŽ‰ Acknowledgments


Built with ❀️ for the Base ecosystem

For questions or support, please open an issue on GitHub.

About

Decentralized marketplace for micro-tasks on Base L2. Post tasks, hire workers, and build reputation onchain with secure ETH payments and dispute resolution.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published