Rewards hook on Ethereum

Uniswap v4 Hook Contract 0xd3f642d35ad8574470d813f90dd5e85793dea0cc on Ethereum · Rewards

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

What it does

This hook takes a basis-point fee from swaps on top of the pool fee and accrues it as pending fees that are later harvested into rewards, so swappers pay slightly more while the hook's reward accounting collects that fee.

How it works step by step

  • Hook is initialized in beforeInitialize and keeps pool identity (poolId, poolKey, token, paired currency) in storage
  • afterSwap accrues a fee amount tracked as pending fees, with per-epoch accounting in a mapping keyed by epoch id
  • beforeSwapReturnDelta and afterSwapReturnDelta are enabled, so the hook can take a share of swap amounts as a return delta and route it to itself
  • harvest and harvestEpochs (nonpayable) move accumulated fees out of the hook and update totalHarvested and epoch storage
  • unlockCallback is present, indicating the hook calls the PoolManager unlock flow to settle or withdraw funds during harvesting
  • liquidityLock, rewards and FEE_BPS views suggest a liquidity lock and reward distribution to a designated recipient
Swap behaviour
beforeSwap is gated and afterSwap updates accounting; with afterSwapReturnDelta and beforeSwapReturnDelta enabled, a fraction of swap amounts (FEE_BPS) is diverted to the hook as a fee, so swappers pay the hook fee on top of the pool fee. Exact direction and rate cannot be confirmed without source.
Liquidity behaviour
beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity and afterRemoveLiquidity selectors exist, but the hook does not enable liquidity return deltas, so liquidity flows are not directly taken by the hook; liquidityLock suggests liquidity removal may be restricted.
Fee behaviour
A hook fee is taken on swaps, expressed in basis points via FEE_BPS and BPS, accrued as pendingFees and split across epochs; the pool's static fee still applies in addition.
Owner & admin controls
No owner or access-control selector was decoded; harvest and harvestEpochs appear callable by anyone, so distribution targets are determined by hook logic. Cannot confirm pause or upgrade functions from bytecode.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeInitialize: records pool key and identity on pool creation. beforeSwap: pre-swap gating and possible return delta for fee capture. afterSwap: accrues the fee into pending fees and epoch accounting. beforeSwapReturnDelta and afterSwapReturnDelta: let the hook take a share of swap amounts as a delta.

Security & trust assessment

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

Who controls it: No owner key was found in the decoded selectors, so centralization risk appears limited; any privileged role would need to be confirmed from source.

Risk to user funds: The hook takes a fee from swaps via return deltas and holds accrued pending fees until harvested, so swap value and accrued fees sit inside the hook contract.

Security findings

  • [medium] Return delta fee capture on swaps: beforeSwapReturnDelta and afterSwapReturnDelta are enabled, so the hook takes value from swap amounts; the rate is set by FEE_BPS and is not verifiable without source.
  • [medium] Permissionless harvest: harvest and harvestEpochs are nonpayable with no decoded caller check, so the timing and recipient of fund movements depend on hook logic that cannot be verified.
  • [medium] Unlock callback fund movement: unlockCallback is present, meaning the hook moves tokens through the PoolManager unlock flow; the hook holds accrued fees between harvests.
  • [info] No verified source: Analysis is based on decoded bytecode only, so exact math, caller restrictions and recipients are inferred.

Contract details

Verified source
No
Bytecode size
8,731 bytes
Upgradeable proxy
No
Detected patterns
return-delta, rewards, self-unlock

Pools using Rewards hook