QubitorFeeHook on Base
Uniswap v4 Hook Contract 0xc2cba312b9b31424900c067c80ac34aaa07140cc on Base · Fee sharing · Verified contract
- Volume (24h)
- $0
- Value locked (TVL)
- $11.59K
- All-time volume
- $815.61K
- Pools using this hook
- 3
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 11,282
What it does
A swap-fee hook that charges an owner-configurable fee (capped at 25%, decreasable only) on swaps involving the quote currency and sends the fee to a fee collector address.
How it works step by step
- Charges a swap fee denominated in the quote currency, computed as swapFeeBps of the relevant swap amount.
- Takes the fee from the PoolManager and sends it to a configurable feeCollector address.
- Uses beforeSwap for exact-input swaps and afterSwap for exact-output swaps to decide which side is charged.
- Enforces a hard cap of 2500 bps (25%) at construction and when updating the fee.
- Blocks any fee increase after deployment, so the fee can only be lowered over time.
- Emits HookFeeCollected and fee/collector/ownership events for transparency.
- Swap behaviour
- On each swap involving the quote currency, a fee of swapFeeBps is taken in beforeSwap (exact input) or afterSwap (exact output) and transferred to feeCollector via poolManager.take, with return deltas adjusting the trader's amounts.
- Liquidity behaviour
- No liquidity callbacks.
- Fee behaviour
- A swap fee of swapFeeBps (owner-set, max 2500 bps = 25%, can only be decreased after deployment) is charged on the quote currency only. On exact-input swaps the fee is taken from the specified amount via beforeSwap; on exact-output swaps it is taken from the unspecified amount via afterSwap. Collected fees are sent by poolManager.take to feeCollector and emitted as HookFeeCollected.
- Owner & admin controls
- Owner (EOA or whatever address was set at construction, transferable via transferOwnership) can call setSwapFeeBps (can only lower the fee, capped at 2500 bps, cannot raise it), setFeeCollector (redirect where collected fees go to any non-zero address), and transferOwnership. No pause, no upgrade proxy, and no way to disable swaps was found.
Enabled Uniswap v4 callbacks
beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta
beforeSwap: charges the quote-currency fee on the specified side by taking tokens to feeCollector and returning a matching delta. afterSwap: charges the quote-currency fee on the unspecified side when the output is in the quote currency. afterSwapReturnDelta and beforeSwapReturnDelta: allow the hook to alter the caller's net swap amounts by the fee taken.
Security & trust assessment
Risk level: low (verified source, high confidence).
Who controls it: The owner can redirect all future hook fees to any address via setFeeCollector and can set the fee to any value from 0 up to the current level, including 0. The owner cannot raise the fee above its value at deployment time, and cannot pause or block swaps.
Risk to user funds: The hook can take up to the configured fee (max 25%) of the quote-currency amount on each swap, sent to feeCollector. It does not custody user LP funds, cannot block liquidity actions, and cannot pause swaps. Fee changes are constrained on-chain.
Security findings
- [medium] Owner can redirect fee revenue: The owner can change feeCollector to any non-zero address, so every subsequent swap fee is sent wherever the owner chooses.
- [info] Fee increases are disabled: setSwapFeeBps enforces that the fee can never increase after deployment and is capped at 2500 bps, limiting the owner's ability to extract value from traders.
- [info] Fee is taken via return deltas: The hook takes tokens from the PoolManager and returns deltas, which changes the amounts traders receive or pay on swaps that involve the quote currency.
- [low] Single-step ownership transfer: Ownership is a single address with no two-step transfer or timelock; transferring to a wrong or zero-equivalent address is only guarded against zero.
Contract details
- Verified source
- Yes (QubitorFeeHook)
- Compiler
- solc 0.8.26+commit.8a97fa7a
- Bytecode size
- 3,747 bytes
- Upgradeable proxy
- No
- Detected patterns
- dynamic-fee, moves-currency, ownable, return-delta
Pools using QubitorFeeHook
- QBT / WETH (0.00% fee) — 24h volume $0, TVL $11.59K, 0 swaps today
- ETH / QBT (15.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- ETH / QBT (35.00% fee) — 24h volume $0, TVL $0, 0 swaps today