@artblocks/abx-sdk 0.1.0-alpha.13 → 0.1.0-alpha.14
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/dist/abi/generated.d.ts +926 -249
- package/dist/abi/generated.d.ts.map +1 -1
- package/dist/abi/generated.js +41 -39
- package/dist/abi/generated.js.map +1 -1
- package/dist/abi/index.d.ts +468 -61
- package/dist/abi/index.d.ts.map +1 -1
- package/dist/abi/index.js +16 -7
- package/dist/abi/index.js.map +1 -1
- package/dist/anchors.d.ts +70 -32
- package/dist/anchors.d.ts.map +1 -1
- package/dist/anchors.js +163 -32
- package/dist/anchors.js.map +1 -1
- package/dist/create2.d.ts +78 -7
- package/dist/create2.d.ts.map +1 -1
- package/dist/create2.js +149 -20
- package/dist/create2.js.map +1 -1
- package/dist/creator-token.d.ts +71 -4
- package/dist/creator-token.d.ts.map +1 -1
- package/dist/creator-token.js +94 -4
- package/dist/creator-token.js.map +1 -1
- package/dist/deploy.d.ts +49 -23
- package/dist/deploy.d.ts.map +1 -1
- package/dist/deploy.js +156 -76
- package/dist/deploy.js.map +1 -1
- package/dist/deployments.d.ts +4 -0
- package/dist/deployments.d.ts.map +1 -1
- package/dist/deployments.js +110 -45
- package/dist/deployments.js.map +1 -1
- package/dist/errors.d.ts +19 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +24 -0
- package/dist/errors.js.map +1 -1
- package/dist/generator-document.d.ts +3 -2
- package/dist/generator-document.d.ts.map +1 -1
- package/dist/generator-document.js +3 -2
- package/dist/generator-document.js.map +1 -1
- package/dist/generator.d.ts +43 -1
- package/dist/generator.d.ts.map +1 -1
- package/dist/generator.js +29 -0
- package/dist/generator.js.map +1 -1
- package/dist/inspect.d.ts +1 -1
- package/dist/inspect.js +2 -2
- package/dist/inspect.js.map +1 -1
- package/dist/onchain-uri.d.ts +11 -0
- package/dist/onchain-uri.d.ts.map +1 -1
- package/dist/onchain-uri.js +20 -0
- package/dist/onchain-uri.js.map +1 -1
- package/dist/ops.d.ts +210 -11
- package/dist/ops.d.ts.map +1 -1
- package/dist/ops.js +308 -34
- package/dist/ops.js.map +1 -1
- package/dist/reconstruct.d.ts +1 -0
- package/dist/reconstruct.d.ts.map +1 -1
- package/dist/reconstruct.js +13 -1
- package/dist/reconstruct.js.map +1 -1
- package/dist/service.d.ts +1 -1
- package/dist/service.js +1 -1
- package/dist/spine.d.ts +3 -4
- package/dist/spine.d.ts.map +1 -1
- package/dist/spine.js +0 -0
- package/dist/spine.js.map +1 -1
- package/dist/staging.d.ts +32 -3
- package/dist/staging.d.ts.map +1 -1
- package/dist/staging.js +85 -8
- package/dist/staging.js.map +1 -1
- package/dist/tokendata.d.ts +1 -1
- package/dist/tokendata.d.ts.map +1 -1
- package/dist/tokendata.js +21 -3
- package/dist/tokendata.js.map +1 -1
- package/dist/tokens.d.ts +1 -1
- package/dist/tokens.js +1 -1
- package/dist/tokens.js.map +1 -1
- package/dist/types.d.ts +8 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/creator-token.js
CHANGED
|
@@ -8,6 +8,15 @@
|
|
|
8
8
|
* zero — never un-enrolls. Every transfer that isn't a mint/burn (or the validator's own)
|
|
9
9
|
* staticcalls `validateTransfer(caller, from, to, tokenId)` on the validator; a policy
|
|
10
10
|
* violation reverts and bubbles.
|
|
11
|
+
*
|
|
12
|
+
* **`setTransferValidator` is owner-only only while the collection has an owner.** Once
|
|
13
|
+
* `owner() == address(0)` the contract opens one asymmetric door: **anyone** may suspend
|
|
14
|
+
* enforcement by passing `zeroAddress`, and nobody — including that caller — may ever arm a
|
|
15
|
+
* validator again. That is the dead-man release for the worst reachable state (a validator that
|
|
16
|
+
* reverts every transfer on a collection with nobody left to re-point it, which would otherwise
|
|
17
|
+
* strand every collector's token forever). An integrator building for collectors should expose
|
|
18
|
+
* that suspension path on a renounced collection rather than gating it behind an owner check that
|
|
19
|
+
* can no longer be satisfied — see {@link prepareSetTransferValidator}.
|
|
11
20
|
*/
|
|
12
21
|
import { encodeFunctionData, zeroAddress } from 'viem';
|
|
13
22
|
import { oneOfOneImageAbi } from './abi/index.js';
|
|
@@ -65,12 +74,93 @@ export async function readCreatorTokenStatus(client, contract) {
|
|
|
65
74
|
]);
|
|
66
75
|
return { enrolled, validator };
|
|
67
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* A selector no transfer validator implements — the probe question. Same constant the contract's
|
|
79
|
+
* own `_requireHasCode` uses, so the SDK and the chain agree about which addresses are refused.
|
|
80
|
+
*/
|
|
81
|
+
const NOT_A_VALIDATOR_SELECTOR = '0xa9b1c2d3';
|
|
82
|
+
/**
|
|
83
|
+
* Ask a candidate transfer validator a question no validator can answer, and require it to FAIL.
|
|
84
|
+
*
|
|
85
|
+
* **`code.length > 0` is not enough**, which is why this exists and why the on-chain guard was
|
|
86
|
+
* rewritten to match. Two shapes enforce nothing while every read surface — ERC-165,
|
|
87
|
+
* `getTransferValidator()`, the extension beacon — reports enforcement as on: no code at all, and a
|
|
88
|
+
* *permissive fallback* that succeeds for any selector. `validateTransfer` returns nothing, so
|
|
89
|
+
* there is no ABI decode to fail; a Safe (its `FallbackManager.fallback()` returns empty when no
|
|
90
|
+
* handler is set), an uninitialised proxy, and an EIP-7702-delegated EOA all pass a has-code check
|
|
91
|
+
* and then wave every transfer through. A creator pasting their own Safe is the likely real case.
|
|
92
|
+
*
|
|
93
|
+
* So the probe inverts the question: a real validator **reverts** here (verified against OpenSea's
|
|
94
|
+
* SATSR and three Limit Break deployments on mainnet and Sepolia), and a permissive one returns
|
|
95
|
+
* empty success. This mirrors the contract exactly — the same selector, the same "must fail" rule —
|
|
96
|
+
* so an address that passes here is an address the token will accept, and the CLI stops reporting
|
|
97
|
+
* "no code on this chain" for an address that plainly has code.
|
|
98
|
+
*
|
|
99
|
+
* An ERC-165 gate was measured and rejected: none of those four live validators advertises
|
|
100
|
+
* `ITransferValidator`/`ITransferValidator1155`, so requiring an id would refuse the entire
|
|
101
|
+
* ecosystem, including the validator ABX itself recommends.
|
|
102
|
+
*
|
|
103
|
+
* **A misconfiguration guard, not a security boundary** — a contract can always be written to pass
|
|
104
|
+
* this and enforce nothing. It catches the honest mistake. Never throws for an on-chain reason:
|
|
105
|
+
* every failure is a verdict (mirrors `probeSeedSource`).
|
|
106
|
+
*/
|
|
107
|
+
export async function probeTransferValidator(client, validator,
|
|
108
|
+
/** The enrolling/enrolled token, when known — the probe is made as the token, because that is
|
|
109
|
+
* the `msg.sender` the contract's own staticcall presents. */
|
|
110
|
+
opts = {}) {
|
|
111
|
+
let code;
|
|
112
|
+
try {
|
|
113
|
+
code = await client.getCode({ address: validator });
|
|
114
|
+
}
|
|
115
|
+
catch (err) {
|
|
116
|
+
return { verdict: 'unreachable', address: validator, error: firstLine(err) };
|
|
117
|
+
}
|
|
118
|
+
if (!code || code === '0x')
|
|
119
|
+
return { verdict: 'no-code', address: validator };
|
|
120
|
+
try {
|
|
121
|
+
await client.call({
|
|
122
|
+
to: validator,
|
|
123
|
+
data: NOT_A_VALIDATOR_SELECTOR,
|
|
124
|
+
...(opts.as ? { account: opts.as } : {}),
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
catch (err) {
|
|
128
|
+
// A revert is the PASS: this is what a real validator does with an unknown selector. A
|
|
129
|
+
// transport failure lands here too, so classify it rather than calling a broken RPC "ok".
|
|
130
|
+
return isTransportFailure(err)
|
|
131
|
+
? { verdict: 'unreachable', address: validator, error: firstLine(err) }
|
|
132
|
+
: { verdict: 'ok', address: validator };
|
|
133
|
+
}
|
|
134
|
+
return { verdict: 'permissive-fallback', address: validator };
|
|
135
|
+
}
|
|
136
|
+
/** First line of an error message — a revert reason is readable; viem's full dump is not. */
|
|
137
|
+
function firstLine(err) {
|
|
138
|
+
return String(err?.message ?? err).split('\n')[0].trim();
|
|
139
|
+
}
|
|
140
|
+
/** Distinguish "the node said this call reverted" (a verdict) from "the node didn't answer" (retry).
|
|
141
|
+
* viem reports a revert as an execution error carrying revert data or the word itself; anything
|
|
142
|
+
* that never reached execution (timeout, socket, HTTP status, rate limit) must not read as a pass. */
|
|
143
|
+
function isTransportFailure(err) {
|
|
144
|
+
const name = err?.name ?? '';
|
|
145
|
+
const msg = String(err?.message ?? err);
|
|
146
|
+
if (/execution reverted|reverted with|revert reason|InvalidTransferValidator/i.test(msg))
|
|
147
|
+
return false;
|
|
148
|
+
return (/Timeout|Socket|Network|HttpRequest|Connection|RateLimit|InternalRpc|LimitExceeded/i.test(name) ||
|
|
149
|
+
/timed? out|timeout|socket hang up|ECONN|fetch failed|status code|too many requests|rate limit/i.test(msg));
|
|
150
|
+
}
|
|
68
151
|
/**
|
|
69
152
|
* Re-point an enrolled token's transfer validator, or suspend enforcement with
|
|
70
|
-
* `zeroAddress` (the token stays enrolled).
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
153
|
+
* `zeroAddress` (the token stays enrolled). Reverts `NotCreatorToken()` on a token that didn't
|
|
154
|
+
* enroll at deploy — enrollment can never be added later — and `InvalidTransferValidator()` on a
|
|
155
|
+
* validator the chain's own probe refuses (no code on this chain, **or** a permissive fallback that
|
|
156
|
+
* would enforce nothing); call {@link probeTransferValidator} first and refuse those before gas.
|
|
157
|
+
*
|
|
158
|
+
* **Who may sign:** the owner, while there is one. On a collection whose `owner()` is
|
|
159
|
+
* `address(0)`, **any** signer may send this with `validator = zeroAddress` to suspend enforcement
|
|
160
|
+
* permanently — the dead-man release described in this module's header. Arming a validator is still
|
|
161
|
+
* owner-only, so an ownerless collection can only move toward transferability, never back. A UX for
|
|
162
|
+
* collectors should offer that suspension when it sees a renounced, enforcing collection; gating it
|
|
163
|
+
* on `owner()` would hide the one recovery a stranded holder has.
|
|
74
164
|
*/
|
|
75
165
|
export function prepareSetTransferValidator(args) {
|
|
76
166
|
const suspending = args.validator === zeroAddress;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"creator-token.js","sourceRoot":"","sources":["../src/creator-token.ts"],"names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AM,EAAE,EAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAC;KAC7D,CAAC;AACJ,CAAC"}
|
package/dist/deploy.d.ts
CHANGED
|
@@ -86,7 +86,7 @@ export interface SeriesCodeInitParams extends SeriesInitParams {
|
|
|
86
86
|
* of {@link SeriesTokenFieldInput} (identical shape; ABX's `OnChainMetadata.TokenFieldInput` has
|
|
87
87
|
* no standard-specific fields). Reused directly rather than duplicated. */
|
|
88
88
|
export type EditionTokenFieldInput = SeriesTokenFieldInput;
|
|
89
|
-
/** Mirrors `OneOfOneEdition.InitParams` — copies of a single
|
|
89
|
+
/** Mirrors `OneOfOneEdition.InitParams` — copies of a single work, id space fixed to `{0}`. */
|
|
90
90
|
export interface OneOfOneEditionInitParams {
|
|
91
91
|
owner: Address;
|
|
92
92
|
/** Recipient of the deploy-time mint (`0x0` or `mintAmount: 0` ⇒ defer all minting). */
|
|
@@ -120,7 +120,7 @@ export interface OneOfOneEditionInitParams {
|
|
|
120
120
|
tokenFields: OnChainFieldInput[];
|
|
121
121
|
contractFields: OnChainFieldInput[];
|
|
122
122
|
}
|
|
123
|
-
/** Mirrors `EditionImage.InitParams` — copies of many distinct
|
|
123
|
+
/** Mirrors `EditionImage.InitParams` — copies of many distinct works (N ids × copies each). */
|
|
124
124
|
export interface EditionImageInitParams {
|
|
125
125
|
owner: Address;
|
|
126
126
|
name: string;
|
|
@@ -132,7 +132,7 @@ export interface EditionImageInitParams {
|
|
|
132
132
|
royaltyReceiver: Address;
|
|
133
133
|
royaltyBps: number;
|
|
134
134
|
transferValidator: Address;
|
|
135
|
-
/** The id-space cap N (> 0): the number of distinct
|
|
135
|
+
/** The id-space cap N (> 0): the number of distinct works this project may ever have.
|
|
136
136
|
* Monotonically non-increasing (floor = the id high-water mark, NOT `totalSupply()` — ids are
|
|
137
137
|
* caller-named, not sequential). */
|
|
138
138
|
maxInvocations: bigint | number;
|
|
@@ -143,7 +143,7 @@ export interface EditionImageInitParams {
|
|
|
143
143
|
paused: boolean;
|
|
144
144
|
/** Recipient for the deploy-time mint (`0x0` ⇒ defer all minting). */
|
|
145
145
|
mintTo: Address;
|
|
146
|
-
/** Distinct
|
|
146
|
+
/** Distinct works to mint at deploy, ids `[0, mintCount)`; `<= maxInvocations`. */
|
|
147
147
|
mintCount: bigint | number;
|
|
148
148
|
/** Copies of EACH deploy-minted id (must be `> 0` if `mintCount > 0`). */
|
|
149
149
|
mintAmount: bigint | number;
|
|
@@ -189,6 +189,7 @@ export declare function saltGuard(salt: Hex): Address;
|
|
|
189
189
|
export declare function deployFactory(send: SendTx, publicClient: PublicClient): Promise<DeployResult<'factory'> & {
|
|
190
190
|
factory: Address;
|
|
191
191
|
implementation: Address;
|
|
192
|
+
metadataLib: Address;
|
|
192
193
|
}>;
|
|
193
194
|
/**
|
|
194
195
|
* Deploy the canonical Series clone factory — the trust anchor for multi-token drops.
|
|
@@ -198,20 +199,27 @@ export declare function deployFactory(send: SendTx, publicClient: PublicClient):
|
|
|
198
199
|
export declare function deploySeriesFactory(send: SendTx, publicClient: PublicClient): Promise<DeployResult<'seriesFactory'> & {
|
|
199
200
|
factory: Address;
|
|
200
201
|
implementation: Address;
|
|
202
|
+
metadataLib: Address;
|
|
201
203
|
}>;
|
|
202
204
|
/**
|
|
203
|
-
* Deploy the code-project trust root on a chain with no canonical set: the two
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
*
|
|
207
|
-
*
|
|
208
|
-
*
|
|
209
|
-
*
|
|
210
|
-
*
|
|
205
|
+
* Deploy the code-project trust root on a chain with no canonical set: the two delegatecalled
|
|
206
|
+
* write-path libraries first ({AbxParamsLib}, {AbxCodeLib}), the factory bytecode LINKED against
|
|
207
|
+
* them (solc placeholders replaced — what forge does at build time, done here so a sandbox/fresh
|
|
208
|
+
* chain needs no forge), then the factory (whose constructor deploys the {SeriesCode}
|
|
209
|
+
* implementation).
|
|
210
|
+
*
|
|
211
|
+
* All three go through the keyless CREATE2 proxy at canonical `AbxSalts` salts, so all three land at
|
|
212
|
+
* addresses that are the same on every chain and computable before the first transaction — the
|
|
213
|
+
* factory's included: linking substitutes an address into already-compiled bytecode, so once the
|
|
214
|
+
* libraries are predictable the linked initcode is fixed too (`predictSeriesCodeFactory()`). The
|
|
215
|
+
* ordering below is still sequential, but now for a plain data-dependency reason rather than a
|
|
216
|
+
* nonce one. See `create2.ts`'s write-path-library note for why the old "libraries are
|
|
217
|
+
* nonce-dependent" story was wrong, and for the compile-time-linking trap that IS real.
|
|
211
218
|
*/
|
|
212
219
|
export declare function deploySeriesCodeFactory(send: SendTx, publicClient: PublicClient): Promise<{
|
|
213
220
|
factory: Address;
|
|
214
221
|
implementation: Address;
|
|
222
|
+
metadataLib: Address;
|
|
215
223
|
paramsLib: Address;
|
|
216
224
|
codeLib: Address;
|
|
217
225
|
txHash: Hex;
|
|
@@ -286,18 +294,30 @@ export declare function deploySeries(send: SendTx, publicClient: PublicClient, a
|
|
|
286
294
|
* keyless CREATE2 proxy with the canonical `AbxSalts.ONE_OF_ONE_EDITION_FACTORY` salt — matching
|
|
287
295
|
* how `contracts/script/DeployOneOfOneEdition.s.sol` actually deploys it — so its address is the
|
|
288
296
|
* SAME on every chain and predictable before the deploy tx (`predictOneOfOneEditionFactory()`).
|
|
297
|
+
*
|
|
298
|
+
* Library-linked, like the two code factories: `OneOfOneEdition` delegates its uri /
|
|
299
|
+
* creator-token / edition-supply bodies into `AbxEditionLib`, so this deploys `AbxParamsLib` +
|
|
300
|
+
* `AbxEditionLib` first ({@link ensureEditionLibraries}) and sends the factory's initcode LINKED
|
|
301
|
+
* against the settled library address. Linking costs nothing in determinism — see `create2.ts`'s
|
|
302
|
+
* write-path-library note.
|
|
289
303
|
*/
|
|
290
304
|
export declare function deployOneOfOneEditionFactory(send: SendTx, publicClient: PublicClient): Promise<DeployResult<'factory'> & {
|
|
291
305
|
factory: Address;
|
|
292
306
|
implementation: Address;
|
|
307
|
+
metadataLib: Address;
|
|
308
|
+
paramsLib: Address;
|
|
309
|
+
editionLib: Address;
|
|
293
310
|
}>;
|
|
294
|
-
/** Deploy the canonical `EditionImageFactory` — the multi-
|
|
311
|
+
/** Deploy the canonical `EditionImageFactory` — the multi-work edition trust anchor. CREATE2
|
|
295
312
|
* via the keyless proxy + the canonical `AbxSalts.EDITION_FACTORY` salt (see {@link
|
|
296
313
|
* deployOneOfOneEditionFactory}'s doc note on why this differs from the 721 series factory's
|
|
297
|
-
* plain-creation bootstrap). */
|
|
314
|
+
* plain-creation bootstrap, and why `AbxEditionLib` has to land first). */
|
|
298
315
|
export declare function deployEditionFactory(send: SendTx, publicClient: PublicClient): Promise<DeployResult<'factory'> & {
|
|
299
316
|
factory: Address;
|
|
300
317
|
implementation: Address;
|
|
318
|
+
metadataLib: Address;
|
|
319
|
+
paramsLib: Address;
|
|
320
|
+
editionLib: Address;
|
|
301
321
|
}>;
|
|
302
322
|
/** Deploy `AbxFixedPriceMinter1155` — the canonical, ownerless, multi-tenant edition sale
|
|
303
323
|
* singleton (the Minter spine's edition lane). Sibling of `deployFixedPriceMinter`, one id
|
|
@@ -319,7 +339,7 @@ export declare function deployOneOfOneEdition(send: SendTx, publicClient: Public
|
|
|
319
339
|
clone: Address;
|
|
320
340
|
}>;
|
|
321
341
|
/**
|
|
322
|
-
* Deploy an EditionImage (multi-
|
|
342
|
+
* Deploy an EditionImage (multi-work edition) NFT as an immutable EIP-1167 clone, at a
|
|
323
343
|
* deterministic address. The edition twin of `deploySeries`.
|
|
324
344
|
*/
|
|
325
345
|
export declare function deployEditionImage(send: SendTx, publicClient: PublicClient, args: {
|
|
@@ -332,18 +352,24 @@ export declare function deployEditionImage(send: SendTx, publicClient: PublicCli
|
|
|
332
352
|
/**
|
|
333
353
|
* Deploy the code-project edition trust root on a chain with no canonical set: the THREE
|
|
334
354
|
* delegatecalled write-path libraries first ({AbxParamsLib}, {AbxCodeLib}, {AbxEditionLib} — the
|
|
335
|
-
* edition twin of `deploySeriesCodeFactory`'s two-lib dance,
|
|
336
|
-
*
|
|
337
|
-
* LINKED against all three
|
|
338
|
-
*
|
|
339
|
-
* {
|
|
340
|
-
*
|
|
341
|
-
*
|
|
342
|
-
*
|
|
355
|
+
* edition twin of `deploySeriesCodeFactory`'s two-lib dance, plus the 1155 write path {@link
|
|
356
|
+
* deployOneOfOneEditionFactory} and {@link deployEditionFactory} link too), the factory bytecode
|
|
357
|
+
* LINKED against all three, then the factory (whose constructor deploys the {EditionCode}
|
|
358
|
+
* implementation). CREATE2 at canonical `AbxSalts` salts throughout, exactly like
|
|
359
|
+
* {@link deploySeriesCodeFactory}, so the whole set is cross-chain-identical and predictable
|
|
360
|
+
* (`predictEditionCodeFactory()`). This is the only factory linking all three libraries; it is NOT
|
|
361
|
+
* the only one linking {AbxEditionLib} — all three 1155 token types delegate into it.
|
|
362
|
+
*
|
|
363
|
+
* One wrinkle the 721 twin doesn't have: {AbxEditionLib} delegatecalls {AbxParamsLib}, so its OWN
|
|
364
|
+
* shipped bytecode carries an unlinked placeholder and has to be linked before it can be deployed
|
|
365
|
+
* ({@link ensureEditionLib} does this via `linkEditionLib()`). Deploying it raw is what made this
|
|
366
|
+
* function fail with an opaque `Invalid byte sequence` — `__$…$__` is not hex, and the old
|
|
367
|
+
* unlinked-placeholder guard only checked the factory's bytecode, never the library's.
|
|
343
368
|
*/
|
|
344
369
|
export declare function deployEditionCodeFactory(send: SendTx, publicClient: PublicClient): Promise<{
|
|
345
370
|
factory: Address;
|
|
346
371
|
implementation: Address;
|
|
372
|
+
metadataLib: Address;
|
|
347
373
|
paramsLib: Address;
|
|
348
374
|
codeLib: Address;
|
|
349
375
|
editionLib: Address;
|
package/dist/deploy.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../src/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyC,KAAK,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,YAAY,
|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