4. Round Lifecycle

  1. Open — Admin opens a round: (starts, ends). Sales happen only within [starts, ends).

  2. Buy — Users buy tickets (USDT or $PLAY). If USDT, 25% is swapped to PLAY and burned.

  3. Close & VRF request — After ends, close and request VRF (manually or via Automation).

  4. Draw — VRF callback sets winningMask and moves the round to TALLYING.

  5. Tally — Automation calls tally(id, maxTickets) repeatedly until all tickets processed.

  6. Finalize — Compute perWinnerUSDT/PLAY per tier, send dust to carryover, set status FINALIZED.

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