Access control hook on Robinhood Chain

Uniswap v4 Hook Contract 0x18603fcc6c4934664cf6567021d8820b660fe0cc on Robinhood Chain · Access control

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

What it does

This hook takes a share of swap flow into internal vats via return deltas, but the direction and size of the effect on which trades pay more or less cannot be confirmed without source.

This read was written for the hook 0xb8c3…e0cc on Robinhood Chain and reused here: the two share a code shape, so constants such as fees, owners and addresses can differ.

How it works step by step

  • Hook with beforeInitialize, beforeSwap, afterSwap and both return-delta permissions enabled, so it can take or give currency inside swaps.
  • Owns an ERC20 token (balanceOf, transfer, approve, transferFrom, totalSupply, name, symbol, decimals) that is part of its own accounting.
  • Maintains a set of vats (vat(uint8), bearerOf(uint8), vats(), drainVat(uint8,uint256)) that appear to hold per-slot balances and are assigned to bearers.
  • Uses an unlock callback (unlockCallback, self-unlock tag, selector unlock(bytes) referenced) to call the pool manager, with take() used to move currency out of the pool.
  • Exposes fee and split parameters (ashBps, cutBps, commonsBps, HOME_FEE, HOME_SPACING, cutCollected, cutDrained, mangle, RUN) whose exact semantics cannot be confirmed from bytecode alone.
Swap behaviour
beforeSwap and afterSwap are both implemented and can return deltas, so the hook can alter the amounts settled on swaps and move currency to or from its own vats; the precise direction and size of the effect (which trades pay more or less) cannot be determined from decoded bytecode without source.
Liquidity behaviour
beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity and afterRemoveLiquidity selectors exist but the corresponding permissions are not enabled, so liquidity callbacks are not invoked by the pool manager.
Fee behaviour
Fees are not taken through LP fee overrides; the hook's own fee-related state (HOME_FEE, ashBps, cutBps, commonsBps, cutCollected) suggests it takes a share of swap flow via return deltas, but the split logic cannot be confirmed from decoded bytecode.
Owner & admin controls
Ownable: owner can renounceOwnership and transferOwnership. drainVat(uint8,uint256) is callable and writes vat balances, but its access check cannot be confirmed from decoded bytecode. No pause or upgrade mechanism was detected.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeInitialize: runs at pool initialization, sets an initialized flag (slot 7 written in dc98354e). beforeSwap: reads hook state and can return a delta to adjust swap settlement. afterSwap: writes vat and accounting state after each swap and can return a delta. beforeSwapReturnDelta and afterSwapReturnDelta: allow the hook to take or give currency in the swap.

Security & trust assessment

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

Who controls it: The owner key and any address that can call drainVat or change ownership could redirect or extract balances held in the hook's vats, and could affect the split parameters.

Risk to user funds: The hook can hold, move and take currency during swaps through return deltas and vat accounting, so user swap flow and any balances in the hook's vats are exposed to its logic.

Security findings

  • [high] Hook takes currency via return deltas: beforeSwapReturnDelta and afterSwapReturnDelta are enabled and the hook can move currency to its own vats, so trader settlement depends on the hook's internal logic.
  • [high] drainVat callable and writes vat balances: drainVat(uint8,uint256) mutates vat storage and its caller restriction could not be verified; if access is weak, vat funds can be drained.
  • [medium] Owner-controlled Ownable contract: The owner can transfer or renounce ownership, and the owner's authority over fee and split parameters is unverified.
  • [medium] No verified source: Analysis relies on decoded selectors and storage only, so the exact accounting and access checks are uncertain.

Contract details

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

Pools using Access control hook