RareFriendsHook on Robinhood Chain

Uniswap v4 Hook Contract 0x7a65d0194e6cc43971c31ce7d1471da01d42a0cc on Robinhood Chain · Rewards · Verified contract

Volume (24h)
$399
Value locked (TVL)
$166.35K
All-time volume
$3.11M
Pools using this hook
1
Swaps (24h)
10 (10 traders)
Total swaps
11,229

What it does

Takes a fixed 5% fee on WETH-side swaps in the RareFriends pool and forwards it to a rewards contract that funds the market.

How it works step by step

  • Restricts pool initialization to the market address so the canonical pool cannot be seeded at an arbitrary price
  • Overrides the LP fee on every swap and charges a fixed 500 bps fee on the WETH side
  • Takes the fee from the PoolManager with take() and sends it to the rewards contract via fund()
  • Uses beforeSwap and afterSwap return deltas to account for the fee on exact-input and exact-output swaps
  • Emits FeeCollected for each fee and RewardsUpdated when the owner changes the rewards address
Swap behaviour
On each swap in the canonical pool, a 5% fee is taken from the WETH side (on exact input as 5% of the amount, on exact output grossed up so the fee is 5% of the WETH leg), transferred to the rewards contract via fund(), and the fee is reflected through the beforeSwap/afterSwap return deltas.
Liquidity behaviour
No liquidity callbacks.
Fee behaviour
Charges a fixed 5% (500 bps) fee on the WETH side of every swap, using an override LP fee flag. For exact input the fee is 5% of the WETH amount; for exact output it is grossed up so the fee equals 5% of the total WETH leg. The collected WETH is taken from the pool manager and forwarded to the rewards contract via fund().
Owner & admin controls
Owner (Ownable) can call setRewards to repoint the reward funding destination and approve the new address for unlimited WETH; owner can renounceOwnership or transferOwnership. Fee rate FEE_BPS and tick spacing are immutable constants, so owner cannot change fees, pause swaps, or upgrade the contract.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeInitialize restricts pool initialization to the market address to prevent a different seed price; beforeSwap and afterSwap take the WETH fee from the pool and redirect it to rewards, using return deltas to account for the fee; beforeSwapReturnDelta and afterSwapReturnDelta allow the hook to take a share of swap currency.

Security & trust assessment

Risk level: medium (verified source, high confidence).

Who controls it: The owner can point rewards at any contract with code and grant it unlimited WETH allowance, so a malicious or compromised owner could redirect all future fees and drain any WETH the hook holds or can pull via the approved spender. Ownership can also be renounced, which removes that ability.

Risk to user funds: The hook takes WETH from the pool on each swap and forwards it to the rewards contract via fund(); it does not custody user principal beyond the in-flight fee. The owner-controlled rewards address with unlimited WETH approval means the hook's WETH balance and approvals are a trust point: a malicious rewards address could pull WETH the hook holds.

Security findings

  • [medium] Owner-controlled reward destination with unlimited WETH approval: setRewards lets the owner set an arbitrary contract as rewards and approves it for unlimited WETH; the new address is only checked to have code.
  • [info] Fixed 5% fee on WETH leg: Every swap in the pool pays a fixed 5% fee on the WETH side, taken via return deltas and forwarded to rewards.fund(); the fee cannot be changed by the owner.
  • [info] Pool access restricted to canonical pool: Pool is restricted to the market address for initialization and only accepts calls from the PoolManager for the canonical pool id, so unrelated pools cannot use this hook.
  • [low] Fee accounting depends on router behaviour: Swaps that are partial fills or routed through other routers still pay the fee, but the source notes that the hook's own router rejects partial fills; other routers' behaviour is out of scope for this hook.

Contract details

Verified source
Yes (RareFriendsHook)
Compiler
solc 0.8.36+commit.8a079791
Bytecode size
3,682 bytes
Upgradeable proxy
No
Detected patterns
moves-currency, ownable, return-delta, rewards

Pools using RareFriendsHook