ProphetBase is live! Try it now: prophetbase.vercel.app
Trade predictions on crypto, DeFi, politics, and sports with real USDC on Base L2. Decentralized, transparent, and secure prediction markets.
Screenshots coming soon - check out the live demo to see ProphetBase in action!
- Live on Base Mainnet - Fully deployed and operational on Base L2
- Create Prediction Markets - Anyone can create markets on any topic
- Trade with USDC - Use real USDC collateral for predictions
- Multiple Categories - DeFi, Crypto, Politics, Sports, and more
- Real-time Probabilities - Dynamic pricing based on market activity
- Claim Winnings - Automatic payout to winners after resolution
- Market Categories - Organized markets by topic (DeFi, Crypto, Politics, Sports, Other)
- Fee System - 2% platform fee on all trades
- Pause Functionality - Emergency pause for security
- Share Trading - Buy and sell outcome shares
- Admin Dashboard - Market creation, fee withdrawal, and contract management
- User Profiles - Track your positions, history, and achievements
- Responsive Design - Beautiful UI that works on all devices
- Audited Contracts - Comprehensive test coverage (46 passing tests)
- Pausable - Emergency stop functionality
- Owner Controls - Protected admin functions
- Fee Collection - Transparent fee tracking and withdrawal
- Solidity 0.8.20 - Smart contract language
- Hardhat - Development environment
- OpenZeppelin - Security-audited contract libraries
- Base L2 - Low-cost, fast blockchain
- Next.js 16 - React framework with App Router
- TypeScript - Type-safe development
- Tailwind CSS - Utility-first styling
- wagmi - React hooks for Ethereum
- RainbowKit - Wallet connection UI
- Recharts - Data visualization
- Vercel - Deployment platform
- Ethers.js - Ethereum library
- date-fns - Date utilities
- React Hot Toast - Notifications
- Node.js 18+
- npm or yarn
- MetaMask or compatible Web3 wallet
- Base network configured in wallet
# Clone the repository
git clone https://github.com/yourusername/ProphetBase.git
cd ProphetBase
# Install dependencies
npm install
# Set up environment variables
cp .env.example .env
# Edit .env with your values
# Run tests
npx hardhat test
# Start frontend development server
cd frontend
npm install
npm run devVisit http://localhost:3000 to see the app.
Base Mainnet:
- PredictionMarket:
0x27177c0edc143CA33119fafD907e8600deF5Ba74 - USDC (Collateral):
0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
createMarket(question, duration, category)- Create a new prediction marketbuyShares(marketId, buyYes, amount)- Purchase outcome sharessellShares(marketId, sellYes, amount)- Sell outcome sharesclaimWinnings(marketId)- Claim winnings after market resolution
resolveMarket(marketId, outcome)- Resolve market with outcomewithdrawFees()- Withdraw collected platform feespause()/unpause()- Emergency pause functionality
markets(marketId)- Get market detailsgetMarketsByCategory(category)- Filter markets by categorytotalFeesCollected- View total platform fees
ProphetBase/
├── contracts/ # Solidity smart contracts
│ ├── PredictionMarket.sol
│ └── OutcomeToken.sol
├── test/ # Contract tests
│ └── PredictionMarket.test.ts
├── scripts/ # Deployment scripts
│ ├── deploy.ts
│ └── create-additional-markets.ts
├── frontend/ # Next.js frontend
│ ├── app/ # App router pages
│ ├── components/ # React components
│ ├── lib/ # Utilities and configs
│ └── public/ # Static assets
├── docs/ # Documentation
├── deployments.json # Deployment history
└── hardhat.config.ts # Hardhat configuration
# Run all tests
npx hardhat test
# Run with coverage
npx hardhat coverage
# Run specific test file
npx hardhat test test/PredictionMarket.test.tsTest Results: ✅ 46/46 passing
# Deploy to Base Sepolia (testnet)
npx hardhat run scripts/deploy.ts --network baseSepolia
# Deploy to Base Mainnet
npx hardhat run scripts/deploy.ts --network baseMainnet
# Verify contract
npx hardhat verify --network baseMainnet DEPLOYED_ADDRESScd frontend
# Build for production
npm run build
# Deploy to Vercel
vercel --prodEnvironment Variables Required:
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID- WalletConnect project IDNEXT_PUBLIC_PREDICTION_MARKET_ADDRESS- Deployed contract addressNEXT_PUBLIC_USDC_ADDRESS- USDC token address
- User Guide - How to use ProphetBase
- Contributing Guide - How to contribute
- Changelog - Version history
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built on Base - Coinbase's L2 solution
- Powered by OpenZeppelin contracts
- UI components inspired by modern Web3 dApps
- Community feedback and testing
- Live App: prophetbase.vercel.app
- Contract: BaseScan
- Issues: GitHub Issues
Built with ❤️ on Base
Making prediction markets accessible to everyone
Making prediction markets accessible to everyone