Dynamic fee hook on Optimism
Uniswap v4 Hook Contract 0x82bc2fe8dc72adc4af0601efa87ece5ae4f5c088 on Optimism · Dynamic fee
- Volume (24h)
- $0
- Value locked (TVL)
- $0
- All-time volume
- $0
- Pools using this hook
- 14
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 61
What it does
A pausable Uniswap v4 hook that runs before swaps and can take a per-pool fee through a return delta, with the owner able to set pool fees and pause swaps.
How it works step by step
- Runs a beforeSwap callback on every swap in pools that use this hook and can return a before-swap delta, which lets the hook alter the amounts settled for the swap.
- Stores a per-pool fee keyed by pool id, set by the owner through setPoolFee(bytes32,uint24).
- Keeps a registry of pools (mapping from pool id to pool key data, a pool count and an allPools list) and checks whether a pool is registered.
- Has a paused flag set by setPaused(bool) that the swap path reads, so the owner can halt swaps.
- Includes an execute(address,uint256,bytes) function and a payable-style call helper, which suggest it can make arbitrary external calls, likely for routing or fee handling through the pool manager or WETH.
- Exposes owner, poolManager, weth and version getters along with fee constants such as BPS and DEFAULT_TICK_SPACING.
- Swap behaviour
- beforeSwap is nonpayable and reads the paused flag and the per-pool registration and fee mappings, then can return a before-swap delta that adjusts the swap amounts. Specific fee arithmetic cannot be confirmed without source.
- Liquidity behaviour
- The hook exposes before and after add and remove liquidity selectors, but the permissions list enables only beforeSwap and beforeSwapReturnDelta, so the pool manager will not call these.
- Fee behaviour
- The owner sets a per-pool fee via setPoolFee; the fee is applied in the swap path and the return delta can take part of the swap amount. The exact fee destination cannot be determined from the decoded bytecode.
- Owner & admin controls
- The owner (storage slot 0) can transfer ownership via setOwner, pause and unpause swaps via setPaused, set any pool's fee via setPoolFee, and call execute to make arbitrary external calls. No upgrade proxy pattern was identified.
Enabled Uniswap v4 callbacks
beforeSwap, beforeSwapReturnDelta
beforeSwap: inspects pause state and pool registration and sets the per-pool fee on each swap. beforeSwapReturnDelta: lets the hook return a delta that changes the amounts settled for the swap, which is how it can take a fee from the swap.
Security & trust assessment
Risk level: high, estimated (decoded bytecode, low confidence).
Who controls it: A single owner key controls swap pausing, per-pool fees, ownership transfer and arbitrary calls from the hook, so compromise of that key could halt trading, set confiscatory fees or move assets the hook holds.
Risk to user funds: The hook can alter swap settlement amounts via the return delta and can block swaps through the pause flag. It may also hold tokens or approvals that the owner's execute function can move. Actual custody depends on implementation details not visible without source.
Security findings
- [medium] Owner can pause all swaps: setPaused(bool) sets a flag that beforeSwap reads, so the owner can halt trading in every pool that uses this hook.
- [high] Owner can set arbitrary pool fees: setPoolFee(bytes32,uint24) lets the owner set any fee on any registered pool with no visible cap in the decoded code; a very high fee could drain value from traders through the return delta.
- [high] Arbitrary external call capability: The execute(address,uint256,bytes) selector lets the owner make arbitrary calls from the hook contract, which could move tokens or approvals held by the hook.
- [medium] Ownership transfer without two-step confirmation: setOwner(address) writes the owner slot directly; a mistaken or malicious transfer takes effect immediately.
- [medium] Return delta can take user value: With beforeSwapReturnDelta enabled, the hook can modify the amounts a swapper settles, so the hook's logic directly affects user funds.
Contract details
- Verified source
- No
- Bytecode size
- 20,805 bytes
- Upgradeable proxy
- No
- Detected patterns
- pausable, return-delta
Pools using Dynamic fee hook
- ETH / HOP-LP-ETH (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- ETH / hETH (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- hUSDT / USDT (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- hSNX / SNX (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- HOP-LP-USDC / USDC (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- sUSD / HOP-LP-sUSD (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- hDAI / DAI (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- hsUSD / sUSD (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- USDT / HOP-LP-USDT (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- HOP-LP-DAI / DAI (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- SNX / HOP-LP-SNX (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- hUSDC / USDC (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- HOP-LP-rETH / rETH (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- hrETH / rETH (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today