OKX Build X · Hook the Future · Uniswap v4 on X Layer

Order doesn't matter. One uniform price.

A sealed batch-auction launch hook for Uniswap v4 on X Layer. Bids are sealed during the window; everyone clears at one price, pro-rata. Snipers can't pay their way to the front, because there is no front.

Live on X Layer mainnet · chain 196 62 / 62 Foundry tests Settled demo · 1,000 dUSD2 cleared · 400k SBID distributed

Every token launch gets sniped.

Whoever orders the trade first, or pays the most to be ordered first, walks away with the cheap supply. Retail eats the markup. That's the default.

Every existing defense still rewards the fastest.

  • Fee decay — launches start at a high fee that drops over time. The fastest wallet still wins; it just pays a tax to do it.
  • Dutch auctions — price falls from a ceiling. The first acceptable bid clears. Block ordering decides who that is.
  • Fixed-price windows — first wallet to commit wins the allocation. Pure speed competition.
  • Priority-fee MEV taxes — work only on chains that order transactions by priority fee. X Layer doesn't.

The X Layer angle

In December 2025 X Layer migrated to the OP Stack and runs a flashblocks sequencer. We tested real mainnet blocks: transactions are not ordered by priority fee, and block-level ordering is effectively unpredictable. That breaks the priority-fee MEV-tax designs, and there's no general-purpose price oracle live on X Layer to power LVR-aware AMMs.

Sealed Launch doesn't fight ordering. It makes ordering irrelevant.

How it works

Four phases. One price. Everyone clears the same.

01

Commit

Bidders post a hashed commitment keccak256(amount, salt, bidder) and escrow a masked deposit. The pool is gated; nobody can trade.

02

Reveal

Bidders open their bid by revealing the real amount + salt. The overage refunds atomically. Bid sizes appear on-chain only here.

03

Settle

Anyone calls settle(). The auction clears at one uniform price P = totalRevealed / offeredTokens, the pool seeds full-range LP at that price, trading opens.

04

Claim

Every revealer claims their pro-rata token allocation. Non-revealers reclaim their masked deposit. First-block and last-block buyers walk away with the identical price.

Fairness is a property of the mechanism, not a tunable parameter.

v1 vs v2

Two managers, one shared hook. v2 adds size-sealed bids on top of v1's clearing.

v1 — SealedLaunch
v2 — CommitRevealLaunch
Order-independent
Bid sizes sealed on-chain
Settlement
uniform price
uniform price
Mechanism
direct commit
hashed commit + masked deposit + reveal
Deployed
mainnet
mainnet

Architecture

Two managers, one gating hook, one ERC-20 per launch — all wired through the official Uniswap v4 PoolManager on X Layer.

HOOK

SealedLaunchHook

A v4 BaseHook with permission flags beforeInitialize | beforeAddLiquidity | beforeSwap (0x2880). Reverts every swap until markSettled is called. Blocks non-manager liquidity adds pre-settlement. Holds no funds; runs no price math. The hook is shared across v1 and v2 — same address gates every pool.

V1

SealedLaunch (v1 manager)

Escrows commitments, clears at the uniform price P = totalCommitted / offeredTokens, seeds full-range LP via poolManager.unlock → modifyLiquidity, and opens trading. Misses minRaise? Everyone refunds.

V2

CommitRevealLaunch (v2 manager)

Adds a hashed commit + masked deposit on top of v1's clearing. Bidders post keccak256(amount, salt, bidder) during the commit window, reveal the real amount during the reveal window (overage refunded), and settle at the uniform clearing price. Bid sizes stay hidden on-chain until reveal.

ERC-20

LaunchToken

A vanilla ERC-20 deployed per-launch by the manager. offeredTokens are distributed pro-rata to revealers at the clearing price; lpTokens are seeded into the v4 pool. Pre-mint goes nowhere a launcher can rug.

All managers initialize their pools against the official Uniswap v4 PoolManager on X Layer at 0x360E68faCcca8cA495c1B759Fd9EEe466db9FB32. The hook address is CREATE2-mined so its low bits carry the required permission flags.

Live contracts on X Layer mainnet

Chain 196. The v2 demo settled end-to-end on-chain — read the state of that demo, live, below.

Live state — v2 demo

Read straight from the deployed v2 manager + the v4 pool. No wallet, no backend.

Auction status
Total revealed
Clearing price
Pool liquidity

Querying the v2 manager and the v4 pool on X Layer…

Try it

A read-only viewer for the mainnet demo, or open a brand-new launch with your own params.

Lifecycle viewer

Drive any auction's lifecycle from a single URL: commit, reveal, settle, claim. Defaults to the mainnet demo.

Open

Create a launch

Deploy a fresh ERC-20 and open a CommitRevealLaunch pool in one transaction, with your own window, raise, and tick spacing.

Create

Internal security audit (2026-05-28)

Honest, full disclosure. We audited 61 findings across contracts, SDK, frontend and Foundry scripts on the day of submission.

Patched in this commit

Frontend, SDK, scripts.

  • KNOWN_LAUNCHES allowlist for ?launch= URLs + opt-in ack.
  • chain-id == 196 assertions on every mainnet script.
  • resolveChain(ctx) throws on missing chain (no wrong-chain broadcasts).
  • deriveSalt normalizes salt input to NFC.
  • New hasCommitted(b) helper, faucet cooldown + amount cap, QuoteFaucet chain-gated.

Disclosed as known v1.0 limits

Two CRITICAL contract findings. The deployed addresses can't be patched in place; mitigated today because only the demo runs on the deployed managers.

  • C-1SealedLaunch.settle() uses a balanceOf sweep; drains other launches' escrow if multiple launches share the same manager + quote.
  • C-2CommitRevealLaunch LP can over-consume the shared quote balance: no quoteUsed <= totalRevealed bound, no tickSpacing / sqrtPrice bounds.

v1.1 fix plan

  • Per-launch quote accounting (no balanceOf sweep).
  • nonReentrant on every external state-changing function.
  • SealedLaunchHook.configure restricted to a manager allowlist.
  • require(quoteUsed <= totalRevealed) invariant, plus tickSpacing / sqrtPrice bounds.
  • Full v1.1 redeploy to fresh mainnet addresses; v1.0 stays on-chain as historical proof.

Roadmap

From a hackathon hook to the fair-issuance rail.

PHASE 0

Built ✓

62/62 Foundry tests, v1 + v2 deployed to X Layer mainnet, real auction settled on-chain.

PHASE 1

Win the hackathon

Demo video, submission, multi-bidder live demo with on-chain pro-rata fairness.

PHASE 2

Hook → product

SDK, hosted dApp, commit-reveal v2, fee routing in OKB, third-party audit.

PHASE 3

X Layer launch standard

flap partnership, launchpad-as-a-service, fairness reputation, OKX integration.

PHASE 4

Smarter auctions + multi-chain

Tiered / Dutch curves, allowlist + KYC gates, deploy on every chain with official v4.

PHASE 5

Fair-issuance rail / EIP

Open standard for on-chain launch covenants; the default way a token comes to market.