Fee sharing hook on Ethereum
Uniswap v4 Hook Contract 0x160abace0f1ef2d530764db190fc6ea2a375a0cc on Ethereum · Fee sharing
- Volume (24h)
- $0
- Value locked (TVL)
- $0
- All-time volume
- $0
- Pools using this hook
- 1
- Swaps (24h)
- 1 (1 traders)
- Total swaps
- 1
What it does
This hook sets a dynamic fee on swaps, with a sell-side fee read from storage that is likely higher than the buy-side fee, and it takes its cut through return deltas, but the exact rates and admin controls cannot be confirmed without verified source.
How it works step by step
- Exposes a sell-fee and buy-fee configuration (currentSellFee, BUY_FEE_BPS, BASE_FEE_BPS, LP_FEE) that is read during swaps
- Has a shield activation step (activateShield) that records activatedAt and changes the swap-time fee state in storage slot 1
- Records an openedAt timestamp and an lpTokenId, indicating it tracks a position created through the position manager
- Uses before/after swap callbacks with return-delta permissions, so it can alter the amount a swap settles against the pool
- Implements unlockCallback with self-unlock behaviour, meaning it opens the pool manager lock itself to perform token movements
- Holds references to PROJECT, POOL, dealer and bunker addresses, suggesting a launch or project-treasury integration
- Swap behaviour
- beforeSwap and afterSwap are both enabled and both can return deltas; beforeSwap reads the sell-fee and activation state and afterSwap settles fee-related amounts, so trades on the sell direction likely pay a higher fee than buys, though the exact direction and rate cannot be confirmed from bytecode alone.
- Liquidity behaviour
- beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity and afterRemoveLiquidity are present as view-style selectors in the dispatch table, and afterInitialize/beforeInitialize are used to register the pool; liquidity operations appear to be gated or observed rather than custom-accounted, but this is not fully determined.
- Fee behaviour
- Uses dynamic fee values read from storage: a base fee (BASE_FEE_BPS), a buy fee (BUY_FEE_BPS), a current sell fee (currentSellFee) and an LP fee (LP_FEE); the fee applied depends on the swap direction and whether the shield is active, and fees are taken through return deltas in the swap callbacks.
- Owner & admin controls
- No explicit owner or admin selector was decoded; activateShield is callable by anyone in the dispatch table and sets state, and the function at 0x6a54a55d (address argument) and 0x2fa57550 (uint256,int24) are nonpayable state setters with unknown authority checks. Access control cannot be confirmed without source.
Enabled Uniswap v4 callbacks
beforeInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta
beforeInitialize: validates or sets pool parameters at pool creation. beforeSwap: reads direction and shield state to set the fee and possibly return a delta. afterSwap: settles or takes fee amounts via return delta. beforeSwapReturnDelta and afterSwapReturnDelta: allow the hook to take a share of swap amounts.
Security & trust assessment
Risk level: high, estimated (decoded bytecode, low confidence).
Who controls it: Without source it is unknown whether a privileged key can change the buy, sell or LP fee values or the project and treasury addresses; if such setters exist, the key could raise fees on traders.
Risk to user funds: The hook can take fee amounts from swaps via return deltas and moves tokens during unlock callbacks, so it can directly affect the amounts traders receive and may hold or route funds tied to the project address.
Security findings
- [medium] Return-delta fee capture on swaps: beforeSwapReturnDelta and afterSwapReturnDelta are enabled, so the hook can take a portion of every swap amount; the size depends on storage values that may be configurable.
- [medium] Unauthenticated activation: activateShield (0xb2b72111) is nonpayable and writes storage slots 0 and 1 without an apparent caller check in the decoded selectors, so if it lacks an access check anyone could trigger the activated state.
- [medium] Self-unlock token movement: unlockCallback (0x91dd7346) indicates the hook unlocks the pool manager itself to move tokens, which widens the surface for accounting errors.
- [info] Unverified source: No verified source is available, so admin roles, upgradeability and exact fee formulas could not be confirmed.
Contract details
- Verified source
- No
- Bytecode size
- 8,210 bytes
- Upgradeable proxy
- No
- Detected patterns
- return-delta, self-unlock