Docs · how raffles work · FAQ
Permissionless raffles, baked into bytecode.
No admin. No extend. No cancel. The contract is the time-lock and the contract is the escrow. Once you create a raffle, neither you nor we can pull the prize back before the timer ends.
How a raffle works
Five on-chain stages. The keeper handles the boring middle so users only need to show up to buy and claim.
- Step 1
Create
Creator picks a prize (NFT or any TIP-20 token), a ticket price (in pathUSD), ticket supply, and an end timestamp. The contract pulls the prize into escrow and emits a RaffleCreated event. Listing is free.
- Step 2
Buy tickets
Anyone holding pathUSD can buy any number of tickets up to the supply. Tickets are weighted: buying more tickets raises your chance of winning, proportional to total tickets sold. The contract tracks each buyer's wallet + ticket count and salts a per-raffle entropy accumulator at every buy (this is what makes the eventual draw MEV-resistant).
- Step 3
Draw
The timer ends. The protocol picks a winner. The raffle page tells everyone where they stand: if you didn't win you'll see it in red, if you did win you'll see it in green with a Claim button waiting for you.
- Step 4
Claim
Winner clicks Claim, prize lands in their wallet. Creator clicks Claim, 95% of the pool lands in theirs. The remaining 5% settles to the protocol treasury. Everything happens directly from the smart contract: no middleman holds your prize, no support ticket required.
Creating raffles
The full create flow takes 1–3 wallet signatures depending on what's already approved.
What can I raffle?
What do buyers pay in?
What prize tokens work for token raffles?
transfer moves exactly the amount you specify.What's the listing fee?
What if my raffle doesn't sell?
How is the winner picked?
Security
The raffle contract has no admin, no upgrade path, and no cancel function. What that means in practice:
No admin override
setOwner, no pause, no cancelRaffle, no extendDeadline. The functions literally don't exist in the bytecode. Once you create a raffle, the only states it can move through are: CREATED → AWAITING_RANDOMNESS → RESOLVED → CLAIMED (or REFUNDED if 0 tickets sold). The MUNKS team cannot reach into a live raffle to change anything.On-chain escrow
ownerOf changed before accepting the create. For token pots we verify the contract's balance increased by exactly the prize amount (this rejects fee-on-transfer and rebasing tokens at create, before they can cause downstream accounting bugs). The prize cannot leave the contract until the winner claims it, the creator reclaims it on a 0-ticket refund, or anyone pushes it to the winner after the 7-day grace period.Provably-fair randomness
blockhash(resolveBlock + 5): a future block, unknowable at resolve timeblockhash(resolveBlock + 10): a second future block, separated to require multiple proposer slots to biasblock.prevrandaoat finalize-time: the entire validator set's RANDAO mix- Per-buy entropy accumulator: XOR of every buyer's address, ticket count, and the block they bought in. A would-be biaser must predict every honest buyer's tx to control this input
To bias the outcome, a validator would need to control both future blocks and the finalize block and predict every ticket buy in advance. The combined probability is exponentially small. Click "Provably fair" on any raffle page to see the live inputs and verify the winner deterministically by hashing them yourself.
Egress balance-delta checks
Independent audit
FAQ
The questions everyone asks before they buy their first ticket.
Is this safe?▾
Can the team rig the draw?▾
prevrandao plus per-buyer entropy. To bias the outcome, the team would need to be the proposer of two specific blocks, plus the proposer of the finalize block, plus predict every honest buyer's transaction. The combined probability rounds to zero.What happens if no one buys a ticket?▾
What happens if I win but don't claim?▾
claimForWinner() to push the prize to your wallet on your behalf. Either way, the prize ends up with you. The contract just stops holding it indefinitely.Can I get my money back if I bought a ticket?▾
What's the protocol fee on the pool?▾
Who picks the winner, you or the chain?▾
keccak256(seed1, seed2, prevrandao, entropy) % ticketsSold and walking the participant list. There is no off-chain oracle.What if my wallet doesn't show the right token balance?▾
Can I edit my raffle after creating it?▾
What chain is this on?▾
What about gas fees?▾
Still got questions?
Read the contract source on the Tempo Explorer, or just create a raffle and watch every step land on-chain.