Token hook on Ethereum

Uniswap v4 Hook Contract 0x233fcd6ea0cc7d1ef8a73fe08363d104b1bd60c4 on Ethereum · Token

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

What it does

This hook charges a buy or sell tax on swaps, with the rates set by the owner and taken from trade output, so trades that are not tax-exempt pay the tax while tax-exempt addresses do not.

How it works step by step

  • Acts as a tax token hook for a pool, applying buy and sell taxes through afterSwap return deltas
  • Holds a trading switch that must be enabled before swaps are allowed in beforeSwap
  • Maintains a tax-exempt address mapping that bypasses taxation for listed addresses
  • Accumulates taxes and forwards ETH to a treasury address
  • Can lock a liquidity position NFT with an unlock time that can be extended but not shortened
  • Blocks liquidity removal and related pool actions based on lock state
Swap behaviour
beforeSwap reverts unless trading is enabled; afterSwap computes a buy or sell tax in basis points (buyTaxBps, sellTaxBps, capped by MAX_TAX_BPS) and takes it via return deltas, except for tax-exempt addresses.
Liquidity behaviour
beforeAddLiquidity and beforeRemoveLiquidity are present as selectors and afterAddLiquidity and afterRemoveLiquidity handle position accounting; removal is gated by the lock state (isLocked, unlockTime, positionBurned).
Fee behaviour
Buy and sell taxes are set by the owner through setBuyTax and setSellTax, applied as a percentage of swap volume and accumulated to the treasury; the pool's static fee is not the only fee component.
Owner & admin controls
Owner (Ownable) can enableTrading, set buy and sell tax rates, set tax-exempt addresses, set the treasury, extend the lock, flush or collect funds, and transfer or renounce ownership.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeSwap, afterSwap, afterSwapReturnDelta

beforeInitialize sets up pool state at initialization; beforeSwap gates trading on the enabled flag; afterSwap applies the tax and takes it via return deltas; afterSwapReturnDelta lets the hook keep part of the swap output.

Security & trust assessment

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

Who controls it: The owner key can raise buy and sell taxes up to the cap, enable or effectively control trading, change the treasury recipient, manage the tax-exempt list, and transfer or renounce ownership.

Risk to user funds: The hook takes a percentage of swap output through return deltas and forwards accumulated ETH to the treasury; the owner can change the tax rates and the treasury address, so users' trade proceeds are directly exposed to these owner-controlled parameters.

Security findings

  • [high] Owner-set tax rates: setBuyTax and setSellTax let the owner change swap taxes up to MAX_TAX_BPS, so the owner can raise taxes on trades after users commit to them.
  • [medium] Return-delta taking of user funds: afterSwapReturnDelta with afterSwap tax logic lets the hook take a share of swap output from traders on every swap.
  • [medium] Trading gate by owner: beforeSwap reverts when trading is not enabled, and enableTrading is owner-only, so the owner controls whether the pool can be traded at all.
  • [low] Treasury ETH flow: Collected ETH is forwarded to a treasury address that the owner can change via setTreasury, creating a path for redirecting accumulated fees.
  • [info] Unverified source: Analysis is from decoded bytecode only, so exact tax math and lock enforcement could not be confirmed against source.

Contract details

Verified source
No
Bytecode size
14,095 bytes
Upgradeable proxy
No
Detected patterns
erc20, moves-currency, ownable, return-delta, self-unlock, tax

Pools using Token hook