Dynamic fee hook on BNB Chain
Uniswap v4 Hook Contract 0x8e19bfb22b69c3badef757c29c0d4a31792ac5c7 on BNB Chain · Dynamic fee
- Volume (24h)
- $0
- Value locked (TVL)
- <$0.01
- All-time volume
- $5.34K
- Pools using this hook
- 2
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 48
What it does
A Uniswap v4 hook on BSC that applies owner-configured dynamic fees with tiered and per-address settings, optionally takes a share of swap and liquidity flows, and includes owner pause, whitelist and withdrawal controls.
How it works step by step
- Sets dynamic fees per pool and per address using tiered fee configuration and a default fee
- Splits collected fees between owner, creator and a secondary recipient using ownerBps and creatorBps
- Gates swaps and liquidity through pause, pool-enabled flags, whitelist mode and trusted router or origin lists
- Tracks swap counts and pool state per pool ID
- Takes a share of swap and liquidity deltas through return-delta permissions
- Allows the owner to withdraw tokens held by the hook
- Swap behaviour
- beforeSwap and afterSwap run on every swap; the hook applies pool-specific or address-specific fee logic, records swap counts, and may capture part of the swap via return delta.
- Liquidity behaviour
- Has afterAddLiquidity, afterRemoveLiquidity and their return-delta variants enabled, so it can alter the liquidity deltas returned to the pool manager and may take or give currency during liquidity changes. Specific logic could not be confirmed.
- Fee behaviour
- The hook appears to set dynamic fees per pool and per address, with tiered fee configuration (TIER_ONE, TIER_TWO, TIER_THREE, TIER_QUOTE), a default fee, a MAX_TOTAL_FEE cap, and a split of collected fees between owner, creator and a secondary recipient (ownerBps, creatorBps, feeRecipient). Exact fee formulas could not be determined without source.
- Owner & admin controls
- Owner-gated functions (owner() selector 0x8da5cb5b present, NotOwner error 0x30cd7471 in bytecode) can pause via setPaused(bool), toggle pool enablement via setPoolEnabled, set trusted routers and origins, set exempt and secondary recipient addresses, set per-address fees via 0x952e60c2, toggle whitelistOnly, withdraw tokens via withdraw/withdrawAll, and change fee-related config (defaultFee, ownerBps, creatorBps, tier values). Ownership transfer and upgrade mechanisms were not confirmed from selectors alone.
Enabled Uniswap v4 callbacks
afterAddLiquidity, afterRemoveLiquidity, beforeSwap, afterSwap, afterSwapReturnDelta, afterAddLiquidityReturnDelta, afterRemoveLiquidityReturnDelta
afterAddLiquidity and afterRemoveLiquidity observe liquidity changes; the *ReturnDelta variants let the hook adjust the balance deltas, which is how it can take a cut of liquidity flows; beforeSwap sets up per-swap logic such as fee or access checks; afterSwap records swap state and can apply return-delta fee capture; the swap return delta permission lets the hook take a share of swap output.
Security & trust assessment
Risk level: high, estimated (decoded bytecode, low confidence).
Who controls it: A single owner key controls pausing, pool enablement, trusted router and origin allowlists, whitelist mode, per-address fees, fee recipients and withdrawal of tokens held by the hook. A compromised or malicious owner could redirect fees, block swaps and liquidity actions, or drain balances the hook accumulates.
Risk to user funds: The hook can take a share of swap and liquidity deltas through return-delta permissions and can hold tokens that the owner may withdraw. It can also pause or restrict trading. Funds exposure is therefore significant and depends on owner honesty and key security.
Security findings
- [high] Owner withdrawal of hook-held tokens: Owner can call withdraw and withdrawAll on arbitrary token addresses, so any tokens held by the hook are controlled by the owner.
- [medium] Return-delta fee capture: The hook uses return-delta permissions on swaps and liquidity, so it can take currency from pool flows; the take fraction is governed by owner-set parameters.
- [medium] Pausable and whitelist gating: setPaused and whitelistOnly can halt or restrict swaps and liquidity, so the owner can block users from trading.
- [medium] Owner-adjustable fees and router trust: Owner can change fee parameters and per-address fees, including the trusted router set, which may allow fee bypass or extraction.
- [info] Packed configuration storage: Storage layout suggests fee and split parameters are stored in packed slots; no upgrade pattern was confirmed.
Contract details
- Verified source
- No
- Bytecode size
- 12,289 bytes
- Upgradeable proxy
- No
- Detected patterns
- moves-currency, pausable, return-delta
Pools using Dynamic fee hook
- USDC / 4Stock (0.00% fee) — 24h volume $0, TVL <$0.01, 0 swaps today
- USDC / 4Stock (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today