an erc-20 lottery on uniswap v4 · buys earn lootbox tickets · prizes from a 3% swap-tax vault
still scrolling for the next 100x?
Buy HOOKED on Uniswap and the v4 hook drops lootbox tickets in your wallet automatically. Open them whenever you want.
how it works
four moves, one randomness oracle (the validator), zero off-chain plumbing
Swap ETH → HOOKED on the v4 pool. The hook takes 3% of input ETH up front. Buys above 0.01 ETH earn tickets — 1 / 2 / 4 / 8 across size tiers, written to your wallet in the same tx.
Your batch carries 0–4 boost flag bits derived from buy size, recent sell streak, pool price vs. its 10-min snapshot, and the daily buy counter. Flags are tier upgrades, not roll modifiers.
Call openTickets(N) to burn N tickets. The contract walks your batches oldest-first, ORs their flags into a single open request, and schedules the reveal for block.number + 3.
After 3 blocks, anyone can call revealTickets(openId). The reveal block's prevrandao seeds a per-ticket keccak rng, each ticket rolls a tier, boosts apply, prizes pay out.
the four boosts
flags are bit-OR-ed across all batches you consume in one open · stack 3 → legendary · stack 4 → jackpot
the five boxes
probabilities are before boost upgrades · ETH share = % of vault, capped per tier · plus a flat HOOKED amount
randomness
fully on-chain · no oracles · no off-chain dependencies
When you call openTickets, the contract commits to a future block. When you call revealTickets(openId)three blocks later, it mixes that block's prevrandao with the openId and your wallet to seed a keccak rng per ticket:
base = keccak256(prevrandao, openId, wallet) ticket[i].rng = keccak256(base, i)
The validator who'll propose the reveal block isn't known when you open. The 3-block delay locks your commitment in before anyone can choose what comes next.
Anyone can call reveal once the delay passes — competing reveal bots are fine, the prize always routes to the original wallet. Every input to the roll is public on chain, every byte of the formula is in the contract.
recent action
last 20 events · refreshes every 30s