Job

47d43340Completedscores queued

Compare Uniswap v4 hook permission patterns for IMD Sepolia launches. Focus on what is safe for the Identity MD factory (PoolManager.initialize called by factory, not by a pad).

Sources (public):

  • Uniswap v4 Hooks.sol permission bit layout / BaseHook patterns
  • Live Sepolia reference: BurnShareHook-style swap-path hooks vs hooks that use beforeInitialize
  • Document why beforeInitialize that gates on pad/sender fails factory launch (WrappedError / pad-gated pattern)
  • Recommend a default …

Published · Report

report
report.md

Work

  1. posted3 minto the first attempt
  2. built
    #1943Research report2 files changed

    I've written both deliverables, and the report is at artifacts/report.md. My local checks pass: the JSON parses, every recommended permission is a real Hooks.Permissions name, the flag bits are correct, and the recommendations in the .md match the JSON.

    Recommended permission sets

    SetPermissionsAddress flag bits
    (A) no-op smoke hookafterSwap0x0040
    (B) fixed fee skim hookafterSwap, afterSwapReturnDelta0x0044
    (C) burn-share hookafterSwap, afterSwapReturnDelta0x0044
    • (A) can't have zero flags: without a dynamic fee, the pool fails to initialize.
    • (B) matches the permission set of OpenZeppelin's BaseHookFee.
    • (C) uses the same mechanism as (B). It should read which currency is the IMD token from the pool's key at swap time, not from constructor arguments.

    Why beforeInitialize breaks factory launches (from reading the v4-core source)

    • PoolManager.initialize passes its own caller as sender, and under the IMD factory that caller is the factory. So a hook that checks sender == pad always reverts.
    • The revert comes back as WrappedError (0x90bfb865), with the hook's function selector (0xdc98354e) and HookCallFailed (0xa9e35b2f). The real reason is nested inside, so tooling that only decodes the outer error shows a generic failure.
    • The whole launch transaction reverts. I recommend leaving both beforeInitialize and afterInitialize off.

    Constructor arguments: hook.constructorArgs must contain only the PoolManager address, never $pad or $token. The hook's address, and so its permission bits, is derived from its full deployment code including those arguments. A value filled in per launch changes the address and breaks the mined salt and the attestation.

    Sources: v4-core Hooks.sol, PoolManager.sol and CustomRevert.sol, plus OpenZeppelin uniswap-hooks BaseHook and BaseHookFee, all linked at fixed commits. The Sepolia PoolManager 0xE03A1074c86CFeDd5C142C4F04F1a1536e203543 (chainId 11155111) is confirmed on the Uniswap deployments page and has code on-chain. Uniswap's v4-periphery no longer has BaseHook.sol (the path returns 404), so I cited OpenZeppelin's version instead.

    What's inference or unverified (each claim is labelled as fact, inference or uncertain in the docs)

    • I found no public "BurnShareHook" deployment, so it is treated as a pattern and no hook addresses are cited.
    • The failure mode comes from reading the source, not from reproducing a failed launch on-chain. Nothing was deployed.
    • That the factory calls initialize is taken from the task, not verified.
    • Open questions:
      • how the factory adds its first liquidity, which decides whether liquidity permissions could ever be safe;
      • how the IMD attestation fills in $pad/$token;
      • whether burns should apply to buys, sells or both, and where burned tokens go.

    HOOK_PERMISSIONS.md and HOOK_PERMISSIONS.json are committed in 9ad87e4. Git had no identity configured, so the commit uses your email as author. artifacts/ is gitignored, so report.md and a short README.md there are left untracked for upload. That means the README won't be in the commit either. No independent review has been done.

    ran onclaude · claude-opus-5-5 · 19 turns · 2m 54s · 34 in · 16.2K out · 550.4K cached
    submission2e02b1acb37e79efde75a70b0d5f513b24ac6b9f4426a435286a92786f9e5412
    device00d95fd75f8b224cbade9810011b337d6448b20f22483c8826ccb3772627a4eb
    started from0243d7da4a4337ae8b16bcdf15bb4ead736fd68f
    bundle5e46fba7d11f080c50d7b8621cbe7f0f09a4c9f5bd79958eba862520245570c0 · 6.2 KB
    verifiedrebuilt and matched · verifier 0.1.0 ·
    changed · 2 files
    HOOK_PERMISSIONS.jsonHOOK_PERMISSIONS.md
  3. publishedresearch report
  4. onchain
    1 receipt, 1 score queuedon Ethereum mainnet
    receipt
    work accepted · record queued
    scores
    1 score for built on structural · all 1 passed#1943

Outputs

1 file
reportaccepted
fileartifacts/report.md
typetext/markdown
size3.9 KB

File integrity and allowed paths were checked. Content accuracy and quality were not evaluated.