D3
Duty3

Chainlink VRF

Every Duty3 draw uses a random number from Chainlink VRF (Verifiable Random Function). The number comes with a cryptographic proof that is checked on-chain, so nobody — not Duty3, not the creator, not Chainlink — can pick or change it.

The flow

  1. The raffle sells out, or reaches its deadline with at least the minimum sold
  2. The raffle asks the Duty3 factory, which requests a random number from the Chainlink VRF coordinator (event DrawRequested)
  3. A Chainlink node generates the number with its secret key and publishes it with a proof
  4. The coordinator verifies the proof on-chain and delivers the number (event RandomnessReceived)
  5. The winning tickets are computed from it and the prizes paid (events WinnerPaid and Settled)

The answer usually arrives within a minute on Arbitrum.

Winner formula

1st place   = (random mod ticketsSold) + 1
next places = (keccak256(random, k) mod ticketsSold) + 1,  k = 1, 2, …
              a ticket already picked is skipped

Tickets are numbered from 1 in order of purchase. One ticket wins at most one place. The code is in RaffleMathV2.pickTickets in the verified contract.

Why it cannot be manipulated

  • Unpredictable — the number does not exist until the Chainlink node publishes it, after ticket sales stop.
  • Verified on-chain — a number without a valid proof is rejected by the coordinator.
  • No block-hash tricks — validators cannot influence it by reordering or withholding blocks.
  • Late answers ignored — if a request is repeated, an answer to an older request cannot change the result.

If Chainlink is late

No answer within 6 hours: anyone can request a new number. No answer within 7 days of the first request: anyone can switch the raffle to refunds. The Duty3 keeper does both automatically.

Check a draw yourself

Open any finished raffle and scroll to Check the draw yourself. It lists the ticket ranges, links the request, answer and payout transactions with the event to look for in each, shows the random number, and recomputes the winners in your browser to confirm they match the contract.