Fee sharing hook on Ethereum
Uniswap v4 Hook Contract 0xa8efc30e6ea815deaf0a02ff9993496b4430c088 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
- 1
What it does
A swap-fee hook that charges a basis-point fee on trades into the pool, accrues it on the contract, and lets the owner withdraw it, with an on/off switch for swaps.
How it works step by step
- Gates swaps behind a swapsEnabled flag that the owner can toggle
- Takes a basis-point fee (HOOK_FEE_BPS) on swaps through beforeSwap return deltas
- Accrues collected fees per token in an internal feeBalance mapping
- Lets the owner withdraw accrued fees with withdrawFees
- Maintains an executor role set by the owner
- Uses the owner for administrative control with transferable ownership
- Swap behaviour
- beforeSwap reverts when swapsEnabled is false and otherwise runs custom logic that takes a basis-point hook fee through return deltas; swap-side details are inferred from the decoded selectors because no source is available.
- Liquidity behaviour
- No liquidity callbacks.
- Fee behaviour
- Contains a HOOK_FEE_BPS getter, a BPS_DENOMINATOR, a feeBalance(address) getter and a withdrawFees function, which suggests the hook takes a basis-point fee on swaps, accrues it per token, and lets the owner withdraw it. The exact fee calculation cannot be confirmed without source.
- Owner & admin controls
- Owner (storage slot 0) can transfer ownership, set the executor address (slot 1), toggle swapsEnabled (slot 1, offset 23), set a value stored in slot 1 at offset 20 (int24, likely the pool's tick or a tick-related parameter) via 0x5a50ba9a, and withdraw accumulated fees via withdrawFees. The executor address appears to be a second privileged role gated by the setExecutor and swap paths.
Enabled Uniswap v4 callbacks
beforeSwap, beforeSwapReturnDelta
beforeSwap: runs custom logic before each swap and can gate it via swapsEnabled. beforeSwapReturnDelta: lets the hook return a delta that changes the swap amounts, which is how it likely takes its fee from the swap.
Security & trust assessment
Risk level: medium, estimated (decoded bytecode, low confidence).
Who controls it: The owner can disable swaps entirely, withdraw any accrued hook fees, change the executor, and transfer ownership. A compromised owner key could drain accumulated fee balances or halt trading in the pool.
Risk to user funds: The hook takes a fee from swap amounts via return deltas and holds accrued fee balances, which the owner can withdraw. It can also block swaps through swapsEnabled, but the bytecode does not show it holding LP principal beyond the fee accounting.
Security findings
- [medium] Owner can halt swaps: swapsEnabled is a boolean the owner can flip, and beforeSwap reverts with SwapsDisabled when it is false, so the owner can freeze trading.
- [medium] Owner can withdraw accrued fees: withdrawFees(address,address,uint256) is callable by the owner and moves fee balances out of the hook, so accrued fees depend on the owner key's security.
- [info] Hook moves currency during swaps: beforeSwapReturnDelta lets the hook alter the amounts settled in a swap. The hook takes currency through take() calls, so it does hold and move user swap value, which is inherent to its fee design.
- [info] Executor role of unclear scope: The executor role is set by the owner and appears to have privileged access in the swap path. Its exact permissions cannot be confirmed without source.
Contract details
- Verified source
- No
- Bytecode size
- 6,547 bytes
- Upgradeable proxy
- No
- Detected patterns
- moves-currency, ownable, return-delta
Pools using Fee sharing hook
- ETH / BICO (1.00% fee) — 24h volume $0, TVL $0, 0 swaps today