RecursiveStrategyHook on Ethereum

Uniswap v4 Hook Contract 0x5e8a308b07194d115bcf78dac9a426c7b46ae444 on Ethereum · Fee sharing · Verified contract

Volume (24h)
$0
Value locked (TVL)
$123.49K
All-time volume
$2.84M
Pools using this hook
115
Swaps (24h)
0 (0 traders)
Total swaps
7,492

What it does

A Uniswap v4 hook for NFTStrategy ETH/token pools that charges a swap fee on each trade which starts very high on buys and decays over time, then distributes the fee between the NFT collection, PunkStrategy buy-and-burn, TokenWorks and a fee recipient.

How it works step by step

  • Restricts pools to ETH/token pairs initialized by the NFTStrategy factory and records each collection's deployment time
  • Charges a dynamic fee on swap output: buys start at 99% and drop 1% per minute to a 10% floor, sells are a flat 10%
  • Rejects exact-output swaps to keep fee accounting consistent
  • Splits collected ETH between the NFT collection (80%), PunkStrategy buy-and-burn, TokenWorks and the fee recipient
  • Grants transfer allowances to the NFTStrategy token during liquidity loading and on each swap
  • Emits HookFee and Trade events for each swap
Swap behaviour
In afterSwap the hook reverts exact-output swaps, computes a fee on the swap output (buy fee decays from 99% to 10% over time, sell fee is 10%), takes it from the pool, converts non-ETH fees to ETH through a pool swap, distributes the ETH, updates transfer allowances, and emits HookFee and Trade events.
Liquidity behaviour
afterAddLiquidity is only permitted while the factory is loading liquidity; it grants the NFTStrategy token a transfer allowance equal to the token amount added. No liquidity removal callbacks.
Fee behaviour
Buys (zeroForOne) start at a 99% fee that falls by 1% per minute after the collection's deployment time until it reaches the 10% default; sells are a flat 10%. Fees are taken from the output token in afterSwap. ETH fees are split 80% to the NFTStrategy collection, a PunkStrategy share (default 8%) sent to the factory to buy and burn PNKSTR, a TokenWorks share (default 2%) to feeAddress, and the remainder to the collection's claimed fee address or feeAddress. Non-ETH fees are swapped to ETH through the pool first.
Owner & admin controls
The NFTStrategyFactory owner can change the global feeAddress via updateFeeAddress, set per-collection fee destinations via adminUpdateFeeAddress, and change the protocol fee split (punkStrategyPercentage, tokenWorksPercentage) via updatePNKSTRSplit within the constraint that the split totals at most 10 and PunkStrategy share is nonzero. Collection owners can redirect their own collection's fee share via updateFeeAddressForCollection. No pause or upgrade mechanism was found in the hook itself.

Enabled Uniswap v4 callbacks

beforeInitialize, afterAddLiquidity, afterSwap, afterSwapReturnDelta

beforeInitialize restricts pools to ETH/token pairs created by the factory and records the collection's deployment time used for the decaying buy fee. afterAddLiquidity runs only during factory loading and raises the token's transfer allowance. afterSwap takes the dynamic fee from the swap output, forwards and distributes it, updates transfer allowances and emits events. afterSwapReturnDelta lets the hook's returned fee amount reduce the swapper's delta so the fee is settled by the hook.

Security & trust assessment

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

Who controls it: The factory owner can redirect the TokenWorks share and any collection's remainder fee destination, and can change the split between PunkStrategy, TokenWorks and the remainder. These changes apply to all future fee distributions with no timelock or cap beyond the sum-to-10 rule.

Risk to user funds: The hook takes swap output tokens as fees via return deltas and holds them transiently while converting non-ETH fees through the pool. It does not custody user principal long term. Fees are paid out in the same transaction to the collection, PunkStrategy factory, TokenWorks feeAddress and the fee recipient. Users can lose a large share of trade output to the decaying buy fee, and fee recipients can be changed by the owner.

Security findings

  • [info] Exact-output swaps are blocked: Exact-output swaps revert in afterSwap, so swaps must be exact-input.
  • [medium] Very high initial buy fee: Buy fees start at 99% and decrease 1% per minute after deployment, so early buyers pay very high fees by design. Fees are charged from swap output, which can make early buys very expensive for users.
  • [low] Owner-adjustable fee split: updatePNKSTRSplit requires the sum of percentages to be at most 10 and PunkStrategy's share to be nonzero, but the TokenWorks share may be set to 0 and the deployer remainder can absorb the rest, so the owner can route nearly all non-collection fees to the feeAddress.
  • [low] Dependency on external recipients: Fee distribution uses forceSafeTransferETH to external addresses and the factory, and afterSwap calls out to the pool manager and collection contracts, so a misbehaving recipient or the factory's swap path could block swaps; the contract is guarded by ReentrancyGuard.

Contract details

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

Pools using RecursiveStrategyHook