Likely custom pricing hook on Ethereum

Uniswap v4 Hook Contract 0xc2ec4973a1880667b41d3b6b90b211e32da4e888 on Ethereum · Custom pricing

Volume (24h)
$0
Value locked (TVL)
$0
All-time volume
$0
Pools using this hook
1
Swaps (24h)
0 (0 traders)
Total swaps
0

What it does

A custom-accounting hook that intercepts swaps and liquidity additions on a pool, sets a hook-managed fee, and routes value through a token jar and an external Curve-style pool.

This read was written for the hook 0xc249…2888 on Ethereum and reused here: the two share a code shape, so constants such as fees, owners and addresses can differ.

How it works step by step

  • Runs beforeInitialize to set up per-pool state stored in a mapping at slot 2.
  • Gates liquidity additions in beforeAddLiquidity and can revert with LiquidityNotAllowed.
  • Overrides swap accounting in beforeSwap via return deltas, using take and settle to move currency.
  • Applies an admin-set uint24 fee parameter during swaps and quotes.
  • Accumulates value that can be swept to a token jar through pollTokenJar.
  • References an expiry block and external Curve-style pool interfaces.
Swap behaviour
beforeSwap is implemented with return-delta support, letting the hook alter swap amounts, apply its own fee, and take or settle currency, possibly by routing through an external Curve-style exchange.
Liquidity behaviour
beforeAddLiquidity is present and can revert with LiquidityNotAllowed, indicating liquidity additions may be restricted; beforeRemoveLiquidity and afterAddLiquidity/afterRemoveLiquidity are dispatched but their bodies are not characterised here.
Fee behaviour
A uint24 stored at slot 0 offset 20 is written by selector 0xc5cda8d2 and read during swap and quote paths, suggesting a hook-managed fee (or fee override) that is set by a privileged function; the exact fee rule is not determinable from the decoded data.
Owner & admin controls
Storage slot 0 holds an address read by pollTokenJar and tokenJar and a uint24 at offset 20 written by selector 0xc5cda8d2, indicating an owner-like address and a fee parameter that a privileged caller can set. The admin() view (0xf851a440) and OnlyAdmin error suggest an admin-gated role. Exact permitted operations cannot be fully confirmed without source.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeAddLiquidity, beforeSwap, beforeSwapReturnDelta

beforeInitialize: runs at pool creation and writes the mapping at slot 2. beforeAddLiquidity: can gate or block liquidity additions. beforeSwap: sets custom swap amounts and fees, reads the mapping at slot 2 and the fee value, and returns a delta so the hook can take or give currency. beforeSwapReturnDelta: lets beforeSwap return a delta that adjusts the amounts the pool settles.

Security & trust assessment

Risk level: high, estimated (decoded bytecode, low confidence).

Who controls it: A privileged key appears able to set the fee parameter and possibly the token jar or curve factory references, and can poll or move accumulated tokens into the jar, which could redirect value to the admin-controlled jar address.

Risk to user funds: The hook can take and settle currency during swaps through return deltas and can sweep accumulated balances to the token jar, so user swap amounts and pool funds are exposed to the hook's logic and to admin-set parameters.

Security findings

  • [high] Hook moves currency via return delta: beforeSwapReturnDelta is enabled and the bytecode contains take and settle selectors, so the hook can move currency during swaps and alter settled amounts.
  • [medium] Admin-adjustable fee: An admin-gated function writes a uint24 fee parameter that is read during swaps, so the admin can change the effective fee.
  • [medium] Token jar sweeping: pollTokenJar is nonpayable and tokenJar is exposed, indicating accumulated tokens can be swept to an external jar address that is controlled by the admin.
  • [low] External pool dependency and expiry: The hook references external Curve-style contracts (exchange, get_dy, coins, is_meta) and an expiryBlock, so behaviour depends on external pools and may end at a set block.
  • [info] Unverified source: No verified source is available, so function bodies and access checks are inferred from selectors and storage access only.

Contract details

Verified source
No
Bytecode size
11,394 bytes
Upgradeable proxy
No
Detected patterns
moves-currency, return-delta

Pools using Likely custom pricing hook