Likely custom pricing hook on Ethereum

Uniswap v4 Hook Contract 0xc5142fac0a46b53bfa348770952ac98d6f1fc888 on Ethereum · Custom pricing

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

What it does

A custom-accounting hook that applies owner-configured pricing with an oracle-based bonus to swaps and gates liquidity additions, with a pause switch and owner withdrawal functions.

How it works step by step

  • Runs custom logic before each swap via beforeSwap and can return a delta to adjust the swap settlement
  • Uses per-token price feed addresses (priceFeeds mapping) and reads latestRoundData from the oracle
  • Applies an owner-configurable bonusPercent to swap outcomes
  • Checks liquidity additions via beforeAddLiquidity
  • Holds and manages tokens and ETH, with owner withdrawal functions
  • Supports pausing and unpausing of swaps by the owner
Swap behaviour
beforeSwap and afterSwap run custom logic, may apply a bonus percentage and oracle-based pricing, and can take or give currency via return delta; swaps can be paused by the owner.
Liquidity behaviour
beforeAddLiquidity is enabled and modifyLiquidity is dispatched; the hook appears to interact with pool liquidity through the PoolManager (unlock/modifyLiquidity/settle/take selectors present), with exact logic not determinable.
Fee behaviour
Not determinable from decoded bytecode; the hook returns a before-swap delta and uses a bonusPercent parameter and Chainlink-style price feeds (latestRoundData), suggesting a custom pricing or bonus mechanism rather than a plain pool fee.
Owner & admin controls
Owner (Ownable, slot 0) can pause and unpause swaps (pauseSwaps/unpauseSwaps), transfer ownership, set bonusPercent, set price feeds per token via setPriceFeed, and withdraw native ETH and arbitrary tokens via withdrawNative/withdrawToken.

Enabled Uniswap v4 callbacks

beforeAddLiquidity, beforeSwap, beforeSwapReturnDelta

beforeAddLiquidity: runs a check or hook logic before liquidity is added. beforeSwap: runs custom logic before each swap and can alter swap amounts. beforeSwapReturnDelta: lets the hook take or give currency deltas during swaps, which can move pool funds.

Security & trust assessment

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

Who controls it: The owner can pause swaps, set the bonus percentage, replace price feed addresses per token, and withdraw native ETH and any token held by the contract. A malicious or compromised owner could redirect hook-held funds or manipulate pricing used in swaps.

Risk to user funds: The hook can hold tokens and native ETH and can settle deltas with the PoolManager during swaps, and the owner can withdraw these balances or pause trading, so user funds routed through the hook are exposed to owner action.

Security findings

  • [high] Owner can withdraw hook balances: withdrawToken and withdrawNative let the owner remove any balance the hook holds, including funds accumulated through return deltas.
  • [medium] Owner controls swap pricing inputs: setPriceFeed lets the owner change the oracle used for pricing, and bonusPercent can be changed, so the owner can alter swap economics after users commit.
  • [medium] Owner can pause swaps: pauseSwaps gates swap execution through a paused flag in storage slot 0, so the owner can halt trading.
  • [medium] Return delta can alter swap settlement: beforeSwapReturnDelta is enabled, so the hook can take or give currency during swaps, changing amounts users receive relative to the pool.

Contract details

Verified source
No
Bytecode size
14,792 bytes
Upgradeable proxy
No
Detected patterns
erc6909-claims, moves-currency, ownable, pausable, return-delta, self-unlock

Pools using Likely custom pricing hook