HopforgeFeeHook on MegaETH

Uniswap v4 Hook Contract 0x165193115b3f03086e25fd88e560ca6b787580cc on MegaETH · Fee sharing · Verified contract

Volume (24h)
$0
Value locked (TVL)
$0
All-time volume
$0
Pools using this hook
1
Swaps (24h)
0 (0 traders)
Total swaps
0

What it does

A fee-sharing hook that charges a 1.5% tax on HOPFORGE pool swaps and distributes it among the referrer, token creator, token holders and platform treasury.

How it works step by step

  • Charges 1.5% of the ETH side of every registered-pool swap using return deltas and ERC6909 mints
  • Locks a first referrer per EOA (tx.origin) on their first swap and pays that referrer 10% of fees
  • Accrues 20% to the token creator, 30% to the holder reflection pool and the remainder to the platform treasury
  • Lets anyone trigger holder harvests after a 5-block delay since the last swap, pushing ETH into the token's notifyReward
  • Allows claims to be paused by the factory and re-credits bounced reward ETH to the platform bucket
Swap behaviour
On every swap in a registered pool, the hook takes 1.5% of the ETH leg as a fee. Exact-input buys are charged in beforeSwap, while exact-output buys and sells are charged in afterSwap, and the fee is credited to accrual balances.
Liquidity behaviour
No liquidity callbacks.
Fee behaviour
Charges a flat 1.5% (FEE_BPS 150) on swap ETH legs via return deltas: exact-input buys in beforeSwap, exact-output buys and sells in afterSwap. The fee is split 10% referrer (if locked), 20% token creator, 30% token holder reflection pool and 40% platform treasury, with any unassigned referrer share falling to the platform.
Owner & admin controls
Factory-only controls: the factory can register pools, change the platform treasury address and pause or unpause all claim functions (setClaimsPaused). No owner, upgrade proxy or parameter setter for the 1.5% fee or the 10/20/30/40 split, which are constants.

Enabled Uniswap v4 callbacks

beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeSwap: charges the fee on exact-input buys, locks referrer and mints ERC6909 claims. afterSwap: charges the fee on exact-output buys and on sells and returns the unspecified-currency delta. beforeSwapReturnDelta and afterSwapReturnDelta: allow the hook to take a share of the swap amounts as the fee.

Security & trust assessment

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

Who controls it: The factory can pause all claims, which blocks referrers, creators, holder rewards and the platform from withdrawing accrued ETH, and it can redirect future platform fees by changing the treasury address. Neither power can alter swaps or seize existing credits.

Risk to user funds: The hook holds accrued ETH only as ERC6909 credits in the PoolManager and takes ETH from swaps to fund those credits. Users' swap funds are taxed by 1.5% but not held beyond the swap. The factory pause can temporarily lock accrued payouts, and the hook can also block swaps only through the external token notifyReward path in the holder branch.

Security findings

  • [info] Mandatory 1.5% swap tax: The hook takes its fee in the ETH leg of every registered pool swap through return deltas and ERC6909 mints. It is an embedded tax on trading.
  • [medium] Factory can freeze all claims: setClaimsPaused is callable by the factory and blocks claimReferrer, claimCreator, harvestHolders and claimPlatform. Accrued balances stay locked until unpaused.
  • [low] External call inside unlock callback: The unlockCallback Holders branch sends ETH to the token's notifyReward, which is an external call into a token contract, inside the PoolManager unlock. A malicious or reverting token could block harvests, though the bounced amount is re-credited.
  • [low] Referrer attribution depends on tx.origin: Referrer is locked from tx.origin, so a contract wallet or relayer cannot earn referrals, and a user can clear and re-lock their own referrer. Attribution is tied to the EOA that pays gas.
  • [low] Pool identity assumptions: Pool registration and claim accounting depend on a token address and a hardcoded fee and tick spacing reconstructed in _idOfToken. Pools registered with different parameters would not be claimable through the token-keyed API.

Contract details

Verified source
Yes (HopforgeFeeHook)
Compiler
solc 0.8.26+commit.8a97fa7a
Bytecode size
9,219 bytes
Upgradeable proxy
No
Detected patterns
moves-currency, return-delta, rewards, self-unlock, tax

Pools using HopforgeFeeHook