NFTStrategyHook on HyperEVM
Uniswap v4 Hook Contract 0x317e01adf67b95a2d817c279b9f78d758fbc2444 on HyperEVM · Dynamic fee · Verified contract
- Volume (24h)
- $0
- Value locked (TVL)
- $0
- All-time volume
- $0
- Pools using this hook
- 5
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 0
What it does
Charges a flat 10% fee on every swap in an NFT strategy pool and distributes it 80% to the strategy, 10% to the launcher-or-creator recipient, and 10% to the protocol fee address.
This read was written for the hook 0xcd51…2444 on Base and reused here: the two share a code shape, so constants such as fees, owners and addresses can differ.
How it works step by step
- Takes a flat 10% fee (1000 bps) on every swap, buys and sells, with no launch-time decay.
- Restricts pools to ETH/token pairs created by the NFTStrategyFactory during launch.
- Splits each collected fee 80% to the strategy's addFees, 10% to the creator recipient (fallback feeAddress), and 10% to feeAddress.
- Converts non-native fee tokens to ETH through a swap it performs inside the PoolManager unlock.
- Defers native fee payouts as PoolManager claims when the PoolManager's native balance is too low, paying them out on a later trade or through processPendingFees.
- Grants the strategy a transfer allowance during factory liquidity loading and on swaps.
- Swap behaviour
- afterSwap rejects exact-output swaps, takes a flat 10% of the swap amount as the hook fee (converting token fees to ETH through a self-unlock swap), distributes it, and emits Trade and HookFee events. Buys and sells pay the same rate.
- Liquidity behaviour
- afterAddLiquidity only runs during factory loading (reverts otherwise) and grants the strategy a transfer allowance for the NFT-token side. No remove-liquidity callbacks.
- Fee behaviour
- Flat 10% (DEFAULT_FEE = 1000 bps) on every swap, buys and sells alike, from the pool's first block; calculateFee ignores its arguments. The fee is taken from the swap output currency in afterSwap and split 80% to the strategy via addFees, 10% to the creator recipient (or feeAddress if unset), and the remaining 10% to feeAddress. Native fees may be deferred as PoolManager claims when the PoolManager lacks native balance.
- Owner & admin controls
- Only the NFTStrategyFactory owner can change feeAddress via updateFeeAddress (paid protocol share, 2300 gas stipend). The factory itself (not an owner) can set a strategy's creator fee recipient via adminUpdateFeeAddress at launch. The current creator-share recipient can move it via updateFeeAddressForCollection. No pause function, no upgrade proxy, and the fee rate is a hardcoded constant (10%) with no setter in the hook.
Enabled Uniswap v4 callbacks
beforeInitialize, afterAddLiquidity, afterSwap, afterSwapReturnDelta
beforeInitialize restricts pool creation to ETH/token pools launched by the factory and records launch time and block. afterAddLiquidity grants transfer allowance during liquidity loading. afterSwap takes the 10% fee, splits and distributes it, and emits trade events. afterSwapReturnDelta lets afterSwap return the fee amount as a delta the hook keeps.
Security & trust assessment
Risk level: medium (verified source, high confidence).
Who controls it: The factory owner can redirect protocol share (feeAddress) at any time, but cannot change the fee rate or the creator recipient. The factory can set creator recipients at launch. Whoever holds the creator recipient role can move that revenue stream to any non-zero address.
Risk to user funds: The hook holds no user funds long term; it takes a 10% fee from each swap in-flight and forwards it to the strategy, creator and fee address. Deferred native fees are held as PoolManager ERC-6909 claims backed by the swapper's payment, and are paid out on later trades or via processPendingFees. The hook cannot block swaps through a pause, but a broken or reverting strategy addFees would revert swaps.
Security findings
- [info] Exact-output swaps are blocked: Exact-output swaps are rejected in afterSwap, so swaps must specify the input amount; this is a deliberate trading restriction.
- [info] Hook takes a fixed 10% fee on all swaps: afterSwap takes a fee from every swap and returns it as a delta; the hook pulls tokens from the PoolManager and swaps non-native fees to ETH via a self-unlock, so swappers pay the 10% fee on every trade.
- [low] Fee payouts use a fixed gas stipend: Fee recipients are paid with a 2300 gas stipend via forceSafeTransferETH; a recipient that cannot receive ETH within that stipend is force-sent, so payouts are not blocked by recipient logic.
- [medium] Factory owner can redirect protocol fee share: The owner can repoint feeAddress to any non-zero address, redirecting the 10% protocol share of all future swap fees.
Contract details
- Verified source
- Yes (NFTStrategyHook)
- Compiler
- solc 0.8.30+commit.73712a01
- Bytecode size
- 7,947 bytes
- Upgradeable proxy
- No
- Detected patterns
- dynamic-fee, moves-currency, return-delta, self-unlock