Fee sharing hook on Base
Uniswap v4 Hook Contract 0x0c3a0d969315a155eaf25ac329585dad1a7da0cc on Base · Fee sharing
- Volume (24h)
- $29.60K
- Value locked (TVL)
- $0
- All-time volume
- $29.60K
- Pools using this hook
- 1
- Swaps (24h)
- 144 (76 traders)
- Total swaps
- 144
What it does
This hook charges a dynamic buy or sell fee on swaps in the pool, with buyBps and sellBps capped by FEE_CAP_BPS, and forwards the collected fees to a fee receiver while blocking trading and blacklisted addresses when the owner chooses.
How it works step by step
- Charges a buy fee (buyBps) and a sell fee (sellBps) on swaps involving the pool, with the fee capped by FEE_CAP_BPS
- Takes the fee through afterSwap return deltas and accumulates the amount in parkedFees before forwarding it to feeReceiver
- Gates trading with a tradingEnabled flag and a blacklist of addresses checked in beforeSwap
- Restricts pool initialization through beforeInitialize and rejects liquidity operations that are not authorized
- Exposes operator-level setters for fee receiver, fee rates and trading state, plus emergency withdrawal functions for ETH, ERC20 and ERC721 tokens
- Has staking, lpManager, router and posm references, suggesting fee distribution to stakers or LPs
- Swap behaviour
- beforeSwap reverts when trading is not enabled or the sender is blacklisted, otherwise it passes through. afterSwap computes a fee on the swap output using buyBps or sellBps depending on direction, takes that amount as an afterSwap return delta, and adds it to parkedFees. Fee rates are capped by FEE_CAP_BPS.
- Liquidity behaviour
- beforeAddLiquidity and beforeRemoveLiquidity are present with view-style signatures and appear to restrict or check liquidity operations; afterAddLiquidity and afterRemoveLiquidity are declared as hook entry points. Exact logic cannot be confirmed from bytecode alone.
- Fee behaviour
- The hook charges a dynamic fee: buy and sell rates are stored in slot 5 (uint16 values) and set through updateFees. Accrued fees are held in parkedFees and sent to feeReceiver through settleParkedFees. disableFees can zero the rates.
- Owner & admin controls
- Owner (Ownable with two-step transfer via transferOwnership and acceptOwnership, plus renounceOwnership) can set the operator, feeReceiver, blacklist entries, grant or revoke access, enable or disable trading, update fees, disable fees and run emergency withdrawals. The operator is a separate role that can also call some setters. Rate changes are bounded by FEE_CAP_BPS.
Enabled Uniswap v4 callbacks
beforeInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta
beforeInitialize restricts pool creation; beforeSwap gates trading and blacklisted addresses; afterSwap returns the fee delta and accrues fees; beforeSwapReturnDelta and afterSwapReturnDelta allow the hook to take a share of swap amounts; afterAddLiquidity and afterRemoveLiquidity hooks are enabled for liquidity accounting, and beforeAddLiquidity and beforeRemoveLiquidity are present.
Security & trust assessment
Risk level: high, estimated (decoded bytecode, medium confidence).
Who controls it: A single owner key can change fees within the cap, halt trading, blacklist addresses, redirect fees by changing feeReceiver, withdraw held funds and grant or revoke access. Ownership is two-step, and renouncing is possible.
Risk to user funds: The hook holds parked fee balances and can take value from swaps via return deltas. Emergency withdrawal and blacklist functions give the admin the ability to move or block user funds interacting with the pool.
Security findings
- [medium] Owner-controlled fee rates: updateFees can change buyBps and sellBps (bounded by FEE_CAP_BPS), so an owner or operator can raise swap costs for traders at will.
- [high] Trading kill switch and blacklist: setTradingEnabled and the blacklist mapping in beforeSwap let an admin halt all swaps or block specific addresses from trading.
- [high] Emergency withdrawal functions: emergencyWithdrawETH, emergencyWithdrawERC20 and emergencyWithdrawERC721 let a privileged account move any tokens the hook holds, including parked fees.
- [medium] Return-delta hook takes swap value: Both beforeSwapReturnDelta and afterSwapReturnDelta are enabled, so the hook alters the amounts settled in each swap and takes a fee from them.
- [info] Unverified source: Analysis is based on decoded bytecode only; exact arithmetic, rounding and liquidity logic could not be verified.
Contract details
- Verified source
- No
- Bytecode size
- 8,311 bytes
- Upgradeable proxy
- No
- Detected patterns
- access-control, dynamic-fee, erc20, moves-currency, ownable, return-delta, rewards, self-unlock
Pools using Fee sharing hook
- ETH / anonpeer (0.00% fee) — 24h volume $29.60K, TVL $0, 144 swaps today