Dynamic fee hook on Robinhood Chain
Uniswap v4 Hook Contract 0x507791a8f0bc5be61e3719bbefe38a33201360cc on Robinhood Chain · Dynamic fee
- Volume (24h)
- $0.83
- Value locked (TVL)
- $0.93
- All-time volume
- $0.83
- Pools using this hook
- 1
- Swaps (24h)
- 4 (3 traders)
- Total swaps
- 4
What it does
This hook runs a credit-line style accounting layer on Uniswap v4 swaps that takes a basis-point cut through return deltas, while the owner and agents control funding and draws, so trader and LP cost depends on privileged configuration that cannot be fully verified from bytecode.
How it works step by step
- Exposes a credit-line style lending interface: open(uint256,address) creates a line for a wallet, draw/repay/withdraw move USDG-denominated balances, and fund(uint256) adds funds.
- Tracks per-address limits, debts and lines through mappings and a wallets array, with counters for drawn and outstanding amounts.
- Uses beforeSwap and afterSwap with return deltas, so the hook can take or supply currency on swaps rather than only observing them.
- Takes a cut of flows as indicated by the CUT_BPS constant, with the cut applied in swap accounting.
- Initialization, liquidity and donate callbacks are declared in the bytecode dispatch, but their bodies are mostly view-only stubs in this decoding.
- Swap behaviour
- beforeSwap and afterSwap are implemented with return-delta permissions, so the hook can alter the amounts settled on a swap, likely taking a CUT_BPS share and adjusting debts or USDG balances tied to the trader's line. The exact formula cannot be confirmed from bytecode alone.
- Liquidity behaviour
- beforeAddLiquidity, beforeRemoveLiquidity, afterAddLiquidity and afterRemoveLiquidity selectors are present as view functions and no liquidity-modifying permissions are enabled, so the hook does not alter liquidity flows.
- Fee behaviour
- Uses the pool's static fee at the protocol level; the hook charges a basis-point cut (CUT_BPS) through return deltas on swaps, not through dynamic LP fee override.
- Owner & admin controls
- Owner can transfer or renounce ownership (transferOwnership, renounceOwnership) and withdraw funds (withdraw). An agents role exists and may control line operations. No upgrade or pause function was identified in the dispatched selectors.
Enabled Uniswap v4 callbacks
beforeInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta
beforeInitialize: validates or records pool initialization. beforeSwap: gates or prepares swaps and may return a delta. afterSwap: settles the post-swap delta and updates line balances. beforeSwapReturnDelta: lets the hook take a share of the swap input or output. afterSwapReturnDelta: lets the hook take a share after the swap completes.
Security & trust assessment
Risk level: high, estimated (decoded bytecode, low confidence).
Who controls it: The owner controls ownership transfer, fund withdrawal and agent management; a compromised owner key could withdraw hook-held funds and reassign control.
Risk to user funds: The hook can hold USDG and other tokens and moves currency through return deltas and draw/repay/withdraw, so user and pool funds are exposed to owner and agent actions.
Security findings
- [medium] Return-delta swap accounting: beforeSwapReturnDelta and afterSwapReturnDelta are enabled, so the hook can alter the amounts settled in every swap in its pool, affecting trader execution.
- [high] Owner withdrawal of funds: The withdraw(address,uint256) function is callable by the owner and moves tokens held by the hook, so the owner can drain balances the hook holds.
- [medium] Agent-controlled credit lines: Lines, limits and draws are managed by owner and agents, so a privileged key can open lines, draw or repay balances for wallets.
- [info] No source verification: Analysis relies on decoded bytecode and inferred storage, so exact fee and accounting logic may differ from what is described.
Contract details
- Verified source
- No
- Bytecode size
- 6,553 bytes
- Upgradeable proxy
- No
- Detected patterns
- erc20, moves-currency, ownable, return-delta
Pools using Dynamic fee hook
- ETH / USDG (0.05% fee) — 24h volume $0.83, TVL $0.93, 4 swaps today