NFTStrategyRangeHook on Ethereum

Uniswap v4 Hook Contract 0x5d8a61fa2ced43eeabffc00c85f705e3e08c28c4 on Ethereum · Dynamic fee · Verified contract

Volume (24h)
$0
Value locked (TVL)
$49.63K
All-time volume
$11.77M
Pools using this hook
1
Swaps (24h)
0 (0 traders)
Total swaps
11,342

What it does

A Uniswap v4 hook for NFTStrategyRange pools that charges a dynamic fee on every swap, starting very high for buys and decaying to 10%, and routes that fee into the NFT strategy, PNKSTR buy-and-burn and designated fee addresses.

How it works step by step

  • Charges a time-decaying buy fee starting at 95% and dropping 1% every 5 blocks down to a 10% floor
  • Charges a flat 10% fee on sells
  • Takes the fee from the pool manager and returns it as an afterSwap return delta
  • Sends 80% of each fee into the NFTStrategy collection via addFees
  • Sends 10% to the NFTStrategyFactory for PNKSTR buy-and-burn and 10% to the owner fee address
  • Restricts liquidity addition to the factory's launch flow and sets a midSwap flag when router restriction is enabled
Swap behaviour
On every swap afterSwap computes the fee on the output-side amount using the current block-based buy fee or the flat 10% sell fee, takes that amount from the pool manager, distributes it (converting non-ETH fees to ETH via an internal swap), emits events, and returns the fee as a return delta so the swapper receives less.
Liquidity behaviour
beforeAddLiquidity only checks that the factory's loadingLiquidity flag is set, reverting with NotNFTStrategy otherwise, so liquidity can only be added during the factory's controlled launch flow. No remove-liquidity or donate callbacks.
Fee behaviour
Fee is charged in afterSwap on the output-side amount of every swap. For buys (zeroForOne) the fee starts at 95% of the swap amount and decreases by 1% every 5 blocks after deployment until it reaches the 10% default; sells are always charged the 10% default. The fee amount is taken from the pool manager, split 80% into the NFTStrategy collection via addFees, 10% sent to the NFTStrategyFactory for PNKSTR buy-and-burn, and 10% to feeAddress or the per-collection claimed address.
Owner & admin controls
The NFTStrategyFactory owner (or the factory itself) can call adminUpdateFeeAddress to redirect the owner-share of fees per collection, and the factory owner can call updateFeeAddress to change the global feeAddress. No pause or upgrade mechanism is present; the fee rate is fixed in code and is not adjustable by admin.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeAddLiquidity, beforeSwap, afterSwap, afterSwapReturnDelta

beforeInitialize: records the deployment block for the collection and requires the factory to be loading liquidity. beforeAddLiquidity: restricts liquidity additions to the factory launch flow. beforeSwap: sets the midSwap flag on the NFTStrategy when routerRestrict is enabled. afterSwap: computes and takes the dynamic fee, distributes it, swaps non-ETH fees to ETH through the pool, and emits Trade and HookFee events. afterSwapReturnDelta: returns the fee amount so the pool manager deducts it from the swapper's delta.

Security & trust assessment

Risk level: medium (verified source, high confidence).

Who controls it: The factory owner can change the global feeAddress and, through adminUpdateFeeAddress, redirect the owner share of fees for any collection to an arbitrary address. The factory owner also controls routerRestrict and the loadingLiquidity flow that gates liquidity provision, so a privileged key can influence which routers may trade and who can seed liquidity.

Risk to user funds: The hook takes the fee from every swap via afterSwapReturnDelta and holds ETH transiently while distributing it, but it does not custody user principal beyond the swap. Fees are routed to the NFTStrategy collection, the factory and configured fee addresses, so users pay between 10% and 95% of buy output depending on timing, and privileged addresses can redirect the owner share.

Security findings

  • [medium] Extreme initial buy fee: Buy fees start at 95% of the swap amount on deployment and decay 1% per 5 blocks, so early buyers receive very little output; this is an intentional, disclosed-in-code design but materially harms first-block buyers.
  • [medium] Privileged fee redirection: updateFeeAddress and adminUpdateFeeAddress let the factory owner or factory redirect fee shares to any address without timelock or limit, so fee proceeds depend on the trust placed in that key.
  • [low] Unprotected fee conversion swap: Fees for non-ETH-denominated pools are swapped back to ETH through a nested pool.manager.swap with price limit bounds and no slippage check on the result, so the conversion can be sandwiched or return less ETH than expected.
  • [info] ETH distribution to configured recipients: _processFees forwards ETH to the NFTStrategy, factory and fee recipients with forceSafeTransferETH and the hook has a receive function; a reverting or malicious recipient cannot block swaps because forceSafeTransferETH falls back to forced transfer, but the recipient configuration is fully trusted.
  • [info] midSwap flag coupling: The hook sets midSwap on the NFTStrategy during swaps when routerRestrict is on, and the afterSwap path resets it only on the success path; a revert in afterSwap rolls back the whole swap so the flag cannot stick.

Contract details

Verified source
Yes (NFTStrategyRangeHook)
Compiler
solc 0.8.30+commit.73712a01
Bytecode size
6,537 bytes
Upgradeable proxy
No
Detected patterns
dynamic-fee, moves-currency, return-delta

Pools using NFTStrategyRangeHook