UnimonHook on Unichain

Uniswap v4 Hook Contract 0x7f7d7e4a9d4da8997730997983c5ca64846868c0 on Unichain · Access control · Verified contract

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

What it does

UnimonHook is a Uniswap v4 hook on a native ETH pool that mints Unimon NFTs to swappers as a game reward, one per 0.0111 ETH of swap input, while restricting swaps to verified routers.

How it works step by step

  • Stores the pool key once on initialization and rejects a second initialization.
  • Allows only one initial liquidity addition, then blocks further adds.
  • Requires swaps to come through an owner-verified router, with a default router whitelisted at deploy.
  • Requires the input currency to be native ETH on every swap.
  • Mints one Unimon NFT per 0.0111 ETH of swap input, capped at 100 per swap and 10000 total supply.
  • Lets NFT holders hatch a Unimon by burning UMN energy tokens for a random level from 1 to 10.
Swap behaviour
beforeSwap requires a verified router and native ETH input, and afterSwap mints NFTs to the swapper based on the ETH amount (max 100 per swap, up to 10000 total). Swap pricing and deltas are unchanged.
Liquidity behaviour
beforeAddLiquidity only allows the first liquidity addition: it sets initialLiquidityAdded to true and reverts on any later call. No remove-liquidity callback is enabled.
Fee behaviour
Uses the pool's static fee. The hook returns zero fee and zero swap delta on every swap.
Owner & admin controls
Owner (Ownable) can toggle verifiedRouters, set baseURI, enable or disable hatching, set the UnimonEnergy token address, and transfer or renounce ownership. The owner does not directly move pool funds.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeAddLiquidity, beforeSwap, afterSwap

beforeInitialize records the pool key once; beforeAddLiquidity enforces a one-time initial liquidity gate; beforeSwap requires the caller to be a verified router and requires native ETH as the input currency and stores the true sender; afterSwap mints NFTs to the swapper proportional to the ETH input amount (1 NFT per 0.0111 ETH, max 100 per swap).

Security & trust assessment

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

Who controls it: The owner can add or remove verified routers, which controls which routers can swap through the pool at all, and can change the metadata base URI and game toggles. The owner cannot change fees or drain pool liquidity through the hook.

Risk to user funds: The hook does not take or return swap deltas and does not custody pool tokens, so it does not hold or move LP or trader funds. Users' ETH sent into swaps goes to the pool as normal. Risk is limited to swap access control and the owner's ability to block routers.

Security findings

  • [medium] Owner-controlled router allowlist gates swaps: beforeSwap reverts for any sender not in verifiedRouters, so the owner can block all swaps from unverified routers by toggling the list.
  • [info] Native-input-only swap restriction: Swaps are only accepted when the input currency is native ETH; ERC20-to-ETH direction swaps of the other side revert, which restricts the pool to one swap direction.
  • [low] Mint recipient depends on trusted router callback: The swap sender is recovered via IMsgSender(sender).msgSender() and keyed by block.timestamp, amount and sender. The mapping is trusted only for verified routers, but the key is predictable within a block, so the mint recipient relies on router honesty.
  • [info] One-time liquidity gate: Only one initial liquidity addition is allowed. The hook does not restrict who adds it, so the first LP to add liquidity determines the pool's starting state.
  • [low] Owner-replaceable energy token dependency: setUnimonEnergy lets the owner point the game token to any contract, and hatch burns tokens through unimonEnergy.burn, which relies on that address being a trusted game manager; a malicious energy contract could affect hatching but not pool funds.

Contract details

Verified source
Yes (UnimonHook)
Compiler
solc 0.8.26+commit.8a97fa7a
Bytecode size
24,466 bytes
Upgradeable proxy
No
Detected patterns
erc20, ownable

Pools using UnimonHook