How it works
A creator escrows a prize. People buy tickets in USDC. One winner is drawn with randomness nobody involved can influence, and the money is split three ways.
Everything below is what the contract at 0x6dd9cd89d05ABF680528c96A2dBF3414fB6BB8a6 does. The figures on this page are read from that contract when the page is built, not written into it.
The sequence
- A creator escrows a prize. One token — USDC, another ERC-20, or a single ERC-721 — and a ticket count, a price and a duration. The escrow moves in the same transaction that opens the raffle, into an address that holds that raffle's prize and nothing else.
- People buy tickets in USDC. Every ticket in a raffle costs the same, and the price is fixed at creation.
- The raffle closes when it sells out or when its deadline passes, whichever comes first. Anyone can close it; the vault does not need us to.
- A winner is drawn from a drand beacon published after the close. Anyone can submit it. How the randomness works.
- Everyone claims separately. The winner claims the prize, the creator claims the revenue. Two pulls, two addresses, and neither can block the other.
The money
- The protocol takes 5% of the ticket revenue, plus a $1.00 creation fee paid when the raffle is opened.
- The creator receives the rest of the ticket revenue — 95%.
- The winner receives the prize, and no USDC.
Worked, so there is no ambiguity — a 100 USDC prize, 110 tickets at $1:
protocol $5.50 from tickets + $1.00 at creation = $6.50
creator $110.00 - $5.50 = $104.50
winner the 100 USDC prize, and no USDC besides
Those are the figures a test asserts against the contract, not an illustration. The numbers in it are the example's own — they only make sense together, and substituting a live fee into them would produce a worked example whose arithmetic does not work.
The ticket price
The creator sets what they want the raffle to raise and how many tickets it takes to get there; the price is what those two imply, rounded up to the cent, and it may be any amount at or above the floor below.
The smallest ticket this vault will sell is $1.00. A raffle needs at least 3 tickets and at most 1,000,000, and the ticket count times the price is capped at $5,000.00 for a single raffle.
Three tickets is where a draw starts being a draw: one ticket has a winner with probability 1, and two is a coin flip with a fee on it.
An unfilled raffle still draws
If the deadline passes with tickets unsold, the raffle draws anyway. The prize is the same and the creator's revenue is smaller, because fewer tickets sold.
It works this way on purpose. A raffle that refunded when it did not fill would hand the creator a free option on their own marketing, and would give every player a reason to wait rather than enter.
Duration and the claim window
A raffle stays open for between 1 hour to 30 days, chosen at creation.
After the draw there is a 365 days window to claim. What is not claimed in that window can be swept to the treasury — an indefinitely claimable balance is an indefinite liability in a contract with no admin.
Buying a ticket costs slightly more than the ticket
Gas on this chain is paid in USDC, out of the same balance the ticket is bought with. There is no separate gas budget to run out of first, so a wallet holding exactly the ticket price cannot buy a ticket.
The interface holds a little back for this and says how much. It is not a fee we take.
What the creator cannot do afterwards
Nothing about a raffle can be changed once it exists: not the prize, not the price, not the ticket count, not the deadline. There is no setter for any of them. While no ticket has sold the creator can take the prize back and close the raffle; after the first ticket, that door is shut too.
The creation fee is not returned in either case.