@artblocks/abx-sdk 0.1.0-alpha.2 → 0.1.0-alpha.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2203 -0
- package/README.md +131 -0
- package/dist/abi/generated.d.ts +8502 -129
- package/dist/abi/generated.d.ts.map +1 -1
- package/dist/abi/generated.js +40 -22
- package/dist/abi/generated.js.map +1 -1
- package/dist/abi/index.d.ts +2645 -168
- package/dist/abi/index.d.ts.map +1 -1
- package/dist/abi/index.js +34 -7
- package/dist/abi/index.js.map +1 -1
- package/dist/anchors.d.ts +319 -0
- package/dist/anchors.d.ts.map +1 -0
- package/dist/anchors.js +703 -0
- package/dist/anchors.js.map +1 -0
- package/dist/chains.d.ts +15 -9
- package/dist/chains.d.ts.map +1 -1
- package/dist/chains.js +19 -15
- package/dist/chains.js.map +1 -1
- package/dist/chunks.d.ts +53 -23
- package/dist/chunks.d.ts.map +1 -1
- package/dist/chunks.js +68 -6
- package/dist/chunks.js.map +1 -1
- package/dist/clients.d.ts +23 -11
- package/dist/clients.d.ts.map +1 -1
- package/dist/clients.js +17 -18
- package/dist/clients.js.map +1 -1
- package/dist/create2.d.ts +85 -1
- package/dist/create2.d.ts.map +1 -1
- package/dist/create2.js +159 -2
- package/dist/create2.js.map +1 -1
- package/dist/creator-token.d.ts +132 -0
- package/dist/creator-token.d.ts.map +1 -0
- package/dist/creator-token.js +183 -0
- package/dist/creator-token.js.map +1 -0
- package/dist/deploy.d.ts +234 -14
- package/dist/deploy.d.ts.map +1 -1
- package/dist/deploy.js +289 -111
- package/dist/deploy.js.map +1 -1
- package/dist/deployments.d.ts +63 -0
- package/dist/deployments.d.ts.map +1 -1
- package/dist/deployments.js +202 -28
- package/dist/deployments.js.map +1 -1
- package/dist/deps.d.ts +122 -5
- package/dist/deps.d.ts.map +1 -1
- package/dist/deps.js +248 -6
- package/dist/deps.js.map +1 -1
- package/dist/env.d.ts.map +1 -1
- package/dist/env.js +8 -0
- package/dist/env.js.map +1 -1
- package/dist/errors.d.ts +94 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +126 -0
- package/dist/errors.js.map +1 -0
- package/dist/execute.d.ts +115 -0
- package/dist/execute.d.ts.map +1 -0
- package/dist/execute.js +142 -0
- package/dist/execute.js.map +1 -0
- package/dist/gateways.d.ts +79 -0
- package/dist/gateways.d.ts.map +1 -0
- package/dist/gateways.js +156 -0
- package/dist/gateways.js.map +1 -0
- package/dist/generator-document.d.ts +58 -0
- package/dist/generator-document.d.ts.map +1 -0
- package/dist/generator-document.js +124 -0
- package/dist/generator-document.js.map +1 -0
- 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/index.d.ts +18 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -3
- package/dist/index.js.map +1 -1
- package/dist/inspect.d.ts +48 -0
- package/dist/inspect.d.ts.map +1 -0
- package/dist/inspect.js +295 -0
- package/dist/inspect.js.map +1 -0
- package/dist/migrate.d.ts +41 -0
- package/dist/migrate.d.ts.map +1 -0
- package/dist/migrate.js +142 -0
- package/dist/migrate.js.map +1 -0
- package/dist/mime.d.ts +11 -0
- package/dist/mime.d.ts.map +1 -0
- package/dist/mime.js +40 -0
- package/dist/mime.js.map +1 -0
- package/dist/node.d.ts +10 -0
- package/dist/node.d.ts.map +1 -0
- package/dist/node.js +24 -0
- package/dist/node.js.map +1 -0
- package/dist/onchain-uri.d.ts +110 -0
- package/dist/onchain-uri.d.ts.map +1 -0
- package/dist/onchain-uri.js +277 -0
- package/dist/onchain-uri.js.map +1 -0
- package/dist/ops.d.ts +507 -14
- package/dist/ops.d.ts.map +1 -1
- package/dist/ops.js +848 -32
- package/dist/ops.js.map +1 -1
- package/dist/policy.d.ts +58 -0
- package/dist/policy.d.ts.map +1 -0
- package/dist/policy.js +36 -0
- package/dist/policy.js.map +1 -0
- package/dist/probe.d.ts +29 -0
- package/dist/probe.d.ts.map +1 -1
- package/dist/probe.js +104 -9
- package/dist/probe.js.map +1 -1
- package/dist/reconstruct.d.ts +94 -2
- package/dist/reconstruct.d.ts.map +1 -1
- package/dist/reconstruct.js +432 -97
- package/dist/reconstruct.js.map +1 -1
- package/dist/resume.d.ts +96 -0
- package/dist/resume.d.ts.map +1 -0
- package/dist/resume.js +95 -0
- package/dist/resume.js.map +1 -0
- package/dist/script-chunks.d.ts +24 -0
- package/dist/script-chunks.d.ts.map +1 -0
- package/dist/script-chunks.js +63 -0
- package/dist/script-chunks.js.map +1 -0
- package/dist/service.d.ts +206 -9
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +228 -18
- package/dist/service.js.map +1 -1
- package/dist/spine.d.ts +47 -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 +124 -0
- package/dist/staging.d.ts.map +1 -0
- package/dist/staging.js +134 -0
- package/dist/staging.js.map +1 -0
- package/dist/tokendata.d.ts +62 -2
- package/dist/tokendata.d.ts.map +1 -1
- package/dist/tokendata.js +79 -17
- package/dist/tokendata.js.map +1 -1
- package/dist/tokens.d.ts +120 -0
- package/dist/tokens.d.ts.map +1 -0
- package/dist/tokens.js +317 -0
- package/dist/tokens.js.map +1 -0
- package/dist/types.d.ts +108 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/util.d.ts +74 -0
- package/dist/util.d.ts.map +1 -0
- package/dist/util.js +106 -0
- package/dist/util.js.map +1 -0
- package/package.json +11 -2
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ERC-721C creator-token support — the opt-in transfer-validation surface.
|
|
3
|
+
*
|
|
4
|
+
* An ABX token enrolls at deploy, permanently, by passing a non-zero `transferValidator` in
|
|
5
|
+
* its InitParams (see `deploy.ts`); zero leaves a plain ERC-721 forever, indistinguishable
|
|
6
|
+
* from a pre-721C token (ERC-165 and the extension beacon both branch on enrollment). Within
|
|
7
|
+
* an enrolled token the owner re-points the validator freely or suspends enforcement with
|
|
8
|
+
* zero — never un-enrolls. Every transfer that isn't a mint/burn (or the validator's own)
|
|
9
|
+
* staticcalls `validateTransfer(caller, from, to, tokenId)` on the validator; a policy
|
|
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}.
|
|
20
|
+
*/
|
|
21
|
+
import { encodeFunctionData, zeroAddress } from 'viem';
|
|
22
|
+
import { oneOfOneImageAbi } from './abi/index.js';
|
|
23
|
+
/** ERC-165 id of `ICreatorToken` — advertised (with the legacy id) only when enrolled. */
|
|
24
|
+
export const CREATOR_TOKEN_INTERFACE_ID = '0xad0d7f6c';
|
|
25
|
+
/** ERC-165 id of `ICreatorTokenLegacy` — the subset older marketplaces probe for. */
|
|
26
|
+
export const CREATOR_TOKEN_LEGACY_INTERFACE_ID = '0xa07d229a';
|
|
27
|
+
/** keccak256("abx.extension.creator-token") — `extensionVersion(id)` is 1 only when enrolled. */
|
|
28
|
+
export const CREATOR_TOKEN_EXTENSION_ID = '0x0839e7ed7fc1f5db3f253851d61b10f852045c5520c2936138b121b73e7e27c0';
|
|
29
|
+
/**
|
|
30
|
+
* The recommended transfer validator per chain — OpenSea's
|
|
31
|
+
* **StrictAuthorizedTransferSecurityRegistry**, the validator their creator-fee-enforcement
|
|
32
|
+
* doc recommends for enforcement eligibility (docs.opensea.io "Creator Fee Enforcement",
|
|
33
|
+
* checked 2026-08; the named alternative is Limit Break's CreatorTokenTransferValidator
|
|
34
|
+
* 0x721C0078c2328597Ca70F5451ffF5A7B38D4E947). Verified empirically against the LIVE
|
|
35
|
+
* contracts on 2026-08-04 (`cast call --from <collection>` on the 4-arg
|
|
36
|
+
* `validateTransfer(address,address,address,uint256)` overload, both chains):
|
|
37
|
+
* an owner-initiated (OTC) transfer succeeds; an unauthorized operator reverts
|
|
38
|
+
* `StrictAuthorizedTransferSecurityRegistry__UnauthorizedTransfer()`.
|
|
39
|
+
*
|
|
40
|
+
* CREATE2-style vanity address, identical on both shipped chains — kept per-chain anyway
|
|
41
|
+
* (keyed like `deployments.ts`) because presence-on-chain is the fact that matters, and a
|
|
42
|
+
* future chain may recommend a different validator.
|
|
43
|
+
*/
|
|
44
|
+
export const RECOMMENDED_TRANSFER_VALIDATOR = {
|
|
45
|
+
// Sepolia (testnet)
|
|
46
|
+
11155111: '0xA000027A9B2802E1ddf7000061001e5c005A0000',
|
|
47
|
+
// Base Sepolia (testnet)
|
|
48
|
+
84532: '0xA000027A9B2802E1ddf7000061001e5c005A0000',
|
|
49
|
+
};
|
|
50
|
+
/** The recommended validator for a chain (undefined if none is known — never guess one). */
|
|
51
|
+
export function resolveRecommendedTransferValidator(chainId) {
|
|
52
|
+
return RECOMMENDED_TRANSFER_VALIDATOR[chainId];
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Read whether `contract` is an enrolled ERC-721C creator token, and its active validator.
|
|
56
|
+
* Enrollment comes from ERC-165 (`ICreatorToken`, which the token advertises only when
|
|
57
|
+
* enrolled); the validator from `getTransferValidator()`. Both reads are defensive — a
|
|
58
|
+
* pre-721C ABX token has neither branch (no `getTransferValidator` selector at all), and
|
|
59
|
+
* must read as `{enrolled: false, validator: zeroAddress}`, not as an error.
|
|
60
|
+
*/
|
|
61
|
+
export async function readCreatorTokenStatus(client, contract) {
|
|
62
|
+
const [enrolled, validator] = await Promise.all([
|
|
63
|
+
client
|
|
64
|
+
.readContract({
|
|
65
|
+
address: contract,
|
|
66
|
+
abi: oneOfOneImageAbi,
|
|
67
|
+
functionName: 'supportsInterface',
|
|
68
|
+
args: [CREATOR_TOKEN_INTERFACE_ID],
|
|
69
|
+
})
|
|
70
|
+
.catch(() => false),
|
|
71
|
+
client
|
|
72
|
+
.readContract({ address: contract, abi: oneOfOneImageAbi, functionName: 'getTransferValidator' })
|
|
73
|
+
.catch(() => zeroAddress),
|
|
74
|
+
]);
|
|
75
|
+
return { enrolled, validator };
|
|
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
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Re-point an enrolled token's transfer validator, or suspend enforcement with
|
|
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.
|
|
164
|
+
*/
|
|
165
|
+
export function prepareSetTransferValidator(args) {
|
|
166
|
+
const suspending = args.validator === zeroAddress;
|
|
167
|
+
return {
|
|
168
|
+
op: 'set-transfer-validator',
|
|
169
|
+
to: args.contract,
|
|
170
|
+
data: encodeFunctionData({
|
|
171
|
+
abi: oneOfOneImageAbi,
|
|
172
|
+
functionName: 'setTransferValidator',
|
|
173
|
+
args: [args.validator],
|
|
174
|
+
}),
|
|
175
|
+
value: '0x0',
|
|
176
|
+
chainId: args.chainId,
|
|
177
|
+
summary: suspending
|
|
178
|
+
? 'Suspend ERC-721C transfer enforcement (validator → 0x0; the token stays enrolled)'
|
|
179
|
+
: `Set ERC-721C transfer validator → ${args.validator}`,
|
|
180
|
+
fields: { contract: args.contract, validator: args.validator },
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
//# sourceMappingURL=creator-token.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"creator-token.js","sourceRoot":"","sources":["../src/creator-token.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAC,kBAAkB,EAAE,WAAW,EAA4C,MAAM,MAAM,CAAC;AAChG,OAAO,EAAC,gBAAgB,EAAC,MAAM,gBAAgB,CAAC;AAGhD,0FAA0F;AAC1F,MAAM,CAAC,MAAM,0BAA0B,GAAG,YAAqB,CAAC;AAChE,qFAAqF;AACrF,MAAM,CAAC,MAAM,iCAAiC,GAAG,YAAqB,CAAC;AACvE,iGAAiG;AACjG,MAAM,CAAC,MAAM,0BAA0B,GACrC,oEAA6E,CAAC;AAEhF;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAA4B;IACrE,oBAAoB;IACpB,QAAQ,EAAE,4CAA4C;IACtD,yBAAyB;IACzB,KAAK,EAAE,4CAA4C;CACpD,CAAC;AAEF,4FAA4F;AAC5F,MAAM,UAAU,mCAAmC,CAAC,OAAe;IACjE,OAAO,8BAA8B,CAAC,OAAO,CAAC,CAAC;AACjD,CAAC;AAUD;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAs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AAC,IAI3C;IACC,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,KAAK,WAAW,CAAC;IAClD,OAAO;QACL,EAAE,EAAE,wBAAwB;QAC5B,EAAE,EAAE,IAAI,CAAC,QAAQ;QACjB,IAAI,EAAE,kBAAkB,CAAC;YACvB,GAAG,EAAE,gBAAgB;YACrB,YAAY,EAAE,sBAAsB;YACpC,IAAI,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC;SACvB,CAAC;QACF,KAAK,EAAE,KAAK;QACZ,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,OAAO,EAAE,UAAU;YACjB,CAAC,CAAC,mFAAmF;YACrF,CAAC,CAAC,qCAAqC,IAAI,CAAC,SAAS,EAAE;QACzD,MAAM,EAAE,EAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAC;KAC7D,CAAC;AACJ,CAAC"}
|
package/dist/deploy.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type Address, type Hex, type PublicClient } from 'viem';
|
|
2
|
+
import type { SendTx } from './execute.js';
|
|
2
3
|
/** One on-chain metadata field to set at deploy (bytes32 `field`/`representation`, bytes `value`). */
|
|
3
4
|
export interface OnChainFieldInput {
|
|
4
5
|
field: Hex;
|
|
@@ -23,6 +24,18 @@ export interface OneOfOneInitParams {
|
|
|
23
24
|
contractURIRenderer: Address;
|
|
24
25
|
royaltyReceiver: Address;
|
|
25
26
|
royaltyBps: number;
|
|
27
|
+
/** Royalty ceiling in basis points (0–10000, up to 100%). Owner-set at deploy and reduce-only
|
|
28
|
+
* after (`reduceMaxRoyaltyBps`); the initial `royaltyBps` must be <= this. Tooling defaults it
|
|
29
|
+
* to 1000 (10%). A monotonic-down cap is a buyer-readable "royalty can never exceed X" guarantee. */
|
|
30
|
+
maxRoyaltyBps: number;
|
|
31
|
+
/** Opt-in burn (default `false`). `true` lets holders (or approved operators) burn their token via
|
|
32
|
+
* `burn(...)`; `false` means the token can never be destroyed, by anyone. Fixed at deploy. */
|
|
33
|
+
burnable: boolean;
|
|
34
|
+
/** `zeroAddress` = plain ERC-721 (the default — no trace of 721C, ever); non-zero = permanent
|
|
35
|
+
* ERC-721C enrollment with that transfer validator (must have code on-chain, else the deploy
|
|
36
|
+
* reverts `InvalidTransferValidator()`). Enrollment is deploy-time-only and irreversible —
|
|
37
|
+
* the owner can later re-point or suspend (zero) the validator, never un-enroll. */
|
|
38
|
+
transferValidator: Address;
|
|
26
39
|
/** Optional on-chain metadata fields for token 0 and for the collection. */
|
|
27
40
|
tokenFields: OnChainFieldInput[];
|
|
28
41
|
contractFields: OnChainFieldInput[];
|
|
@@ -47,6 +60,18 @@ export interface SeriesInitParams {
|
|
|
47
60
|
contractURIRenderer: Address;
|
|
48
61
|
royaltyReceiver: Address;
|
|
49
62
|
royaltyBps: number;
|
|
63
|
+
/** Royalty ceiling in basis points (0–10000, up to 100%). Owner-set at deploy and reduce-only
|
|
64
|
+
* after (`reduceMaxRoyaltyBps`); the initial `royaltyBps` must be <= this. Tooling defaults it
|
|
65
|
+
* to 1000 (10%). A monotonic-down cap is a buyer-readable "royalty can never exceed X" guarantee. */
|
|
66
|
+
maxRoyaltyBps: number;
|
|
67
|
+
/** Opt-in burn (default `false`). `true` lets holders (or approved operators) burn their token via
|
|
68
|
+
* `burn(...)`; `false` means the token can never be destroyed, by anyone. Fixed at deploy. */
|
|
69
|
+
burnable: boolean;
|
|
70
|
+
/** `zeroAddress` = plain ERC-721 (the default — no trace of 721C, ever); non-zero = permanent
|
|
71
|
+
* ERC-721C enrollment with that transfer validator (must have code on-chain, else the deploy
|
|
72
|
+
* reverts `InvalidTransferValidator()`). Enrollment is deploy-time-only and irreversible —
|
|
73
|
+
* the owner can later re-point or suspend (zero) the validator, never un-enroll. */
|
|
74
|
+
transferValidator: Address;
|
|
50
75
|
/** Series size N (> 0): the supply cap. Monotonically non-increasing after deploy. */
|
|
51
76
|
maxInvocations: bigint | number;
|
|
52
77
|
/** Primary-sale payout destination (`0x0` = none). */
|
|
@@ -71,6 +96,97 @@ export interface SeriesCodeInitParams extends SeriesInitParams {
|
|
|
71
96
|
/** Opt out of delegate.xyz on the TokenOwner auth leg (default false = canonical registry). */
|
|
72
97
|
disableTokenOwnerDelegation: boolean;
|
|
73
98
|
}
|
|
99
|
+
/** One per-token on-chain metadata field to set at deploy, keyed by `tokenId` — the edition twin
|
|
100
|
+
* of {@link SeriesTokenFieldInput} (identical shape; ABX's `OnChainMetadata.TokenFieldInput` has
|
|
101
|
+
* no standard-specific fields). Reused directly rather than duplicated. */
|
|
102
|
+
export type EditionTokenFieldInput = SeriesTokenFieldInput;
|
|
103
|
+
/** Mirrors `OneOfOneEdition.InitParams` — copies of a single work, id space fixed to `{0}`. */
|
|
104
|
+
export interface OneOfOneEditionInitParams {
|
|
105
|
+
owner: Address;
|
|
106
|
+
/** Recipient of the deploy-time mint (`0x0` or `mintAmount: 0` ⇒ defer all minting). */
|
|
107
|
+
mintTo: Address;
|
|
108
|
+
/** Copies of id 0 to mint to `mintTo` at deploy (`0` ⇒ none). */
|
|
109
|
+
mintAmount: bigint | number;
|
|
110
|
+
name: string;
|
|
111
|
+
symbol: string;
|
|
112
|
+
/** Off-chain resolver base for `uri(id)`; the pointer is derived on-chain as
|
|
113
|
+
* `{base}/{chainId}/{address}/{id}`. */
|
|
114
|
+
tokenURIBase: string;
|
|
115
|
+
/** On-chain renderer for `uri(id)`; `0x0` ⇒ resolve off-chain via the base. */
|
|
116
|
+
tokenURIRenderer: Address;
|
|
117
|
+
contractURIBase: string;
|
|
118
|
+
contractURIRenderer: Address;
|
|
119
|
+
royaltyReceiver: Address;
|
|
120
|
+
royaltyBps: number;
|
|
121
|
+
/** Royalty ceiling in basis points (0–10000, up to 100%). Owner-set at deploy and reduce-only
|
|
122
|
+
* after (`reduceMaxRoyaltyBps`); the initial `royaltyBps` must be <= this. Tooling defaults it
|
|
123
|
+
* to 1000 (10%). A monotonic-down cap is a buyer-readable "royalty can never exceed X" guarantee. */
|
|
124
|
+
maxRoyaltyBps: number;
|
|
125
|
+
/** Opt-in burn (default `false`). `true` lets holders (or approved operators) burn their token via
|
|
126
|
+
* `burn(...)`; `false` means the token can never be destroyed, by anyone. Fixed at deploy. */
|
|
127
|
+
burnable: boolean;
|
|
128
|
+
/** `zeroAddress` = a plain ERC-1155 forever (the default). Non-zero = permanent ERC-1155C
|
|
129
|
+
* enrollment with that transfer validator (must have code on-chain). */
|
|
130
|
+
transferValidator: Address;
|
|
131
|
+
/** The default supply cap for id 0 (`0` = open edition, uncapped). */
|
|
132
|
+
editionSize: bigint | number;
|
|
133
|
+
/** Primary-sale payout destination (`0x0` = none). */
|
|
134
|
+
primaryPayee: Address;
|
|
135
|
+
/** Initial authorized minter — a single address (`0x0` = owner-only). */
|
|
136
|
+
minter: Address;
|
|
137
|
+
/** Initial mint-pause state — `true` restricts minting to the owner until unpaused (deploy-time
|
|
138
|
+
* reserves still mint). */
|
|
139
|
+
paused: boolean;
|
|
140
|
+
/** Optional on-chain metadata fields for id 0 (each field → one representation). */
|
|
141
|
+
tokenFields: OnChainFieldInput[];
|
|
142
|
+
contractFields: OnChainFieldInput[];
|
|
143
|
+
}
|
|
144
|
+
/** Mirrors `EditionImage.InitParams` — copies of many distinct works (N ids × copies each). */
|
|
145
|
+
export interface EditionImageInitParams {
|
|
146
|
+
owner: Address;
|
|
147
|
+
name: string;
|
|
148
|
+
symbol: string;
|
|
149
|
+
tokenURIBase: string;
|
|
150
|
+
tokenURIRenderer: Address;
|
|
151
|
+
contractURIBase: string;
|
|
152
|
+
contractURIRenderer: Address;
|
|
153
|
+
royaltyReceiver: Address;
|
|
154
|
+
royaltyBps: number;
|
|
155
|
+
/** Royalty ceiling in basis points (0–10000, up to 100%). Owner-set at deploy and reduce-only
|
|
156
|
+
* after (`reduceMaxRoyaltyBps`); the initial `royaltyBps` must be <= this. Tooling defaults it
|
|
157
|
+
* to 1000 (10%). A monotonic-down cap is a buyer-readable "royalty can never exceed X" guarantee. */
|
|
158
|
+
maxRoyaltyBps: number;
|
|
159
|
+
/** Opt-in burn (default `false`). `true` lets holders (or approved operators) burn their token via
|
|
160
|
+
* `burn(...)`; `false` means the token can never be destroyed, by anyone. Fixed at deploy. */
|
|
161
|
+
burnable: boolean;
|
|
162
|
+
transferValidator: Address;
|
|
163
|
+
/** The id-space cap N (> 0): the number of distinct works this project may ever have.
|
|
164
|
+
* Monotonically non-increasing (floor = the id high-water mark, NOT `totalSupply()` — ids are
|
|
165
|
+
* caller-named, not sequential). */
|
|
166
|
+
maxInvocations: bigint | number;
|
|
167
|
+
/** The default per-id copy cap for EVERY id (`0` = open edition, uncapped). */
|
|
168
|
+
editionSize: bigint | number;
|
|
169
|
+
primaryPayee: Address;
|
|
170
|
+
minter: Address;
|
|
171
|
+
paused: boolean;
|
|
172
|
+
/** Recipient for the deploy-time mint (`0x0` ⇒ defer all minting). */
|
|
173
|
+
mintTo: Address;
|
|
174
|
+
/** Distinct works to mint at deploy, ids `[0, mintCount)`; `<= maxInvocations`. */
|
|
175
|
+
mintCount: bigint | number;
|
|
176
|
+
/** Copies of EACH deploy-minted id (must be `> 0` if `mintCount > 0`). */
|
|
177
|
+
mintAmount: bigint | number;
|
|
178
|
+
/** Optional per-token on-chain metadata fields, keyed by id. */
|
|
179
|
+
tokenFields: EditionTokenFieldInput[];
|
|
180
|
+
contractFields: OnChainFieldInput[];
|
|
181
|
+
}
|
|
182
|
+
/** {@link EditionImageInitParams} plus the code-project extension config ({EditionCode.InitParams}).
|
|
183
|
+
* NOTE: unlike {@link SeriesCodeInitParams}, there is no `disableTokenOwnerDelegation` — editions
|
|
184
|
+
* have no TokenOwner-leg delegation to opt out of (see `ConfigurableParams`'s edition init path;
|
|
185
|
+
* the auth leg generalizes to "any holder" instead — `balanceOf(sender, id) > 0`). */
|
|
186
|
+
export interface EditionCodeInitParams extends EditionImageInitParams {
|
|
187
|
+
/** IAbxSeedSource the token calls at each id's FIRST mint (`0x0` = no mint-time seed). */
|
|
188
|
+
seedSource: Address;
|
|
189
|
+
}
|
|
74
190
|
export interface DeployResult<T extends string> {
|
|
75
191
|
txHash: Hex;
|
|
76
192
|
blockNumber: bigint;
|
|
@@ -89,6 +205,11 @@ export declare function saltFor(deployer: Address, entropy?: Hex): Hex;
|
|
|
89
205
|
* A permissionless salt: an all-zero guard prefix, so **anyone** may deploy to the
|
|
90
206
|
* address it predicts (a shared, canonical deployment). No front-run protection —
|
|
91
207
|
* use only when a publicly-deployable, caller-independent address is the point.
|
|
208
|
+
*
|
|
209
|
+
* **Never use this for a pre-published or pre-funded address.** If you predict an address with
|
|
210
|
+
* this salt and share it (or send value to it) before deploying, a third party can occupy that
|
|
211
|
+
* exact address first with their own `InitParams` (their owner, their URIs). For any address a
|
|
212
|
+
* creator reserves, use {@link saltFor} — its deployer-bound prefix is front-run-proof.
|
|
92
213
|
*/
|
|
93
214
|
export declare function permissionlessSalt(entropy?: Hex): Hex;
|
|
94
215
|
/** The address a salt reserves the deploy to (`0x0` ⇒ permissionless). */
|
|
@@ -98,29 +219,40 @@ export declare function saltGuard(salt: Hex): Address;
|
|
|
98
219
|
* once deployed, its address is what platforms allowlist. Deploy this once per
|
|
99
220
|
* (chain, core version) and reuse it for every clone.
|
|
100
221
|
*/
|
|
101
|
-
export declare function deployFactory(
|
|
222
|
+
export declare function deployFactory(send: SendTx, publicClient: PublicClient): Promise<DeployResult<'factory'> & {
|
|
102
223
|
factory: Address;
|
|
103
224
|
implementation: Address;
|
|
225
|
+
metadataLib: Address;
|
|
104
226
|
}>;
|
|
105
227
|
/**
|
|
106
228
|
* Deploy the canonical Series clone factory — the trust anchor for multi-token drops.
|
|
107
229
|
* Ownerless and immutable; the sibling of `deployFactory`. Deploy once per (chain, core
|
|
108
230
|
* version). The shared renderer + chunk store are reused (deploy them separately).
|
|
109
231
|
*/
|
|
110
|
-
export declare function deploySeriesFactory(
|
|
232
|
+
export declare function deploySeriesFactory(send: SendTx, publicClient: PublicClient): Promise<DeployResult<'seriesFactory'> & {
|
|
111
233
|
factory: Address;
|
|
112
234
|
implementation: Address;
|
|
235
|
+
metadataLib: Address;
|
|
113
236
|
}>;
|
|
114
237
|
/**
|
|
115
|
-
* Deploy the code-project trust root on a chain with no canonical set: the two
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
238
|
+
* Deploy the code-project trust root on a chain with no canonical set: the two delegatecalled
|
|
239
|
+
* write-path libraries first ({AbxParamsLib}, {AbxCodeLib}), the factory bytecode LINKED against
|
|
240
|
+
* them (solc placeholders replaced — what forge does at build time, done here so a sandbox/fresh
|
|
241
|
+
* chain needs no forge), then the factory (whose constructor deploys the {SeriesCode}
|
|
242
|
+
* implementation).
|
|
243
|
+
*
|
|
244
|
+
* All three go through the keyless CREATE2 proxy at canonical `AbxSalts` salts, so all three land at
|
|
245
|
+
* addresses that are the same on every chain and computable before the first transaction — the
|
|
246
|
+
* factory's included: linking substitutes an address into already-compiled bytecode, so once the
|
|
247
|
+
* libraries are predictable the linked initcode is fixed too (`predictSeriesCodeFactory()`). The
|
|
248
|
+
* ordering below is still sequential, but now for a plain data-dependency reason rather than a
|
|
249
|
+
* nonce one. See `create2.ts`'s write-path-library note for why the old "libraries are
|
|
250
|
+
* nonce-dependent" story was wrong, and for the compile-time-linking trap that IS real.
|
|
120
251
|
*/
|
|
121
|
-
export declare function deploySeriesCodeFactory(
|
|
252
|
+
export declare function deploySeriesCodeFactory(send: SendTx, publicClient: PublicClient): Promise<{
|
|
122
253
|
factory: Address;
|
|
123
254
|
implementation: Address;
|
|
255
|
+
metadataLib: Address;
|
|
124
256
|
paramsLib: Address;
|
|
125
257
|
codeLib: Address;
|
|
126
258
|
txHash: Hex;
|
|
@@ -130,7 +262,7 @@ export declare function deploySeriesCodeFactory(wallet: WalletClient, account: A
|
|
|
130
262
|
* keyless proxy + canonical salt → the SAME address on every chain (matches `DeploySeedSource.s.sol`
|
|
131
263
|
* and the manifest). The seed source is single-profile, so — unlike the SeriesCode factory — the
|
|
132
264
|
* SDK's bytecode is the canonical one. */
|
|
133
|
-
export declare function deploySeedSource(
|
|
265
|
+
export declare function deploySeedSource(send: SendTx, publicClient: PublicClient): Promise<{
|
|
134
266
|
seedSource: Address;
|
|
135
267
|
txHash: Hex;
|
|
136
268
|
}>;
|
|
@@ -140,7 +272,7 @@ export declare function deploySeedSource(wallet: WalletClient, account: Account,
|
|
|
140
272
|
* their URI-renderer config. It reads each token's on-chain fields and returns a
|
|
141
273
|
* `data:application/json` URI, so a token using it resolves with zero off-chain infra.
|
|
142
274
|
*/
|
|
143
|
-
export declare function deployRenderer(
|
|
275
|
+
export declare function deployRenderer(send: SendTx, publicClient: PublicClient): Promise<DeployResult<'renderer'> & {
|
|
144
276
|
renderer: Address;
|
|
145
277
|
specVersion: bigint;
|
|
146
278
|
}>;
|
|
@@ -150,7 +282,7 @@ export declare function deployRenderer(wallet: WalletClient, account: Account, p
|
|
|
150
282
|
* (config is keyed by token address, authority defers to each token's owner). Sibling of
|
|
151
283
|
* `deployRenderer` — ownerless, no constructor args, safe for any funded signer to stand up.
|
|
152
284
|
*/
|
|
153
|
-
export declare function deployFixedPriceMinter(
|
|
285
|
+
export declare function deployFixedPriceMinter(send: SendTx, publicClient: PublicClient): Promise<DeployResult<'fixedPriceMinter'> & {
|
|
154
286
|
minter: Address;
|
|
155
287
|
}>;
|
|
156
288
|
/**
|
|
@@ -168,7 +300,7 @@ export declare function predictClone(publicClient: PublicClient, args: {
|
|
|
168
300
|
* address (so URIs can be baked in before deploy). Returns the clone address and
|
|
169
301
|
* the block it landed in — the indexer's start block.
|
|
170
302
|
*/
|
|
171
|
-
export declare function deployOneOfOne(
|
|
303
|
+
export declare function deployOneOfOne(send: SendTx, publicClient: PublicClient, args: {
|
|
172
304
|
factory: Address;
|
|
173
305
|
params: OneOfOneInitParams;
|
|
174
306
|
salt: Hex;
|
|
@@ -182,11 +314,99 @@ export declare function deployOneOfOne(wallet: WalletClient, account: Account |
|
|
|
182
314
|
* computes with its own implementation. `params.mintCount`/`mintTo` decide the deploy-time
|
|
183
315
|
* mint; anything larger mints post-deploy under a gas budget.
|
|
184
316
|
*/
|
|
185
|
-
export declare function deploySeries(
|
|
317
|
+
export declare function deploySeries(send: SendTx, publicClient: PublicClient, args: {
|
|
186
318
|
factory: Address;
|
|
187
319
|
params: SeriesInitParams;
|
|
188
320
|
salt: Hex;
|
|
189
321
|
}): Promise<DeployResult<'clone'> & {
|
|
190
322
|
clone: Address;
|
|
191
323
|
}>;
|
|
324
|
+
/**
|
|
325
|
+
* Deploy the canonical `OneOfOneEditionFactory` — the 1/1-edition trust anchor. Unlike {@link
|
|
326
|
+
* deployFactory} (the 721 1/1 factory, a plain contract creation), this one goes through the
|
|
327
|
+
* keyless CREATE2 proxy with the canonical `AbxSalts.ONE_OF_ONE_EDITION_FACTORY` salt — matching
|
|
328
|
+
* how `contracts/script/DeployOneOfOneEdition.s.sol` actually deploys it — so its address is the
|
|
329
|
+
* SAME on every chain and predictable before the deploy tx (`predictOneOfOneEditionFactory()`).
|
|
330
|
+
*
|
|
331
|
+
* Library-linked, like the two code factories: `OneOfOneEdition` delegates its uri /
|
|
332
|
+
* creator-token / edition-supply bodies into `AbxEditionLib`, so this deploys `AbxParamsLib` +
|
|
333
|
+
* `AbxEditionLib` first ({@link ensureEditionLibraries}) and sends the factory's initcode LINKED
|
|
334
|
+
* against the settled library address. Linking costs nothing in determinism — see `create2.ts`'s
|
|
335
|
+
* write-path-library note.
|
|
336
|
+
*/
|
|
337
|
+
export declare function deployOneOfOneEditionFactory(send: SendTx, publicClient: PublicClient): Promise<DeployResult<'factory'> & {
|
|
338
|
+
factory: Address;
|
|
339
|
+
implementation: Address;
|
|
340
|
+
metadataLib: Address;
|
|
341
|
+
paramsLib: Address;
|
|
342
|
+
editionLib: Address;
|
|
343
|
+
}>;
|
|
344
|
+
/** Deploy the canonical `EditionImageFactory` — the multi-work edition trust anchor. CREATE2
|
|
345
|
+
* via the keyless proxy + the canonical `AbxSalts.EDITION_FACTORY` salt (see {@link
|
|
346
|
+
* deployOneOfOneEditionFactory}'s doc note on why this differs from the 721 series factory's
|
|
347
|
+
* plain-creation bootstrap, and why `AbxEditionLib` has to land first). */
|
|
348
|
+
export declare function deployEditionFactory(send: SendTx, publicClient: PublicClient): Promise<DeployResult<'factory'> & {
|
|
349
|
+
factory: Address;
|
|
350
|
+
implementation: Address;
|
|
351
|
+
metadataLib: Address;
|
|
352
|
+
paramsLib: Address;
|
|
353
|
+
editionLib: Address;
|
|
354
|
+
}>;
|
|
355
|
+
/** Deploy `AbxFixedPriceMinter1155` — the canonical, ownerless, multi-tenant edition sale
|
|
356
|
+
* singleton (the Minter spine's edition lane). Sibling of `deployFixedPriceMinter`, one id
|
|
357
|
+
* finer at the contract level (`(token, id)`-keyed sales) — the deploy itself is identical in
|
|
358
|
+
* shape: CREATE2 via the keyless proxy + canonical salt. */
|
|
359
|
+
export declare function deployFixedPriceMinter1155(send: SendTx, publicClient: PublicClient): Promise<DeployResult<'fixedPriceMinter1155'> & {
|
|
360
|
+
minter: Address;
|
|
361
|
+
}>;
|
|
362
|
+
/**
|
|
363
|
+
* Deploy a 1/1 edition NFT as an immutable EIP-1167 clone, at a deterministic address. The
|
|
364
|
+
* edition twin of `deployOneOfOne` — `predictClone` works unchanged (the
|
|
365
|
+
* `predictDeterministicAddress` fragment is identical across every factory, 721 or 1155).
|
|
366
|
+
*/
|
|
367
|
+
export declare function deployOneOfOneEdition(send: SendTx, publicClient: PublicClient, args: {
|
|
368
|
+
factory: Address;
|
|
369
|
+
params: OneOfOneEditionInitParams;
|
|
370
|
+
salt: Hex;
|
|
371
|
+
}): Promise<DeployResult<'clone'> & {
|
|
372
|
+
clone: Address;
|
|
373
|
+
}>;
|
|
374
|
+
/**
|
|
375
|
+
* Deploy an EditionImage (multi-work edition) NFT as an immutable EIP-1167 clone, at a
|
|
376
|
+
* deterministic address. The edition twin of `deploySeries`.
|
|
377
|
+
*/
|
|
378
|
+
export declare function deployEditionImage(send: SendTx, publicClient: PublicClient, args: {
|
|
379
|
+
factory: Address;
|
|
380
|
+
params: EditionImageInitParams;
|
|
381
|
+
salt: Hex;
|
|
382
|
+
}): Promise<DeployResult<'clone'> & {
|
|
383
|
+
clone: Address;
|
|
384
|
+
}>;
|
|
385
|
+
/**
|
|
386
|
+
* Deploy the code-project edition trust root on a chain with no canonical set: the THREE
|
|
387
|
+
* delegatecalled write-path libraries first ({AbxParamsLib}, {AbxCodeLib}, {AbxEditionLib} — the
|
|
388
|
+
* edition twin of `deploySeriesCodeFactory`'s two-lib dance, plus the 1155 write path {@link
|
|
389
|
+
* deployOneOfOneEditionFactory} and {@link deployEditionFactory} link too), the factory bytecode
|
|
390
|
+
* LINKED against all three, then the factory (whose constructor deploys the {EditionCode}
|
|
391
|
+
* implementation). CREATE2 at canonical `AbxSalts` salts throughout, exactly like
|
|
392
|
+
* {@link deploySeriesCodeFactory}, so the whole set is cross-chain-identical and predictable
|
|
393
|
+
* (`predictEditionCodeFactory()`). This is the only factory linking all three libraries; it is NOT
|
|
394
|
+
* the only one linking {AbxEditionLib} — all three 1155 token types delegate into it.
|
|
395
|
+
*
|
|
396
|
+
* One wrinkle the 721 twin doesn't have: {AbxEditionLib} delegatecalls {AbxParamsLib}, so its OWN
|
|
397
|
+
* shipped bytecode carries an unlinked placeholder and has to be linked before it can be deployed
|
|
398
|
+
* ({@link ensureEditionLib} does this via `linkEditionLib()`). Deploying it raw is what made this
|
|
399
|
+
* function fail with an opaque `Invalid byte sequence` — `__$…$__` is not hex, and the old
|
|
400
|
+
* unlinked-placeholder guard only checked the factory's bytecode, never the library's.
|
|
401
|
+
*/
|
|
402
|
+
export declare function deployEditionCodeFactory(send: SendTx, publicClient: PublicClient): Promise<{
|
|
403
|
+
factory: Address;
|
|
404
|
+
implementation: Address;
|
|
405
|
+
metadataLib: Address;
|
|
406
|
+
paramsLib: Address;
|
|
407
|
+
codeLib: Address;
|
|
408
|
+
editionLib: Address;
|
|
409
|
+
txHash: Hex;
|
|
410
|
+
blockNumber: bigint;
|
|
411
|
+
}>;
|
|
192
412
|
//# sourceMappingURL=deploy.d.ts.map
|
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,
|
|
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,EAAC,MAAM,MAAM,CAAC;AA8CvG,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AAEzC,sGAAsG;AACtG,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,GAAG,CAAC;IACX,cAAc,EAAE,GAAG,CAAC;IACpB,KAAK,EAAE,GAAG,CAAC;CACZ;AAED,0EAA0E;AAC1E,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,OAAO,CAAC;IACf,mGAAmG;IACnG,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf;gFAC4E;IAC5E,YAAY,EAAE,MAAM,CAAC;IACrB,mFAAmF;IACnF,gBAAgB,EAAE,OAAO,CAAC;IAC1B,2FAA2F;IAC3F,eAAe,EAAE,MAAM,CAAC;IACxB,wFAAwF;IACxF,mBAAmB,EAAE,OAAO,CAAC;IAC7B,eAAe,EAAE,OAAO,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB;;0GAEsG;IACtG,aAAa,EAAE,MAAM,CAAC;IACtB;mGAC+F;IAC/F,QAAQ,EAAE,OAAO,CAAC;IAClB;;;yFAGqF;IACrF,iBAAiB,EAAE,OAAO,CAAC;IAC3B,4EAA4E;IAC5E,WAAW,EAAE,iBAAiB,EAAE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