Receive external randomness
A request is sent to Chainlink VRF when the player reveals. The platform cannot choose the returned number.
PRIZE ALLOCATION
Chainlink VRF returns randomness, not a prize answer. Public smart-contract rules combine each ticket's value with the live remaining total to calculate its exact prize position.
THE FIXED FORMULA
Positions start at 0. The public formula and inspectable inputs prevent the platform from choosing a prize after seeing the randomness.
Ticket random value
…4721
Live remaining total
% 10
Position
1
A request is sent to Chainlink VRF when the player reveals. The platform cannot choose the returned number.
V2 receives one VRF seed per batch, then derives a value for every ticket from its ticket ID and index in the RevealDrawSent.tokenIDs array.
The ticket value is divided by the number of prizes remaining at that moment. The remainder is its position.
After recording the prize, the contract immediately updates the pool. The next ticket uses only what remains.
SINGLE DRAW
Ten prizes remain. The illustrated value 4721 modulo 10 gives position 1, the second slot when counting from 0.
MULTI-TICKET REVEAL
The system follows the RevealDrawSent.tokenIDs array without re-sorting ticket IDs. Each awarded prize is removed before the next ticket takes modulo against the updated total.
Ticket 1
Before: 10
The updated pool becomes the next ticket's starting point.
Ticket 2
Before: 9
The updated pool becomes the next ticket's starting point.
Ticket 3
Before: 8
The three tickets reveal B, C, then E
10 → 9 → 8 → 7
The examples show only four trailing digits for readability. Actual on-chain verification uses the complete 256-bit integers.
COMMON CASES
The rule does not change with ticket count or prize type. What changes is the pool that truly remains.
random % 10 = positionThe contract calculates once and removes one prize.
10 → 9 → 8Tickets follow the RevealDrawSent.tokenIDs array, not numeric ticket-ID order. Each uses the pool left by the previous ticket.
D × 3 → 2 → 1 → 0Each award removes one copy. Once the count reaches zero, later tickets cannot win it.
Jackpot × 1 → 0Once awarded, the jackpot immediately leaves the pool and cannot repeat later in the batch.
4721 % 10 = 1 · 4721 % 9 = 5A different remaining total can produce a different position, so every ticket must use the live pool.
callback A → update → callback BThe pool updates in the order each VRF callback actually completes on-chain, not by the order requests were submitted.
random % 1 = 0With one slot left, every random value has remainder 0, so the final ticket receives the final prize.
A reveal proof combines tokenIDs array order, the post-batch pool state, randomness, and results, then restores the starting pool to reproduce the calculation.
Open the full verification guidetokenIDsConfirms the public order used for tickets in the batch.
subPrizesRemainingQuantitiesThese are the quantities after the batch. Add this batch's awarded prizes back before replaying the draw from its starting pool.
randomWords · derived valueUses the full integers to reproduce each ticket's modulo position.
UpdateTicketStatusCompares the public record's ticket ID and prize with the displayed result.
A multi-ticket reveal does not calculate every prize at once
The contract follows the RevealDrawSent.tokenIDs array, using each ticket's value and the pool updated by the previous result.