@artblocks/abx-sdk 0.1.0-alpha.0

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.
Files changed (86) hide show
  1. package/LICENSE +21 -0
  2. package/dist/abi/generated.d.ts +6185 -0
  3. package/dist/abi/generated.d.ts.map +1 -0
  4. package/dist/abi/generated.js +28 -0
  5. package/dist/abi/generated.js.map +1 -0
  6. package/dist/abi/index.d.ts +3227 -0
  7. package/dist/abi/index.d.ts.map +1 -0
  8. package/dist/abi/index.js +38 -0
  9. package/dist/abi/index.js.map +1 -0
  10. package/dist/chains.d.ts +27 -0
  11. package/dist/chains.d.ts.map +1 -0
  12. package/dist/chains.js +71 -0
  13. package/dist/chains.js.map +1 -0
  14. package/dist/chunks.d.ts +168 -0
  15. package/dist/chunks.d.ts.map +1 -0
  16. package/dist/chunks.js +232 -0
  17. package/dist/chunks.js.map +1 -0
  18. package/dist/clients.d.ts +42 -0
  19. package/dist/clients.d.ts.map +1 -0
  20. package/dist/clients.js +90 -0
  21. package/dist/clients.js.map +1 -0
  22. package/dist/create2.d.ts +42 -0
  23. package/dist/create2.d.ts.map +1 -0
  24. package/dist/create2.js +47 -0
  25. package/dist/create2.js.map +1 -0
  26. package/dist/deploy.d.ts +192 -0
  27. package/dist/deploy.d.ts.map +1 -0
  28. package/dist/deploy.js +231 -0
  29. package/dist/deploy.js.map +1 -0
  30. package/dist/deployments.d.ts +60 -0
  31. package/dist/deployments.d.ts.map +1 -0
  32. package/dist/deployments.js +81 -0
  33. package/dist/deployments.js.map +1 -0
  34. package/dist/deps.d.ts +109 -0
  35. package/dist/deps.d.ts.map +1 -0
  36. package/dist/deps.js +103 -0
  37. package/dist/deps.js.map +1 -0
  38. package/dist/env.d.ts +2 -0
  39. package/dist/env.d.ts.map +1 -0
  40. package/dist/env.js +45 -0
  41. package/dist/env.js.map +1 -0
  42. package/dist/fastlz.d.ts +20 -0
  43. package/dist/fastlz.d.ts.map +1 -0
  44. package/dist/fastlz.js +123 -0
  45. package/dist/fastlz.js.map +1 -0
  46. package/dist/generator.d.ts +129 -0
  47. package/dist/generator.d.ts.map +1 -0
  48. package/dist/generator.js +81 -0
  49. package/dist/generator.js.map +1 -0
  50. package/dist/index.d.ts +31 -0
  51. package/dist/index.d.ts.map +1 -0
  52. package/dist/index.js +20 -0
  53. package/dist/index.js.map +1 -0
  54. package/dist/ops.d.ts +379 -0
  55. package/dist/ops.d.ts.map +1 -0
  56. package/dist/ops.js +811 -0
  57. package/dist/ops.js.map +1 -0
  58. package/dist/probe.d.ts +30 -0
  59. package/dist/probe.d.ts.map +1 -0
  60. package/dist/probe.js +74 -0
  61. package/dist/probe.js.map +1 -0
  62. package/dist/reconstruct.d.ts +97 -0
  63. package/dist/reconstruct.d.ts.map +1 -0
  64. package/dist/reconstruct.js +597 -0
  65. package/dist/reconstruct.js.map +1 -0
  66. package/dist/spine.d.ts +110 -0
  67. package/dist/spine.d.ts.map +1 -0
  68. package/dist/spine.js +0 -0
  69. package/dist/spine.js.map +1 -0
  70. package/dist/token.d.ts +33 -0
  71. package/dist/token.d.ts.map +1 -0
  72. package/dist/token.js +66 -0
  73. package/dist/token.js.map +1 -0
  74. package/dist/tokendata.d.ts +50 -0
  75. package/dist/tokendata.d.ts.map +1 -0
  76. package/dist/tokendata.js +178 -0
  77. package/dist/tokendata.js.map +1 -0
  78. package/dist/traits.d.ts +38 -0
  79. package/dist/traits.d.ts.map +1 -0
  80. package/dist/traits.js +92 -0
  81. package/dist/traits.js.map +1 -0
  82. package/dist/types.d.ts +145 -0
  83. package/dist/types.d.ts.map +1 -0
  84. package/dist/types.js +2 -0
  85. package/dist/types.js.map +1 -0
  86. package/package.json +53 -0
@@ -0,0 +1,90 @@
1
+ import { createPublicClient, createWalletClient, fallback, http, } from 'viem';
2
+ import { privateKeyToAccount } from 'viem/accounts';
3
+ import { DEFAULT_CHAIN_KEY, resolveChain, resolveRpcUrls, rpcEnvVar } from './chains.js';
4
+ import { loadDotEnv } from './env.js';
5
+ /**
6
+ * A transport over one or more endpoints. With several, a viem `fallback` fails
7
+ * over on error — so a request one endpoint rejects (e.g. a too-wide `eth_getLogs`)
8
+ * is retried on the next, which is how the toolkit "finds the endpoint fit for the
9
+ * job" at request time. `retryCount: 0` makes that failover immediate.
10
+ */
11
+ function makeTransport(opts) {
12
+ if (opts.rpcUrl)
13
+ return http(opts.rpcUrl);
14
+ const urls = resolveRpcUrls(opts.chainKey);
15
+ if (urls.length <= 1)
16
+ return http(urls[0]);
17
+ return fallback(urls.map((u) => http(u, { retryCount: 0 })));
18
+ }
19
+ /** A read-only client — all the indexer and token API ever need. */
20
+ export function makePublicClient(opts = {}) {
21
+ return createPublicClient({ chain: resolveChain(opts.chainKey), transport: makeTransport(opts) });
22
+ }
23
+ const verifiedChains = new Set();
24
+ /**
25
+ * Verify the configured RPC actually IS the chain we think it is, before any write.
26
+ * The env var names a network ("sepolia") but the URL behind it could point anywhere;
27
+ * this calls `eth_chainId` and hard-fails on a mismatch so an irreversible tx can't go
28
+ * to the wrong chain. Memoized per chainKey — one round-trip per process, so callers can
29
+ * invoke it liberally at write preflights. Reads never call it (they stay zero-overhead).
30
+ *
31
+ * `allowUnreachable` (used by `--dry-run` preflights): a *wrong-network* RPC still hard-fails
32
+ * with the clear mismatch message — a dry run makes RPC reads (predict address, resolve the
33
+ * factory/renderer) that otherwise fail deep inside viem as an opaque "returned no data" — but
34
+ * an *unreachable* RPC is tolerated (returns silently), so a genuinely offline `--dry-run` can
35
+ * still preview what it can. Only a reachable-but-wrong endpoint is a preview-blocking error.
36
+ */
37
+ export async function assertChainId(chainKey = DEFAULT_CHAIN_KEY, opts = {}) {
38
+ if (verifiedChains.has(chainKey))
39
+ return;
40
+ const expected = resolveChain(chainKey).id;
41
+ let actual;
42
+ try {
43
+ actual = await makePublicClient({ chainKey }).getChainId();
44
+ }
45
+ catch (err) {
46
+ if (opts.allowUnreachable)
47
+ return; // offline dry-run: preview what we can, don't block
48
+ throw new Error(`Could not reach an RPC for '${chainKey}' to verify the network: ${err.message}. ` +
49
+ `Check ${rpcEnvVar(chainKey)} / ABX_RPC_URLS in your .env.`);
50
+ }
51
+ if (actual !== expected) {
52
+ throw new Error(`RPC network mismatch: the configured endpoint reports chain ${actual}, but ABX_CHAIN='${chainKey}' ` +
53
+ `expects ${expected}. Point ${rpcEnvVar(chainKey)} (or ABX_RPC_URLS) at a '${chainKey}' endpoint.`);
54
+ }
55
+ verifiedChains.add(chainKey);
56
+ }
57
+ /**
58
+ * A signing client, backed by a private key from the environment. The SDK never
59
+ * takes custody of keys beyond reading them from the operator's own env — there
60
+ * is no key storage, no prompt, no remote signer here.
61
+ *
62
+ * Key precedence: `ABX_DEPLOYER_PK` → `SEPOLIA_FUNDED_PK` → `SEPOLIA_WALLET_PK`.
63
+ */
64
+ export function makeWalletClient(opts = {}) {
65
+ loadDotEnv();
66
+ const pk = process.env.ABX_DEPLOYER_PK ?? process.env.SEPOLIA_FUNDED_PK ?? process.env.SEPOLIA_WALLET_PK;
67
+ if (!pk) {
68
+ throw new Error('No signing key found. Set ABX_DEPLOYER_PK, SEPOLIA_FUNDED_PK, or SEPOLIA_WALLET_PK in your .env.');
69
+ }
70
+ const account = privateKeyToAccount(normalizePk(pk));
71
+ const chain = resolveChain(opts.chainKey);
72
+ const wallet = createWalletClient({ account, chain, transport: makeTransport(opts) });
73
+ return { wallet, account };
74
+ }
75
+ function normalizePk(pk) {
76
+ const trimmed = pk.trim();
77
+ return (trimmed.startsWith('0x') ? trimmed : `0x${trimmed}`);
78
+ }
79
+ /**
80
+ * The env signing key (0x-normalized), same precedence as {@link makeWalletClient}
81
+ * (`ABX_DEPLOYER_PK` → `SEPOLIA_FUNDED_PK` → `SEPOLIA_WALLET_PK`), or `undefined` if none is set.
82
+ * For reusing the hot key as a *storage* signing identity (an Ethereum Turbo identity) without
83
+ * constructing a wallet client. Never throws.
84
+ */
85
+ export function envSigningKey() {
86
+ loadDotEnv();
87
+ const pk = process.env.ABX_DEPLOYER_PK ?? process.env.SEPOLIA_FUNDED_PK ?? process.env.SEPOLIA_WALLET_PK;
88
+ return pk ? normalizePk(pk) : undefined;
89
+ }
90
+ //# sourceMappingURL=clients.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clients.js","sourceRoot":"","sources":["../src/clients.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,QAAQ,EACR,IAAI,GAKL,MAAM,MAAM,CAAC;AACd,OAAO,EAAC,mBAAmB,EAAC,MAAM,eAAe,CAAC;AAClD,OAAO,EAAC,iBAAiB,EAAE,YAAY,EAAE,cAAc,EAAE,SAAS,EAAC,MAAM,aAAa,CAAC;AACvF,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAOpC;;;;;GAKG;AACH,SAAS,aAAa,CAAC,IAAmB;IACxC,IAAI,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC1C,MAAM,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC3C,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3C,OAAO,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,EAAC,UAAU,EAAE,CAAC,EAAC,CAAC,CAAC,CAAC,CAAC;AAC7D,CAAC;AAED,oEAAoE;AACpE,MAAM,UAAU,gBAAgB,CAAC,OAAsB,EAAE;IACvD,OAAO,kBAAkB,CAAC,EAAC,KAAK,EAAE,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,SAAS,EAAE,aAAa,CAAC,IAAI,CAAC,EAAC,CAAC,CAAC;AAClG,CAAC;AAED,MAAM,cAAc,GAAG,IAAI,GAAG,EAAU,CAAC;AAEzC;;;;;;;;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AAE,CAAC,CAAC,CAAC;IACrD,MAAM,KAAK,GAAG,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC1C,MAAM,MAAM,GAAG,kBAAkB,CAAC,EAAC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,aAAa,CAAC,IAAI,CAAC,EAAC,CAAC,CAAC;IACpF,OAAO,EAAC,MAAM,EAAE,OAAO,EAAC,CAAC;AAC3B,CAAC;AAED,SAAS,WAAW,CAAC,EAAU;IAC7B,MAAM,OAAO,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC;IAC1B,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE,CAAkB,CAAC;AAChF,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa;IAC3B,UAAU,EAAE,CAAC;IACb,MAAM,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;IACzG,OAAO,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC1C,CAAC"}
@@ -0,0 +1,42 @@
1
+ import { type Address, type Hex } from 'viem';
2
+ /**
3
+ * Keyless CREATE2 deployment — the TS twin of `contracts/script/AbxSalts.sol`.
4
+ *
5
+ * ABX infra is deployed through the keyless CREATE2 proxy (present at the same address on every EVM
6
+ * chain — the address `forge` routes `new X{salt: …}()` through) with a canonical salt, so a given
7
+ * contract has the **same address on every chain**. Keeping the salts + proxy here lets the SDK/CLI
8
+ * predict those addresses and deploy to them, so the toolkit's lazy deployers land at the exact
9
+ * addresses the forge scripts (and the manifest) use — deterministic everywhere, no drift.
10
+ */
11
+ /** The keyless CREATE2 proxy (Arachnid deterministic-deployment-proxy). Same address on every chain. */
12
+ export declare const CREATE2_PROXY: Address;
13
+ /** Canonical salt strings — MUST stay byte-identical to `contracts/script/AbxSalts.sol`, since the
14
+ * deterministic address is `keccak256(0xff ++ proxy ++ keccak256(salt) ++ keccak256(initcode))`. */
15
+ export declare const ABX_SALT: {
16
+ readonly oneOfOneFactory: "abx.factory.one-of-one.v1";
17
+ readonly seriesFactory: "abx.factory.series.v1";
18
+ readonly seriesCodeFactory: "abx.factory.series-code.v1";
19
+ readonly renderer: "abx.renderer.v1";
20
+ readonly chunkStore: "abx.chunk-store.v1";
21
+ readonly fixedPriceMinter: "abx.minter.fixed-price.v1";
22
+ readonly seedSource: "abx.seed-source.v1";
23
+ readonly generator: "abx.generator.v1";
24
+ };
25
+ /** The 32-byte salt a CREATE2 deploy uses (`keccak256` of the canonical string). */
26
+ export declare const saltHash: (salt: string) => Hex;
27
+ /** The deterministic address `bytecode` deploys to under `salt` via the keyless proxy — identical
28
+ * on every chain. Pure: no chain access. */
29
+ export declare function predictCreate2Address(salt: string, bytecode: Hex): Address;
30
+ /** The calldata a CREATE2-proxy deploy sends: 32-byte salt ++ initcode (the proxy CREATE2-deploys it). */
31
+ export declare function create2Calldata(salt: string, bytecode: Hex): Hex;
32
+ /** The canonical (cross-chain-identical) AbxChunkStore address for the current bytecode. */
33
+ export declare const predictChunkStore: () => Address;
34
+ /** The canonical (cross-chain-identical) AbxMetadataRenderer address for the current bytecode. */
35
+ export declare const predictRenderer: () => Address;
36
+ /** The canonical (cross-chain-identical) AbxFixedPriceMinter address for the current bytecode. */
37
+ export declare const predictFixedPriceMinter: () => Address;
38
+ /** The canonical (cross-chain-identical) AbxSeedSource address. Deploy it standalone
39
+ * (`DeploySeedSource.s.sol`) so it compiles at the default profile — bundling it with the
40
+ * SeriesCode factory's `clone-impl` unit yields a different, non-canonical bytecode + address. */
41
+ export declare const predictSeedSource: () => Address;
42
+ //# sourceMappingURL=create2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create2.d.ts","sourceRoot":"","sources":["../src/create2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiD,KAAK,OAAO,EAAE,KAAK,GAAG,EAAC,MAAM,MAAM,CAAC;AAQ5F;;;;;;;;GAQG;AAEH,wGAAwG;AACxG,eAAO,MAAM,aAAa,EAAE,OAAsD,CAAC;AAEnF;qGACqG;AACrG,eAAO,MAAM,QAAQ;;;;;;;;;CASX,CAAC;AAEX,oFAAoF;AACpF,eAAO,MAAM,QAAQ,GAAI,MAAM,MAAM,KAAG,GAA+B,CAAC;AAExE;6CAC6C;AAC7C,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,OAAO,CAE1E;AAED,0GAA0G;AAC1G,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,GAAG,CAEhE;AAED,4FAA4F;AAC5F,eAAO,MAAM,iBAAiB,QAAO,OAA4E,CAAC;AAElH,kGAAkG;AAClG,eAAO,MAAM,eAAe,QAAO,OAAgF,CAAC;AAEpH,kGAAkG;AAClG,eAAO,MAAM,uBAAuB,QAAO,OACoC,CAAC;AAEhF;;mGAEmG;AACnG,eAAO,MAAM,iBAAiB,QAAO,OAA4E,CAAC"}
@@ -0,0 +1,47 @@
1
+ import { concat, getContractAddress, keccak256, toBytes } from 'viem';
2
+ import { abxChunkStoreBytecode, abxFixedPriceMinterBytecode, abxMetadataRendererBytecode, abxSeedSourceBytecode, } from './abi/index.js';
3
+ /**
4
+ * Keyless CREATE2 deployment — the TS twin of `contracts/script/AbxSalts.sol`.
5
+ *
6
+ * ABX infra is deployed through the keyless CREATE2 proxy (present at the same address on every EVM
7
+ * chain — the address `forge` routes `new X{salt: …}()` through) with a canonical salt, so a given
8
+ * contract has the **same address on every chain**. Keeping the salts + proxy here lets the SDK/CLI
9
+ * predict those addresses and deploy to them, so the toolkit's lazy deployers land at the exact
10
+ * addresses the forge scripts (and the manifest) use — deterministic everywhere, no drift.
11
+ */
12
+ /** The keyless CREATE2 proxy (Arachnid deterministic-deployment-proxy). Same address on every chain. */
13
+ export const CREATE2_PROXY = '0x4e59b44847b379578588920cA78FbF26c0B4956C';
14
+ /** Canonical salt strings — MUST stay byte-identical to `contracts/script/AbxSalts.sol`, since the
15
+ * deterministic address is `keccak256(0xff ++ proxy ++ keccak256(salt) ++ keccak256(initcode))`. */
16
+ export const ABX_SALT = {
17
+ oneOfOneFactory: 'abx.factory.one-of-one.v1',
18
+ seriesFactory: 'abx.factory.series.v1',
19
+ seriesCodeFactory: 'abx.factory.series-code.v1',
20
+ renderer: 'abx.renderer.v1',
21
+ chunkStore: 'abx.chunk-store.v1',
22
+ fixedPriceMinter: 'abx.minter.fixed-price.v1',
23
+ seedSource: 'abx.seed-source.v1',
24
+ generator: 'abx.generator.v1',
25
+ };
26
+ /** The 32-byte salt a CREATE2 deploy uses (`keccak256` of the canonical string). */
27
+ export const saltHash = (salt) => keccak256(toBytes(salt));
28
+ /** The deterministic address `bytecode` deploys to under `salt` via the keyless proxy — identical
29
+ * on every chain. Pure: no chain access. */
30
+ export function predictCreate2Address(salt, bytecode) {
31
+ return getContractAddress({ opcode: 'CREATE2', from: CREATE2_PROXY, salt: saltHash(salt), bytecode });
32
+ }
33
+ /** The calldata a CREATE2-proxy deploy sends: 32-byte salt ++ initcode (the proxy CREATE2-deploys it). */
34
+ export function create2Calldata(salt, bytecode) {
35
+ return concat([saltHash(salt), bytecode]);
36
+ }
37
+ /** The canonical (cross-chain-identical) AbxChunkStore address for the current bytecode. */
38
+ export const predictChunkStore = () => predictCreate2Address(ABX_SALT.chunkStore, abxChunkStoreBytecode);
39
+ /** The canonical (cross-chain-identical) AbxMetadataRenderer address for the current bytecode. */
40
+ export const predictRenderer = () => predictCreate2Address(ABX_SALT.renderer, abxMetadataRendererBytecode);
41
+ /** The canonical (cross-chain-identical) AbxFixedPriceMinter address for the current bytecode. */
42
+ export const predictFixedPriceMinter = () => predictCreate2Address(ABX_SALT.fixedPriceMinter, abxFixedPriceMinterBytecode);
43
+ /** The canonical (cross-chain-identical) AbxSeedSource address. Deploy it standalone
44
+ * (`DeploySeedSource.s.sol`) so it compiles at the default profile — bundling it with the
45
+ * SeriesCode factory's `clone-impl` unit yields a different, non-canonical bytecode + address. */
46
+ export const predictSeedSource = () => predictCreate2Address(ABX_SALT.seedSource, abxSeedSourceBytecode);
47
+ //# sourceMappingURL=create2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create2.js","sourceRoot":"","sources":["../src/create2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAE,kBAAkB,EAAE,SAAS,EAAE,OAAO,EAAyB,MAAM,MAAM,CAAC;AAC5F,OAAO,EACL,qBAAqB,EACrB,2BAA2B,EAC3B,2BAA2B,EAC3B,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AAExB;;;;;;;;GAQG;AAEH,wGAAwG;AACxG,MAAM,CAAC,MAAM,aAAa,GAAY,4CAA4C,CAAC;AAEnF;qGACqG;AACrG,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,eAAe,EAAE,2BAA2B;IAC5C,aAAa,EAAE,uBAAuB;IACtC,iBAAiB,EAAE,4BAA4B;IAC/C,QAAQ,EAAE,iBAAiB;IAC3B,UAAU,EAAE,oBAAoB;IAChC,gBAAgB,EAAE,2BAA2B;IAC7C,UAAU,EAAE,oBAAoB;IAChC,SAAS,EAAE,kBAAkB;CACrB,CAAC;AAEX,oFAAoF;AACpF,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAO,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AAExE;6CAC6C;AAC7C,MAAM,UAAU,qBAAqB,CAAC,IAAY,EAAE,QAAa;IAC/D,OAAO,kBAAkB,CAAC,EAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAC,CAAC,CAAC;AACtG,CAAC;AAED,0GAA0G;AAC1G,MAAM,UAAU,eAAe,CAAC,IAAY,EAAE,QAAa;IACzD,OAAO,MAAM,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC5C,CAAC;AAED,4FAA4F;AAC5F,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAY,EAAE,CAAC,qBAAqB,CAAC,QAAQ,CAAC,UAAU,EAAE,qBAAqB,CAAC,CAAC;AAElH,kGAAkG;AAClG,MAAM,CAAC,MAAM,eAAe,GAAG,GAAY,EAAE,CAAC,qBAAqB,CAAC,QAAQ,CAAC,QAAQ,EAAE,2BAA2B,CAAC,CAAC;AAEpH,kGAAkG;AAClG,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAY,EAAE,CACnD,qBAAqB,CAAC,QAAQ,CAAC,gBAAgB,EAAE,2BAA2B,CAAC,CAAC;AAEhF;;mGAEmG;AACnG,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAY,EAAE,CAAC,qBAAqB,CAAC,QAAQ,CAAC,UAAU,EAAE,qBAAqB,CAAC,CAAC"}
@@ -0,0 +1,192 @@
1
+ import { type Account, type Address, type Hex, type PublicClient, type WalletClient } from 'viem';
2
+ /** One on-chain metadata field to set at deploy (bytes32 `field`/`representation`, bytes `value`). */
3
+ export interface OnChainFieldInput {
4
+ field: Hex;
5
+ representation: Hex;
6
+ value: Hex;
7
+ }
8
+ /** Mirrors `OneOfOneImage.InitParams` (the deploy-time configuration). */
9
+ export interface OneOfOneInitParams {
10
+ owner: Address;
11
+ /** Recipient of the token at deploy; `0x0` (zeroAddress) defers the mint to a later `mint(to)`. */
12
+ mintTo: Address;
13
+ name: string;
14
+ symbol: string;
15
+ /** Off-chain resolver base; the per-token pointer is derived on-chain as
16
+ * `{base}/{chainId}/{address}/{tokenId}`. Empty ⇒ no off-chain pointer. */
17
+ tokenURIBase: string;
18
+ /** On-chain renderer for the token URI; `0x0` ⇒ resolve off-chain via the base. */
19
+ tokenURIRenderer: Address;
20
+ /** Off-chain resolver base for the collection; derived as `{base}/{chainId}/{address}`. */
21
+ contractURIBase: string;
22
+ /** On-chain renderer for the collection URI; `0x0` ⇒ resolve off-chain via the base. */
23
+ contractURIRenderer: Address;
24
+ royaltyReceiver: Address;
25
+ royaltyBps: number;
26
+ /** Optional on-chain metadata fields for token 0 and for the collection. */
27
+ tokenFields: OnChainFieldInput[];
28
+ contractFields: OnChainFieldInput[];
29
+ }
30
+ /** One per-token on-chain metadata field to set at deploy — keyed by `tokenId`. */
31
+ export interface SeriesTokenFieldInput {
32
+ tokenId: bigint | number;
33
+ field: Hex;
34
+ representation: Hex;
35
+ value: Hex;
36
+ }
37
+ /** Mirrors `SeriesImage.InitParams` (the multi-token deploy-time configuration). */
38
+ export interface SeriesInitParams {
39
+ owner: Address;
40
+ name: string;
41
+ symbol: string;
42
+ /** Off-chain resolver base; per-token pointer derived as `{base}/{chainId}/{address}/{tokenId}`. */
43
+ tokenURIBase: string;
44
+ /** On-chain renderer for the token URI; `0x0` ⇒ resolve off-chain via the base. */
45
+ tokenURIRenderer: Address;
46
+ contractURIBase: string;
47
+ contractURIRenderer: Address;
48
+ royaltyReceiver: Address;
49
+ royaltyBps: number;
50
+ /** Series size N (> 0): the supply cap. Monotonically non-increasing after deploy. */
51
+ maxInvocations: bigint | number;
52
+ /** Primary-sale payout destination (`0x0` = none). */
53
+ primaryPayee: Address;
54
+ /** Initial authorized minter — a single address (`0x0` = owner-only minting). */
55
+ minter: Address;
56
+ /** Initial mint-pause state — `true` = owner-only minting until unpaused (deploy-time
57
+ * reserves still mint). Projects usually deploy paused and unpause to go live. */
58
+ paused: boolean;
59
+ /** Recipient for the deploy-time mint (`0x0` defers all minting). */
60
+ mintTo: Address;
61
+ /** Tokens to mint in order (`[0, mintCount)`) at deploy; `<= maxInvocations`. */
62
+ mintCount: bigint | number;
63
+ /** Optional per-token on-chain metadata fields (keyed by token id). */
64
+ tokenFields: SeriesTokenFieldInput[];
65
+ contractFields: OnChainFieldInput[];
66
+ }
67
+ /** {@link SeriesInitParams} plus the code-project extension config ({SeriesCode.InitParams}). */
68
+ export interface SeriesCodeInitParams extends SeriesInitParams {
69
+ /** IAbxSeedSource the token calls at mint (`0x0` = no mint-time seed). */
70
+ seedSource: Address;
71
+ /** Opt out of delegate.xyz on the TokenOwner auth leg (default false = canonical registry). */
72
+ disableTokenOwnerDelegation: boolean;
73
+ }
74
+ export interface DeployResult<T extends string> {
75
+ txHash: Hex;
76
+ blockNumber: bigint;
77
+ }
78
+ /**
79
+ * A salt that reserves the deployed address to `deployer`. The factory's salt
80
+ * guard requires the leading 20 bytes to equal `msg.sender` when non-zero, so
81
+ * encoding the deployer there makes the address **front-run-proof**: nobody else
82
+ * can land their params on the address this salt predicts. The trailing 12 bytes
83
+ * are entropy (pass your own to mine a vanity suffix; random otherwise). Works for
84
+ * any account type — an EOA, an ERC-4337 smart account, or a Safe — since each is
85
+ * the `msg.sender` the factory checks.
86
+ */
87
+ export declare function saltFor(deployer: Address, entropy?: Hex): Hex;
88
+ /**
89
+ * A permissionless salt: an all-zero guard prefix, so **anyone** may deploy to the
90
+ * address it predicts (a shared, canonical deployment). No front-run protection —
91
+ * use only when a publicly-deployable, caller-independent address is the point.
92
+ */
93
+ export declare function permissionlessSalt(entropy?: Hex): Hex;
94
+ /** The address a salt reserves the deploy to (`0x0` ⇒ permissionless). */
95
+ export declare function saltGuard(salt: Hex): Address;
96
+ /**
97
+ * Deploy the canonical clone factory — the trust anchor. Ownerless and immutable;
98
+ * once deployed, its address is what platforms allowlist. Deploy this once per
99
+ * (chain, core version) and reuse it for every clone.
100
+ */
101
+ export declare function deployFactory(wallet: WalletClient, account: Account, publicClient: PublicClient): Promise<DeployResult<'factory'> & {
102
+ factory: Address;
103
+ implementation: Address;
104
+ }>;
105
+ /**
106
+ * Deploy the canonical Series clone factory — the trust anchor for multi-token drops.
107
+ * Ownerless and immutable; the sibling of `deployFactory`. Deploy once per (chain, core
108
+ * version). The shared renderer + chunk store are reused (deploy them separately).
109
+ */
110
+ export declare function deploySeriesFactory(wallet: WalletClient, account: Account, publicClient: PublicClient): Promise<DeployResult<'seriesFactory'> & {
111
+ factory: Address;
112
+ implementation: Address;
113
+ }>;
114
+ /**
115
+ * Deploy the code-project trust root on a chain with no canonical set: the two
116
+ * delegatecalled write-path libraries first ({AbxParamsLib}, {AbxCodeLib}), the factory
117
+ * bytecode LINKED against them (solc placeholders replaced — what forge does at build
118
+ * time, done here so a sandbox/fresh chain needs no forge), then the factory (whose
119
+ * constructor deploys the {SeriesCode} implementation).
120
+ */
121
+ export declare function deploySeriesCodeFactory(wallet: WalletClient, account: Account, publicClient: PublicClient): Promise<{
122
+ factory: Address;
123
+ implementation: Address;
124
+ paramsLib: Address;
125
+ codeLib: Address;
126
+ txHash: Hex;
127
+ blockNumber: bigint;
128
+ }>;
129
+ /** Deploy the canonical pseudorandom seed source (for chains without one shipped). CREATE2 via the
130
+ * keyless proxy + canonical salt → the SAME address on every chain (matches `DeploySeedSource.s.sol`
131
+ * and the manifest). The seed source is single-profile, so — unlike the SeriesCode factory — the
132
+ * SDK's bytecode is the canonical one. */
133
+ export declare function deploySeedSource(wallet: WalletClient, account: Account, publicClient: PublicClient): Promise<{
134
+ seedSource: Address;
135
+ txHash: Hex;
136
+ }>;
137
+ /**
138
+ * Deploy `AbxMetadataRenderer` — the canonical on-chain metadata renderer.
139
+ * Stateless and shared: deploy once per chain, then point any number of tokens at it via
140
+ * their URI-renderer config. It reads each token's on-chain fields and returns a
141
+ * `data:application/json` URI, so a token using it resolves with zero off-chain infra.
142
+ */
143
+ export declare function deployRenderer(wallet: WalletClient, account: Account, publicClient: PublicClient): Promise<DeployResult<'renderer'> & {
144
+ renderer: Address;
145
+ specVersion: bigint;
146
+ }>;
147
+ /**
148
+ * Deploy `AbxFixedPriceMinter` — the canonical, ownerless, multi-tenant fixed-price sale
149
+ * singleton (the Minter spine reference). Deploy once per chain; every project shares it
150
+ * (config is keyed by token address, authority defers to each token's owner). Sibling of
151
+ * `deployRenderer` — ownerless, no constructor args, safe for any funded signer to stand up.
152
+ */
153
+ export declare function deployFixedPriceMinter(wallet: WalletClient, account: Account, publicClient: PublicClient): Promise<DeployResult<'fixedPriceMinter'> & {
154
+ minter: Address;
155
+ }>;
156
+ /**
157
+ * The address `deployOneOfOne` will produce for this (factory, salt). It's a pure
158
+ * function of the salt — independent of who deploys — so it can be predicted and
159
+ * its URIs baked in before any signer is known. (Front-running is governed by the
160
+ * salt's guard prefix; see `saltFor` / `permissionlessSalt`.)
161
+ */
162
+ export declare function predictClone(publicClient: PublicClient, args: {
163
+ factory: Address;
164
+ salt: Hex;
165
+ }): Promise<Address>;
166
+ /**
167
+ * Deploy a 1/1 image NFT as an immutable EIP-1167 clone, at a deterministic
168
+ * address (so URIs can be baked in before deploy). Returns the clone address and
169
+ * the block it landed in — the indexer's start block.
170
+ */
171
+ export declare function deployOneOfOne(wallet: WalletClient, account: Account | Address, publicClient: PublicClient, args: {
172
+ factory: Address;
173
+ params: OneOfOneInitParams;
174
+ salt: Hex;
175
+ }): Promise<DeployResult<'clone'> & {
176
+ clone: Address;
177
+ }>;
178
+ /**
179
+ * Deploy a Series (multi-token) NFT as an immutable EIP-1167 clone, at a deterministic
180
+ * address. The sibling of `deployOneOfOne`. `predictClone` works unchanged — the
181
+ * `predictDeterministicAddress` fragment is identical across factories, and each factory
182
+ * computes with its own implementation. `params.mintCount`/`mintTo` decide the deploy-time
183
+ * mint; anything larger mints post-deploy under a gas budget.
184
+ */
185
+ export declare function deploySeries(wallet: WalletClient, account: Account | Address, publicClient: PublicClient, args: {
186
+ factory: Address;
187
+ params: SeriesInitParams;
188
+ salt: Hex;
189
+ }): Promise<DeployResult<'clone'> & {
190
+ clone: Address;
191
+ }>;
192
+ //# sourceMappingURL=deploy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../src/deploy.ts"],"names":[],"m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AED;;;;;GAKG;AACH,wBAAsB,YAAY,CAChC,YAAY,EAAE,YAAY,EAC1B,IAAI,EAAE;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,GAAG,CAAA;CAAC,GAClC,OAAO,CAAC,OAAO,CAAC,CAOlB;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,GAAG,OAAO,EAC1B,YAAY,EAAE,YAAY,EAC1B,IAAI,EAAE;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,kBAAkB,CAAC;IAAC,IAAI,EAAE,GAAG,CAAA;CAAC,GAC9D,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG;IAAC,KAAK,EAAE,OAAO,CAAA;CAAC,CAAC,CAcnD;AAED;;;;;;GAMG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,GAAG,OAAO,EAC1B,YAAY,EAAE,YAAY,EAC1B,IAAI,EAAE;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,gBAAgB,CAAC;IAAC,IAAI,EAAE,GAAG,CAAA;CAAC,GAC5D,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG;IAAC,KAAK,EAAE,OAAO,CAAA;CAAC,CAAC,CAcnD"}
package/dist/deploy.js ADDED
@@ -0,0 +1,231 @@
1
+ import { concat, getAddress, toHex, zeroAddress, keccak256, toBytes, } from 'viem';
2
+ import { oneOfOneImageFactoryAbi, oneOfOneImageFactoryBytecode, seriesImageFactoryAbi, seriesImageFactoryBytecode, abxMetadataRendererAbi, abxMetadataRendererBytecode, abxFixedPriceMinterBytecode, seriesCodeFactoryAbi, seriesCodeFactoryBytecode, abxSeedSourceBytecode, abxParamsLibBytecode, abxCodeLibBytecode, } from './abi/index.js';
3
+ import { ABX_SALT, CREATE2_PROXY, create2Calldata, predictCreate2Address } from './create2.js';
4
+ /** 12 bytes of entropy — the non-guard tail of a deterministic-deploy salt. */
5
+ function entropy12() {
6
+ return toHex(crypto.getRandomValues(new Uint8Array(12)));
7
+ }
8
+ /**
9
+ * A salt that reserves the deployed address to `deployer`. The factory's salt
10
+ * guard requires the leading 20 bytes to equal `msg.sender` when non-zero, so
11
+ * encoding the deployer there makes the address **front-run-proof**: nobody else
12
+ * can land their params on the address this salt predicts. The trailing 12 bytes
13
+ * are entropy (pass your own to mine a vanity suffix; random otherwise). Works for
14
+ * any account type — an EOA, an ERC-4337 smart account, or a Safe — since each is
15
+ * the `msg.sender` the factory checks.
16
+ */
17
+ export function saltFor(deployer, entropy = entropy12()) {
18
+ return concat([getAddress(deployer), entropy]); // 20 + 12 = 32 bytes
19
+ }
20
+ /**
21
+ * A permissionless salt: an all-zero guard prefix, so **anyone** may deploy to the
22
+ * address it predicts (a shared, canonical deployment). No front-run protection —
23
+ * use only when a publicly-deployable, caller-independent address is the point.
24
+ */
25
+ export function permissionlessSalt(entropy = entropy12()) {
26
+ return concat([zeroAddress, entropy]); // zero prefix + 12 bytes
27
+ }
28
+ /** The address a salt reserves the deploy to (`0x0` ⇒ permissionless). */
29
+ export function saltGuard(salt) {
30
+ return getAddress(`0x${salt.slice(2, 42)}`);
31
+ }
32
+ /**
33
+ * Deploy the canonical clone factory — the trust anchor. Ownerless and immutable;
34
+ * once deployed, its address is what platforms allowlist. Deploy this once per
35
+ * (chain, core version) and reuse it for every clone.
36
+ */
37
+ export async function deployFactory(wallet, account, publicClient) {
38
+ const txHash = await wallet.deployContract({
39
+ abi: oneOfOneImageFactoryAbi,
40
+ bytecode: oneOfOneImageFactoryBytecode,
41
+ account,
42
+ chain: wallet.chain,
43
+ args: [],
44
+ });
45
+ const receipt = await publicClient.waitForTransactionReceipt({ hash: txHash });
46
+ if (!receipt.contractAddress)
47
+ throw new Error('Factory deploy produced no contract address');
48
+ const factory = receipt.contractAddress;
49
+ const implementation = (await publicClient.readContract({
50
+ address: factory,
51
+ abi: oneOfOneImageFactoryAbi,
52
+ functionName: 'implementation',
53
+ }));
54
+ return { factory, implementation, txHash, blockNumber: receipt.blockNumber };
55
+ }
56
+ /**
57
+ * Deploy the canonical Series clone factory — the trust anchor for multi-token drops.
58
+ * Ownerless and immutable; the sibling of `deployFactory`. Deploy once per (chain, core
59
+ * version). The shared renderer + chunk store are reused (deploy them separately).
60
+ */
61
+ export async function deploySeriesFactory(wallet, account, publicClient) {
62
+ const txHash = await wallet.deployContract({
63
+ abi: seriesImageFactoryAbi,
64
+ bytecode: seriesImageFactoryBytecode,
65
+ account,
66
+ chain: wallet.chain,
67
+ args: [],
68
+ });
69
+ const receipt = await publicClient.waitForTransactionReceipt({ hash: txHash });
70
+ if (!receipt.contractAddress)
71
+ throw new Error('Series factory deploy produced no contract address');
72
+ const factory = receipt.contractAddress;
73
+ const implementation = (await publicClient.readContract({
74
+ address: factory,
75
+ abi: seriesImageFactoryAbi,
76
+ functionName: 'implementation',
77
+ }));
78
+ return { factory, implementation, txHash, blockNumber: receipt.blockNumber };
79
+ }
80
+ /** The solc link placeholder for a fully-qualified library name: `__$<keccak(fqn)[0:34]>$__`. */
81
+ function libPlaceholder(fullyQualified) {
82
+ return `__$${keccak256(toBytes(fullyQualified)).slice(2, 36)}$__`;
83
+ }
84
+ /**
85
+ * Deploy the code-project trust root on a chain with no canonical set: the two
86
+ * delegatecalled write-path libraries first ({AbxParamsLib}, {AbxCodeLib}), the factory
87
+ * bytecode LINKED against them (solc placeholders replaced — what forge does at build
88
+ * time, done here so a sandbox/fresh chain needs no forge), then the factory (whose
89
+ * constructor deploys the {SeriesCode} implementation).
90
+ */
91
+ export async function deploySeriesCodeFactory(wallet, account, publicClient) {
92
+ const deployRaw = async (bytecode) => {
93
+ const hash = await wallet.sendTransaction({ data: bytecode, account, chain: wallet.chain, to: null });
94
+ const receipt = await publicClient.waitForTransactionReceipt({ hash });
95
+ if (!receipt.contractAddress)
96
+ throw new Error('library deploy produced no contract address');
97
+ return { address: receipt.contractAddress, hash };
98
+ };
99
+ const { address: paramsLib } = await deployRaw(abxParamsLibBytecode);
100
+ const { address: codeLib } = await deployRaw(abxCodeLibBytecode);
101
+ const linked = seriesCodeFactoryBytecode
102
+ .split(libPlaceholder('src/libraries/AbxParamsLib.sol:AbxParamsLib'))
103
+ .join(paramsLib.slice(2).toLowerCase())
104
+ .split(libPlaceholder('src/libraries/AbxCodeLib.sol:AbxCodeLib'))
105
+ .join(codeLib.slice(2).toLowerCase());
106
+ if (linked.includes('__$'))
107
+ throw new Error('unlinked library placeholder remains in SeriesCodeFactory bytecode');
108
+ const txHash = await wallet.deployContract({ abi: seriesCodeFactoryAbi, bytecode: linked, account, chain: wallet.chain, args: [] });
109
+ const receipt = await publicClient.waitForTransactionReceipt({ hash: txHash });
110
+ if (!receipt.contractAddress)
111
+ throw new Error('SeriesCodeFactory deploy produced no contract address');
112
+ const factory = receipt.contractAddress;
113
+ const implementation = (await publicClient.readContract({
114
+ address: factory,
115
+ abi: seriesCodeFactoryAbi,
116
+ functionName: 'implementation',
117
+ }));
118
+ return { factory, implementation, paramsLib, codeLib, txHash, blockNumber: receipt.blockNumber };
119
+ }
120
+ /** Deploy the canonical pseudorandom seed source (for chains without one shipped). CREATE2 via the
121
+ * keyless proxy + canonical salt → the SAME address on every chain (matches `DeploySeedSource.s.sol`
122
+ * and the manifest). The seed source is single-profile, so — unlike the SeriesCode factory — the
123
+ * SDK's bytecode is the canonical one. */
124
+ export async function deploySeedSource(wallet, account, publicClient) {
125
+ const seedSource = predictCreate2Address(ABX_SALT.seedSource, abxSeedSourceBytecode);
126
+ const txHash = await wallet.sendTransaction({
127
+ account,
128
+ chain: wallet.chain,
129
+ to: CREATE2_PROXY,
130
+ data: create2Calldata(ABX_SALT.seedSource, abxSeedSourceBytecode),
131
+ });
132
+ await publicClient.waitForTransactionReceipt({ hash: txHash });
133
+ return { seedSource, txHash };
134
+ }
135
+ /**
136
+ * Deploy `AbxMetadataRenderer` — the canonical on-chain metadata renderer.
137
+ * Stateless and shared: deploy once per chain, then point any number of tokens at it via
138
+ * their URI-renderer config. It reads each token's on-chain fields and returns a
139
+ * `data:application/json` URI, so a token using it resolves with zero off-chain infra.
140
+ */
141
+ export async function deployRenderer(wallet, account, publicClient) {
142
+ // CREATE2 via the keyless proxy + canonical salt → the SAME address on every chain (matches the
143
+ // forge `DeployRenderer` script and the manifest). Address is deterministic, so compute it (the
144
+ // tx targets the proxy, not a contract creation, so `receipt.contractAddress` is null).
145
+ const renderer = predictCreate2Address(ABX_SALT.renderer, abxMetadataRendererBytecode);
146
+ const txHash = await wallet.sendTransaction({
147
+ account,
148
+ chain: wallet.chain,
149
+ to: CREATE2_PROXY,
150
+ data: create2Calldata(ABX_SALT.renderer, abxMetadataRendererBytecode),
151
+ });
152
+ const receipt = await publicClient.waitForTransactionReceipt({ hash: txHash });
153
+ const specVersion = (await publicClient.readContract({
154
+ address: renderer,
155
+ abi: abxMetadataRendererAbi,
156
+ functionName: 'specVersion',
157
+ }));
158
+ return { renderer, specVersion, txHash, blockNumber: receipt.blockNumber };
159
+ }
160
+ /**
161
+ * Deploy `AbxFixedPriceMinter` — the canonical, ownerless, multi-tenant fixed-price sale
162
+ * singleton (the Minter spine reference). Deploy once per chain; every project shares it
163
+ * (config is keyed by token address, authority defers to each token's owner). Sibling of
164
+ * `deployRenderer` — ownerless, no constructor args, safe for any funded signer to stand up.
165
+ */
166
+ export async function deployFixedPriceMinter(wallet, account, publicClient) {
167
+ // CREATE2 via the keyless proxy + canonical salt → the SAME address on every chain (matches the
168
+ // forge `DeployMinter` script and the manifest). Address is deterministic, so compute it.
169
+ const minter = predictCreate2Address(ABX_SALT.fixedPriceMinter, abxFixedPriceMinterBytecode);
170
+ const txHash = await wallet.sendTransaction({
171
+ account,
172
+ chain: wallet.chain,
173
+ to: CREATE2_PROXY,
174
+ data: create2Calldata(ABX_SALT.fixedPriceMinter, abxFixedPriceMinterBytecode),
175
+ });
176
+ const receipt = await publicClient.waitForTransactionReceipt({ hash: txHash });
177
+ return { minter, txHash, blockNumber: receipt.blockNumber };
178
+ }
179
+ /**
180
+ * The address `deployOneOfOne` will produce for this (factory, salt). It's a pure
181
+ * function of the salt — independent of who deploys — so it can be predicted and
182
+ * its URIs baked in before any signer is known. (Front-running is governed by the
183
+ * salt's guard prefix; see `saltFor` / `permissionlessSalt`.)
184
+ */
185
+ export async function predictClone(publicClient, args) {
186
+ return (await publicClient.readContract({
187
+ address: args.factory,
188
+ abi: oneOfOneImageFactoryAbi,
189
+ functionName: 'predictDeterministicAddress',
190
+ args: [args.salt],
191
+ }));
192
+ }
193
+ /**
194
+ * Deploy a 1/1 image NFT as an immutable EIP-1167 clone, at a deterministic
195
+ * address (so URIs can be baked in before deploy). Returns the clone address and
196
+ * the block it landed in — the indexer's start block.
197
+ */
198
+ export async function deployOneOfOne(wallet, account, publicClient, args) {
199
+ const clone = await predictClone(publicClient, { factory: args.factory, salt: args.salt });
200
+ const { request } = await publicClient.simulateContract({
201
+ address: args.factory,
202
+ abi: oneOfOneImageFactoryAbi,
203
+ functionName: 'deployDeterministic',
204
+ args: [args.params, args.salt],
205
+ account,
206
+ });
207
+ const txHash = await wallet.writeContract(request);
208
+ const receipt = await publicClient.waitForTransactionReceipt({ hash: txHash });
209
+ return { clone, txHash, blockNumber: receipt.blockNumber };
210
+ }
211
+ /**
212
+ * Deploy a Series (multi-token) NFT as an immutable EIP-1167 clone, at a deterministic
213
+ * address. The sibling of `deployOneOfOne`. `predictClone` works unchanged — the
214
+ * `predictDeterministicAddress` fragment is identical across factories, and each factory
215
+ * computes with its own implementation. `params.mintCount`/`mintTo` decide the deploy-time
216
+ * mint; anything larger mints post-deploy under a gas budget.
217
+ */
218
+ export async function deploySeries(wallet, account, publicClient, args) {
219
+ const clone = await predictClone(publicClient, { factory: args.factory, salt: args.salt });
220
+ const { request } = await publicClient.simulateContract({
221
+ address: args.factory,
222
+ abi: seriesImageFactoryAbi,
223
+ functionName: 'deployDeterministic',
224
+ args: [args.params, args.salt],
225
+ account,
226
+ });
227
+ const txHash = await wallet.writeContract(request);
228
+ const receipt = await publicClient.waitForTransactionReceipt({ hash: txHash });
229
+ return { clone, txHash, blockNumber: receipt.blockNumber };
230
+ }
231
+ //# sourceMappingURL=deploy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploy.js","sourceRoot":"","sources":["../src/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,UAAU,EACV,KAAK,EACL,WAAW,EAMX,SAAS,EACT,OAAO,GACR,MAAM,MAAM,CAAC;AACd,OAAO,EACL,uBAAuB,EACvB,4BAA4B,EAC5B,qBAAqB,EACrB,0BAA0B,EAC1B,sBAAsB,EACtB,2BAA2B,EAE3B,2BAA2B,EAC3B,oBAAoB,EACpB,yBAAyB,EACzB,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAC,QAAQ,EAAE,aAAa,EAAE,eAAe,EAAE,qBAAqB,EAAC,MAAM,cAAc,CAAC;AAoF7F,+EAA+E;AAC/E,SAAS,SAAS;IAChB,OAAO,KAAK,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,OAAO,CAAC,QAAiB,EAAE,UAAe,SAAS,EAAE;IACnE,OAAO,MAAM,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,qBAAqB;AACvE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,UAAe,SAAS,EAAE;IAC3D,OAAO,MAAM,CAAC,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,yBAAyB;AAClE,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,SAAS,CAAC,IAAS;IACjC,OAAO,UAAU,CAAC,KAAK,IAAI,CAAC,K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