Fee sharing hook on Optimism
Uniswap v4 Hook Contract 0x00e9cbd590629a4a0c0d2645d7b81bbdee980088 on Optimism · Fee sharing
- Volume (24h)
- $0
- Value locked (TVL)
- $0
- All-time volume
- $0
- Pools using this hook
- 1
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 0
What it does
A Uniswap v4 hook that charges an owner-configurable fee on swaps and sends the captured amount to a treasury address, with the owner able to pause swaps.
How it works step by step
- beforeSwap reads the paused flag from slot 2 and reverts or passes through based on it
- beforeSwap reads the swap fee from slot 1 and computes the captured amount
- beforeSwapReturnDelta lets the hook modify the swap delta so the fee is taken from the swap
- The take call on the pool manager sends the captured currency to the treasury address in slot 0
- setSwapFee, setTreasury and setPaused let the owner change fee, recipient and pause state
- Swap behaviour
- beforeSwap reads the pause flag and swap fee, then uses the return delta and the take call to move the fee portion of the swap to the treasury.
- Liquidity behaviour
- beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity and afterRemoveLiquidity selectors are present in the dispatch table but no state writes or currency movements are clearly tied to them from the decoded bytecode. Treated as no meaningful liquidity logic.
- Fee behaviour
- A settable swap fee is stored in slot 1 and read in beforeSwap. The hook takes a cut of swap flow and sends it to a treasury address, using the take call on the pool manager. Exact fee split logic cannot be confirmed without source.
- Owner & admin controls
- Owner can pause and unpause the hook via setPaused(bool), set the swap fee via setSwapFee(uint256) (reverts with FeeTooHigh above a cap), set the treasury address via setTreasury(address), and transfer ownership via transferOwnership(address). The owner is stored in slot 2 with a 20-byte address packed alongside a bool at offset 1 in the same slot.
Enabled Uniswap v4 callbacks
beforeSwap, beforeSwapReturnDelta
beforeSwap is used to read the fee and pause state and to take a fee amount to the treasury. beforeSwapReturnDelta lets the hook adjust the swap delta, which is how it captures the fee from the swap.
Security & trust assessment
Risk level: medium, estimated (decoded bytecode, medium confidence).
Who controls it: The owner can pause all swaps through the hook, change the fee up to the contract cap, redirect the treasury address to any destination so future fees go there, and transfer ownership to any address. A compromised owner key could redirect all captured fees.
Risk to user funds: The hook takes a portion of swap input or output via return delta and sends it to the treasury. It cannot be confirmed from bytecode alone whether a paused hook can block pool liquidity or only swaps routed through it. Users swapping while the hook is paused or with an unfavourable fee are exposed to owner-set parameters.
Security findings
- [medium] Owner pause control: Owner can call setPaused to block swaps routed through this hook while paused.
- [medium] Treasury redirection by owner: setTreasury lets the owner redirect all captured fees to an arbitrary address with no timelock visible in the bytecode.
- [info] Hook moves swap currency: beforeSwapReturnDelta combined with the take call means the hook moves user-side tokens to the treasury on every swap, so fee capture is performed by the hook.
- [low] Single-step ownership transfer: Owner is a single address with transferOwnership and no two-step acceptance pattern is visible in the selectors.
Contract details
- Verified source
- No
- Bytecode size
- 2,778 bytes
- Upgradeable proxy
- No
- Detected patterns
- moves-currency, ownable, pausable, return-delta
Pools using Fee sharing hook
- ttUSDC / ppUSD (0.01% fee) — 24h volume $0, TVL $0, 0 swaps today