Fee sharing hook on Ethereum

Uniswap v4 Hook Contract 0xbe7cf8fd75f7522999f97f14e38a6602eb592acc on Ethereum · Fee sharing

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

What it does

This hook charges every swap a fixed base fee plus an optional capped creator fee, splits the fees between the creator and the platform for later claiming, and keeps TWAP price data; LP tokens are not charged, though the hook checks withdrawals.

How it works step by step

  • Charges a swap fee on registered pools, split between the token creator and a platform address, with fees credited to them for later claim.
  • Lets a pool creator set an extra own fee, capped by a hard-coded maximum (MAX_OWN_FEE_PIPS) whose exact value cannot be read from bytecode.
  • Keeps a price history ring buffer so it can report spot prices and time-weighted average prices (TWAP).
  • Runs checks before pool setup, adding liquidity and removing liquidity. These checks appear to be view-only validations tied to registered pools.
Swap behaviour
On each swap the hook can take a fee from the swap amounts through return deltas and records price data for its oracle. The fee is a base fee plus an optional creator fee, and the exact percentages are not readable from bytecode.
Liquidity behaviour
Add and remove liquidity callbacks are view functions, so they cannot take tokens, but they could revert under conditions that cannot be confirmed without source. There are no liquidity return deltas, so the hook cannot deduct LP tokens.
Fee behaviour
A fixed base fee (FEE_PIPS) is split between the creator and the platform using the constants CREATOR_PIPS and PLATFORM_PIPS. Creators can add an own fee up to MAX_OWN_FEE_PIPS, the fees accrue as amounts owed, and recipients withdraw them via claim or claimTo.
Owner & admin controls
The owner can change the owner, the platform fee recipient and an engine address, and can register pools and creators. Creators can set their own fee only up to the hard-coded cap; the cap and base fees are constants.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeAddLiquidity, beforeRemoveLiquidity, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeInitialize: validates pool registration; beforeAddLiquidity: checks deposits; beforeRemoveLiquidity: checks withdrawals; beforeSwap: computes the fee and updates the oracle; afterSwap: settles the fee; beforeSwapReturnDelta/afterSwapReturnDelta: let the hook take the fee from swap amounts.

Security & trust assessment

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

Who controls it: A single owner controls the platform recipient, the engine address and pool or creator registration. Creators control their own extra fee within a hard-coded cap.

Risk to user funds: Traders pay the base fee plus any creator fee from their swap amounts, and the exact percentages are unknown but capped by constants. LP principal cannot be deducted by the hook, though withdrawal checks exist.

Security findings

  • [medium] Unverified swap fee taking: The hook takes fees through swap return deltas, and the exact fee and cap values cannot be verified from bytecode, though the constants suggest bounded fees.
  • [low] Withdrawal check present: beforeRemoveLiquidity is enabled as a view function. It cannot take funds, but it might revert for some pools; the exact conditions are unknown.
  • [info] Owner-set engine address: The owner can change an engine address, and its role in the hook's logic is not clear from bytecode.

Contract details

Verified source
No
Bytecode size
12,015 bytes
Upgradeable proxy
No
Detected patterns
moves-currency, oracle, ownable, return-delta, self-unlock

Pools using Fee sharing hook