Dynamic fee hook on BNB Chain

Uniswap v4 Hook Contract 0xcac90a5842d207329d207177384fb278dbffa9cc on BNB Chain · Dynamic fee

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

What it does

An owner-controlled, upgradeable dynamic-fee hook that sets pool swap fees and can cap the number of swaps; every trade pays the owner-set fee, and the owner's upgrade power over swap deltas and withdrawals means traders and LPs must fully trust them.

How it works step by step

  • Sets a per-pool swap fee when a pool is created and lets the owner change it, plus a global dynamic fee value used during swaps.
  • Counts swaps per pool and can reject swaps once a maximum swap limit is reached.
  • Has owner-only setters for fees, a gas limit, a 'mid' address and a per-address value whose purpose is unclear from bytecode.
  • Runs on liquidity adds and on liquidity removals, and has swap return-delta rights that could change swap amounts.
  • Runs behind an upgradeable proxy, so the owner can replace the logic at any time.
Swap behaviour
Before each swap the hook reads the pool's swap counter and the dynamic fee, and may revert with a swap-limit error once the pool hits its maximum swap count. Because swap return deltas are enabled on the address, the current or a future implementation could take tokens from swap input or output, though no explicit fee-taking delta could be confirmed from bytecode.
Liquidity behaviour
The hook runs when liquidity is added (with an owner check visible in that path) and after liquidity is removed. Since afterRemoveLiquidity is enabled and the contract is upgradeable, a future implementation could make withdrawals revert and trap LP funds.
Fee behaviour
Uses a dynamic LP fee set by the owner, both per pool and globally, with an invalid-fee check whose exact cap cannot be read from bytecode. Fees go to LPs through the normal pool fee unless the logic is changed to use swap return deltas.
Owner & admin controls
The owner can set per-pool and global swap fees (cap unknown), the gas limit, a 'mid' address, per-address values and swap counters, and can upgrade the implementation. The exact fee limits cannot be confirmed from bytecode.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeAddLiquidity, afterRemoveLiquidity, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeInitialize: requires a dynamic-fee pool and stores its fee; beforeAddLiquidity: gates or checks liquidity additions; afterRemoveLiquidity: runs on every withdrawal; beforeSwap: enforces swap limits and sets the fee; afterSwap: post-swap bookkeeping; beforeSwapReturnDelta/afterSwapReturnDelta: lets the hook change swap amounts.

Security & trust assessment

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

Who controls it: A single owner controls fees, swap limits, liquidity gating and proxy upgrades. In the worst case they can halt swaps, take swap tokens via an upgrade, or block LP withdrawals.

Risk to user funds: Trader swap amounts are exposed through enabled return deltas, with no verifiable fee cap. LP principal is not held by the hook but could be trapped if an upgrade makes the remove-liquidity callback revert.

Security findings

  • [high] Upgradeable proxy with swap delta rights: The owner can swap in new logic that uses the enabled swap return deltas to take tokens from traders' swaps.
  • [high] Withdrawal callback can be weaponized: afterRemoveLiquidity is enabled, so an upgraded implementation could revert withdrawals and lock LP principal.
  • [medium] Owner-controlled swap limit and gating: The owner can set swap counters so swaps hit the limit and revert, and liquidity additions appear to be owner-checked.
  • [medium] Fee cap unverified: An invalid-fee check exists, but its maximum cannot be confirmed from bytecode.

Contract details

Verified source
No
Bytecode size
1,112 bytes
Upgradeable proxy
Yes
Detected patterns
dynamic-fee, ownable, return-delta, upgradeable

Pools using Dynamic fee hook