Likely custom pricing hook on Polygon
Uniswap v4 Hook Contract 0xa00a2d0c40be769e2ae3cf08af6998af304f8ac8 on Polygon · Custom pricing
- Volume (24h)
- $0
- Value locked (TVL)
- $0
- All-time volume
- $0
- Pools using this hook
- 2
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 7
What it does
A custom accounting hook on a Polygon pool that tracks a stored price ratio, gates liquidity changes, and can adjust swap deltas, with owner-controlled pause and token withdrawal.
How it works step by step
- Stores a price numerator and denominator in contract storage (priceNum, priceDen)
- Runs custom logic in beforeSwap and afterSwap, updating stored price state
- Uses return deltas to take or adjust currency during swaps
- Gates or observes add and remove liquidity through the before and after liquidity callbacks
- Supports an owner-controlled pause switch and ERC20 withdrawal
- Swap behaviour
- beforeSwap and afterSwap are implemented; beforeSwapReturnDelta is enabled, so the hook can modify swap deltas and take currency during swaps. It also reads and updates a stored price value.
- Liquidity behaviour
- beforeAddLiquidity and beforeRemoveLiquidity are hooked, and afterAddLiquidity and afterRemoveLiquidity have decoded selectors, so liquidity operations are gated or observed by the hook.
- Fee behaviour
- No explicit fee-setting function found; priceNum and priceDen suggest a price ratio used in swap accounting, and afterSwap appears to update a stored price value. Fee treatment could not be determined from bytecode alone.
- Owner & admin controls
- Owner (storage slot 0) can transfer ownership via setOwner and toggle pause via setPaused; withdraw20 lets the owner move ERC20 tokens out of the hook; owner() and paused() are exposed as views.
Enabled Uniswap v4 callbacks
beforeAddLiquidity, beforeRemoveLiquidity, beforeSwap, afterSwap, beforeSwapReturnDelta
beforeAddLiquidity and beforeRemoveLiquidity gate liquidity changes; beforeSwap and afterSwap run custom logic around swaps; beforeSwapReturnDelta lets the hook alter swap deltas, so it can take or supply currency during a swap.
Security & trust assessment
Risk level: high, estimated (decoded bytecode, medium confidence).
Who controls it: The owner can pause the pool through setPaused, which may block swaps and liquidity actions, can withdraw ERC20 balances held by the hook via withdraw20, and can hand control to another address via setOwner.
Risk to user funds: The hook can take currency from the pool through return deltas and can transfer ERC20 balances it holds via withdraw20, so it can move pool and hook-held funds; it can also pause swaps and liquidity, blocking user access.
Security findings
- [high] Hook can alter swap deltas: beforeSwapReturnDelta is enabled and the bytecode calls take(address,address,uint256), so the hook can take currency from the pool manager and alter swap accounting.
- [high] Owner can withdraw hook token balances: The owner can call withdraw20 to transfer ERC20 tokens held by the hook, which may include user or fee funds if the hook holds balances.
- [medium] Owner can pause the hook: setPaused is an owner-controlled switch that can halt swaps or liquidity actions, depending on which callbacks check the paused flag.
- [medium] Single owner with immediate transfer: Ownership is stored in slot 0 and can be reassigned by setOwner without a timelock or two-step transfer visible in the bytecode.
- [low] Price state updated after swaps: The storage layout suggests a price numerator and denominator are stored and updated in afterSwap, which could be manipulated if the update logic is not guarded.
Contract details
- Verified source
- No
- Bytecode size
- 9,845 bytes
- Upgradeable proxy
- No
- Detected patterns
- moves-currency, pausable, return-delta
Pools using Likely custom pricing hook
- USDT0 / GDC (0.30% fee) — 24h volume $0, TVL $0, 0 swaps today
- USDT0 / REDCOIN (0.30% fee) — 24h volume $0, TVL $0, 0 swaps today