fortune.cookie
uniswap v4 hook
fortune.cookie
uniswap v4 · mainneton-chain rng

every swapis aticket◆

a uniswap v4 hook where trading is the lottery. swap any pair routed through fortune.cookie — automatically get a ticket. every 100 blocks, one ticket cracks the jar.

★ you have 1 unread fortune.
chrome holographic fortune cookie
paid out
0.00Ξ
draws
0
tickets
0
◆ the money shot

the.jar

next draw in 870 blocks ✦
◆ jar livewindow #0
holographic jar of ETH
current jar
42.873
Ξ
≈ $147,911.85
next draw in
870blocks~2h 54m
0 tickets0%
★ MY-TICKETS.EXE — this window_×
your tickets
win odds
↑ connect wallet to play
◆ contracts not yet deployed — preview mode
◆ three steps

how.it.works

no signup, no extra clicks, no extra gas. swap as usual through any hook-enabled pool — the rest is on-chain math.

step_01.exe — SWAP_×
step_01
swap.

trade any token pair through a fortune.cookie-enabled v4 pool. you pay the normal lp fee — no surcharge.

◆ mainnet
step_02.exe — TICKET_×
step_02
ticket.

the hook mints tickets weighted by your eth volume. bigger swaps get more entries. tickets live in the jar until the draw.

◆ weight = ƒ(eth volume)
step_03.exe — WIN_×
step_03
win.

every 100 blocks, a verifiable random draw picks one ticket. the entire jar transfers to the winner. no claims.

◆ rng: chainlink vrf v2
◆ the hook

no admin.
no upgrades.
just.math.

fortune.cookie is a single immutable uniswap v4 hook. every swap routed through a fortune.cookie pool fires afterSwap(), which mints the ticket and rolls the jar. the lottery is the protocol.

✓ chainlink vrf v2.5✓ immutable↗ verified · etherscan
FortuneCookieHook.sol — Notepad_×
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;

contract FortuneCookieHook is BaseHook, VRFConsumerBaseV2Plus {
  uint256 public immutable epochDuration;   // seconds
  uint256 public currentEpochId;
  mapping(uint256 => Epoch) public epochs;

  function _afterSwap(
    address swapper,
    PoolKey calldata key,
    SwapParams calldata p,
    BalanceDelta delta,
    bytes calldata
  ) internal override returns (bytes4, int128) {
    uint128 ethVolume = _ethAbs(delta);
    uint256 ticketTax = ethVolume * taxBps / 10_000;

    _mintTickets(swapper, ethVolume - ticketTax);
    epochs[currentEpochId].ethPot += ticketTax;
    return (this.afterSwap.selector, int128(uint128(ticketTax)));
  }

  function requestDraw() external {
    Epoch storage e = epochs[currentEpochId];
    require(block.timestamp >= e.startTime + epochDuration);
    e.vrfRequestId = s_vrfCoordinator.requestRandomWords(...);
    e.drawing = true;
    emit DrawRequested(currentEpochId, e.vrfRequestId);
  }
}
◆ fortune.os v4.1 ◆
audited by humans ✦
0x4A…F9C0 won 12.40Ξ at block 19,284,331 0x9C…1830 won 3.10Ξ at block 19,282,283 0x12…0400 won 8.92Ξ at block 19,280,235 0xfE…D210 won 5.41Ξ at block 19,278,187 0xa1…0660 won 21.07Ξ at block 19,276,139 0xb7…4200 won 7.83Ξ at block 19,274,091 0x4A…F9C0 won 12.40Ξ at block 19,284,331 0x9C…1830 won 3.10Ξ at block 19,282,283 0x12…0400 won 8.92Ξ at block 19,280,235 0xfE…D210 won 5.41Ξ at block 19,278,187 0xa1…0660 won 21.07Ξ at block 19,276,139 0xb7…4200 won 7.83Ξ at block 19,274,091
cracked chrome fortune cookie
★ you cracked the jar!
◆ your fortune

crack.it.

“the next 100 blocks belong to you. one ticket. one jar. one winner. ◆”

◆ no admin keys◆ chainlink vrf◆ instant payout