Fee sharing hook on BNB Chain

Uniswap v4 Hook Contract 0xc482f6ac196885912eaec0db78aab76fda57c5c7 on BNB Chain · Fee sharing

Volume (24h)
$0
Value locked (TVL)
<$0.01
All-time volume
$8.94M
Pools using this hook
6
Swaps (24h)
0 (0 traders)
Total swaps
3,128

What it does

A fee and revenue-routing hook for Uniswap v4 pools that tiers the LP fee by a per-pool setting, adjusts swap fees with trusted-router and whitelist checks, and splits collected fees between an owner, a creator and a fee recipient.

How it works step by step

  • Stores a fee tier table (tierOneFee, tierTwoFee, tierThreeFee, defaultFee) and selects a fee for each swap, with a gas threshold parameter.
  • Tracks swap counts per pool (swapCount mapping keyed by pool id) to drive fee tiering.
  • Maintains allowlists: a whitelistOnly flag, trusted routers, trusted origins and an exempt address mapping.
  • Takes a share of fees through afterSwap and afterAddLiquidity/afterRemoveLiquidity return deltas and routes it by ownerBps and creatorBps to owner and creator-related addresses, with feeRecipient as the destination.
  • Exposes a withdraw function (selector 0xd9caed12) that moves accrued balances out of the hook.
  • Includes a pause switch (setPaused) and a sweep-style batch configuration for routers and origins.
Swap behaviour
beforeSwap computes a dynamic fee from the tier configuration and whitelist/trusted-router checks; afterSwap updates swap counters and can take a fee share via return delta, sending it toward the owner/creator split.
Liquidity behaviour
afterAddLiquidity and afterRemoveLiquidity return deltas are enabled, so the hook can take a portion of liquidity-related token flows; the mapping at slot 0x0b stores per-id uint16 values used in these paths.
Fee behaviour
Dynamic fee set in beforeSwap from tierOneFee, tierTwoFee, tierThreeFee or defaultFee, selected by swap count and whitelist status; a portion of fees is retained and split by ownerBps and creatorBps (defaults include DEFAULT_CREATOR_BPS).
Owner & admin controls
Owner (transferOwnership, slot 0) can set fee tiers, owner/creator bps, the fee recipient, trusted routers and origins, whitelist mode, exempt address, gas threshold and pause state; owner can call withdraw. The bytecode also indicates an owner-only path that sets ownerBps and creatorBps via uint16 parameters. No proxy or upgrade selector was found.

Enabled Uniswap v4 callbacks

afterAddLiquidity, afterRemoveLiquidity, beforeSwap, afterSwap, afterSwapReturnDelta, afterAddLiquidityReturnDelta, afterRemoveLiquidityReturnDelta

beforeSwap: sets the dynamic LP fee per swap. afterSwap: updates counters and can take a fee share via return delta. afterAddLiquidity and afterRemoveLiquidity (with return deltas): can take a share of liquidity flows and account for them. afterSwapReturnDelta and the liquidity return delta permissions let the hook take tokens from the pool's flows.

Security & trust assessment

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

Who controls it: A single owner key controls fee tiers, the fee split, the fee recipient, routing allowlists, the pause state and fund withdrawal from the hook, so a compromised or malicious owner could divert accrued fees and change pool fees for trading against the pool.

Risk to user funds: The hook holds accrued fee balances and takes tokens through return deltas on swaps and liquidity events; the owner can withdraw those balances and can pause swaps, so user trades and LP positions can be blocked and fees redirected, though the LP principal itself is held by the pool manager rather than the hook.

Security findings

  • [medium] Owner can withdraw accrued funds: The withdraw(address,address,uint256) function (0xd9caed12) writes to a storage slot used as a balance accumulator, so the owner can move fee balances held by the hook to any address.
  • [medium] Owner can change fee split and fee rates: setOwnerBps, setCreatorBps, setFeeRecipient and the tier setters can redirect the share of fees taken from swaps and liquidity flows, including setting them to a large share or to an address the owner controls.
  • [low] Pause can block swaps: setPaused writes a pause flag that is read in the swap path (0x575e24b4), so an owner pause can cause swaps through this hook to revert.
  • [low] Return-delta fee capture on liquidity flows: The hook has liquidity return-delta permissions, so it can take tokens out of LP add and remove flows rather than only swap flows; the exact take logic is not verifiable without source.
  • [info] Ownable without timelock: Ownership transfers in a single step (transferOwnership) and no timelock or multisig requirement is visible in the decoded functions.

Contract details

Verified source
No
Bytecode size
23,686 bytes
Upgradeable proxy
No
Detected patterns
erc20, moves-currency, ownable, pausable, return-delta

Pools using Fee sharing hook