Custom pricing hook on Robinhood Chain
Uniswap v4 Hook Contract 0xec5a61ae4c6cc83045e235630851c4acdc110044 on Robinhood Chain · Custom pricing
- Volume (24h)
- $0
- Value locked (TVL)
- $2.77
- All-time volume
- $26
- Pools using this hook
- 1
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 61
What it does
A Uniswap v4 hook that charges a configurable fee on swaps after execution and holds the collected fees for the owner to withdraw.
How it works step by step
- afterSwap callback runs after each swap and computes a fee from the stored fee rate
- afterSwapReturnDelta lets the hook take its fee from the swap amount settled with the pool manager
- Owner sets the fee in basis points through setFeeBps, capped by a BpsTooHigh check
- Collected fees are held by the hook contract until the owner withdraws them with withdrawFees
- Owner-only controls include transferOwnership and a second uint24 parameter setter
- Liquidity callbacks and beforeSwap are dispatched in the ABI but not enabled by the address permissions
- Swap behaviour
- After each swap the afterSwap callback computes the hook fee using the stored fee rate and takes it via the afterSwapReturnDelta mechanism; the fee rate is read from storage on every swap.
- Liquidity behaviour
- No liquidity callbacks are enabled in the permissions; beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity and afterRemoveLiquidity exist as view selectors but the address encodes only afterSwap and afterSwapReturnDelta permissions.
- Fee behaviour
- Hook takes a configurable fee in basis points (feeBps, set by owner through setFeeBps) on swaps; the fee is taken via afterSwap return delta and accrued in the hook for later withdrawal by the owner.
- Owner & admin controls
- Owner (slot 0 address) can transfer ownership via transferOwnership, set the fee via setFeeBps (uint24, bounded by BpsTooHigh check), set a parameter via 0xe0ec4101 (uint24, likely a rate or fee setter), toggle a bool flag at slot 0 offset 26 via 0x01f649f8, and withdraw accumulated tokens via withdrawFees.
Enabled Uniswap v4 callbacks
afterSwap, afterSwapReturnDelta
afterSwap: runs after each swap to compute and record the hook's fee on the swap output. afterSwapReturnDelta: lets the hook return a delta that changes the amount the pool settles, so the hook can take its fee from the swap.
Security & trust assessment
Risk level: medium, estimated (decoded bytecode, low confidence).
Who controls it: The owner controls the fee rate, a second uint24 parameter, a bool flag, ownership and withdrawal of fees accrued in the hook. A malicious or compromised owner could raise the fee up to the allowed cap on every swap, or withdraw any tokens the hook holds.
Risk to user funds: The hook takes fees through its afterSwap return delta and holds those tokens until withdrawFees is called by the owner, so accrued fees and any tokens sent to the hook are under owner control; swaps themselves are not blocked by any observed pause logic.
Security findings
- [medium] Owner-adjustable swap fee: Owner can call setFeeBps to change the swap fee, bounded only by BpsTooHigh check; raising the fee shifts value from traders to the hook.
- [medium] Owner can withdraw hook-held tokens: withdrawFees(address,address,uint256) and the take/transfer selectors show the hook moves ERC20 tokens to an address chosen by the caller path controlled by the owner.
- [low] Single-step ownership transfer: Ownership can be transferred with transferOwnership with no visible two-step confirmation, so a wrong address would permanently lock admin functions.
- [info] Limited permission surface: Only afterSwap and afterSwapReturnDelta are enabled, so the hook cannot block liquidity operations; it does not appear to be upgradeable from the decoded selectors.
Contract details
- Verified source
- No
- Bytecode size
- 3,384 bytes
- Upgradeable proxy
- No
- Detected patterns
- dynamic-fee, erc20, moves-currency, ownable, return-delta
Pools using Custom pricing hook
- WETH / USDG (0.05% fee) — 24h volume $0, TVL $2.77, 0 swaps today