Fee sharing hook on Avalanche
Uniswap v4 Hook Contract 0xc4b059cecec513fb353e6f6feb172d587cb90088 on Avalanche · Fee sharing
- Volume (24h)
- $0
- Value locked (TVL)
- $0
- All-time volume
- $11
- Pools using this hook
- 1
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 52
What it does
A Uniswap v4 hook on Avalanche that takes a fee on swaps through beforeSwap return deltas, accrues it to an owner-withdrawable balance, and lets the owner pause swaps.
How it works step by step
- Runs beforeSwap on each swap and can revert with SwapsDisabled when the owner has paused trading.
- Takes a fee expressed in basis points (HOOK_FEE_BPS) from swap flows using beforeSwapReturnDelta.
- Accumulates collected fees in per-token balances readable via feeBalance(address).
- Lets the owner withdraw accrued fees through withdrawFees.
- Holds an owner-set executor address and an ownable access model.
- Exposes pool manager, WAVAX and native AVAX references used when moving currency.
- Swap behaviour
- beforeSwap runs on every swap, may enforce the swapsEnabled flag, and uses return deltas to collect a hook fee from the swap currency flows.
- Liquidity behaviour
- No liquidity callbacks are enabled in the hook permissions; beforeAddLiquidity and beforeRemoveLiquidity selectors exist in the ABI but are not wired to pool operations.
- Fee behaviour
- A HOOK_FEE_BPS parameter exists and fees accrue into per-token balances readable via feeBalance(address); the hook takes a cut of swap flows through beforeSwap return deltas, with the exact formula not determinable from selectors alone.
- Owner & admin controls
- Owner (storage slot 0) can transfer ownership, set an executor address, toggle swapsEnabled, and withdraw accumulated hook fees via withdrawFees(address,address,uint256). Owner-only functions reject non-owners with NotOwner.
Enabled Uniswap v4 callbacks
beforeSwap, beforeSwapReturnDelta
beforeSwap is used to inspect swap parameters and possibly take a fee; beforeSwapReturnDelta lets the hook alter the swap's net currency deltas and move currency through the pool manager (take/settle calls appear in the bytecode).
Security & trust assessment
Risk level: medium, estimated (decoded bytecode, low confidence).
Who controls it: The owner can set an executor, disable swaps entirely via setSwapsEnabled(false), and withdraw collected fees, so a compromised or malicious owner key could halt trading and drain accrued hook fees.
Risk to user funds: The hook can take currency during swaps via return deltas and holds accrued fee balances that the owner can withdraw, and the owner can block swaps, so user swap flows and pool-related funds are exposed to the owner's actions.
Security findings
- [medium] Owner can disable swaps: setSwapsEnabled(bool) lets the owner halt all swaps through the hook by reverting with SwapsDisabled, which can block trading in the pool.
- [medium] Owner can withdraw accrued fees: withdrawFees(address,address,uint256) allows the owner to withdraw accumulated fee balances tracked in storage; no timelock or cap is visible in the bytecode.
- [medium] Return delta permission moves currency: beforeSwapReturnDelta is enabled, so the hook can take or settle currency during swaps, adding a trust surface beyond a passive hook.
- [low] Privileged executor role: An executor address is settable by the owner and appears to gate some call path; its privileges are not fully determinable without source.
- [info] Single-step ownership transfer: Ownership can be transferred with a single call to transferOwnership, with no two-step acceptance visible in the selectors.
Contract details
- Verified source
- No
- Bytecode size
- 6,643 bytes
- Upgradeable proxy
- No
- Detected patterns
- moves-currency, ownable, return-delta
Pools using Fee sharing hook
- AVAX / FOLKS (1.00% fee) — 24h volume $0, TVL $0, 0 swaps today