WrappedHook
EthereumWrappedHook is a Uniswap v4 hook on Ethereum. Live for 1 day. Still in use: 4 trades in the last week, and 2 new pools this week.
- Contract name
- WrappedHook
How this hook works
Wrapped token tradingThis hook makes a wrapped copy of any token that already trades against ETH, and gives it a Uniswap v4 pool. Every trade is routed into the original token's real pool, and a 1% to 10% fee is taken in ETH: 30% to the hook developer and the rest to the pool creator and, optionally, holders.
Trades ride the original pool
The wrapped pool holds no liquidity of its own. When traders buy, the hook buys the original token in its real pool (Uniswap v2, v3 or v4) and gives out wrapped tokens; when they sell, it does the reverse.
The code that does this (beforeSwap):function beforeSwap(address, PoolKey calldata key, SwapParams calldata p, bytes calldata) external override nonReentrant returns (bytes4, BeforeSwapDelta, uint24) { if (msg.sender != address(poolManager)) revert NotPoolManager(); // Only serve the canonical wX pool: WETH=currency0, a registered wX=currency1. (Anyone can // init a pool bearing this hook; without this, a rogue key would pull WETH float against a // non-wX currency0 — it reverts on the delta today, but assert it explicitly.) _validatePool(key); address wX = Currency.unwrap(key.currency1); WrapInfo storage w = infoOf[wX]; if (!w.active) revert NotActive(); if (p.amountSpecified >= 0) revert ExactOutputUnsupported(); // exact-input only in V1 uint256 amt = uint256(-p.amountSpecified); Currency hxc = Currency.wrap(wX); int128 dSpecified; int128 dUnspecified; if (p.zeroForOne) { // BUY: WETH in (amt), wX out. Take the WETH, skim fee, route the rest into X's pool for // xOut of X (locked as backing), then deliver xOut wX — reusing reserve claims first. wethCurrency.take(poolManager, address(this), amt, false); uint256 fee = _accrueFee(w, wX, amt); uint256 xOut = _routeToX(w, amt - fee); uint256 res = reserveOf[wX]; uint256 fromReserve = res >= xOut ? xOut : res; // …Fee split on every trade
The pool creator picks a fee between 1% and 10%, taken in ETH. 30% of it goes to the hook developer's treasury, part can go to wrapped token holders as an ETH reward, and the rest goes to the pool creator.
The code that does this (_accrueFee):function _accrueFee(WrapInfo storage w, address wX, uint256 wethAmount) internal returns (uint256 total) { _flush(wX); // distribute the PREVIOUS trade's reflection over the now-settled holder base total = (wethAmount * w.feeBps) / 10_000; if (total == 0) return 0; uint256 protocolShare = (total * PROTOCOL_SHARE_BPS) / 10_000; if (protocolShare > total) protocolShare = total; uint256 reflectionShare = (wethAmount * w.reflectionBps) / 10_000; if (protocolShare + reflectionShare > total) reflectionShare = total - protocolShare; uint256 creatorShare = total - protocolShare - reflectionShare; feesOwed[treasury] += protocolShare; feesOwed[w.feeRecipient] += creatorShare; if (reflectionShare > 0) pendingReflection[wX] += reflectionShare; }Fully backed and redeemable
Each wrapped token is backed one to one by the original token held in the hook, and holders can swap back to the original at any time, even after the wrapper is turned off. Wrapping and unwrapping also pay the same fee.
The code that does this (unwrap):function unwrap(address wX, uint256 amount) external nonReentrant { address original = infoOf[wX].original; if (original == address(0)) revert NotActive(); WrappedToken(wX).burn(msg.sender, amount); uint256 fee = _entryExitFee(infoOf[wX], wX, amount); IERC20(original).safeTransfer(msg.sender, amount - fee); emit Unwrapped(wX, msg.sender, amount - fee); }Safety check before listing
To create a wrapper, the pool creator must lend some ETH for a test buy and sell of the original token. If less than 80% comes back (a sign of a scam token or a heavy tax), creation fails.
The code that does this (createWrapper):function createWrapper( address original, Version version, uint24 v3Fee, PoolKey calldata v4Key, address feeRecipient, uint16 feeBps, uint16 reflectionBps, uint256 probeWeth ) external nonReentrant returns (address wX) { require(feeRecipient != address(0) && original != address(0), "zero recipient or token"); if (!permissionless && msg.sender != owner()) revert NotAuthorized(); if (feeBps < MIN_TAX_BPS || feeBps > MAX_TAX_BPS) revert FeeTooHigh(); // Direct reflections must fit inside the creator-controlled 70% of fees. if (uint256(reflectionBps) * 10_000 > uint256(feeBps) * (10_000 - PROTOCOL_SHARE_BPS)) revert FeeTooHigh(); if (wrapperOf[original] != address(0)) revert AlreadyWrapped(); if (version == Version.NONE) revert NoOriginalPool(); if (probeWeth == 0) revert ProbeRequired(); bool origWethIs0; if (version == Version.V4) { // Only hookless original v4 pools: routing/probe swap this pool, so a non-zero hook would // be attacker-controlled code we'd call (reentrancy / arbitrary-hook vector). if (address(v4Key.hooks) != address(0)) revert BadV4Key(); address c0 = Currency.unwrap(v4Key.currency0); address c1 = Currency.unwrap(v4Key.currency1); if (c0 == WETH && c1 == original) origWethIs0 = true; else if (c0 == original && c1 == WETH) origWethIs0 = false; else revert BadV4Key(); } // …
Who controls it: The hook developer can change the treasury address and choose whether anyone or only they can create wrappers. The hook developer or the original token's owner can turn a wrapper off, which stops trading and new wrapping but never stops unwrapping. Each wrapper's fee is fixed when it is created. The code cannot be upgraded.
Based on the hook’s published code.What do these labels mean?
Safety report
Before you build on it. Automated checks, not an auditdisableWrapperconvertOriginalFeesSwapRouter02: nothing there can change how trades go.What it can do
Its code executes inside each trade in pools that use it.
It can take or add tokens during a swap. Fees, burns and custom curves work this way, and so do scams.
It runs when a pool is created, often to lock in that pool’s settings.
Hook history
Across all its pools, the hook handled trade money (this hook holds the pool’s funds): $10.15.
- Handled trade money (this hook holds the pool’s funds) 2 times, worth $10.15
Latest transactions
- 0xb8d45f08…ff29fa block 26,422,132 · 0.00550 WETH
- 0x06b756c4…6be28f block 26,422,107 · 0.000100 WETH
- Routed a trade through the original pool and took its fee 4 times
Latest transactions
- 0x058e46b1…f716da block 26,422,180
- 0xb8d45f08…ff29fa block 26,422,132
- 0x06b756c4…6be28f block 26,422,107 · 2 times in this transaction
- Created a wrapped token and its pool 2 times
Latest transactions
- 0x4da9c99b…8622e0 block 26,422,747
- 0x6be5a08d…50003f block 26,422,104
- Wrapped original tokens 1 time
- Swapped wrapped tokens back to the original 1 time
Counted from what the hook recorded on-chain across all its pools, for every action in its published code, plus token transfers in and out of it. Dollar values count the amounts paid in ETH, stablecoins, BNB and BTC, at today’s prices.