Likely dynamic fee hook on World Chain
Uniswap v4 Hook Contract 0x20f1ba858d14ad49e88c56b881d19770f98980c0 on World Chain · Dynamic fee
- Volume (24h)
- $0
- Value locked (TVL)
- $0
- All-time volume
- $0.56
- Pools using this hook
- 1
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 1
What it does
A dynamic-fee hook that applies an adjustable base fee to swaps and takes a protocol fee, with an owner able to change the fee and withdraw accumulated funds.
How it works step by step
- Stores a base fee value in slot 0 that determines swap pricing
- Reads the base fee in beforeSwap via baseFee() to adjust the swap fee
- Runs afterSwap accounting that takes currency through the pool manager
- Exposes setBaseFee to let a privileged caller change the fee
- Exposes withdraw to move tokens held by the hook
- Declares liquidity callbacks whose logic is not clearly decoded
- Swap behaviour
- beforeSwap reads the base fee from storage and afterSwap performs post-swap accounting that moves currency through the pool manager.
- Liquidity behaviour
- Liquidity add and remove callbacks (beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity, afterRemoveLiquidity) are present but the decoded logic does not clearly show their behaviour.
- Fee behaviour
- Fees are driven by a base fee value stored in slot 0 (readable via baseFee() and used during beforeSwap), adjustable by setBaseFee; a protocol fee constant PROTOCOL_FEE_BPS is exposed and the hook can take currency via the pool manager.
- Owner & admin controls
- The owner-style key can call setBaseFee(uint24) to change the base fee stored in slot 0, and withdraw(address,uint256) to move funds out of the hook; no pause or upgrade mechanism was identified in the decoded functions.
Enabled Uniswap v4 callbacks
beforeSwap, afterSwap
beforeSwap is used to read the base fee and likely adjust swap pricing; afterSwap is used to run post-swap accounting, which may include taking a protocol fee.
Security & trust assessment
Risk level: medium, estimated (decoded bytecode, low confidence).
Who controls it: A privileged key can set the base fee to any uint24 value through setBaseFee and can withdraw accumulated tokens through withdraw, so it can set fees arbitrarily high or drain hook-held balances.
Risk to user funds: The hook can hold tokens taken during afterSwap accounting and can move them through withdraw, and it can change swap pricing through the base fee, so user swaps could be made more expensive by a privileged caller.
Security findings
- [medium] Owner-adjustable base fee: setBaseFee(uint24) writes the fee in slot 0 with no visible bound check in the decoded selectors, so a privileged caller could set an extreme fee affecting swappers.
- [medium] Withdrawal of hook-held funds: withdraw(address,uint256) is a nonpayable function that can move tokens held by the hook, which may include protocol fees.
- [low] Hook moves currency and self-unlocks: The hook calls take and unlock on the pool manager and moves currency during callbacks, so it can hold and transfer tokens as part of swaps.
- [info] Unverified access control: Access control on setBaseFee and withdraw could not be confirmed without source or decoded caller checks.
Contract details
- Verified source
- No
- Bytecode size
- 5,938 bytes
- Upgradeable proxy
- No
- Detected patterns
- moves-currency, self-unlock
Pools using Likely dynamic fee hook
- WLD / SUSHI (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today