Dynamic fee hook on Tempo
Uniswap v4 Hook Contract 0xa0698a98771683f526f281e003af6a6a20c7e0cc on Tempo · Dynamic fee
- Volume (24h)
- $0
- Value locked (TVL)
- $0.74
- All-time volume
- $535
- Pools using this hook
- 3
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 9
What it does
A Uniswap v4 hook that applies configurable buy and sell taxes on swaps for registered pools, taking a share of trades through return deltas.
How it works step by step
- Registers pools through registerPool, storing per-pool tax config in mapping slot 2
- Applies a buy tax and a sell tax expressed in basis points on swaps
- Uses beforeSwapReturnDelta and afterSwapReturnDelta to take the tax from swap amounts
- Validates pool initialization through beforeInitialize and afterInitialize
- Exposes branding metadata such as WEBSITE, TWITTER and BRAND
- Keeps owner-controlled factory and ownership settings in storage slots 0 and 1
- Swap behaviour
- beforeSwap and afterSwap are enabled with return-delta permissions, so the hook applies a buy or sell tax (BUY_TAX_BPS / SELL_TAX_BPS) to swaps on registered pools.
- Liquidity behaviour
- beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity and afterRemoveLiquidity are exposed as view selectors, which suggests they are present in the interface but perform no state-changing logic; no liquidity callbacks are enabled in the hook permissions.
- Fee behaviour
- Charges buy and sell taxes expressed in basis points (BUY_TAX_BPS, SELL_TAX_BPS against BPS_DENOMINATOR), with per-pool tax configuration read from poolTaxConfig(bytes32). Taxes are applied through beforeSwap/afterSwap return deltas; exact tax-taking mechanics cannot be fully confirmed without source.
- Owner & admin controls
- Owner (ownable, slot 0) can transfer or renounce ownership and call setFactory(address) which writes slot 1; registerPool (slot 2 mapping) is callable via nonpayable entry point, likely restricted to the factory or owner but access check not confirmed from bytecode alone. Tax parameters BUY_TAX_BPS and SELL_TAX_BPS are exposed as view getters; no setter for them was found in the dispatch table, so they appear fixed or set per pool via poolTaxConfig.
Enabled Uniswap v4 callbacks
beforeInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta
beforeInitialize: validates or registers pool on initialization. beforeSwap: computes buy or sell tax and returns a delta to take it. afterSwap: finalizes accounting and may take a return delta after the swap. beforeSwapReturnDelta and afterSwapReturnDelta: allow the hook to take a portion of swap amounts as fees through return deltas.
Security & trust assessment
Risk level: medium, estimated (decoded bytecode, low confidence).
Who controls it: The owner can transfer ownership, renounce it, and change the factory address via setFactory. A malicious or compromised owner could redirect pool registration to a malicious factory, which could affect which pools receive the tax logic.
Risk to user funds: The hook can take a percentage of swap token amounts through return deltas on both buy and sell swaps, so traders pay the configured tax. It does not appear to hold a custodial balance of user funds, but the taken amounts flow into the hook's accounting, and the owner-controlled factory and pool registration determine which pools are affected.
Security findings
- [medium] Hook takes swap amounts via return deltas: The hook uses beforeSwapReturnDelta and afterSwapReturnDelta, so it can take a portion of every swap amount directly from pool flows; the tax rates determine the share taken.
- [medium] Owner can change factory address: setFactory(address) writes to slot 1, and the owner can change it at any time, which may alter pool registration behavior.
- [low] Single owner key controls admin functions: The owner is a single EOA-style address in slot 0 with transferOwnership and renounceOwnership, with no visible timelock or multisig requirement from the bytecode.
- [info] Tax parameters appear fixed or set per pool: Tax constants are exposed as getters and the pool tax config is read from storage; no tax setter was found, so tax values may be immutable or set only at registration.
- [info] Branding metadata present: Contract exposes WEBSITE, TWITTER and BRAND string getters, indicating a token-launch style project.
Contract details
- Verified source
- No
- Bytecode size
- 4,504 bytes
- Upgradeable proxy
- No
- Detected patterns
- ownable, return-delta
Pools using Dynamic fee hook
- pathUSD / SUPPORT (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- pathUSD / SMOKE (0.00% fee) — 24h volume $0, TVL $0.74, 0 swaps today
- pathUSD / Tcat (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today