Access control hook on Robinhood Chain
Uniswap v4 Hook Contract 0x04656530180e9ea27a2e75b2139c780cd6a6eacc on Robinhood Chain · Access control
- Volume (24h)
- $0.58
- Value locked (TVL)
- $0.58
- All-time volume
- $0.58
- Pools using this hook
- 1
- Swaps (24h)
- 1 (1 traders)
- Total swaps
- 1
What it does
This hook takes part in swaps and liquidity changes and can adjust swap deltas, but from the decoded bytecode alone the fee and direction of trades that pay more or less cannot be confirmed.
How it works step by step
- Declares beforeInitialize, beforeAddLiquidity, beforeRemoveLiquidity, beforeSwap, afterSwap, beforeSwapReturnDelta and afterSwapReturnDelta permissions, so it can alter swap amounts and take value via return deltas.
- beforeSwap and afterSwap write per-pool accounting into storage slots 1 to 4, keyed by a uint256 (pool or position id), tracking amounts and timestamps.
- Exposes open(bytes32) and drain(bytes32), which move funds recorded for a pool key out of the hook's accounting.
- Exposes getPending(bytes32), currentFees(bytes32), holders() and permissions() as views for reading pending amounts and fees.
- Has a second-stage setter (selector 0xa9ea29a9 and 0xd219735a) that writes the address slot 0, indicating configurable parameters or a registered address.
- Calls back into the pool manager via poolManager()/core() and extsload, and reverts with NotCore, UnknownPool or HookNotImplemented when called incorrectly.
- Swap behaviour
- beforeSwap and afterSwap run and update storage (slots 1, 2, 3 and 4) and the hook returns deltas (beforeSwapReturnDelta and afterSwapReturnDelta enabled), so it can adjust the amounts a swap settles; the exact fee or amount logic cannot be determined from the decoded bytecode.
- Liquidity behaviour
- beforeAddLiquidity and beforeRemoveLiquidity are gated by the hook; afterAddLiquidity and afterRemoveLiquidity selectors exist but only the before-hooks are enabled in permissions, and the hook keeps no clear per-position logic beyond storage writes.
- Fee behaviour
- currentFees(bytes32) is exposed and beforeSwap/afterSwap appear to compute or accumulate fee amounts, but the fee rate and destination cannot be confirmed from bytecode alone; treat fee behaviour as unknown.
- Owner & admin controls
- A setter writes the address slot 0 and open/drain are callable; no explicit owner or pause check could be confirmed from decoded bytecode, so admin gating is unknown.
Enabled Uniswap v4 callbacks
beforeInitialize, beforeAddLiquidity, beforeRemoveLiquidity, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta
beforeInitialize validates pool creation; beforeAddLiquidity and beforeRemoveLiquidity gate liquidity changes; beforeSwap and afterSwap run swap logic; beforeSwapReturnDelta and afterSwapReturnDelta let the hook take or credit currency deltas during swaps.
Security & trust assessment
Risk level: high, estimated (decoded bytecode, low confidence).
Who controls it: Whoever controls the address set in slot 0 or can call drain and open may be able to move accounted funds or change behaviour; this could not be confirmed.
Risk to user funds: The hook holds and accounts for pool-related amounts (storage slots 1 to 4) and can take value through return deltas, so user or pool funds may be affected by swaps and by drain-style withdrawals.
Security findings
- [high] Return deltas enabled on swaps: beforeSwapReturnDelta and afterSwapReturnDelta are enabled, so the hook can take or credit tokens from swap flows and alter what traders pay or receive.
- [high] Drain function callable: A drain(bytes32) selector moves value recorded in storage slot 1 out of the hook; if access control is missing or weak, funds held by the hook can be withdrawn.
- [medium] Unverified access control on setters: Selector 0xa9ea29a9 and 0xd219735a write storage slot 0 and no caller check is visible in the decoded bytecode, so privileged-only use cannot be confirmed.
- [info] No source for verification: No verified source is available, so the exact logic of storage writes and fee computation is inferred from selectors and storage layout only.
Contract details
- Verified source
- No
- Bytecode size
- 9,019 bytes
- Upgradeable proxy
- No
- Detected patterns
- return-delta
Pools using Access control hook
- ETH / SWAI (0.00% fee) — 24h volume $0.58, TVL $0.58, 1 swaps today