Likely custom pricing hook on Polygon
Uniswap v4 Hook Contract 0xc255d0e1ea36cc03097e5f41996a927cf0550ac8 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
- 6
What it does
A custom-accounting hook on Polygon that intercepts swaps and liquidity changes and can take tokens via return deltas, with owner-controlled pausing and token withdrawal.
How it works step by step
- Hooks beforeSwap and afterSwap to run custom logic around each swap
- Uses beforeSwapReturnDelta to take or give tokens as part of swap accounting
- Gates add and remove liquidity through before and after liquidity callbacks
- Exposes a pause flag that blocks swap execution when set by the owner
- Holds ERC20 balances and allows the owner to withdraw them with withdraw20
- Exposes price-ratio getters priceNum and priceDen that suggest a fixed or admin-set exchange rate
- Swap behaviour
- beforeSwap and afterSwap run custom logic, may take currency via return deltas, and respect a pause flag; afterSwap writes two storage slots.
- Liquidity behaviour
- Liquidity add and remove callbacks (beforeAddLiquidity, beforeRemoveLiquidity, afterAddLiquidity, afterRemoveLiquidity) are exposed, but the decoded bodies show no obvious state writes; they appear to be pass-through or gating hooks.
- Fee behaviour
- No fee logic identified in decoded functions; the pool's fee is used for swaps, but beforeSwap and afterSwap may apply a custom price-based adjustment via return deltas (priceNum/priceDen storage reads suggest a fixed or admin-set price ratio).
- Owner & admin controls
- Owner (storage slot 0) can call setPaused(bool) to pause the hook and withdraw20(address,address) to move ERC20 tokens out of the hook; owner() is readable. No upgrade mechanism detected.
Enabled Uniswap v4 callbacks
beforeAddLiquidity, beforeRemoveLiquidity, beforeSwap, afterSwap, beforeSwapReturnDelta
beforeAddLiquidity and beforeRemoveLiquidity gate liquidity changes; beforeSwap and afterSwap run custom logic around swaps (afterSwap writes storage slots 1 and 2); beforeSwapReturnDelta lets the hook modify swap deltas, so it can take or give tokens during swaps.
Security & trust assessment
Risk level: high, estimated (decoded bytecode, medium confidence).
Who controls it: The owner can pause all swaps via setPaused, and can call withdraw20 to transfer any ERC20 balance held by the hook to an arbitrary address, which can drain tokens the hook holds.
Risk to user funds: The hook can hold and move tokens: it takes currency through return deltas during swaps and the owner can withdraw ERC20 balances via withdraw20 and pause trading via setPaused.
Security findings
- [medium] Owner pause switch: The owner can call setPaused(bool) to halt swap execution, blocking trades while paused.
- [high] Owner can withdraw hook token balances: withdraw20(address,address) lets the owner transfer ERC20 tokens held by the hook contract, which could include user or pool value routed through return deltas.
- [medium] Hook takes tokens via return deltas: beforeSwapReturnDelta is enabled and the bytecode calls take(address,address,uint256) and transfer, so the hook can take tokens during swaps and hold them.
- [info] Swap-driven state updates: Storage slots 1 and 2 are written in afterSwap and read alongside priceNum/priceDen, implying swap-dependent state that the owner's configuration may influence; exact logic cannot be confirmed without source.
Contract details
- Verified source
- No
- Bytecode size
- 9,315 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