Quick Start (choose the deployment path)
- Determine target chain and deployment mode:
- Foundry scripts (EOA / operator):
script/DeployInfrastructure.s.sol and script/deploy.sh
- ERC-4337 / AA (smart account):
script/deploy-with-aa.ts (and frontend/src/pages/DeployVault.tsx for the UI flow)
- Multi-phase orchestrator (Base code-deposit limits):
contracts/helpers/batchers/CreatorVaultDeployer.sol (Phase 1–2; Phase 3 is strategies)
- “Infra v2” deterministic deployment helpers:
./script/deploy.sh infra-v2 → script/DeployBaseMainnetDeployer.s.sol
- Post-deploy batchers (strategies + activation):
contracts/helpers/batchers/StrategyDeploymentBatcher.sol, contracts/helpers/batchers/VaultActivationBatcher.sol
- Always do a read-only preflight first (RPC connectivity, owner/deployer identity, “already deployed?” checks).
- Never paste private keys or full
.env contents in output.
System Model (what “deploy a vault” means here)
There are multiple layers:
- Core infra (one-time, typically Base):
- Registry + factory + shared services (see
script/DeployInfrastructure.s.sol)
- Per-creator vault infra (per creator coin):
CreatorOVault (ERC-4626 vault)
CreatorOVaultWrapper
CreatorShareOFT (wrapped shares; tradable token)
CreatorGaugeController
CCALaunchStrategy (auction / launch mechanism)
CreatorOracle
- Optional post-deploy:
- Strategies (Charm/Ajna) via batchers
- Payout routing (e.g.,
PayoutRouter)
Required Inputs
- Chain/network + RPC URL
- Creator coin address (the underlying creator token)
- Owner model:
- Creator-owned (creator EOA/smart wallet) vs protocol-owned (multisig/treasury)
- If deploying via scripts (Foundry):
- Required env vars (names only):
PRIVATE_KEY, RPC_URL (or BASE_RPC_URL for v2 deployer), ETHERSCAN_API_KEY/BaseScan key
- For per-creator deploy:
CREATOR_FACTORY
- If deploying via AA script (
deploy-with-aa.ts):
- Required env vars (names only):
SMART_ACCOUNT, PRIVATE_KEY, CREATOR_FACTORY
- Optional:
BASE_RPC_URL, BUNDLER_URL, PAYMASTER_URL, PAYOUT_ROUTER_FACTORY
- If deploying via frontend UI (
DeployVault.tsx):
- Privy must be enabled + configured (client
VITE_PRIVY_*, server PRIVY_*), and the user must sign in with Privy or connect an external wallet that can operate the canonical smart wallet.
Repo Map (where to look / entrypoints)
- Foundry deployment:
script/DeployInfrastructure.s.sol (core infra + DeployCreatorVault per creator)
script/deploy.sh (wrapper for infra/vault/AA deploy)
- “Infra v2” deployer (bytecode store + deployer + multi-phase deploy contract):
script/DeployBaseMainnetDeployer.s.sol (used by ./script/deploy.sh infra-v2)
- AA deployment (CLI):
script/deploy-with-aa.ts (UserOp deployment via bundler/paymaster)
- AA deployment (frontend UI):
frontend/src/pages/DeployVault.tsx (Privy + smart wallet 1-click deploy; can also operate via external owner wallet in some flows)
- Multi-phase deploy orchestrator:
contracts/helpers/batchers/CreatorVaultDeployer.sol (Phase 1: vault/wrapper/shareOFT; Phase 2: gauge/cca/oracle + deposit/auction; Phase 3: strategies)
- Strategy deployment:
contracts/helpers/batchers/StrategyDeploymentBatcher.sol (Charm + optional Ajna strategies)
- Activation / launch:
contracts/helpers/batchers/VaultActivationBatcher.sol (activates vault + can trigger launch)
- Payout routing:
contracts/helpers/routers/PayoutRouter.sol
- “Required approvals” reminder:
docs/deployment/REQUIRED_APPROVALS_CHECKLIST.md
docs/deployment/PRE_LAUNCH_VERIFICATION.md
docs/deployment/CCA_DEPLOYMENT_VERIFICATION.md
Read-only Preflight (do before any state changes)
Use templates like:
# Ensure RPC works and you’re on the expected chain
cast chain-id --rpc-url $RPC_URL
# Check whether a creator coin is already registered/deployed.
#
# IMPORTANT: This repo has had multiple infra deployments over time. For existing creator coins, you may need to
# check the *legacy* registry/factory (from env/config) rather than the latest defaults.
# 1) Registry is the source of truth for what the app should use.
cast call --rpc-url $RPC_URL $CREATOR_REGISTRY "getVaultForToken(address)(address)" $CREATOR_COIN
# 2) Factory is useful to see “which stack was registered by which infra deploy”.
cast call --rpc-url $RPC_URL $CREATOR_FACTORY "isDeployed(address)(bool)" $CREATOR_COIN
cast call --rpc-url $RPC_URL $CREATOR_FACTORY "getDeployment(address)((address,address,address,address,address,address,address,address,uint256,bool))" $CREATOR_COIN
If you’re using the multi-phase deployer, prefer checking deterministic addresses first (computeAddress/create2) rather than “guessing”.
Deployment Workflows
A) Foundry: deploy core infra (one-time)
Preferred wrapper:
./script/deploy.sh infrastructure
Or directly:
forge script script/DeployInfrastructure.s.sol:DeployInfrastructure --rpc-url $RPC_URL --broadcast --verify -vvvv
Outputs/verification:
- Foundry broadcast artifacts under
broadcast/**
- Copy emitted addresses into env/config as needed
B) Foundry: deploy per-creator vault infra (EOA/operator)
Wrapper:
./script/deploy.sh vault $CREATOR_COIN_ADDRESS
This runs:
script/DeployInfrastructure.s.sol:DeployCreatorVault with CREATOR_COIN_ADDRESS set
Post-checks:
- Ensure the deployment was registered in
CreatorOVaultFactory (via registerDeployment)
- Ensure registry wiring happened (if
CreatorOVaultFactory.registry was set)
C) ERC-4337 / AA: deploy per-creator vault infra (smart account)
Wrapper:
./script/deploy.sh aa $CREATOR_COIN_ADDRESS --gasless
Under the hood:
npx ts-node script/deploy-with-aa.ts <CREATOR_COIN> [--gasless]
Notes:
- This path depends on the AA contracts (
EntryPoint, smart account) and the bundler/paymaster.
- It may require simulation/predicted addresses to do multi-call atomic wiring.
Reality check (AA CLI vs UI):
- The frontend AA path is the canonical “1-click deploy” in practice. It uses the onchain batcher/deployer addresses from config (e.g.
creatorVaultBatcher, vaultActivationBatcher) and submits UserOperations via Coinbase.
- The CLI AA script (
script/deploy-with-aa.ts, called by ./script/deploy.sh aa) may be stale depending on the currently deployed factory shape; validate its target contract ABI before relying on it for production deployments.
D) Multi-phase: deploy via CreatorVaultDeployer (Phase 1–3)
Use when Base code-deposit limits prevent “all-in-one” deploys, or when you want deterministic CREATE2 addresses + phased execution.
- Phase 1: deploy vault + wrapper + shareOFT + minimal wiring
- Phase 2: deploy gauge + CCA + oracle + deposit + optional auction + ownership transfers
- Phase 3: deploy + register strategies (Charm/Ajna) and optionally create/init V3 pool
Approvals / One-time protocol actions
The most common “gotcha” is approvals for launch/batchers. See:
docs/deployment/REQUIRED_APPROVALS_CHECKLIST.md
Common required approvals (high level):
- Protocol owner (one-time per deployment of CCA / activation batcher):
CCALaunchStrategy.setApprovedLauncher(vaultActivationBatcher, true)
- Per-user (before strategy deploy):
- Creator token approval to
StrategyDeploymentBatcher (so it can transferFrom during batch calls)
Troubleshooting (common failures)
- “Already deployed”:
CreatorOVaultFactory.registerDeployment reverts if deployments[token].exists == true
- “AA deploy stuck / reverted”:
- check bundler error and paymaster sponsorship; reduce batch size or switch to multi-phase deployer
- “Launch/activate reverted”:
- missing
setApprovedLauncher(...) approval on CCA strategy (protocol owner action)
- “Strategy batch reverted”:
- user didn’t approve creator token to the batcher; confirm allowance first
- “Frontend 1-click deploy blocked”:
- user is neither signed in with Privy nor connected with a wallet that can operate the canonical smart wallet; switch sign-in method and retry
- “Wallet connection not ready”:
- wagmi wallet client is missing; reconnect wallet and retry
Output Format (when using this skill)
Return a structured result:
- Summary: what was deployed / what’s blocked
- Inputs: chain, RPC, creator coin, chosen deployment path, owner model
- Preflight results: “already deployed?” + key contract reads
- Actions taken: commands run or transactions sent (hashes)
- Verification: post-state reads showing wiring/ownership
- Follow-ups: approvals required, remaining phases, monitoring
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: vault-deployment3description: Deploy and configure CreatorVault vault infrastructure (CreatorOVault, wrapper, ShareOFT, gauge, CCA strategy, oracle) and optionally post-deploy strategies/payout routing. Use when the user mentions deploy vault, DeployCreatorVault, DeployInfrastructure, account abstraction (ERC-4337), Privy deploy flow, CreatorVaultDeployer phases, or strategy batch deployment. Use when this capability is needed.4---56## Quick Start (choose the deployment path)78- Determine target chain and deployment mode:9 - Foundry scripts (EOA / operator): `script/DeployInfrastructure.s.sol` and `script/deploy.sh`10 - ERC-4337 / AA (smart account): `script/deploy-with-aa.ts` (and `frontend/src/pages/DeployVault.tsx` for the UI flow)11 - Multi-phase orchestrator (Base code-deposit limits): `contracts/helpers/batchers/CreatorVaultDeployer.sol` (Phase 1–2; Phase 3 is strategies)12 - “Infra v2” deterministic deployment helpers: `./script/deploy.sh infra-v2` → `script/DeployBaseMainnetDeployer.s.sol`13 - Post-deploy batchers (strategies + activation): `contracts/helpers/batchers/StrategyDeploymentBatcher.sol`, `contracts/helpers/batchers/VaultActivationBatcher.sol`14- Always do a read-only preflight first (RPC connectivity, owner/deployer identity, “already deployed?” checks).15- Never paste private keys or full `.env` contents in output.1617## System Model (what “deploy a vault” means here)1819There are multiple layers:2021- Core infra (one-time, typically Base):22 - Registry + factory + shared services (see `script/DeployInfrastructure.s.sol`)23- Per-creator vault infra (per creator coin):24 - `CreatorOVault` (ERC-4626 vault)25 - `CreatorOVaultWrapper`26 - `CreatorShareOFT` (wrapped shares; tradable token)27 - `CreatorGaugeController`28 - `CCALaunchStrategy` (auction / launch mechanism)29 - `CreatorOracle`30- Optional post-deploy:31 - Strategies (Charm/Ajna) via batchers32 - Payout routing (e.g., `PayoutRouter`)3334## Required Inputs3536- Chain/network + RPC URL37- Creator coin address (the underlying creator token)38- Owner model:39 - Creator-owned (creator EOA/smart wallet) vs protocol-owned (multisig/treasury)40- If deploying via scripts (Foundry):41 - Required env vars (names only): `PRIVATE_KEY`, `RPC_URL` (or `BASE_RPC_URL` for v2 deployer), `ETHERSCAN_API_KEY`/BaseScan key42 - For per-creator deploy: `CREATOR_FACTORY`43- If deploying via AA script (`deploy-with-aa.ts`):44 - Required env vars (names only): `SMART_ACCOUNT`, `PRIVATE_KEY`, `CREATOR_FACTORY`45 - Optional: `BASE_RPC_URL`, `BUNDLER_URL`, `PAYMASTER_URL`, `PAYOUT_ROUTER_FACTORY`46- If deploying via frontend UI (`DeployVault.tsx`):47 - Privy must be enabled + configured (client `VITE_PRIVY_*`, server `PRIVY_*`), and the user must sign in with Privy **or** connect an external wallet that can operate the canonical smart wallet.4849## Repo Map (where to look / entrypoints)5051- Foundry deployment:52 - `script/DeployInfrastructure.s.sol` (core infra + `DeployCreatorVault` per creator)53 - `script/deploy.sh` (wrapper for infra/vault/AA deploy)54- “Infra v2” deployer (bytecode store + deployer + multi-phase deploy contract):55 - `script/DeployBaseMainnetDeployer.s.sol` (used by `./script/deploy.sh infra-v2`)56- AA deployment (CLI):57 - `script/deploy-with-aa.ts` (UserOp deployment via bundler/paymaster)58- AA deployment (frontend UI):59 - `frontend/src/pages/DeployVault.tsx` (Privy + smart wallet 1-click deploy; can also operate via external owner wallet in some flows)60- Multi-phase deploy orchestrator:61 - `contracts/helpers/batchers/CreatorVaultDeployer.sol` (Phase 1: vault/wrapper/shareOFT; Phase 2: gauge/cca/oracle + deposit/auction; Phase 3: strategies)62- Strategy deployment:63 - `contracts/helpers/batchers/StrategyDeploymentBatcher.sol` (Charm + optional Ajna strategies)64- Activation / launch:65 - `contracts/helpers/batchers/VaultActivationBatcher.sol` (activates vault + can trigger launch)66- Payout routing:67 - `contracts/helpers/routers/PayoutRouter.sol`68- “Required approvals” reminder:69 - `docs/deployment/REQUIRED_APPROVALS_CHECKLIST.md`70 - `docs/deployment/PRE_LAUNCH_VERIFICATION.md`71 - `docs/deployment/CCA_DEPLOYMENT_VERIFICATION.md`7273## Read-only Preflight (do before any state changes)7475Use templates like:7677```bash78# Ensure RPC works and you’re on the expected chain79cast chain-id --rpc-url $RPC_URL8081# Check whether a creator coin is already registered/deployed.82#83# IMPORTANT: This repo has had multiple infra deployments over time. For existing creator coins, you may need to84# check the *legacy* registry/factory (from env/config) rather than the latest defaults.8586# 1) Registry is the source of truth for what the app should use.87cast call --rpc-url $RPC_URL $CREATOR_REGISTRY "getVaultForToken(address)(address)" $CREATOR_COIN8889# 2) Factory is useful to see “which stack was registered by which infra deploy”.90cast call --rpc-url $RPC_URL $CREATOR_FACTORY "isDeployed(address)(bool)" $CREATOR_COIN91cast call --rpc-url $RPC_URL $CREATOR_FACTORY "getDeployment(address)((address,address,address,address,address,address,address,address,uint256,bool))" $CREATOR_COIN92```9394If you’re using the multi-phase deployer, prefer checking deterministic addresses first (computeAddress/create2) rather than “guessing”.9596## Deployment Workflows9798### A) Foundry: deploy core infra (one-time)99100Preferred wrapper:101102- `./script/deploy.sh infrastructure`103104Or directly:105106- `forge script script/DeployInfrastructure.s.sol:DeployInfrastructure --rpc-url $RPC_URL --broadcast --verify -vvvv`107108Outputs/verification:109- Foundry broadcast artifacts under `broadcast/**`110- Copy emitted addresses into env/config as needed111112### B) Foundry: deploy per-creator vault infra (EOA/operator)113114Wrapper:115116- `./script/deploy.sh vault $CREATOR_COIN_ADDRESS`117118This runs:119- `script/DeployInfrastructure.s.sol:DeployCreatorVault` with `CREATOR_COIN_ADDRESS` set120121Post-checks:122- Ensure the deployment was registered in `CreatorOVaultFactory` (via `registerDeployment`)123- Ensure registry wiring happened (if `CreatorOVaultFactory.registry` was set)124125### C) ERC-4337 / AA: deploy per-creator vault infra (smart account)126127Wrapper:128129- `./script/deploy.sh aa $CREATOR_COIN_ADDRESS --gasless`130131Under the hood:132- `npx ts-node script/deploy-with-aa.ts <CREATOR_COIN> [--gasless]`133134Notes:135- This path depends on the AA contracts (`EntryPoint`, smart account) and the bundler/paymaster.136- It may require simulation/predicted addresses to do multi-call atomic wiring.137138Reality check (AA CLI vs UI):139140- The **frontend AA path** is the canonical “1-click deploy” in practice. It uses the onchain batcher/deployer addresses from config (e.g. `creatorVaultBatcher`, `vaultActivationBatcher`) and submits UserOperations via Coinbase.141- The **CLI AA script** (`script/deploy-with-aa.ts`, called by `./script/deploy.sh aa`) may be stale depending on the currently deployed factory shape; validate its target contract ABI before relying on it for production deployments.142143### D) Multi-phase: deploy via `CreatorVaultDeployer` (Phase 1–3)144145Use when Base code-deposit limits prevent “all-in-one” deploys, or when you want deterministic CREATE2 addresses + phased execution.146147- Phase 1: deploy vault + wrapper + shareOFT + minimal wiring148- Phase 2: deploy gauge + CCA + oracle + deposit + optional auction + ownership transfers149- Phase 3: deploy + register strategies (Charm/Ajna) and optionally create/init V3 pool150151## Approvals / One-time protocol actions152153The most common “gotcha” is approvals for launch/batchers. See:154- `docs/deployment/REQUIRED_APPROVALS_CHECKLIST.md`155156Common required approvals (high level):157158- Protocol owner (one-time per deployment of CCA / activation batcher):159 - `CCALaunchStrategy.setApprovedLauncher(vaultActivationBatcher, true)`160- Per-user (before strategy deploy):161 - Creator token approval to `StrategyDeploymentBatcher` (so it can `transferFrom` during batch calls)162163## Troubleshooting (common failures)164165- “Already deployed”:166 - `CreatorOVaultFactory.registerDeployment` reverts if `deployments[token].exists == true`167- “AA deploy stuck / reverted”:168 - check bundler error and paymaster sponsorship; reduce batch size or switch to multi-phase deployer169- “Launch/activate reverted”:170 - missing `setApprovedLauncher(...)` approval on CCA strategy (protocol owner action)171- “Strategy batch reverted”:172 - user didn’t approve creator token to the batcher; confirm allowance first173- “Frontend 1-click deploy blocked”:174 - user is neither signed in with Privy nor connected with a wallet that can operate the canonical smart wallet; switch sign-in method and retry175- “Wallet connection not ready”:176 - wagmi wallet client is missing; reconnect wallet and retry177178## Output Format (when using this skill)179180Return a structured result:181182- Summary: what was deployed / what’s blocked183- Inputs: chain, RPC, creator coin, chosen deployment path, owner model184- Preflight results: “already deployed?” + key contract reads185- Actions taken: commands run or transactions sent (hashes)186- Verification: post-state reads showing wiring/ownership187- Follow-ups: approvals required, remaining phases, monitoring188189---190> Converted and distributed by [TomeVault](https://tomevault.io/claim/wenakita) — claim your Tome and manage your conversions.191<!-- tomevault:4.0:skill_md:2026-04-13 -->