LaunchGuardHookTest on Ethereum
Uniswap v4 Hook Contract 0xa7000cd989eacf2a2d08368eef79167e62266ac0 on Ethereum · Launchpad · Verified contract
- Volume (24h)
- $0
- Value locked (TVL)
- $7.26K
- All-time volume
- $1.33M
- Pools using this hook
- 1
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 8,504
What it does
A launchpad hook for a fixed-fee token pool that only allows the designated locker to create the pool and tracks buy volume so the market can consume it, while collecting fees from the locker on sells.
How it works step by step
- Restricts pool initialization to the locker address at a fixed initial sqrt price
- Validates every pool interaction against a fixed 2% fee, fixed tick spacing, native-token/token pairing and this hook address
- On buys, adds the token1 output amount to transient buy credit that the market can later consume
- On sells, calls collectFromHook on the locker to collect accrued fees, guarded against reentry
- Lets only the market contract consume buy credit via consumeBuyCredit
- Emits FeesTriggered when fee collection runs
- Swap behaviour
- beforeSwap validates the pool and returns zero delta with no fee override. afterSwap records output of buys as transient buy credit, and on sells (unless a protocol swap) it calls the locker's collectFromHook and emits FeesTriggered.
- Liquidity behaviour
- beforeAddLiquidity and beforeRemoveLiquidity only validate the pool key and return their selectors; liquidity is not restricted beyond pool-key validation and no deltas are taken.
- Fee behaviour
- Pool fee is fixed at 20000 (2%) by POOL_FEE and must match on every call. Sell-direction swaps (oneForZero, not protocol) trigger ILaunchGuardLocker.collectFromHook() on the locker, which collects accrued fees; the hook itself returns zero fee override and zero delta.
- Owner & admin controls
- No owner or admin role is set; the constructor fixes poolManager, locker, token and market as immutables, so no one can change them after deployment. Only the locker may initialize the pool and only the market may call consumeBuyCredit.
Enabled Uniswap v4 callbacks
beforeInitialize, beforeAddLiquidity, beforeRemoveLiquidity, beforeSwap, afterSwap
beforeInitialize restricts pool creation to the locker with the fixed initial sqrt price and sets the initialized flag. beforeSwap and beforeAddLiquidity/beforeRemoveLiquidity validate the pool key (fee, tick spacing, token pairing, hook address). afterSwap tracks buy credit in transient storage on buys (zeroForOne, token1 output), calls the locker to collect fees on sells, and emits FeesTriggered.
Security & trust assessment
Risk level: medium (verified source, high confidence).
Who controls it: No privileged key exists after deployment, so no single party can pause swaps, change fees or drain funds. The locker is a trusted address set at construction; if it is compromised it can initialize pools and trigger fee collection calls.
Risk to user funds: The hook takes no tokens via return deltas and never holds user funds directly; it only forwards a fee-collection call to the locker on sells. Funds exposure therefore sits with the locker contract, which the hook calls but does not control.
Security findings
- [info] Pool initialization is restricted: Only the locker can initialize the pool and only at the hardcoded sqrt price, so the pool cannot be created with a different configuration.
- [medium] Sells depend on external locker call: afterSwap calls ILaunchGuardLocker.collectFromHook() on every non-protocol sell. The hook depends on the locker contract behaving correctly, and a reverting or malicious locker would block sell swaps.
- [info] Buy credit is transaction-scoped: Buy credit is accumulated in transient storage (tstore) and consumed by the market through consumeBuyCredit. Transient storage is cleared at the end of each transaction, so credit cannot persist across transactions.
- [low] Protocol-swap bypass depends on market address: The protocolSwap path is enabled only when sender equals market and hookData is a single byte with value 1. Any caller that can set those values bypasses the credit and fee-collection logic, but the market address is immutable and fixed at deployment.
Contract details
- Verified source
- Yes (LaunchGuardHookTest)
- Compiler
- solc 0.8.26+commit.8a97fa7a
- Bytecode size
- 3,794 bytes
- Upgradeable proxy
- No
- Detected patterns
- launchpad
Pools using LaunchGuardHookTest
- ETH / usocks (2.00% fee) — 24h volume $0, TVL $7.26K, 0 swaps today