NateRich.net Docs Lab Tools

Quintile Lottery

A Sepolia demo of a no-house on-chain lottery design. One ticket in five wins. No oracle, no house cut on the pot, no admin who can alter the result. The hosted app is a demo and reference surface, not a real-money service.

What it is

Quintile Lottery is a smart-contract raffle where every round is self-contained: tickets are purchased, the pot accumulates, and when the deadline passes anyone can trigger the draw. Winners are selected by the contract using public on-chain randomness — no trusted third party decides the outcome.

The demo lives on Sepolia testnet at the lottery app. It uses test ETH and lab test tokens only. The contract family is being hardened for a GPL-3.0 GitHub release so others can review, fork, and deploy it themselves, but this hosted instance remains a demo.

Try the no-wallet simulator to model any round before connecting.

Demo variants

The current app surfaces six Sepolia games. They share the same lifecycle and prize math, but scale ticket price, pot caps, and test-token plumbing for different demo paths.

variantassetrole
EtherSepolia ETHcanonical ETH-denominated demo
Ether-miniSepolia ETHsmaller ETH-denominated round for faster testing
QTSTQTST test tokencanonical ERC-20 demo
Mini-QTSTQTST test tokensmaller ERC-20 round
BQTSTBQTST test tokenEVL-gated ERC-20 demo
Mini-BQTSTBQTST test tokensmaller EVL-gated ERC-20 round

QTST and BQTST have no value. They exist so the demo can exercise ERC-20 intake, approvals, badge-gated faucets, and EVL credential flows without pretending to be a production deployment.

How a round works

phasewhat happens
OpenTickets are on sale at the selected variant's configured price. Donations can be sent any time and go 100% to the pot.
ArmedThe deadline block has passed. The round is locked — no new tickets. Anyone can call requestDraw().
DrawingThe contract has a pending randomness request. Anyone can call executeDraw() once the block is final.
ClaimableWinners are set. Each winning wallet calls claim() to pull their prize. Prizes are never auto-pushed.
ExpiredClaim window has closed. Unclaimed prizes roll forward into the next pot.

Prize structure

About one ticket in five wins. The pot is divided into three legs — winners in earlier legs receive more per ticket:

legshare of potwinners
Grand20%1 – 3 depending on round size
Top decile50%~10% of all tickets, split evenly
Second decile30%~10% of all tickets, split evenly

Grand winners take 20% of the pot split among only 1–3 tickets — a single grand-prize ticket can be worth dozens of second-decile tickets on the same round. The simulator shows the exact split for any pot size and ticket count.

Design principles

The 1% protocol fee is the only value extracted from the system — it is segregated from the pot and can only be swept by the contract owner. Everything else (ticket purchase, donation, draw request, draw execution, claim) is permissionless: any wallet can perform any action, and the contract cannot be paused or altered after deployment.

Randomness comes from Ethereum's on-chain RANDAO value after a future-block lookahead rather than an oracle. This keeps the contract independent and cheap. The proposer-bias tradeoff is documented in Blocks, time & state.

Documentation

New to crypto? Start with Crypto 101, then try the simulator before connecting a wallet.