Fee sharing hook on Ethereum
Uniswap v4 Hook Contract 0xf17dacf779da2a578c2c6578b258e2bdf634a888 on Ethereum · Fee sharing
- Volume (24h)
- $0
- Value locked (TVL)
- $0
- All-time volume
- $0
- Pools using this hook
- 1
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 0
What it does
A Uniswap v4 hook that runs custom logic on pool initialization, liquidity additions and swaps, with a token jar and an adjustable fee, though the exact behaviour cannot be fully verified without source.
This read was written for the hook 0xf10b…a888 on Ethereum and reused here: the two share a code shape, so constants such as fees, owners and addresses can differ.
How it works step by step
- Runs custom setup when a pool is initialized (beforeInitialize)
- Gates liquidity additions through beforeAddLiquidity
- Executes custom logic on every swap and returns a delta that can adjust settlement
- Reads a fee-like uint24 parameter from storage for swap pricing
- Forwards collected value to a token jar via pollTokenJar
- Exposes quote and admin views, and has an expiryBlock
- Swap behaviour
- beforeSwap is a nonpayable function that runs custom logic and uses beforeSwapReturnDelta to return a delta, so the hook can take or supply currency during swaps. A quote function also exists for estimating outputs.
- Liquidity behaviour
- beforeAddLiquidity is exposed, and it is a view function that appears to revert or gate liquidity, consistent with LiquidityNotAllowed() appearing in the bytecode. The liquidity callbacks in the permission set are beforeAddLiquidity only; removal callbacks are not enabled.
- Fee behaviour
- A uint24 fee-like value is stored in slot 0 and written by selector c5cda8d2, and quote and beforeSwap read it; the hook appears to set or read a custom fee, and a token jar is referenced for collected fees. The exact fee formula cannot be determined without source.
- Owner & admin controls
- Storage slot 0 holds an address that is read and written by pollTokenJar (3f7d1179); this is likely the token jar or fee recipient rather than an owner. A uint24 at slot 0 offset 20 is written by selector c5cda8d2 (likely a fee setter), and an admin() view (f851a440) exists, suggesting an admin role. Whether these are gated by an admin check cannot be confirmed from decoded bytecode, though OnlyAdmin() and UnauthorizedCaller() errors appear in the bytecode, which suggests access control exists.
Enabled Uniswap v4 callbacks
beforeInitialize, beforeAddLiquidity, beforeSwap, beforeSwapReturnDelta
beforeInitialize: sets up pool state at initialization, reading and writing storage slots 2 and 3. beforeAddLiquidity: gates liquidity additions. beforeSwap: runs custom swap logic, returning a delta so the hook can take or supply currency. beforeSwapReturnDelta: lets beforeSwap return a delta that adjusts the swap amounts, which means the hook can settle or take tokens during swaps.
Security & trust assessment
Risk level: medium, estimated (decoded bytecode, low confidence).
Who controls it: An admin key can likely change the uint24 fee parameter, reroute collected fees through pollTokenJar, and potentially influence the expiryBlock and pool logic. Without source, the exact scope of privileged actions is unknown.
Risk to user funds: Because beforeSwapReturnDelta is enabled and the hook calls take, settle and transfer-related selectors, the hook can hold and move pool currency during swaps. An admin-controlled fee and token jar could redirect a portion of swap value, and an expiry block could affect whether swaps keep functioning.
Security findings
- [medium] Hook takes currency via return delta: beforeSwapReturnDelta is enabled and the bytecode references take, settle and transfer selectors, so the hook can move currency during swaps.
- [medium] Admin-adjustable fee parameter: A uint24 fee value in storage is written by an admin-looking selector, so a privileged key may be able to change swap fees.
- [low] Expiry and single-admin control: An expiryBlock view and an admin() role suggest the hook may stop working after a set block or be controlled by a single key.
- [info] Unverified source: The hook is not verified, so all findings rest on decoded selectors and storage layout rather than readable code.
Contract details
- Verified source
- No
- Bytecode size
- 12,342 bytes
- Upgradeable proxy
- No
- Detected patterns
- moves-currency, return-delta
Pools using Fee sharing hook
- WBTC / LBTC (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today