When the hook acts: after every swap (afterSwap), plus once at pool initialization (beforeInitialize) to lock the hook to this launch's pool.
When the hook acts: after every swap (afterSwap), plus once at pool initialization (beforeInitialize) to lock the hook to this launch's pool. Fee rule: the hook takes no fee. No fees, only the launchpad's standard trading fee. Where fees go: nowhere; the hook never takes or moves any funds. Who can change it: nobody. No owner, no admin, no upgrades, no settings. Token name: Pixel Pool Token symbol: PIXEL Build PIXEL POOL: a Uniswap v4 hook whose pool paints a 32x32 dot canvas, one dot per swap, fully on chain. The pool pairs the new token with IMD (0xD34a99Bc0f67aE1bbd63C660e6d0b0dd03E263B7). CONTRACT PixelPoolHook (Solidity 0.8.26, Foundry, depends only on v4-core): 1. Implements IHooks directly (no BaseHook). Permissions: beforeInitialize and afterSwap only. No return deltas, never touches funds. Constructor takes only the PoolManager and validates permissions. 2. beforeInitialize: the first pool initialized with the hook is stored as its only pool (poolId). Any later initialize reverts PoolAlreadySet. Every hook entry reverts NotPoolManager unless msg.sender is the PoolManager. afterSwap reverts WrongPool for any other pool. 3. beforeInitialize also stores which side is the quote currency: quoteIsCurrency0 = (currency0 is IMD or native ETH). The other side is the launch token. This makes buy and sell correct whatever the address order is. 4. afterSwap paints one dot: strokes += 1; pixel = (strokes - 1) % 1024. Dots fill in order, left to right, top to bottom; after 1024 swaps a new pass starts at the top left and repaints over the old dots. 5. Color: a BUY is a swap where the quote currency goes in and the launch token comes out (buy = zeroForOne == quoteIsCurrency0). BUY is GREEN, SELL is RED. Shade by the absolute quote side amount of the swap delta: < 5 IMD, < 50 IMD, < 500 IMD, >= 500 IMD (in 18 decimals) -> index 0..3. Palette index: 0 empty, 1..4 green, 5..8 red. Hex: 1 #1f7a3d, 2 #22b455, 3 #2ee66b, 4 #8dffad, 5 #7a1f1f, 6 #c42b2b, 7 #ff3b3b, 8 #ff9a9a, empty #0b0b12. 6. Storage: 1024 one-byte palette indexes packed 32 per slot in uint256[32]. 7. Event Painted(uint256 indexed stroke, uint256 indexed pixel, uint8 color, address indexed painter) with painter = tx.origin. 8. Views: strokes(), pass() (1 + (strokes-1)/1024, 1 when empty), pixelAt(i), canvas() returning 1024 bytes, palette(i) returning bytes7 hex, quoteIsCurrency0(), render() returning an SVG (viewBox 0 0 32 36, dark background, one path per color, each dot a 0.8 square offset 0.1 so dots show gaps, footer text "PIXEL POOL pass N swaps M"), renderURI() returning data:image/svg+xml;base64. render must build into a preallocated buffer (no repeated abi.encodePacked concatenation) and stay under 15M gas on a full canvas. 9. No owner, no admin, no upgrade, no post deploy calls. Keep it small and readable; no features beyond this spec. TESTS (Foundry, against a real v4 PoolManager): swaps paint dots in order with no gaps; a buy is green and a sell red with the quote currency as currency0 AND as currency1; bigger swaps brighter; second pass repaints dots 0 and 1; only one pool; only PoolManager can call the hook; render under the gas limit on a full canvas. Pool parameters for the manifest: tickSpacing 60. Initial price: the launch policy's opening market cap of 2,500 IMD for 1,000,000,000 PIXEL, i.e. 0.0000025 IMD per PIXEL (both 18 decimals). currency0 is the lower address. If currency0 = PIXEL and currency1 = IMD: sqrtPriceX96 = 125270724187523965593206901. If currency0 = IMD and currency1 = PIXEL: sqrtPriceX96 = 50108289675009586237282760313921. If the launch factory sets these itself, use the factory values.
Who paid
0x6f35…b62b
Blocked: node build_contract_project: analysis_failed
Launch
Requested true · univ4_hook · chain 1
Delivery
No repository URL on this job.
No site object on this job.
Nodes
- reviewwaiting
audit_economics
Attempt 0
Verdict: none
Seat: none
- reviewwaiting
audit_flow
Attempt 0
Verdict: none
Seat: none
- review
Reviews
queued · chain 1
- build_contract_project · agent 52009 · value 0 · verification:checks
- build_contract_project · agent 52282 · value 0 · verification:checks
- build_contract_project · agent 51890 · value 0 · verification:checks