ERC20StrategyHook on Ethereum
Uniswap v4 Hook Contract 0x9f8f375b2d246da6be816b453f13d43d8240a444 on Ethereum · Dynamic fee · Verified contract
- Volume (24h)
- $0
- Value locked (TVL)
- $149.96K
- All-time volume
- $1.80M
- Pools using this hook
- 5
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 4,061
What it does
A Uniswap v4 hook for ERC20 strategy pools that charges a decaying buy fee and flat sell fee, then splits the fee among the strategy, a PNKSTR buy-and-burn, and a fee recipient.
How it works step by step
- Records the token deployment time at pool initialization so the buy fee can decay per minute
- Charges a buy fee starting at 99% and dropping 1% per minute to a 10% floor, with a flat 10% sell fee
- Takes the fee from swap output via afterSwapReturnDelta and emits HookFee and Trade events
- Splits each fee 80% to the strategy addFees, 10% to the PNKSTR factory, and 10% to a fee address
- Grants transfer allowances to the strategy token during liquidity seeding and swaps
- Rejects exact-output swaps and non-ETH/token pools
- Swap behaviour
- Exact-input swaps only. afterSwap takes a dynamic fee (99% decaying to 10% for buys, 10% for sells) as a return delta, converts non-ETH fees to ETH, distributes the proceeds, and sets a transfer allowance for the strategy token.
- Liquidity behaviour
- After liquidity is added during factory loading, the hook grants the strategy a transfer allowance equal to the token amount added. Otherwise adding liquidity reverts with NotNFTStrategy. No removal callbacks.
- Fee behaviour
- Swap fee is taken on the ETH-side output in afterSwap via a return delta. Buys (zeroForOne true) start at 99% and drop by 1% per minute after deployment to a floor of 10%; sells are a flat 10%. Fees are split 80% deposited to the NFT/ERC20 strategy via addFees, 10% sent to the PNKSTR factory for buy-and-burn, and 10% to the owner-configured fee address (or added to the deposit if unset). Non-ETH fee tokens are swapped to ETH through the pool first.
- Owner & admin controls
- Factory owner (via erc20StrategyFactory.owner()) can call updateFeeAddress to change the protocol fee recipient and adminUpdateFeeAddress to set per-collection fee destinations. The collection token owner can set its own fee destination via updateFeeAddressForCollection. No pause, upgrade, or fee-rate setter exists; the fee schedule is hardcoded.
Enabled Uniswap v4 callbacks
beforeInitialize, afterAddLiquidity, afterSwap, afterSwapReturnDelta
beforeInitialize: restricts pool creation to ETH/token pools launched by the factory and records the token deployment timestamp used for the decaying buy fee. afterAddLiquidity: only during factory loading, grants the strategy a transfer allowance for the seeded tokens. afterSwap: restricts to exact-input swaps, computes and takes the dynamic fee, distributes it, and emits events. afterSwapReturnDelta: lets the hook take the fee as a delta from the swap output.
Security & trust assessment
Risk level: medium (verified source, high confidence).
Who controls it: The factory owner can redirect the 10% protocol share and set a per-collection fee destination for any strategy, changing where a share of trader fees goes. The owner cannot change fee percentages or block swaps directly, and the hook has no pause or upgrade path.
Risk to user funds: Swap fees pass through the hook, which takes the fee via return delta and may hold ETH briefly during distribution. Trader funds are not otherwise held or blocked by the hook. The factory owner controls fee destinations but not pool liquidity.
Security findings
- [info] Very high initial buy fee: Buy fee starts at 99% at deployment and decays by 100 bips per minute to 10%. Early buyers face extremely high fees by design; the schedule is immutable.
- [medium] Unguarded internal swap during afterSwap: _swapToEth performs a swap in the pool with no slippage limit beyond the max price limit and is called from within afterSwap, which is reentrancy-sensitive. ReentrancyGuard is inherited but no function applies nonReentrant.
- [low] Owner-controlled fee recipients: Fee destinations (updateFeeAddress, adminUpdateFeeAddress) can be changed by the factory owner at any time, so fee routing is governed by a single privileged key.
- [info] Exact-output swaps disabled: Exact-output swaps revert with ExactOutputNotAllowed, so routers that rely on exact-output will fail for these pools.
- [low] Hook holds transient ETH balances: The contract holds ETH from fee processing and pool settlements; _processFees forwards ETH via forceSafeTransferETH, so balances are transient but present in the hook.
Contract details
- Verified source
- Yes (ERC20StrategyHook)
- Compiler
- solc 0.8.30+commit.73712a01
- Bytecode size
- 6,746 bytes
- Upgradeable proxy
- No
- Detected patterns
- dynamic-fee, moves-currency, return-delta
Pools using ERC20StrategyHook
- ETH / UPEGSTR (0.00% fee) — 24h volume $0, TVL $21.78K, 0 swaps today
- ETH / WBTCSTR (0.00% fee) — 24h volume $0, TVL $118.52K, 0 swaps today
- ETH / PEPESTR (0.00% fee) — 24h volume $0, TVL $8.30K, 0 swaps today
- ETH / BNBSTR (0.00% fee) — 24h volume $0, TVL $1.19K, 0 swaps today
- ETH / ASTEROIDSTR (0.00% fee) — 24h volume $0, TVL $172, 0 swaps today