Fee sharing hook on Unichain

Uniswap v4 Hook Contract 0xcc2efb167503f2d7df0eae906600066aec9e8444 on Unichain · Fee sharing

Volume (24h)
$0
Value locked (TVL)
$12.01K
All-time volume
$1.57M
Pools using this hook
114
Swaps (24h)
0 (0 traders)
Total swaps
551,558

What it does

A fee-sharing hook that skims a fee from swaps and distributes it to a referral tree, a creator and a fee recipient.

How it works step by step

  • Charges a total fee on swaps, defined by TOTAL_FEE over FEE_DENOMINATOR.
  • Splits the collected fee among L1, L2 and L3 referral levels and a creator fee.
  • Uses afterSwapReturnDelta to take the fee from swap output currency.
  • Calls the pool manager take function to withdraw fee currency.
  • Stores a feeRecipient address that receives the remaining fee share.
  • Manages admin and role permissions via AccessControl.
Swap behaviour
afterSwap computes a fee on swap output, takes it through the pool manager via a return delta, and routes it to referral and creator shares and the fee recipient.
Liquidity behaviour
afterAddLiquidity is enabled and the hook implements afterRemoveLiquidity and before/after liquidity selectors as ABI entries; the bytecode does not clearly show custom liquidity logic beyond the permission flag, so liquidity handling appears to be pass-through.
Fee behaviour
The hook exposes TOTAL_FEE, FEE_DENOMINATOR, REFERRAL_FEE, L1/L2/L3_REFERRAL_FEE and CREATOR_FEE constants and a feeRecipient, indicating afterSwap takes a fee from swap output and distributes it across a referral tree and a creator, with the remainder going to feeRecipient. Exact percentages are not readable from the decoded input.
Owner & admin controls
AccessControl with DEFAULT_ADMIN_ROLE and ADMIN_ROLE; role holders can grant and revoke roles and call setFeeRecipient to change where fees are sent. Source is unverified so the exact role gating is inferred from selectors only.

Enabled Uniswap v4 callbacks

afterAddLiquidity, afterSwap, afterSwapReturnDelta

afterAddLiquidity: runs after liquidity is added, likely for bookkeeping. afterSwap: runs after each swap to compute and collect fees. afterSwapReturnDelta: lets the hook take a share of the swap's output currency via a return delta, which is how fees are skimmed from swaps.

Security & trust assessment

Risk level: medium (decoded bytecode, medium confidence).

Who controls it: Holders of DEFAULT_ADMIN_ROLE or ADMIN_ROLE can grant roles to new addresses and redirect fee revenue by changing feeRecipient, potentially diverting protocol or referral fees.

Risk to user funds: The hook can take a fee in the swap output currency on every swap through its return delta and withdraws currency from the pool manager; it does not appear to hold a long-term user balance, but it does participate in every swap's settlement.

Security findings

  • [medium] Hook takes swap output via return delta: afterSwapReturnDelta lets the hook take part of swap output via the pool manager, so the hook directly moves user-facing currency on every swap.
  • [medium] Privileged fee recipient change: setFeeRecipient is callable by privileged roles and redirects accumulated fee flows, so a compromised admin key could divert fees.
  • [info] Pool currency withdrawals: Bytecode references a take(address,address,uint256) call to the pool manager, meaning the hook withdraws currency from the pool on swaps.
  • [info] Unverified source: No verified source is available, so fee math, role gating and upgradeability cannot be confirmed from the code.

Contract details

Verified source
No
Bytecode size
6,261 bytes
Upgradeable proxy
No
Detected patterns
moves-currency, return-delta

Pools using Fee sharing hook