FeeHook on Soneium
Uniswap v4 Hook Contract 0x35bf74f583c88c0daef3bdb6a77d18da6ada00cc on Soneium · Oracle · Verified contract
- Volume (24h)
- $0
- Value locked (TVL)
- $0.11
- All-time volume
- $0.12
- Pools using this hook
- 1
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 2
What it does
Records a tick-cumulative TWAP oracle on every swap and skims a fee from swap amounts into a treasury, so traders pay the hook fee on top of the pool fee.
How it works step by step
- Stores tick-cumulative observations in a 4096-slot ring buffer on each swap
- Exposes observe() so external contracts can read time-weighted average ticks
- Takes a fee (FEE_BPS) from swap amounts via beforeSwap return delta
- Routes the collected fee token to the treasury address
- Leaves liquidity add and remove untouched
- Swap behaviour
- beforeSwap and afterSwap run on every swap: the hook adjusts the swap amount and takes a portion of one currency through return deltas, and afterSwap records a new oracle observation at the current tick.
- Liquidity behaviour
- No liquidity callbacks are enabled; liquidity add and remove are not hooked by permissions.
- Fee behaviour
- Exposes FEE_BPS and a feeToken and treasury; beforeSwap returns a fee-related delta that the hook uses to take a fee in one currency and send it to the treasury, while the pool's static fee applies to LPs.
- Owner & admin controls
- Source is truncated before the FeeHook constructor and state-changing admin functions can be fully reviewed; ABI shows no owner, pause or upgrade functions, so no admin controls found in the visible ABI.
Enabled Uniswap v4 callbacks
beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta
beforeSwap: reads and records the swap for the oracle and sets the specified-currency delta. afterSwap: writes the tick observation to the TWAP buffer and adjusts the unspecified-currency delta. beforeSwapReturnDelta and afterSwapReturnDelta: allow the hook to take a portion of swap amounts as its own return delta.
Security & trust assessment
Risk level: medium (verified source, medium confidence).
Who controls it: Treasury and fee-token addresses are fixed at construction according to the visible ABI; a privileged key is not evident, but the truncated source prevents a full check of any setter.
Risk to user funds: The hook's return deltas can take a share of each swap's tokens and route them to the treasury, so swappers pay the hook fee; it does not hold pool liquidity directly, and no pause that blocks swaps was seen in the visible code.
Security findings
- [medium] Hook takes swap value via return deltas: The hook enables beforeSwapReturnDelta and afterSwapReturnDelta, so it can take part of every swap's input or output and send it to the treasury.
- [low] Oracle observation window can revert: observe() reverts with NoObservations or TargetTooOld for invalid windows, so consumers of the TWAP must handle reverts.
- [low] Short-window TWAP manipulability: Oracle observations are written from swap-time ticks and can be influenced by large swaps within a block, so TWAP inputs are manipulable over short windows.
- [info] Oracle records every swap: The hook is an oracle that records tick cumulatives on every swap; this is a neutral observation about its role.
Contract details
- Verified source
- Yes (FeeHook)
- Compiler
- solc 0.8.34+commit.80d5c536
- Bytecode size
- 7,546 bytes
- Upgradeable proxy
- No
- Detected patterns
- moves-currency, oracle, return-delta
Pools using FeeHook
- CBLT / USDC.e (1.00% fee) — 24h volume $0, TVL $0.11, 0 swaps today