Binary prediction markets on HashKey Chain. Users create YES/NO markets, bet with mUSDC, and claim proportional payouts when markets resolve.
HashPrediction/
contract/ # Solidity smart contracts (Foundry)
front-end/ # Next.js web application
| Contract | Address |
|---|---|
| HashPrediction | 0xC89bE9D4124E75869174ABd46b47De5a0d7e57E9 |
| MockERC20 (mUSDC, 6 decimals) | 0x9cefc16AD9dD2a4be819c616017F51d3A016C6ab |
| Admin | 0xafb5963275f4E0F75AC472F7ABDfAeD06903d85C |
- RPC:
https://testnet.hsk.xyz - Explorer:
https://testnet-explorer.hsk.xyz
cd contract
forge install
forge build
forge testDeploy to HashKey Testnet:
forge script script/Deploy.s.sol --rpc-url https://testnet.hsk.xyz --broadcast --legacy -vvvvSeed sample markets:
forge script script/Seed.s.sol --rpc-url https://testnet.hsk.xyz --broadcast --legacy -vvvvcd front-end
npm install
npm run devOpen http://localhost:3000 and connect MetaMask with the HashKey testnet.
- Create Market - Anyone posts a YES/NO question with a resolution time and optional fee
- Place Bets - Users bet mUSDC on YES or NO before the resolution time
- Resolve / Cancel - After resolution time, admin resolves with a winner or cancels
- Claim - Winners claim their original bet plus a proportional share of the losing pool
MIT