Custom pricing hook on Ethereum
Uniswap v4 Hook Contract 0x7058b6f04d3c34e7eea111890eeb8d0a0d32a0cc on Ethereum · Custom pricing
- Volume (24h)
- $56.93K
- Value locked (TVL)
- $3.58K
- All-time volume
- $56.93K
- Pools using this hook
- 1
- Swaps (24h)
- 414 (166 traders)
- Total swaps
- 414
What it does
This hook taxes swaps through return-delta fees, charging buy and sell rates that are configured separately with extra limits on early trades, and it distributes collected ETH to holders through claims and escrow, though the exact direction-specific rates could not be fully confirmed from bytecode.
How it works step by step
- Charges a buy and sell fee through beforeSwap and afterSwap, using before-swap return deltas to take currency from the swap
- Tracks per-address buy and sell limits and wallet caps, with a time-limited protection window tracked per address
- Accrues an ETH escrow and a fee-share accumulator that is distributed to holders through claim functions
- Runs an eating/resolution cycle (eatCommitBlock, resolveEats, pendingEats) that burns or redistributes accumulated balances over time
- Integrates an NFT and a tokenURI renderer, plus a token transfer hook (beforeTokenTransfer, afterTokenTransfer) for mirroring and exclusion logic
- Gates pool initialization to a canonical pool manager and a single initializer, with an initialized flag
- Swap behaviour
- beforeSwap and afterSwap run on every swap and both have return-delta permissions, so the hook can take a share of the input or output currency as a fee. Buy and sell fees are configured separately (creatorBuyFeeBps, creatorSellFeeBps, DEV_TAX_BPS, PLATFORM_FEE_BPS), and early-window trades are subject to a protection tax and buyer limits. Exact direction-specific rates could not be fully confirmed from decoded bytecode alone.
- Liquidity behaviour
- beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity and afterRemoveLiquidity are present as selectors, but liquidity hook permissions are not enabled on the address, so these are likely invoked only through the pool manager path or not at all.
- Fee behaviour
- Hook fees come from configured buy and sell basis points plus a dev tax and platform fee, applied via return deltas on swaps. The dispatcher also exposes lpFee and maxModuleLpFeePips, and beforeSwap can return a dynamic fee override, so the pool's effective LP fee may be dynamic. A portion of collected fees is directed to a fee vault, treasury, platform recipient and an ETH escrow.
- Owner & admin controls
- A capAdmin role and an owner-like NotOwner check exist. Functions include removeMaxTx, removeMaxWallet and a method that can enable or update a module reference, plus a renderer and fee vault setter path. An initializer address is recorded. No pause or upgrade mechanism was clearly identified, but the admin set is not fully mapped.
Enabled Uniswap v4 callbacks
beforeInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta
beforeInitialize: validates the pool key and initializes hook state. beforeSwap: computes buy or sell tax, enforces limits and can return a fee override and a currency delta. afterSwap: settles the taxed amount and updates volume and fee accounting. beforeSwapReturnDelta and afterSwapReturnDelta: allow the hook to take currency from swaps as fees.
Security & trust assessment
Risk level: high, estimated (decoded bytecode, low confidence).
Who controls it: A capAdmin or owner key can remove limits, change fee-related parameters, and set module, renderer and fee vault addresses, which could redirect fee flows or change taxes for all traders.
Risk to user funds: The hook takes currency from swaps and holds an ETH escrow balance, so user funds pass through the hook contract. Trades can be taxed or restricted by the configured limits, and accumulated balances are moved by claim and eat functions.
Security findings
- [high] Hook takes currency via return deltas: beforeSwapReturnDelta and afterSwapReturnDelta are enabled, so the hook extracts a share of every swap. Tax magnitude depends on configurable basis points that the owner or capAdmin may be able to change.
- [medium] Admin-adjustable trading limits and caps: removeMaxTx and removeMaxWallet, together with maxTxOn and maxWalletOn flags, let privileged roles alter buyer limits and wallet caps, which can block or restrict specific wallets from trading.
- [medium] Module and renderer delegation: The hook references an external module (module, moduleCodeHash, maxModuleLpFeePips) and a renderer. A changed module could alter fee or accounting behavior if the module is replaceable.
- [medium] Escrow and burn logic over pooled ETH: ETH escrow, eat cycles and burn calls (gameBurn, totalBurned) move accumulated balances. Correctness depends on the eat/resolve sequencing and was not verified from source.
- [info] Unverified source: No verified source is available, so function semantics and admin role boundaries are inferred from selectors and storage layout only.
Contract details
- Verified source
- No
- Bytecode size
- 23,964 bytes
- Upgradeable proxy
- No
- Detected patterns
- dynamic-fee, liquidity-management, moves-currency, return-delta, tax
Pools using Custom pricing hook
- ETH / DRAW (0.00% fee) — 24h volume $56.93K, TVL $3.58K, 414 swaps today