Dynamic fee hook on BNB Chain
Uniswap v4 Hook Contract 0xca1ad0a376eac065ecf3195810514505ede205c7 on BNB Chain · Dynamic fee
- Volume (24h)
- $0
- Value locked (TVL)
- $5.33
- All-time volume
- $19.92M
- Pools using this hook
- 30
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 11,486
What it does
A Uniswap v4 hook that appears to apply owner-configurable dynamic swap fees with tiers, floors, overrides and whitelist or pause controls, and that takes part in swap and liquidity settlement via return deltas.
How it works step by step
- beforeSwap computes a dynamic fee from tier, floor, default and bot fee settings, with per-pool and per-address overrides
- afterSwap tracks swap counts per pool and can take or give tokens via a return delta
- afterAddLiquidity and afterRemoveLiquidity run post-liquidity logic and can return balance deltas
- Owner can pause the hook or restrict swaps to a whitelist
- Trusted routers and exempt addresses are managed by the owner
- Owner can withdraw tokens held by the hook
- Swap behaviour
- beforeSwap sets a dynamic fee and checks pause, whitelist and router trust; afterSwap updates per-pool swap counts and may return a delta.
- Liquidity behaviour
- afterAddLiquidity, afterRemoveLiquidity and their return-delta variants are enabled, and beforeAddLiquidity/beforeRemoveLiquidity selectors exist. The hook can return balance deltas after liquidity changes, so it may charge or credit tokens to LPs; the precise amounts are not determinable from the bytecode alone.
- Fee behaviour
- Fees appear to be set dynamically in beforeSwap (selector 0x575e24b4) from a stored fee configuration with tiers (tierOne, tierTwo, tierThree), a floor fee, a default fee, a bot fee and per-pool or per-address fee overrides (poolFeeOverride, feeOverride, exemptAddress). Fee values are capped by FEE_CAP; the exact tier triggering logic could not be confirmed without source. Swap counts per pool (swapCount) suggest a fee that varies with activity.
- Owner & admin controls
- Owner (slot 0) is two-step transferable via transferOwnership/acceptOwnership and can call setPaused, setWhitelistOnly, setFeeOverride, setTrustedRouter, setExemptAddress, withdraw, and set fee tiers (tierOne/Two/Three, floorFee, defaultFee, botFee parameters via setters 0x2d398609, 0xf62ab668, 0xb7547be1, 0xa3f45c64, 0x5d2988eb, 0xb6852851), plus a bot/exempt-address and a fee-override list via 0x292b0179 and 0xefc19b20. renounceOwnership is present. Owner may also be able to toggle an authorised-caller flag (0xa8f4d212) and an additional admin-level bool via 0x72359bd3, 0xd8af1208, 0x81ba111c, 0xf1e6cd24.
Enabled Uniswap v4 callbacks
afterAddLiquidity, afterRemoveLiquidity, beforeSwap, afterSwap, afterSwapReturnDelta, afterAddLiquidityReturnDelta, afterRemoveLiquidityReturnDelta
afterAddLiquidity and afterRemoveLiquidity: post-liquidity-change logic, likely accounting or fee handling. afterAddLiquidityReturnDelta and afterRemoveLiquidityReturnDelta: the hook can take or give tokens as a delta on liquidity changes. beforeSwap: sets the dynamic swap fee and checks whitelist, router trust and pause status. afterSwap: updates swap counters and may apply a return delta. afterSwapReturnDelta: the hook can take or give tokens on swaps. Pausable and whitelist-gated logic are also present.
Security & trust assessment
Risk level: high (decoded bytecode, low confidence).
Who controls it: The owner can pause the hook, enable whitelist-only mode, change fee tiers, floor and bot fees, add per-pool or per-address fee overrides, set trusted routers, withdraw tokens via withdraw(address,address,uint256), and transfer ownership. A malicious or compromised owner could raise fees to extreme levels, block swaps via pause or whitelist, or drain tokens held by the hook.
Risk to user funds: The hook holds and moves tokens through take and withdraw paths and returns deltas on swaps and liquidity changes, so it can hold or redirect funds. The owner can withdraw hook-held balances and can pause or whitelist-gate swaps, which can block user access.
Security findings
- [high] Owner token withdrawal capability: withdraw(address,address,uint256) is callable by the owner and the hook uses take(address,address,uint256) with return deltas, so the hook holds or moves tokens. A privileged key can extract those balances.
- [medium] Owner-adjustable swap fees: Fee tiers, floor, default and bot fees and per-pool overrides are owner-set, with a FEE_CAP limit. If the cap is high or setters lack bounds, the owner can impose very high swap fees on users.
- [medium] Swap blocking via pause and whitelist: setPaused and setWhitelistOnly can block swaps for non-whitelisted or all users, and the owner can change trusted routers and exempt addresses.
- [medium] Return-delta hooks alter settlement: Several return-delta permissions are enabled, so the hook participates in settlement of swaps and liquidity changes. Bugs in delta accounting could misallocate funds.
- [info] Unverified source: Source is unverified and analysis relies on selectors and storage layout, so exact behaviour of fee calculation and delta logic cannot be confirmed.
Contract details
- Verified source
- No
- Bytecode size
- 22,080 bytes
- Upgradeable proxy
- No
- Detected patterns
- moves-currency, ownable, pausable, return-delta
Pools using Dynamic fee hook
- QQQB / USDC (0.00% fee) — 24h volume $0, TVL <$0.01, 0 swaps today
- BNC4 / USDC (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today
- BNC4 / USDC (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- USDT / BNC4 (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today
- BNC4 / USDC (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- BNC4 / USDC (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- QQQB / USDC (Dynamic fee) — 24h volume $0, TVL <$0.01, 0 swaps today
- USDT / BNC4 (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today
- BNC4 / USDC (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- BABAB / USDC (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- BNC4 / USDC (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today
- BNC4 / USDC (0.00% fee) — 24h volume $0, TVL <$0.01, 0 swaps today
- BNC4 / USDC (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- BNC4 / USDC (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today
- BNC4 / USDC (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today
- QQQB / USDC (0.00% fee) — 24h volume $0, TVL <$0.01, 0 swaps today
- BNC4 / USDC (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today
- QQQB / USDT (88.00% fee) — 24h volume $0, TVL $5.33, 0 swaps today
- QQQB / USDC (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- QQQB / USDC (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today