FanForge

Sports prediction game using card collectibles. Collect cards, predict match outcomes, earn rewards!

FanForge

Created At

ETHGlobal Buenos Aires

Winner of

Chiliz

Chiliz - The Future of Fan Ownership 1st place

Project Description

FanForge is a sports prediction game on Chiliz Blockchain. Players collect and pack cards (player cards like Tom Brady and Mbappé, and match event cards like Red Card, Hat Trick, Overtime), use them to make predictions on real sports matches, and earn dynamic Fan NFTs that level up based on prediction accuracy and knowledge of your team. This is a new way for sports fans to interact with their teams. FanForge allows fans to turn their passion into real interactions and value. They can get a prize reward if they show their loyalty through accurate predictions and upgrading their NFT (proof of loyalty and knowledge). This also allows to turn fandoms into financial participation and bring all the attention of sports into a gamified experience where users can also win.

How it's Made

I am using Solidity with Hardhat, OpenZeppelin, React, Ethers.js and the app is deployed on Chiliz Spicy Testnet. The system includes 3 contracts—CardPackFactory, DynamicFanNFT, and PredictionManager. This works with a React frontend that interacts directly via Ethers.js. I have a Pseudo-randomness logic that uses block.timestamp, block.prevrandao, and per-user nonces. Prediction IDs are computed client-side by iterating previous matches. The frontend handles BigInt-to-string conversions from Ethers.js. Card ownership is checked by iterating up to 30 card IDs instead of indexed queries. Metadata URIs are dynamically updated on NFT level-ups using abi.encodePacked string concatenation. The system uses a cumulative probability distribution for rarity (40/30/20/8/2%) and locks cards by transferring them to the PredictionManager contract during predictions.

background image mobile

Join the mailing list

Get the latest news and updates