Fairness
How the winning block is chosen, and how to check a round yourself.
Where the randomness comes from
When a round locks, the contract asks the Dice oracle for one random output. Dice is a commit-reveal oracle: it committed to its secrets before the request, and it reveals the output afterwards. The output is not produced by this project.
The contract stores exactly one output per round. The winning block and the jackpot roll are computed on chain from that output, so anyone can repeat the computation.
Trust assumption: as long as Dice's commitments hold, the provider can delay a reveal, which stalls the round, but it cannot choose the result. Dice is a third-party protocol that this project has not audited. If a reveal never arrives, the round can be cancelled and every deploy is refunded.
The computation
import { encodePacked, keccak256 } from 'viem'
const block = (BigInt(keccak256(encodePacked(['bytes32', 'string'], [output, 'SQUARE']))) % 25n) + 1n
const jackpotRoll = BigInt(keccak256(encodePacked(['bytes32', 'string'], [output, 'JACKPOT'])))
const jackpot = jackpotRoll % jackpotChanceDenominator === 0nWinning block: the output with the label SQUARE, hashed, modulo 25, plus 1. Jackpot: the output with the label JACKPOT, hashed, modulo the jackpot denominator; a result of 0 is a hit.
Check a round
Reading the round from the chain.