A decentralized head-to-head football prediction platform built on Base.
ForgeBet is a Web3 prediction platform where users compete head-to-head on Premier League match outcomes. Stake ETH on your predictions, get matched with opponents, and win rewards when results are settled on-chain.
- Browse Matches - View upcoming Premier League fixtures
- Create Prediction - Stake ETH (minimum 0.005) and predict the outcome
- Get Matched - Another user joins with opposing prediction and matching stake
- Auto-Settlement - Results fetched from FPL API and settled on Base Sepolia
- Claim Rewards - Winners receive their share of the prize pool
ResultsConsumer.sol- Chainlink Functions consumer contract- Can request match results from FPL API via Chainlink Functions (UI flow disabled; backend handles results)
- Stores match outcomes on-chain (gameweek, matchId, homeScore, awayScore, status)
PredictionContract.sol- Main betting contract- Users place bets with ETH
- Groups bets by gameweek + matchId
- Settles matches from on-chain outcome
- Owner can refund unmatched single-sided bets in full (no platform fee)
- Primary (current): backend fetches results (FPL) → sets result → calls
settleMatch. - Chainlink Functions remains compatible but is not invoked from the UI.
- Node.js 18+ and npm
- Wallet with ETH on Base Sepolia testnet
- Git
git clone <repository-url>
cd forgebet-contracts
# Contracts
cd contracts && npm install
# Backend
cd ../backend && npm install
# Client
cd ../client && npm installcd contracts
cp .env.example .envFill PRIVATE_KEY, BASE_SEPOLIA_RPC_URL.
cd backend
cp .env.example .envSet PRIVATE_KEY, OWNER_ADDRESS, PREDICTION_CONTRACT_ADDRESS, RESULTS_CONSUMER_ADDRESS, RPC_URL.
cd client
cp .env.example .envSet contract addresses and WalletConnect project ID.
cd contracts
npm run deploy:base-sepoliaUpdates .env files with deployed addresses.
cd backend
npm startServes fixtures/results at http://localhost:3002 in development.
forgebet/
├── contracts/ # Solidity, Hardhat, scripts, tests
├── backend/ # Express server, settlement/cron scripts
└── client/ # React frontend (Vite)
- ResultsConsumer:
0xA7C6A76A73Fe9CB5Bb508e0277e064678C2d6D8D - PredictionContract:
0xd3A3f2c96b8a5390D29893184cc236b2b5767e43 - Network: Base Sepolia (Chain ID: 84532)
- Explorer: https://sepolia.basescan.org
- Solidity 0.8.20, Hardhat, OpenZeppelin, ethers.js
- Backend: Node/Express
- Frontend: React, Vite, Wagmi, RainbowKit
- Oracle-compatible: Chainlink Functions (UI disabled; backend handles results)
- Head-to-head match betting with ETH stakes
- Backend result fetch (FPL fallback) → settlement
- Refund unmatched bets (no platform fee)
- Leaderboard tracking
cd backend
OWNER_ADDRESS=0x575109e921c6d6a1cb7ca60be0191b10950afa6c \
PRIVATE_KEY=<owner_key> \
RPC_URL=<rpc> \
PREDICTION_CONTRACT_ADDRESS=0xd3A3f2c96b8a5390D29893184cc236b2b5767e43 \
RESULTS_CONSUMER_ADDRESS=0xA7C6A76A73Fe9CB5Bb508e0277e064678C2d6D8D \
node scripts/settle-and-refund.jsUnlicense