PredictRisk

On-chain strategy and prediction game powered by prediction markets.

PredictRisk

Created At

HackMoney 2026

Project Description

This project is a hybrid strategy and prediction game. Players claim and manage territories on a world map, station and attack with ERC‑20 “ARMY” tokens, and place bets on Polymarket markets through an on‑chain escrow. The frontend visualizes territories, armies, and betting positions; the smart contracts manage game logic, betting, ownership of territories and armies

How it's Made

The app is built with React + TypeScript + Vite on the frontend, using wagmi and viem for wallet connection and EVM interactions. Smart contracts are written in Solidity, compiled/deployed with Hardhat, and include RiskGame, TerritoryNFT, ArmyToken, and BetEscrow. Polymarket integration uses gamma-api through a Vite proxy (/api/polymarket) to fetch market/outcome data. Bets are signed by a small Node signer server (EIP‑712) that returns signatures for BetEscrow.placeBet. A notable design point: on‑chain escrow guarantees token custody, while the UI can still show off‑chain PnL; for real cash‑out, an oracle‑style close price must be added. If you want, I’ll implement the on‑chain cash‑out so “Close” returns the balance + PnL.

The game can be played in an asycrhonous and the obective is to acquire more armies and territory. A player can attack other countries, claim daily armies and bet his armies on prediction markets. The logic of the attack is the following if a territory it's free a player must select a number of Armies he wants to move, if a territory it's occupied the attack shall be done only with 2.7 times the armies of the defendant. Every day you can claim armies + 15 more armies each territory you have. A player can also bet its armies on Polymarket and get a return so he can deploy more armies.

background image mobile

Join the mailing list

Get the latest news and updates

PredictRisk | ETHGlobal