@black-market/sdk 0.11.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/README.md +96 -79
  2. package/dist/lifecycle/abi.d.ts +1 -0
  3. package/dist/lifecycle/abi.d.ts.map +1 -1
  4. package/dist/lifecycle/abi.js +1 -0
  5. package/dist/lifecycle/abi.js.map +1 -1
  6. package/dist/lifecycle/deployments/ufg-dynamic-pool-20261021.d.ts +71 -0
  7. package/dist/lifecycle/deployments/ufg-dynamic-pool-20261021.d.ts.map +1 -0
  8. package/dist/lifecycle/deployments/ufg-dynamic-pool-20261021.js +73 -0
  9. package/dist/lifecycle/deployments/ufg-dynamic-pool-20261021.js.map +1 -0
  10. package/dist/lifecycle/deployments/ufg-fixed-pool-20261021.d.ts +71 -0
  11. package/dist/lifecycle/deployments/ufg-fixed-pool-20261021.d.ts.map +1 -0
  12. package/dist/lifecycle/deployments/ufg-fixed-pool-20261021.js +73 -0
  13. package/dist/lifecycle/deployments/ufg-fixed-pool-20261021.js.map +1 -0
  14. package/dist/lifecycle/index.d.ts +1 -0
  15. package/dist/lifecycle/index.d.ts.map +1 -1
  16. package/dist/lifecycle/index.js +1 -0
  17. package/dist/lifecycle/index.js.map +1 -1
  18. package/dist/lifecycle/markets.d.ts +3 -1
  19. package/dist/lifecycle/markets.d.ts.map +1 -1
  20. package/dist/lifecycle/markets.js +20 -3
  21. package/dist/lifecycle/markets.js.map +1 -1
  22. package/dist/lifecycle/planner.d.ts.map +1 -1
  23. package/dist/lifecycle/planner.js +101 -46
  24. package/dist/lifecycle/planner.js.map +1 -1
  25. package/dist/lifecycle/presets.d.ts +4 -2
  26. package/dist/lifecycle/presets.d.ts.map +1 -1
  27. package/dist/lifecycle/presets.js +11 -4
  28. package/dist/lifecycle/presets.js.map +1 -1
  29. package/dist/lifecycle/progress.d.ts +3 -1
  30. package/dist/lifecycle/progress.d.ts.map +1 -1
  31. package/dist/lifecycle/progress.js +145 -59
  32. package/dist/lifecycle/progress.js.map +1 -1
  33. package/dist/lifecycle/rpc.d.ts +8 -2
  34. package/dist/lifecycle/rpc.d.ts.map +1 -1
  35. package/dist/lifecycle/rpc.js +165 -9
  36. package/dist/lifecycle/rpc.js.map +1 -1
  37. package/dist/lifecycle/simulation.d.ts +1 -1
  38. package/dist/lifecycle/simulation.d.ts.map +1 -1
  39. package/dist/lifecycle/simulation.js +15 -11
  40. package/dist/lifecycle/simulation.js.map +1 -1
  41. package/dist/lifecycle/types.d.ts +23 -1
  42. package/dist/lifecycle/types.d.ts.map +1 -1
  43. package/dist/lifecycle/types.js.map +1 -1
  44. package/dist/lifecycle/ufg-abi.d.ts +2386 -0
  45. package/dist/lifecycle/ufg-abi.d.ts.map +1 -0
  46. package/dist/lifecycle/ufg-abi.js +171 -0
  47. package/dist/lifecycle/ufg-abi.js.map +1 -0
  48. package/dist/lifecycle/ufg-config.d.ts +38 -0
  49. package/dist/lifecycle/ufg-config.d.ts.map +1 -0
  50. package/dist/lifecycle/ufg-config.js +75 -0
  51. package/dist/lifecycle/ufg-config.js.map +1 -0
  52. package/dist/lifecycle/ufg.d.ts +21 -0
  53. package/dist/lifecycle/ufg.d.ts.map +1 -0
  54. package/dist/lifecycle/ufg.js +98 -0
  55. package/dist/lifecycle/ufg.js.map +1 -0
  56. package/docs/launch-lifecycle.md +611 -1363
  57. package/docs/reference.md +332 -0
  58. package/examples/.env.example +3 -2
  59. package/examples/README.md +172 -539
  60. package/examples/launch-example-support.ts +11 -3
  61. package/examples/launch-example.ts +1 -1
  62. package/examples/launch-lifecycle-smoke.ts +1 -1
  63. package/examples/ufg-launch-config.ts +31 -0
  64. package/package.json +1 -1
  65. package/src/lifecycle/abi.ts +1 -0
  66. package/src/lifecycle/deployments/ufg-dynamic-pool-20261021.ts +74 -0
  67. package/src/lifecycle/deployments/ufg-fixed-pool-20261021.ts +74 -0
  68. package/src/lifecycle/index.ts +1 -0
  69. package/src/lifecycle/markets.ts +16 -3
  70. package/src/lifecycle/planner.ts +95 -45
  71. package/src/lifecycle/presets.ts +11 -4
  72. package/src/lifecycle/progress.ts +131 -51
  73. package/src/lifecycle/rpc.ts +158 -10
  74. package/src/lifecycle/simulation.ts +14 -10
  75. package/src/lifecycle/types.ts +15 -2
  76. package/src/lifecycle/ufg-abi.ts +173 -0
  77. package/src/lifecycle/ufg-config.ts +77 -0
  78. package/src/lifecycle/ufg.ts +86 -0
@@ -1,574 +1,207 @@
1
- # Examples
2
-
3
- The launch examples use the public `@black-market/sdk` 0.11.0 package and viem.
4
- Build this checkout before running its examples; in a consumer project install
5
- `@black-market/sdk@0.11.0` for current gas packing and proof-coverage semantics.
6
- The default chain-4663 launch cases retain
7
- the October8 mined fixed pool-bound V4 config6/V2 and canonical Abyss config1 deployment.
8
- The SDK additionally knows the October11 zero-author-royalty Dynamic Fee Hook;
9
- its registration does not change the fixed cases' selection or fee schedule.
10
- HMM Fixed/Dynamic V2 are additional admitted October17 presets; their required
11
- 512-byte typed launch tail and explicit bid/reference guards are demonstrated by
12
- `hmm-launch-config.ts`. The generic HMM profile keys now select V2 only.
13
- Existing fixed cases are intentionally unchanged. See the lifecycle guide for
14
- the breaking migration, per-swap funding and fee-owner configuration/pause ABIs.
15
- Historical October5 config5 evidence is not relabeled as these graphs. Discovery
16
- is read-only; fixed launch examples default to an unsigned dry run. Only
17
- `--broadcast` (or deliberate `--resume` continuation) authorizes real writes.
18
-
19
- Use Node 24+ to run these TypeScript files directly, for example
20
- `pnpm build && node examples/quickstart.ts`. No extra runtime dependency or
21
- `--experimental-strip-types` flag is needed. The build emits the SDK used by the
22
- examples; their relative support imports use explicit `.ts` extensions for Node ESM.
23
-
24
- | Script | Behavior |
25
- | --- | --- |
26
- | `quickstart.ts` | Reads the current mainnet orchestrator, checks its registry binding, and discovers admitted profiles. No wallet or writes. |
27
- | `hmm-launch-config.ts` | Pure HMM V2 fixed/dynamic config construction with caller-chosen bid/reference guards and an automatically appended 512-byte launch tail; no RPC, signatures or writes. |
28
- | `launch.ts` | Reviews/reconstructs an explicit saved plan and selected atomic/staged mode; optional offchain config6/V2 salt mining. Prints simulation, progress, and an admitted unsigned next transaction when evidence permits. |
29
- | `generate-lifecycle-commitment-fixture.ts` | Frozen independent historical config4/Abyss ABI bytes/hash/identity vector. Its pre-cutover allocations are not an executable 0.7.1 plan. |
30
- | `launch-lifecycle-smoke.ts` | Actual SDK launch/recovery/custody/fee operations, only on an explicitly authorized owned disposable loopback graph. |
31
- | `launch-erc20-*.ts`, `launch-erc404-*.ts` | Eleven independent fixed cases: unsigned end-to-end planning by default; `--broadcast` adds guarded local signing, chain verification and mandatory API publication/indexing. |
32
-
33
- ## Deployed read-only discovery
34
-
35
- ```sh
36
- pnpm install
37
- pnpm examples
38
- # Optional: RPC_URL=https://your-robinhood-rpc pnpm examples
39
- ```
1
+ # Run the examples
40
2
 
41
- `CHAIN_ID` defaults to `4663`. Local `31337` and workbench `46631` require a matching
42
- RPC and explicit `LAUNCH_ORCHESTRATOR`, `LAUNCH_IMPLEMENTATION_REGISTRY`, and
43
- `LAUNCH_FEE_OWNER_REGISTRY`. The example checks RPC chain identity and registry binding.
44
- Profile discovery verifies live registry admission and certified dependencies; it does
45
- not build/sign a launch, choose a developer fee, or select market economics.
3
+ These commands use the checkout's built `@black-market/sdk` **0.13.0** and viem.
4
+ Use **Node 24+** for direct TypeScript execution. Start with the one-market
5
+ `launch-erc20-abyss.ts`; larger cases can exceed the RPC's simulation budget.
6
+ For valuation, token ordering, ranges, and buy protection, read the
7
+ [launch guide](../docs/launch-lifecycle.md#price-the-launch).
46
8
 
47
- ## Unsigned saved-plan review
9
+ ## Set up the checkout
48
10
 
49
- Supply full `LaunchPlanV1` JSON using the selected RPC's current deployment:
11
+ Run from the repository root:
50
12
 
51
13
  ```sh
14
+ pnpm install --frozen-lockfile
52
15
  pnpm build
53
- node examples/launch.ts \
54
- --plan plan.json --rpc https://rpc.mainnet.chain.robinhood.com/ --mode staged --mine
16
+ cp -n examples/.env.example .env
17
+ chmod 600 .env
55
18
  ```
56
19
 
57
- `--mine` uses `prepareAndPlanLifecycleLaunch` to finalize config6/V2 salts and admit the
58
- requested mode in one SDK-owned invocation. Persist its exact returned plan before
59
- begin. `--receipts receipt-references.json` takes a JSON array of SDK receipt
60
- references, with bigint block numbers encoded as decimal strings; `--confirmations N`
61
- restores the selected canonical recovery depth. The CLI checks source chain identity
62
- before discovery. It never signs, submits source-chain transactions, uploads metadata,
63
- or publishes a launch. Modes never fall back silently.
64
-
65
- Executable admission requires actual stateful measurement and exact validated replay.
66
- `--limits current-limits.json` is optional tightening policy, not a required backend:
67
- missing caps stay explicit uncertainty, while supplied malformed/stale/mismatched
68
- provenance rejects. Encode bigint values as decimal strings. Robinhood `4663` reads
69
- pinned native Nitro compute/poster evidence and requires native `eth_simulateV1`.
70
- A **separate disposable loopback fork** (`--fork-rpc URL`) remains available for
71
- generic EVM, not as a Nitro metering substitute. Unsigned review reports
72
- `transportPreflight: "not-requested"` unless a consumer supplies its active submission
73
- RPC to build-next. See the
74
- [lifecycle guide](../docs/launch-lifecycle.md#execution-constraints-and-stateful-simulation).
75
-
76
- Robinhood defaults to a 50M aggregate simulation gas-used budget. Inspect
77
- `simulation.deferredTransactionIds`: admitted/proved means the proven prefix,
78
- not every future transaction or eventual activation. Deferred commands have no
79
- gas/price/estimate/admission; obtain each fresh immediate envelope through
80
- `buildNextTransaction` after canonical progress advances. Reviewed envelopes are
81
- replayed directly, without measuring/replaying the suffix again. The saved-plan
82
- CLI prints proof coverage and never signs. Override `limits.maxSimulationGas` only
83
- for a provider that supports the selected budget. Examples requiring actual
84
- activation outputs for `buySlippageBps` or economic review refuse if activation is
85
- deferred; use a suitably higher-budget provider rather than inventing buy outputs.
86
-
87
-
88
- For a real new graph, create the saved plan using `readLifecycleProfiles` with its
89
- explicit chain/core and admitted pool-bound config6 profile. Supply that graph's RPC
90
- to `launch.ts`; do not substitute the historical known preset. Applications may use
91
- the existing `LAUNCH_ORCHESTRATOR`, `LAUNCH_IMPLEMENTATION_REGISTRY`, and
92
- `LAUNCH_FEE_OWNER_REGISTRY` overrides from the same authentic deployment evidence.
93
- The SDK certifies actual registry/creation-code/runtime/constructor bindings and
94
- requires real execution proof; setting configuration does not certify a graph.
95
-
96
- ## Real HTTP metadata sessions
97
-
98
- The real HTTP integration suite uses the public `LaunchApiClient` against a separately
99
- running service. Reads are unsigned; metadata-session writes require a disposable key
100
- and an owned loopback service with real application storage:
20
+ Launch wrappers load `.env` from the working directory with `process.loadEnvFile`.
21
+ Existing environment values take precedence. Values are literal; shell interpolation
22
+ is not applied. Use the matching SDK version when copying wrappers into a consumer project:
23
+ `pnpm add @black-market/sdk@0.13.0 viem`.
24
+ Copy `launch-example.ts`, `launch-example-support.ts`, and `launch-example-kyber.ts` with the wrapper.
25
+
26
+ ### Configure the environment
27
+
28
+ | Variable | Value / default |
29
+ | --- | --- |
30
+ | `PRIVATE_KEY` | Your funded EOA's 32-byte hex key; leave blank when using a keystore. |
31
+ | `EXAMPLE_KEYSTORE_PATH` | Alternative signer: owner-only local V3 scrypt/AES-128-CTR keystore. |
32
+ | `EXAMPLE_KEYSTORE_PASSWORD` | Keystore password; defaults to empty. |
33
+ | `LAUNCH_API_URL` | Required service root: `https://api.abyss.trading`. |
34
+ | `RPC_URL` | Optional Robinhood mainnet RPC; defaults to the SDK's official endpoint. |
35
+ | `NFT_BASE_URI` | Optional hosted ERC404 NFT metadata base URI; defaults to empty. |
36
+ | `EXAMPLE_BUY_AMOUNT_WEI` | Native ETH input **per buy**; default `10000000000000` (0.00001 ETH). |
37
+ | `EXAMPLE_TARGET_MARKET_CAP_USD` | Whole-supply target FDV in decimal USD; default `5000`. |
38
+ | `EXAMPLE_TOKEN_NAME` / `EXAMPLE_TOKEN_SYMBOL` | Override the case's token identity. |
39
+ | `EXAMPLE_TOKEN_DESCRIPTION` | Override the case's metadata description. |
40
+ | `EXAMPLE_IMAGE_PATH` | Optional actual PNG, JPEG, or WebP file, 1 byte–5 MiB. |
41
+ | `EXAMPLE_KYBER_API_URL` | Optional conversion API root; defaults to `LAUNCH_API_URL`. |
42
+ | `EXAMPLE_CHAIN_GAS_CAP` | Optional complete transaction gas-envelope ceiling. |
43
+ | `EXAMPLE_RPC_GAS_CAP` | Optional provider transaction gas-envelope ceiling. |
44
+ | `EXAMPLE_ACCOUNT_GAS_CAP` | Optional wallet/account transaction gas-envelope ceiling. |
45
+ | `EXAMPLE_MAX_CALLDATA_BYTES` | Optional whole-transaction byte ceiling. |
46
+ | `EXAMPLE_HEADROOM_BPS` | Gas headroom, default `1500`; accepted range 0–10,000. |
47
+ | `EXAMPLE_SIMULATION_GAS_CAP` | Aggregate simulation-used gas budget; default 50M on chain 4663. |
48
+
49
+ Configure **exactly one** of `PRIVATE_KEY` and `EXAMPLE_KEYSTORE_PATH`.
50
+ A keystore must be a regular file owned by your user with owner-only permissions.
51
+ Dry-run derives the public address but does not construct a wallet signer.
52
+ Remote RPC/API endpoints require HTTPS; owned loopback services may use HTTP.
53
+
54
+ Metadata limits are 100 Unicode codepoints/128 UTF-8 bytes for name, 32 codepoints/bytes
55
+ for symbol, and 2,000 codepoints for description. The runner normalizes and trims text.
56
+ Images are hashed before attribution signing; malformed or animated files may fail API verification.
57
+ Keep `.env`, keystores, signed bytes, and private recovery material out of git.
58
+
59
+ ## Discover without a wallet
101
60
 
102
61
  ```sh
103
- LAUNCH_API_TEST_URL=http://127.0.0.1:18763 pnpm test:api
104
- LAUNCH_API_TEST_URL=http://127.0.0.1:18763 \
105
- LAUNCH_API_TEST_PRIVATE_KEY="$DISPOSABLE_TEST_PRIVATE_KEY" pnpm test:api:write
62
+ pnpm examples
63
+ # quickstart.ts does not load .env; load it explicitly if needed:
64
+ node --env-file=.env examples/quickstart.ts
106
65
  ```
107
66
 
108
- These are metadata-only session tests, not token deployment or image/transaction
109
- publication. No image store, indexer, wallet balance, or chain transaction is needed.
110
- See [service prerequisites](../docs/launch-lifecycle.md#real-http-api-integration).
67
+ `quickstart.ts` reads process environment, verifies the chain and core/registry binding,
68
+ and prints live profile admission. `CHAIN_ID` defaults to `4663`.
69
+ Local `31337` and workbench `46631` need a matching RPC and explicit
70
+ `LAUNCH_ORCHESTRATOR`, `LAUNCH_IMPLEMENTATION_REGISTRY`, and `LAUNCH_FEE_OWNER_REGISTRY`.
71
+ Discovery does not choose prices, construct a wallet, or write metadata.
111
72
 
112
- ## Individual token creation
73
+ ## Choose one of eleven launch cases
113
74
 
114
- **Without a mode flag, these files are dry runs: no transactions are signed or
115
- broadcast, and no metadata/image is uploaded or published. `--broadcast` signs,
116
- spends real funds and publishes to your configured API. Mainnet execution is
117
- irreversible.** Choose one case per intended launch.
75
+ All commands are `node examples/<file>`, with no required arguments.
76
+ V4 cases select the fixed-fee pool-bound profile. Quotes default to WETH.
77
+ Position counts below are permanent launch positions, not separate hooks.
118
78
 
119
- ### Two-step flow: dry run, then broadcast
79
+ | File | Token / rewards | Markets / positions | Mode / total buys |
80
+ | --- | --- | --- | --- |
81
+ | `launch-erc20-abyss.ts` | ERC20 / none | Abyss WETH: 1 | atomic / 1 |
82
+ | `launch-erc20-v4.ts` | ERC20 / none | V4 WETH: 1 | atomic / 1 |
83
+ | `launch-erc404-v4.ts` | ERC404 / none | V4 WETH: 1 | staged / 1 |
84
+ | `launch-erc404-abyss.ts` | ERC404 / none | Abyss WETH: 1 | atomic / 1 |
85
+ | `launch-erc20-staking-v4.ts` | ERC20 / staking | V4 WETH: 2 | staged / 2 |
86
+ | `launch-erc20-dividends-abyss.ts` | ERC20 / dividends | Abyss WETH: 3 | staged / 1 |
87
+ | `launch-erc20-burn-mixed.ts` | ERC20 / 30% token-fee burn | V4 WETH: 2; Abyss WETH: 1 | staged / 2 |
88
+ | `launch-erc404-dividends-mixed.ts` | ERC404 / dividends | V4 WETH: 2; Abyss WETH: 3 | staged / 2 |
89
+ | `launch-erc20-multi-quote.ts` | ERC20 / none | V4 WETH: 1; V4 USDG: 1; Abyss WETH: 1 | staged / 3 |
90
+ | `launch-erc20-depth-v4.ts` | ERC20 / none | V4 WETH: 4 adjacent Early Scarcity bands | staged / 1 |
91
+ | `launch-erc20-dividends-multiquote-mixed.ts` | ERC20 / dividends | V4 WETH: 2; V4 USDG: 2; Abyss WETH: 3 | staged / 3 |
92
+
93
+ Reward-enabled cases allocate 40% of fee assets to holder rewards and 60% to the owner;
94
+ this is a fee-revenue split, not a 40% trading tax. The burn case allocates 30% of
95
+ launch-token fee revenue to burn; quote fees are not burned.
96
+ At most one V4 market per quote is allowed; an Abyss market may reuse that quote.
97
+ Market budgets sum to supply; position caps sum to each market budget. Actual mint
98
+ debits can be smaller than caps: unused mint dust burns **before** opening buys.
99
+
100
+ The eleven wrappers use neither HMM nor UFG. Pure configuration commands are:
120
101
 
121
102
  ```sh
122
- # 1. Discover, build funding and plan; print the complete economic review and save artifacts.
123
- node examples/launch-erc20-v4.ts
124
- # 2. After reviewing the output, explicitly execute the same case.
125
- node examples/launch-erc20-v4.ts --broadcast
103
+ node examples/hmm-launch-config.ts
104
+ node examples/ufg-launch-config.ts
126
105
  ```
127
106
 
128
- The default output starts with **DRY RUN — no transactions signed or broadcast.**
129
- It performs the same profile discovery, quote/funding builds, image descriptor
130
- freezing, economics, salt preparation and planner admission as execution, then
131
- exits `0` on successful planning. It saves `plan.json`, `economic-review.json`,
132
- `planning.json` and all other planning evidence in a fresh `launch-results/` directory.
133
- The creator's public address is derived locally (including authenticated keystore
134
- decryption when selected), but no wallet signer is created. The final output line
135
- is the exact case command with `--broadcast` appended.
136
-
137
- **Choosing `--broadcast` is the authorization. It deliberately skips manual
138
- economic-review admission: there is no interactive hash prompt or hash input.**
139
- The full review is still printed and saved, including its computed provenance hash.
140
- The broadcast run plans afresh with current state, fresh random identity and funding
141
- builds; it does not submit the dry run's saved plan. Planner admission, unchanged
142
- economic authority, deadlines, image verification and canonical/reorg barriers remain
143
- mandatory before signing and publication.
144
- `--resume <recovery-dir>` retains its existing continuation/publication behavior;
145
- it does not become a dry run and does not need `--broadcast`. Unknown, duplicated
146
- or combined mode flags fail before configuration or artifact creation with usage text.
147
-
148
- ### Setup once
149
-
150
- Use **Node 24+**. In this repository run `pnpm install`. In a consumer project install
151
- both public dependencies with `pnpm add @black-market/sdk viem` (or
152
- `npm install @black-market/sdk viem`) and copy the selected files with
153
- `launch-example.ts`, `launch-example-support.ts`, and `launch-example-kyber.ts`
154
- into `examples/`, using the matching updated SDK build.
155
- Copy `examples/.env.example` to `.env` in the directory you will run commands from:
107
+ For actual HMM/UFG integrations, use the [guide](../docs/launch-lifecycle.md#launch-a-ufg-treasury).
108
+ `launch.ts` is a direct-core saved-plan tool and does not carry the UFG route/config.
109
+
110
+ ## Dry-run, broadcast, or resume
156
111
 
157
112
  ```sh
158
- cp examples/.env.example .env
159
- chmod 600 .env
113
+ node examples/launch-erc20-abyss.ts
114
+ node examples/launch-erc20-abyss.ts --broadcast
115
+ node examples/launch-erc20-abyss.ts --resume "launch-results/<original-run-dir>"
160
116
  ```
161
117
 
162
- Edit `.env` once:
118
+ | Mode | Reads / writes | Identity |
119
+ | --- | --- | --- |
120
+ | No flags | Live discovery, funding quotes, preparation, simulation, economic output; unsigned, no API writes | Fresh plan/run directory |
121
+ | `--broadcast` | Signs, spends, stages/uploads metadata, deploys, verifies, and publishes; no further prompt | **Fresh plan**, not the preceding dry run |
122
+ | `--resume <original-run-dir>` | May sign remaining steps or finish publication | Retained plan, receipts, mode, confirmation policy, and API session |
163
123
 
164
- ```dotenv
165
- PRIVATE_KEY=
166
- LAUNCH_API_URL=
167
- RPC_URL=
168
- ```
124
+ Dry-run needs the signer source, RPC/API, and sufficient funds for execution admission.
125
+ Review its economics, then review the fresh broadcast output too. Mode flags cannot
126
+ be combined or duplicated. Resume is an execution authorization; omit `--broadcast`.
169
127
 
170
- Configure **exactly one** signer: your funded EOA's 32-byte `PRIVATE_KEY`, or
171
- `EXAMPLE_KEYSTORE_PATH` pointing to a local V3 scrypt/AES-128-CTR JSON keystore.
172
- `EXAMPLE_KEYSTORE_PASSWORD` defaults to the empty string; both/neither signer
173
- sources reject. The keystore must be a regular owner-only file owned by your user;
174
- the bounded loader authenticates its Keccak MAC and declared address before deriving
175
- the creator. It uses Node crypto and existing viem, with no extra dependency.
176
- Dry-run configuration derives only the public creator address; signing methods are
177
- constructed only in broadcast or nonterminal resume execution.
178
- Never commit the keystore/password or use a published test key for a real launch.
179
- Set `LAUNCH_API_URL` to your actual HTTPS or owned loopback service root. There is
180
- no default wallet, guessed metadata API, or silent API skip. The API needs actual
181
- application storage and an indexer observing the same chain as the execution RPC.
182
- Existing environment variables take precedence over the working-directory `.env`,
183
- loaded once using Node's native `process.loadEnvFile`. No shell interpolation is used.
184
-
185
- `EXAMPLE_BUY_AMOUNT_WEI` sets the exact **native ETH conversion input per opening
186
- buy**, not the eventual WETH/USDG amount. Use a positive canonical decimal uint256
187
- wei string; the default is `10000000000000` (**0.00001 ETH**). Kyber's app-compatible
188
- exact-input domain additionally requires each aggregate input to be below `2^255`.
189
- The runner aggregates ETH inputs per quote, obtains one fresh
190
- `POST EXAMPLE_KYBER_API_URL/api/v1/quote/kyber/build?chainId=4663` build per quote,
191
- and binds native zero-address input, exact input, sender/recipient equal to the
192
- actual funding escrow, **50 bps conversion slippage**, and the same 300-second
193
- launch-purpose deadline as the plan. The API owns fresh route preview; a preview
194
- GET is not executable funding. `EXAMPLE_KYBER_API_URL` defaults to `LAUNCH_API_URL`
195
- (the app's public trade default is `https://api.abyss.trading`); an explicit override
196
- must meet the same HTTPS/owned-loopback safety rules.
197
-
198
- Each funding row is `LifecycleFundingKind.Swap`, native zero-address `inputAsset`,
199
- the reviewed router target and original built calldata. The runner decodes the
200
- reviewed `swap` entry point and checks currencies, escrow recipient, exact input,
201
- output floor, executor payload, flags and absence of redirected inputs/extra fees.
202
- `amountOutMinimum = floor(amountOut * 9950 / 10000)` is the exact quote budget.
203
- That budget is divided across the quote's ordered buys, with the integer remainder
204
- in the last such buy, so their inputs sum exactly to the API minimum. No WETH/USDG
205
- wallet balance or ERC20 approval is needed; the creator needs native ETH **plus gas**.
206
- Registry target/spender/runtime admission is checked on the launch graph and
207
- rechecked before signatures. Refusal, unavailable route, changed binding or expiry
208
- stops unsigned with retained evidence: **never fall back to native-wrap, direct ERC20
209
- funding, a separate wallet swap, dropped buys, or rewritten quote bytes/deadline**.
210
-
211
- Optional `EXAMPLE_TOKEN_NAME`, `EXAMPLE_TOKEN_SYMBOL`, and
212
- `EXAMPLE_TOKEN_DESCRIPTION` override each case's default metadata. Text is NFC
213
- normalized and trimmed, with the unchanged API/lifecycle bounds (name: 100 Unicode
214
- codepoints/128 UTF-8 bytes; symbol: 32 codepoints/bytes; description: 2000 codepoints).
215
- `EXAMPLE_IMAGE_PATH` optionally loads 1 byte through 5 MiB of actual PNG/JPEG/WebP
216
- bytes. The frozen image SHA-256/type/length is reviewed and signed, uploaded using
217
- only the exact API-issued PUT URL/headers, and completed/verified before execution.
218
- Without it the session remains metadata-only; no artwork is invented. API image
219
- verification may reject malformed or animated files even when their type is valid.
220
- With an image set, success additionally requires matching staged/published image
221
- SHA-256/type/length, the same non-null public image URL in the publication and
222
- indexed token DTO, and one bounded no-redirect GET of that URL returning **HTTP
223
- 200**, an image content-type family and nonempty bytes. Byte-identical output
224
- must match the signed type/length/SHA-256. Different served bytes may be an API/CDN
225
- transformation: `published-image.json` records the actual SHA-256/type/length and
226
- that limited family/nonempty-body check, explicitly not byte identity. HTTP/type/
227
- empty/oversized failures stop nonzero with evidence; no image retry or metadata-only
228
- fallback occurs. The final canonical RPC barrier runs after this GET.
229
-
230
-
231
- The target is **USD 5000**, not a fixed token/WETH ratio. Optional
232
- `EXAMPLE_TARGET_MARKET_CAP_USD` accepts a positive exact USD decimal (up to 18
233
- fractional digits). It does not grant signing permission or override the USD seed.
234
- The runner makes one bounded, uncached GET to
235
- `LAUNCH_API_URL/api/v1/token-prices?chainId=4663&limit=100`, without pagination,
236
- redirects or retries. It selects the reviewed chain-4663 WETH address and requires
237
- ready metadata, 18 decimals, `priced: true`, `source: "anchor"`, and direct
238
- Chainlink-anchor provenance bound to WETH and the reviewed aggregator
239
- `0x78F3556b67E17Df817D51Ef5a990cDaF09E8d3A9`. The exact positive uint256
240
- `priceUsdX18` is an **indicative API-published launch seed**, not an executable
241
- swap quote or on-chain execution authority. HTTP/body/validation failure or a missing
242
- WETH row stops unsigned; there is no manual price or alternate-source fallback.
243
- Each request has a 30-second timeout and a 1 MiB streamed response limit.
244
- The review and console preserve API origin, index/graph blocks, upstream observation
245
- timestamp and age, and local retrieval time. Retrieval does not make an old upstream
246
- observation fresh. The API may continue publishing its price as upstream age grows;
247
- the runner does not impose a 15-minute contract-round freshness gate.
248
- USDG markets use the SDK-exported chain-4663 Global Dollar address, **6 decimals**
249
- and the reviewed `usdPeg` source at exactly `1e18` USD-X18, matching the app. There
250
- is no substituted WETH/USD value. Every market has its own quote precision, USD
251
- seed, token/quote orientation and aligned valuation; multi-quote FDVs are not additive.
252
-
253
-
254
- Before any attribution or transaction signature, the runner saves
255
- `economic-review.json` and exact owner-only recovery and prints its financial summary.
256
- The computed hash binds all quotes, target, actual supply, predicted per-market
257
- token order, every allocation, fees, protected buys, Kyber conversion bytes/minima/
258
- deadline, metadata/image and finalized plan. It is provenance evidence, never an
259
- authorization input. Dry runs stop here without signing; broadcast runs save
260
- `economic-admission.json` with `authorization: "--broadcast"` and that hash as
261
- evidence of the chosen mode, not another gate.
262
- Before every later signature the runner rereads the same configured API snapshot and
263
- rechecks the immutable review, target, supply, finalized plan and predicted token
264
- order. Any exact price, API origin, chain, WETH/decimals or direct-anchor identity,
265
- kind or source change stops execution. Failed or unpriced reads also reject.
266
- Index/graph blocks and observation/retrieval times may advance with the identical
267
- price and source; they never replace the original review. Changed economics require
268
- a new explicit review, never silent plan rewriting or submission replay. Actual
269
- RPC chain, balances, nonce, prediction, deadline and native execution proof remain
270
- execution authority; API block fields are observations, not RPC canonicality pins.
271
- The original plan deadline must still be future at metadata signing/staging and
272
- before each later signature, including **after asynchronous quote/authority reads**.
273
- Expiry requires a new explicit review; the runner never extends the saved deadline.
274
-
275
-
276
- Blank `RPC_URL` uses the SDK official Robinhood chain-4663 mainnet endpoint; HTTPS
277
- providers and explicit owned loopback HTTP execution RPCs are supported.
278
- The creator is derived locally from the configured signer; deployment/WETH addresses
279
- come from `getAddresses(4663)`. The runner checks chain identity, EOA, deployed core
280
- and registry, admitted profiles, funding escrow/core/native binding and each quote's
281
- actual decimals. WETH keeps the registered P1 `(1,4096)` oracle. USDG discovers
282
- `OracleConfigRegistered` history at a pinned block, rereads the factory mapping at
283
- that same block, and selects a compatible registered config deterministically by
284
- increasing max tick move, decreasing cardinality, then config ID. Factory configs
285
- are generic, not a separate hardcoded USDG ID. No compatible config, unavailable
286
- history, or a changed canonical pin fails loudly. V4 cases require config6/V2;
287
- an old config5 profile is never selected instead.
288
- V4 fixed cases encode max `10000`, min `1000` pips and sensitivity `7654321`
289
- fee-pips × seconds/tick; all are immutable. The reviewed `FixedFeePoolHookV1` charges
290
- the fixed maximum `10000` pips (1%) on applicable amounts. Minimum and sensitivity
291
- are stored and exposed, not used for a dynamic fee calculation. The current defaults
292
- resolve the matching October8 mined config6 graph. Position maxima exactly cover market budgets and budgets
293
- exactly cover minted supply. Actual unused inventory burns before buys, never to the
294
- creator. Verification accounts for burn `Transfer` logs, reduced `totalSupply`, an
295
- empty core token balance, and creator balance equal only to paid opening-buy output.
296
- Optional `NFT_BASE_URI` supplies your actually hosted ERC404 NFT metadata base URI.
297
- Blank uses an empty base URI: NFT units/mirror behavior remain real, but the example
298
- does not claim hosted NFT metadata exists.
299
-
300
- The fixed Robinhood examples require native sequential Nitro `eth_simulateV1`, including
301
- an isolated pinned ArbOS capability probe and exact fee-bearing replay. Generic
302
- Anvil/Hardhat forks cannot certify Nitro compute/poster metering and are not a fallback.
303
- Unsupported native simulation, insufficient funds or failed admission stop before API
304
- staging/broadcast. Each immediate next envelope is additionally proved afresh against
305
- the saved `reviewedTransaction` and preflighted read-only through the same execution
306
- RPC before signing. Calldata, value, gas and gas price must remain exactly as reviewed.
307
- There is no mode fallback, admission override, automatic submission replay or reduced case.
308
-
309
- ### Commands and launch matrix
310
-
311
- Every command below defaults to a dry run. Append `--broadcast` to execute the
312
- selected case; the table's atomic/staged mode is independent of the CLI dry-run/
313
- broadcast choice.
128
+ The default proof window is **50M aggregate used gas**, not a per-transaction limit.
129
+ Opening-buy calibration needs activation inside the proven prefix. A deferred activation
130
+ cannot produce protected buy minima. Raise `EXAMPLE_SIMULATION_GAS_CAP` only when your
131
+ provider supports it; start with one market when checking an unfamiliar RPC.
314
132
 
315
- ```sh
316
- node examples/launch-erc20-v4.ts
317
- node examples/launch-erc20-abyss.ts
318
- node examples/launch-erc404-v4.ts
319
- node examples/launch-erc404-abyss.ts
320
- node examples/launch-erc20-staking-v4.ts
321
- node examples/launch-erc20-dividends-abyss.ts
322
- node examples/launch-erc20-burn-mixed.ts
323
- node examples/launch-erc404-dividends-mixed.ts
324
- node examples/launch-erc20-multi-quote.ts
325
- node examples/launch-erc20-depth-v4.ts
326
- node examples/launch-erc20-dividends-multiquote-mixed.ts
327
- ```
133
+ ### Fund opening buys
328
134
 
329
- | File suffix | Token / rewards | Markets and permanent positions | Mode / opening buys |
330
- | --- | --- | --- | --- |
331
- | `erc20-v4` | ERC20 / none | V4: 1 | atomic / 1 |
332
- | `erc20-abyss` | ERC20 / none | Abyss: 1 | atomic / 1 |
333
- | `erc404-v4` | ERC404 / none | V4: 1 | staged / 1 |
334
- | `erc404-abyss` | ERC404 / none | Abyss: 1 | atomic / 1 |
335
- | `erc20-staking-v4` | ERC20 / staking | V4: 2 | staged / 2 |
336
- | `erc20-dividends-abyss` | ERC20 / dividends | Abyss: 3 | staged / 1 |
337
- | `erc20-burn-mixed` | ERC20 / token-only burn 3000 bps | dual-fee V4: 2; Abyss: 1 | staged / 1 per market |
338
- | `erc404-dividends-mixed` | ERC404 / dividends | V4: 2; Abyss: 3 | staged / 1 per market |
339
- | `erc20-multi-quote` (new) | ERC20 / none | V4 WETH: 1; V4 USDG: 1; Abyss WETH: 1 | staged / 1 per market (3 total) |
340
- | `erc20-depth-v4` (new) | ERC20 / none | V4 WETH: 4, Early Scarcity / progressive Depth | staged / 1 |
341
- | `erc20-dividends-multiquote-mixed` (new) | ERC20 / dividends 4000 bps | V4 WETH: 2; V4 USDG: 2; Abyss WETH: 3 | staged / 1 per market (3 total) |
342
-
343
- The three new cases are **additions**, not replacements yet: the eight existing
344
- descriptors/topologies remain intact until the user validates new cases with real
345
- runs. At most one V4 market per quote is permitted; Abyss may reuse a quote.
346
-
347
- ERC20 supply is `1_000_000e18`; ERC404 supply is `10_000e18`, NFT unit `100e18`.
348
- `deriveLaunchPoolRecipe` prices against **the entire actual minted supply**, even
349
- in mixed-market cases. Per-market budgets divide that supply, with integer remainder
350
- assigned to the last market. One position uses the recipe's full one-sided range
351
- and budget-funded liquidity; multi-position markets use `deriveLaunchPositionRanges`
352
- with the exact requested count, `positionGaps: "adjacent"` and an explicitly
353
- extended final tail. Staircase remains the existing multi-position default; the
354
- new four-position Depth case uses **Early Scarcity**, increasing inventory from
355
- low-price scarcity to more inventory at higher prices. This is the requested Depth
356
- shape in the current SDK vocabulary, not a literal reproduction of the separate
357
- eight-position design catalogue. Spacing is 60 and LP fee is 3000 pips for both
358
- venues. Predicted address order sets orientation independently per quote; multi-quote
359
- markets aim at the same USD valuation, not the same raw sqrt price. Per-position
360
- maxima exactly cover each budget, except documented integer mint-rounding dust.
361
- Each buy defaults to `0.00001 ETH` through its quote's Kyber funding conversion.
362
- The unified SDK invocation sets
363
- every ordered buy's minimum from its actual stateful diagnostic output with **50 bps
364
- (0.5%) slippage**, then proves and saves only the final protected commitment. The draft's
365
- one-wei minima are diagnostic inputs, never the submitted protection.
366
- Rewards use 4000 bps where selected; token-only burn is 3000 bps in the burn case.
367
- V4 uses frozen registered
368
- treasury/author terms with developer rate `0`; executor fee is 275 bps.
369
- Hook salts/random identities are finalized and saved before execution. The shared
370
- runner uses the combined preparation/admission result without an immediate second
371
- planning pass. Staged cases simulate only staged work, never an unused atomic launch.
372
-
373
- USD 5000 is a **target before tick alignment**, not a promise of exactly USD 5000
374
- after alignment or buys. The economic review shows aligned unit price in USD/quote,
375
- minted-supply valuation, expected rounding burn, retained supply and its aligned
376
- opening valuation. It also decodes every ordered output/input from the final admitted
377
- simulation receipt, showing all-in average execution price and the premium against
378
- opening price. That premium includes fees and price impact; it is **not** the
379
- post-buy marginal spot price. Opening buys move the pool, so the actual post-buy
380
- valuation must use observed post-activation pool price and retained total supply.
381
- The old 1:1/fixed-liquidity examples could burn almost the entire intended supply
382
- and produce a radically different retained-supply valuation. They are not a pricing
383
- recipe or a valid precedent for a new launch.
384
-
385
- ### Optional execution restrictions
386
-
387
- There are no default chain/RPC/account gas or calldata caps. The SDK reads current
388
- Nitro protocol compute ceilings and exact-calldata poster budgets itself. Default
389
- headroom is **1500 bps (15%)**. Set explicit decimal restrictions only when you intend
390
- to tighten the complete transaction envelope: `EXAMPLE_CHAIN_GAS_CAP`,
391
- `EXAMPLE_RPC_GAS_CAP`, `EXAMPLE_ACCOUNT_GAS_CAP`, `EXAMPLE_MAX_CALLDATA_BYTES`.
392
- `EXAMPLE_HEADROOM_BPS` preserves your explicit 0–10000 policy. These are local
393
- restrictions, not invented provider/account assurances or admission bypasses.
394
- Poster allocation is already inside Nitro gas/affordability and is not charged twice.
395
-
396
- Robinhood's separate aggregate simulation gas-used budget defaults to **50M**.
397
- `EXAMPLE_SIMULATION_GAS_CAP` overrides that budget (positive decimal gas) for
398
- providers supporting more or less. It does not change per-transaction compute
399
- capacity. Multi-step examples requiring full activation outputs for buy protection
400
- and economic review need a provider/budget covering activation, or refuse before
401
- signing; do not raise the setting beyond the provider's actual supported budget.
402
-
403
- ### Evidence and failure recovery
404
-
405
- Each dry run or broadcast automatically creates `launch-results/<timestamp-case-random>/`;
406
- `--resume` reuses the original directory rather than creating another launch. Inspect
407
- `result.json`, `events.jsonl`, finalized `plan.json`, `planning.json`,
408
- `economic-review.json` and `receipts.json`. A dry-run result has `runMode: "dry-run"`,
409
- `scope: "planning"` and `execution: "dry-run"`, with no transactions or API writes.
410
- Publication-only artifacts (`publication-progress.json`, `published-token.json` and,
411
- when configured, `published-image.json`) are produced only during broadcast/resume.
412
- Exact admitted wallet envelopes are signed locally only during execution; computed
413
- hashes and unsigned envelopes are durably retained as `broadcast-attempt`
414
- **before the one raw broadcast**. Real receipts are saved before
415
- status/canonical-state assertions. No unlocked-account signing or sending is used.
416
- Public evidence preserves structured field names but redacts sensitive values:
417
- known keys, signatures, signed raw bytes, API capabilities, authorization values
418
- and endpoint credentials. Public `plan.json` may therefore differ from the exact
419
- commitment and is **not recovery authority**. Before the first attribution or chain
420
- signature, `private-recovery.json` durably retains the complete unredacted finalized
421
- `plan`, original `mode`, `confirmations` and `economicReview`. Broadcast additionally
422
- saves `economicAdmission` with the computed review hash and `authorization: "--broadcast"`.
423
- This owner-only file (mode `0600` inside the mode `0700` run directory) also retains
424
- raw signed transactions and one-time API recovery material across session updates.
425
- Original plan and economic review/admission provenance are immutable.
426
- Never share or commit it.
427
- `launch-results/` is ignored.
428
-
429
- Every broadcast case requires actual API metadata staging (and verified image completion
430
- when configured), publication using the activation hash, and an indexed DTO
431
- matching token/creator/hash/metadata/image. Genuine pending-indexer HTTP `202`
432
- responses are polled for up to 90 seconds respecting `Retry-After`. Before **each
433
- publication attempt** and before final success, fresh RPC progress must be
434
- confirmation-safe canonical Active with all retained receipts confirmed and the
435
- original activation still in its saved block number/hash. Reorg, moved inclusion,
436
- missing/unconfirmed receipt or changed phase stops, retains `publication-progress.json`
437
- and private recovery evidence, and exits nonzero—even if the API reports success.
438
- Other API failures are not retried or converted to partial success. The runner
439
- never retries a raw send, relaunches, cancels or rolls back the source chain.
440
- **Do not blindly rerun after an ambiguous broadcast**: inspect the durable hash first.
441
- See [chain/API invariants](../docs/launch-lifecycle.md#individual-token-creation-examples).
442
-
443
- Continue a begun launch with the same signer source and API endpoint:
135
+ | Quote | What the runner does with native ETH |
136
+ | --- | --- |
137
+ | WETH | Uses `LifecycleFundingKind.NativeWrap`; wraps ETH, no Kyber swap. |
138
+ | USDG | Uses `LifecycleFundingKind.Swap`; builds an admitted Kyber conversion with a minimum quote output. |
139
+
140
+ ETH for gas is additional. The SDK also supports direct ERC20 funding; the wrappers
141
+ use native ETH input. Buys sharing a quote use one aggregated funding output.
142
+ The plan expires after **3,600 seconds**; Kyber conversion calldata expires after
143
+ **300 seconds**. Conversion expiry must be at most 1,200 seconds away and no later
144
+ than plan expiry. A valid plan does not extend an expired conversion quote.
145
+ The conversion minimum protects ETH→USDG, not USDG→launch-token output;
146
+ [buy protection](../docs/launch-lifecycle.md#protect-the-opening-buy) is separate.
147
+
148
+ ## Keep artifacts and recover the original launch
149
+
150
+ Each fresh run creates `launch-results/<timestamp-case-random>/`. Resume reuses it.
151
+ Read `result.json`, `economic-review.json`, `planning.json`, and `receipts.json` to
152
+ separate planning, chain completion, publication, and indexing.
153
+ Public `plan.json` may be redacted and cannot reconstruct the exact commitment.
154
+ The owner-only `private-recovery.json` retains the exact plan and API capability;
155
+ keep it inside its mode-0700 run directory and never share it.
156
+
157
+ The runner records the signed transaction's hash and exact envelope **before** one raw send.
158
+ After a timeout or interrupted send, inspect that hash and chain progress before continuing.
159
+ It does not automatically retry sends, adopt replacements, cancel, or create another token.
160
+
161
+ | Saved chain state | Resume behavior / next action |
162
+ | --- | --- |
163
+ | Preparing / Ready, still executable | Re-admit the original plan and submit only remaining steps. |
164
+ | Active | Recover the original activation receipt; verify and publish, even after the launch deadline. |
165
+ | Expired Preparing / Ready | Use SDK cancellation after reconciling receipts; see [recovery](../docs/launch-lifecycle.md#recover-or-cancel). |
166
+ | Unstarted / Cancelled / unresolved signed hash | Stops for reconciliation; do not use a new invocation as a retry. |
167
+
168
+ Resume retains salts and buy minima; it does not rerun preparation or recalibrate economics.
169
+ For replacements, retain original `transactionHash` and effective `replacementHash`,
170
+ plus observed block number/hash. A missing receipt alone does not establish a reorg.
171
+
172
+ Metadata is staged before deployment. Publication uses the **original activation hash**.
173
+ A `LaunchPublishPending` response means indexing is pending; the runner polls for up
174
+ to 90 seconds, respecting `Retry-After`, and checks canonical Active before publication.
175
+ An image/indexing error after activation does not undo the launch. Resume publication.
176
+
177
+ Resume refreshes the original session and retains its one-time capability across responses.
178
+ If an image is still awaiting upload, supply the original `EXAMPLE_IMAGE_PATH` bytes;
179
+ the SHA-256, type, and length must match. It can renew an expired PUT URL once;
180
+ a verified image is not reuploaded. A reorg or changed activation inclusion stops recovery.
181
+
182
+ ## Review a saved direct-core plan without signing
444
183
 
445
184
  ```sh
446
- node examples/launch-erc20-v4.ts --resume launch-results/<original-run-directory>
185
+ node examples/launch.ts --plan plan.json \
186
+ --rpc https://rpc.mainnet.chain.robinhood.com/ --mode staged --mine
447
187
  ```
448
188
 
449
- All eleven wrappers accept this option; the retained plan/review, not the wrapper's
450
- case descriptor or new identity overrides, determines the resumed launch.
451
- The runner loads owner-only `private-recovery.json`, restores the original mode,
452
- confirmation policy, execution restrictions and typed receipts with observed block
453
- number/hash, and re-admits `parseLaunchPlan(JSON.stringify(recovery.plan))` with
454
- `planLaunch` against current canonical state. It does **not** call
455
- `prepareAndPlanLifecycleLaunch`, remine salts, recalibrate buys, or repeat begin.
456
- Canonical **Preparing/Ready** resumes only remaining `buildNextTransaction` steps
457
- under the saved economic admission and signing gates; canonical **Active** recovers
458
- the original activation receipt and runs chain verification/publication only,
459
- including after the signing deadline. Unstarted/Cancelled state, changed inclusion,
460
- replacement or unresolved signed hashes stop for read-only reconciliation.
461
-
462
- Before publication the original API session is refreshed with `getUploadSession`;
463
- the retained one-time capability is carried across every read/renew/complete response
464
- because the API does not echo it. If an image is still awaiting upload, set
465
- `EXAMPLE_IMAGE_PATH` to the original bytes: SHA-256, content type and length must
466
- match the signed descriptor. An expired PUT URL is renewed once on HTTP 403/410/412
467
- with `renewUploadUrl`, then the same bytes are uploaded and completed. A live ready
468
- image is never reuploaded. No new attribution signature or session is created.
469
- All existing chain/image/indexer checks and canonical activation barriers still apply.
470
-
471
- After interruption, timeout, replacement or reorg, preserve the original identity,
472
- `private-recovery.json` and every signed hash. Public `plan.json` and diagnostic
473
- `planning.json` are not recovery authority; do not rerun a wrapper without `--resume`.
474
- Supply receipt references including observed block number/hash;
475
- when a replacement is known retain both `transactionHash` (original) and
476
- `replacementHash` (effective). A same-nonce cancellation is not successful activation;
477
- a missing receipt alone does not prove a reorg. No replacement is adopted or retried
478
- automatically by these local-signing cases: a timed-out original hash requires manual
479
- reconciliation. `launch.ts` provides unsigned reload/review for a privately extracted
480
- exact plan: keep that file owner-only and supply the original `--mode`,
481
- `--confirmations` and reconciled `--receipts`. Do not publish the extracted plan or
482
- CLI output, which may contain sensitive committed values. Recovery of API publication
483
- uses the original private session/capability and canonical activation hash, never
484
- another launch.
485
-
486
- ### Owned-local wallet verification helpers
487
-
488
- `launch-example-support.ts` exports
489
- `createLocalLaunchWallet({privateKey,creator,chainId,orchestrator,client,redactor})`
490
- and `submitSignedRecorded({transaction,wallet,client,wait,artifacts,signal})`.
491
- `client.request({method,params})` is an explicit RPC adapter; `transaction` carries
492
- `id`, `kind`, and exact unsigned `wire` chain/from/to/data/value/gas fields plus
493
- optional nonce/fees/type/accessList. `wait(hash)` returns a real receipt.
494
- The signer exposes `address`, `signTypedData(typedData)` and `signTransaction(wire)`
495
- returning `{wire,rawTransaction,transactionHash}`. Retain the result privately.
496
- Use `RunArtifacts(output,caseId,redactor)` with `Redactor` and a fresh directory for
497
- durable evidence; call `initialize()` before work and `finish(status,error)` afterward.
498
- The shared `runLaunchExample(caseObject, argv = process.argv.slice(2))` in
499
- `launch-example.ts` takes the same fixed case objects as the eleven files, loads
500
- environment and either auto-creates output for a new launch or resumes in place.
501
- `RunArtifacts(output,caseId,redactor,{resume:true})` reopens private recovery and
502
- retained transaction evidence without truncating the journal.
503
- Offline diagnostics are in `test/launch-example.test.mjs`,
504
- `test/launch-example-matrix.test.mjs` and `test/launch-example-resume.test.mjs`;
505
- they do not claim real launch/indexer proof.
506
-
507
- ## Relationship to the application flows
508
-
509
- The examples have been reviewed against `abyss-app`'s `scripts/launch-node.mjs`,
510
- `launch-node-deploy.mjs`, `launch-browser-wallet.mjs`, `launch-staged-smoke.mjs`,
511
- `launch-review-smoke.mjs`, and `src/lib/creation` / `src/lib/lifecycle` authoring,
512
- funding, execution and recovery modules. These are behavioral references, not SDK
513
- dependencies. The application consumes the published **`@black-market/sdk` 0.8.1** and
514
- derives current deployment defaults through **`getAddresses`**, as do these examples.
515
- The package pin alone is not live deployment authority. The mined graph
516
- is recorded in the contracts repository at
517
- `contracts/deployments/launch/pool-launch-v1/20261008T000141Z-e174ce6/manifest.json`;
518
- examples resolve its SDK presets and certify live bindings, rather than copying
519
- addresses from an application script.
520
-
521
- | Flow | Shared contract / intentional difference |
522
- | --- | --- |
523
- | Eleven launch wrappers | Unified preparation/admission, explicit mode, exact allocations, immutable config6 fees, protected ordered buys, reviewed next envelopes and canonical Active/custody verification. Eight original descriptors remain; three new matrix additions await user live validation. |
524
- | App Node launch/deploy | Both use valuation-driven recipes with actual supply, per-quote orientation/budgets and native ETH-to-quote Kyber funding. Examples retain an indicative validated API WETH USD seed and the reviewed USDG peg; they default to a dry run, while `--broadcast` supplies explicit authorization independently of mandatory RPC execution proof. |
525
- | Browser wallet | Browser account/provider authority and explicit UI review are application-owned. The examples instead derive an EOA locally, hold one source/submission RPC, recheck chain before signing/sending, and preserve computed signed hashes before one raw send. A browser integration must bind the active account/provider/chain again after review and pass that provider's RPC adapter as `submissionClient`; read proof alone does not authorize wallet submission. |
526
- | App creation funding | All fixed examples use integrated native-input `Swap` funding. Current registry target/spender/code hash, native/quote precision and decoded exact receiver/input/minimum/calldata are checked. No separate swap, native-wrap fallback or ERC20 approval is submitted on refusal. Other app payment paths are not this example runner's signing allowlist. |
527
- | App metadata/image | Both sign chain/core/wallet-bound attribution. Optional `EXAMPLE_IMAGE_PATH` signs actual SHA-256/type/length, uses the exact issued `putImage` URL/headers and requires `completeUpload` verification before launch. Publication/indexed association and one bounded public image GET are also required before example success; transformed served bytes are recorded separately. Unset keeps metadata-only behavior. Signer may be a local key or authenticated V3 keystore; app legal/UI consent remains application-owned. |
528
- | App publication/recovery | Pending HTTP 202 is not success. Examples honor `LaunchPublishPending`/`Retry-After` and require indexed provenance plus fresh confirmation-safe RPC Active and the original activation inclusion before every attempt/final pass. The app's polling UI/two-confirmation/replacement policy differs intentionally from these one-confirmation stop-and-reconcile examples. |
529
- | App review/staged smoke | These app scripts exercise read-only browser review and large matrices, not permission to deploy. SDK `quickstart.ts` and `launch.ts` remain read-only on the source chain. SDK `launch-lifecycle-smoke.ts` is a different, explicitly authorized owned-loopback execution proof, including real ERC20 approval prerequisites when supplied by fixture plans. |
530
- | Historical commitment generator | Retains original independent config4 bytes/hashes for codec regression evidence; no addresses or allocations in that vector should be used to construct the current graph. |
531
-
532
- ### Safe verification without a funded launch
533
-
534
- After rebuilding the package, run the ordinary offline suite (including
535
- `test/launch-example.test.mjs`) and typecheck. The example tests retain endpoint,
536
- chain/account, exact-signing, redaction, pre-broadcast durability, pending-publication
537
- and no-retry behavior, plus residual-burn/no-creator-reserve accounting; they do not
538
- claim an actual chain launch or indexer proof.
539
-
540
- For CLI proof, run `node examples/launch.ts` without required arguments (usage refusal,
541
- no RPC/signing) and `node examples/generate-lifecycle-commitment-fixture.ts` without
542
- output paths (offline historical vector to stdout). Read-only deployed discovery is
543
- `node examples/quickstart.ts`. With a reviewed exact saved current plan, use
544
- `launch.ts --plan ... --rpc ... --mode ...` and retained receipt-reference JSON;
545
- `--mine` performs only local mining and read-only native simulation on the source.
546
- Do **not** run any of the eight configured wallet/API wrappers to verify this review.
547
- Real metadata-session integration needs an owned disposable HTTP service; full custody,
548
- receipt and fee execution proof needs the separately authorized owned fixture below.
549
-
550
-
551
- ## Actual owned-fixture proof
552
-
553
- The manifest must declare `fixtureOnly: true`, exact reviewed graph addresses, and
554
- `executionLimits.provenance.scope: "controlled-local-measurement"`. The plan file
555
- contains Solidity-exported `plans` with encoded-plan/hash/identity/token vectors.
556
- Do not pass a mined mainnet manifest as a writable fixture.
189
+ Use an owner-only exact `LaunchPlanV1` JSON file. `--mine` finalizes bound-hook salts
190
+ offchain; omit it when reviewing an already-finalized plan.
191
+ `--receipts receipts.json`, `--confirmations N`, and `--limits current-limits.json`
192
+ restore receipt references, confirmation depth, and optional tightening limits.
193
+ The CLI never signs, uploads, or publishes. It does not support UFG.
194
+
195
+ ## Run read-only and local smoke checks
557
196
 
558
197
  ```sh
559
- pnpm build
560
- LAUNCH_LIFECYCLE_RPC_URL=http://127.0.0.1:18555 \
561
- LAUNCH_LIFECYCLE_FORK_RPC_URL=http://127.0.0.1:18556 \
562
- LAUNCH_LIFECYCLE_ALLOW_LOCAL_EXECUTION=1 \
563
- node examples/launch-lifecycle-smoke.ts manifest.json sdk-plans.json
198
+ pnpm test
199
+ node examples/quickstart.ts
200
+ node examples/generate-lifecycle-commitment-fixture.ts
564
201
  ```
565
202
 
566
- This explicitly authorized command executes disposable fixture transactions and
567
- restores snapshots per plan/mode. It exercises ordered buys, canonical Active state,
568
- permanent custody, typed deployment provenance, V3 no-argument `claimAndSplit()`,
569
- reserved owner/developer balances, and authenticated author claims. Cursor completion
570
- and payment success stay separate.
571
-
572
- For chain boundary regressions, also set `LAUNCH_LIFECYCLE_MANIFEST` and
573
- `LAUNCH_LIFECYCLE_FIXTURES`, then run `node --test test/lifecycle-chain.test.mjs` with
574
- the same local-execution environment. Ordinary `pnpm test` does not authorize chain writes.
203
+ `pnpm test` is the offline unit suite. The generator prints a historical ABI vector,
204
+ not a current executable plan. Do not run a funded launch wrapper as a smoke check.
205
+ Owned-fork, owned-fixture, and HTTP API test commands are in the
206
+ [SDK reference](../docs/reference.md#run-owned-fixture-and-api-checks); they require
207
+ separate disposable infrastructure and explicit permission for any writes.