@artblocks/abx-cli 0.1.0-alpha.58 → 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 +6 -0
- package/dist/commands/deploy.d.ts +4 -4
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +37 -97
- package/dist/commands/deploy.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 +30 -1
- package/dist/creator-signer.js.map +1 -1
- package/package.json +3 -3
- package/skill/SKILL.md +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
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
|
+
|
|
3
9
|
## 0.1.0-alpha.58
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -24,9 +24,9 @@ export declare function copiesOneNote(cmd: string): string;
|
|
|
24
24
|
export declare function parseNonNegativeIntFlag(raw: string, flag: string): bigint;
|
|
25
25
|
/**
|
|
26
26
|
* A `--dry-run` computes the deterministic deploy address, which is a pure function of
|
|
27
|
-
* (factory, salt, deployer) — so it needs a deployer even though it signs nothing. Resolve
|
|
28
|
-
*
|
|
29
|
-
*
|
|
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.
|
|
30
30
|
*/
|
|
31
31
|
/**
|
|
32
32
|
* A dry run only checks whether a factory address is CONFIGURED, not whether it has code on this
|
|
@@ -52,7 +52,7 @@ export declare function assertRealIdentity(flags: Flags, o: {
|
|
|
52
52
|
symbol: string;
|
|
53
53
|
dryRun: boolean;
|
|
54
54
|
}): void;
|
|
55
|
-
export declare function
|
|
55
|
+
export declare function resolvePreviewDeployer(flags: Flags, lane: Lane, required?: boolean): Promise<Address | null>;
|
|
56
56
|
export declare function warnUnfunded(publicClient: PublicClient, address: Address, lane: Lane): Promise<void>;
|
|
57
57
|
export declare function shArg(v: string): string;
|
|
58
58
|
export declare function deployCommandLine(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,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,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAQ3D;AAED;;;0CAG0C;AAC1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KAAK,IAAI,iBAi7C/F;AAiBD,eAAO,MAAM,yBAAyB,aAuBpC,CAAC;AAEH,wBAAsB,wBAAwB,CAAC,KAAK,EAAE,KAAK,EAAE,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
|
@@ -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).');
|
|
@@ -726,8 +736,7 @@ export async function cmdDeployBody(flags, serveAfter, emit) {
|
|
|
726
736
|
// A keyless preview needs `--for` (the address is a pure function of factory+salt+deployer). Check
|
|
727
737
|
// it HERE, before the trust-anchor/content/plan steps print — hitting this after a wall of output
|
|
728
738
|
// reads as "it half-worked", and a first-timer previewing with no key in .env always hits it.
|
|
729
|
-
|
|
730
|
-
assertPreviewDeployer(flags);
|
|
739
|
+
const previewDeployer = dryRun ? await resolvePreviewDeployer(flags, lane) : null;
|
|
731
740
|
const publicClient = makePublicClient({ chainKey: CHAIN });
|
|
732
741
|
// Verify the RPC really is CHAIN before any send (factory/renderer/staging/deploy). A dry run
|
|
733
742
|
// sends nothing, but it DOES read the chain (predict address, resolve the factory/renderer), so
|
|
@@ -1030,19 +1039,7 @@ export async function cmdDeployBody(flags, serveAfter, emit) {
|
|
|
1030
1039
|
// no branch has run yet; every path that reaches the sent `emit()` has set it by then.
|
|
1031
1040
|
let deployerAddr;
|
|
1032
1041
|
if (dryRun) {
|
|
1033
|
-
|
|
1034
|
-
if (flags.for)
|
|
1035
|
-
deployer = flags.for;
|
|
1036
|
-
else {
|
|
1037
|
-
try {
|
|
1038
|
-
deployer = makeWalletClient({ chainKey: CHAIN }).account.address;
|
|
1039
|
-
}
|
|
1040
|
-
catch {
|
|
1041
|
-
throw new Error('dry run needs a deployer address to compute the deterministic deploy address — pass --for 0x.. ' +
|
|
1042
|
-
'(a preview signs nothing, so no key is needed). For the REAL deploy with no key in .env, use the ' +
|
|
1043
|
-
'wallet lane: --sign --for 0x.. (you approve in your own wallet).');
|
|
1044
|
-
}
|
|
1045
|
-
}
|
|
1042
|
+
const deployer = previewDeployer;
|
|
1046
1043
|
const { clone: predicted, params, salt, contentNote } = await buildForDeployer(deployer);
|
|
1047
1044
|
info(`deployer ${deployer}`);
|
|
1048
1045
|
await warnUnfunded(publicClient, deployer, lane); // advisory for self-funded signing lanes
|
|
@@ -1451,8 +1448,7 @@ export async function cmdDeployOneOfOneEditionBody(flags, emit) {
|
|
|
1451
1448
|
throw new Error('Staging an on-chain image (--onchain-image) needs interactive signing — each chunk tx feeds ' +
|
|
1452
1449
|
"the next. Use the hot lane (a funded key) or --sign (browser wallet); --unsigned and the initial --sponsor beta do not stage content.");
|
|
1453
1450
|
}
|
|
1454
|
-
|
|
1455
|
-
assertPreviewDeployer(flags);
|
|
1451
|
+
const previewDeployer = dryRun ? await resolvePreviewDeployer(flags, lane) : null;
|
|
1456
1452
|
const publicClient = makePublicClient({ chainKey: CHAIN });
|
|
1457
1453
|
await assertChainId(CHAIN, { allowUnreachable: dryRun });
|
|
1458
1454
|
// --721c reuses the SAME flag + value grammar to enroll ERC-1155C instead — see the locked
|
|
@@ -1624,19 +1620,7 @@ export async function cmdDeployOneOfOneEditionBody(flags, emit) {
|
|
|
1624
1620
|
// See the 1/1 lane's identical local for why this is hoisted (feeds the sent plan's `roles`).
|
|
1625
1621
|
let deployerAddr;
|
|
1626
1622
|
if (dryRun) {
|
|
1627
|
-
|
|
1628
|
-
if (flags.for)
|
|
1629
|
-
deployer = flags.for;
|
|
1630
|
-
else {
|
|
1631
|
-
try {
|
|
1632
|
-
deployer = makeWalletClient({ chainKey: CHAIN }).account.address;
|
|
1633
|
-
}
|
|
1634
|
-
catch {
|
|
1635
|
-
throw new Error('dry run needs a deployer address to compute the deterministic deploy address — pass --for 0x.. ' +
|
|
1636
|
-
'(a preview signs nothing, so no key is needed). For the REAL deploy with no key in .env, use the ' +
|
|
1637
|
-
'wallet lane: --sign --for 0x.. (you approve in your own wallet).');
|
|
1638
|
-
}
|
|
1639
|
-
}
|
|
1623
|
+
const deployer = previewDeployer;
|
|
1640
1624
|
const { clone: predicted, params, salt, contentNote } = await buildForDeployer(deployer);
|
|
1641
1625
|
info(`deployer ${deployer}`);
|
|
1642
1626
|
await warnUnfunded(publicClient, deployer, lane);
|
|
@@ -1900,13 +1884,12 @@ export async function cmdDeploySeriesBody(flags, emit) {
|
|
|
1900
1884
|
if (count > files.length)
|
|
1901
1885
|
throw new Error(`--count ${count} exceeds the ${files.length} media file(s) in ${dirPath}`);
|
|
1902
1886
|
const slots = files.slice(0, count);
|
|
1903
|
-
const dryRun = isDryRun(flags);
|
|
1904
|
-
if (dryRun)
|
|
1905
|
-
assertPreviewDeployer(flags); // fail fast, before the preview does any work (see cmdDeploy)
|
|
1906
|
-
assertRealIdentity(flags, { name, symbol, dryRun });
|
|
1907
1887
|
const lane = laneFromFlags(flags);
|
|
1908
1888
|
if (lane === 'sponsor')
|
|
1909
1889
|
assertSponsorConfigured(CHAIN);
|
|
1890
|
+
const dryRun = isDryRun(flags);
|
|
1891
|
+
const previewDeployer = dryRun ? await resolvePreviewDeployer(flags, lane) : null;
|
|
1892
|
+
assertRealIdentity(flags, { name, symbol, dryRun });
|
|
1910
1893
|
const publicClient = makePublicClient({ chainKey: CHAIN });
|
|
1911
1894
|
// Catch a wrong-network RPC with the clear mismatch message even on dry-run (which still reads
|
|
1912
1895
|
// the chain to predict the address); tolerate an unreachable RPC so an offline preview still works.
|
|
@@ -2207,19 +2190,7 @@ export async function cmdDeploySeriesBody(flags, emit) {
|
|
|
2207
2190
|
};
|
|
2208
2191
|
step(`Deploy a ${count}-token Series to ${CHAIN}`);
|
|
2209
2192
|
if (dryRun) {
|
|
2210
|
-
|
|
2211
|
-
if (flags.for)
|
|
2212
|
-
deployer = flags.for;
|
|
2213
|
-
else {
|
|
2214
|
-
try {
|
|
2215
|
-
deployer = makeWalletClient({ chainKey: CHAIN }).account.address;
|
|
2216
|
-
}
|
|
2217
|
-
catch {
|
|
2218
|
-
throw new Error('dry run needs a deployer address to compute the deterministic deploy address — pass --for 0x.. ' +
|
|
2219
|
-
'(a preview signs nothing, so no key is needed). For the REAL deploy with no key in .env, use the ' +
|
|
2220
|
-
'wallet lane: --sign --for 0x.. (you approve in your own wallet).');
|
|
2221
|
-
}
|
|
2222
|
-
}
|
|
2193
|
+
const deployer = previewDeployer;
|
|
2223
2194
|
const { clone: predicted, params, salt } = await buildForDeployer(deployer);
|
|
2224
2195
|
info(`deployer ${deployer}`);
|
|
2225
2196
|
// Without --salt this salt was just freshly randomly reserved; a plain re-run gets a
|
|
@@ -2554,13 +2525,12 @@ export async function cmdDeployEditionImageBody(flags, emit) {
|
|
|
2554
2525
|
if (count > files.length)
|
|
2555
2526
|
throw new Error(`--count ${count} exceeds the ${files.length} media file(s) in ${dirPath}`);
|
|
2556
2527
|
const slots = files.slice(0, count);
|
|
2557
|
-
const dryRun = isDryRun(flags);
|
|
2558
|
-
if (dryRun)
|
|
2559
|
-
assertPreviewDeployer(flags);
|
|
2560
|
-
assertRealIdentity(flags, { name, symbol, dryRun });
|
|
2561
2528
|
const lane = laneFromFlags(flags);
|
|
2562
2529
|
if (lane === 'sponsor')
|
|
2563
2530
|
assertSponsorConfigured(CHAIN);
|
|
2531
|
+
const dryRun = isDryRun(flags);
|
|
2532
|
+
const previewDeployer = dryRun ? await resolvePreviewDeployer(flags, lane) : null;
|
|
2533
|
+
assertRealIdentity(flags, { name, symbol, dryRun });
|
|
2564
2534
|
const onchainImage = !!flags['onchain-image'];
|
|
2565
2535
|
const compress = parseCompress(flags.compress);
|
|
2566
2536
|
// Staging is a SEQUENCE (chunk writes → the deploy that references each manifest) where every tx's
|
|
@@ -2841,17 +2811,7 @@ export async function cmdDeployEditionImageBody(flags, emit) {
|
|
|
2841
2811
|
// See the 1/1 lane's identical local for why this is hoisted (feeds the sent plan's `roles`).
|
|
2842
2812
|
let deployerAddr;
|
|
2843
2813
|
if (dryRun) {
|
|
2844
|
-
|
|
2845
|
-
if (flags.for)
|
|
2846
|
-
deployer = flags.for;
|
|
2847
|
-
else {
|
|
2848
|
-
try {
|
|
2849
|
-
deployer = makeWalletClient({ chainKey: CHAIN }).account.address;
|
|
2850
|
-
}
|
|
2851
|
-
catch {
|
|
2852
|
-
throw new Error('dry run needs a deployer address to compute the deterministic deploy address — pass --for 0x.. (a preview signs nothing).');
|
|
2853
|
-
}
|
|
2854
|
-
}
|
|
2814
|
+
const deployer = previewDeployer;
|
|
2855
2815
|
const { clone: predicted, params, salt } = await buildForDeployer(deployer);
|
|
2856
2816
|
info(`deployer ${deployer}`);
|
|
2857
2817
|
await warnUnfunded(publicClient, deployer, lane);
|
|
@@ -3440,6 +3400,9 @@ export async function cmdDeployCodeBody(flags, emit) {
|
|
|
3440
3400
|
'a fresh 721 deploy (this command, without --copies) has no per-id mint amount. For a NEW edition deploy, use ' +
|
|
3441
3401
|
'`abx deploy-code --copies <n|open> --mint-amount <n>`.');
|
|
3442
3402
|
}
|
|
3403
|
+
const lane = laneFromFlags(flags);
|
|
3404
|
+
if (lane === 'sponsor')
|
|
3405
|
+
assertSponsorConfigured(CHAIN);
|
|
3443
3406
|
const dryRun = isDryRun(flags);
|
|
3444
3407
|
const name = flags.name ?? 'ABX Code';
|
|
3445
3408
|
const symbol = flags.symbol ?? 'ABXC';
|
|
@@ -4018,17 +3981,7 @@ export async function cmdDeployCodeBody(flags, emit) {
|
|
|
4018
3981
|
// expectation, tx count, cost — is deployer-independent, so a wallet-less creator (the common
|
|
4019
3982
|
// "before I set up a key" preview) still gets the full readout. Missing deployer ⇒ null, and
|
|
4020
3983
|
// the address-dependent lines degrade to a clear placeholder instead of refusing the preview.
|
|
4021
|
-
|
|
4022
|
-
if (flags.for)
|
|
4023
|
-
deployer = flags.for;
|
|
4024
|
-
else {
|
|
4025
|
-
try {
|
|
4026
|
-
deployer = makeWalletClient({ chainKey: CHAIN }).account.address;
|
|
4027
|
-
}
|
|
4028
|
-
catch {
|
|
4029
|
-
deployer = null;
|
|
4030
|
-
}
|
|
4031
|
-
}
|
|
3984
|
+
const deployer = await resolvePreviewDeployer(flags, lane, false);
|
|
4032
3985
|
const explicitSalt = parseSaltFlag(flags.salt);
|
|
4033
3986
|
const salt = deployer ? (explicitSalt ?? saltFor(deployer)) : null;
|
|
4034
3987
|
if (explicitSalt && deployer)
|
|
@@ -4327,9 +4280,6 @@ export async function cmdDeployCodeBody(flags, emit) {
|
|
|
4327
4280
|
ok(`uploaded ${dirUpload.entries.length} file(s) → code field (${rep}): ${value}`);
|
|
4328
4281
|
}
|
|
4329
4282
|
step('Deploy');
|
|
4330
|
-
const lane = laneFromFlags(flags);
|
|
4331
|
-
if (lane === 'sponsor')
|
|
4332
|
-
assertSponsorConfigured(CHAIN);
|
|
4333
4283
|
// --onchain-uri with no explicit public URL: leave the off-chain pointer EMPTY rather than
|
|
4334
4284
|
// baking a misleading localhost (the renderer is authoritative while set) — the same rule as
|
|
4335
4285
|
// the 1/1's on-chain lane. The renderers themselves are set as setup-multicall legs, so the
|
|
@@ -4958,6 +4908,9 @@ export async function cmdDeployEditionCodeBody(flags, emit) {
|
|
|
4958
4908
|
'(balanceOf(sender, id) > 0) instead of the 721 TokenOwner leg\'s delegate.xyz resolution --no-delegation opts out ' +
|
|
4959
4909
|
'of. Drop the flag.');
|
|
4960
4910
|
}
|
|
4911
|
+
const lane = laneFromFlags(flags);
|
|
4912
|
+
if (lane === 'sponsor')
|
|
4913
|
+
assertSponsorConfigured(CHAIN);
|
|
4961
4914
|
const dryRun = isDryRun(flags);
|
|
4962
4915
|
const name = flags.name ?? 'ABX Edition Code';
|
|
4963
4916
|
const symbol = flags.symbol ?? 'ABXEC';
|
|
@@ -5234,9 +5187,6 @@ export async function cmdDeployEditionCodeBody(flags, emit) {
|
|
|
5234
5187
|
}
|
|
5235
5188
|
const onchainUriLegs = onChainUri ? onchainUriSetupCalls({ generator, metadataRenderer }) : [];
|
|
5236
5189
|
step('Deploy');
|
|
5237
|
-
const lane = laneFromFlags(flags);
|
|
5238
|
-
if (lane === 'sponsor')
|
|
5239
|
-
assertSponsorConfigured(CHAIN);
|
|
5240
5190
|
const minter = flags.minter ?? zeroAddress;
|
|
5241
5191
|
const primaryPayee = flags['primary-payee'] ?? zeroAddress;
|
|
5242
5192
|
const explicitSalt = parseSaltFlag(flags.salt);
|
|
@@ -5330,17 +5280,7 @@ export async function cmdDeployEditionCodeBody(flags, emit) {
|
|
|
5330
5280
|
(transferValidator !== zeroAddress ? ` ERC-1155C: enrolled at deploy, permanently (validator ${transferValidator}).` : ''), flags);
|
|
5331
5281
|
}
|
|
5332
5282
|
if (dryRun) {
|
|
5333
|
-
|
|
5334
|
-
if (flags.for)
|
|
5335
|
-
deployer = flags.for;
|
|
5336
|
-
else {
|
|
5337
|
-
try {
|
|
5338
|
-
deployer = makeWalletClient({ chainKey: CHAIN }).account.address;
|
|
5339
|
-
}
|
|
5340
|
-
catch {
|
|
5341
|
-
deployer = null;
|
|
5342
|
-
}
|
|
5343
|
-
}
|
|
5283
|
+
const deployer = await resolvePreviewDeployer(flags, lane, false);
|
|
5344
5284
|
const salt = deployer ? (explicitSalt ?? saltFor(deployer)) : null;
|
|
5345
5285
|
if (explicitSalt && deployer)
|
|
5346
5286
|
assertSaltGuardForDeployer(explicitSalt, deployer);
|