$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 commit-reveal randomness 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 use a two-step commit-reveal:
commitDraw(epoch)— anyone calls after the epoch ends. records the current block number as the randomness source. costs only gas.revealDraw(epoch)— anyone calls 1+ blocks later. usesblockhash(commitBlock)combined with accumulated swap entropy to select the winner. costs only gas.
no keeper fees. no sealed hashes. no preimages. the draw is permissionless and free to trigger.
winners are paid automatically inside the revealDraw transaction. 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):
- stale commit grief: bounded by the 256-block blockhash window; anyone may commit again with no penalty or cost
- reentrancy: draw state is updated before external calls (checks-effects-interactions). winner payout uses a gas-stipended call with rollover on failure.
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
- commit-reveal uses the blockhash of a future block. validator bias requires controlling both the commit and reveal blocks, which is impractical.
- 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 0x7777774274d9eb8b07deCf31cEc80CDA62dEB8c1 lotohook.sol 0xaE564f585328157c30794a81C4237B5c6d168044 pool eth/loto · 0.3% fee · uniswap v4
/* end of document. there are no future versions. */