Dynamic fee hook on BNB Chain
Uniswap v4 Hook Contract 0x0dacf3211cbbaf3e89c834eb1ebecf1d01b98880 on BNB Chain · Dynamic fee
- Volume (24h)
- $0
- Value locked (TVL)
- <$0.01
- All-time volume
- $9.93M
- Pools using this hook
- 1
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 20,834
What it does
A dynamic-fee hook that charges swap fees based on how many swaps a pool has seen, with owner-configurable tiers, and gates which addresses may add liquidity.
How it works step by step
- Counts swaps per pool in a mapping keyed by pool id
- Selects a swap fee from a default or one of three tier fees based on swap count
- Applies per-address fee overrides set by the owner
- Gates liquidity additions through an address-keyed boolean mapping in beforeAddLiquidity
- Lets the owner pause the hook and adjust fee parameters
- Swap behaviour
- beforeSwap increments a per-pool swap counter, selects a fee from the default or one of three tier fees based on that count and any per-address override, and returns it as an override fee for the swap.
- Liquidity behaviour
- beforeAddLiquidity is implemented and checks an address-keyed boolean mapping (likely an allowlist or blocklist) before permitting liquidity additions. No liquidity removal callbacks are enabled.
- Fee behaviour
- Fees are set dynamically in beforeSwap: a default fee plus tiered fees (tierOne, tierTwo, tierThree) selected by a per-pool counter stored in a mapping keyed by pool id (swapCount), with tier thresholds and per-address overrides configured by the owner. The hook returns an override fee flagged with OVERRIDE_FEE_FLAG and is bounded by MAX_LP_FEE and BPS_DENOMINATOR.
- Owner & admin controls
- Owner (slot 0) can pause and unpause via setPaused, set the default fee via setDefaultFee, reconfigure the fee tiers and thresholds via the 7-parameter setter (0x65a08c0e), set per-address fee overrides via 0xc94e2375, grant or revoke a flag per address via 0x6e0db89c, and transfer ownership via transferOwnership. Ownership is a single address with no timelock visible in the decoded functions.
Enabled Uniswap v4 callbacks
beforeAddLiquidity, beforeSwap
beforeSwap: adjusts swap fees per call based on swap count tiers and overrides. beforeAddLiquidity: gates liquidity additions using an address-based flag mapping.
Security & trust assessment
Risk level: medium (decoded bytecode, medium confidence).
Who controls it: The owner can pause swaps and liquidity additions, change every fee tier and the default fee up to the protocol maximum, grant or revoke per-address access, and transfer ownership. A compromised owner key could raise fees to the maximum on all pools or block trading.
Risk to user funds: The hook does not appear to custody tokens or take return deltas, so it cannot directly seize pool funds. User exposure comes from the owner's ability to pause swaps, set high fees, and block liquidity additions, which can trap positions in terms of execution and cost rather than outright loss.
Security findings
- [medium] Owner can pause the hook: setPaused and the fee setters are callable by the owner only; a pause would block swaps through beforeSwap, which is gated by the paused flag read in the swap path.
- [medium] Owner-controlled fee levels: The fee configuration function writes the default and tier fee slots without an evident upper bound beyond the protocol max fee; the owner can set fees high enough to make swaps uneconomic for traders.
- [low] Address-based liquidity gating: beforeAddLiquidity reads an address-keyed boolean mapping, and the owner can write it, so the owner can block specific addresses from adding liquidity.
- [info] Single-key ownership: Owner is a single address stored in slot 0 with transferOwnership and no evident two-step transfer or timelock.
Contract details
- Verified source
- No
- Bytecode size
- 7,204 bytes
- Upgradeable proxy
- No
- Detected patterns
- ownable, pausable
Pools using Dynamic fee hook
- BNB / USDT (Dynamic fee) — 24h volume $0, TVL <$0.01, 0 swaps today