@artblocks/abx-cli 0.1.0-alpha.57 → 0.1.0-alpha.59
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.
- package/CHANGELOG.md +14 -0
- package/dist/capabilities.d.ts +1 -1
- package/dist/capabilities.js +1 -1
- package/dist/capabilities.js.map +1 -1
- package/dist/commands/deploy.d.ts +6 -5
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +66 -105
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/project.d.ts.map +1 -1
- package/dist/commands/project.js +3 -1
- package/dist/commands/project.js.map +1 -1
- package/dist/creator-signer.d.ts +10 -0
- package/dist/creator-signer.d.ts.map +1 -1
- package/dist/creator-signer.js +33 -4
- package/dist/creator-signer.js.map +1 -1
- package/dist/flags.d.ts +7 -1
- package/dist/flags.d.ts.map +1 -1
- package/dist/flags.js +26 -0
- package/dist/flags.js.map +1 -1
- package/dist/main.js +4 -4
- package/dist/main.js.map +1 -1
- package/dist/signer.d.ts +1 -1
- package/package.json +3 -3
- package/skill/SKILL.md +2 -2
- package/skill/reference/services.md +8 -5
- package/skill/reference/setup.md +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @artblocks/abx-cli
|
|
2
2
|
|
|
3
|
+
## 0.1.0-alpha.59
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- c324a8f: Make sponsored deployment previews resolve the existing ABX creator wallet without provisioning external state, so the preview and real send use the same owner, mint recipient, and deterministic salt.
|
|
8
|
+
|
|
9
|
+
## 0.1.0-alpha.58
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- b8f2876: Keep sponsored deploy guidance consistent: an ABX creator wallet no longer receives a faucet warning when its native balance is intentionally zero.
|
|
14
|
+
- e89896a: Reject deterministic deploy salts reserved to a different signer before authorization or broadcast.
|
|
15
|
+
- cf2708c: Allow the beta creator-wallet sponsorship lane on Base mainnet when the live provider and account explicitly advertise eligibility, while retaining Base Sepolia as the recommended first run.
|
|
16
|
+
|
|
3
17
|
## 0.1.0-alpha.57
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/capabilities.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export declare const ABX_CAPABILITIES: {
|
|
|
29
29
|
readonly flag: "--sponsor";
|
|
30
30
|
readonly summary: "account-bound ABX creator wallet; ABX Services pays eligible gas";
|
|
31
31
|
readonly supportLevel: "beta";
|
|
32
|
-
readonly chainIds: readonly [84532];
|
|
32
|
+
readonly chainIds: readonly [8453, 84532];
|
|
33
33
|
readonly limits: readonly ["zero value", "3,000,000 gas per transaction", "no direct CREATE", "no staged --onchain-image"];
|
|
34
34
|
};
|
|
35
35
|
readonly unsigned: {
|
package/dist/capabilities.js
CHANGED
|
@@ -21,7 +21,7 @@ export const ABX_CAPABILITIES = {
|
|
|
21
21
|
flag: '--sponsor',
|
|
22
22
|
summary: 'account-bound ABX creator wallet; ABX Services pays eligible gas',
|
|
23
23
|
supportLevel: 'beta',
|
|
24
|
-
chainIds: [84_532],
|
|
24
|
+
chainIds: [8_453, 84_532],
|
|
25
25
|
limits: ['zero value', '3,000,000 gas per transaction', 'no direct CREATE', 'no staged --onchain-image'],
|
|
26
26
|
},
|
|
27
27
|
unsigned: { flag: '--unsigned', summary: 'print for an external signer', supportLevel: 'supported' },
|
package/dist/capabilities.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../src/capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAE,iBAAiB,EAAE,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AAGtF;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,aAAa,EAAE,CAAC;IAChB,YAAY,EAAE,iBAAiB;IAC/B,MAAM,EAAE,aAAa;I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type OpenSeaAttribute, type Proje
|
|
|
3
3
|
import { type Hex } from 'viem';
|
|
4
4
|
import { type StorageOverrides } from '../config.js';
|
|
5
5
|
import { type Flags } from '../flags.js';
|
|
6
|
+
import { type Lane } from '../signer.js';
|
|
6
7
|
export declare const DIMENSIONS: Record<string, {
|
|
7
8
|
label: string;
|
|
8
9
|
aliases: string[];
|
|
@@ -23,9 +24,9 @@ export declare function copiesOneNote(cmd: string): string;
|
|
|
23
24
|
export declare function parseNonNegativeIntFlag(raw: string, flag: string): bigint;
|
|
24
25
|
/**
|
|
25
26
|
* A `--dry-run` computes the deterministic deploy address, which is a pure function of
|
|
26
|
-
* (factory, salt, deployer) — so it needs a deployer even though it signs nothing. Resolve
|
|
27
|
-
*
|
|
28
|
-
*
|
|
27
|
+
* (factory, salt, deployer) — so it needs a deployer even though it signs nothing. Resolve the
|
|
28
|
+
* address from the selected lane: the account-bound creator wallet for `--sponsor`, otherwise
|
|
29
|
+
* `--for` or the env key. Fail EARLY rather than printing a plan for a different eventual signer.
|
|
29
30
|
*/
|
|
30
31
|
/**
|
|
31
32
|
* A dry run only checks whether a factory address is CONFIGURED, not whether it has code on this
|
|
@@ -51,8 +52,8 @@ export declare function assertRealIdentity(flags: Flags, o: {
|
|
|
51
52
|
symbol: string;
|
|
52
53
|
dryRun: boolean;
|
|
53
54
|
}): void;
|
|
54
|
-
export declare function
|
|
55
|
-
export declare function warnUnfunded(publicClient: PublicClient, address: Address): Promise<void>;
|
|
55
|
+
export declare function resolvePreviewDeployer(flags: Flags, lane: Lane, required?: boolean): Promise<Address | null>;
|
|
56
|
+
export declare function warnUnfunded(publicClient: PublicClient, address: Address, lane: Lane): Promise<void>;
|
|
56
57
|
export declare function shArg(v: string): string;
|
|
57
58
|
export declare function deployCommandLine(flags: Flags, salt: string): string;
|
|
58
59
|
export declare function deploySeriesCommandLine(flags: Flags, salt: string): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/commands/deploy.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAC,eAAe,EAAC,MAAM,wBAAwB,CAAC;AACvD,OAAO,EACL,KAAK,OAAO,EAMZ,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,YAAY,EAMjB,KAAK,qBAAqB,EAE1B,KAAK,aAAa,EAMlB,KAAK,UAAU,EAoDhB,MAAM,oBAAoB,CAAC;AAY5B,OAAO,EAAC,KAAK,GAAG,EAAqD,MAAM,MAAM,CAAC;AAClF,OAAO,EAGL,KAAK,gBAAgB,EAmBtB,MAAM,cAAc,CAAC;AAEtB,OAAO,
|
|
1
|
+
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/commands/deploy.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAC,eAAe,EAAC,MAAM,wBAAwB,CAAC;AACvD,OAAO,EACL,KAAK,OAAO,EAMZ,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,YAAY,EAMjB,KAAK,qBAAqB,EAE1B,KAAK,aAAa,EAMlB,KAAK,UAAU,EAoDhB,MAAM,oBAAoB,CAAC;AAY5B,OAAO,EAAC,KAAK,GAAG,EAAqD,MAAM,MAAM,CAAC;AAClF,OAAO,EAGL,KAAK,gBAAgB,EAmBtB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAEL,KAAK,KAAK,EAMX,MAAM,aAAa,CAAC;AAgErB,OAAO,EAA6C,KAAK,IAAI,EAAkB,MAAM,cAAc,CAAC;AA2BpG,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAC,CAGzE,CAAC;AACF,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOrD;AAQD;;;gEAGgE;AAChE,wBAAgB,WAAW,CAAC,GAAG,EA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AE,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CA+nBtH;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,4BAA4B,CAChD,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,OAAO,EACf,QAAQ,GAAE,MAAM,GAAG,OAAgB,GAClC,OAAO,CAAC,OAAO,CAAC,CAmClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAsB,qBAAqB,CACzC,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,OAAO,CAAC,CAoDlB"}
|
package/dist/commands/deploy.js
CHANGED
|
@@ -21,7 +21,7 @@ import { DEFAULT_PORT, contentHash, generateContent, resolveBaseUrl, startTokenA
|
|
|
21
21
|
import { encodeFunctionData, getAddress, toHex, zeroAddress } from 'viem';
|
|
22
22
|
import { CHAIN, explorerBase, assertTurboFundsForUpload, backendResolution, collectContentLocators, ensureArweaveIdentityForUpload, factoryAddress, faucetHint, localIndexer, loopbackBaseUrl, noteArweavePlan, noteStorageReadiness, rendererAddress, seriesFactoryAddress, oneOfOneEditionFactoryAddress, editionFactoryAddress, editionCodeFactoryAddress, storageOptions, storageOverrides, storageSignerChoice, } from '../config.js';
|
|
23
23
|
import { parseDepFlag } from '../deps.js';
|
|
24
|
-
import { isDryRun, parseSaltFlag, refuseStrayFlags, warnSignWithoutFor } from '../flags.js';
|
|
24
|
+
import { assertSaltGuardForDeployer, isDryRun, parseSaltFlag, refuseStrayFlags, warnSignWithoutFor, } from '../flags.js';
|
|
25
25
|
import { isEditionContract } from '../kind.js';
|
|
26
26
|
import { jsonSafe, withJson } from '../jsonout.js';
|
|
27
27
|
import { planOnChainScript } from '../script-chunks.js';
|
|
@@ -34,7 +34,7 @@ import { describeSchema, editionSchemaAdvisory, parseSchemaSpecs } from '../sche
|
|
|
34
34
|
import { parseSeriesTraits } from '../series-traits.js';
|
|
35
35
|
import { decodeOnChainJson } from '../served.js';
|
|
36
36
|
import { openWalletSession, signHotSequence, signTx } from '../signer.js';
|
|
37
|
-
import { assertSponsorConfigured, openSponsoredSession } from '../creator-signer.js';
|
|
37
|
+
import { assertSponsorConfigured, openSponsoredSession, sponsoredPreviewAddress } from '../creator-signer.js';
|
|
38
38
|
// ── plan-object warning capture ──────────────────────────────────────────────────────────────────
|
|
39
39
|
// The structured `--json` plan object (deploy-plan.ts) reports "the warnings the lane raised"
|
|
40
40
|
// alongside every other computed field — but ~400 `warn()` call sites in this file exist purely as
|
|
@@ -109,9 +109,9 @@ export function parseNonNegativeIntFlag(raw, flag) {
|
|
|
109
109
|
}
|
|
110
110
|
/**
|
|
111
111
|
* A `--dry-run` computes the deterministic deploy address, which is a pure function of
|
|
112
|
-
* (factory, salt, deployer) — so it needs a deployer even though it signs nothing. Resolve
|
|
113
|
-
*
|
|
114
|
-
*
|
|
112
|
+
* (factory, salt, deployer) — so it needs a deployer even though it signs nothing. Resolve the
|
|
113
|
+
* address from the selected lane: the account-bound creator wallet for `--sponsor`, otherwise
|
|
114
|
+
* `--for` or the env key. Fail EARLY rather than printing a plan for a different eventual signer.
|
|
115
115
|
*/
|
|
116
116
|
/**
|
|
117
117
|
* A dry run only checks whether a factory address is CONFIGURED, not whether it has code on this
|
|
@@ -154,13 +154,23 @@ export function assertRealIdentity(flags, o) {
|
|
|
154
154
|
throw new Error('refusing to write tool placeholders as your public on-chain identity — pass --name "Your Title" --symbol SYM ' +
|
|
155
155
|
'(or --yes to accept the defaults). On-chain identity is effectively permanent.');
|
|
156
156
|
}
|
|
157
|
-
export function
|
|
157
|
+
export async function resolvePreviewDeployer(flags, lane, required = true) {
|
|
158
|
+
if (lane === 'sponsor') {
|
|
159
|
+
const sponsored = await sponsoredPreviewAddress(CHAIN);
|
|
160
|
+
if (flags.for && String(flags.for).toLowerCase() !== sponsored.toLowerCase()) {
|
|
161
|
+
throw new Error(`--for ${String(flags.for)} does not match this account's ABX creator wallet ${sponsored}. ` +
|
|
162
|
+
'A sponsored preview must use the same owner and CREATE2 salt as the real sponsored send.');
|
|
163
|
+
}
|
|
164
|
+
return sponsored;
|
|
165
|
+
}
|
|
158
166
|
if (flags.for)
|
|
159
|
-
return;
|
|
167
|
+
return flags.for;
|
|
160
168
|
try {
|
|
161
|
-
makeWalletClient({ chainKey: CHAIN });
|
|
169
|
+
return makeWalletClient({ chainKey: CHAIN }).account.address;
|
|
162
170
|
}
|
|
163
171
|
catch {
|
|
172
|
+
if (!required)
|
|
173
|
+
return null;
|
|
164
174
|
throw new Error('dry run needs a deployer address to compute the deterministic deploy address — pass --for 0x.. ' +
|
|
165
175
|
'(a preview signs nothing, so no key is needed). For the REAL deploy with no key in .env, use the ' +
|
|
166
176
|
'wallet lane: --sign --for 0x.. (you approve in your own wallet).');
|
|
@@ -168,7 +178,11 @@ export function assertPreviewDeployer(flags) {
|
|
|
168
178
|
}
|
|
169
179
|
// Funding preflight — a 0-balance signer fails only at the tx, with a confusing error. Surface it
|
|
170
180
|
// up front. Especially the wallet lane (--sign/--for), which has no env key for `doctor` to check.
|
|
171
|
-
|
|
181
|
+
// The sponsored lane is deliberately allowed to have a zero balance: funding is the service's job,
|
|
182
|
+
// and telling that creator to visit a faucet contradicts the lane they explicitly selected.
|
|
183
|
+
export async function warnUnfunded(publicClient, address, lane) {
|
|
184
|
+
if (lane === 'sponsor')
|
|
185
|
+
return;
|
|
172
186
|
try {
|
|
173
187
|
const bal = await publicClient.getBalance({ address });
|
|
174
188
|
if (bal === 0n)
|
|
@@ -722,8 +736,7 @@ export async function cmdDeployBody(flags, serveAfter, emit) {
|
|
|
722
736
|
// A keyless preview needs `--for` (the address is a pure function of factory+salt+deployer). Check
|
|
723
737
|
// it HERE, before the trust-anchor/content/plan steps print — hitting this after a wall of output
|
|
724
738
|
// reads as "it half-worked", and a first-timer previewing with no key in .env always hits it.
|
|
725
|
-
|
|
726
|
-
assertPreviewDeployer(flags);
|
|
739
|
+
const previewDeployer = dryRun ? await resolvePreviewDeployer(flags, lane) : null;
|
|
727
740
|
const publicClient = makePublicClient({ chainKey: CHAIN });
|
|
728
741
|
// Verify the RPC really is CHAIN before any send (factory/renderer/staging/deploy). A dry run
|
|
729
742
|
// sends nothing, but it DOES read the chain (predict address, resolve the factory/renderer), so
|
|
@@ -745,7 +758,7 @@ export async function cmdDeployBody(flags, serveAfter, emit) {
|
|
|
745
758
|
catch { /* no key yet — later steps handle it */ }
|
|
746
759
|
}
|
|
747
760
|
if (signer)
|
|
748
|
-
await warnUnfunded(publicClient, signer);
|
|
761
|
+
await warnUnfunded(publicClient, signer, lane);
|
|
749
762
|
}
|
|
750
763
|
// `deploy` surfaces the trust anchor as a step; the demo does NOT. It briefly opened on "only this
|
|
751
764
|
// factory can make a token that IS an ABX token", which is simply false — anything that follows the
|
|
@@ -974,6 +987,8 @@ export async function cmdDeployBody(flags, serveAfter, emit) {
|
|
|
974
987
|
const buildForDeployer = async (deployer) => {
|
|
975
988
|
assertLaneCanSign(flags); // no upload before we know this run can be signed — see `assertLaneCanSign`
|
|
976
989
|
const salt = explicitSalt ?? saltFor(deployer);
|
|
990
|
+
if (explicitSalt)
|
|
991
|
+
assertSaltGuardForDeployer(explicitSalt, deployer);
|
|
977
992
|
const clone = await predictClone(publicClient, { factory, salt });
|
|
978
993
|
// A baked on-chain image (--onchain-image) replaces prepareContent's image field —
|
|
979
994
|
// the bytes already live on-chain behind the reader, nothing to custody or hash. On a
|
|
@@ -1024,22 +1039,10 @@ export async function cmdDeployBody(flags, serveAfter, emit) {
|
|
|
1024
1039
|
// no branch has run yet; every path that reaches the sent `emit()` has set it by then.
|
|
1025
1040
|
let deployerAddr;
|
|
1026
1041
|
if (dryRun) {
|
|
1027
|
-
|
|
1028
|
-
if (flags.for)
|
|
1029
|
-
deployer = flags.for;
|
|
1030
|
-
else {
|
|
1031
|
-
try {
|
|
1032
|
-
deployer = makeWalletClient({ chainKey: CHAIN }).account.address;
|
|
1033
|
-
}
|
|
1034
|
-
catch {
|
|
1035
|
-
throw new Error('dry run needs a deployer address to compute the deterministic deploy address — pass --for 0x.. ' +
|
|
1036
|
-
'(a preview signs nothing, so no key is needed). For the REAL deploy with no key in .env, use the ' +
|
|
1037
|
-
'wallet lane: --sign --for 0x.. (you approve in your own wallet).');
|
|
1038
|
-
}
|
|
1039
|
-
}
|
|
1042
|
+
const deployer = previewDeployer;
|
|
1040
1043
|
const { clone: predicted, params, salt, contentNote } = await buildForDeployer(deployer);
|
|
1041
1044
|
info(`deployer ${deployer}`);
|
|
1042
|
-
await warnUnfunded(publicClient, deployer); // advisory
|
|
1045
|
+
await warnUnfunded(publicClient, deployer, lane); // advisory for self-funded signing lanes
|
|
1043
1046
|
// The address is a pure function of (factory, salt), and without --salt this salt was just
|
|
1044
1047
|
// freshly randomly reserved (saltFor mixes in entropy) — a plain re-run gets a DIFFERENT one, so
|
|
1045
1048
|
// the address below is real for THIS preview but not reproducible by habit. Rather than print an
|
|
@@ -1445,8 +1448,7 @@ export async function cmdDeployOneOfOneEditionBody(flags, emit) {
|
|
|
1445
1448
|
throw new Error('Staging an on-chain image (--onchain-image) needs interactive signing — each chunk tx feeds ' +
|
|
1446
1449
|
"the next. Use the hot lane (a funded key) or --sign (browser wallet); --unsigned and the initial --sponsor beta do not stage content.");
|
|
1447
1450
|
}
|
|
1448
|
-
|
|
1449
|
-
assertPreviewDeployer(flags);
|
|
1451
|
+
const previewDeployer = dryRun ? await resolvePreviewDeployer(flags, lane) : null;
|
|
1450
1452
|
const publicClient = makePublicClient({ chainKey: CHAIN });
|
|
1451
1453
|
await assertChainId(CHAIN, { allowUnreachable: dryRun });
|
|
1452
1454
|
// --721c reuses the SAME flag + value grammar to enroll ERC-1155C instead — see the locked
|
|
@@ -1464,7 +1466,7 @@ export async function cmdDeployOneOfOneEditionBody(flags, emit) {
|
|
|
1464
1466
|
}
|
|
1465
1467
|
}
|
|
1466
1468
|
if (signer)
|
|
1467
|
-
await warnUnfunded(publicClient, signer);
|
|
1469
|
+
await warnUnfunded(publicClient, signer, lane);
|
|
1468
1470
|
}
|
|
1469
1471
|
step('Trust anchor');
|
|
1470
1472
|
let factory;
|
|
@@ -1576,6 +1578,8 @@ export async function cmdDeployOneOfOneEditionBody(flags, emit) {
|
|
|
1576
1578
|
const buildForDeployer = async (deployer) => {
|
|
1577
1579
|
assertLaneCanSign(flags); // no upload before we know this run can be signed — see `assertLaneCanSign`
|
|
1578
1580
|
const salt = explicitSalt ?? saltFor(deployer);
|
|
1581
|
+
if (explicitSalt)
|
|
1582
|
+
assertSaltGuardForDeployer(explicitSalt, deployer);
|
|
1579
1583
|
const clone = await predictClone(publicClient, { factory, salt });
|
|
1580
1584
|
const { tokenFields, contentNote } = bakedImage
|
|
1581
1585
|
? { tokenFields: [bakedImage], contentNote: 'content: image staged ON-CHAIN via reader (self-resolving, no custody)' }
|
|
@@ -1616,22 +1620,10 @@ export async function cmdDeployOneOfOneEditionBody(flags, emit) {
|
|
|
1616
1620
|
// See the 1/1 lane's identical local for why this is hoisted (feeds the sent plan's `roles`).
|
|
1617
1621
|
let deployerAddr;
|
|
1618
1622
|
if (dryRun) {
|
|
1619
|
-
|
|
1620
|
-
if (flags.for)
|
|
1621
|
-
deployer = flags.for;
|
|
1622
|
-
else {
|
|
1623
|
-
try {
|
|
1624
|
-
deployer = makeWalletClient({ chainKey: CHAIN }).account.address;
|
|
1625
|
-
}
|
|
1626
|
-
catch {
|
|
1627
|
-
throw new Error('dry run needs a deployer address to compute the deterministic deploy address — pass --for 0x.. ' +
|
|
1628
|
-
'(a preview signs nothing, so no key is needed). For the REAL deploy with no key in .env, use the ' +
|
|
1629
|
-
'wallet lane: --sign --for 0x.. (you approve in your own wallet).');
|
|
1630
|
-
}
|
|
1631
|
-
}
|
|
1623
|
+
const deployer = previewDeployer;
|
|
1632
1624
|
const { clone: predicted, params, salt, contentNote } = await buildForDeployer(deployer);
|
|
1633
1625
|
info(`deployer ${deployer}`);
|
|
1634
|
-
await warnUnfunded(publicClient, deployer);
|
|
1626
|
+
await warnUnfunded(publicClient, deployer, lane);
|
|
1635
1627
|
if (explicitSalt)
|
|
1636
1628
|
info(`deterministic address: ${predicted}`);
|
|
1637
1629
|
info(`name "${name}"${flags.name ? '' : dim(' (default — pass --name)')}`);
|
|
@@ -1892,13 +1884,12 @@ export async function cmdDeploySeriesBody(flags, emit) {
|
|
|
1892
1884
|
if (count > files.length)
|
|
1893
1885
|
throw new Error(`--count ${count} exceeds the ${files.length} media file(s) in ${dirPath}`);
|
|
1894
1886
|
const slots = files.slice(0, count);
|
|
1895
|
-
const dryRun = isDryRun(flags);
|
|
1896
|
-
if (dryRun)
|
|
1897
|
-
assertPreviewDeployer(flags); // fail fast, before the preview does any work (see cmdDeploy)
|
|
1898
|
-
assertRealIdentity(flags, { name, symbol, dryRun });
|
|
1899
1887
|
const lane = laneFromFlags(flags);
|
|
1900
1888
|
if (lane === 'sponsor')
|
|
1901
1889
|
assertSponsorConfigured(CHAIN);
|
|
1890
|
+
const dryRun = isDryRun(flags);
|
|
1891
|
+
const previewDeployer = dryRun ? await resolvePreviewDeployer(flags, lane) : null;
|
|
1892
|
+
assertRealIdentity(flags, { name, symbol, dryRun });
|
|
1902
1893
|
const publicClient = makePublicClient({ chainKey: CHAIN });
|
|
1903
1894
|
// Catch a wrong-network RPC with the clear mismatch message even on dry-run (which still reads
|
|
1904
1895
|
// the chain to predict the address); tolerate an unreachable RPC so an offline preview still works.
|
|
@@ -2169,6 +2160,8 @@ export async function cmdDeploySeriesBody(flags, emit) {
|
|
|
2169
2160
|
const buildForDeployer = async (deployer) => {
|
|
2170
2161
|
assertLaneCanSign(flags); // no upload before we know this run can be signed — see `assertLaneCanSign`
|
|
2171
2162
|
const salt = explicitSalt ?? saltFor(deployer);
|
|
2163
|
+
if (explicitSalt)
|
|
2164
|
+
assertSaltGuardForDeployer(explicitSalt, deployer);
|
|
2172
2165
|
const clone = await predictClone(publicClient, { factory, salt });
|
|
2173
2166
|
const params = {
|
|
2174
2167
|
owner: deployer,
|
|
@@ -2197,19 +2190,7 @@ export async function cmdDeploySeriesBody(flags, emit) {
|
|
|
2197
2190
|
};
|
|
2198
2191
|
step(`Deploy a ${count}-token Series to ${CHAIN}`);
|
|
2199
2192
|
if (dryRun) {
|
|
2200
|
-
|
|
2201
|
-
if (flags.for)
|
|
2202
|
-
deployer = flags.for;
|
|
2203
|
-
else {
|
|
2204
|
-
try {
|
|
2205
|
-
deployer = makeWalletClient({ chainKey: CHAIN }).account.address;
|
|
2206
|
-
}
|
|
2207
|
-
catch {
|
|
2208
|
-
throw new Error('dry run needs a deployer address to compute the deterministic deploy address — pass --for 0x.. ' +
|
|
2209
|
-
'(a preview signs nothing, so no key is needed). For the REAL deploy with no key in .env, use the ' +
|
|
2210
|
-
'wallet lane: --sign --for 0x.. (you approve in your own wallet).');
|
|
2211
|
-
}
|
|
2212
|
-
}
|
|
2193
|
+
const deployer = previewDeployer;
|
|
2213
2194
|
const { clone: predicted, params, salt } = await buildForDeployer(deployer);
|
|
2214
2195
|
info(`deployer ${deployer}`);
|
|
2215
2196
|
// Without --salt this salt was just freshly randomly reserved; a plain re-run gets a
|
|
@@ -2544,13 +2525,12 @@ export async function cmdDeployEditionImageBody(flags, emit) {
|
|
|
2544
2525
|
if (count > files.length)
|
|
2545
2526
|
throw new Error(`--count ${count} exceeds the ${files.length} media file(s) in ${dirPath}`);
|
|
2546
2527
|
const slots = files.slice(0, count);
|
|
2547
|
-
const dryRun = isDryRun(flags);
|
|
2548
|
-
if (dryRun)
|
|
2549
|
-
assertPreviewDeployer(flags);
|
|
2550
|
-
assertRealIdentity(flags, { name, symbol, dryRun });
|
|
2551
2528
|
const lane = laneFromFlags(flags);
|
|
2552
2529
|
if (lane === 'sponsor')
|
|
2553
2530
|
assertSponsorConfigured(CHAIN);
|
|
2531
|
+
const dryRun = isDryRun(flags);
|
|
2532
|
+
const previewDeployer = dryRun ? await resolvePreviewDeployer(flags, lane) : null;
|
|
2533
|
+
assertRealIdentity(flags, { name, symbol, dryRun });
|
|
2554
2534
|
const onchainImage = !!flags['onchain-image'];
|
|
2555
2535
|
const compress = parseCompress(flags.compress);
|
|
2556
2536
|
// Staging is a SEQUENCE (chunk writes → the deploy that references each manifest) where every tx's
|
|
@@ -2795,6 +2775,8 @@ export async function cmdDeployEditionImageBody(flags, emit) {
|
|
|
2795
2775
|
const buildForDeployer = async (deployer) => {
|
|
2796
2776
|
assertLaneCanSign(flags); // no upload before we know this run can be signed — see `assertLaneCanSign`
|
|
2797
2777
|
const salt = explicitSalt ?? saltFor(deployer);
|
|
2778
|
+
if (explicitSalt)
|
|
2779
|
+
assertSaltGuardForDeployer(explicitSalt, deployer);
|
|
2798
2780
|
const clone = await predictClone(publicClient, { factory, salt });
|
|
2799
2781
|
const params = {
|
|
2800
2782
|
owner: deployer,
|
|
@@ -2829,20 +2811,10 @@ export async function cmdDeployEditionImageBody(flags, emit) {
|
|
|
2829
2811
|
// See the 1/1 lane's identical local for why this is hoisted (feeds the sent plan's `roles`).
|
|
2830
2812
|
let deployerAddr;
|
|
2831
2813
|
if (dryRun) {
|
|
2832
|
-
|
|
2833
|
-
if (flags.for)
|
|
2834
|
-
deployer = flags.for;
|
|
2835
|
-
else {
|
|
2836
|
-
try {
|
|
2837
|
-
deployer = makeWalletClient({ chainKey: CHAIN }).account.address;
|
|
2838
|
-
}
|
|
2839
|
-
catch {
|
|
2840
|
-
throw new Error('dry run needs a deployer address to compute the deterministic deploy address — pass --for 0x.. (a preview signs nothing).');
|
|
2841
|
-
}
|
|
2842
|
-
}
|
|
2814
|
+
const deployer = previewDeployer;
|
|
2843
2815
|
const { clone: predicted, params, salt } = await buildForDeployer(deployer);
|
|
2844
2816
|
info(`deployer ${deployer}`);
|
|
2845
|
-
await warnUnfunded(publicClient, deployer);
|
|
2817
|
+
await warnUnfunded(publicClient, deployer, lane);
|
|
2846
2818
|
if (explicitSalt)
|
|
2847
2819
|
info(`deterministic address: ${predicted}`);
|
|
2848
2820
|
info(`name "${name}"${flags.name ? '' : dim(' (default — pass --name)')}`);
|
|
@@ -3428,6 +3400,9 @@ export async function cmdDeployCodeBody(flags, emit) {
|
|
|
3428
3400
|
'a fresh 721 deploy (this command, without --copies) has no per-id mint amount. For a NEW edition deploy, use ' +
|
|
3429
3401
|
'`abx deploy-code --copies <n|open> --mint-amount <n>`.');
|
|
3430
3402
|
}
|
|
3403
|
+
const lane = laneFromFlags(flags);
|
|
3404
|
+
if (lane === 'sponsor')
|
|
3405
|
+
assertSponsorConfigured(CHAIN);
|
|
3431
3406
|
const dryRun = isDryRun(flags);
|
|
3432
3407
|
const name = flags.name ?? 'ABX Code';
|
|
3433
3408
|
const symbol = flags.symbol ?? 'ABXC';
|
|
@@ -4006,19 +3981,11 @@ export async function cmdDeployCodeBody(flags, emit) {
|
|
|
4006
3981
|
// expectation, tx count, cost — is deployer-independent, so a wallet-less creator (the common
|
|
4007
3982
|
// "before I set up a key" preview) still gets the full readout. Missing deployer ⇒ null, and
|
|
4008
3983
|
// the address-dependent lines degrade to a clear placeholder instead of refusing the preview.
|
|
4009
|
-
|
|
4010
|
-
if (flags.for)
|
|
4011
|
-
deployer = flags.for;
|
|
4012
|
-
else {
|
|
4013
|
-
try {
|
|
4014
|
-
deployer = makeWalletClient({ chainKey: CHAIN }).account.address;
|
|
4015
|
-
}
|
|
4016
|
-
catch {
|
|
4017
|
-
deployer = null;
|
|
4018
|
-
}
|
|
4019
|
-
}
|
|
3984
|
+
const deployer = await resolvePreviewDeployer(flags, lane, false);
|
|
4020
3985
|
const explicitSalt = parseSaltFlag(flags.salt);
|
|
4021
3986
|
const salt = deployer ? (explicitSalt ?? saltFor(deployer)) : null;
|
|
3987
|
+
if (explicitSalt && deployer)
|
|
3988
|
+
assertSaltGuardForDeployer(explicitSalt, deployer);
|
|
4022
3989
|
const predicted = salt
|
|
4023
3990
|
? (await publicClient.readContract({ address: factory, abi: seriesCodeFactoryAbi, functionName: 'predictDeterministicAddress', args: [salt] }))
|
|
4024
3991
|
: null;
|
|
@@ -4313,9 +4280,6 @@ export async function cmdDeployCodeBody(flags, emit) {
|
|
|
4313
4280
|
ok(`uploaded ${dirUpload.entries.length} file(s) → code field (${rep}): ${value}`);
|
|
4314
4281
|
}
|
|
4315
4282
|
step('Deploy');
|
|
4316
|
-
const lane = laneFromFlags(flags);
|
|
4317
|
-
if (lane === 'sponsor')
|
|
4318
|
-
assertSponsorConfigured(CHAIN);
|
|
4319
4283
|
// --onchain-uri with no explicit public URL: leave the off-chain pointer EMPTY rather than
|
|
4320
4284
|
// baking a misleading localhost (the renderer is authoritative while set) — the same rule as
|
|
4321
4285
|
// the 1/1's on-chain lane. The renderers themselves are set as setup-multicall legs, so the
|
|
@@ -4355,7 +4319,10 @@ export async function cmdDeployCodeBody(flags, emit) {
|
|
|
4355
4319
|
// identical split — see `planCodeSetupBatches`'s doc), this time with real mint calldata.
|
|
4356
4320
|
const cid = resolveChain(CHAIN).id;
|
|
4357
4321
|
const preparedFor = async (owner) => {
|
|
4358
|
-
const
|
|
4322
|
+
const explicitSalt = parseSaltFlag(flags.salt);
|
|
4323
|
+
if (explicitSalt)
|
|
4324
|
+
assertSaltGuardForDeployer(explicitSalt, owner);
|
|
4325
|
+
const salt = explicitSalt ?? saltFor(owner);
|
|
4359
4326
|
const clone = (await publicClient.readContract({ address: factory, abi: seriesCodeFactoryAbi, functionName: 'predictDeterministicAddress', args: [salt] }));
|
|
4360
4327
|
const g = setupLegGroups(owner);
|
|
4361
4328
|
const batches = planCodeSetupBatches({
|
|
@@ -4941,6 +4908,9 @@ export async function cmdDeployEditionCodeBody(flags, emit) {
|
|
|
4941
4908
|
'(balanceOf(sender, id) > 0) instead of the 721 TokenOwner leg\'s delegate.xyz resolution --no-delegation opts out ' +
|
|
4942
4909
|
'of. Drop the flag.');
|
|
4943
4910
|
}
|
|
4911
|
+
const lane = laneFromFlags(flags);
|
|
4912
|
+
if (lane === 'sponsor')
|
|
4913
|
+
assertSponsorConfigured(CHAIN);
|
|
4944
4914
|
const dryRun = isDryRun(flags);
|
|
4945
4915
|
const name = flags.name ?? 'ABX Edition Code';
|
|
4946
4916
|
const symbol = flags.symbol ?? 'ABXEC';
|
|
@@ -5217,9 +5187,6 @@ export async function cmdDeployEditionCodeBody(flags, emit) {
|
|
|
5217
5187
|
}
|
|
5218
5188
|
const onchainUriLegs = onChainUri ? onchainUriSetupCalls({ generator, metadataRenderer }) : [];
|
|
5219
5189
|
step('Deploy');
|
|
5220
|
-
const lane = laneFromFlags(flags);
|
|
5221
|
-
if (lane === 'sponsor')
|
|
5222
|
-
assertSponsorConfigured(CHAIN);
|
|
5223
5190
|
const minter = flags.minter ?? zeroAddress;
|
|
5224
5191
|
const primaryPayee = flags['primary-payee'] ?? zeroAddress;
|
|
5225
5192
|
const explicitSalt = parseSaltFlag(flags.salt);
|
|
@@ -5274,6 +5241,8 @@ export async function cmdDeployEditionCodeBody(flags, emit) {
|
|
|
5274
5241
|
const editionSetupBatches = planCodeSetupBatches({ chunks: chunkLegs, config: configLegs, mints: mintLegsFor(zeroAddress) });
|
|
5275
5242
|
const preparedFor = async (owner) => {
|
|
5276
5243
|
const salt = explicitSalt ?? saltFor(owner);
|
|
5244
|
+
if (explicitSalt)
|
|
5245
|
+
assertSaltGuardForDeployer(explicitSalt, owner);
|
|
5277
5246
|
const clone = await predictClone(publicClient, { factory, salt });
|
|
5278
5247
|
const setupTxs = codeSetupTxsFromBatches(planCodeSetupBatches({ chunks: chunkLegs, config: configLegs, mints: mintLegsFor(owner) }), { contract: clone, chainId, deps: deps.map((d) => d.display) });
|
|
5279
5248
|
const txs = [prepareDeployEditionCode({ factory, params: initParamsFor(owner), salt, chainId, clone }), ...setupTxs];
|
|
@@ -5311,18 +5280,10 @@ export async function cmdDeployEditionCodeBody(flags, emit) {
|
|
|
5311
5280
|
(transferValidator !== zeroAddress ? ` ERC-1155C: enrolled at deploy, permanently (validator ${transferValidator}).` : ''), flags);
|
|
5312
5281
|
}
|
|
5313
5282
|
if (dryRun) {
|
|
5314
|
-
|
|
5315
|
-
if (flags.for)
|
|
5316
|
-
deployer = flags.for;
|
|
5317
|
-
else {
|
|
5318
|
-
try {
|
|
5319
|
-
deployer = makeWalletClient({ chainKey: CHAIN }).account.address;
|
|
5320
|
-
}
|
|
5321
|
-
catch {
|
|
5322
|
-
deployer = null;
|
|
5323
|
-
}
|
|
5324
|
-
}
|
|
5283
|
+
const deployer = await resolvePreviewDeployer(flags, lane, false);
|
|
5325
5284
|
const salt = deployer ? (explicitSalt ?? saltFor(deployer)) : null;
|
|
5285
|
+
if (explicitSalt && deployer)
|
|
5286
|
+
assertSaltGuardForDeployer(explicitSalt, deployer);
|
|
5326
5287
|
const predicted = salt ? await predictClone(publicClient, { factory, salt }) : null;
|
|
5327
5288
|
const shownAddr = explicitSalt ? predicted : null;
|
|
5328
5289
|
step(`Deploy plan — up to ${max} id(s), ${editionSize === 0n ? 'open' : editionSize.toString()} cop${editionSize === 1n ? 'y' : 'ies'} each, to ${CHAIN}`);
|