@artblocks/abx-sdk 0.1.0-alpha.13 → 0.1.0-alpha.15
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 +2 -0
- package/dist/reconstruct.d.ts.map +1 -1
- package/dist/reconstruct.js +39 -2
- 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 +29 -1
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js +21 -1
- package/dist/tokens.js.map +1 -1
- package/dist/types.d.ts +34 -5
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/abi/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/abi/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,uBAAuB,EACvB,4BAA4B,EAC5B,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EACrB,0BAA0B,EAC1B,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,yBAAyB,EACzB,aAAa,EACb,kBAAkB,EAElB,yBAAyB,EACzB,8BAA8B,EAC9B,kBAAkB,EAClB,uBAAuB,EACvB,sBAAsB,EACtB,2BAA2B,EAC3B,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,0BAA0B,EAC1B,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,EACrB,0BAA0B,EAC1B,+BAA+B,EAC/B,gBAAgB,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA2BtB,CAAC"}
|
package/dist/abi/index.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// package (Layer 1) via `pnpm sync-abis`; never hand-edit `generated.ts`.
|
|
3
3
|
export { oneOfOneImageFactoryAbi, oneOfOneImageFactoryBytecode, oneOfOneImageAbi, oneOfOneImageBytecode, seriesImageFactoryAbi, seriesImageFactoryBytecode, seriesImageAbi, seriesImageBytecode, seriesCodeFactoryAbi, seriesCodeFactoryBytecode, seriesCodeAbi, seriesCodeBytecode,
|
|
4
4
|
// ERC-1155 editions — the twin token+factory set (see contracts/src/tokens/Edition*.sol).
|
|
5
|
-
oneOfOneEditionFactoryAbi, oneOfOneEditionFactoryBytecode, oneOfOneEditionAbi, oneOfOneEditionBytecode, editionImageFactoryAbi, editionImageFactoryBytecode, editionImageAbi, editionImageBytecode, editionCodeFactoryAbi, editionCodeFactoryBytecode, editionCodeAbi, editionCodeBytecode, abxEditionLibAbi, abxEditionLibBytecode, abxFixedPriceMinter1155Abi, abxFixedPriceMinter1155Bytecode, abxSeedSourceAbi, abxSeedSourceBytecode, abxParamsLibAbi, abxParamsLibBytecode, abxCodeLibAbi, abxCodeLibBytecode, abxMetadataRendererAbi, abxMetadataRendererBytecode, abxChunkStoreAbi, abxChunkStoreBytecode, abxFixedPriceMinterAbi, abxFixedPriceMinterBytecode, } from './generated.js';
|
|
6
|
-
import { oneOfOneImageAbi, oneOfOneImageFactoryAbi, seriesImageAbi, seriesImageFactoryAbi, seriesCodeAbi, seriesCodeFactoryAbi, oneOfOneEditionAbi, oneOfOneEditionFactoryAbi, editionImageAbi, editionImageFactoryAbi, editionCodeAbi, editionCodeFactoryAbi, abxFixedPriceMinterAbi, abxFixedPriceMinter1155Abi, } from './generated.js';
|
|
5
|
+
oneOfOneEditionFactoryAbi, oneOfOneEditionFactoryBytecode, oneOfOneEditionAbi, oneOfOneEditionBytecode, editionImageFactoryAbi, editionImageFactoryBytecode, editionImageAbi, editionImageBytecode, editionCodeFactoryAbi, editionCodeFactoryBytecode, editionCodeAbi, editionCodeBytecode, abxEditionLibAbi, abxEditionLibBytecode, abxMetadataLibAbi, abxMetadataLibBytecode, abxFixedPriceMinter1155Abi, abxFixedPriceMinter1155Bytecode, abxSeedSourceAbi, abxSeedSourceBytecode, abxParamsLibAbi, abxParamsLibBytecode, abxCodeLibAbi, abxCodeLibBytecode, abxMetadataRendererAbi, abxMetadataRendererBytecode, abxChunkStoreAbi, abxChunkStoreBytecode, abxFixedPriceMinterAbi, abxFixedPriceMinterBytecode, } from './generated.js';
|
|
6
|
+
import { oneOfOneImageAbi, oneOfOneImageFactoryAbi, seriesImageAbi, seriesImageFactoryAbi, seriesCodeAbi, seriesCodeFactoryAbi, oneOfOneEditionAbi, oneOfOneEditionFactoryAbi, editionImageAbi, editionImageFactoryAbi, editionCodeAbi, editionCodeFactoryAbi, abxFixedPriceMinterAbi, abxFixedPriceMinter1155Abi, abxParamsLibAbi, } from './generated.js';
|
|
7
7
|
/** A stable signature key for an ABI event fragment (name + input types), for de-duping. */
|
|
8
8
|
function eventKey(f) {
|
|
9
9
|
return `${f.name ?? ''}(${(f.inputs ?? []).map((i) => i.type).join(',')})`;
|
|
@@ -19,11 +19,19 @@ function eventKey(f) {
|
|
|
19
19
|
* types, so same-named-but-different-shaped events (the 721 vs. 1155 minters' `SaleConfigured`/
|
|
20
20
|
* `Purchase`, which differ by an `id`/`amount`) survive as distinct fragments — `parseEventLogs`
|
|
21
21
|
* disambiguates them by topic0 (the full canonical signature hash) at decode time, same as it
|
|
22
|
-
* already does for every other event here. `AbxEditionLib` (
|
|
23
|
-
*
|
|
24
|
-
* `editionCodeAbi` already
|
|
25
|
-
* including it would only add pure
|
|
26
|
-
* excluded
|
|
22
|
+
* already does for every other event here. `AbxEditionLib` (the EIP-170 relief-valve library all
|
|
23
|
+
* three 1155 token types delegatecall) is deliberately excluded — its event mirrors are
|
|
24
|
+
* byte-identical to the ones `oneOfOneEditionAbi`/`editionImageAbi`/`editionCodeAbi` already carry
|
|
25
|
+
* via inheritance (Uri1155/CreatorToken1155/EditionSupply), so including it would only add pure
|
|
26
|
+
* duplicates (`abxCodeLibAbi` is excluded for the same reason).
|
|
27
|
+
*
|
|
28
|
+
* **`abxParamsLibAbi` is unioned in**, unlike the other two libraries, because one of its events is
|
|
29
|
+
* NOT a duplicate: `ParamHooksFrozen()` is declared only there — the token's `IAbxConfigurableParams`
|
|
30
|
+
* interface declares `HooksConfigured` but not the freeze — so without this the one-way lock on the
|
|
31
|
+
* param hooks would be invisible to every consumer that folds the spine, while the hook it freezes
|
|
32
|
+
* can veto a transfer. `eventKey`'s dedup makes the rest of the library's mirrors free, so this
|
|
33
|
+
* costs nothing beyond the fragment that was missing. (The durable fix is for the interface to
|
|
34
|
+
* declare the event; unioning here keeps reconstruction honest either way.)
|
|
27
35
|
*/
|
|
28
36
|
export const spineEventAbi = (() => {
|
|
29
37
|
const all = [
|
|
@@ -41,6 +49,7 @@ export const spineEventAbi = (() => {
|
|
|
41
49
|
...editionImageFactoryAbi,
|
|
42
50
|
...editionCodeFactoryAbi,
|
|
43
51
|
...abxFixedPriceMinter1155Abi,
|
|
52
|
+
...abxParamsLibAbi, // for ParamHooksFrozen — see the note above; the rest dedup away
|
|
44
53
|
].filter((f) => f.type === 'event');
|
|
45
54
|
const seen = new Set();
|
|
46
55
|
const out = [];
|
package/dist/abi/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/abi/index.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,0EAA0E;AAC1E,OAAO,EACL,uBAAuB,EACvB,4BAA4B,EAC5B,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EACrB,0BAA0B,EAC1B,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,yBAAyB,EACzB,aAAa,EACb,kBAAkB;AAClB,0FAA0F;AAC1F,yBAAyB,EACzB,8BAA8B,EAC9B,kBAAkB,EAClB,uBAAuB,EACvB,sBAAsB,EACtB,2BAA2B,EAC3B,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,0BAA0B,EAC1B,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,EACrB,0BAA0B,EAC1B,+BAA+B,EAC/B,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,oBAAoB,EACpB,aAAa,EACb,kBAAkB,EAClB,sBAAsB,EACtB,2BAA2B,EAC3B,gBAAgB,EAChB,qBAAqB,EACrB,sBAAsB,EACtB,2BAA2B,GAC5B,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,cAAc,EACd,qBAAqB,EACrB,aAAa,EACb,oBAAoB,EACpB,kBAAkB,EAClB,yBAAyB,EACzB,eAAe,EACf,sBAAsB,EACtB,cAAc,EACd,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/abi/index.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,0EAA0E;AAC1E,OAAO,EACL,uBAAuB,EACvB,4BAA4B,EAC5B,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EACrB,0BAA0B,EAC1B,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,yBAAyB,EACzB,aAAa,EACb,kBAAkB;AAClB,0FAA0F;AAC1F,yBAAyB,EACzB,8BAA8B,EAC9B,kBAAkB,EAClB,uBAAuB,EACvB,sBAAsB,EACtB,2BAA2B,EAC3B,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,0BAA0B,EAC1B,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,EACrB,iBAAiB,EACjB,sBAAsB,EACtB,0BAA0B,EAC1B,+BAA+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C;IACpD,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,MAAM,GAAG,GAAe,EAAE,CAAC;IAC3B,KAAK,MAAM,CAAC,IAAI,GAAG,EAAE,CAAC;QACpB,MAAM,GAAG,GAAG,QAAQ,CAAC,CAAU,CAAC,CAAC;QACjC,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,SAAS;QAC5B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACd,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACd,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC,CAAC,EAAE,CAAC"}
|
package/dist/anchors.d.ts
CHANGED
|
@@ -2,8 +2,9 @@ import type { Address, Hex, PublicClient } from 'viem';
|
|
|
2
2
|
import { type AnchorKind } from './errors.js';
|
|
3
3
|
import type { SendTx } from './execute.js';
|
|
4
4
|
/**
|
|
5
|
-
* Bootstrap-or-refuse resolution for ABX's
|
|
6
|
-
* factories (1/1, Series, SeriesCode
|
|
5
|
+
* Bootstrap-or-refuse resolution for ABX's six trust anchors + singletons — the six clone
|
|
6
|
+
* factories (1/1, Series, SeriesCode and their three ERC-1155 edition twins) and the shared,
|
|
7
|
+
* stateless renderer + seed source — plus the
|
|
7
8
|
* read-only protocol questions that come with owning a deployed clone (which canonical factory made
|
|
8
9
|
* it; its earliest plausible deploy block).
|
|
9
10
|
*
|
|
@@ -18,15 +19,20 @@ import type { SendTx } from './execute.js';
|
|
|
18
19
|
/** Progress from an `ensure*` trust-anchor resolution, so a caller can narrate without the SDK
|
|
19
20
|
* printing anything itself (mirrors {@link ChunkStoreEvent}'s vocabulary). Not every anchor emits
|
|
20
21
|
* every kind: `canonical` (found at the CREATE2-deterministic address) applies to the renderer,
|
|
21
|
-
* the seed source,
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
22
|
+
* the seed source, the two edition factories
|
|
23
|
+
* (`one-of-one-edition-factory`/`edition-factory`), the two 721 factories
|
|
24
|
+
* (`factory`/`series-factory`) and the two code factories
|
|
25
|
+
* (`series-code-factory`/`edition-code-factory`) — all FOUR of the edition/code factories link
|
|
26
|
+
* write-path libraries, which are themselves CREATE2-deployed at canonical salts, so the linked
|
|
27
|
+
* factory has a deterministic address like everything else (see `create2.ts`'s write-path-library
|
|
28
|
+
* note). Every anchor the SDK deploys now goes through the keyless proxy at a canonical salt, so
|
|
29
|
+
* every one of them can self-heal to its predicted address. The optional
|
|
26
30
|
* `deployed` fields are anchor-specific: `implementation` for every factory, `specVersion` for
|
|
27
|
-
* the renderer,
|
|
28
|
-
*
|
|
29
|
-
*
|
|
31
|
+
* the renderer, and the linked write-path libraries each factory actually needs —
|
|
32
|
+
* `metadataLib` for ALL SIX (the metadata field store is externalized), plus
|
|
33
|
+
* `paramsLib`/`codeLib` for `SeriesCodeFactory`, all of them for `EditionCodeFactory`, and
|
|
34
|
+
* `paramsLib`/`editionLib` for the two 1155 image factories (`AbxEditionLib` is delegatecalled by
|
|
35
|
+
* ALL THREE edition token types, and it links `AbxParamsLib` itself). */
|
|
30
36
|
export type AnchorEvent = {
|
|
31
37
|
anchor: AnchorKind;
|
|
32
38
|
} & ({
|
|
@@ -48,6 +54,7 @@ export type AnchorEvent = {
|
|
|
48
54
|
txHash: Hex;
|
|
49
55
|
implementation?: Address;
|
|
50
56
|
specVersion?: bigint;
|
|
57
|
+
metadataLib?: Address;
|
|
51
58
|
paramsLib?: Address;
|
|
52
59
|
codeLib?: Address;
|
|
53
60
|
editionLib?: Address;
|
|
@@ -57,6 +64,10 @@ export type AnchorEvent = {
|
|
|
57
64
|
* read) — so an older factory whose impl predates it is detected and a fresh, source-current
|
|
58
65
|
* (and thus Etherscan-verifiable) one deployed. A stale impl reverts the probe. (Bump this to
|
|
59
66
|
* the newest capability with each impl change.) */
|
|
67
|
+
/** `AbxVersion.CORE_VERSION` in `contracts/src/libraries/AbxVersion.sol`. MUST move in lockstep with
|
|
68
|
+
* it — the Solidity constant's own NatSpec says so, and `test/anchor-version.test.ts` pins the two
|
|
69
|
+
* together so a bump on one side cannot ship alone. */
|
|
70
|
+
export declare const ABX_CORE_VERSION = 2n;
|
|
60
71
|
export declare function isCurrentFactory(publicClient: PublicClient, factory: Address): Promise<boolean>;
|
|
61
72
|
/**
|
|
62
73
|
* Get (or deploy) the chain's canonical 1/1 clone factory — the trust anchor: a factory is THE
|
|
@@ -82,13 +93,37 @@ export declare function ensureSeriesFactory(publicClient: PublicClient, send: Se
|
|
|
82
93
|
allowBootstrap?: boolean;
|
|
83
94
|
onEvent?: (e: AnchorEvent) => void;
|
|
84
95
|
}): Promise<Address>;
|
|
85
|
-
/** Is the configured renderer the spec version this build expects (
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
96
|
+
/** Is the configured renderer the spec version this build expects (**v10**)? A behind-spec renderer
|
|
97
|
+
* is treated as stale so {@link ensureRenderer} deploys a fresh one (greenfield redeploy-freely:
|
|
98
|
+
* this number is what tells the CLI a deployed renderer predates behavior the current build emits).
|
|
99
|
+
* Bump in lockstep with `AbxMetadataRenderer.SPEC_VERSION`.
|
|
100
|
+
*
|
|
101
|
+
* **This is a security floor, not just a feature floor**, which is why it has moved twice for
|
|
102
|
+
* reasons unrelated to the params projection:
|
|
103
|
+
* - v4 → v5: v4 left the `abx_provenance` `note` unescaped, and that note carries owner-chosen
|
|
104
|
+
* bytes — enough to flip `onChain` to true, shadow the real `image`, or make `tokenURI`
|
|
105
|
+
* unparseable. A v4 renderer does not merely lag a projection; it will lie about provenance.
|
|
106
|
+
* - v5 → v6: the 2026-08 audit removed two on-chain checks in favour of stated trust assumptions
|
|
107
|
+
* and closed an empty-render case that produced an unparseable document. Rendered output differs,
|
|
108
|
+
* so the version has to.
|
|
109
|
+
* - v6 → v7: the `artist` collection field became `creator`.
|
|
110
|
+
* - v7 → v8: an independent audit found a computed `image` locator was being data-wrapped, so it
|
|
111
|
+
* was not dereferenceable at all; `abx_provenance` lost `onChain` and `verifiedAgainstChain`
|
|
112
|
+
* (the first was wrong in both directions, the second always null); and `abx_params` left
|
|
113
|
+
* `tokenURI` entirely — params enumerate from the contract, which is canonical, and nothing read
|
|
114
|
+
* the projection back.
|
|
115
|
+
* - v8 → v9: a computed `image` was emitted twice — once as `image`, once again inside `artifacts`
|
|
116
|
+
* — nearly doubling the inner payload of the on-chain-SVG lane's `tokenURI`. The data-plane spec
|
|
117
|
+
* always allowed an on-chain renderer to omit reserved-key duplicates; v9 takes it, so
|
|
118
|
+
* `artifacts` no longer appears on the on-chain lanes at all. Rendered output differs, so the
|
|
119
|
+
* version has to.
|
|
120
|
+
* - v9 → v10: four reserved keys the spec had always listed were projected by neither plane on
|
|
121
|
+
* chain — `background_color`, `youtube_url`, `banner_image`, `featured_image`. A documented
|
|
122
|
+
* reserved key that nothing emits is a protocol hole, so the renderer now emits all four when
|
|
123
|
+
* their representation is chain-reachable. A v9 renderer silently drops them.
|
|
124
|
+
*
|
|
125
|
+
* Read `specVersion()` rather than probing for a feature: a capability probe answers yes for every
|
|
126
|
+
* build that has the feature, which is exactly how a stale factory once reported as current. */
|
|
92
127
|
export declare function isCurrentRenderer(publicClient: PublicClient, renderer: Address): Promise<boolean>;
|
|
93
128
|
/** Get (or deploy) the chain's shared `AbxMetadataRenderer` — the on-chain metadata
|
|
94
129
|
* renderer that fully-on-chain tokens point at. Stateless + shared, so one deployment
|
|
@@ -98,12 +133,12 @@ export declare function ensureRenderer(publicClient: PublicClient, send: SendTx,
|
|
|
98
133
|
override?: string;
|
|
99
134
|
onEvent?: (e: AnchorEvent) => void;
|
|
100
135
|
}): Promise<Address>;
|
|
101
|
-
/** The code-project trust anchor: use the canonical factory, else
|
|
102
|
-
* fresh chain — libraries linked in-flight; see {@link
|
|
103
|
-
* 1/1 and Series factories there is no version probe (no
|
|
104
|
-
* configured factory with code is always accepted)
|
|
105
|
-
*
|
|
106
|
-
* is
|
|
136
|
+
/** The code-project trust anchor: use the canonical factory, else the CREATE2-deterministic address,
|
|
137
|
+
* else deploy one (a sandbox / fresh chain — libraries linked in-flight; see {@link
|
|
138
|
+
* deploySeriesCodeFactory}). Unlike the 1/1 and Series factories there is no version probe (no
|
|
139
|
+
* `isCurrentSeriesCodeFactory` — a configured factory with code is always accepted); it needs none
|
|
140
|
+
* at the deterministic address, because a CREATE2 address is bytecode-bound — code sitting at
|
|
141
|
+
* `predictSeriesCodeFactory()` is necessarily THIS build, linked against these libraries. */
|
|
107
142
|
export declare function ensureSeriesCodeFactory(publicClient: PublicClient, send: SendTx, opts: {
|
|
108
143
|
chainId: number;
|
|
109
144
|
override?: string;
|
|
@@ -118,10 +153,12 @@ export declare function ensureSeriesCodeFactory(publicClient: PublicClient, send
|
|
|
118
153
|
export declare function isCurrentOneOfOneEditionFactory(publicClient: PublicClient, factory: Address): Promise<boolean>;
|
|
119
154
|
/**
|
|
120
155
|
* Get (or deploy) the chain's canonical 1/1-edition clone factory — the trust anchor for a
|
|
121
|
-
* priced open/limited edition of a single
|
|
156
|
+
* priced open/limited edition of a single work. The edition twin of {@link ensureFactory},
|
|
122
157
|
* but — because `OneOfOneEditionFactory` is CREATE2-deterministic (see `create2.ts`'s
|
|
123
158
|
* class-level dev note), unlike the 721 1/1 factory's own bootstrap path — this one ALSO
|
|
124
|
-
* self-heals to the predicted address, mirroring {@link ensureRenderer}'s style.
|
|
159
|
+
* self-heals to the predicted address, mirroring {@link ensureRenderer}'s style. The bootstrap
|
|
160
|
+
* leg deploys `AbxParamsLib` + `AbxEditionLib` first (reusing whatever is already on-chain) and
|
|
161
|
+
* links the factory against them — see {@link deployOneOfOneEditionFactory}.
|
|
125
162
|
*/
|
|
126
163
|
export declare function ensureOneOfOneEditionFactory(publicClient: PublicClient, send: SendTx, opts: {
|
|
127
164
|
chainId: number;
|
|
@@ -134,20 +171,21 @@ export declare function ensureOneOfOneEditionFactory(publicClient: PublicClient,
|
|
|
134
171
|
* cap isn't a distinguishing probe here since it's shared, unchanged, with the 721 Series
|
|
135
172
|
* factory (see `reconstruct.ts`'s `contractType` fold for that same reasoning). */
|
|
136
173
|
export declare function isCurrentEditionFactory(publicClient: PublicClient, factory: Address): Promise<boolean>;
|
|
137
|
-
/** Get (or deploy) the chain's `EditionImageFactory` — the multi-
|
|
174
|
+
/** Get (or deploy) the chain's `EditionImageFactory` — the multi-work edition trust anchor,
|
|
138
175
|
* the sibling of {@link ensureSeriesFactory}. CREATE2-deterministic, so it self-heals to its
|
|
139
|
-
* predicted address exactly like {@link ensureOneOfOneEditionFactory}
|
|
176
|
+
* predicted address exactly like {@link ensureOneOfOneEditionFactory} — and, like it, links
|
|
177
|
+
* `AbxEditionLib` (+ that library's own `AbxParamsLib`) on the bootstrap leg. */
|
|
140
178
|
export declare function ensureEditionFactory(publicClient: PublicClient, send: SendTx, opts: {
|
|
141
179
|
chainId: number;
|
|
142
180
|
override?: string;
|
|
143
181
|
allowBootstrap?: boolean;
|
|
144
182
|
onEvent?: (e: AnchorEvent) => void;
|
|
145
183
|
}): Promise<Address>;
|
|
146
|
-
/** The code-project EDITION trust anchor: use the canonical factory, else
|
|
147
|
-
* fresh chain — three libraries linked in-flight; see {@link
|
|
148
|
-
* {@link ensureSeriesCodeFactory}'s stance, extended to a third
|
|
149
|
-
* configured factory with code is always accepted) and
|
|
150
|
-
*
|
|
184
|
+
/** The code-project EDITION trust anchor: use the canonical factory, else the CREATE2-deterministic
|
|
185
|
+
* address, else deploy one (a sandbox / fresh chain — three libraries linked in-flight; see {@link
|
|
186
|
+
* deployEditionCodeFactory}). Exactly {@link ensureSeriesCodeFactory}'s stance, extended to a third
|
|
187
|
+
* library: no version probe (a configured factory with code is always accepted), and the same
|
|
188
|
+
* bytecode-bound self-heal at `predictEditionCodeFactory()`. */
|
|
151
189
|
export declare function ensureEditionCodeFactory(publicClient: PublicClient, send: SendTx, opts: {
|
|
152
190
|
chainId: number;
|
|
153
191
|
override?: string;
|
package/dist/anchors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anchors.d.ts","sourceRoot":"","sources":["../src/anchors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,OAAO,EAAE,GAAG,EAAE,YAAY,EAAC,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"anchors.d.ts","sourceRoot":"","sources":["../src/anchors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,OAAO,EAAE,GAAG,EAAE,YAAY,EAAC,MAAM,MAAM,CAAC;AA2CrD,OAAO,EAAyB,KAAK,UAAU,EAAC,MAAM,aAAa,CAAC;AACpE,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AAEzC;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;;;;;;;;;;0EAgB0E;AAC1E,MAAM,MAAM,WAAW,GAAG;IAAC,MAAM,EAAE,UAAU,CAAA;CAAC,GAAG,CAC7C;IAAC,IAAI,EAAE,UAAU,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAC,GACpC;IAAC,IAAI,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,SAAS,GAAG,eAAe,CAAA;CAAC,GACtE;IAAC,IAAI,EAAE,WAAW,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAC,GACrC;IAAC,IAAI,EAAE,WAAW,CAAA;CAAC,GACnB;IACE,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,GAAG,CAAC;IACZ,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EA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C,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,OAAO,EAChB,IAAI,GAAE;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,IAAI,CAAA;CAAM,GAC7F,OAAO,CAAC,MAAM,CAAC,CAiBjB"}
|
package/dist/anchors.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { oneOfOneImageAbi, oneOfOneImageFactoryAbi, seriesImageAbi, seriesImageFactoryAbi, abxMetadataRendererAbi, oneOfOneEditionAbi, oneOfOneEditionFactoryAbi, editionImageAbi, editionImageFactoryAbi, } from './abi/index.js';
|
|
2
2
|
import { resolveFactory, resolveSeriesFactory, resolveRenderer, resolveSeriesCodeFactory, resolveSeedSource, resolveOneOfOneEditionFactory, resolveEditionFactory, resolveEditionCodeFactory, } from './deployments.js';
|
|
3
|
-
import { predictRenderer, predictSeedSource, predictOneOfOneEditionFactory, predictEditionFactory } from './create2.js';
|
|
3
|
+
import { predictRenderer, predictSeedSource, predictFactory, predictSeriesFactory, predictOneOfOneEditionFactory, predictEditionFactory, predictSeriesCodeFactory, predictEditionCodeFactory, } from './create2.js';
|
|
4
4
|
import { deployFactory, deploySeriesFactory, deployRenderer, deploySeriesCodeFactory, deploySeedSource, deployOneOfOneEditionFactory, deployEditionFactory, deployEditionCodeFactory, } from './deploy.js';
|
|
5
5
|
import { discoverDeployBlock } from './reconstruct.js';
|
|
6
6
|
import { AnchorUnavailableError } from './errors.js';
|
|
@@ -10,6 +10,32 @@ import { AnchorUnavailableError } from './errors.js';
|
|
|
10
10
|
* read) — so an older factory whose impl predates it is detected and a fresh, source-current
|
|
11
11
|
* (and thus Etherscan-verifiable) one deployed. A stale impl reverts the probe. (Bump this to
|
|
12
12
|
* the newest capability with each impl change.) */
|
|
13
|
+
/** `AbxVersion.CORE_VERSION` in `contracts/src/libraries/AbxVersion.sol`. MUST move in lockstep with
|
|
14
|
+
* it — the Solidity constant's own NatSpec says so, and `test/anchor-version.test.ts` pins the two
|
|
15
|
+
* together so a bump on one side cannot ship alone. */
|
|
16
|
+
export const ABX_CORE_VERSION = 2n;
|
|
17
|
+
/** Is this implementation built from the current core?
|
|
18
|
+
*
|
|
19
|
+
* A VERSION gate, deliberately, replacing the capability probes that used to stand in for one.
|
|
20
|
+
* Those asked "does the implementation expose feature X" — a question every pre-remediation build
|
|
21
|
+
* also answers yes to — and carried a comment instructing the next author to hand-bump the probed
|
|
22
|
+
* capability on every implementation change. That convention failed exactly as you would expect: an
|
|
23
|
+
* operator holding a factory from before the 2026-08 security remediation would have it reported as
|
|
24
|
+
* `resolved` and keep stamping clones on a vulnerable implementation. `abxVersion()` has been on
|
|
25
|
+
* every token the whole time; nothing read it. */
|
|
26
|
+
async function implCoreVersionIsCurrent(publicClient, impl) {
|
|
27
|
+
try {
|
|
28
|
+
const v = (await publicClient.readContract({
|
|
29
|
+
address: impl,
|
|
30
|
+
abi: oneOfOneImageAbi, // `abxVersion()` is on AbxBeaconCore — identical on all six token types
|
|
31
|
+
functionName: 'abxVersion',
|
|
32
|
+
}));
|
|
33
|
+
return BigInt(v) === ABX_CORE_VERSION;
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
return false; // no `abxVersion()` at all ⇒ far older than the current core
|
|
37
|
+
}
|
|
38
|
+
}
|
|
13
39
|
export async function isCurrentFactory(publicClient, factory) {
|
|
14
40
|
try {
|
|
15
41
|
const impl = (await publicClient.readContract({
|
|
@@ -17,6 +43,10 @@ export async function isCurrentFactory(publicClient, factory) {
|
|
|
17
43
|
abi: oneOfOneImageFactoryAbi,
|
|
18
44
|
functionName: 'implementation',
|
|
19
45
|
}));
|
|
46
|
+
// The core-version gate runs FIRST: it is the question that actually distinguishes builds. The
|
|
47
|
+
// capability probe below stays as a cheap sanity check on the implementation's shape.
|
|
48
|
+
if (!(await implCoreVersionIsCurrent(publicClient, impl)))
|
|
49
|
+
return false;
|
|
20
50
|
// `totalSupply()` is a view → readContract; it reverts on an impl that predates it.
|
|
21
51
|
await publicClient.readContract({ address: impl, abi: oneOfOneImageAbi, functionName: 'totalSupply' });
|
|
22
52
|
return true;
|
|
@@ -55,11 +85,22 @@ export async function ensureFactory(publicClient, send, opts) {
|
|
|
55
85
|
notify({ anchor: 'factory', kind: 'stale', address: known, reason: 'no-code' });
|
|
56
86
|
}
|
|
57
87
|
}
|
|
88
|
+
// A CREATE2 address is bytecode-bound to the build that predicted it, so this build's OneOfOneImageFactory
|
|
89
|
+
// sitting at its canonical address is already the right anchor — reuse it instead of deploying a
|
|
90
|
+
// duplicate. This is what makes a chain missing from the manifest a non-event.
|
|
91
|
+
const predicted = predictFactory();
|
|
92
|
+
if (!known || known.toLowerCase() !== predicted.toLowerCase()) {
|
|
93
|
+
const pcode = await publicClient.getCode({ address: predicted });
|
|
94
|
+
if (pcode && pcode !== '0x' && (await isCurrentFactory(publicClient, predicted))) {
|
|
95
|
+
notify({ anchor: 'factory', kind: 'canonical', address: predicted });
|
|
96
|
+
return predicted;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
58
99
|
if (!known && !opts.allowBootstrap)
|
|
59
100
|
throw new AnchorUnavailableError('factory', 'not-configured');
|
|
60
101
|
notify({ anchor: 'factory', kind: 'deploying' });
|
|
61
|
-
const { factory, implementation, txHash } = await deployFactory(send, publicClient);
|
|
62
|
-
notify({ anchor: 'factory', kind: 'deployed', address: factory, implementation, txHash, inManifest: false });
|
|
102
|
+
const { factory, implementation, metadataLib, txHash } = await deployFactory(send, publicClient);
|
|
103
|
+
notify({ anchor: 'factory', kind: 'deployed', address: factory, implementation, metadataLib, txHash, inManifest: false });
|
|
63
104
|
return factory;
|
|
64
105
|
}
|
|
65
106
|
// ── the canonical Series trust anchor ─────────────────────────────────────────
|
|
@@ -72,6 +113,10 @@ export async function isCurrentSeriesFactory(publicClient, factory) {
|
|
|
72
113
|
abi: seriesImageFactoryAbi,
|
|
73
114
|
functionName: 'implementation',
|
|
74
115
|
}));
|
|
116
|
+
// The core-version gate runs FIRST: it is the question that actually distinguishes builds. The
|
|
117
|
+
// capability probe below stays as a cheap sanity check on the implementation's shape.
|
|
118
|
+
if (!(await implCoreVersionIsCurrent(publicClient, impl)))
|
|
119
|
+
return false;
|
|
75
120
|
// Probe the NEWEST capability the current implementation exposes — ERC-165 support for the
|
|
76
121
|
// IAbxSequentialMint primitive (mint(address) → uint256, the fixed-price-minter target).
|
|
77
122
|
// A pre-minter-spine impl (mint returns void, id not advertised) returns false → a fresh,
|
|
@@ -102,21 +147,56 @@ export async function ensureSeriesFactory(publicClient, send, opts) {
|
|
|
102
147
|
throw new AnchorUnavailableError('series-factory', 'stale-version', known);
|
|
103
148
|
notify({ anchor: 'series-factory', kind: 'stale', address: known, reason: 'stale-version' });
|
|
104
149
|
}
|
|
150
|
+
// A CREATE2 address is bytecode-bound to the build that predicted it, so this build's SeriesImageFactory
|
|
151
|
+
// sitting at its canonical address is already the right anchor — reuse it instead of deploying a
|
|
152
|
+
// duplicate. This is what makes a chain missing from the manifest a non-event.
|
|
153
|
+
const predicted = predictSeriesFactory();
|
|
154
|
+
if (!known || known.toLowerCase() !== predicted.toLowerCase()) {
|
|
155
|
+
const pcode = await publicClient.getCode({ address: predicted });
|
|
156
|
+
if (pcode && pcode !== '0x' && (await isCurrentSeriesFactory(publicClient, predicted))) {
|
|
157
|
+
notify({ anchor: 'series-factory', kind: 'canonical', address: predicted });
|
|
158
|
+
return predicted;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
105
161
|
if (!known && !opts.allowBootstrap)
|
|
106
162
|
throw new AnchorUnavailableError('series-factory', 'not-configured');
|
|
107
163
|
notify({ anchor: 'series-factory', kind: 'deploying' });
|
|
108
|
-
const { factory, implementation, txHash } = await deploySeriesFactory(send, publicClient);
|
|
109
|
-
notify({ anchor: 'series-factory', kind: 'deployed', address: factory, implementation, txHash, inManifest: false });
|
|
164
|
+
const { factory, implementation, metadataLib, txHash } = await deploySeriesFactory(send, publicClient);
|
|
165
|
+
notify({ anchor: 'series-factory', kind: 'deployed', address: factory, implementation, metadataLib, txHash, inManifest: false });
|
|
110
166
|
return factory;
|
|
111
167
|
}
|
|
112
168
|
// ── the canonical on-chain renderer ────────────────────────────────────────────
|
|
113
|
-
/** Is the configured renderer the spec version this build expects (
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
169
|
+
/** Is the configured renderer the spec version this build expects (**v10**)? A behind-spec renderer
|
|
170
|
+
* is treated as stale so {@link ensureRenderer} deploys a fresh one (greenfield redeploy-freely:
|
|
171
|
+
* this number is what tells the CLI a deployed renderer predates behavior the current build emits).
|
|
172
|
+
* Bump in lockstep with `AbxMetadataRenderer.SPEC_VERSION`.
|
|
173
|
+
*
|
|
174
|
+
* **This is a security floor, not just a feature floor**, which is why it has moved twice for
|
|
175
|
+
* reasons unrelated to the params projection:
|
|
176
|
+
* - v4 → v5: v4 left the `abx_provenance` `note` unescaped, and that note carries owner-chosen
|
|
177
|
+
* bytes — enough to flip `onChain` to true, shadow the real `image`, or make `tokenURI`
|
|
178
|
+
* unparseable. A v4 renderer does not merely lag a projection; it will lie about provenance.
|
|
179
|
+
* - v5 → v6: the 2026-08 audit removed two on-chain checks in favour of stated trust assumptions
|
|
180
|
+
* and closed an empty-render case that produced an unparseable document. Rendered output differs,
|
|
181
|
+
* so the version has to.
|
|
182
|
+
* - v6 → v7: the `artist` collection field became `creator`.
|
|
183
|
+
* - v7 → v8: an independent audit found a computed `image` locator was being data-wrapped, so it
|
|
184
|
+
* was not dereferenceable at all; `abx_provenance` lost `onChain` and `verifiedAgainstChain`
|
|
185
|
+
* (the first was wrong in both directions, the second always null); and `abx_params` left
|
|
186
|
+
* `tokenURI` entirely — params enumerate from the contract, which is canonical, and nothing read
|
|
187
|
+
* the projection back.
|
|
188
|
+
* - v8 → v9: a computed `image` was emitted twice — once as `image`, once again inside `artifacts`
|
|
189
|
+
* — nearly doubling the inner payload of the on-chain-SVG lane's `tokenURI`. The data-plane spec
|
|
190
|
+
* always allowed an on-chain renderer to omit reserved-key duplicates; v9 takes it, so
|
|
191
|
+
* `artifacts` no longer appears on the on-chain lanes at all. Rendered output differs, so the
|
|
192
|
+
* version has to.
|
|
193
|
+
* - v9 → v10: four reserved keys the spec had always listed were projected by neither plane on
|
|
194
|
+
* chain — `background_color`, `youtube_url`, `banner_image`, `featured_image`. A documented
|
|
195
|
+
* reserved key that nothing emits is a protocol hole, so the renderer now emits all four when
|
|
196
|
+
* their representation is chain-reachable. A v9 renderer silently drops them.
|
|
197
|
+
*
|
|
198
|
+
* Read `specVersion()` rather than probing for a feature: a capability probe answers yes for every
|
|
199
|
+
* build that has the feature, which is exactly how a stale factory once reported as current. */
|
|
120
200
|
export async function isCurrentRenderer(publicClient, renderer) {
|
|
121
201
|
try {
|
|
122
202
|
const v = (await publicClient.readContract({
|
|
@@ -124,7 +204,7 @@ export async function isCurrentRenderer(publicClient, renderer) {
|
|
|
124
204
|
abi: abxMetadataRendererAbi,
|
|
125
205
|
functionName: 'specVersion',
|
|
126
206
|
}));
|
|
127
|
-
return v ===
|
|
207
|
+
return v === 10n;
|
|
128
208
|
}
|
|
129
209
|
catch {
|
|
130
210
|
return false;
|
|
@@ -161,12 +241,12 @@ export async function ensureRenderer(publicClient, send, opts) {
|
|
|
161
241
|
return renderer;
|
|
162
242
|
}
|
|
163
243
|
// ── the code-project (SeriesCode) trust anchor ────────────────────────────────
|
|
164
|
-
/** The code-project trust anchor: use the canonical factory, else
|
|
165
|
-
* fresh chain — libraries linked in-flight; see {@link
|
|
166
|
-
* 1/1 and Series factories there is no version probe (no
|
|
167
|
-
* configured factory with code is always accepted)
|
|
168
|
-
*
|
|
169
|
-
* is
|
|
244
|
+
/** The code-project trust anchor: use the canonical factory, else the CREATE2-deterministic address,
|
|
245
|
+
* else deploy one (a sandbox / fresh chain — libraries linked in-flight; see {@link
|
|
246
|
+
* deploySeriesCodeFactory}). Unlike the 1/1 and Series factories there is no version probe (no
|
|
247
|
+
* `isCurrentSeriesCodeFactory` — a configured factory with code is always accepted); it needs none
|
|
248
|
+
* at the deterministic address, because a CREATE2 address is bytecode-bound — code sitting at
|
|
249
|
+
* `predictSeriesCodeFactory()` is necessarily THIS build, linked against these libraries. */
|
|
170
250
|
export async function ensureSeriesCodeFactory(publicClient, send, opts) {
|
|
171
251
|
const notify = opts.onEvent ?? (() => { });
|
|
172
252
|
const known = resolveSeriesCodeFactory(opts.chainId, opts.override);
|
|
@@ -180,6 +260,16 @@ export async function ensureSeriesCodeFactory(publicClient, send, opts) {
|
|
|
180
260
|
throw new AnchorUnavailableError('series-code-factory', 'no-code', known);
|
|
181
261
|
notify({ anchor: 'series-code-factory', kind: 'stale', address: known, reason: 'no-code' });
|
|
182
262
|
}
|
|
263
|
+
// Self-heal: the forge script (or an earlier bootstrap) may have put this build's factory at its
|
|
264
|
+
// deterministic address without the manifest catching up. Check there before spending a deploy.
|
|
265
|
+
const predicted = predictSeriesCodeFactory();
|
|
266
|
+
if (!known || known.toLowerCase() !== predicted.toLowerCase()) {
|
|
267
|
+
const pcode = await publicClient.getCode({ address: predicted });
|
|
268
|
+
if (pcode && pcode !== '0x') {
|
|
269
|
+
notify({ anchor: 'series-code-factory', kind: 'canonical', address: predicted });
|
|
270
|
+
return predicted;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
183
273
|
if (!known && !opts.allowBootstrap)
|
|
184
274
|
throw new AnchorUnavailableError('series-code-factory', 'not-configured');
|
|
185
275
|
notify({ anchor: 'series-code-factory', kind: 'deploying' });
|
|
@@ -189,6 +279,7 @@ export async function ensureSeriesCodeFactory(publicClient, send, opts) {
|
|
|
189
279
|
kind: 'deployed',
|
|
190
280
|
address: r.factory,
|
|
191
281
|
implementation: r.implementation,
|
|
282
|
+
metadataLib: r.metadataLib,
|
|
192
283
|
paramsLib: r.paramsLib,
|
|
193
284
|
codeLib: r.codeLib,
|
|
194
285
|
txHash: r.txHash,
|
|
@@ -216,6 +307,10 @@ export async function isCurrentOneOfOneEditionFactory(publicClient, factory) {
|
|
|
216
307
|
abi: oneOfOneEditionFactoryAbi,
|
|
217
308
|
functionName: 'implementation',
|
|
218
309
|
}));
|
|
310
|
+
// The core-version gate runs FIRST: it is the question that actually distinguishes builds. The
|
|
311
|
+
// capability probe below stays as a cheap sanity check on the implementation's shape.
|
|
312
|
+
if (!(await implCoreVersionIsCurrent(publicClient, impl)))
|
|
313
|
+
return false;
|
|
219
314
|
const [isErc1155, isEditionMint] = await Promise.all([
|
|
220
315
|
publicClient.readContract({ address: impl, abi: oneOfOneEditionAbi, functionName: 'supportsInterface', args: [ERC1155_INTERFACE_ID] }),
|
|
221
316
|
publicClient.readContract({ address: impl, abi: oneOfOneEditionAbi, functionName: 'supportsInterface', args: [EDITION_MINT_INTERFACE_ID] }),
|
|
@@ -228,10 +323,12 @@ export async function isCurrentOneOfOneEditionFactory(publicClient, factory) {
|
|
|
228
323
|
}
|
|
229
324
|
/**
|
|
230
325
|
* Get (or deploy) the chain's canonical 1/1-edition clone factory — the trust anchor for a
|
|
231
|
-
* priced open/limited edition of a single
|
|
326
|
+
* priced open/limited edition of a single work. The edition twin of {@link ensureFactory},
|
|
232
327
|
* but — because `OneOfOneEditionFactory` is CREATE2-deterministic (see `create2.ts`'s
|
|
233
328
|
* class-level dev note), unlike the 721 1/1 factory's own bootstrap path — this one ALSO
|
|
234
|
-
* self-heals to the predicted address, mirroring {@link ensureRenderer}'s style.
|
|
329
|
+
* self-heals to the predicted address, mirroring {@link ensureRenderer}'s style. The bootstrap
|
|
330
|
+
* leg deploys `AbxParamsLib` + `AbxEditionLib` first (reusing whatever is already on-chain) and
|
|
331
|
+
* links the factory against them — see {@link deployOneOfOneEditionFactory}.
|
|
235
332
|
*/
|
|
236
333
|
export async function ensureOneOfOneEditionFactory(publicClient, send, opts) {
|
|
237
334
|
const notify = opts.onEvent ?? (() => { });
|
|
@@ -264,8 +361,18 @@ export async function ensureOneOfOneEditionFactory(publicClient, send, opts) {
|
|
|
264
361
|
if (!known && !opts.allowBootstrap)
|
|
265
362
|
throw new AnchorUnavailableError('one-of-one-edition-factory', 'not-configured');
|
|
266
363
|
notify({ anchor: 'one-of-one-edition-factory', kind: 'deploying' });
|
|
267
|
-
const { factory, implementation, txHash } = await deployOneOfOneEditionFactory(send, publicClient);
|
|
268
|
-
notify({
|
|
364
|
+
const { factory, implementation, metadataLib, paramsLib, editionLib, txHash } = await deployOneOfOneEditionFactory(send, publicClient);
|
|
365
|
+
notify({
|
|
366
|
+
anchor: 'one-of-one-edition-factory',
|
|
367
|
+
kind: 'deployed',
|
|
368
|
+
address: factory,
|
|
369
|
+
implementation,
|
|
370
|
+
metadataLib,
|
|
371
|
+
paramsLib,
|
|
372
|
+
editionLib,
|
|
373
|
+
txHash,
|
|
374
|
+
inManifest: false,
|
|
375
|
+
});
|
|
269
376
|
return factory;
|
|
270
377
|
}
|
|
271
378
|
/** Is the deployed edition-image factory this build's version? Same two-probe shape as {@link
|
|
@@ -279,6 +386,10 @@ export async function isCurrentEditionFactory(publicClient, factory) {
|
|
|
279
386
|
abi: editionImageFactoryAbi,
|
|
280
387
|
functionName: 'implementation',
|
|
281
388
|
}));
|
|
389
|
+
// The core-version gate runs FIRST: it is the question that actually distinguishes builds. The
|
|
390
|
+
// capability probe below stays as a cheap sanity check on the implementation's shape.
|
|
391
|
+
if (!(await implCoreVersionIsCurrent(publicClient, impl)))
|
|
392
|
+
return false;
|
|
282
393
|
const [isErc1155, isEditionMint] = await Promise.all([
|
|
283
394
|
publicClient.readContract({ address: impl, abi: editionImageAbi, functionName: 'supportsInterface', args: [ERC1155_INTERFACE_ID] }),
|
|
284
395
|
publicClient.readContract({ address: impl, abi: editionImageAbi, functionName: 'supportsInterface', args: [EDITION_MINT_INTERFACE_ID] }),
|
|
@@ -289,9 +400,10 @@ export async function isCurrentEditionFactory(publicClient, factory) {
|
|
|
289
400
|
return false;
|
|
290
401
|
}
|
|
291
402
|
}
|
|
292
|
-
/** Get (or deploy) the chain's `EditionImageFactory` — the multi-
|
|
403
|
+
/** Get (or deploy) the chain's `EditionImageFactory` — the multi-work edition trust anchor,
|
|
293
404
|
* the sibling of {@link ensureSeriesFactory}. CREATE2-deterministic, so it self-heals to its
|
|
294
|
-
* predicted address exactly like {@link ensureOneOfOneEditionFactory}
|
|
405
|
+
* predicted address exactly like {@link ensureOneOfOneEditionFactory} — and, like it, links
|
|
406
|
+
* `AbxEditionLib` (+ that library's own `AbxParamsLib`) on the bootstrap leg. */
|
|
295
407
|
export async function ensureEditionFactory(publicClient, send, opts) {
|
|
296
408
|
const notify = opts.onEvent ?? (() => { });
|
|
297
409
|
const known = resolveEditionFactory(opts.chainId, opts.override);
|
|
@@ -323,15 +435,25 @@ export async function ensureEditionFactory(publicClient, send, opts) {
|
|
|
323
435
|
if (!known && !opts.allowBootstrap)
|
|
324
436
|
throw new AnchorUnavailableError('edition-factory', 'not-configured');
|
|
325
437
|
notify({ anchor: 'edition-factory', kind: 'deploying' });
|
|
326
|
-
const { factory, implementation, txHash } = await deployEditionFactory(send, publicClient);
|
|
327
|
-
notify({
|
|
438
|
+
const { factory, implementation, metadataLib, paramsLib, editionLib, txHash } = await deployEditionFactory(send, publicClient);
|
|
439
|
+
notify({
|
|
440
|
+
anchor: 'edition-factory',
|
|
441
|
+
kind: 'deployed',
|
|
442
|
+
address: factory,
|
|
443
|
+
implementation,
|
|
444
|
+
metadataLib,
|
|
445
|
+
paramsLib,
|
|
446
|
+
editionLib,
|
|
447
|
+
txHash,
|
|
448
|
+
inManifest: false,
|
|
449
|
+
});
|
|
328
450
|
return factory;
|
|
329
451
|
}
|
|
330
|
-
/** The code-project EDITION trust anchor: use the canonical factory, else
|
|
331
|
-
* fresh chain — three libraries linked in-flight; see {@link
|
|
332
|
-
* {@link ensureSeriesCodeFactory}'s stance, extended to a third
|
|
333
|
-
* configured factory with code is always accepted) and
|
|
334
|
-
*
|
|
452
|
+
/** The code-project EDITION trust anchor: use the canonical factory, else the CREATE2-deterministic
|
|
453
|
+
* address, else deploy one (a sandbox / fresh chain — three libraries linked in-flight; see {@link
|
|
454
|
+
* deployEditionCodeFactory}). Exactly {@link ensureSeriesCodeFactory}'s stance, extended to a third
|
|
455
|
+
* library: no version probe (a configured factory with code is always accepted), and the same
|
|
456
|
+
* bytecode-bound self-heal at `predictEditionCodeFactory()`. */
|
|
335
457
|
export async function ensureEditionCodeFactory(publicClient, send, opts) {
|
|
336
458
|
const notify = opts.onEvent ?? (() => { });
|
|
337
459
|
const known = resolveEditionCodeFactory(opts.chainId, opts.override);
|
|
@@ -345,6 +467,14 @@ export async function ensureEditionCodeFactory(publicClient, send, opts) {
|
|
|
345
467
|
throw new AnchorUnavailableError('edition-code-factory', 'no-code', known);
|
|
346
468
|
notify({ anchor: 'edition-code-factory', kind: 'stale', address: known, reason: 'no-code' });
|
|
347
469
|
}
|
|
470
|
+
const predicted = predictEditionCodeFactory();
|
|
471
|
+
if (!known || known.toLowerCase() !== predicted.toLowerCase()) {
|
|
472
|
+
const pcode = await publicClient.getCode({ address: predicted });
|
|
473
|
+
if (pcode && pcode !== '0x') {
|
|
474
|
+
notify({ anchor: 'edition-code-factory', kind: 'canonical', address: predicted });
|
|
475
|
+
return predicted;
|
|
476
|
+
}
|
|
477
|
+
}
|
|
348
478
|
if (!known && !opts.allowBootstrap)
|
|
349
479
|
throw new AnchorUnavailableError('edition-code-factory', 'not-configured');
|
|
350
480
|
notify({ anchor: 'edition-code-factory', kind: 'deploying' });
|
|
@@ -354,6 +484,7 @@ export async function ensureEditionCodeFactory(publicClient, send, opts) {
|
|
|
354
484
|
kind: 'deployed',
|
|
355
485
|
address: r.factory,
|
|
356
486
|
implementation: r.implementation,
|
|
487
|
+
metadataLib: r.metadataLib,
|
|
357
488
|
paramsLib: r.paramsLib,
|
|
358
489
|
codeLib: r.codeLib,
|
|
359
490
|
editionLib: r.editionLib,
|