4. Round Lifecycle
Open — Admin opens a round:
(starts, ends)
. Sales happen only within[starts, ends)
.Buy — Users buy tickets (USDT or $PLAY). If USDT, 25% is swapped to PLAY and burned.
Close & VRF request — After
ends
, close and request VRF (manually or via Automation).Draw — VRF callback sets
winningMask
and moves the round to TALLYING.Tally — Automation calls
tally(id, maxTickets)
repeatedly until all tickets processed.Finalize — Compute
perWinnerUSDT/PLAY
per tier, send dust to carryover, set status FINALIZED.Claim — Winners call
claim(tokenId)
to withdraw their winnings.
Automation
checkUpkeep
encodes next action;performUpkeep
executes it.Typical sequence: close → tally chunks of N → finalize.
Last updated