@artblocks/abx-cli 0.1.0-alpha.41 → 0.1.0-alpha.42

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.
@@ -1 +1 @@
1
- {"version":3,"file":"riskgate.d.ts","sourceRoot":"","sources":["../src/riskgate.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAgE,KAAK,OAAO,EAAkB,MAAM,oBAAoB,CAAC;AAChI,OAAO,EAAS,KAAK,IAAI,EAAE,KAAK,UAAU,EAAE,KAAK,UAAU,EAAC,MAAM,aAAa,CAAC;AAChF,OAAO,EAAW,KAAK,KAAK,EAAC,MAAM,YAAY,CAAC;AAOhD;6FAC6F;AAC7F,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAoBhD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAUpD;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAO9E;AAaD,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,eAAe,GAAG,cAAc,GAAG,SAAS,CAAC;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAkBjD;AA4DD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB;+DAC2D;IAC3D,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;;;GAQG;AACH,wBAAsB,SAAS,CAAC,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CA+BtH"}
1
+ {"version":3,"file":"riskgate.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AAQ,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAkCtH"}
package/dist/riskgate.js CHANGED
@@ -15,9 +15,9 @@
15
15
  * free just by routing through here — there is no owner-op-specific reason they lacked it; it was
16
16
  * simply never wired.
17
17
  */
18
- import { decodeErrorResult, zeroAddress } from 'viem';
18
+ import { decodeErrorResult, formatEther, zeroAddress } from 'viem';
19
19
  import { createInterface } from 'node:readline';
20
- import { assertChainId, envSigningKey, makePublicClient, seriesCodeAbi } from '@artblocks/abx-sdk';
20
+ import { assertChainId, envSigningKey, makePublicClient, pinGas, seriesCodeAbi, GasEstimateBelowFloorError, } from '@artblocks/abx-sdk';
21
21
  import { signTx } from './signer.js';
22
22
  import { isDryRun } from './flags.js';
23
23
  // ── tiny ANSI (kept local — every module here stands alone; see signer.ts/ownerops.ts) ───────
@@ -134,18 +134,36 @@ export function revertReason(err) {
134
134
  return short;
135
135
  }
136
136
  /**
137
- * `eth_call` the prepared transaction against current state, and say what would happen.
137
+ * Simulate the prepared transaction against current state, and say what would happen — honestly.
138
138
  *
139
139
  * This is what makes `--dry-run` an *answer* rather than an echo of its own input. It matters most
140
140
  * for a **multicall** — `attach`'s batched pairs, `deploy-code`'s setup — because a multicall is one
141
141
  * transaction, so simulating it exercises the whole sequence atomically against real state, with no
142
142
  * fork and no new surface.
143
143
  *
144
- * Reports **unknown**, never a false green, whenever it cannot actually prove anything: no signer to
145
- * simulate as (an owner-gated call from nobody reverts for the wrong reason), a contract deploy, a
146
- * target that does not exist yet, or an unreachable node.
144
+ * A dry run that reports `would-succeed` for a send whose real gas turned out to need 49% more than
145
+ * this function used to check, then failed for real, is a preview asserting an outcome it never
146
+ * established the same class of bug fixed for `verify --remote --json` (see `cmdVerifyRemote`'s
147
+ * fail-closed comment in commands/project.ts): a payload must not claim success it hasn't earned.
148
+ * Two things had to be true before this could say "would succeed", and neither was checked:
149
+ * 1. The call executes without reverting — the ORIGINAL check (an `eth_call`, now folded into
150
+ * {@link pinGas} below instead of a separate unconstrained call, so the preview shares the
151
+ * real send's own gas math, not a second copy of it that could quietly disagree).
152
+ * 2. The signer can actually PAY for it. `estimateGas` succeeding proves the call is valid; it says
153
+ * nothing about whether the account sending it has the ETH to cover `gas × gasPrice (+ value)`.
154
+ * A preview that skips this is not "optimistic", it is wrong — the failure this fixes.
155
+ *
156
+ * Reports **unknown**, never a false green, whenever it cannot actually prove EITHER of those: no
157
+ * signer to simulate as, a contract deploy, a target that does not exist yet, an unreachable node, or
158
+ * a gas estimate that comes back below the transaction's provable floor even after retrying (the
159
+ * exact same refusal a real send makes — see {@link GasEstimateBelowFloorError}). `unknown` is never
160
+ * collapsed into `would-succeed` (an optimistic guess) or `would-revert` (a false alarm) — it says
161
+ * plainly that the question could not be answered, and why.
162
+ *
163
+ * `clientOverride` exists for tests: production callers always omit it and get a real client built
164
+ * from `chainKey`, exactly as before.
147
165
  */
148
- async function simulateDryRun(prepared, chainKey, expectedSigner, narrate = true) {
166
+ async function simulateDryRun(prepared, chainKey, expectedSigner, narrate = true, clientOverride) {
149
167
  const label = 'simulation'.padEnd(12);
150
168
  const unknown = (why) => {
151
169
  if (narrate)
@@ -162,24 +180,47 @@ async function simulateDryRun(prepared, chainKey, expectedSigner, narrate = true
162
180
  // preview is the product; the simulation is a bonus). So even constructing the client is guarded —
163
181
  // `resolveChain` throws on a chain key it doesn't know, and that must degrade to `unknown`, never
164
182
  // turn a preview into a failure.
183
+ let client;
184
+ try {
185
+ client = clientOverride ?? makePublicClient({ chainKey });
186
+ }
187
+ catch (err) {
188
+ return unknown(`could not run the simulation (${revertReason(err)})`);
189
+ }
165
190
  try {
166
- const client = makePublicClient({ chainKey });
167
191
  const code = await client.getCode({ address: prepared.to });
168
192
  if (!code || code === '0x')
169
193
  return unknown(`${prepared.to} has no code yet on this chain`);
170
- await client.call({
171
- account: expectedSigner,
194
+ }
195
+ catch (err) {
196
+ return unknown(`could not run the simulation (${revertReason(err)})`);
197
+ }
198
+ // Reuse the REAL send's own gas selection (`pinGas`, execute.ts — the exact function
199
+ // `makeHotSender` calls at send time) instead of a second, separately-written `eth_call`. Two
200
+ // benefits: (a) the preview can never independently drift from what the send would actually do,
201
+ // and (b) a transaction whose real send would REFUSE (every estimate attempt below the provable
202
+ // floor) is reported as such here too, rather than "succeeding" against an unconstrained call.
203
+ let gas;
204
+ try {
205
+ gas = await pinGas(client, {
206
+ from: expectedSigner,
172
207
  to: prepared.to,
173
208
  data: prepared.data,
174
- ...(prepared.value && prepared.value !== '0x0' ? { value: BigInt(prepared.value) } : {}),
209
+ value: prepared.value,
210
+ gasFloor: prepared.gasFloor,
175
211
  });
176
- if (narrate)
177
- console.log(` ${dim(label)} ${C.green}✓${C.reset} would succeed ${dim('(eth_call against current state)')}`);
178
- return { status: 'would-succeed' };
179
212
  }
180
213
  catch (err) {
181
- // A node that cannot answer is not a failing transaction — do not report one as the other.
214
+ if (err instanceof GasEstimateBelowFloorError) {
215
+ // Not a contract-logic revert and not a network hiccup — this is "cannot be determined safe",
216
+ // the same refusal a real send makes. Reported as `unknown`, never folded into `would-revert`
217
+ // (nothing was proven to revert) or `would-succeed` (nothing was proven safe either).
218
+ return unknown(`the gas estimate (${err.estimate}) came back below the ${err.floor} this transaction provably needs, ` +
219
+ `even after retrying — the same reason a real send would refuse rather than risk an under-funded ` +
220
+ `transaction. Retry in a few seconds, or against a different RPC.`);
221
+ }
182
222
  const reason = revertReason(err);
223
+ // A node that cannot answer is not a failing transaction — do not report one as the other.
183
224
  if (/fetch|network|timeout|ECONN|unknown chain/i.test(reason))
184
225
  return unknown(`could not run the simulation (${reason})`);
185
226
  if (narrate) {
@@ -188,6 +229,36 @@ async function simulateDryRun(prepared, chainKey, expectedSigner, narrate = true
188
229
  }
189
230
  return { status: 'would-revert', reason };
190
231
  }
232
+ // The call is provably executable at `gas` — what's left is whether the signer can actually PAY
233
+ // for it. This is the check that was missing entirely: a preview that never compares cost against
234
+ // balance is asserting an outcome it has not earned.
235
+ let gasPrice;
236
+ let balance;
237
+ try {
238
+ [gasPrice, balance] = await Promise.all([client.getGasPrice(), client.getBalance({ address: expectedSigner })]);
239
+ }
240
+ catch (err) {
241
+ // We proved the call itself would succeed; we just can't price it. Say so — do NOT fall back to
242
+ // a bare "would succeed" that quietly drops the affordability question it was just asked.
243
+ return unknown(`the call would succeed, but the cost to send it could not be priced (${revertReason(err)})`);
244
+ }
245
+ const value = prepared.value && prepared.value !== '0x0' ? BigInt(prepared.value) : 0n;
246
+ const cost = gas * gasPrice + value;
247
+ const priced = { estimatedGas: gas.toString(), estimatedCostWei: cost.toString(), balanceWei: balance.toString() };
248
+ if (balance < cost) {
249
+ const reason = `insufficient funds — this send needs ≈${formatEther(cost)} ETH (${gas} gas × ${formatEther(gasPrice)} ` +
250
+ `ETH/gas${value > 0n ? ` + ${formatEther(value)} ETH value` : ''}) but ${expectedSigner} has only ` +
251
+ `${formatEther(balance)} ETH — short by ${formatEther(cost - balance)} ETH.`;
252
+ if (narrate) {
253
+ console.log(` ${dim(label)} ${C.orange}✗ would FAIL${C.reset} — ${reason}`);
254
+ console.log(` ${dim(''.padEnd(12))} ${dim('sending this now would run out of funds before it lands.')}`);
255
+ }
256
+ return { status: 'would-revert', reason, ...priced };
257
+ }
258
+ if (narrate) {
259
+ console.log(` ${dim(label)} ${C.green}✓${C.reset} would succeed ${dim(`(≈${gas} gas, ≈${formatEther(cost)} ETH — signer holds ${formatEther(balance)} ETH)`)}`);
260
+ }
261
+ return { status: 'would-succeed', ...priced };
191
262
  }
192
263
  /**
193
264
  * The one send choke point for a SINGLE already-prepared write: `--dry-run` preview (nothing sent,
@@ -202,19 +273,22 @@ export async function gatedSend(provider, flags, opts) {
202
273
  if (isDryRun(flags)) {
203
274
  const prepared = await resolveProvider(provider, opts.expectedSigner ?? zeroAddress);
204
275
  if (flags.json !== undefined) {
205
- const simulation = await simulateDryRun(prepared, opts.chainKey, opts.expectedSigner, false);
276
+ const simulation = await simulateDryRun(prepared, opts.chainKey, opts.expectedSigner, false, opts.client);
206
277
  console.log(JSON.stringify({
207
278
  dryRun: true,
208
279
  sent: false,
209
280
  lane: laneFromFlags(flags),
210
281
  expectedSigner: opts.expectedSigner ?? null,
211
282
  transaction: prepared,
283
+ // `transaction.gasFloor` (when present) is a PROVEN MINIMUM used to detect an implausible
284
+ // gas estimate — not a prediction of total cost. `simulation.estimatedGas`/`estimatedCostWei`
285
+ // are the real numbers, from the same gas selection the send itself uses; trust those.
212
286
  simulation,
213
287
  }, null, 2));
214
288
  }
215
289
  else {
216
290
  printDryRunPreview(prepared, opts.expectedSigner);
217
- await simulateDryRun(prepared, opts.chainKey, opts.expectedSigner);
291
+ await simulateDryRun(prepared, opts.chainKey, opts.expectedSigner, true, opts.client);
218
292
  console.log(dim(`\n Re-run without --dry-run to send (lane: ${laneFromFlags(flags)}).\n`));
219
293
  }
220
294
  return null;
@@ -1 +1 @@
1
- {"version":3,"file":"riskgate.js","sourceRoot":"","sources":["../src/riskgate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAC,iBAAiB,EAAE,WAAW,EAAC,MAAM,MAAM,CAAC;AACpD,OAAO,EAAC,eAAe,EAAC,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAC,aAAa,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,EAAgC,MAAM,oBAAoB,CAAC;AAChI,OAAO,EAAC,MAAM,EAA8C,MAAM,aAAa,CAAC;AAChF,OAAO,EAAC,QAAQ,EAAa,MAAM,YAAY,CAAC;AAEhD,gGAAgG;AAChG,MAAM,CAAC,GAAG,EAAC,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,EAAE,gBAAgB,EAAC,CAAC;AACjH,MAAM,GAAG,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,GAAG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AC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS;QACjD,WAAW,EAAE,KAAK,CAAC,eAAe,CAAC;KACpC,CAAC,CAAC;AACL,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artblocks/abx-cli",
3
- "version": "0.1.0-alpha.41",
3
+ "version": "0.1.0-alpha.42",
4
4
  "license": "MIT",
5
5
  "description": "Command-line interface for deploying, operating, indexing, and serving ABX projects.",
6
6
  "type": "module",
@@ -39,13 +39,13 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "viem": "^2.56.0",
42
- "@artblocks/abx-sdk": "0.1.0-alpha.31",
43
- "@artblocks/abx-indexer": "0.1.0-alpha.32",
44
- "@artblocks/abx-storage": "0.1.0-alpha.31",
45
- "@artblocks/abx-token-api": "0.1.0-alpha.34"
42
+ "@artblocks/abx-sdk": "0.1.0-alpha.32",
43
+ "@artblocks/abx-indexer": "0.1.0-alpha.33",
44
+ "@artblocks/abx-token-api": "0.1.0-alpha.35",
45
+ "@artblocks/abx-storage": "0.1.0-alpha.32"
46
46
  },
47
47
  "optionalDependencies": {
48
- "@artblocks/abx-effects": "0.1.0-alpha.31"
48
+ "@artblocks/abx-effects": "0.1.0-alpha.32"
49
49
  },
50
50
  "devDependencies": {
51
51
  "playwright": "1.62.1"
package/skill/SKILL.md CHANGED
@@ -9,7 +9,7 @@ description: >-
9
9
  change an ABX collection, or to determine whether ABX supports a mechanic.
10
10
  compatibility: Drives @artblocks/abx-cli on Node 22.13+. Co-versioned with the CLI; install or refresh with `abx skill install`.
11
11
  metadata:
12
- version: "0.1.0-alpha.41"
12
+ version: "0.1.0-alpha.42"
13
13
  ---
14
14
 
15
15
  # ABX
@@ -26,6 +26,20 @@ renderers, marketplace stills and traits, seeds, dependencies, parameters, and c
26
26
  | Solidity-computed fields | `--image-renderer` and/or `--attributes-renderer` | on-chain SVG image and/or traits |
27
27
  | Hybrid | script plus field renderers | program animation plus Solidity image/traits |
28
28
 
29
+ `--script` splits the source into on-chain chunks automatically (default ~22 KB per chunk, the
30
+ practical SSTORE2/EIP-170 limit). Pass `--chunk-size <bytes>` to override the split size — smaller
31
+ values force a multi-chunk program cheaply, which is the fast way to exercise multi-chunk behavior on
32
+ a tiny test script rather than needing a large real one. `abx replace-script`
33
+ ([operate.md](operate.md#replacing-an-unlocked-script)) accepts the same flag.
34
+
35
+ There is no fixed supported script-size ceiling. Post-deploy setup (chunks, PostParam schemas,
36
+ dependency declarations, on-chain-URI legs, reserve mints) rides one combined transaction when it
37
+ fits; a large script splits it into several gas-bounded transactions instead — chunks first, then the
38
+ remaining config, mints strictly last. The dry run's `transactions`/`approvals` reports the real
39
+ count for the whole plan; if any single one is interrupted mid-sequence, `--resume` finishes it (see
40
+ [diagnose.md](diagnose.md#incomplete-deployments)) — every non-mint leg is idempotent, so re-running
41
+ resume is always safe.
42
+
29
43
  Without `--copies`, the contract is SeriesCode (ERC-721). With `--copies <n|open>`, it is EditionCode
30
44
  (ERC-1155): N generated ids, each with multiple copies. EditionCode currently supports scripts,
31
45
  directory builds (`--code-dir`), dependencies, field renderers, deterministic per-id off-chain stills
@@ -148,6 +148,12 @@ that already matches is never re-sent), folds every write and remove into ONE at
148
148
  a revert can never leave a half-applied script), and reads the completed script back to verify exact
149
149
  reassembly before reporting success. Prefer this over hand-encoding `setScriptChunk` calls.
150
150
 
151
+ `--chunk-size <bytes>` overrides the default on-chain split size (~22 KB) — the same flag
152
+ `deploy-code` accepts (see [code.md](code.md#choose-the-runtime-lane)). A small value forces a
153
+ multi-chunk layout, which is the cheap way to exercise growing/shrinking a program across several
154
+ chunks (including the on-chain removal of surplus chunks when shrinking) without needing a large
155
+ real program.
156
+
151
157
  ### Refresh and URI events
152
158
 
153
159
  `abx refresh` asks external marketplaces to fetch metadata again; it does not fix the metadata or
@@ -198,6 +204,12 @@ Important qualifications:
198
204
  - A locked pointer to an upgradeable proxy fixes the address, not its behavior.
199
205
  - A transfer-hook address represents a standing ability to veto mints/transfers. Freezing an empty
200
206
  hook set is the proof that this power cannot later be added.
207
+ - `lock-field` targets one scope (token, or `--collection`); a token-scope value wins over a
208
+ collection-scope one when both are set. Locking a scope that ISN'T actually serving the value
209
+ freezes an empty or overridden slot, not what a viewer sees — the CLI refuses this by default and
210
+ names the correct command; only `--force-field` proceeds (with a loud warning, never silently).
211
+ Check `abx tokenuri --token <id>`'s `abx_provenance` (or just try the lock without `--force-field`)
212
+ before assuming a scope holds the value.
201
213
 
202
214
  Use `abx verify` and direct state reads to enumerate what remains mutable. Describe the guarantee as
203
215
  specific stored values and addresses that can no longer change; do not promise immutable output unless