Limit orders hook on Base

Uniswap v4 Hook Contract 0x1b13c5317565f4495133dbce7ee82c65d2aa2088 on Base · Limit orders

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

What it does

A Uniswap v4 hook that stores on-ramp limit orders at tick levels and fills them against incoming swaps, with order creation restricted to an owner-designated vault.

How it works step by step

  • Stores pending on-ramp orders in a mapping keyed by a bytes32 pool id, tick and direction (pendingOrders, getPendingOrders).
  • Creates orders via createOnRampOrder, restricted to the vault address set by the owner.
  • Fills pending orders during swaps in beforeSwap using return deltas.
  • Uses unlockCallback with the pool manager to settle, take, mint and burn currency claims.
  • Exposes _tickToPrice helper for converting ticks to prices.
Swap behaviour
beforeSwap and afterSwap run on swaps; beforeSwap returns a delta that can fill pending on-ramp orders against the swap, altering the amounts exchanged.
Liquidity behaviour
No liquidity callbacks are enabled in the permissions; beforeAddLiquidity and beforeRemoveLiquidity selectors exist in the bytecode but are not part of the enabled permissions.
Fee behaviour
Uses the pool's static fee; the revert string RampHook_MustUseDynamicFee suggests the hook expects pools initialized with the dynamic fee flag in beforeInitialize, but no fee override is evident in the decoded selectors.
Owner & admin controls
Owner (slot 0) can call setVault(address) to set the vault address in slot 1, which authorizes that address to create on-ramp orders. Owner can transferOwnership or renounceOwnership. No pause or upgrade function was identified in the decoded selectors.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeSwap, beforeSwapReturnDelta

beforeInitialize: validates pool setup on initialization. beforeSwap: returns a delta (beforeSwapReturnDelta) that can fill or intercept swaps against pending on-ramp orders. beforeSwapReturnDelta: allows the hook to alter the swap's token amounts by taking or settling currency.

Security & trust assessment

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

Who controls it: The owner controls which vault address may create on-ramp orders via setVault and can transfer or renounce ownership. A malicious or compromised owner could point the vault to a contract that creates orders which drain pool value, though this is inferred rather than confirmed from source.

Risk to user funds: The hook can take and settle pool currency and mint or burn ERC6909 claims during swaps via return deltas, so swap outcomes and pool balances depend on the on-ramp order logic. Funds could be affected if that logic or the vault address is malicious.

Security findings

  • [medium] Hook moves currency during swaps: The hook enables beforeSwapReturnDelta and uses take/settle/sync/mint/burn calls, so it can move or claim pool currency during swaps.
  • [medium] Owner-controlled order creator: setVault is callable only by the owner and determines which address can create on-ramp orders stored under the orders mapping.
  • [low] Single-owner control without timelock: Owner can call transferOwnership and renounceOwnership; no timelock or multisig requirement is visible in the bytecode.
  • [info] Order storage logic unverified: Pending orders are stored in a mapping keyed by tick and direction, and unlockCallback manipulates those arrays; correctness cannot be verified without source.

Contract details

Verified source
No
Bytecode size
10,118 bytes
Upgradeable proxy
No
Detected patterns
erc6909-claims, moves-currency, ownable, return-delta, self-unlock

Pools using Limit orders hook