Fee sharing hook on Polygon

Uniswap v4 Hook Contract 0xf6cd9ffaffbb8b690d06beabc145a3ea3c0f0088 on Polygon · Fee sharing

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

What it does

A Uniswap v4 hook that charges an owner-configurable dynamic LP fee and takes a share of swap volume for the hook owner on pool swaps.

How it works step by step

  • Sets a dynamic LP fee for the pool via poolFee, updatable by the owner through setPoolFee.
  • Takes a hook fee share defined in basis points (hookFeeBps), updatable through setHookFeeBps.
  • Applies fee logic in beforeSwap using the beforeSwapReturnDelta permission, so the hook can take currency on swaps.
  • Allows the owner to withdraw accumulated tokens from the hook via withdrawToken.
  • Exposes a tokenBalance view and uses balanceOf, sync, settle and take calls to interact with the pool manager for accounting.
Swap behaviour
beforeSwap is nonpayable and uses the return delta permission to apply the dynamic fee and capture a hook fee share on swaps; afterSwap is also dispatched but its effect is not separately confirmed.
Liquidity behaviour
Liquidity add and remove callbacks (beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity, afterRemoveLiquidity) and donate callbacks are present as dispatched selectors but appear to be pass-through; no clear state mutation was identified for them.
Fee behaviour
The hook sets a dynamic LP fee through poolFee (adjustable by owner via setPoolFee) and takes a hook fee share defined in basis points (hookFeeBps, adjustable via setHookFeeBps, BPS constant present). Fee values are stored in slot 0 alongside hookFeeBps; the beforeSwap path appears to compute and apply the fee.
Owner & admin controls
Owner (selector owner()) can call setPoolFee to change the pool's dynamic LP fee and setHookFeeBps to change the hook's fee share in basis points; withdrawToken lets the owner withdraw tokens held by the hook. Storage slot 0 packs hookFeeBps and poolFee and is written by the owner setters, so these parameters are owner-adjustable at any time. Access control details could not be confirmed without source.

Enabled Uniswap v4 callbacks

beforeSwap, beforeSwapReturnDelta

beforeSwap: adjusts the swap by applying the dynamic fee and taking a hook fee share. beforeSwapReturnDelta: the hook can return a delta that alters the swap amounts, which allows it to take a portion of the swap in its own accounting. The other callbacks listed in the dispatch table are not enabled by the permission bits.

Security & trust assessment

Risk level: medium, estimated (decoded bytecode, medium confidence).

Who controls it: The owner key can set the LP fee and hook fee share at will, and can withdraw tokens held by the hook via withdrawToken. A malicious or compromised owner could raise fees sharply to extract value from swappers or drain hook-held balances.

Risk to user funds: The hook can take a share of swap amounts through return deltas and hold those tokens until withdrawn by the owner via withdrawToken. Users' swap outcomes depend on owner-set fee parameters. Pool liquidity itself is not directly moved by the hook based on the decoded functions.

Security findings

  • [medium] Owner-adjustable fees without confirmed caps: The dispatch table includes setPoolFee and setHookFeeBps, which write fee parameters in storage slot 0 with no visible bounds in the bytecode decoding; the owner could set extreme values.
  • [medium] Owner can withdraw hook-held tokens: withdrawToken is callable by the owner and moves ERC20 balances the hook holds, which can include fees collected via return deltas.
  • [info] Return delta takes currency on swaps: The beforeSwapReturnDelta permission means the hook can take currency from swaps, adding a dependency on owner-set parameters for user outcomes.

Contract details

Verified source
No
Bytecode size
7,563 bytes
Upgradeable proxy
No
Detected patterns
dynamic-fee, moves-currency, return-delta

Pools using Fee sharing hook