AgentUniswapHook on Base

Uniswap v4 Hook Contract 0x10c1b4c7b1ac62a0f83458f342c3d6b8d2847fff on Base · Launchpad · Verified contract

Volume (24h)
$0
Value locked (TVL)
$9.52K
All-time volume
$66.34K
Pools using this hook
1
Swaps (24h)
0 (0 traders)
Total swaps
339,405

What it does

A launchpad hook for Agent tokens that charges per-pair fees on swaps, sends collateral fees to configured recipients, and burns agent tokens on the other side of the trade.

How it works step by step

  • Restricts pool initialization to launch pools authorized by the owner or controller
  • Stores per-pair fee configuration (collateral token, burn basis, recipients and basis amounts)
  • On buys with exact output or sells with exact input, takes a burn fee in agent tokens
  • On other swaps, takes collateral fees and sends them to configured recipients
  • After each swap, burns the agent tokens held by the hook
  • Keeps all other liquidity and donation callbacks as no-ops
Swap behaviour
On swaps the hook takes a fee (collateral to recipients, or agent tokens to be burned) via before-swap delta, and burns any agent tokens it holds after the swap.
Liquidity behaviour
No liquidity callbacks modify state; add and remove liquidity hooks only return selectors and zero deltas.
Fee behaviour
Per-pair fees are set by owner or controller via setFeesForPair. On swaps where collateral is the amount being taken (or agent token is the specified input or output), a collateral-denominated fee is taken and sent to the configured recipients in proportion to basisAmounts. On the other swap direction the hook instead takes burnBasisAmount of the agent token, which is burned in afterSwap. Fees are charged in addition to the pool's LP fee.
Owner & admin controls
Owner (Ownable2Step, transfers need acceptance) can upgrade the implementation via UUPS, set the controller, and call setFeesForPair and setAuthorizedLaunchPool. The controller (normally the AgentFactory) can also call setFeesForPair and setAuthorizedLaunchPool. No pause function found.

Enabled Uniswap v4 callbacks

beforeInitialize, afterInitialize, beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity, afterRemoveLiquidity, beforeSwap, afterSwap, beforeDonate, afterDonate, beforeSwapReturnDelta, afterSwapReturnDelta, afterAddLiquidityReturnDelta, afterRemoveLiquidityReturnDelta

beforeInitialize restricts pool initialization to authorized launch pools. beforeSwap takes fee amounts via poolManager.take and returns a before-swap delta. afterSwap burns any agent tokens held by the hook. afterSwapReturnDelta and afterAddLiquidityReturnDelta/afterRemoveLiquidityReturnDelta are enabled but return zero deltas. The remaining callbacks are no-ops returning their selectors.

Security & trust assessment

Risk level: medium (verified source, high confidence).

Who controls it: The owner can upgrade the implementation to arbitrary logic, which could redirect fees, change recipients, or drain tokens held by the hook. The owner or controller can set any fee basis, including very large values that could make swaps uneconomic, and can authorize any launch pool. The controller has the same fee and authorization powers as the owner without upgrade rights.

Risk to user funds: The hook does not custody LP liquidity directly, but during swaps it takes collateral or agent tokens from the pool and forwards them to fee recipients, and it burns agent tokens it holds. A malicious or compromised upgrade could redirect or freeze that flow, affecting swappers in these pools.

Security findings

  • [high] Upgradeable proxy controlled by a single owner: Owner can call upgradeToAndCall and replace the implementation with arbitrary code, so fee logic, recipients and token handling are fully mutable.
  • [medium] Unbounded fee parameters: setFeesForPair accepts any basisAmounts and burnBasisAmount with no upper bound, so the owner or controller can set fees that take most of a swap.
  • [medium] Hook moves swap currency: The hook takes collateral and agent tokens via poolManager.take during swaps, so it holds and redirects user swap flows; afterSwap burns whatever agent tokens the hook holds.
  • [low] Controller has fee and pool authority: The controller can set fees and authorize launch pools without owner approval, widening the set of parties who can change economics.
  • [low] Burn targets full balance: Burn is applied to the full hook token balance in afterSwap, and IBurnable is called on token addresses from fee configuration; a misconfigured pair could burn unintended balances.

Contract details

Verified source
Yes (AgentUniswapHook)
Compiler
solc 0.8.28+commit.7893614a
Bytecode size
176 bytes
Upgradeable proxy
Yes
Detected patterns
dynamic-fee, launchpad, moves-currency, ownable, return-delta, upgradeable

Pools using AgentUniswapHook