Fee sharing hook on Ethereum
Uniswap v4 Hook Contract 0x04eeb40f679dab34f8e675aa8012b9851ca6e0cc on Ethereum · Fee sharing
- Volume (24h)
- $0
- Value locked (TVL)
- $0
- All-time volume
- $0
- Pools using this hook
- 1
- Swaps (24h)
- 159 (76 traders)
- Total swaps
- 159
What it does
This hook takes buy and sell swap fees on a token-wrapped Uniswap v4 pool and distributes accrued rewards to holders, with fee rates set by fixed basis-point constants.
How it works step by step
- Acts as an ERC20-style token wrapper around a Uniswap v4 pool, with its own balances, allowances and total supply in storage
- Takes swap fees through beforeSwapReturnDelta and afterSwapReturnDelta, with separate buy and sell fee bps constants and running totals of buy and sell fees
- Accrues rewards per holder via reward weight, reward debt and eligible supply, with claim and pending reward views
- Maintains a reward exempt list and a social address that is settable by the owner
- Includes a ghost-related function group (ghost, ghostVault, GHOST_AFTER, carry) that appears to move or redistribute balances, but its exact logic cannot be confirmed without source
- Uses an ownable two-step ownership pattern (transferOwnership, acceptOwnership, renounceOwnership)
- Swap behaviour
- beforeSwap and afterSwap run on every swap, and both have return-delta permissions, so the hook can take or credit a fee on swaps; from the selectors, buy and sell sides are distinguished with separate fee constants (BUY_FEE_BPS and SELL_FEE_BPS), though the exact direction mapping cannot be confirmed from bytecode alone.
- Liquidity behaviour
- beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity and afterRemoveLiquidity selectors exist in the decoded interface but the hook does not advertise liquidity permissions, so these are likely unused stubs; beforeDonate and afterDonate are similarly present in the ABI without matching permissions.
- Fee behaviour
- Hook takes swap fees via return deltas, with separate buy and sell fee rates in basis points (BUY_FEE_BPS, SELL_FEE_BPS) and tracked totals (totalBuyFees, totalSellFees); the pool also has a static LP_FEE. Exact rates cannot be read from the decoded input.
- Owner & admin controls
- Owner (Ownable, two-step transfer) can set the social address via setSocial and can set reward exemptions via setRewardExempt; owner can renounce or transfer ownership. No pause or upgrade mechanism is visible in the decoded selectors, and the contract does not appear to be a proxy.
Enabled Uniswap v4 callbacks
beforeInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta
beforeInitialize sets up the pool (poolInitialized, poolId, POOL_INITIALIZER guard); beforeSwap and afterSwap apply and account for fees; beforeSwapReturnDelta and afterSwapReturnDelta let the hook take a share of swap amounts; afterInitialize is present for initialization bookkeeping.
Security & trust assessment
Risk level: high, estimated (decoded bytecode, low confidence).
Who controls it: The owner key can change the social address, manage reward exemptions and transfer or renounce ownership; the owner could alter reward accounting and reward eligibility for holders.
Risk to user funds: The hook can take swap fees through return deltas and move balances through ghost-related functions, so user and pool funds are exposed to fee capture and balance redistribution.
Security findings
- [medium] Return-delta fee capture: beforeSwapReturnDelta and afterSwapReturnDelta permissions let the hook alter swap amounts and take tokens from swappers, so fee terms directly affect trader outcomes.
- [medium] Owner-set social address and reward exemptions: The owner can change the social address and reward exempt list via setSocial and setRewardExempt, which can redirect or alter reward distribution without user consent.
- [medium] Ghost and carry mechanics unclear: The ghost, ghostVault, GHOST_AFTER and carry functions move or redistribute balances, and their conditions cannot be verified without source, so user funds may be affected in ways that are hard to audit.
- [info] Unverified source: No verified source is available, so all findings are based on decoded selectors and storage layout rather than reviewed code.
Contract details
- Verified source
- No
- Bytecode size
- 10,753 bytes
- Upgradeable proxy
- No
- Detected patterns
- erc20, liquidity-management, moves-currency, ownable, return-delta, rewards