ProtocolFeeHookV2 on Ethereum
Uniswap v4 Hook Contract 0x07355eb152358aee9bbebe92ff8bbd83d3c3c044 on Ethereum · Dynamic fee · Verified contract
- Volume (24h)
- $0
- Value locked (TVL)
- $0
- All-time volume
- $22.76K
- Pools using this hook
- 1
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 152
What it does
Charges an owner-adjustable protocol fee on swaps through pools that use this hook, with separate rate tiers for partner routers and individual pools, and accrues the fee to the owner.
How it works step by step
- Resolves a fee per swap: exempt sender gives zero, else partner tier, else pool override, else default.
- Charges the fee on the unspecified currency of each swap, so exact-input swaps pay on output and exact-output swaps pay on input.
- Takes the fee to the hook through poolManager.take and nets it via afterSwapReturnDelta.
- Accrues fees per currency in feesCollected until the owner calls collectFees.
- Counts all processed swaps in swapCount.
- Allows the owner to batch-onboard integrator fee tiers via setPartnerFees.
- Swap behaviour
- After each swap, the hook computes a fee on the unspecified currency (output for exact-input, input for exact-output), takes that amount to itself via PoolManager, and returns it as a hook delta so it is netted from the swapper's settlement. Swaps from fee-exempt senders or below minSwapForFee pass through unchanged.
- Liquidity behaviour
- No liquidity callbacks.
- Fee behaviour
- Fee is taken in basis points on the unspecified currency of each swap (output for exact-input, input for exact-output). Resolution order: feeExempt sender gives 0; a non-zero partnerFeeBps for the sender overrides; then a non-zero poolFeeBps for the pool; otherwise defaultFeeBps. Swaps whose unspecified amount is below minSwapForFee are fee-free. The fee is taken via poolManager.take to the hook and netted through afterSwapReturnDelta, and is accrued in feesCollected per currency until the owner collects it.
- Owner & admin controls
- Owner (set at construction, transferable via transferOwnership with no timelock or two-step) can set the default fee and per-pool fee overrides up to 100% (10000 bps), set per-sender partner fee tiers up to 100% individually and in batch, set minSwapForFee, add or remove fee-exempt senders, transfer ownership, and call collectFees to withdraw all accrued fee balances of any currency to the owner. No pause, upgrade proxy, or timelock was found.
Enabled Uniswap v4 callbacks
afterSwap, afterSwapReturnDelta
afterSwap: charges the protocol fee on the swap's unspecified currency and records it in feesCollected. afterSwapReturnDelta: lets the hook return a positive delta so the fee is netted from the swapper's settlement inside PoolManager.
Security & trust assessment
Risk level: medium (verified source, high confidence).
Who controls it: A single owner key controls all fee rates for every pool and integrator, can exempt any router from fees, and can withdraw every accrued fee balance at any time. A compromised key could raise fees to 100% on all swaps for pools using this hook or redirect collected fees via ownership transfer.
Risk to user funds: The hook can take a fee from every swap on pools keyed to it, with the rate set by the owner up to 100%. It holds accrued fee balances and the owner can withdraw them, but it cannot block swaps or move LP liquidity, and the fee is only applied to the swap's unspecified currency.
Security findings
- [high] Uncapped owner-controlled fee up to 100%: Owner can set defaultFeeBps, poolFeeBps and partnerFeeBps up to 10000 bps (100%), so swaps on hooked pools can be taxed fully without notice or delay.
- [medium] Single-step ownership transfer: transferOwnership is a single step with no timelock or acceptance by the new owner, so an accidental or malicious transfer immediately hands over fee and withdrawal control.
- [medium] Owner can withdraw all accrued fees: collectFees transfers the full balance of the given currency held by the hook to the owner, which includes all accrued fees across pools.
- [info] Hook takes currency from swaps: The hook takes a share of swap output or input via return deltas, so it directly affects the amounts swappers and LPs settle against the pool.
- [info] Caller restriction and arithmetic checks present: afterSwap restricts callers to the PoolManager and the code uses checked arithmetic for the fee, with no reentrancy-sensitive external calls beyond poolManager.take and the fee-free path.
Contract details
- Verified source
- Yes (ProtocolFeeHookV2)
- Compiler
- solc 0.8.28+commit.7893614a
- Bytecode size
- 8,767 bytes
- Upgradeable proxy
- No
- Detected patterns
- dynamic-fee, moves-currency, ownable, return-delta
Pools using ProtocolFeeHookV2
- USDC / WETH (0.01% fee) — 24h volume $0, TVL $0, 0 swaps today