$loto: a uniswap v4 lottery hook with permanent supply burn
two immutable contracts. no governance. no admin. every swap is a ticket. every draw burns supply. forever.
abstract
$loto is a uniswap v4 hook that converts ordinary swap activity into deterministic lottery participation. on every swap routed through the hook pool, 0.5% of the swap output is diverted into the daily lottery pot. every 24 hours, a single address is selected via on-chain randomness (prevrandao + swap entropy) and receives 80% of the eth balance of the pot. 10% of every jackpot is retained as a seed for the next pot. all loto tokens that accumulated in the pot during the epoch are burned via loto.burn(); totalSupply decreases. there is no mint function.
01. design goals
- no governance, no admin keys, no upgradeability
- no off-chain dependencies — randomness sourced on-chain
- no ticket purchase flow — lottery participation is a side-effect of liquidity
- monotonically deflationary — supply only decreases
- every state transition triggerable by any caller, not the deployer
02. the hook
lotohook.sol implements IHooks from uniswap v4 and is deployed as the singular hook for one canonical eth/loto pool. the relevant lifecycle methods:
afterSwap(params) → divert 0.5% of swap output into currentPot
accumulate weight for the swapper
(uses tx.origin; AA wallets pass via hookData)
03. the pot
the pot is a per-epoch struct tracking participants and the fees each one has contributed. each address accumulates weight proportional to sqrt(fees contributed). more trading activity = higher odds, but with diminishing returns thanks to sqrt compression. there is no separate ticket-purchase flow.
04. the draw
draws settle automatically when the first swap of a new epoch occurs. the hook detects the epoch boundary and runs the draw inline. if no swap happens, anyone can call forceDraw(epoch) to settle it manually. costs only gas.
randomness comes from block.prevrandao combined with entropy accumulated from every swap in the epoch (swapper address, fee amount, delta, block number). no commit-reveal, no keeper, no oracle.
winners are paid automatically inside the draw settlement. no claim step. no expiration. eth is sent directly to the winning address. if the winner's wallet rejects the transfer, the payout rolls into the next jackpot.
05. the burn
alongside eth, the pot accumulates loto tokens (the loto side of every swap contributes to the pot). at draw time, the hook calls loto.burn() on the entire loto balance of the pot. totalSupply decreases. there is no admin override and no path to recover burned supply. the cumulative amount is queryable via totalBurned().
06. supply curve
initial supply : 777,777 loto
mint : disabled (no function)
burn rate : scales with trading volume — more activity, faster burn
(highly variable; volume-dependent)
asymptote : 0
supply approaches but never reaches zero. as supply contracts and demand for tickets remains constant, the per-token claim on the pot's eth grows. the curve is not pre-defined; it emerges from realized swap volume.
07. security
the contracts are immutable. the deployer holds no privileged role. there is no owner, no pauser, no upgrade proxy. all state transitions are public and callable by any externally-owned account.
two known attack surfaces are addressed in the audit (link on /contract):
- reentrancy: draw state is updated before external calls (checks-effects-interactions). winner payout uses a low-level call with rollover on failure. nonReentrant guard on settlement.
- validator bias: prevrandao is mixed with swap-accumulated entropy across the entire epoch, making single-block manipulation insufficient.
08. trust model
you trust: solidity, the ethereum protocol, uniswap v4's hook lifecycle, the audit. you do not trust: the deployer, any team, any multisig, any oracle. there is no off-chain component to compromise.
09. limitations
- prevrandao is proposer-influenceable. the accumulated swap entropy mitigates this but does not eliminate it entirely for very low-volume epochs.
- extreme low-volume epochs may have very few participants, increasing variance
- the pool is a single eth/loto pair. there is no multi-pool aggregation.
10. contracts
loto.sol 0x777777651a6097a97dE9A57571945Ae8D445a341 lotohook.sol 0x226f3D8ed87FA2311215F84550421Cb8bd7B4044 swaprouter 0xb5d7a3B3d3A4eBc2EC021056fD495C897FF077c4 pool eth/loto · 0.3% fee · uniswap v4
/* end of document. there are no future versions. */