InitialBuyNFTStrategyHook on Ethereum
Uniswap v4 Hook Contract 0x337eee273d26bcfbbb772ea582331b1dfc882444 on Ethereum · Dynamic fee · Verified contract
- Volume (24h)
- $2.01K
- Value locked (TVL)
- $43.77K
- All-time volume
- $672.10K
- Pools using this hook
- 17
- Swaps (24h)
- 9 (7 traders)
- Total swaps
- 2,649
What it does
A fee hook for NFTStrategy ETH/NFT-token pools that charges a decaying buy fee (starting at 99% and dropping one point per block to 10%) and a flat 10% sell fee, then splits the collected fees between the strategy, PunkStrategy/burn and a fee address; the initial factory purchase is exempt from the buy fee.
How it works step by step
- Records the pool's initialization block for each strategy collection in beforeInitialize and only accepts pools that use native ETH as currency0 while the factory is loading liquidity.
- Computes the buy fee as 9900 bps minus 100 bps per block since initialization, floored at the 1000 bps default; sells always pay 1000 bps.
- In afterSwap, takes the fee from the swap output via manager.take and reverts on exact-output swaps.
- Splits each ETH fee 80% to the collection's strategy via addFees, 10% to the NFT strategy factory (to buy and burn PNKSTR), and 10% (or the collection's claimed address) to a fee recipient.
- For non-ETH fee currencies, swaps the fee token back to ETH inside the hook before distributing it.
- The initial-buy subclass waives the buy fee only when the factory itself is the sender, the swap is an exact-input ETH-to-token buy, and the strategy matches the factory's initialBuyStrategy.
- Swap behaviour
- afterSwap rejects exact-output swaps, computes the swap fee from the decay schedule (or zero for the exempt initial buy), takes that amount of the output currency into the hook, updates the strategy's transfer allowance and emits Trade and HookFee events. Returns the fee as an afterSwap delta so the pool pays it out to the hook.
- Liquidity behaviour
- afterAddLiquidity only does work while the factory is loading liquidity: it increases the strategy token's transfer allowance by the token amount added and returns a zero delta. Outside loading it reverts. No remove-liquidity callbacks.
- Fee behaviour
- Buy fee decays from 99% at pool initialization by 1 percentage point per block down to 10%; sell fee is a fixed 10%. Fees are taken from the swap output and distributed 80/10/10 between the NFT strategy, the factory (PNKSTR buy-and-burn) and a fee address, with an optional per-collection override set by the collection owner or the factory owner.
- Owner & admin controls
- The NFT strategy factory owner can change the global feeAddress and set or override fee recipients for any collection via adminUpdateFeeAddress. The owner of the NFT collection can set its own fee recipient via updateFeeAddressForCollection. The fee rates and decay constants are hardcoded and cannot be changed. No pause or upgrade mechanism appears in the verified source; the factory's own owner powers (e.g. setting loadingLiquidity, which gates pool initialization and liquidity addition) are external to this contract.
Enabled Uniswap v4 callbacks
beforeInitialize, afterAddLiquidity, afterSwap, afterSwapReturnDelta
beforeInitialize records deployment time and block and validates the pool currency pair and factory state; afterAddLiquidity grants transfer allowance during initial liquidity loading; afterSwap takes the swap fee, distributes it and enforces no exact-output swaps; afterSwapReturnDelta lets the hook claim the fee amount from the swap delta.
Security & trust assessment
Risk level: medium (verified source, high confidence).
Who controls it: The NFT strategy factory owner can redirect fee destinations for the global feeAddress and for any collection and controls the loadingLiquidity flag that gates pool initialization and initial liquidity, so the owner can effectively decide where a share of fees goes and whether pools can be created or funded.
Risk to user funds: The hook holds the fee amounts briefly during swaps before forwarding them, and it can also hold tokens it converts to ETH. It does not custody pool liquidity directly. Users' swap outputs are reduced by the fee, and the hook can block exact-output swaps and pool initialization or liquidity addition indirectly via the factory flag.
Security findings
- [medium] Fee recipient redirection by admin: adminUpdateFeeAddress and updateFeeAddress let the NFT strategy factory owner redirect the 10% fee share and any per-collection fee address to arbitrary destinations without a timelock or cap.
- [info] Hook takes swap output via return delta: afterSwapReturnDelta is enabled and the hook calls manager.take to remove the fee from the pool, so every swap's output is partially diverted to the hook and then distributed.
- [medium] Trading gated by factory state: _beforeInitialize and _afterAddLiquidity revert unless nftStrategyFactory.loadingLiquidity() is true, so pool creation and liquidity addition depend entirely on the factory owner's flag.
- [low] Fees forwarded with forceSafeTransferETH: Fee payouts use forceSafeTransferETH, so ETH is delivered even to contracts that reject transfers; a misconfigured recipient would receive funds it cannot later handle.
- [low] Exempt initial buy relies on factory address: The fee exemption checks sender == factory and the factory's initialBuyStrategy() return value; it is only as trustworthy as the factory's view function.
Contract details
- Verified source
- Yes (InitialBuyNFTStrategyHook)
- Compiler
- solc 0.8.30+commit.73712a01
- Bytecode size
- 7,213 bytes
- Upgradeable proxy
- No
- Detected patterns
- dynamic-fee, moves-currency, return-delta
Pools using InitialBuyNFTStrategyHook
- ETH / AZUKISTR (0.00% fee) — 24h volume $810, TVL $1.09K, 2 swaps today
- ETH / AEONSTR (0.00% fee) — 24h volume $612, TVL $606, 1 swaps today
- ETH / LPUDGYSTR (0.00% fee) — 24h volume $460, TVL $301, 2 swaps today
- ETH / MILADYSTR (0.00% fee) — 24h volume $103, TVL $16.61K, 1 swaps today
- ETH / V1PNKSTR (0.00% fee) — 24h volume $22, TVL $4.39K, 1 swaps today
- ETH / MAYCSTR (0.00% fee) — 24h volume $3.21, TVL $1.96K, 2 swaps today
- ETH / BITMONSTR (0.00% fee) — 24h volume $0, TVL $6.98K, 0 swaps today
- ETH / CLAUSTR (0.00% fee) — 24h volume $0, TVL $3.10K, 0 swaps today
- ETH / CREDOSTR (0.00% fee) — 24h volume $0, TVL $893, 0 swaps today
- ETH / GLYPHSTR (0.00% fee) — 24h volume $0, TVL $3.21K, 0 swaps today
- ETH / FWSTR (0.00% fee) — 24h volume $0, TVL $88, 0 swaps today
- ETH / CLONESTR (0.00% fee) — 24h volume $0, TVL $2.65K, 0 swaps today
- ETH / OPEPENSTR (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- ETH / WPUNKSTR (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- ETH / VEESTR (0.00% fee) — 24h volume $0, TVL $624, 0 swaps today
- ETH / REMIOSTR (0.00% fee) — 24h volume $0, TVL $650, 0 swaps today
- ETH / FWIENDSTR (0.00% fee) — 24h volume $0, TVL $606, 0 swaps today