PRIZE ALLOCATION

Every ticket is recalculated from what truly remains

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

Start with 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

01

Receive external randomness

A request is sent to Chainlink VRF when the player reveals. The platform cannot choose the returned number.

02

Derive a value for each ticket

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.

03

Take modulo by the live total

The ticket value is divided by the number of prizes remaining at that moment. The remainder is its position.

04

Award, record, and remove

After recording the prize, the contract immediately updates the pool. The next ticket uses only what remains.

SINGLE DRAW

How one ticket is revealed

Ten prizes remain. The illustrated value 4721 modulo 10 gives position 1, the second slot when counting from 0.

0A
1B
2C
3C
4D
5D
6D
7E
8E
9E
Position 1 → Prize B → remove
ACCDDDEEE

MULTI-TICKET REVEAL

Three tickets do not all calculate against the same 10

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

…4721 % 10 = 1

B

Before: 10

ABCCDDDEEE
Remove B, 9 remain
ACCDDDEEE

The updated pool becomes the next ticket's starting point.

Ticket 2

…3107 % 9 = 2

C

Before: 9

ACCDDDEEE
Remove C, 8 remain
ACDDDEEE

The updated pool becomes the next ticket's starting point.

Ticket 3

…5605 % 8 = 5

E

Before: 8

ACDDDEEE
Remove E, 7 remain
ACDDDEE

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

How does the formula behave?

The rule does not change with ticket count or prize type. What changes is the pool that truly remains.

Single-ticket reveal

random % 10 = position

The contract calculates once and removes one prize.

Multi-ticket reveal

10 → 9 → 8

Tickets follow the RevealDrawSent.tokenIDs array, not numeric ticket-ID order. Each uses the pool left by the previous ticket.

Several copies of one prize

D × 3 → 2 → 1 → 0

Each award removes one copy. Once the count reaches zero, later tickets cannot win it.

One jackpot remains

Jackpot × 1 → 0

Once awarded, the jackpot immediately leaves the pool and cannot repeat later in the batch.

Same value, different pool

4721 % 10 = 1 · 4721 % 9 = 5

A different remaining total can produce a different position, so every ticket must use the live pool.

Several VRF requests are pending

callback A → update → callback B

The pool updates in the order each VRF callback actually completes on-chain, not by the order requests were submitted.

Only one prize remains

random % 1 = 0

With one slot left, every random value has remainder 0, so the final ticket receives the final prize.

How can you reproduce it on-chain?

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 guide
01

Ticket processing order

tokenIDs

Confirms the public order used for tickets in the batch.

02

Post-batch pool state

subPrizesRemainingQuantities

These are the quantities after the batch. Add this batch's awarded prizes back before replaying the draw from its starting pool.

03

VRF and per-ticket values

randomWords · derived value

Uses the full integers to reproduce each ticket's modulo position.

04

Final awarded prize

UpdateTicketStatus

Compares 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.

Back to the on-chain draw