Dynamic fee hook on Base
Uniswap v4 Hook Contract 0x216317cb06e08d8f1429852d158b2fc904a85080 on Base · Dynamic fee
- Volume (24h)
- $1.51K
- Value locked (TVL)
- $513
- All-time volume
- $171.32K
- Pools using this hook
- 2
- Swaps (24h)
- 31 (13 traders)
- Total swaps
- 2,301
What it does
A Uniswap v4 hook that sets a default fee on pool initialization and applies whitelist-based checks before swaps, controlled by an owner address.
How it works step by step
- On pool initialization (afterInitialize), the hook applies its stored default fee to the new pool.
- Before each swap (beforeSwap), it reads a whitelist mapping to decide swap-specific handling.
- The owner can change the default fee used for future initializations via setDefaultFee.
- The owner can add or remove addresses from the whitelist via setWhitelisted.
- Ownership can be reassigned by the current owner via setOwner.
- Swap behaviour
- beforeSwap reads a whitelist mapping and is a view function in the dispatch table, so it inspects state rather than moving tokens; exact fee adjustments on swaps could not be fully determined from decoded bytecode.
- Liquidity behaviour
- No liquidity callbacks.
- Fee behaviour
- A default fee stored in slot 2 is written to pools at initialization (afterInitialize) and can be changed by the owner through setDefaultFee. The beforeSwap path reads a whitelist mapping (slot 1), which suggests whitelisted callers or pools may receive different fee handling, but the exact fee logic could not be fully determined without source.
- Owner & admin controls
- Owner (storage slot 0) can transfer ownership via setOwner, set the default fee via setDefaultFee, and add or remove addresses from a whitelist via setWhitelisted. No pause or upgrade functions were found.
Enabled Uniswap v4 callbacks
afterInitialize, beforeSwap
afterInitialize: sets up the pool's fee settings when it is initialized. beforeSwap: runs before each swap and checks the whitelist mapping to decide swap-specific behaviour.
Security & trust assessment
Risk level: medium (decoded bytecode, medium confidence).
Who controls it: The owner can change the default fee for future pools and can whitelist or unwhitelist addresses, which may change swap behaviour for those addresses. The owner can also transfer ownership to any address.
Risk to user funds: The hook appears not to hold or move tokens directly based on the dispatched functions, but its fee setting and whitelist can change swap costs for users. The exact impact depends on logic that could not be fully decoded.
Security findings
- [medium] Owner-controlled default fee: The owner can call setDefaultFee with any uint24 value, which may include very high fee settings that make swaps expensive for users in pools using this default.
- [medium] Owner-controlled whitelist affects swaps: Whitelist state is read in beforeSwap, so the owner can change which addresses receive different treatment during swaps.
- [low] Single-key ownership transfer: Ownership is a single address with a setOwner function and no two-step transfer or timelock was identified in the dispatch table.
- [info] No custody of user funds observed: Bytecode suggests the hook does not take custody of tokens or return deltas; no token transfer selectors were identified in the dispatch table.
Contract details
- Verified source
- No
- Bytecode size
- 2,721 bytes
- Upgradeable proxy
- No
Pools using Dynamic fee hook
- REI / USDC (Dynamic fee) — 24h volume $1.51K, TVL $513, 31 swaps today
- ETH / REI (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today