PerpetualHook on Ethereum
Uniswap v4 Hook Contract 0x9dedda61bf433d3a630c8c0cdb1438dc58676444 on Ethereum · Dynamic fee · Verified contract
- Volume (24h)
- $286
- Value locked (TVL)
- $18.09K
- All-time volume
- $393.82K
- Pools using this hook
- 2
- Swaps (24h)
- 1 (1 traders)
- Total swaps
- 717
What it does
Charges a decaying buy fee on ETH-to-token swaps that starts near 95% at launch and falls to 10%, then splits the collected fee between the token's PerpetualMeme contract and a fee address.
How it works step by step
- Initializes only factory-launched ETH/token pools and records each token's deployment block
- Applies a buy fee that decays from 95% to 10% over time based on blocks since deployment
- Charges a flat 10% fee on sells
- Takes the fee from swap output via manager.take and afterSwap return delta
- Splits collected ETH fees 80% to the PerpetualMeme contract and 20% to feeAddress
- Grants PerpetualMeme transfer allowances on swaps and factory-loaded liquidity additions
- Swap behaviour
- On afterSwap, exact-output swaps revert; otherwise the hook computes a fee (time-decayed for buys, flat 10% for sells), takes it from pool accounting, returns it as a delta, converts non-ETH fees to ETH via a nested swap, and forwards 80% of the ETH to PerpetualMeme.addFees and 20% to feeAddress, emitting HookFee and Trade events.
- Liquidity behaviour
- afterAddLiquidity is only permitted while the factory is loading liquidity (reverts otherwise); it increases the PerpetualMeme transfer allowance by the token1 amount added. No remove-liquidity callbacks.
- Fee behaviour
- Swap fee is a time-decaying buy fee: when zeroForOne is true it starts at 95% (9500 bips) at deployment block and drops by 20 bips per 5 blocks until it reaches 10% (1000 bips); sells always pay the flat 10% default. The fee is taken from the output as an afterSwap return delta, then 80% of the ETH value goes to the PerpetualMeme contract via addFees and 20% goes to feeAddress.
- Owner & admin controls
- Only the PerpetualFactory owner (queried via perpetualFactory.owner()) can call updateFeeAddress, which redirects 20% of hook fees to a new address. No pause or upgrade mechanism is present in the hook; the hook is immutable with fixed factory and pool manager references.
Enabled Uniswap v4 callbacks
beforeInitialize, afterAddLiquidity, afterSwap, afterSwapReturnDelta
beforeInitialize: restricts pool creation to ETH/token pools launched by the factory and records the deployment block per token. afterAddLiquidity: admits factory-initiated liquidity and grants a transfer allowance on the PerpetualMeme token. afterSwap: enforces no exact-output swaps, computes and takes the dynamic fee via manager.take, routes fees to PerpetualMeme and feeAddress, and emits trade events. afterSwapReturnDelta: lets the hook keep the fee amount from the swap's output delta.
Security & trust assessment
Risk level: medium (verified source, high confidence).
Who controls it: The factory owner can redirect 20% of all hook fee revenue by changing feeAddress at any time. The owner cannot change fee parameters, pause swaps, or move pool funds directly through this hook.
Risk to user funds: The hook can take fee amounts from swap outputs and forwards 80% to the PerpetualMeme contract and 20% to feeAddress. It does not hold user principal beyond transient swap accounting, and it cannot block swaps except through the explicit exact-output restriction and the factory-only liquidity gate.
Security findings
- [info] Hook takes tokens via return delta: afterSwap calls manager.take and returns a positive fee as a return delta, so the hook holds fee tokens transiently and can pull tokens from pool accounting.
- [low] Nested swap for token-denominated fees: For non-ETH fee currencies the hook performs a swap back to ETH inside afterSwap, which adds execution and pricing dependency on the pool.
- [low] Transfer allowance coupling: PerpetualMeme.increaseTransferAllowance is granted from the hook on every swap and liquidity add, so transfer restrictions depend on correct accounting; mistakes there could affect the token rather than the hook itself.
- [medium] Instant fee-recipient change by owner: updateFeeAddress has no timelock or event emission, so a compromised factory owner could redirect the 20% share immediately.
- [info] Fixed fee decay schedule: Fee decay is block-based and deterministic (95% to 10% over roughly 0.6 hours per 100 bips step cycle of 5 blocks each); no owner override exists for the fee curve.
Contract details
- Verified source
- Yes (PerpetualHook)
- Compiler
- solc 0.8.30+commit.73712a01
- Bytecode size
- 5,941 bytes
- Upgradeable proxy
- No
- Detected patterns
- dynamic-fee, moves-currency, return-delta
Pools using PerpetualHook
- ETH / PEPEp (0.00% fee) — 24h volume $286, TVL $15.61K, 1 swaps today
- ETH / SPXp (0.00% fee) — 24h volume $0, TVL $2.48K, 0 swaps today