Likely custom pricing hook on Polygon

Uniswap v4 Hook Contract 0xf1431433e731f53fdded71731e51113051984ac8 on Polygon · 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
5

What it does

A custom-accounting hook for a Uniswap v4 pool on Polygon that adds owner-controlled pausing and token withdrawal around swaps and liquidity actions, with a price-based return delta that can alter settlement amounts.

How it works step by step

  • Gates swaps and liquidity actions through the owner-controlled paused flag
  • Runs custom logic in beforeSwap and afterSwap that updates stored price-related values
  • Returns a before-swap delta that changes the amounts settled with the PoolManager
  • Gates add and remove liquidity through beforeAddLiquidity and beforeRemoveLiquidity
  • Exposes priceNum() and priceDen() views, suggesting a price ratio the hook uses for pricing
  • Lets the owner withdraw ERC20 balances held by the hook via withdraw20
Swap behaviour
beforeSwap and afterSwap run custom logic on every swap, the swap path checks the paused flag, and beforeSwapReturnDelta lets the hook adjust settled amounts.
Liquidity behaviour
beforeAddLiquidity, beforeRemoveLiquidity, afterAddLiquidity and afterRemoveLiquidity callbacks exist in the dispatch table; beforeAddLiquidity and beforeRemoveLiquidity are the hook's permissioned callbacks, and their behaviour cannot be fully determined from decoded bytecode.
Fee behaviour
Hook takes no protocol fee in the decoded functions; the swap path uses return deltas via beforeSwapReturnDelta, which may alter effective pricing, but the exact fee logic cannot be confirmed without source.
Owner & admin controls
Owner (slot 0) can call setPaused(bool) to pause the hook and withdraw20(address,address) to withdraw ERC20 tokens held by the hook; owner() is readable. No parameter-change setter was decoded. No upgrade mechanism was detected.

Enabled Uniswap v4 callbacks

beforeAddLiquidity, beforeRemoveLiquidity, beforeSwap, afterSwap, beforeSwapReturnDelta

beforeAddLiquidity and beforeRemoveLiquidity gate or inspect liquidity changes; beforeSwap and afterSwap run custom logic around swaps; beforeSwapReturnDelta lets the hook return a delta that changes the amounts settled with the PoolManager.

Security & trust assessment

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

Who controls it: The owner can pause all hook-gated swaps and liquidity actions via setPaused and can withdraw any ERC20 balance the hook holds via withdraw20, so a compromised owner key could drain tokens held by the hook.

Risk to user funds: The hook can take and transfer currency through the PoolManager via return deltas and can hold tokens; the owner can pause swaps and withdraw any ERC20 balance the hook holds, so user funds routed through the hook are exposed to the owner key.

Security findings

  • [medium] Owner pause control: setPaused(bool) is callable by the owner and paused() is checked in the swap path, so a privileged key can halt swaps for this pool.
  • [high] Owner can withdraw hook-held tokens: withdraw20(address,address) lets the owner move ERC20 tokens held by the hook contract to an arbitrary address.
  • [medium] Return delta moves currency: beforeSwapReturnDelta permission and the take/transfer selectors show the hook can settle currency deltas with the PoolManager, which affects how swap amounts are settled.
  • [info] No upgradeability detected: No proxy or upgrade selectors were found, so the logic appears immutable, but owner-held privileges remain.

Contract details

Verified source
No
Bytecode size
9,310 bytes
Upgradeable proxy
No
Detected patterns
moves-currency, pausable, return-delta

Pools using Likely custom pricing hook