LaunchGuardHook on Ethereum

Uniswap v4 Hook Contract 0xee83560bb83fa38dcd3c1060233ddc7933c520cc on Ethereum · Launchpad · Verified contract

Volume (24h)
$4.92K
Value locked (TVL)
$8.84K
All-time volume
$771.18K
Pools using this hook
65
Swaps (24h)
31 (23 traders)
Total swaps
7,191

What it does

A guarded launch hook for v2 token markets that charges a one percent fee on base-side swap value, limits early buyers during the launch window, and caps how much any one buyer can accumulate.

How it works step by step

  • Registers only markets admitted by the factory; beforeInitialize accepts pools only when the factory initializes them with zero LP fee and the hook's own address.
  • During the guard window (guardActive on the market token), non-opening buys of the launch token are blocked unless the buyer is on the early-buyer list, via buyerIdentity resolution of router-forwarded senders.
  • Tracks each buyer's cumulative bought amount per pool in boughtInWindow and reverts when a single buy exceeds currentBuyCap or the running total exceeds MAX_HOLD.
  • Charges a 1% fee on the base-side amount of every swap in beforeSwap or afterSwap (depending on exact-in or exact-out) and takes it through return deltas.
  • Splits each fee between the creator beneficiary, the factory treasury and token holders according to the market's fixed split; failed shares are deferred to the LiquidityLocker as ERC-6909 claims instead of reverting the swap.
  • Exposes feeOnNet, marketFor and a pay helper that takes base currency from PoolManager and forwards it to the launch token's fund function for holder funding.
Swap behaviour
beforeSwap can block non-early-access buys during the guard window, and charges the 1% base-side fee by returning a specified-side delta; afterSwap enforces per-buyer buy and hold caps on the launch token output and charges the fee on unspecified-side base amounts when applicable.
Liquidity behaviour
No liquidity callbacks.
Fee behaviour
A fixed 1% fee on base-side value (feeOnNet inverts the grossing-up for exact-output), taken by the hook through return deltas and split among creator, treasury and holders; the pool's LP fee is zero. Undeliverable shares are minted to the LiquidityLocker and claimable later.
Owner & admin controls
The hook itself has no owner or pause. The factory (upgradeable, per source comments) controls the treasury address and opening-buy state that the hook reads. The LiquidityLocker's graduation pricing is administered by the factory owner (setSource, setReferenceTicks, setGraduationThreshold), which does not gate swaps. Router, alternateRouter and quoter addresses are immutable.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeInitialize validates that pools are factory-created with zero fee and are registered; beforeSwap enforces early-access restrictions and charges the fee via a specified delta; afterSwap enforces buy and hold caps and charges the fee on unspecified amounts; beforeSwapReturnDelta and afterSwapReturnDelta let the hook take a share of swap amounts as fees.

Security & trust assessment

Risk level: medium (verified source, high confidence).

Who controls it: The factory owner can change graduation pricing sources, reference ticks and the graduation threshold, and can alter the factory-supplied treasury and opening-buy state through factory upgrades. These do not directly move LP funds but can change where the 1% fee goes and whether swaps in the launch window are gated.

Risk to user funds: The hook holds no balances itself; fees are taken from swap deltas and routed via PoolManager to the creator, the treasury and the token, with undeliverable shares minted to the LiquidityLocker. Swaps can be blocked by early-access or cap logic during the guard window, and fee routing depends on the factory's treasury value.

Security findings

  • [medium] Fee and gating depend on an upgradeable factory: The factory supplies the treasury address and openingBuyActive state, and its implementation can be upgraded. A malicious or buggy factory upgrade could redirect the treasury share or change opening-buy gating for markets, though reads are bounded and market snapshots are write-once.
  • [medium] Early-access and buy caps can block trades during the guard window: beforeSwap reverts EarlyAccessOnly for non-whitelisted buyers in the launch block window, and afterSwap reverts BuyCapExceeded or HoldCapExceeded for buys over currentBuyCap or MAX_HOLD, which are read from the launch token. Those token parameters, controlled by the token contract, determine whether trades succeed.
  • [low] Router-dependent buyer identity: buyerIdentity trusts the immutable router, alternateRouter and quoter msgSender() views to resolve the real trader; a bug in those routers would misattribute caps and early access, while unknown callers are treated as their own identity.
  • [low] Fee and payout delivery relies on gas-capped external calls: Creator and treasury takes are gas-capped at 100000 and failures are deferred to the locker; holder funding calls the launch token fund function and failures are deferred, so an unusual token or recipient can shift value into deferred claims rather than reverting.
  • [info] Hook holds and moves base currency via return deltas: The hook takes base-side fees through beforeSwapReturnDelta and afterSwapReturnDelta and uses PoolManager take and mint to route them, so it does move pool-backed user value on every swap.

Contract details

Verified source
Yes (LaunchGuardHook)
Compiler
solc 0.8.26+commit.8a97fa7a
Bytecode size
9,484 bytes
Upgradeable proxy
No
Detected patterns
launchpad, moves-currency, return-delta

Pools using LaunchGuardHook