AmountHelpers2 on Base

Uniswap v4 Hook Contract 0x4519e2b040ff1b64fa03abe2aef0bc99d7cceaa8 on Base · Utility · Verified contract

Volume (24h)
$9.02
Value locked (TVL)
$29.00K
All-time volume
$983.96K
Pools using this hook
1
Swaps (24h)
25 (2 traders)
Total swaps
15,154

What it does

This contract is a view-only library helper that calculates token amounts for a liquidity range, and the hook's swap and liquidity behaviour cannot be confirmed from the supplied source.

How it works step by step

  • Proxy delegates all hook calls to implementation 0xdf10cfbc3723febda6866ad1925ffbdef65b9601, which is the verified AmountHelpers2 library code
  • Exposes getMaxAmountInForPool2, a view function that reads pool liquidity and current sqrt price and returns the token0 and token1 amounts needed to back liquidity over a given tick range
  • Computes amounts using LiquidityAmounts helpers and TickMath sqrt price boundaries, with no state writes
  • computeSwapFeeAmounts is an internal library function that the verified source includes, but no external selector for it is exposed through the public ABI
  • Enabled hook flags (beforeInitialize, beforeAddLiquidity, beforeRemoveLiquidity, beforeSwap, beforeDonate, beforeSwapReturnDelta) are reported from the address; the verified source for AmountHelpers2 contains no callback implementations, so the hook logic that consumes these flags is not visible in the supplied source
Swap behaviour
Not determinable from the supplied source: the verified library only contains a view helper and an internal swap fee computation, and the beforeSwap and beforeSwapReturnDelta callbacks that the address enables are not implemented in the code provided.
Liquidity behaviour
Not determinable from the supplied source: beforeAddLiquidity and beforeRemoveLiquidity are enabled by the address, but no implementation of them appears in the verified library code.
Fee behaviour
Not determinable from the supplied source. The library's computeSwapFeeAmounts uses a constant 1% (10000 pips) fee for its calculation, but the library does not show how a hook would apply this to swaps.
Owner & admin controls
No admin controls found in the supplied source. Upgradeability is indicated by the proxy delegating to a separate implementation, which implies the implementation can be replaced by whoever controls the proxy's upgrade mechanism, but the proxy admin logic is not included in the input.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeAddLiquidity, beforeRemoveLiquidity, beforeSwap, beforeDonate, beforeSwapReturnDelta

beforeInitialize, beforeAddLiquidity, beforeRemoveLiquidity, beforeSwap, beforeDonate and beforeSwapReturnDelta are enabled by the hook address, but the supplied verified source does not show the callbacks that use them, so their purpose cannot be confirmed.

Security & trust assessment

Risk level: medium, estimated (verified source, low confidence).

Who controls it: A privileged key controlling the proxy could replace the implementation and therefore change swap, liquidity and return-delta behaviour for every pool using this hook.

Risk to user funds: Unknown from the supplied source. The hook address enables return-delta and before-swap callbacks, so in principle it could take or alter amounts, but the implementing code is not in the input and the deployed implementation's full bytecode was not provided.

Security findings

  • [medium] Upgradeable proxy: The hook is a proxy that delegates every call to implementation 0xdf10cfbc3723febda6866ad1925ffbdef65b9601. If the proxy admin can change the implementation, the hook logic can be replaced at any time, including the logic for before-callbacks and return deltas.
  • [medium] Return-delta permission enabled: beforeSwapReturnDelta is enabled on the address, which allows the hook to alter the amounts a swap settles with. The supplied source does not show the implementation that uses it, so the extent of the effect on user funds cannot be verified.
  • [info] Before-callback gating not visible in source: Several before-callbacks (initialize, add and remove liquidity, swap, donate) are enabled, but none are implemented in the verified source provided, so whether they can block operations cannot be checked.

Contract details

Verified source
Yes (AmountHelpers2)
Compiler
solc 0.8.30+commit.73712a01
Bytecode size
19,046 bytes
Upgradeable proxy
Yes
Detected patterns
return-delta, upgradeable

Pools using AmountHelpers2