Dynamic fee hook on BNB Chain
Uniswap v4 Hook Contract 0x76e512bd824b4255889bc4171f205575719329cc on BNB Chain · Dynamic fee
- Volume (24h)
- <$0.01
- Value locked (TVL)
- $0
- All-time volume
- <$0.01
- Pools using this hook
- 1
- Swaps (24h)
- 1 (1 traders)
- Total swaps
- 1
What it does
This is an upgradeable dynamic-fee hook where the owner sets swap fees for all traders and each pool stops accepting swaps after a maximum swap count, which puts significant trust in the owner.
How it works step by step
- Requires pools to use dynamic fees and stores a per-pool swap fee when the pool is created.
- Lets the owner set a global dynamic fee, per-pool swap fees, a gas limit and an external address, with fees validated by an unknown cap check.
- Counts swaps per pool and rejects swaps once a maximum swap count is reached.
- Runs checks when liquidity is added (owner-related logic) and when liquidity is removed.
- Sits behind an upgradeable proxy, so the owner or upgrader can replace the logic at any time.
- Swap behaviour
- Before each swap the hook checks the pool's swap counter against a maximum and reverts with a swap-limit error once it is reached. It applies the owner-set dynamic fee, and swap return deltas are enabled, so it could adjust swap amounts, though the exact behaviour cannot be confirmed from bytecode.
- Liquidity behaviour
- The hook runs on adding liquidity, which reads the owner and may restrict who can add. It also runs after removing liquidity, so through the upgradeable proxy it could in principle block or alter withdrawals.
- Fee behaviour
- The swap fee is a dynamic fee set by the owner, either globally or per pool, and checked by an invalid-fee guard whose exact cap is unknown from bytecode. Fees go to LPs through the pool's normal fee mechanism unless return deltas take extra amounts.
- Owner & admin controls
- The owner can set the dynamic fee, per-pool swap fees, the gas limit, an external address and per-address values, and can reset swap counters. Because the hook is an upgradeable proxy, the logic can be replaced entirely.
Enabled Uniswap v4 callbacks
beforeInitialize, beforeAddLiquidity, afterRemoveLiquidity, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta
beforeInitialize: requires a dynamic-fee pool and records its fee; beforeAddLiquidity: gates or checks liquidity additions; afterRemoveLiquidity: runs on withdrawals; beforeSwap: enforces the swap limit and sets the fee; afterSwap: updates swap tracking; beforeSwapReturnDelta/afterSwapReturnDelta: allow changing swap amounts.
Security & trust assessment
Risk level: high, estimated (decoded bytecode, low confidence).
Who controls it: A single owner controls fees, swap limits and other settings, and the proxy admin can swap out the whole contract. In the worst case they could halt swaps, raise fees or block withdrawals through an upgrade.
Risk to user funds: Swap amounts can be altered through return deltas, and fee bounds are unverified. LP withdrawals currently run through a hook callback that an upgrade could make revert.
Security findings
- [high] Upgradeable proxy: Every call is delegated to a replaceable implementation, so the swap, fee and withdrawal logic can be changed without notice.
- [medium] Swap cap can halt trading: Swaps revert once a per-pool swap count reaches a maximum, and only the owner appears able to reset it.
- [medium] Owner-set fees with unverified cap: The owner sets dynamic and per-pool fees. An invalid-fee check exists, but its limit cannot be confirmed from bytecode.
- [medium] Withdrawal callback enabled: afterRemoveLiquidity runs on every withdrawal, so an upgrade could make it revert and trap LP funds.
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
- USDT / 牛来 (Dynamic fee) — 24h volume <$0.01, TVL $0, 1 swaps today