@artblocks/abx-cli 0.1.0-alpha.4 → 0.1.0-alpha.41
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 +161 -0
- package/assets/renderer-scaffold/README.md +41 -11
- package/assets/renderer-scaffold/foundry.toml +5 -0
- package/assets/renderer-scaffold/remappings.txt +1 -1
- package/assets/renderer-scaffold/script/DeployHooks.s.sol +24 -0
- package/assets/renderer-scaffold/script/Preview.s.sol +99 -0
- package/assets/renderer-scaffold/src/MyHooks.sol +20 -0
- package/assets/renderer-scaffold/src/MyRenderer.sol +4 -4
- package/assets/renderer-scaffold/src/MyTraits.sol +2 -2
- package/assets/renderer-scaffold/test/MyRenderer.t.sol +60 -3
- package/dist/bin.d.ts +26 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +63 -0
- package/dist/bin.js.map +1 -0
- package/dist/capabilities.d.ts +99 -0
- package/dist/capabilities.d.ts.map +1 -0
- package/dist/capabilities.js +144 -0
- package/dist/capabilities.js.map +1 -0
- package/dist/commands/auth.d.ts +54 -0
- package/dist/commands/auth.d.ts.map +1 -0
- package/dist/commands/auth.js +447 -0
- package/dist/commands/auth.js.map +1 -0
- package/dist/commands/deploy.d.ts +242 -0
- package/dist/commands/deploy.d.ts.map +1 -0
- package/dist/commands/deploy.js +5429 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/feedback.d.ts +7 -0
- package/dist/commands/feedback.d.ts.map +1 -0
- package/dist/commands/feedback.js +147 -0
- package/dist/commands/feedback.js.map +1 -0
- package/dist/commands/maintenance.d.ts +4 -0
- package/dist/commands/maintenance.d.ts.map +1 -0
- package/dist/commands/maintenance.js +114 -0
- package/dist/commands/maintenance.js.map +1 -0
- package/dist/commands/project.d.ts +429 -0
- package/dist/commands/project.d.ts.map +1 -0
- package/dist/commands/project.js +1720 -0
- package/dist/commands/project.js.map +1 -0
- package/dist/commands/reads.d.ts +85 -0
- package/dist/commands/reads.d.ts.map +1 -0
- package/dist/commands/reads.js +868 -0
- package/dist/commands/reads.js.map +1 -0
- package/dist/commands/scaffold.d.ts +89 -0
- package/dist/commands/scaffold.d.ts.map +1 -0
- package/dist/commands/scaffold.js +738 -0
- package/dist/commands/scaffold.js.map +1 -0
- package/dist/commands/service.d.ts +67 -0
- package/dist/commands/service.d.ts.map +1 -0
- package/dist/commands/service.js +748 -0
- package/dist/commands/service.js.map +1 -0
- package/dist/commands/storage.d.ts +51 -0
- package/dist/commands/storage.d.ts.map +1 -0
- package/dist/commands/storage.js +399 -0
- package/dist/commands/storage.js.map +1 -0
- package/dist/commands/submit-app.d.ts +102 -0
- package/dist/commands/submit-app.d.ts.map +1 -0
- package/dist/commands/submit-app.js +622 -0
- package/dist/commands/submit-app.js.map +1 -0
- package/dist/config.d.ts +105 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +351 -12
- package/dist/config.js.map +1 -1
- package/dist/conformance.d.ts +31 -0
- package/dist/conformance.d.ts.map +1 -0
- package/dist/conformance.js +390 -0
- package/dist/conformance.js.map +1 -0
- package/dist/contract-read-error.d.ts +5 -0
- package/dist/contract-read-error.d.ts.map +1 -0
- package/dist/contract-read-error.js +37 -0
- package/dist/contract-read-error.js.map +1 -0
- package/dist/deploy-plan.d.ts +150 -0
- package/dist/deploy-plan.d.ts.map +1 -0
- package/dist/deploy-plan.js +31 -0
- package/dist/deploy-plan.js.map +1 -0
- package/dist/deps.d.ts +6 -39
- package/dist/deps.d.ts.map +1 -1
- package/dist/deps.js +4 -68
- package/dist/deps.js.map +1 -1
- package/dist/errors.d.ts +20 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +25 -0
- package/dist/errors.js.map +1 -0
- package/dist/flag-allowlists.d.ts +53 -0
- package/dist/flag-allowlists.d.ts.map +1 -0
- package/dist/flag-allowlists.js +184 -0
- package/dist/flag-allowlists.js.map +1 -0
- package/dist/flags.d.ts +47 -0
- package/dist/flags.d.ts.map +1 -1
- package/dist/flags.js +125 -1
- package/dist/flags.js.map +1 -1
- package/dist/jsonout.d.ts +37 -0
- package/dist/jsonout.d.ts.map +1 -0
- package/dist/jsonout.js +79 -0
- package/dist/jsonout.js.map +1 -0
- package/dist/kind.d.ts +57 -0
- package/dist/kind.d.ts.map +1 -0
- package/dist/kind.js +122 -0
- package/dist/kind.js.map +1 -0
- package/dist/main.js +786 -4838
- package/dist/main.js.map +1 -1
- package/dist/mintpage.d.ts +17 -2
- package/dist/mintpage.d.ts.map +1 -1
- package/dist/mintpage.js +241 -54
- package/dist/mintpage.js.map +1 -1
- package/dist/output.d.ts +179 -0
- package/dist/output.d.ts.map +1 -0
- package/dist/output.js +780 -0
- package/dist/output.js.map +1 -0
- package/dist/ownerops.d.ts +381 -57
- package/dist/ownerops.d.ts.map +1 -1
- package/dist/ownerops.js +2014 -359
- package/dist/ownerops.js.map +1 -1
- package/dist/preview.d.ts +23 -5
- package/dist/preview.d.ts.map +1 -1
- package/dist/preview.js +95 -43
- package/dist/preview.js.map +1 -1
- package/dist/prompt.d.ts +17 -0
- package/dist/prompt.d.ts.map +1 -0
- package/dist/prompt.js +19 -0
- package/dist/prompt.js.map +1 -0
- package/dist/provision.d.ts +3 -13
- package/dist/provision.d.ts.map +1 -1
- package/dist/provision.js +19 -21
- package/dist/provision.js.map +1 -1
- package/dist/remote.d.ts +157 -52
- package/dist/remote.d.ts.map +1 -1
- package/dist/remote.js +435 -46
- package/dist/remote.js.map +1 -1
- package/dist/riskgate.d.ts +62 -0
- package/dist/riskgate.d.ts.map +1 -0
- package/dist/riskgate.js +234 -0
- package/dist/riskgate.js.map +1 -0
- package/dist/scaffold.d.ts +12 -0
- package/dist/scaffold.d.ts.map +1 -0
- package/dist/scaffold.js +56 -0
- package/dist/scaffold.js.map +1 -0
- package/dist/schema.d.ts +36 -1
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +121 -26
- package/dist/schema.js.map +1 -1
- package/dist/script-chunks.d.ts +8 -0
- package/dist/script-chunks.d.ts.map +1 -0
- package/dist/script-chunks.js +35 -0
- package/dist/script-chunks.js.map +1 -0
- package/dist/served.d.ts +30 -0
- package/dist/served.d.ts.map +1 -0
- package/dist/served.js +112 -0
- package/dist/served.js.map +1 -0
- package/dist/signer.d.ts +13 -0
- package/dist/signer.d.ts.map +1 -1
- package/dist/signer.js +84 -15
- package/dist/signer.js.map +1 -1
- package/dist/update-check.d.ts +86 -5
- package/dist/update-check.d.ts.map +1 -1
- package/dist/update-check.js +161 -20
- package/dist/update-check.js.map +1 -1
- package/package.json +13 -12
- package/skill/SKILL.md +181 -347
- package/skill/agents/openai.yaml +4 -0
- package/skill/reference/capabilities.md +188 -0
- package/skill/reference/code.md +220 -0
- package/skill/reference/creator-token.md +94 -0
- package/skill/reference/deploy.md +174 -0
- package/skill/reference/diagnose.md +178 -0
- package/skill/reference/hosting.md +186 -93
- package/skill/reference/operate.md +220 -0
- package/skill/reference/services.md +121 -0
- package/skill/reference/setup.md +154 -36
- package/assets/renderer-scaffold/src/interfaces/IAbxFieldRenderer.sol +0 -32
- package/assets/renderer-scaffold/src/interfaces/IAbxParams.sol +0 -26
- package/dist/inspect.d.ts +0 -48
- package/dist/inspect.d.ts.map +0 -1
- package/dist/inspect.js +0 -184
- package/dist/inspect.js.map +0 -1
- package/dist/migrate.d.ts +0 -65
- package/dist/migrate.d.ts.map +0 -1
- package/dist/migrate.js +0 -180
- package/dist/migrate.js.map +0 -1
- package/dist/onchain-uri.d.ts +0 -97
- package/dist/onchain-uri.d.ts.map +0 -1
- package/dist/onchain-uri.js +0 -243
- package/dist/onchain-uri.js.map +0 -1
- package/dist/upload.d.ts +0 -28
- package/dist/upload.d.ts.map +0 -1
- package/dist/upload.js +0 -41
- package/dist/upload.js.map +0 -1
- package/skill/reference/code-projects.md +0 -246
- package/skill/reference/operating.md +0 -116
- package/skill/reference/troubleshooting.md +0 -28
|
@@ -0,0 +1,622 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `abx submit-app` — optional post-deploy listing in the ABX App Store.
|
|
3
|
+
*
|
|
4
|
+
* Not part of deploy. A creator (or the agent driving them) opts in after the
|
|
5
|
+
* collection exists: mint one entry token through the store's gated minter, then
|
|
6
|
+
* write catalog copy as the registry's TokenOwner params. Same transactions as
|
|
7
|
+
* the store's `/submit` page; the CLI is the agent path.
|
|
8
|
+
*
|
|
9
|
+
* Catalog copy is NOT the collection's `--name` / `--description`. Those are NFT
|
|
10
|
+
* metadata. The store wants outcome copy — what someone can do — and this command
|
|
11
|
+
* requires those fields on purpose so an agent cannot silently reuse deploy flags.
|
|
12
|
+
*/
|
|
13
|
+
import { assertChainId, encodeScalarParam, makePublicClient, prepareConfigureTokenParam, prepareConfigureTokenParamData, prepareMulticall, } from '@artblocks/abx-sdk';
|
|
14
|
+
import { encodeFunctionData, getAddress, isAddress, parseEventLogs, toHex } from 'viem';
|
|
15
|
+
import { CHAIN, chainId, explorerBase } from '../config.js';
|
|
16
|
+
import { CliError } from '../errors.js';
|
|
17
|
+
import { isDryRun } from '../flags.js';
|
|
18
|
+
import { jsonMode, withJson } from '../jsonout.js';
|
|
19
|
+
import { bold, dim, g, ok } from '../output.js';
|
|
20
|
+
import { confirmSend, laneFromFlags } from '../riskgate.js';
|
|
21
|
+
import { openWalletSession, signHotSequence, signTx, } from '../signer.js';
|
|
22
|
+
/** Matches the App Store registry schema (`lib/submissions.ts` in abx-app-store). */
|
|
23
|
+
export const APP_CATEGORIES = [
|
|
24
|
+
'Create',
|
|
25
|
+
'Games',
|
|
26
|
+
'Physical world',
|
|
27
|
+
'Records',
|
|
28
|
+
'Coordination',
|
|
29
|
+
'Utilities',
|
|
30
|
+
'Developer tools',
|
|
31
|
+
];
|
|
32
|
+
export const APP_STAGES = ['Live', 'Prototype', 'Concept'];
|
|
33
|
+
export const APP_TONES = ['acid', 'coral', 'blue', 'violet', 'amber', 'mint'];
|
|
34
|
+
export const APP_RELATIONSHIP = 'built-on-abx';
|
|
35
|
+
export const SUBMIT_APP_CATALOG_NOTE = 'The on-chain listing is updated. Hosted catalog refresh timing is provider-owned; verify the displayed copy separately. Re-run this command to change the on-chain copy (no second mint).';
|
|
36
|
+
const PARAM_KEYS = [
|
|
37
|
+
'name',
|
|
38
|
+
'summary',
|
|
39
|
+
'description',
|
|
40
|
+
'url',
|
|
41
|
+
'urlLabel',
|
|
42
|
+
'image',
|
|
43
|
+
'mark',
|
|
44
|
+
'tone',
|
|
45
|
+
'category',
|
|
46
|
+
'relationships',
|
|
47
|
+
'stage',
|
|
48
|
+
'tags',
|
|
49
|
+
];
|
|
50
|
+
/** Sequencer/RPC per-tx gas cap. A full param dump in one multicall exceeds it. */
|
|
51
|
+
export const MAX_CALLS_PER_TX = 3;
|
|
52
|
+
const MINTER_ABI = [
|
|
53
|
+
{
|
|
54
|
+
type: 'function',
|
|
55
|
+
name: 'submit',
|
|
56
|
+
stateMutability: 'nonpayable',
|
|
57
|
+
inputs: [{ name: 'collection', type: 'address' }],
|
|
58
|
+
outputs: [{ name: 'tokenId', type: 'uint256' }],
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
type: 'function',
|
|
62
|
+
name: 'claimed',
|
|
63
|
+
stateMutability: 'view',
|
|
64
|
+
inputs: [{ name: 'collection', type: 'address' }],
|
|
65
|
+
outputs: [{ name: '', type: 'bool' }],
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
type: 'function',
|
|
69
|
+
name: 'entryOf',
|
|
70
|
+
stateMutability: 'view',
|
|
71
|
+
inputs: [{ name: 'collection', type: 'address' }],
|
|
72
|
+
outputs: [{ name: '', type: 'uint256' }],
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
type: 'event',
|
|
76
|
+
name: 'EntrySubmitted',
|
|
77
|
+
inputs: [
|
|
78
|
+
{ name: 'collection', type: 'address', indexed: true },
|
|
79
|
+
{ name: 'tokenId', type: 'uint256', indexed: true },
|
|
80
|
+
{ name: 'owner', type: 'address', indexed: true },
|
|
81
|
+
],
|
|
82
|
+
},
|
|
83
|
+
];
|
|
84
|
+
const OWNER_ABI = [
|
|
85
|
+
{
|
|
86
|
+
type: 'function',
|
|
87
|
+
name: 'owner',
|
|
88
|
+
stateMutability: 'view',
|
|
89
|
+
inputs: [],
|
|
90
|
+
outputs: [{ name: '', type: 'address' }],
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
type: 'function',
|
|
94
|
+
name: 'ownerOf',
|
|
95
|
+
stateMutability: 'view',
|
|
96
|
+
inputs: [{ name: 'tokenId', type: 'uint256' }],
|
|
97
|
+
outputs: [{ name: '', type: 'address' }],
|
|
98
|
+
},
|
|
99
|
+
];
|
|
100
|
+
/**
|
|
101
|
+
* Shipped App Store registry + gated minter, per chain. Override with
|
|
102
|
+
* `--registry` / `--minter` or `ABX_APP_STORE_REGISTRY` / `ABX_APP_STORE_MINTER`.
|
|
103
|
+
* A chain with no row is not an error until someone runs this command there.
|
|
104
|
+
*/
|
|
105
|
+
const APP_STORE = {
|
|
106
|
+
'base-sepolia': {
|
|
107
|
+
registry: '0xBD0D5eE35075E62d970467771775c630B9FB87fa',
|
|
108
|
+
minter: '0xBC0aD16F6501424f7028260a5A396b41aa6d9046',
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
const USAGE = 'abx submit-app <collection> --name <s> --summary "<s>" --description "<s>" [--mark A/] [--tone acid] [--category Create] [--stage Prototype] [--url https://…] [--url-label "Open app"] [--image https://…] [--tags a,b] [--registry 0x…] [--minter 0x…] [--sign|--unsigned|--dry-run]';
|
|
112
|
+
function requireFlag(flags, name) {
|
|
113
|
+
const v = flags[name];
|
|
114
|
+
if (!v || v === 'true') {
|
|
115
|
+
throw new Error(`missing --${name}\nusage: ${USAGE}`);
|
|
116
|
+
}
|
|
117
|
+
return v;
|
|
118
|
+
}
|
|
119
|
+
function optionalFlag(flags, name) {
|
|
120
|
+
const v = flags[name];
|
|
121
|
+
if (!v || v === 'true')
|
|
122
|
+
return '';
|
|
123
|
+
return v;
|
|
124
|
+
}
|
|
125
|
+
function oneOf(value, options, flag) {
|
|
126
|
+
if (options.includes(value))
|
|
127
|
+
return value;
|
|
128
|
+
throw new Error(`--${flag} must be one of ${options.join(' | ')} (got "${value}").`);
|
|
129
|
+
}
|
|
130
|
+
function requireHttps(value, flag) {
|
|
131
|
+
if (!value)
|
|
132
|
+
return '';
|
|
133
|
+
let url;
|
|
134
|
+
try {
|
|
135
|
+
url = new URL(value);
|
|
136
|
+
}
|
|
137
|
+
catch {
|
|
138
|
+
throw new Error(`--${flag} must be an HTTPS URL.`);
|
|
139
|
+
}
|
|
140
|
+
if (url.protocol !== 'https:')
|
|
141
|
+
throw new Error(`--${flag} must be an HTTPS URL.`);
|
|
142
|
+
return value.trim();
|
|
143
|
+
}
|
|
144
|
+
function parseTags(raw) {
|
|
145
|
+
if (!raw)
|
|
146
|
+
return [];
|
|
147
|
+
const tags = raw
|
|
148
|
+
.split(/[,\n]/)
|
|
149
|
+
.map((t) => t.trim())
|
|
150
|
+
.filter(Boolean);
|
|
151
|
+
if (tags.length > 12)
|
|
152
|
+
throw new Error('--tags accepts at most 12 tags.');
|
|
153
|
+
const seen = new Set();
|
|
154
|
+
for (const tag of tags) {
|
|
155
|
+
if (tag.length > 60)
|
|
156
|
+
throw new Error(`tag "${tag}" is longer than 60 characters.`);
|
|
157
|
+
const key = tag.toLowerCase();
|
|
158
|
+
if (seen.has(key))
|
|
159
|
+
throw new Error(`duplicate tag "${tag}".`);
|
|
160
|
+
seen.add(key);
|
|
161
|
+
}
|
|
162
|
+
return tags;
|
|
163
|
+
}
|
|
164
|
+
function bound(value, flag, max, min = 1) {
|
|
165
|
+
const t = value.trim();
|
|
166
|
+
if (t.length < min)
|
|
167
|
+
throw new Error(`--${flag} is required.`);
|
|
168
|
+
if (t.length > max)
|
|
169
|
+
throw new Error(`--${flag} is longer than ${max} characters.`);
|
|
170
|
+
return t;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Catalog copy from flags. Requires name / summary / description so deploy identity
|
|
174
|
+
* cannot silently become the listing.
|
|
175
|
+
*/
|
|
176
|
+
export function parseSubmitAppEntry(flags) {
|
|
177
|
+
return {
|
|
178
|
+
name: bound(requireFlag(flags, 'name'), 'name', 100),
|
|
179
|
+
summary: bound(requireFlag(flags, 'summary'), 'summary', 240),
|
|
180
|
+
description: bound(requireFlag(flags, 'description'), 'description', 2_000),
|
|
181
|
+
url: requireHttps(optionalFlag(flags, 'url'), 'url'),
|
|
182
|
+
urlLabel: optionalFlag(flags, 'url-label').trim().slice(0, 60),
|
|
183
|
+
image: requireHttps(optionalFlag(flags, 'image'), 'image'),
|
|
184
|
+
mark: bound(optionalFlag(flags, 'mark') || 'A/', 'mark', 3),
|
|
185
|
+
tone: oneOf(optionalFlag(flags, 'tone') || 'acid', APP_TONES, 'tone'),
|
|
186
|
+
category: oneOf(optionalFlag(flags, 'category') || 'Create', APP_CATEGORIES, 'category'),
|
|
187
|
+
stage: oneOf(optionalFlag(flags, 'stage') || 'Prototype', APP_STAGES, 'stage'),
|
|
188
|
+
tags: parseTags(optionalFlag(flags, 'tags')),
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
export function paramValues(entry) {
|
|
192
|
+
return {
|
|
193
|
+
name: entry.name,
|
|
194
|
+
summary: entry.summary,
|
|
195
|
+
description: entry.description,
|
|
196
|
+
url: entry.url,
|
|
197
|
+
urlLabel: entry.urlLabel,
|
|
198
|
+
image: entry.image,
|
|
199
|
+
mark: entry.mark,
|
|
200
|
+
tone: entry.tone,
|
|
201
|
+
category: entry.category,
|
|
202
|
+
relationships: APP_RELATIONSHIP,
|
|
203
|
+
stage: entry.stage,
|
|
204
|
+
tags: entry.tags.join(','),
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
export function resolveAppStoreAddresses(chainKey, flags = {}, env = process.env) {
|
|
208
|
+
const shipped = APP_STORE[chainKey];
|
|
209
|
+
const registryRaw = optionalFlag(flags, 'registry') || env.ABX_APP_STORE_REGISTRY || shipped?.registry;
|
|
210
|
+
const minterRaw = optionalFlag(flags, 'minter') || env.ABX_APP_STORE_MINTER || shipped?.minter;
|
|
211
|
+
if (!registryRaw || !minterRaw) {
|
|
212
|
+
throw new Error(`No ABX App Store registry is shipped for '${chainKey}'. Pass --registry 0x… and --minter 0x… ` +
|
|
213
|
+
`(or set ABX_APP_STORE_REGISTRY / ABX_APP_STORE_MINTER).`);
|
|
214
|
+
}
|
|
215
|
+
if (!isAddress(registryRaw) || !isAddress(minterRaw)) {
|
|
216
|
+
throw new Error('--registry and --minter must be 0x… addresses.');
|
|
217
|
+
}
|
|
218
|
+
return { registry: getAddress(registryRaw), minter: getAddress(minterRaw) };
|
|
219
|
+
}
|
|
220
|
+
export function chunkItems(items, size = MAX_CALLS_PER_TX) {
|
|
221
|
+
if (size < 1)
|
|
222
|
+
throw new Error('chunk size must be ≥ 1');
|
|
223
|
+
const out = [];
|
|
224
|
+
for (let i = 0; i < items.length; i += size)
|
|
225
|
+
out.push(items.slice(i, i + size));
|
|
226
|
+
return out;
|
|
227
|
+
}
|
|
228
|
+
export function buildParamOps(args) {
|
|
229
|
+
const values = paramValues(args.entry);
|
|
230
|
+
const ops = [];
|
|
231
|
+
for (const key of PARAM_KEYS) {
|
|
232
|
+
const value = values[key];
|
|
233
|
+
if (value === '')
|
|
234
|
+
continue;
|
|
235
|
+
if (key === 'tone') {
|
|
236
|
+
const encoded = encodeScalarParam('Select', value, [...APP_TONES]);
|
|
237
|
+
ops.push(prepareConfigureTokenParam({
|
|
238
|
+
contract: args.registry,
|
|
239
|
+
tokenId: args.tokenId,
|
|
240
|
+
key,
|
|
241
|
+
value: encoded.value,
|
|
242
|
+
display: encoded.display,
|
|
243
|
+
chainId: args.chainId,
|
|
244
|
+
}));
|
|
245
|
+
continue;
|
|
246
|
+
}
|
|
247
|
+
ops.push(prepareConfigureTokenParamData({
|
|
248
|
+
contract: args.registry,
|
|
249
|
+
tokenId: args.tokenId,
|
|
250
|
+
key,
|
|
251
|
+
data: toHex(new TextEncoder().encode(value)),
|
|
252
|
+
chainId: args.chainId,
|
|
253
|
+
}));
|
|
254
|
+
}
|
|
255
|
+
return ops;
|
|
256
|
+
}
|
|
257
|
+
export function batchParamOps(ops) {
|
|
258
|
+
return chunkItems(ops, MAX_CALLS_PER_TX).map((group, i, all) => {
|
|
259
|
+
if (group.length === 1)
|
|
260
|
+
return group[0];
|
|
261
|
+
return prepareMulticall({
|
|
262
|
+
ops: group,
|
|
263
|
+
summary: `Write App Store metadata ${i + 1}/${all.length} (${group.length} fields)`,
|
|
264
|
+
});
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
function prepareSubmitCollection(args) {
|
|
268
|
+
return {
|
|
269
|
+
op: 'submit-app',
|
|
270
|
+
to: args.minter,
|
|
271
|
+
data: encodeFunctionData({
|
|
272
|
+
abi: MINTER_ABI,
|
|
273
|
+
functionName: 'submit',
|
|
274
|
+
args: [args.collection],
|
|
275
|
+
}),
|
|
276
|
+
value: '0x0',
|
|
277
|
+
chainId: args.chainId,
|
|
278
|
+
summary: `List ${args.collection} in the ABX App Store`,
|
|
279
|
+
fields: { minter: args.minter, collection: args.collection },
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
function tokenIdFromMintLogs(logs) {
|
|
283
|
+
try {
|
|
284
|
+
const parsed = parseEventLogs({
|
|
285
|
+
abi: MINTER_ABI,
|
|
286
|
+
logs: logs,
|
|
287
|
+
eventName: 'EntrySubmitted',
|
|
288
|
+
});
|
|
289
|
+
const first = parsed[0];
|
|
290
|
+
return first ? first.args.tokenId : null;
|
|
291
|
+
}
|
|
292
|
+
catch {
|
|
293
|
+
return null;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Bounded, backed-off retry for ONLY the first metadata write immediately following a mint THIS
|
|
298
|
+
* run performed.
|
|
299
|
+
*
|
|
300
|
+
* `pinGas` (packages/sdk/src/execute.ts) is a provable-floor lie detector: it re-tries an estimate
|
|
301
|
+
* only when the number it got back is BELOW a gas floor it can compute in advance from bytes stored
|
|
302
|
+
* on-chain (its own docs walk through why). None of `buildParamOps`'s writes carry a `gasFloor` — a
|
|
303
|
+
* param write has no on-chain bytes to compute one from — so an estimate revert on any of them
|
|
304
|
+
* surfaces through `pinGas` immediately, with zero retries: `if (floor === 0n) throw err`. That is
|
|
305
|
+
* the right GENERAL behavior — an unfloored estimate revert is usually a real rejection ("caller is
|
|
306
|
+
* not the token owner"), and teaching `pinGas` to retry every unfloored revert would hide real ones
|
|
307
|
+
* behind a multi-second stall on every write the CLI makes, not just this one.
|
|
308
|
+
*
|
|
309
|
+
* This ONE call site is different in a way `pinGas` has no way to see: the token being written to is
|
|
310
|
+
* one THIS SAME PROCESS just minted a few lines up. Its estimate reverting is very likely the same
|
|
311
|
+
* read-after-write lag `execute.ts` already retries the nonce and the code-deposit gas for — the RPC
|
|
312
|
+
* answering the estimate hasn't caught up to the mint's block yet, so the registry's owner-gated
|
|
313
|
+
* param check reads a token that (from that node's point of view) does not exist yet — just on a
|
|
314
|
+
* write `pinGas` has no floor to detect it with. So the retry lives here, scoped to exactly the one
|
|
315
|
+
* write our own just-broadcast mint could have caused to fail this way (see `resumableConfigError`
|
|
316
|
+
* for what happens once the bound is spent).
|
|
317
|
+
*/
|
|
318
|
+
export const FIRST_METADATA_WRITE_RETRY_DELAYS_MS = [2_000, 4_000, 8_000];
|
|
319
|
+
/**
|
|
320
|
+
* Takes a `send` thunk rather than a tx + lane opts so the retry policy is testable on its own — a
|
|
321
|
+
* fake `send` that fails a scripted number of times before succeeding, no RPC or signing involved —
|
|
322
|
+
* the same shape `sendMintThenParams` above already uses for its lane-agnostic send injection.
|
|
323
|
+
*/
|
|
324
|
+
export async function withFirstMetadataWriteRetry(send, delaysMs = FIRST_METADATA_WRITE_RETRY_DELAYS_MS) {
|
|
325
|
+
for (let retry = 0;; retry++) {
|
|
326
|
+
try {
|
|
327
|
+
return await send();
|
|
328
|
+
}
|
|
329
|
+
catch (err) {
|
|
330
|
+
const delay = delaysMs[retry];
|
|
331
|
+
if (delay === undefined)
|
|
332
|
+
throw err; // bound spent — surface the real error to the caller
|
|
333
|
+
console.log(dim(` metadata write did not simulate yet (RPC may still be catching up to the mint) — ` +
|
|
334
|
+
`retrying in ${delay / 1000}s… (retry ${retry + 1}/${delaysMs.length})`));
|
|
335
|
+
await new Promise((r) => setTimeout(r, delay));
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Wrap an exhausted retry as an explicit resumable result instead of a bare estimate error. The mint
|
|
341
|
+
* already happened and is irreversible, and the collection's `claimed` gate — read at the top of
|
|
342
|
+
* `cmdSubmitApp`, before either lane decides whether to build a mint tx at all — means the NEXT
|
|
343
|
+
* invocation, even seconds later once the RPC has caught up, is guaranteed to skip straight to
|
|
344
|
+
* writing metadata onto THIS token rather than minting a second one (see `cmdSubmitApp`'s `claimed`
|
|
345
|
+
* read and its `if (claimed) { … } else { … }` branch just below it — a fresh mint is only ever
|
|
346
|
+
* prepared in the `else`). So the fix is always the same command again, never a different one — name
|
|
347
|
+
* that explicitly rather than leaving a raw revert on screen with no next step.
|
|
348
|
+
*/
|
|
349
|
+
export function resumableConfigError(args) {
|
|
350
|
+
const reason = args.cause instanceof Error ? args.cause.message : String(args.cause);
|
|
351
|
+
return new Error(`Minted token #${args.tokenId.toString()}, but its metadata still won't simulate after retrying — nothing ` +
|
|
352
|
+
`else was sent. The collection is now claimed, so re-running this exact command will skip the mint and ` +
|
|
353
|
+
`pick up writing metadata onto token #${args.tokenId.toString()}.\n underlying: ${reason}`);
|
|
354
|
+
}
|
|
355
|
+
function previewTx(tx, expectedSigner) {
|
|
356
|
+
console.log(`\n ${bold('◆ ' + tx.summary)} ${dim('(dry run — nothing sent)')}`);
|
|
357
|
+
for (const [k, v] of Object.entries(tx.fields))
|
|
358
|
+
console.log(` ${dim(k.padEnd(12))} ${v}`);
|
|
359
|
+
console.log(` ${dim('to'.padEnd(12))} ${tx.to ?? dim('(none)')}`);
|
|
360
|
+
if (expectedSigner)
|
|
361
|
+
console.log(` ${dim('signer'.padEnd(12))} ${expectedSigner}`);
|
|
362
|
+
}
|
|
363
|
+
export async function cmdSubmitApp(address, flags) {
|
|
364
|
+
if (!address || address.startsWith('--')) {
|
|
365
|
+
console.error(`usage: ${USAGE}\n`);
|
|
366
|
+
throw new CliError('', 1, true);
|
|
367
|
+
}
|
|
368
|
+
if (!isAddress(address)) {
|
|
369
|
+
throw new Error(`<collection> must be a 0x… address (got "${address}").`);
|
|
370
|
+
}
|
|
371
|
+
const collection = getAddress(address);
|
|
372
|
+
const entry = parseSubmitAppEntry(flags);
|
|
373
|
+
const store = resolveAppStoreAddresses(CHAIN, flags);
|
|
374
|
+
const cid = chainId();
|
|
375
|
+
const publicClient = makePublicClient({ chainKey: CHAIN });
|
|
376
|
+
const claimed = (await publicClient.readContract({
|
|
377
|
+
address: store.minter,
|
|
378
|
+
abi: MINTER_ABI,
|
|
379
|
+
functionName: 'claimed',
|
|
380
|
+
args: [collection],
|
|
381
|
+
}));
|
|
382
|
+
let tokenId = null;
|
|
383
|
+
let expectedSigner;
|
|
384
|
+
if (claimed) {
|
|
385
|
+
tokenId = (await publicClient.readContract({
|
|
386
|
+
address: store.minter,
|
|
387
|
+
abi: MINTER_ABI,
|
|
388
|
+
functionName: 'entryOf',
|
|
389
|
+
args: [collection],
|
|
390
|
+
}));
|
|
391
|
+
expectedSigner = (await publicClient.readContract({
|
|
392
|
+
address: store.registry,
|
|
393
|
+
abi: OWNER_ABI,
|
|
394
|
+
functionName: 'ownerOf',
|
|
395
|
+
args: [tokenId],
|
|
396
|
+
}));
|
|
397
|
+
// This narration runs BEFORE `withJson` below ever starts — its console.log → stderr swap
|
|
398
|
+
// hasn't engaged yet, so an unguarded `console.log` here would land on the real stdout and
|
|
399
|
+
// corrupt the one JSON document `--json` promises there (see jsonout.ts). Every other narration
|
|
400
|
+
// line in this command lives inside the `withJson` body for exactly that reason; this is the one
|
|
401
|
+
// read that happens first (deciding whether to mint at all), so it routes itself the same way
|
|
402
|
+
// `withJson` would: stderr under `--json` (still visible, never suppressed), plain stdout
|
|
403
|
+
// otherwise.
|
|
404
|
+
const alreadyListedLine = ` already listed as token #${tokenId.toString()} — skipping mint, writing metadata (same as /update).`;
|
|
405
|
+
if (jsonMode(flags))
|
|
406
|
+
process.stderr.write(dim(alreadyListedLine) + '\n');
|
|
407
|
+
else
|
|
408
|
+
console.log(dim(alreadyListedLine));
|
|
409
|
+
}
|
|
410
|
+
else {
|
|
411
|
+
expectedSigner = (await publicClient.readContract({
|
|
412
|
+
address: collection,
|
|
413
|
+
abi: OWNER_ABI,
|
|
414
|
+
functionName: 'owner',
|
|
415
|
+
args: [],
|
|
416
|
+
}));
|
|
417
|
+
}
|
|
418
|
+
const paramOps = tokenId !== null
|
|
419
|
+
? buildParamOps({ registry: store.registry, tokenId, entry, chainId: cid })
|
|
420
|
+
: buildParamOps({ registry: store.registry, tokenId: 0n, entry, chainId: cid });
|
|
421
|
+
// When the token id isn't known yet, ops are only used to count batches for the sign-page total
|
|
422
|
+
// and the dry-run preview. Calldata is rebuilt after mint with the real id.
|
|
423
|
+
const paramBatches = batchParamOps(paramOps);
|
|
424
|
+
const mintTx = claimed
|
|
425
|
+
? null
|
|
426
|
+
: prepareSubmitCollection({ minter: store.minter, collection, chainId: cid });
|
|
427
|
+
const approvalCount = (mintTx ? 1 : 0) + paramBatches.length;
|
|
428
|
+
return withJson(flags, async (emit) => {
|
|
429
|
+
if (isDryRun(flags)) {
|
|
430
|
+
if (mintTx)
|
|
431
|
+
previewTx(mintTx, expectedSigner);
|
|
432
|
+
console.log(dim(`\n then ${paramBatches.length} metadata transaction(s) (${paramOps.length} fields, max ${MAX_CALLS_PER_TX} per tx).`));
|
|
433
|
+
for (const key of PARAM_KEYS) {
|
|
434
|
+
const value = paramValues(entry)[key];
|
|
435
|
+
if (value === '')
|
|
436
|
+
continue;
|
|
437
|
+
console.log(` ${dim(key.padEnd(16))} ${value.length > 80 ? value.slice(0, 77) + '…' : value}`);
|
|
438
|
+
}
|
|
439
|
+
console.log(dim(`\n Re-run without --dry-run to send (lane: ${laneFromFlags(flags)}).\n`));
|
|
440
|
+
return {
|
|
441
|
+
collection,
|
|
442
|
+
chainId: cid,
|
|
443
|
+
registry: store.registry,
|
|
444
|
+
minter: store.minter,
|
|
445
|
+
claimed,
|
|
446
|
+
tokenId: tokenId !== null ? tokenId.toString() : null,
|
|
447
|
+
sent: false,
|
|
448
|
+
approvals: approvalCount,
|
|
449
|
+
};
|
|
450
|
+
}
|
|
451
|
+
await confirmSend(claimed
|
|
452
|
+
? `Update App Store listing #${tokenId.toString()} (${paramBatches.length} metadata tx)`
|
|
453
|
+
: `List ${collection} in the App Store (mint + ${paramBatches.length} metadata tx)`, flags);
|
|
454
|
+
await assertChainId(CHAIN);
|
|
455
|
+
const lane = laneFromFlags(flags);
|
|
456
|
+
let mintHash = null;
|
|
457
|
+
let paramsHashes = [];
|
|
458
|
+
let listedId = tokenId;
|
|
459
|
+
// The mint is real and irreversible the moment its receipt confirms — a `--json` caller must be
|
|
460
|
+
// able to recover that token id even if every step after this one fails (jsonout.ts's `withJson`
|
|
461
|
+
// prints whatever was last `emit()`-ed before a later throw, alongside the error). Nothing past
|
|
462
|
+
// the mint is guaranteed sent yet, so this always reports `sent: false`; the final return at the
|
|
463
|
+
// bottom of this function is the only place that reports `sent: true`, and (per withJson) a
|
|
464
|
+
// returned value always wins over an earlier emit.
|
|
465
|
+
const emitMinted = () => emit({
|
|
466
|
+
collection,
|
|
467
|
+
chainId: cid,
|
|
468
|
+
registry: store.registry,
|
|
469
|
+
minter: store.minter,
|
|
470
|
+
claimed,
|
|
471
|
+
tokenId: listedId !== null ? listedId.toString() : null,
|
|
472
|
+
sent: false,
|
|
473
|
+
mintTx: mintHash,
|
|
474
|
+
paramsTxs: paramsHashes,
|
|
475
|
+
});
|
|
476
|
+
const sendMintThenParams = async (send) => {
|
|
477
|
+
if (mintTx) {
|
|
478
|
+
const minted = await send(mintTx);
|
|
479
|
+
mintHash = minted.txHash;
|
|
480
|
+
listedId = tokenIdFromMintLogs(minted.logs);
|
|
481
|
+
if (listedId === null) {
|
|
482
|
+
throw new Error('Mint succeeded but the entry token id was not in the receipt. The collection is claimed — retry to write metadata onto the existing token.');
|
|
483
|
+
}
|
|
484
|
+
ok(`listed as token #${listedId.toString()}`);
|
|
485
|
+
emitMinted();
|
|
486
|
+
}
|
|
487
|
+
const ops = buildParamOps({
|
|
488
|
+
registry: store.registry,
|
|
489
|
+
tokenId: listedId,
|
|
490
|
+
entry,
|
|
491
|
+
chainId: cid,
|
|
492
|
+
});
|
|
493
|
+
const batches = batchParamOps(ops);
|
|
494
|
+
for (const [i, tx] of batches.entries()) {
|
|
495
|
+
const sent = await send(tx);
|
|
496
|
+
paramsHashes.push(sent.txHash);
|
|
497
|
+
console.log(dim(` metadata ${i + 1}/${batches.length}`));
|
|
498
|
+
}
|
|
499
|
+
};
|
|
500
|
+
if (lane === 'unsigned') {
|
|
501
|
+
// Cold lane can't do mint-then-params in one shot (the token id is assigned at mint).
|
|
502
|
+
// Print the mint (or the param batches if already claimed) and stop.
|
|
503
|
+
if (mintTx) {
|
|
504
|
+
await signTx(mintTx, {
|
|
505
|
+
lane: 'unsigned',
|
|
506
|
+
chainKey: CHAIN,
|
|
507
|
+
expectedSigner,
|
|
508
|
+
yes: !!flags.yes,
|
|
509
|
+
});
|
|
510
|
+
console.log(dim(' After the mint confirms, re-run this command to write catalog copy onto the new token (configure is an upsert).'));
|
|
511
|
+
}
|
|
512
|
+
else {
|
|
513
|
+
for (const tx of paramBatches) {
|
|
514
|
+
await signTx(tx, {
|
|
515
|
+
lane: 'unsigned',
|
|
516
|
+
chainKey: CHAIN,
|
|
517
|
+
expectedSigner,
|
|
518
|
+
yes: !!flags.yes,
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
return {
|
|
523
|
+
collection,
|
|
524
|
+
chainId: cid,
|
|
525
|
+
registry: store.registry,
|
|
526
|
+
minter: store.minter,
|
|
527
|
+
claimed,
|
|
528
|
+
tokenId: listedId !== null ? listedId.toString() : null,
|
|
529
|
+
sent: false,
|
|
530
|
+
mintTx: null,
|
|
531
|
+
paramsTxs: [],
|
|
532
|
+
};
|
|
533
|
+
}
|
|
534
|
+
if (lane === 'send') {
|
|
535
|
+
const results = [];
|
|
536
|
+
if (mintTx) {
|
|
537
|
+
const minted = await signTx(mintTx, {
|
|
538
|
+
lane: 'send',
|
|
539
|
+
chainKey: CHAIN,
|
|
540
|
+
expectedSigner,
|
|
541
|
+
yes: !!flags.yes,
|
|
542
|
+
});
|
|
543
|
+
if (!minted)
|
|
544
|
+
throw new Error('Mint was not sent.');
|
|
545
|
+
results.push(minted);
|
|
546
|
+
mintHash = minted.txHash;
|
|
547
|
+
const receipt = await publicClient.getTransactionReceipt({ hash: minted.txHash });
|
|
548
|
+
listedId = tokenIdFromMintLogs(receipt.logs);
|
|
549
|
+
if (listedId === null) {
|
|
550
|
+
throw new Error('Mint succeeded but the entry token id was not in the receipt. Retry to write metadata onto the existing token.');
|
|
551
|
+
}
|
|
552
|
+
ok(`listed as token #${listedId.toString()}`);
|
|
553
|
+
emitMinted();
|
|
554
|
+
}
|
|
555
|
+
const ops = buildParamOps({
|
|
556
|
+
registry: store.registry,
|
|
557
|
+
tokenId: listedId,
|
|
558
|
+
entry,
|
|
559
|
+
chainId: cid,
|
|
560
|
+
});
|
|
561
|
+
const batches = batchParamOps(ops);
|
|
562
|
+
if (batches.length > 0) {
|
|
563
|
+
// Only the batch immediately after OUR OWN just-broadcast mint risks the read-after-write RPC
|
|
564
|
+
// lag `withFirstMetadataWriteRetry` retries: a run that skipped straight to `configure` (already
|
|
565
|
+
// claimed, no mint this run) hits state that has been settled for as long as the collection
|
|
566
|
+
// has been listed, so it gets the ordinary un-retried path instead.
|
|
567
|
+
const [first, ...rest] = batches;
|
|
568
|
+
const sendFirst = async () => (await signHotSequence([first], { chainKey: CHAIN, yes: !!flags.yes }))[0];
|
|
569
|
+
let firstResult;
|
|
570
|
+
try {
|
|
571
|
+
firstResult = mintTx ? await withFirstMetadataWriteRetry(sendFirst) : await sendFirst();
|
|
572
|
+
}
|
|
573
|
+
catch (err) {
|
|
574
|
+
// Bounded retries spent (or this wasn't a fresh mint, so none were attempted): the mint is
|
|
575
|
+
// done either way, so tell the caller exactly how to finish rather than a bare estimate
|
|
576
|
+
// error with no next step.
|
|
577
|
+
throw resumableConfigError({ tokenId: listedId, cause: err });
|
|
578
|
+
}
|
|
579
|
+
results.push(firstResult);
|
|
580
|
+
paramsHashes.push(firstResult.txHash);
|
|
581
|
+
if (rest.length > 0) {
|
|
582
|
+
const restResults = await signHotSequence(rest, { chainKey: CHAIN, yes: !!flags.yes });
|
|
583
|
+
results.push(...restResults);
|
|
584
|
+
paramsHashes.push(...restResults.map((r) => r.txHash));
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
else {
|
|
589
|
+
const session = await openWalletSession({
|
|
590
|
+
chainKey: CHAIN,
|
|
591
|
+
expectedSigner,
|
|
592
|
+
total: approvalCount,
|
|
593
|
+
port: flags.port ? Number(flags.port) : undefined,
|
|
594
|
+
signUrlFile: flags['sign-url-file'],
|
|
595
|
+
});
|
|
596
|
+
try {
|
|
597
|
+
await session.connect();
|
|
598
|
+
await sendMintThenParams(async (tx) => {
|
|
599
|
+
const { txHash, receipt } = await session.send(tx);
|
|
600
|
+
return { txHash, logs: receipt.logs };
|
|
601
|
+
});
|
|
602
|
+
}
|
|
603
|
+
finally {
|
|
604
|
+
session.close();
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
console.log(`\n ${g('Listed.')} token #${listedId.toString()} on ${CHAIN} ${dim(explorerBase() + '/token/' + store.registry + '?a=' + listedId.toString())}`);
|
|
608
|
+
console.log(dim(` ${SUBMIT_APP_CATALOG_NOTE}`));
|
|
609
|
+
return {
|
|
610
|
+
collection,
|
|
611
|
+
chainId: cid,
|
|
612
|
+
registry: store.registry,
|
|
613
|
+
minter: store.minter,
|
|
614
|
+
claimed,
|
|
615
|
+
tokenId: listedId.toString(),
|
|
616
|
+
sent: true,
|
|
617
|
+
mintTx: mintHash,
|
|
618
|
+
paramsTxs: paramsHashes,
|
|
619
|
+
};
|
|
620
|
+
});
|
|
621
|
+
}
|
|
622
|
+
//# sourceMappingURL=submit-app.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"submit-app.js","sourceRoot":"","sources":["../../src/commands/submit-app.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,0BAA0B,EAC1B,8BAA8B,EAC9B,gBAAgB,GAIjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAC,kBAAkB,EAAE,UAAU,EAAE,SAAS,EAAE,cAAc,EAAE,KAAK,EAAC,MAAM,MAAM,CAAC;AACtF,OAAO,EAAC,KAAK,EAAE,OAAO,EAAE,YAAY,EAAC,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAC,QAAQ,EAAC,MAAM,cAAc,CAAC;AACtC,OAAO,EAAa,QAAQ,EAAC,MAAM,aAAa,CAAC;AACjD,OAAO,EAAC,QAAQ,EAAE,QAAQ,EAAC,MAAM,eAAe,CAAC;AACjD,OAAO,EAAC,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAC,WAAW,EAAE,aAAa,EAAC,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,MAAM,GAEP,MAAM,cAAc,CAAC;AAEtB,qFAAqF;AACrF,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,QAAQ;IACR,OAAO;IACP,gBAAgB;IAChB,SAAS;IACT,cAAc;IACd,WAAW;IACX,iBAAiB;CACT,CAAC;AAEX,MAAM,CAAC,MA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