Dynamic fee hook on Base

Uniswap v4 Hook Contract 0xb995b9efcc8021300bdc93fbd0c156e9a5ca0088 on Base · Dynamic fee

Volume (24h)
$0
Value locked (TVL)
$3.74
All-time volume
$3.74
Pools using this hook
1
Swaps (24h)
0 (0 traders)
Total swaps
3

What it does

A Uniswap v4 hook on Base that charges owner-configurable buy and sell taxes plus an LP fee on swaps, with the collected tax routed to a tax receiver address.

How it works step by step

  • Applies a buy tax in basis points to swaps in one direction (buyTaxBps).
  • Applies a sell tax in basis points to swaps in the opposite direction (sellTaxBps).
  • Sets an adjustable LP fee (lpFeeBps) used by the pool.
  • Takes the tax amount from the pool via take() and returns it as a before-swap delta.
  • Sends collected tax to a configurable taxReceiver address.
  • Owner can update rates within capped limits and transfer or renounce ownership in a two-step process.
Swap behaviour
On every swap beforeSwap runs, computes a buy or sell tax based on swap direction using the configured basis-point rate, takes that amount from the pool through the return delta, and applies the LP fee.
Liquidity behaviour
No liquidity callbacks.
Fee behaviour
Charges a buy tax and a sell tax in basis points (buyTaxBps, sellTaxBps) applied in beforeSwap, and sets an adjustable LP fee (lpFeeBps) that is written to the pool via the beforeSwap return delta path. Tax rates and LP fee are owner-configurable up to the on-chain caps; the exact fee routing to taxReceiver could not be fully confirmed from bytecode alone.
Owner & admin controls
Owner (Ownable2Step: transferOwnership then acceptOwnership, plus renounceOwnership) can set buy tax, sell tax and LP fee via setBuyTax, setSellTax and setLpFee, and can set the tax receiver address via setTaxReceiver. Tax and fee setters are capped by MAX_TAX_BPS and MAX_LP_FEE_BPS constants, which were not verified in value.

Enabled Uniswap v4 callbacks

beforeSwap, beforeSwapReturnDelta

beforeSwap: applies buy/sell tax and LP fee logic on every swap. beforeSwapReturnDelta: lets the hook return a delta so it can take a portion of the swap amount as tax before the swap executes.

Security & trust assessment

Risk level: medium, estimated (decoded bytecode, medium confidence).

Who controls it: A single owner key controls buy tax, sell tax, LP fee and the tax receiver. It can raise taxes up to the cap, redirect tax proceeds to any address, and renounce ownership. Ownership transfer is two-step, which reduces accidental loss of control.

Risk to user funds: The hook can take a share of swap input as tax through the return delta and transfer it to the tax receiver, so swappers lose part of each trade to the hook owner. It does not appear to hold a persistent LP position, but the owner-controlled tax rates and receiver determine how much value leaves the swap.

Security findings

  • [medium] Hook moves swap currency: The hook takes currency from the pool via the take(address,address,uint256) call during beforeSwap, so a portion of every swap is diverted to the tax receiver.
  • [medium] Owner-adjustable taxes and fees: Owner can change buyTaxBps, sellTaxBps and lpFeeBps at any time, and can redirect taxReceiver, so swap costs can change instantly for traders.
  • [low] Caps not verified: Tax and fee setters are bounded by MAX_TAX_BPS and MAX_LP_FEE_BPS, but these caps were read from selectors only and their values were not verified.
  • [info] Unverified source: Contract has no source, so behaviour is inferred from decoded selectors and storage slots; unrecognised helpers such as _hookEntropy and _skim have unknown purpose.

Contract details

Verified source
No
Bytecode size
3,037 bytes
Upgradeable proxy
No
Detected patterns
launchpad, moves-currency, ownable, return-delta, tax

Pools using Dynamic fee hook