Skip to content

feat: deploy-uni-hook skill (Uniswap v4 hook generate+audit+simulate+deploy) - #805

Merged
aaronjmars merged 3 commits into
mainfrom
feat/deploy-uni-hook
Jul 31, 2026
Merged

feat: deploy-uni-hook skill (Uniswap v4 hook generate+audit+simulate+deploy)#805
aaronjmars merged 3 commits into
mainfrom
feat/deploy-uni-hook

Conversation

@aaronjmars

@aaronjmars aaronjmars commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

What

Ports the deploy-uni-hook skill (proven on the aeon-uni instance) into canon, plus the dashboard support it needs. Turns a one-line brief into a live Uniswap v4 hook + test pool on any v4 chain.

  • Two build modes: pre-audited templates (dynamic / noop / skim) or a from-scratch freeform hook. Hook flags are auto-derived from the generated code and CREATE2-mined (HookMiner) so the address carries the right permission bits.
  • Deploy is gated: static audit -> dangerous-pattern scan -> behavioral forge test -> fork simulation. A failure at any gate blocks the broadcast.
  • Safe by default: every run is a dry-run (generate, compile, mine, simulate, never broadcast) unless the brief is prefixed arm:.

Mainnet triple-lock

A mainnet broadcast needs all three, or it degrades with a named code:

  1. arm: on the brief, and
  2. an explicit chain:<mainnet> (never defaulted), and
  3. the operator-level HOOK_MAINNET_OK=1 secret.

Testnet (base-sepolia default) needs only arm:. Also enforced pre-broadcast: a funding floor, a MAX_GAS_GWEI ceiling, and a spend cap.

Other hardening (all live-validated on aeon-uni)

  • Authenticated Alchemy RPC (falls back to public; RPC_URL override), host-only redaction in logs.
  • Deploy receipt: address, decoded hook flags, explorer link, tx hashes.
  • Explorer auto-verify with retry/backoff to survive the CREATE2 factory-tx indexing race (immediate post-broadcast verify 404s on mainnet until the internal creation tx is indexed).
  • Idempotency: computes the canonical flag-matching CREATE2 address and short-circuits ALREADY_DEPLOYED instead of mining a fresh one.

Dashboard

  • Catalog the two new HOOK_* secrets on the Access Keys vault (HOOK_DEPLOYER_PRIVATE_KEY burner, HOOK_MAINNET_OK lock), each with a key glyph so they don't render as a grey initials badge.
  • New per-skill run-input hint (varHint): parsed from each SKILL.md var: and shown as help text under the Skill-settings input. General mechanism, no per-slug special-casing; empty for skills that don't set it.

Config

  • enabled: false, workflow_dispatch only, Opus-pinned (claude-opus-5) - freeform hook generation is the hard part.
  • requires: [HOOK_DEPLOYER_PRIVATE_KEY?, ALCHEMY_API_KEY?, ETHERSCAN_API_KEY?, HOOK_MAINNET_OK?] - all optional; a dry-run needs none.

Runtime wiring (mirrors the vuln-scanner staging pattern)

The skill's ./hook-deploy.sh exits 3 unless a pre-run step stages the toolchain - the claude -p sandbox denies in-run toolchain installs, and an in-run PATH export doesn't survive Claude's per-call fresh shells. So, exactly like vuln-scanner:

  • scripts/stage-deploy-uni-hook.sh - a workflow step (full capability) that installs Foundry, builds a v4 project (v4-core + v4-periphery + templates) at $HOOKBUILD_DIR, appends ~/.foundry/bin to $GITHUB_PATH, and copies the key-safe ./hook-deploy.sh + chains.tsv to the repo root. Self-guards to the skill; best-effort (never fails the run).
  • aeon.yml workflow - a Stage deploy-uni-hook toolchain step gated on steps.skill.outputs.name == 'deploy-uni-hook', right after the vuln-scanner staging step.
  • scripts/skill_mode.sh - grants the write tier the forge / cast / ./hook-deploy.sh bare-names so the sandbox doesn't deny the skill's own tool use.
  • .gitignore - the repo-root run-time copies (/hook-deploy.sh, /chains.tsv), which are copies of the templates, never sources.

Validated locally

Canon Actions are disabled, so every relevant CI gate was run by hand and is green:

  • ci-apps: dashboard typecheck clean, test 176/176, build clean, apps/cli typecheck clean.
  • ci-skills-json / ci-packs-json: regenerated via bin/generate-*-json (66 skills; crypto pack 13 -> 14).
  • ci-readme-catalog: OK (summary + full-catalog tables + counts synced).
  • ci-skill-category: OK (category: crypto).
  • ci-okf: OK (108 concepts conform).
  • ci-tests: validate-config 7/7; config invariants CLEAN.
  • ci-skill-packs: OK (community registry unaffected).
  • ci-tests (workflow + scripts): test_skill_mode.sh ALL PASS, test_skill_requires.sh PASS, actionlint clean on aeon.yml, bash -n clean on both scripts.

Notes for the operator

  • The deployer key is a throwaway burner - it only ever holds a small gas float; never fund it with real value or reuse it.
  • To run on canon you would set the secrets on the dashboard and flip enabled: true. Mainnet stays locked until HOOK_MAINNET_OK=1 is set explicitly.

Port the deploy-uni-hook skill from the aeon-uni instance. Turns a one-line
brief into a live Uniswap v4 hook on any v4 chain: pre-audited templates or a
freeform hook (flags auto-derived), gated by a static audit, a dangerous-pattern
scan, a behavioral forge test, and a fork simulation. Dry-run by default; an
explicit arm: broadcasts. Testnet-only unless arm: + explicit chain: +
HOOK_MAINNET_OK=1 (triple lock). Authenticated Alchemy RPC, deploy receipt,
explorer auto-verify with CREATE2-indexing retry, and idempotency detection.

Dashboard: catalog the two new HOOK_* secrets (burner key + mainnet lock) with
key glyphs, and add a general per-skill run-input hint (varHint) parsed from
each SKILL.md var: and surfaced under the Skill-settings input.
Regenerate skills.json + packs.json (66 skills; crypto pack 13 to 14) and sync
the README catalog tables and counts. Separate commit per the convention that
per-skill sha/updated are git-log-derived.
…rant

The skill's ./hook-deploy.sh exits 3 unless a pre-run step stages Foundry and a
built v4 project - the claude -p sandbox denies in-run toolchain installs and an
in-run PATH export doesn't survive Claude's per-call shells. Mirror the
vuln-scanner staging pattern:

- scripts/stage-deploy-uni-hook.sh: install Foundry, build a v4 project (v4-core
  + v4-periphery + templates) at $HOOKBUILD_DIR, append ~/.foundry/bin to the
  PATH file, and copy the key-safe ./hook-deploy.sh + chains.tsv to the repo
  root. Self-guards to the skill; best-effort (never fails the run).
- aeon.yml workflow: a "Stage deploy-uni-hook toolchain" step gated on the skill
  name, right after the vuln-scanner staging step.
- skill_mode.sh: grant the write tier the forge / cast / ./hook-deploy.sh
  bare-names so the sandbox doesn't deny the skill's own tool use.
- .gitignore: the repo-root run-time copies (/hook-deploy.sh, /chains.tsv).
@aaronjmars
aaronjmars merged commit 2fdca13 into main Jul 31, 2026
11 checks passed
@aaronjmars
aaronjmars deleted the feat/deploy-uni-hook branch July 31, 2026 13:01
aaronjmars added a commit that referenced this pull request Jul 31, 2026
Propagate the deploy-uni-hook skill (#805) to the aeon repo docs, and correct
the pre-existing skill-count / pack-count drift the catalog change surfaces.

- CHANGELOG.md: new [Unreleased] entry for deploy-uni-hook (catalog 65 -> 66).
- docs/skill-packs.md: total 65 -> 66; Crypto pack 13 -> 14; also Dev 8 -> 10
  (a stale count from #802 that left the table summing to 63, not its header).
- docs/aeon-setup.md, docs/examples/README.md: "65 skills" -> "66 skills".

#804 (the prior batch's own aeon-side docs sync) carries no new capability and
is not narrated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant