LaunchGuardHook on Ethereum

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

Volume (24h)
$960
Value locked (TVL)
$12.81K
All-time volume
$2.83M
Pools using this hook
266
Swaps (24h)
72 (46 traders)
Total swaps
37,242

What it does

A swap guard for fresh token launches: during the launch block only the factory's opening buy may swap, and in the following window each buyer is capped on how much of the token they can take from the pool and in total.

How it works step by step

  • beforeSwap reverts any swap in the token's launch block unless the sender is the token's factory, which is the creator's opening buy.
  • afterSwap reads the guard state from the pool's currency1 token (guardActive, launchBlock, currentBuyCap, MAX_HOLD) and skips the check if the pool does not hold a token that reports a factory.
  • Buys (currency1 leaving the pool) larger than currentBuyCap revert the whole swap after the amount is known.
  • A running per-pool, per-tx.origin total of bought amounts is kept in boughtInWindow and reverts when it exceeds MAX_HOLD.
  • Sells (zeroForOne swaps) and all liquidity, donate and initialize callbacks are not capped or touched.
Swap behaviour
beforeSwap blocks non-factory swaps in the launch block. afterSwap, when guard is active and the swap is a buy after the launch block, reverts if the buy exceeds the current buy cap or pushes the buyer's cumulative amount over the hold cap; otherwise it accepts the swap with no delta change.
Liquidity behaviour
No liquidity callbacks.
Fee behaviour
Uses the pool's static fee. The hook returns zero delta and no fee override.
Owner & admin controls
No owner, pause, upgrade or parameter setter is present in the ABI or source. Limits come from the token contract's own state (currentBuyCap, MAX_HOLD, guardActive, launchBlock) which the hook reads but does not control.

Enabled Uniswap v4 callbacks

beforeSwap, afterSwap

beforeSwap is used to refuse non-creator swaps in the launch block before any output is settled. afterSwap is used to enforce the per-buy cap and the cumulative hold cap on the measured output amount.

Security & trust assessment

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

Who controls it: The hook itself has no privileged role. Whoever controls the launched token's factory and token state (guardActive, currentBuyCap, MAX_HOLD) effectively controls how this guard behaves, and those values are not visible in this hook's source.

Risk to user funds: The hook does not custody or move tokens and returns zero deltas. It can revert swaps, which blocks buys in the launch block for non-factory senders and blocks buys over the caps; it cannot take funds.

Security findings

  • [medium] Caps depend on the token contract: The guard values are read from the currency1 token via factory(), currentBuyCap(), guardActive(), MAX_HOLD() and launchBlock(). A token that returns misleading values or is itself upgradeable can change or disable the guard without any change to this hook.
  • [low] Hold cap keyed on tx.origin: boughtInWindow uses tx.origin, so a buyer can split purchases across several wallets to get more than one hold cap, and contracts that relay for users share a bucket. The comment acknowledges the key choice but it does not prevent multi-wallet circumvention.
  • [low] Hook trusts currency1 as the token: _guarded treats whatever address sits in currency1 as the launched token. A pool with a non-launch token that happens to return a factory() address is subject to these rules, and a pool that does not is skipped silently, so the guard only applies to pools that follow the factory's sorting convention.
  • [info] Bucket never cleared: boughtInWindow is never reset, per the source comment. It is keyed per pool so it only matters for that pool, but it grows without bound and is not enforced by time after the window closes; afterSwap still applies MAX_HOLD to later buys if guardActive stays true.
  • [info] Unused callbacks present: Only beforeSwap and afterSwap are enabled by the address, so the other IHooks functions in the ABI are inert stubs that the PoolManager does not call.

Contract details

Verified source
Yes (LaunchGuardHook)
Compiler
solc 0.8.26+commit.8a97fa7a
Bytecode size
2,776 bytes
Upgradeable proxy
No
Detected patterns
launchpad

Pools using LaunchGuardHook