@zoralabs/protocol-deployments 0.1.10 → 0.1.11
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/.turbo/turbo-build.log +24 -11
- package/CHANGELOG.md +6 -0
- package/dist/_esm-UK4OVIHX.js +3537 -0
- package/dist/_esm-UK4OVIHX.js.map +1 -0
- package/dist/ccip-XSYMJLYD.js +15 -0
- package/dist/ccip-XSYMJLYD.js.map +1 -0
- package/dist/chunk-2FDPSBOH.js +118 -0
- package/dist/chunk-2FDPSBOH.js.map +1 -0
- package/dist/chunk-3EJPJMEH.js +44 -0
- package/dist/chunk-3EJPJMEH.js.map +1 -0
- package/dist/chunk-ANM5XPUU.js +3209 -0
- package/dist/chunk-ANM5XPUU.js.map +1 -0
- package/dist/generated/1155.d.ts +1 -1
- package/dist/generated/mints.d.ts +8 -0
- package/dist/generated/mints.d.ts.map +1 -1
- package/dist/generated/wagmi.d.ts +893 -501
- package/dist/generated/wagmi.d.ts.map +1 -1
- package/dist/index.cjs +2021 -158
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +442 -161
- package/dist/index.js.map +1 -1
- package/dist/secp256k1-R7PEGLZR.js +2222 -0
- package/dist/secp256k1-R7PEGLZR.js.map +1 -0
- package/dist/typedData.d.ts +18 -2
- package/dist/typedData.d.ts.map +1 -1
- package/dist/types.d.ts +39 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/generated/1155.ts +14 -14
- package/src/generated/mints.ts +9 -2
- package/src/generated/wagmi.ts +344 -142
- package/src/index.ts +1 -0
- package/src/typedData.ts +127 -11
- package/src/types.ts +107 -0
package/dist/index.cjs
CHANGED
|
@@ -3,6 +3,9 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __esm = (fn, res) => function __init() {
|
|
7
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
8
|
+
};
|
|
6
9
|
var __export = (target, all) => {
|
|
7
10
|
for (var name in all)
|
|
8
11
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -17,13 +20,1585 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
20
|
};
|
|
18
21
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
22
|
|
|
23
|
+
// ../../node_modules/abitype/dist/esm/regex.js
|
|
24
|
+
function execTyped(regex, string) {
|
|
25
|
+
const match = regex.exec(string);
|
|
26
|
+
return match?.groups;
|
|
27
|
+
}
|
|
28
|
+
var init_regex = __esm({
|
|
29
|
+
"../../node_modules/abitype/dist/esm/regex.js"() {
|
|
30
|
+
"use strict";
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// ../../node_modules/abitype/dist/esm/human-readable/formatAbiParameter.js
|
|
35
|
+
function formatAbiParameter(abiParameter) {
|
|
36
|
+
let type = abiParameter.type;
|
|
37
|
+
if (tupleRegex.test(abiParameter.type) && "components" in abiParameter) {
|
|
38
|
+
type = "(";
|
|
39
|
+
const length = abiParameter.components.length;
|
|
40
|
+
for (let i = 0; i < length; i++) {
|
|
41
|
+
const component = abiParameter.components[i];
|
|
42
|
+
type += formatAbiParameter(component);
|
|
43
|
+
if (i < length - 1)
|
|
44
|
+
type += ", ";
|
|
45
|
+
}
|
|
46
|
+
const result = execTyped(tupleRegex, abiParameter.type);
|
|
47
|
+
type += `)${result?.array ?? ""}`;
|
|
48
|
+
return formatAbiParameter({
|
|
49
|
+
...abiParameter,
|
|
50
|
+
type
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
if ("indexed" in abiParameter && abiParameter.indexed)
|
|
54
|
+
type = `${type} indexed`;
|
|
55
|
+
if (abiParameter.name)
|
|
56
|
+
return `${type} ${abiParameter.name}`;
|
|
57
|
+
return type;
|
|
58
|
+
}
|
|
59
|
+
var tupleRegex;
|
|
60
|
+
var init_formatAbiParameter = __esm({
|
|
61
|
+
"../../node_modules/abitype/dist/esm/human-readable/formatAbiParameter.js"() {
|
|
62
|
+
"use strict";
|
|
63
|
+
init_regex();
|
|
64
|
+
tupleRegex = /^tuple(?<array>(\[(\d*)\])*)$/;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
// ../../node_modules/abitype/dist/esm/human-readable/formatAbiParameters.js
|
|
69
|
+
function formatAbiParameters(abiParameters) {
|
|
70
|
+
let params = "";
|
|
71
|
+
const length = abiParameters.length;
|
|
72
|
+
for (let i = 0; i < length; i++) {
|
|
73
|
+
const abiParameter = abiParameters[i];
|
|
74
|
+
params += formatAbiParameter(abiParameter);
|
|
75
|
+
if (i !== length - 1)
|
|
76
|
+
params += ", ";
|
|
77
|
+
}
|
|
78
|
+
return params;
|
|
79
|
+
}
|
|
80
|
+
var init_formatAbiParameters = __esm({
|
|
81
|
+
"../../node_modules/abitype/dist/esm/human-readable/formatAbiParameters.js"() {
|
|
82
|
+
"use strict";
|
|
83
|
+
init_formatAbiParameter();
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
// ../../node_modules/abitype/dist/esm/human-readable/formatAbiItem.js
|
|
88
|
+
function formatAbiItem(abiItem) {
|
|
89
|
+
if (abiItem.type === "function")
|
|
90
|
+
return `function ${abiItem.name}(${formatAbiParameters(abiItem.inputs)})${abiItem.stateMutability && abiItem.stateMutability !== "nonpayable" ? ` ${abiItem.stateMutability}` : ""}${abiItem.outputs.length ? ` returns (${formatAbiParameters(abiItem.outputs)})` : ""}`;
|
|
91
|
+
else if (abiItem.type === "event")
|
|
92
|
+
return `event ${abiItem.name}(${formatAbiParameters(abiItem.inputs)})`;
|
|
93
|
+
else if (abiItem.type === "error")
|
|
94
|
+
return `error ${abiItem.name}(${formatAbiParameters(abiItem.inputs)})`;
|
|
95
|
+
else if (abiItem.type === "constructor")
|
|
96
|
+
return `constructor(${formatAbiParameters(abiItem.inputs)})${abiItem.stateMutability === "payable" ? " payable" : ""}`;
|
|
97
|
+
else if (abiItem.type === "fallback")
|
|
98
|
+
return "fallback()";
|
|
99
|
+
return "receive() external payable";
|
|
100
|
+
}
|
|
101
|
+
var init_formatAbiItem = __esm({
|
|
102
|
+
"../../node_modules/abitype/dist/esm/human-readable/formatAbiItem.js"() {
|
|
103
|
+
"use strict";
|
|
104
|
+
init_formatAbiParameters();
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
// ../../node_modules/abitype/dist/esm/exports/index.js
|
|
109
|
+
var init_exports = __esm({
|
|
110
|
+
"../../node_modules/abitype/dist/esm/exports/index.js"() {
|
|
111
|
+
"use strict";
|
|
112
|
+
init_formatAbiItem();
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
// node_modules/viem/_esm/utils/abi/formatAbiItem.js
|
|
117
|
+
function formatAbiItem2(abiItem, { includeName = false } = {}) {
|
|
118
|
+
if (abiItem.type !== "function" && abiItem.type !== "event" && abiItem.type !== "error")
|
|
119
|
+
throw new InvalidDefinitionTypeError(abiItem.type);
|
|
120
|
+
return `${abiItem.name}(${formatAbiParams(abiItem.inputs, { includeName })})`;
|
|
121
|
+
}
|
|
122
|
+
function formatAbiParams(params, { includeName = false } = {}) {
|
|
123
|
+
if (!params)
|
|
124
|
+
return "";
|
|
125
|
+
return params.map((param) => formatAbiParam(param, { includeName })).join(includeName ? ", " : ",");
|
|
126
|
+
}
|
|
127
|
+
function formatAbiParam(param, { includeName }) {
|
|
128
|
+
if (param.type.startsWith("tuple")) {
|
|
129
|
+
return `(${formatAbiParams(param.components, { includeName })})${param.type.slice("tuple".length)}`;
|
|
130
|
+
}
|
|
131
|
+
return param.type + (includeName && param.name ? ` ${param.name}` : "");
|
|
132
|
+
}
|
|
133
|
+
var init_formatAbiItem2 = __esm({
|
|
134
|
+
"node_modules/viem/_esm/utils/abi/formatAbiItem.js"() {
|
|
135
|
+
"use strict";
|
|
136
|
+
init_abi();
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
// node_modules/viem/_esm/utils/data/isHex.js
|
|
141
|
+
function isHex(value, { strict = true } = {}) {
|
|
142
|
+
if (!value)
|
|
143
|
+
return false;
|
|
144
|
+
if (typeof value !== "string")
|
|
145
|
+
return false;
|
|
146
|
+
return strict ? /^0x[0-9a-fA-F]*$/.test(value) : value.startsWith("0x");
|
|
147
|
+
}
|
|
148
|
+
var init_isHex = __esm({
|
|
149
|
+
"node_modules/viem/_esm/utils/data/isHex.js"() {
|
|
150
|
+
"use strict";
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
// node_modules/viem/_esm/utils/data/size.js
|
|
155
|
+
function size(value) {
|
|
156
|
+
if (isHex(value, { strict: false }))
|
|
157
|
+
return Math.ceil((value.length - 2) / 2);
|
|
158
|
+
return value.length;
|
|
159
|
+
}
|
|
160
|
+
var init_size = __esm({
|
|
161
|
+
"node_modules/viem/_esm/utils/data/size.js"() {
|
|
162
|
+
"use strict";
|
|
163
|
+
init_isHex();
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
// node_modules/viem/_esm/errors/version.js
|
|
168
|
+
var version;
|
|
169
|
+
var init_version = __esm({
|
|
170
|
+
"node_modules/viem/_esm/errors/version.js"() {
|
|
171
|
+
"use strict";
|
|
172
|
+
version = "2.9.18";
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
// node_modules/viem/_esm/errors/utils.js
|
|
177
|
+
var getVersion;
|
|
178
|
+
var init_utils = __esm({
|
|
179
|
+
"node_modules/viem/_esm/errors/utils.js"() {
|
|
180
|
+
"use strict";
|
|
181
|
+
init_version();
|
|
182
|
+
getVersion = () => `viem@${version}`;
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
// node_modules/viem/_esm/errors/base.js
|
|
187
|
+
function walk(err, fn) {
|
|
188
|
+
if (fn?.(err))
|
|
189
|
+
return err;
|
|
190
|
+
if (err && typeof err === "object" && "cause" in err)
|
|
191
|
+
return walk(err.cause, fn);
|
|
192
|
+
return fn ? null : err;
|
|
193
|
+
}
|
|
194
|
+
var BaseError;
|
|
195
|
+
var init_base = __esm({
|
|
196
|
+
"node_modules/viem/_esm/errors/base.js"() {
|
|
197
|
+
"use strict";
|
|
198
|
+
init_utils();
|
|
199
|
+
BaseError = class _BaseError extends Error {
|
|
200
|
+
constructor(shortMessage, args = {}) {
|
|
201
|
+
super();
|
|
202
|
+
Object.defineProperty(this, "details", {
|
|
203
|
+
enumerable: true,
|
|
204
|
+
configurable: true,
|
|
205
|
+
writable: true,
|
|
206
|
+
value: void 0
|
|
207
|
+
});
|
|
208
|
+
Object.defineProperty(this, "docsPath", {
|
|
209
|
+
enumerable: true,
|
|
210
|
+
configurable: true,
|
|
211
|
+
writable: true,
|
|
212
|
+
value: void 0
|
|
213
|
+
});
|
|
214
|
+
Object.defineProperty(this, "metaMessages", {
|
|
215
|
+
enumerable: true,
|
|
216
|
+
configurable: true,
|
|
217
|
+
writable: true,
|
|
218
|
+
value: void 0
|
|
219
|
+
});
|
|
220
|
+
Object.defineProperty(this, "shortMessage", {
|
|
221
|
+
enumerable: true,
|
|
222
|
+
configurable: true,
|
|
223
|
+
writable: true,
|
|
224
|
+
value: void 0
|
|
225
|
+
});
|
|
226
|
+
Object.defineProperty(this, "name", {
|
|
227
|
+
enumerable: true,
|
|
228
|
+
configurable: true,
|
|
229
|
+
writable: true,
|
|
230
|
+
value: "ViemError"
|
|
231
|
+
});
|
|
232
|
+
Object.defineProperty(this, "version", {
|
|
233
|
+
enumerable: true,
|
|
234
|
+
configurable: true,
|
|
235
|
+
writable: true,
|
|
236
|
+
value: getVersion()
|
|
237
|
+
});
|
|
238
|
+
const details = args.cause instanceof _BaseError ? args.cause.details : args.cause?.message ? args.cause.message : args.details;
|
|
239
|
+
const docsPath = args.cause instanceof _BaseError ? args.cause.docsPath || args.docsPath : args.docsPath;
|
|
240
|
+
this.message = [
|
|
241
|
+
shortMessage || "An error occurred.",
|
|
242
|
+
"",
|
|
243
|
+
...args.metaMessages ? [...args.metaMessages, ""] : [],
|
|
244
|
+
...docsPath ? [
|
|
245
|
+
`Docs: https://viem.sh${docsPath}${args.docsSlug ? `#${args.docsSlug}` : ""}`
|
|
246
|
+
] : [],
|
|
247
|
+
...details ? [`Details: ${details}`] : [],
|
|
248
|
+
`Version: ${this.version}`
|
|
249
|
+
].join("\n");
|
|
250
|
+
if (args.cause)
|
|
251
|
+
this.cause = args.cause;
|
|
252
|
+
this.details = details;
|
|
253
|
+
this.docsPath = docsPath;
|
|
254
|
+
this.metaMessages = args.metaMessages;
|
|
255
|
+
this.shortMessage = shortMessage;
|
|
256
|
+
}
|
|
257
|
+
walk(fn) {
|
|
258
|
+
return walk(this, fn);
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
// node_modules/viem/_esm/errors/abi.js
|
|
265
|
+
var AbiEncodingArrayLengthMismatchError, AbiEncodingBytesSizeMismatchError, AbiEncodingLengthMismatchError, AbiItemAmbiguityError, InvalidAbiEncodingTypeError, InvalidArrayError, InvalidDefinitionTypeError;
|
|
266
|
+
var init_abi = __esm({
|
|
267
|
+
"node_modules/viem/_esm/errors/abi.js"() {
|
|
268
|
+
"use strict";
|
|
269
|
+
init_formatAbiItem2();
|
|
270
|
+
init_size();
|
|
271
|
+
init_base();
|
|
272
|
+
AbiEncodingArrayLengthMismatchError = class extends BaseError {
|
|
273
|
+
constructor({ expectedLength, givenLength, type }) {
|
|
274
|
+
super([
|
|
275
|
+
`ABI encoding array length mismatch for type ${type}.`,
|
|
276
|
+
`Expected length: ${expectedLength}`,
|
|
277
|
+
`Given length: ${givenLength}`
|
|
278
|
+
].join("\n"));
|
|
279
|
+
Object.defineProperty(this, "name", {
|
|
280
|
+
enumerable: true,
|
|
281
|
+
configurable: true,
|
|
282
|
+
writable: true,
|
|
283
|
+
value: "AbiEncodingArrayLengthMismatchError"
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
AbiEncodingBytesSizeMismatchError = class extends BaseError {
|
|
288
|
+
constructor({ expectedSize, value }) {
|
|
289
|
+
super(`Size of bytes "${value}" (bytes${size(value)}) does not match expected size (bytes${expectedSize}).`);
|
|
290
|
+
Object.defineProperty(this, "name", {
|
|
291
|
+
enumerable: true,
|
|
292
|
+
configurable: true,
|
|
293
|
+
writable: true,
|
|
294
|
+
value: "AbiEncodingBytesSizeMismatchError"
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
AbiEncodingLengthMismatchError = class extends BaseError {
|
|
299
|
+
constructor({ expectedLength, givenLength }) {
|
|
300
|
+
super([
|
|
301
|
+
"ABI encoding params/values length mismatch.",
|
|
302
|
+
`Expected length (params): ${expectedLength}`,
|
|
303
|
+
`Given length (values): ${givenLength}`
|
|
304
|
+
].join("\n"));
|
|
305
|
+
Object.defineProperty(this, "name", {
|
|
306
|
+
enumerable: true,
|
|
307
|
+
configurable: true,
|
|
308
|
+
writable: true,
|
|
309
|
+
value: "AbiEncodingLengthMismatchError"
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
};
|
|
313
|
+
AbiItemAmbiguityError = class extends BaseError {
|
|
314
|
+
constructor(x, y) {
|
|
315
|
+
super("Found ambiguous types in overloaded ABI items.", {
|
|
316
|
+
metaMessages: [
|
|
317
|
+
`\`${x.type}\` in \`${formatAbiItem2(x.abiItem)}\`, and`,
|
|
318
|
+
`\`${y.type}\` in \`${formatAbiItem2(y.abiItem)}\``,
|
|
319
|
+
"",
|
|
320
|
+
"These types encode differently and cannot be distinguished at runtime.",
|
|
321
|
+
"Remove one of the ambiguous items in the ABI."
|
|
322
|
+
]
|
|
323
|
+
});
|
|
324
|
+
Object.defineProperty(this, "name", {
|
|
325
|
+
enumerable: true,
|
|
326
|
+
configurable: true,
|
|
327
|
+
writable: true,
|
|
328
|
+
value: "AbiItemAmbiguityError"
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
};
|
|
332
|
+
InvalidAbiEncodingTypeError = class extends BaseError {
|
|
333
|
+
constructor(type, { docsPath }) {
|
|
334
|
+
super([
|
|
335
|
+
`Type "${type}" is not a valid encoding type.`,
|
|
336
|
+
"Please provide a valid ABI type."
|
|
337
|
+
].join("\n"), { docsPath });
|
|
338
|
+
Object.defineProperty(this, "name", {
|
|
339
|
+
enumerable: true,
|
|
340
|
+
configurable: true,
|
|
341
|
+
writable: true,
|
|
342
|
+
value: "InvalidAbiEncodingType"
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
};
|
|
346
|
+
InvalidArrayError = class extends BaseError {
|
|
347
|
+
constructor(value) {
|
|
348
|
+
super([`Value "${value}" is not a valid array.`].join("\n"));
|
|
349
|
+
Object.defineProperty(this, "name", {
|
|
350
|
+
enumerable: true,
|
|
351
|
+
configurable: true,
|
|
352
|
+
writable: true,
|
|
353
|
+
value: "InvalidArrayError"
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
};
|
|
357
|
+
InvalidDefinitionTypeError = class extends BaseError {
|
|
358
|
+
constructor(type) {
|
|
359
|
+
super([
|
|
360
|
+
`"${type}" is not a valid definition type.`,
|
|
361
|
+
'Valid types: "function", "event", "error"'
|
|
362
|
+
].join("\n"));
|
|
363
|
+
Object.defineProperty(this, "name", {
|
|
364
|
+
enumerable: true,
|
|
365
|
+
configurable: true,
|
|
366
|
+
writable: true,
|
|
367
|
+
value: "InvalidDefinitionTypeError"
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
|
|
374
|
+
// node_modules/viem/_esm/errors/data.js
|
|
375
|
+
var SliceOffsetOutOfBoundsError, SizeExceedsPaddingSizeError;
|
|
376
|
+
var init_data = __esm({
|
|
377
|
+
"node_modules/viem/_esm/errors/data.js"() {
|
|
378
|
+
"use strict";
|
|
379
|
+
init_base();
|
|
380
|
+
SliceOffsetOutOfBoundsError = class extends BaseError {
|
|
381
|
+
constructor({ offset, position, size: size2 }) {
|
|
382
|
+
super(`Slice ${position === "start" ? "starting" : "ending"} at offset "${offset}" is out-of-bounds (size: ${size2}).`);
|
|
383
|
+
Object.defineProperty(this, "name", {
|
|
384
|
+
enumerable: true,
|
|
385
|
+
configurable: true,
|
|
386
|
+
writable: true,
|
|
387
|
+
value: "SliceOffsetOutOfBoundsError"
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
};
|
|
391
|
+
SizeExceedsPaddingSizeError = class extends BaseError {
|
|
392
|
+
constructor({ size: size2, targetSize, type }) {
|
|
393
|
+
super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} size (${size2}) exceeds padding size (${targetSize}).`);
|
|
394
|
+
Object.defineProperty(this, "name", {
|
|
395
|
+
enumerable: true,
|
|
396
|
+
configurable: true,
|
|
397
|
+
writable: true,
|
|
398
|
+
value: "SizeExceedsPaddingSizeError"
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
});
|
|
404
|
+
|
|
405
|
+
// node_modules/viem/_esm/utils/data/pad.js
|
|
406
|
+
function pad(hexOrBytes, { dir, size: size2 = 32 } = {}) {
|
|
407
|
+
if (typeof hexOrBytes === "string")
|
|
408
|
+
return padHex(hexOrBytes, { dir, size: size2 });
|
|
409
|
+
return padBytes(hexOrBytes, { dir, size: size2 });
|
|
410
|
+
}
|
|
411
|
+
function padHex(hex_, { dir, size: size2 = 32 } = {}) {
|
|
412
|
+
if (size2 === null)
|
|
413
|
+
return hex_;
|
|
414
|
+
const hex = hex_.replace("0x", "");
|
|
415
|
+
if (hex.length > size2 * 2)
|
|
416
|
+
throw new SizeExceedsPaddingSizeError({
|
|
417
|
+
size: Math.ceil(hex.length / 2),
|
|
418
|
+
targetSize: size2,
|
|
419
|
+
type: "hex"
|
|
420
|
+
});
|
|
421
|
+
return `0x${hex[dir === "right" ? "padEnd" : "padStart"](size2 * 2, "0")}`;
|
|
422
|
+
}
|
|
423
|
+
function padBytes(bytes2, { dir, size: size2 = 32 } = {}) {
|
|
424
|
+
if (size2 === null)
|
|
425
|
+
return bytes2;
|
|
426
|
+
if (bytes2.length > size2)
|
|
427
|
+
throw new SizeExceedsPaddingSizeError({
|
|
428
|
+
size: bytes2.length,
|
|
429
|
+
targetSize: size2,
|
|
430
|
+
type: "bytes"
|
|
431
|
+
});
|
|
432
|
+
const paddedBytes = new Uint8Array(size2);
|
|
433
|
+
for (let i = 0; i < size2; i++) {
|
|
434
|
+
const padEnd = dir === "right";
|
|
435
|
+
paddedBytes[padEnd ? i : size2 - i - 1] = bytes2[padEnd ? i : bytes2.length - i - 1];
|
|
436
|
+
}
|
|
437
|
+
return paddedBytes;
|
|
438
|
+
}
|
|
439
|
+
var init_pad = __esm({
|
|
440
|
+
"node_modules/viem/_esm/utils/data/pad.js"() {
|
|
441
|
+
"use strict";
|
|
442
|
+
init_data();
|
|
443
|
+
}
|
|
444
|
+
});
|
|
445
|
+
|
|
446
|
+
// node_modules/viem/_esm/errors/encoding.js
|
|
447
|
+
var IntegerOutOfRangeError, SizeOverflowError;
|
|
448
|
+
var init_encoding = __esm({
|
|
449
|
+
"node_modules/viem/_esm/errors/encoding.js"() {
|
|
450
|
+
"use strict";
|
|
451
|
+
init_base();
|
|
452
|
+
IntegerOutOfRangeError = class extends BaseError {
|
|
453
|
+
constructor({ max, min, signed, size: size2, value }) {
|
|
454
|
+
super(`Number "${value}" is not in safe ${size2 ? `${size2 * 8}-bit ${signed ? "signed" : "unsigned"} ` : ""}integer range ${max ? `(${min} to ${max})` : `(above ${min})`}`);
|
|
455
|
+
Object.defineProperty(this, "name", {
|
|
456
|
+
enumerable: true,
|
|
457
|
+
configurable: true,
|
|
458
|
+
writable: true,
|
|
459
|
+
value: "IntegerOutOfRangeError"
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
};
|
|
463
|
+
SizeOverflowError = class extends BaseError {
|
|
464
|
+
constructor({ givenSize, maxSize }) {
|
|
465
|
+
super(`Size cannot exceed ${maxSize} bytes. Given size: ${givenSize} bytes.`);
|
|
466
|
+
Object.defineProperty(this, "name", {
|
|
467
|
+
enumerable: true,
|
|
468
|
+
configurable: true,
|
|
469
|
+
writable: true,
|
|
470
|
+
value: "SizeOverflowError"
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
};
|
|
474
|
+
}
|
|
475
|
+
});
|
|
476
|
+
|
|
477
|
+
// node_modules/viem/_esm/utils/encoding/fromHex.js
|
|
478
|
+
function assertSize(hexOrBytes, { size: size2 }) {
|
|
479
|
+
if (size(hexOrBytes) > size2)
|
|
480
|
+
throw new SizeOverflowError({
|
|
481
|
+
givenSize: size(hexOrBytes),
|
|
482
|
+
maxSize: size2
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
var init_fromHex = __esm({
|
|
486
|
+
"node_modules/viem/_esm/utils/encoding/fromHex.js"() {
|
|
487
|
+
"use strict";
|
|
488
|
+
init_encoding();
|
|
489
|
+
init_size();
|
|
490
|
+
}
|
|
491
|
+
});
|
|
492
|
+
|
|
493
|
+
// node_modules/viem/_esm/utils/encoding/toHex.js
|
|
494
|
+
function toHex(value, opts = {}) {
|
|
495
|
+
if (typeof value === "number" || typeof value === "bigint")
|
|
496
|
+
return numberToHex(value, opts);
|
|
497
|
+
if (typeof value === "string") {
|
|
498
|
+
return stringToHex(value, opts);
|
|
499
|
+
}
|
|
500
|
+
if (typeof value === "boolean")
|
|
501
|
+
return boolToHex(value, opts);
|
|
502
|
+
return bytesToHex(value, opts);
|
|
503
|
+
}
|
|
504
|
+
function boolToHex(value, opts = {}) {
|
|
505
|
+
const hex = `0x${Number(value)}`;
|
|
506
|
+
if (typeof opts.size === "number") {
|
|
507
|
+
assertSize(hex, { size: opts.size });
|
|
508
|
+
return pad(hex, { size: opts.size });
|
|
509
|
+
}
|
|
510
|
+
return hex;
|
|
511
|
+
}
|
|
512
|
+
function bytesToHex(value, opts = {}) {
|
|
513
|
+
let string = "";
|
|
514
|
+
for (let i = 0; i < value.length; i++) {
|
|
515
|
+
string += hexes[value[i]];
|
|
516
|
+
}
|
|
517
|
+
const hex = `0x${string}`;
|
|
518
|
+
if (typeof opts.size === "number") {
|
|
519
|
+
assertSize(hex, { size: opts.size });
|
|
520
|
+
return pad(hex, { dir: "right", size: opts.size });
|
|
521
|
+
}
|
|
522
|
+
return hex;
|
|
523
|
+
}
|
|
524
|
+
function numberToHex(value_, opts = {}) {
|
|
525
|
+
const { signed, size: size2 } = opts;
|
|
526
|
+
const value = BigInt(value_);
|
|
527
|
+
let maxValue;
|
|
528
|
+
if (size2) {
|
|
529
|
+
if (signed)
|
|
530
|
+
maxValue = (1n << BigInt(size2) * 8n - 1n) - 1n;
|
|
531
|
+
else
|
|
532
|
+
maxValue = 2n ** (BigInt(size2) * 8n) - 1n;
|
|
533
|
+
} else if (typeof value_ === "number") {
|
|
534
|
+
maxValue = BigInt(Number.MAX_SAFE_INTEGER);
|
|
535
|
+
}
|
|
536
|
+
const minValue = typeof maxValue === "bigint" && signed ? -maxValue - 1n : 0;
|
|
537
|
+
if (maxValue && value > maxValue || value < minValue) {
|
|
538
|
+
const suffix = typeof value_ === "bigint" ? "n" : "";
|
|
539
|
+
throw new IntegerOutOfRangeError({
|
|
540
|
+
max: maxValue ? `${maxValue}${suffix}` : void 0,
|
|
541
|
+
min: `${minValue}${suffix}`,
|
|
542
|
+
signed,
|
|
543
|
+
size: size2,
|
|
544
|
+
value: `${value_}${suffix}`
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
const hex = `0x${(signed && value < 0 ? (1n << BigInt(size2 * 8)) + BigInt(value) : value).toString(16)}`;
|
|
548
|
+
if (size2)
|
|
549
|
+
return pad(hex, { size: size2 });
|
|
550
|
+
return hex;
|
|
551
|
+
}
|
|
552
|
+
function stringToHex(value_, opts = {}) {
|
|
553
|
+
const value = encoder.encode(value_);
|
|
554
|
+
return bytesToHex(value, opts);
|
|
555
|
+
}
|
|
556
|
+
var hexes, encoder;
|
|
557
|
+
var init_toHex = __esm({
|
|
558
|
+
"node_modules/viem/_esm/utils/encoding/toHex.js"() {
|
|
559
|
+
"use strict";
|
|
560
|
+
init_encoding();
|
|
561
|
+
init_pad();
|
|
562
|
+
init_fromHex();
|
|
563
|
+
hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_v, i) => i.toString(16).padStart(2, "0"));
|
|
564
|
+
encoder = /* @__PURE__ */ new TextEncoder();
|
|
565
|
+
}
|
|
566
|
+
});
|
|
567
|
+
|
|
568
|
+
// node_modules/viem/_esm/utils/encoding/toBytes.js
|
|
569
|
+
function toBytes(value, opts = {}) {
|
|
570
|
+
if (typeof value === "number" || typeof value === "bigint")
|
|
571
|
+
return numberToBytes(value, opts);
|
|
572
|
+
if (typeof value === "boolean")
|
|
573
|
+
return boolToBytes(value, opts);
|
|
574
|
+
if (isHex(value))
|
|
575
|
+
return hexToBytes(value, opts);
|
|
576
|
+
return stringToBytes(value, opts);
|
|
577
|
+
}
|
|
578
|
+
function boolToBytes(value, opts = {}) {
|
|
579
|
+
const bytes2 = new Uint8Array(1);
|
|
580
|
+
bytes2[0] = Number(value);
|
|
581
|
+
if (typeof opts.size === "number") {
|
|
582
|
+
assertSize(bytes2, { size: opts.size });
|
|
583
|
+
return pad(bytes2, { size: opts.size });
|
|
584
|
+
}
|
|
585
|
+
return bytes2;
|
|
586
|
+
}
|
|
587
|
+
function charCodeToBase16(char) {
|
|
588
|
+
if (char >= charCodeMap.zero && char <= charCodeMap.nine)
|
|
589
|
+
return char - charCodeMap.zero;
|
|
590
|
+
if (char >= charCodeMap.A && char <= charCodeMap.F)
|
|
591
|
+
return char - (charCodeMap.A - 10);
|
|
592
|
+
if (char >= charCodeMap.a && char <= charCodeMap.f)
|
|
593
|
+
return char - (charCodeMap.a - 10);
|
|
594
|
+
return void 0;
|
|
595
|
+
}
|
|
596
|
+
function hexToBytes(hex_, opts = {}) {
|
|
597
|
+
let hex = hex_;
|
|
598
|
+
if (opts.size) {
|
|
599
|
+
assertSize(hex, { size: opts.size });
|
|
600
|
+
hex = pad(hex, { dir: "right", size: opts.size });
|
|
601
|
+
}
|
|
602
|
+
let hexString = hex.slice(2);
|
|
603
|
+
if (hexString.length % 2)
|
|
604
|
+
hexString = `0${hexString}`;
|
|
605
|
+
const length = hexString.length / 2;
|
|
606
|
+
const bytes2 = new Uint8Array(length);
|
|
607
|
+
for (let index = 0, j = 0; index < length; index++) {
|
|
608
|
+
const nibbleLeft = charCodeToBase16(hexString.charCodeAt(j++));
|
|
609
|
+
const nibbleRight = charCodeToBase16(hexString.charCodeAt(j++));
|
|
610
|
+
if (nibbleLeft === void 0 || nibbleRight === void 0) {
|
|
611
|
+
throw new BaseError(`Invalid byte sequence ("${hexString[j - 2]}${hexString[j - 1]}" in "${hexString}").`);
|
|
612
|
+
}
|
|
613
|
+
bytes2[index] = nibbleLeft * 16 + nibbleRight;
|
|
614
|
+
}
|
|
615
|
+
return bytes2;
|
|
616
|
+
}
|
|
617
|
+
function numberToBytes(value, opts) {
|
|
618
|
+
const hex = numberToHex(value, opts);
|
|
619
|
+
return hexToBytes(hex);
|
|
620
|
+
}
|
|
621
|
+
function stringToBytes(value, opts = {}) {
|
|
622
|
+
const bytes2 = encoder2.encode(value);
|
|
623
|
+
if (typeof opts.size === "number") {
|
|
624
|
+
assertSize(bytes2, { size: opts.size });
|
|
625
|
+
return pad(bytes2, { dir: "right", size: opts.size });
|
|
626
|
+
}
|
|
627
|
+
return bytes2;
|
|
628
|
+
}
|
|
629
|
+
var encoder2, charCodeMap;
|
|
630
|
+
var init_toBytes = __esm({
|
|
631
|
+
"node_modules/viem/_esm/utils/encoding/toBytes.js"() {
|
|
632
|
+
"use strict";
|
|
633
|
+
init_base();
|
|
634
|
+
init_isHex();
|
|
635
|
+
init_pad();
|
|
636
|
+
init_fromHex();
|
|
637
|
+
init_toHex();
|
|
638
|
+
encoder2 = /* @__PURE__ */ new TextEncoder();
|
|
639
|
+
charCodeMap = {
|
|
640
|
+
zero: 48,
|
|
641
|
+
nine: 57,
|
|
642
|
+
A: 65,
|
|
643
|
+
F: 70,
|
|
644
|
+
a: 97,
|
|
645
|
+
f: 102
|
|
646
|
+
};
|
|
647
|
+
}
|
|
648
|
+
});
|
|
649
|
+
|
|
650
|
+
// ../../node_modules/@noble/hashes/esm/_assert.js
|
|
651
|
+
function number(n) {
|
|
652
|
+
if (!Number.isSafeInteger(n) || n < 0)
|
|
653
|
+
throw new Error(`Wrong positive integer: ${n}`);
|
|
654
|
+
}
|
|
655
|
+
function bytes(b, ...lengths) {
|
|
656
|
+
if (!(b instanceof Uint8Array))
|
|
657
|
+
throw new Error("Expected Uint8Array");
|
|
658
|
+
if (lengths.length > 0 && !lengths.includes(b.length))
|
|
659
|
+
throw new Error(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`);
|
|
660
|
+
}
|
|
661
|
+
function exists(instance, checkFinished = true) {
|
|
662
|
+
if (instance.destroyed)
|
|
663
|
+
throw new Error("Hash instance has been destroyed");
|
|
664
|
+
if (checkFinished && instance.finished)
|
|
665
|
+
throw new Error("Hash#digest() has already been called");
|
|
666
|
+
}
|
|
667
|
+
function output(out, instance) {
|
|
668
|
+
bytes(out);
|
|
669
|
+
const min = instance.outputLen;
|
|
670
|
+
if (out.length < min) {
|
|
671
|
+
throw new Error(`digestInto() expects output buffer of length at least ${min}`);
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
var init_assert = __esm({
|
|
675
|
+
"../../node_modules/@noble/hashes/esm/_assert.js"() {
|
|
676
|
+
"use strict";
|
|
677
|
+
}
|
|
678
|
+
});
|
|
679
|
+
|
|
680
|
+
// ../../node_modules/@noble/hashes/esm/_u64.js
|
|
681
|
+
function fromBig(n, le = false) {
|
|
682
|
+
if (le)
|
|
683
|
+
return { h: Number(n & U32_MASK64), l: Number(n >> _32n & U32_MASK64) };
|
|
684
|
+
return { h: Number(n >> _32n & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };
|
|
685
|
+
}
|
|
686
|
+
function split(lst, le = false) {
|
|
687
|
+
let Ah = new Uint32Array(lst.length);
|
|
688
|
+
let Al = new Uint32Array(lst.length);
|
|
689
|
+
for (let i = 0; i < lst.length; i++) {
|
|
690
|
+
const { h, l } = fromBig(lst[i], le);
|
|
691
|
+
[Ah[i], Al[i]] = [h, l];
|
|
692
|
+
}
|
|
693
|
+
return [Ah, Al];
|
|
694
|
+
}
|
|
695
|
+
var U32_MASK64, _32n, rotlSH, rotlSL, rotlBH, rotlBL;
|
|
696
|
+
var init_u64 = __esm({
|
|
697
|
+
"../../node_modules/@noble/hashes/esm/_u64.js"() {
|
|
698
|
+
"use strict";
|
|
699
|
+
U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);
|
|
700
|
+
_32n = /* @__PURE__ */ BigInt(32);
|
|
701
|
+
rotlSH = (h, l, s) => h << s | l >>> 32 - s;
|
|
702
|
+
rotlSL = (h, l, s) => l << s | h >>> 32 - s;
|
|
703
|
+
rotlBH = (h, l, s) => l << s - 32 | h >>> 64 - s;
|
|
704
|
+
rotlBL = (h, l, s) => h << s - 32 | l >>> 64 - s;
|
|
705
|
+
}
|
|
706
|
+
});
|
|
707
|
+
|
|
708
|
+
// ../../node_modules/@noble/hashes/esm/utils.js
|
|
709
|
+
function utf8ToBytes(str) {
|
|
710
|
+
if (typeof str !== "string")
|
|
711
|
+
throw new Error(`utf8ToBytes expected string, got ${typeof str}`);
|
|
712
|
+
return new Uint8Array(new TextEncoder().encode(str));
|
|
713
|
+
}
|
|
714
|
+
function toBytes2(data) {
|
|
715
|
+
if (typeof data === "string")
|
|
716
|
+
data = utf8ToBytes(data);
|
|
717
|
+
if (!u8a(data))
|
|
718
|
+
throw new Error(`expected Uint8Array, got ${typeof data}`);
|
|
719
|
+
return data;
|
|
720
|
+
}
|
|
721
|
+
function wrapConstructor(hashCons) {
|
|
722
|
+
const hashC = (msg) => hashCons().update(toBytes2(msg)).digest();
|
|
723
|
+
const tmp = hashCons();
|
|
724
|
+
hashC.outputLen = tmp.outputLen;
|
|
725
|
+
hashC.blockLen = tmp.blockLen;
|
|
726
|
+
hashC.create = () => hashCons();
|
|
727
|
+
return hashC;
|
|
728
|
+
}
|
|
729
|
+
function wrapXOFConstructorWithOpts(hashCons) {
|
|
730
|
+
const hashC = (msg, opts) => hashCons(opts).update(toBytes2(msg)).digest();
|
|
731
|
+
const tmp = hashCons({});
|
|
732
|
+
hashC.outputLen = tmp.outputLen;
|
|
733
|
+
hashC.blockLen = tmp.blockLen;
|
|
734
|
+
hashC.create = (opts) => hashCons(opts);
|
|
735
|
+
return hashC;
|
|
736
|
+
}
|
|
737
|
+
var u8a, u32, isLE, Hash, toStr;
|
|
738
|
+
var init_utils2 = __esm({
|
|
739
|
+
"../../node_modules/@noble/hashes/esm/utils.js"() {
|
|
740
|
+
"use strict";
|
|
741
|
+
u8a = (a) => a instanceof Uint8Array;
|
|
742
|
+
u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
|
|
743
|
+
isLE = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
|
|
744
|
+
if (!isLE)
|
|
745
|
+
throw new Error("Non little-endian hardware is not supported");
|
|
746
|
+
Hash = class {
|
|
747
|
+
// Safe version that clones internal state
|
|
748
|
+
clone() {
|
|
749
|
+
return this._cloneInto();
|
|
750
|
+
}
|
|
751
|
+
};
|
|
752
|
+
toStr = {}.toString;
|
|
753
|
+
}
|
|
754
|
+
});
|
|
755
|
+
|
|
756
|
+
// ../../node_modules/@noble/hashes/esm/sha3.js
|
|
757
|
+
function keccakP(s, rounds = 24) {
|
|
758
|
+
const B = new Uint32Array(5 * 2);
|
|
759
|
+
for (let round = 24 - rounds; round < 24; round++) {
|
|
760
|
+
for (let x = 0; x < 10; x++)
|
|
761
|
+
B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];
|
|
762
|
+
for (let x = 0; x < 10; x += 2) {
|
|
763
|
+
const idx1 = (x + 8) % 10;
|
|
764
|
+
const idx0 = (x + 2) % 10;
|
|
765
|
+
const B0 = B[idx0];
|
|
766
|
+
const B1 = B[idx0 + 1];
|
|
767
|
+
const Th = rotlH(B0, B1, 1) ^ B[idx1];
|
|
768
|
+
const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1];
|
|
769
|
+
for (let y = 0; y < 50; y += 10) {
|
|
770
|
+
s[x + y] ^= Th;
|
|
771
|
+
s[x + y + 1] ^= Tl;
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
let curH = s[2];
|
|
775
|
+
let curL = s[3];
|
|
776
|
+
for (let t = 0; t < 24; t++) {
|
|
777
|
+
const shift = SHA3_ROTL[t];
|
|
778
|
+
const Th = rotlH(curH, curL, shift);
|
|
779
|
+
const Tl = rotlL(curH, curL, shift);
|
|
780
|
+
const PI = SHA3_PI[t];
|
|
781
|
+
curH = s[PI];
|
|
782
|
+
curL = s[PI + 1];
|
|
783
|
+
s[PI] = Th;
|
|
784
|
+
s[PI + 1] = Tl;
|
|
785
|
+
}
|
|
786
|
+
for (let y = 0; y < 50; y += 10) {
|
|
787
|
+
for (let x = 0; x < 10; x++)
|
|
788
|
+
B[x] = s[y + x];
|
|
789
|
+
for (let x = 0; x < 10; x++)
|
|
790
|
+
s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10];
|
|
791
|
+
}
|
|
792
|
+
s[0] ^= SHA3_IOTA_H[round];
|
|
793
|
+
s[1] ^= SHA3_IOTA_L[round];
|
|
794
|
+
}
|
|
795
|
+
B.fill(0);
|
|
796
|
+
}
|
|
797
|
+
var SHA3_PI, SHA3_ROTL, _SHA3_IOTA, _0n, _1n, _2n, _7n, _256n, _0x71n, SHA3_IOTA_H, SHA3_IOTA_L, rotlH, rotlL, Keccak, gen, sha3_224, sha3_256, sha3_384, sha3_512, keccak_224, keccak_256, keccak_384, keccak_512, genShake, shake128, shake256;
|
|
798
|
+
var init_sha3 = __esm({
|
|
799
|
+
"../../node_modules/@noble/hashes/esm/sha3.js"() {
|
|
800
|
+
"use strict";
|
|
801
|
+
init_assert();
|
|
802
|
+
init_u64();
|
|
803
|
+
init_utils2();
|
|
804
|
+
[SHA3_PI, SHA3_ROTL, _SHA3_IOTA] = [[], [], []];
|
|
805
|
+
_0n = /* @__PURE__ */ BigInt(0);
|
|
806
|
+
_1n = /* @__PURE__ */ BigInt(1);
|
|
807
|
+
_2n = /* @__PURE__ */ BigInt(2);
|
|
808
|
+
_7n = /* @__PURE__ */ BigInt(7);
|
|
809
|
+
_256n = /* @__PURE__ */ BigInt(256);
|
|
810
|
+
_0x71n = /* @__PURE__ */ BigInt(113);
|
|
811
|
+
for (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {
|
|
812
|
+
[x, y] = [y, (2 * x + 3 * y) % 5];
|
|
813
|
+
SHA3_PI.push(2 * (5 * y + x));
|
|
814
|
+
SHA3_ROTL.push((round + 1) * (round + 2) / 2 % 64);
|
|
815
|
+
let t = _0n;
|
|
816
|
+
for (let j = 0; j < 7; j++) {
|
|
817
|
+
R = (R << _1n ^ (R >> _7n) * _0x71n) % _256n;
|
|
818
|
+
if (R & _2n)
|
|
819
|
+
t ^= _1n << (_1n << /* @__PURE__ */ BigInt(j)) - _1n;
|
|
820
|
+
}
|
|
821
|
+
_SHA3_IOTA.push(t);
|
|
822
|
+
}
|
|
823
|
+
[SHA3_IOTA_H, SHA3_IOTA_L] = /* @__PURE__ */ split(_SHA3_IOTA, true);
|
|
824
|
+
rotlH = (h, l, s) => s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s);
|
|
825
|
+
rotlL = (h, l, s) => s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s);
|
|
826
|
+
Keccak = class _Keccak extends Hash {
|
|
827
|
+
// NOTE: we accept arguments in bytes instead of bits here.
|
|
828
|
+
constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {
|
|
829
|
+
super();
|
|
830
|
+
this.blockLen = blockLen;
|
|
831
|
+
this.suffix = suffix;
|
|
832
|
+
this.outputLen = outputLen;
|
|
833
|
+
this.enableXOF = enableXOF;
|
|
834
|
+
this.rounds = rounds;
|
|
835
|
+
this.pos = 0;
|
|
836
|
+
this.posOut = 0;
|
|
837
|
+
this.finished = false;
|
|
838
|
+
this.destroyed = false;
|
|
839
|
+
number(outputLen);
|
|
840
|
+
if (0 >= this.blockLen || this.blockLen >= 200)
|
|
841
|
+
throw new Error("Sha3 supports only keccak-f1600 function");
|
|
842
|
+
this.state = new Uint8Array(200);
|
|
843
|
+
this.state32 = u32(this.state);
|
|
844
|
+
}
|
|
845
|
+
keccak() {
|
|
846
|
+
keccakP(this.state32, this.rounds);
|
|
847
|
+
this.posOut = 0;
|
|
848
|
+
this.pos = 0;
|
|
849
|
+
}
|
|
850
|
+
update(data) {
|
|
851
|
+
exists(this);
|
|
852
|
+
const { blockLen, state } = this;
|
|
853
|
+
data = toBytes2(data);
|
|
854
|
+
const len = data.length;
|
|
855
|
+
for (let pos = 0; pos < len; ) {
|
|
856
|
+
const take = Math.min(blockLen - this.pos, len - pos);
|
|
857
|
+
for (let i = 0; i < take; i++)
|
|
858
|
+
state[this.pos++] ^= data[pos++];
|
|
859
|
+
if (this.pos === blockLen)
|
|
860
|
+
this.keccak();
|
|
861
|
+
}
|
|
862
|
+
return this;
|
|
863
|
+
}
|
|
864
|
+
finish() {
|
|
865
|
+
if (this.finished)
|
|
866
|
+
return;
|
|
867
|
+
this.finished = true;
|
|
868
|
+
const { state, suffix, pos, blockLen } = this;
|
|
869
|
+
state[pos] ^= suffix;
|
|
870
|
+
if ((suffix & 128) !== 0 && pos === blockLen - 1)
|
|
871
|
+
this.keccak();
|
|
872
|
+
state[blockLen - 1] ^= 128;
|
|
873
|
+
this.keccak();
|
|
874
|
+
}
|
|
875
|
+
writeInto(out) {
|
|
876
|
+
exists(this, false);
|
|
877
|
+
bytes(out);
|
|
878
|
+
this.finish();
|
|
879
|
+
const bufferOut = this.state;
|
|
880
|
+
const { blockLen } = this;
|
|
881
|
+
for (let pos = 0, len = out.length; pos < len; ) {
|
|
882
|
+
if (this.posOut >= blockLen)
|
|
883
|
+
this.keccak();
|
|
884
|
+
const take = Math.min(blockLen - this.posOut, len - pos);
|
|
885
|
+
out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);
|
|
886
|
+
this.posOut += take;
|
|
887
|
+
pos += take;
|
|
888
|
+
}
|
|
889
|
+
return out;
|
|
890
|
+
}
|
|
891
|
+
xofInto(out) {
|
|
892
|
+
if (!this.enableXOF)
|
|
893
|
+
throw new Error("XOF is not possible for this instance");
|
|
894
|
+
return this.writeInto(out);
|
|
895
|
+
}
|
|
896
|
+
xof(bytes2) {
|
|
897
|
+
number(bytes2);
|
|
898
|
+
return this.xofInto(new Uint8Array(bytes2));
|
|
899
|
+
}
|
|
900
|
+
digestInto(out) {
|
|
901
|
+
output(out, this);
|
|
902
|
+
if (this.finished)
|
|
903
|
+
throw new Error("digest() was already called");
|
|
904
|
+
this.writeInto(out);
|
|
905
|
+
this.destroy();
|
|
906
|
+
return out;
|
|
907
|
+
}
|
|
908
|
+
digest() {
|
|
909
|
+
return this.digestInto(new Uint8Array(this.outputLen));
|
|
910
|
+
}
|
|
911
|
+
destroy() {
|
|
912
|
+
this.destroyed = true;
|
|
913
|
+
this.state.fill(0);
|
|
914
|
+
}
|
|
915
|
+
_cloneInto(to) {
|
|
916
|
+
const { blockLen, suffix, outputLen, rounds, enableXOF } = this;
|
|
917
|
+
to || (to = new _Keccak(blockLen, suffix, outputLen, enableXOF, rounds));
|
|
918
|
+
to.state32.set(this.state32);
|
|
919
|
+
to.pos = this.pos;
|
|
920
|
+
to.posOut = this.posOut;
|
|
921
|
+
to.finished = this.finished;
|
|
922
|
+
to.rounds = rounds;
|
|
923
|
+
to.suffix = suffix;
|
|
924
|
+
to.outputLen = outputLen;
|
|
925
|
+
to.enableXOF = enableXOF;
|
|
926
|
+
to.destroyed = this.destroyed;
|
|
927
|
+
return to;
|
|
928
|
+
}
|
|
929
|
+
};
|
|
930
|
+
gen = (suffix, blockLen, outputLen) => wrapConstructor(() => new Keccak(blockLen, suffix, outputLen));
|
|
931
|
+
sha3_224 = /* @__PURE__ */ gen(6, 144, 224 / 8);
|
|
932
|
+
sha3_256 = /* @__PURE__ */ gen(6, 136, 256 / 8);
|
|
933
|
+
sha3_384 = /* @__PURE__ */ gen(6, 104, 384 / 8);
|
|
934
|
+
sha3_512 = /* @__PURE__ */ gen(6, 72, 512 / 8);
|
|
935
|
+
keccak_224 = /* @__PURE__ */ gen(1, 144, 224 / 8);
|
|
936
|
+
keccak_256 = /* @__PURE__ */ gen(1, 136, 256 / 8);
|
|
937
|
+
keccak_384 = /* @__PURE__ */ gen(1, 104, 384 / 8);
|
|
938
|
+
keccak_512 = /* @__PURE__ */ gen(1, 72, 512 / 8);
|
|
939
|
+
genShake = (suffix, blockLen, outputLen) => wrapXOFConstructorWithOpts((opts = {}) => new Keccak(blockLen, suffix, opts.dkLen === void 0 ? outputLen : opts.dkLen, true));
|
|
940
|
+
shake128 = /* @__PURE__ */ genShake(31, 168, 128 / 8);
|
|
941
|
+
shake256 = /* @__PURE__ */ genShake(31, 136, 256 / 8);
|
|
942
|
+
}
|
|
943
|
+
});
|
|
944
|
+
|
|
945
|
+
// node_modules/viem/_esm/utils/hash/keccak256.js
|
|
946
|
+
function keccak256(value, to_) {
|
|
947
|
+
const to = to_ || "hex";
|
|
948
|
+
const bytes2 = keccak_256(isHex(value, { strict: false }) ? toBytes(value) : value);
|
|
949
|
+
if (to === "bytes")
|
|
950
|
+
return bytes2;
|
|
951
|
+
return toHex(bytes2);
|
|
952
|
+
}
|
|
953
|
+
var init_keccak256 = __esm({
|
|
954
|
+
"node_modules/viem/_esm/utils/hash/keccak256.js"() {
|
|
955
|
+
"use strict";
|
|
956
|
+
init_sha3();
|
|
957
|
+
init_isHex();
|
|
958
|
+
init_toBytes();
|
|
959
|
+
init_toHex();
|
|
960
|
+
}
|
|
961
|
+
});
|
|
962
|
+
|
|
963
|
+
// node_modules/viem/_esm/utils/hash/hashSignature.js
|
|
964
|
+
function hashSignature(sig) {
|
|
965
|
+
return hash(sig);
|
|
966
|
+
}
|
|
967
|
+
var hash;
|
|
968
|
+
var init_hashSignature = __esm({
|
|
969
|
+
"node_modules/viem/_esm/utils/hash/hashSignature.js"() {
|
|
970
|
+
"use strict";
|
|
971
|
+
init_toBytes();
|
|
972
|
+
init_keccak256();
|
|
973
|
+
hash = (value) => keccak256(toBytes(value));
|
|
974
|
+
}
|
|
975
|
+
});
|
|
976
|
+
|
|
977
|
+
// node_modules/viem/_esm/utils/hash/normalizeSignature.js
|
|
978
|
+
function normalizeSignature(signature) {
|
|
979
|
+
let active = true;
|
|
980
|
+
let current = "";
|
|
981
|
+
let level = 0;
|
|
982
|
+
let result = "";
|
|
983
|
+
let valid = false;
|
|
984
|
+
for (let i = 0; i < signature.length; i++) {
|
|
985
|
+
const char = signature[i];
|
|
986
|
+
if (["(", ")", ","].includes(char))
|
|
987
|
+
active = true;
|
|
988
|
+
if (char === "(")
|
|
989
|
+
level++;
|
|
990
|
+
if (char === ")")
|
|
991
|
+
level--;
|
|
992
|
+
if (!active)
|
|
993
|
+
continue;
|
|
994
|
+
if (level === 0) {
|
|
995
|
+
if (char === " " && ["event", "function", ""].includes(result))
|
|
996
|
+
result = "";
|
|
997
|
+
else {
|
|
998
|
+
result += char;
|
|
999
|
+
if (char === ")") {
|
|
1000
|
+
valid = true;
|
|
1001
|
+
break;
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
continue;
|
|
1005
|
+
}
|
|
1006
|
+
if (char === " ") {
|
|
1007
|
+
if (signature[i - 1] !== "," && current !== "," && current !== ",(") {
|
|
1008
|
+
current = "";
|
|
1009
|
+
active = false;
|
|
1010
|
+
}
|
|
1011
|
+
continue;
|
|
1012
|
+
}
|
|
1013
|
+
result += char;
|
|
1014
|
+
current += char;
|
|
1015
|
+
}
|
|
1016
|
+
if (!valid)
|
|
1017
|
+
throw new BaseError("Unable to normalize signature.");
|
|
1018
|
+
return result;
|
|
1019
|
+
}
|
|
1020
|
+
var init_normalizeSignature = __esm({
|
|
1021
|
+
"node_modules/viem/_esm/utils/hash/normalizeSignature.js"() {
|
|
1022
|
+
"use strict";
|
|
1023
|
+
init_base();
|
|
1024
|
+
}
|
|
1025
|
+
});
|
|
1026
|
+
|
|
1027
|
+
// node_modules/viem/_esm/utils/hash/toSignature.js
|
|
1028
|
+
var toSignature;
|
|
1029
|
+
var init_toSignature = __esm({
|
|
1030
|
+
"node_modules/viem/_esm/utils/hash/toSignature.js"() {
|
|
1031
|
+
"use strict";
|
|
1032
|
+
init_exports();
|
|
1033
|
+
init_normalizeSignature();
|
|
1034
|
+
toSignature = (def) => {
|
|
1035
|
+
const def_ = (() => {
|
|
1036
|
+
if (typeof def === "string")
|
|
1037
|
+
return def;
|
|
1038
|
+
return formatAbiItem(def);
|
|
1039
|
+
})();
|
|
1040
|
+
return normalizeSignature(def_);
|
|
1041
|
+
};
|
|
1042
|
+
}
|
|
1043
|
+
});
|
|
1044
|
+
|
|
1045
|
+
// node_modules/viem/_esm/utils/hash/toSignatureHash.js
|
|
1046
|
+
function toSignatureHash(fn) {
|
|
1047
|
+
return hashSignature(toSignature(fn));
|
|
1048
|
+
}
|
|
1049
|
+
var init_toSignatureHash = __esm({
|
|
1050
|
+
"node_modules/viem/_esm/utils/hash/toSignatureHash.js"() {
|
|
1051
|
+
"use strict";
|
|
1052
|
+
init_hashSignature();
|
|
1053
|
+
init_toSignature();
|
|
1054
|
+
}
|
|
1055
|
+
});
|
|
1056
|
+
|
|
1057
|
+
// node_modules/viem/_esm/utils/hash/toEventSelector.js
|
|
1058
|
+
var toEventSelector;
|
|
1059
|
+
var init_toEventSelector = __esm({
|
|
1060
|
+
"node_modules/viem/_esm/utils/hash/toEventSelector.js"() {
|
|
1061
|
+
"use strict";
|
|
1062
|
+
init_toSignatureHash();
|
|
1063
|
+
toEventSelector = toSignatureHash;
|
|
1064
|
+
}
|
|
1065
|
+
});
|
|
1066
|
+
|
|
1067
|
+
// node_modules/viem/_esm/errors/address.js
|
|
1068
|
+
var InvalidAddressError;
|
|
1069
|
+
var init_address = __esm({
|
|
1070
|
+
"node_modules/viem/_esm/errors/address.js"() {
|
|
1071
|
+
"use strict";
|
|
1072
|
+
init_base();
|
|
1073
|
+
InvalidAddressError = class extends BaseError {
|
|
1074
|
+
constructor({ address }) {
|
|
1075
|
+
super(`Address "${address}" is invalid.`, {
|
|
1076
|
+
metaMessages: [
|
|
1077
|
+
"- Address must be a hex value of 20 bytes (40 hex characters).",
|
|
1078
|
+
"- Address must match its checksum counterpart."
|
|
1079
|
+
]
|
|
1080
|
+
});
|
|
1081
|
+
Object.defineProperty(this, "name", {
|
|
1082
|
+
enumerable: true,
|
|
1083
|
+
configurable: true,
|
|
1084
|
+
writable: true,
|
|
1085
|
+
value: "InvalidAddressError"
|
|
1086
|
+
});
|
|
1087
|
+
}
|
|
1088
|
+
};
|
|
1089
|
+
}
|
|
1090
|
+
});
|
|
1091
|
+
|
|
1092
|
+
// node_modules/viem/_esm/utils/lru.js
|
|
1093
|
+
var LruMap;
|
|
1094
|
+
var init_lru = __esm({
|
|
1095
|
+
"node_modules/viem/_esm/utils/lru.js"() {
|
|
1096
|
+
"use strict";
|
|
1097
|
+
LruMap = class extends Map {
|
|
1098
|
+
constructor(size2) {
|
|
1099
|
+
super();
|
|
1100
|
+
Object.defineProperty(this, "maxSize", {
|
|
1101
|
+
enumerable: true,
|
|
1102
|
+
configurable: true,
|
|
1103
|
+
writable: true,
|
|
1104
|
+
value: void 0
|
|
1105
|
+
});
|
|
1106
|
+
this.maxSize = size2;
|
|
1107
|
+
}
|
|
1108
|
+
set(key, value) {
|
|
1109
|
+
super.set(key, value);
|
|
1110
|
+
if (this.maxSize && this.size > this.maxSize)
|
|
1111
|
+
this.delete(this.keys().next().value);
|
|
1112
|
+
return this;
|
|
1113
|
+
}
|
|
1114
|
+
};
|
|
1115
|
+
}
|
|
1116
|
+
});
|
|
1117
|
+
|
|
1118
|
+
// node_modules/viem/_esm/utils/address/getAddress.js
|
|
1119
|
+
function checksumAddress(address_, chainId) {
|
|
1120
|
+
const hexAddress = chainId ? `${chainId}${address_.toLowerCase()}` : address_.substring(2).toLowerCase();
|
|
1121
|
+
const hash2 = keccak256(stringToBytes(hexAddress), "bytes");
|
|
1122
|
+
const address = (chainId ? hexAddress.substring(`${chainId}0x`.length) : hexAddress).split("");
|
|
1123
|
+
for (let i = 0; i < 40; i += 2) {
|
|
1124
|
+
if (hash2[i >> 1] >> 4 >= 8 && address[i]) {
|
|
1125
|
+
address[i] = address[i].toUpperCase();
|
|
1126
|
+
}
|
|
1127
|
+
if ((hash2[i >> 1] & 15) >= 8 && address[i + 1]) {
|
|
1128
|
+
address[i + 1] = address[i + 1].toUpperCase();
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
return `0x${address.join("")}`;
|
|
1132
|
+
}
|
|
1133
|
+
var init_getAddress = __esm({
|
|
1134
|
+
"node_modules/viem/_esm/utils/address/getAddress.js"() {
|
|
1135
|
+
"use strict";
|
|
1136
|
+
init_toBytes();
|
|
1137
|
+
init_keccak256();
|
|
1138
|
+
}
|
|
1139
|
+
});
|
|
1140
|
+
|
|
1141
|
+
// node_modules/viem/_esm/utils/address/isAddress.js
|
|
1142
|
+
function isAddress(address, options) {
|
|
1143
|
+
const { strict = true } = options ?? {};
|
|
1144
|
+
if (isAddressCache.has(address))
|
|
1145
|
+
return isAddressCache.get(address);
|
|
1146
|
+
const result = (() => {
|
|
1147
|
+
if (!addressRegex.test(address))
|
|
1148
|
+
return false;
|
|
1149
|
+
if (address.toLowerCase() === address)
|
|
1150
|
+
return true;
|
|
1151
|
+
if (strict)
|
|
1152
|
+
return checksumAddress(address) === address;
|
|
1153
|
+
return true;
|
|
1154
|
+
})();
|
|
1155
|
+
isAddressCache.set(address, result);
|
|
1156
|
+
return result;
|
|
1157
|
+
}
|
|
1158
|
+
var addressRegex, isAddressCache;
|
|
1159
|
+
var init_isAddress = __esm({
|
|
1160
|
+
"node_modules/viem/_esm/utils/address/isAddress.js"() {
|
|
1161
|
+
"use strict";
|
|
1162
|
+
init_lru();
|
|
1163
|
+
init_getAddress();
|
|
1164
|
+
addressRegex = /^0x[a-fA-F0-9]{40}$/;
|
|
1165
|
+
isAddressCache = /* @__PURE__ */ new LruMap(8192);
|
|
1166
|
+
}
|
|
1167
|
+
});
|
|
1168
|
+
|
|
1169
|
+
// node_modules/viem/_esm/utils/data/concat.js
|
|
1170
|
+
function concat(values) {
|
|
1171
|
+
if (typeof values[0] === "string")
|
|
1172
|
+
return concatHex(values);
|
|
1173
|
+
return concatBytes(values);
|
|
1174
|
+
}
|
|
1175
|
+
function concatBytes(values) {
|
|
1176
|
+
let length = 0;
|
|
1177
|
+
for (const arr of values) {
|
|
1178
|
+
length += arr.length;
|
|
1179
|
+
}
|
|
1180
|
+
const result = new Uint8Array(length);
|
|
1181
|
+
let offset = 0;
|
|
1182
|
+
for (const arr of values) {
|
|
1183
|
+
result.set(arr, offset);
|
|
1184
|
+
offset += arr.length;
|
|
1185
|
+
}
|
|
1186
|
+
return result;
|
|
1187
|
+
}
|
|
1188
|
+
function concatHex(values) {
|
|
1189
|
+
return `0x${values.reduce((acc, x) => acc + x.replace("0x", ""), "")}`;
|
|
1190
|
+
}
|
|
1191
|
+
var init_concat = __esm({
|
|
1192
|
+
"node_modules/viem/_esm/utils/data/concat.js"() {
|
|
1193
|
+
"use strict";
|
|
1194
|
+
}
|
|
1195
|
+
});
|
|
1196
|
+
|
|
1197
|
+
// node_modules/viem/_esm/utils/data/slice.js
|
|
1198
|
+
function slice(value, start, end, { strict } = {}) {
|
|
1199
|
+
if (isHex(value, { strict: false }))
|
|
1200
|
+
return sliceHex(value, start, end, {
|
|
1201
|
+
strict
|
|
1202
|
+
});
|
|
1203
|
+
return sliceBytes(value, start, end, {
|
|
1204
|
+
strict
|
|
1205
|
+
});
|
|
1206
|
+
}
|
|
1207
|
+
function assertStartOffset(value, start) {
|
|
1208
|
+
if (typeof start === "number" && start > 0 && start > size(value) - 1)
|
|
1209
|
+
throw new SliceOffsetOutOfBoundsError({
|
|
1210
|
+
offset: start,
|
|
1211
|
+
position: "start",
|
|
1212
|
+
size: size(value)
|
|
1213
|
+
});
|
|
1214
|
+
}
|
|
1215
|
+
function assertEndOffset(value, start, end) {
|
|
1216
|
+
if (typeof start === "number" && typeof end === "number" && size(value) !== end - start) {
|
|
1217
|
+
throw new SliceOffsetOutOfBoundsError({
|
|
1218
|
+
offset: end,
|
|
1219
|
+
position: "end",
|
|
1220
|
+
size: size(value)
|
|
1221
|
+
});
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1224
|
+
function sliceBytes(value_, start, end, { strict } = {}) {
|
|
1225
|
+
assertStartOffset(value_, start);
|
|
1226
|
+
const value = value_.slice(start, end);
|
|
1227
|
+
if (strict)
|
|
1228
|
+
assertEndOffset(value, start, end);
|
|
1229
|
+
return value;
|
|
1230
|
+
}
|
|
1231
|
+
function sliceHex(value_, start, end, { strict } = {}) {
|
|
1232
|
+
assertStartOffset(value_, start);
|
|
1233
|
+
const value = `0x${value_.replace("0x", "").slice((start ?? 0) * 2, (end ?? value_.length) * 2)}`;
|
|
1234
|
+
if (strict)
|
|
1235
|
+
assertEndOffset(value, start, end);
|
|
1236
|
+
return value;
|
|
1237
|
+
}
|
|
1238
|
+
var init_slice = __esm({
|
|
1239
|
+
"node_modules/viem/_esm/utils/data/slice.js"() {
|
|
1240
|
+
"use strict";
|
|
1241
|
+
init_data();
|
|
1242
|
+
init_isHex();
|
|
1243
|
+
init_size();
|
|
1244
|
+
}
|
|
1245
|
+
});
|
|
1246
|
+
|
|
1247
|
+
// node_modules/viem/_esm/utils/abi/encodeAbiParameters.js
|
|
1248
|
+
function encodeAbiParameters(params, values) {
|
|
1249
|
+
if (params.length !== values.length)
|
|
1250
|
+
throw new AbiEncodingLengthMismatchError({
|
|
1251
|
+
expectedLength: params.length,
|
|
1252
|
+
givenLength: values.length
|
|
1253
|
+
});
|
|
1254
|
+
const preparedParams = prepareParams({
|
|
1255
|
+
params,
|
|
1256
|
+
values
|
|
1257
|
+
});
|
|
1258
|
+
const data = encodeParams(preparedParams);
|
|
1259
|
+
if (data.length === 0)
|
|
1260
|
+
return "0x";
|
|
1261
|
+
return data;
|
|
1262
|
+
}
|
|
1263
|
+
function prepareParams({ params, values }) {
|
|
1264
|
+
const preparedParams = [];
|
|
1265
|
+
for (let i = 0; i < params.length; i++) {
|
|
1266
|
+
preparedParams.push(prepareParam({ param: params[i], value: values[i] }));
|
|
1267
|
+
}
|
|
1268
|
+
return preparedParams;
|
|
1269
|
+
}
|
|
1270
|
+
function prepareParam({ param, value }) {
|
|
1271
|
+
const arrayComponents = getArrayComponents(param.type);
|
|
1272
|
+
if (arrayComponents) {
|
|
1273
|
+
const [length, type] = arrayComponents;
|
|
1274
|
+
return encodeArray(value, { length, param: { ...param, type } });
|
|
1275
|
+
}
|
|
1276
|
+
if (param.type === "tuple") {
|
|
1277
|
+
return encodeTuple(value, {
|
|
1278
|
+
param
|
|
1279
|
+
});
|
|
1280
|
+
}
|
|
1281
|
+
if (param.type === "address") {
|
|
1282
|
+
return encodeAddress(value);
|
|
1283
|
+
}
|
|
1284
|
+
if (param.type === "bool") {
|
|
1285
|
+
return encodeBool(value);
|
|
1286
|
+
}
|
|
1287
|
+
if (param.type.startsWith("uint") || param.type.startsWith("int")) {
|
|
1288
|
+
const signed = param.type.startsWith("int");
|
|
1289
|
+
return encodeNumber(value, { signed });
|
|
1290
|
+
}
|
|
1291
|
+
if (param.type.startsWith("bytes")) {
|
|
1292
|
+
return encodeBytes(value, { param });
|
|
1293
|
+
}
|
|
1294
|
+
if (param.type === "string") {
|
|
1295
|
+
return encodeString(value);
|
|
1296
|
+
}
|
|
1297
|
+
throw new InvalidAbiEncodingTypeError(param.type, {
|
|
1298
|
+
docsPath: "/docs/contract/encodeAbiParameters"
|
|
1299
|
+
});
|
|
1300
|
+
}
|
|
1301
|
+
function encodeParams(preparedParams) {
|
|
1302
|
+
let staticSize = 0;
|
|
1303
|
+
for (let i = 0; i < preparedParams.length; i++) {
|
|
1304
|
+
const { dynamic, encoded } = preparedParams[i];
|
|
1305
|
+
if (dynamic)
|
|
1306
|
+
staticSize += 32;
|
|
1307
|
+
else
|
|
1308
|
+
staticSize += size(encoded);
|
|
1309
|
+
}
|
|
1310
|
+
const staticParams = [];
|
|
1311
|
+
const dynamicParams = [];
|
|
1312
|
+
let dynamicSize = 0;
|
|
1313
|
+
for (let i = 0; i < preparedParams.length; i++) {
|
|
1314
|
+
const { dynamic, encoded } = preparedParams[i];
|
|
1315
|
+
if (dynamic) {
|
|
1316
|
+
staticParams.push(numberToHex(staticSize + dynamicSize, { size: 32 }));
|
|
1317
|
+
dynamicParams.push(encoded);
|
|
1318
|
+
dynamicSize += size(encoded);
|
|
1319
|
+
} else {
|
|
1320
|
+
staticParams.push(encoded);
|
|
1321
|
+
}
|
|
1322
|
+
}
|
|
1323
|
+
return concat([...staticParams, ...dynamicParams]);
|
|
1324
|
+
}
|
|
1325
|
+
function encodeAddress(value) {
|
|
1326
|
+
if (!isAddress(value))
|
|
1327
|
+
throw new InvalidAddressError({ address: value });
|
|
1328
|
+
return { dynamic: false, encoded: padHex(value.toLowerCase()) };
|
|
1329
|
+
}
|
|
1330
|
+
function encodeArray(value, { length, param }) {
|
|
1331
|
+
const dynamic = length === null;
|
|
1332
|
+
if (!Array.isArray(value))
|
|
1333
|
+
throw new InvalidArrayError(value);
|
|
1334
|
+
if (!dynamic && value.length !== length)
|
|
1335
|
+
throw new AbiEncodingArrayLengthMismatchError({
|
|
1336
|
+
expectedLength: length,
|
|
1337
|
+
givenLength: value.length,
|
|
1338
|
+
type: `${param.type}[${length}]`
|
|
1339
|
+
});
|
|
1340
|
+
let dynamicChild = false;
|
|
1341
|
+
const preparedParams = [];
|
|
1342
|
+
for (let i = 0; i < value.length; i++) {
|
|
1343
|
+
const preparedParam = prepareParam({ param, value: value[i] });
|
|
1344
|
+
if (preparedParam.dynamic)
|
|
1345
|
+
dynamicChild = true;
|
|
1346
|
+
preparedParams.push(preparedParam);
|
|
1347
|
+
}
|
|
1348
|
+
if (dynamic || dynamicChild) {
|
|
1349
|
+
const data = encodeParams(preparedParams);
|
|
1350
|
+
if (dynamic) {
|
|
1351
|
+
const length2 = numberToHex(preparedParams.length, { size: 32 });
|
|
1352
|
+
return {
|
|
1353
|
+
dynamic: true,
|
|
1354
|
+
encoded: preparedParams.length > 0 ? concat([length2, data]) : length2
|
|
1355
|
+
};
|
|
1356
|
+
}
|
|
1357
|
+
if (dynamicChild)
|
|
1358
|
+
return { dynamic: true, encoded: data };
|
|
1359
|
+
}
|
|
1360
|
+
return {
|
|
1361
|
+
dynamic: false,
|
|
1362
|
+
encoded: concat(preparedParams.map(({ encoded }) => encoded))
|
|
1363
|
+
};
|
|
1364
|
+
}
|
|
1365
|
+
function encodeBytes(value, { param }) {
|
|
1366
|
+
const [, paramSize] = param.type.split("bytes");
|
|
1367
|
+
const bytesSize = size(value);
|
|
1368
|
+
if (!paramSize) {
|
|
1369
|
+
let value_ = value;
|
|
1370
|
+
if (bytesSize % 32 !== 0)
|
|
1371
|
+
value_ = padHex(value_, {
|
|
1372
|
+
dir: "right",
|
|
1373
|
+
size: Math.ceil((value.length - 2) / 2 / 32) * 32
|
|
1374
|
+
});
|
|
1375
|
+
return {
|
|
1376
|
+
dynamic: true,
|
|
1377
|
+
encoded: concat([padHex(numberToHex(bytesSize, { size: 32 })), value_])
|
|
1378
|
+
};
|
|
1379
|
+
}
|
|
1380
|
+
if (bytesSize !== parseInt(paramSize))
|
|
1381
|
+
throw new AbiEncodingBytesSizeMismatchError({
|
|
1382
|
+
expectedSize: parseInt(paramSize),
|
|
1383
|
+
value
|
|
1384
|
+
});
|
|
1385
|
+
return { dynamic: false, encoded: padHex(value, { dir: "right" }) };
|
|
1386
|
+
}
|
|
1387
|
+
function encodeBool(value) {
|
|
1388
|
+
if (typeof value !== "boolean")
|
|
1389
|
+
throw new BaseError(`Invalid boolean value: "${value}" (type: ${typeof value}). Expected: \`true\` or \`false\`.`);
|
|
1390
|
+
return { dynamic: false, encoded: padHex(boolToHex(value)) };
|
|
1391
|
+
}
|
|
1392
|
+
function encodeNumber(value, { signed }) {
|
|
1393
|
+
return {
|
|
1394
|
+
dynamic: false,
|
|
1395
|
+
encoded: numberToHex(value, {
|
|
1396
|
+
size: 32,
|
|
1397
|
+
signed
|
|
1398
|
+
})
|
|
1399
|
+
};
|
|
1400
|
+
}
|
|
1401
|
+
function encodeString(value) {
|
|
1402
|
+
const hexValue = stringToHex(value);
|
|
1403
|
+
const partsLength = Math.ceil(size(hexValue) / 32);
|
|
1404
|
+
const parts = [];
|
|
1405
|
+
for (let i = 0; i < partsLength; i++) {
|
|
1406
|
+
parts.push(padHex(slice(hexValue, i * 32, (i + 1) * 32), {
|
|
1407
|
+
dir: "right"
|
|
1408
|
+
}));
|
|
1409
|
+
}
|
|
1410
|
+
return {
|
|
1411
|
+
dynamic: true,
|
|
1412
|
+
encoded: concat([
|
|
1413
|
+
padHex(numberToHex(size(hexValue), { size: 32 })),
|
|
1414
|
+
...parts
|
|
1415
|
+
])
|
|
1416
|
+
};
|
|
1417
|
+
}
|
|
1418
|
+
function encodeTuple(value, { param }) {
|
|
1419
|
+
let dynamic = false;
|
|
1420
|
+
const preparedParams = [];
|
|
1421
|
+
for (let i = 0; i < param.components.length; i++) {
|
|
1422
|
+
const param_ = param.components[i];
|
|
1423
|
+
const index = Array.isArray(value) ? i : param_.name;
|
|
1424
|
+
const preparedParam = prepareParam({
|
|
1425
|
+
param: param_,
|
|
1426
|
+
value: value[index]
|
|
1427
|
+
});
|
|
1428
|
+
preparedParams.push(preparedParam);
|
|
1429
|
+
if (preparedParam.dynamic)
|
|
1430
|
+
dynamic = true;
|
|
1431
|
+
}
|
|
1432
|
+
return {
|
|
1433
|
+
dynamic,
|
|
1434
|
+
encoded: dynamic ? encodeParams(preparedParams) : concat(preparedParams.map(({ encoded }) => encoded))
|
|
1435
|
+
};
|
|
1436
|
+
}
|
|
1437
|
+
function getArrayComponents(type) {
|
|
1438
|
+
const matches = type.match(/^(.*)\[(\d+)?\]$/);
|
|
1439
|
+
return matches ? (
|
|
1440
|
+
// Return `null` if the array is dynamic.
|
|
1441
|
+
[matches[2] ? Number(matches[2]) : null, matches[1]]
|
|
1442
|
+
) : void 0;
|
|
1443
|
+
}
|
|
1444
|
+
var init_encodeAbiParameters = __esm({
|
|
1445
|
+
"node_modules/viem/_esm/utils/abi/encodeAbiParameters.js"() {
|
|
1446
|
+
"use strict";
|
|
1447
|
+
init_abi();
|
|
1448
|
+
init_address();
|
|
1449
|
+
init_base();
|
|
1450
|
+
init_isAddress();
|
|
1451
|
+
init_concat();
|
|
1452
|
+
init_pad();
|
|
1453
|
+
init_size();
|
|
1454
|
+
init_slice();
|
|
1455
|
+
init_toHex();
|
|
1456
|
+
}
|
|
1457
|
+
});
|
|
1458
|
+
|
|
1459
|
+
// node_modules/viem/_esm/utils/hash/toFunctionSelector.js
|
|
1460
|
+
var toFunctionSelector;
|
|
1461
|
+
var init_toFunctionSelector = __esm({
|
|
1462
|
+
"node_modules/viem/_esm/utils/hash/toFunctionSelector.js"() {
|
|
1463
|
+
"use strict";
|
|
1464
|
+
init_slice();
|
|
1465
|
+
init_toSignatureHash();
|
|
1466
|
+
toFunctionSelector = (fn) => slice(toSignatureHash(fn), 0, 4);
|
|
1467
|
+
}
|
|
1468
|
+
});
|
|
1469
|
+
|
|
1470
|
+
// node_modules/viem/_esm/utils/abi/getAbiItem.js
|
|
1471
|
+
function getAbiItem(parameters) {
|
|
1472
|
+
const { abi, args = [], name } = parameters;
|
|
1473
|
+
const isSelector = isHex(name, { strict: false });
|
|
1474
|
+
const abiItems = abi.filter((abiItem) => {
|
|
1475
|
+
if (isSelector) {
|
|
1476
|
+
if (abiItem.type === "function")
|
|
1477
|
+
return toFunctionSelector(abiItem) === name;
|
|
1478
|
+
if (abiItem.type === "event")
|
|
1479
|
+
return toEventSelector(abiItem) === name;
|
|
1480
|
+
return false;
|
|
1481
|
+
}
|
|
1482
|
+
return "name" in abiItem && abiItem.name === name;
|
|
1483
|
+
});
|
|
1484
|
+
if (abiItems.length === 0)
|
|
1485
|
+
return void 0;
|
|
1486
|
+
if (abiItems.length === 1)
|
|
1487
|
+
return abiItems[0];
|
|
1488
|
+
let matchedAbiItem = void 0;
|
|
1489
|
+
for (const abiItem of abiItems) {
|
|
1490
|
+
if (!("inputs" in abiItem))
|
|
1491
|
+
continue;
|
|
1492
|
+
if (!args || args.length === 0) {
|
|
1493
|
+
if (!abiItem.inputs || abiItem.inputs.length === 0)
|
|
1494
|
+
return abiItem;
|
|
1495
|
+
continue;
|
|
1496
|
+
}
|
|
1497
|
+
if (!abiItem.inputs)
|
|
1498
|
+
continue;
|
|
1499
|
+
if (abiItem.inputs.length === 0)
|
|
1500
|
+
continue;
|
|
1501
|
+
if (abiItem.inputs.length !== args.length)
|
|
1502
|
+
continue;
|
|
1503
|
+
const matched = args.every((arg, index) => {
|
|
1504
|
+
const abiParameter = "inputs" in abiItem && abiItem.inputs[index];
|
|
1505
|
+
if (!abiParameter)
|
|
1506
|
+
return false;
|
|
1507
|
+
return isArgOfType(arg, abiParameter);
|
|
1508
|
+
});
|
|
1509
|
+
if (matched) {
|
|
1510
|
+
if (matchedAbiItem && "inputs" in matchedAbiItem && matchedAbiItem.inputs) {
|
|
1511
|
+
const ambiguousTypes = getAmbiguousTypes(abiItem.inputs, matchedAbiItem.inputs, args);
|
|
1512
|
+
if (ambiguousTypes)
|
|
1513
|
+
throw new AbiItemAmbiguityError({
|
|
1514
|
+
abiItem,
|
|
1515
|
+
type: ambiguousTypes[0]
|
|
1516
|
+
}, {
|
|
1517
|
+
abiItem: matchedAbiItem,
|
|
1518
|
+
type: ambiguousTypes[1]
|
|
1519
|
+
});
|
|
1520
|
+
}
|
|
1521
|
+
matchedAbiItem = abiItem;
|
|
1522
|
+
}
|
|
1523
|
+
}
|
|
1524
|
+
if (matchedAbiItem)
|
|
1525
|
+
return matchedAbiItem;
|
|
1526
|
+
return abiItems[0];
|
|
1527
|
+
}
|
|
1528
|
+
function isArgOfType(arg, abiParameter) {
|
|
1529
|
+
const argType = typeof arg;
|
|
1530
|
+
const abiParameterType = abiParameter.type;
|
|
1531
|
+
switch (abiParameterType) {
|
|
1532
|
+
case "address":
|
|
1533
|
+
return isAddress(arg, { strict: false });
|
|
1534
|
+
case "bool":
|
|
1535
|
+
return argType === "boolean";
|
|
1536
|
+
case "function":
|
|
1537
|
+
return argType === "string";
|
|
1538
|
+
case "string":
|
|
1539
|
+
return argType === "string";
|
|
1540
|
+
default: {
|
|
1541
|
+
if (abiParameterType === "tuple" && "components" in abiParameter)
|
|
1542
|
+
return Object.values(abiParameter.components).every((component, index) => {
|
|
1543
|
+
return isArgOfType(Object.values(arg)[index], component);
|
|
1544
|
+
});
|
|
1545
|
+
if (/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(abiParameterType))
|
|
1546
|
+
return argType === "number" || argType === "bigint";
|
|
1547
|
+
if (/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(abiParameterType))
|
|
1548
|
+
return argType === "string" || arg instanceof Uint8Array;
|
|
1549
|
+
if (/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(abiParameterType)) {
|
|
1550
|
+
return Array.isArray(arg) && arg.every((x) => isArgOfType(x, {
|
|
1551
|
+
...abiParameter,
|
|
1552
|
+
// Pop off `[]` or `[M]` from end of type
|
|
1553
|
+
type: abiParameterType.replace(/(\[[0-9]{0,}\])$/, "")
|
|
1554
|
+
}));
|
|
1555
|
+
}
|
|
1556
|
+
return false;
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1559
|
+
}
|
|
1560
|
+
function getAmbiguousTypes(sourceParameters, targetParameters, args) {
|
|
1561
|
+
for (const parameterIndex in sourceParameters) {
|
|
1562
|
+
const sourceParameter = sourceParameters[parameterIndex];
|
|
1563
|
+
const targetParameter = targetParameters[parameterIndex];
|
|
1564
|
+
if (sourceParameter.type === "tuple" && targetParameter.type === "tuple" && "components" in sourceParameter && "components" in targetParameter)
|
|
1565
|
+
return getAmbiguousTypes(sourceParameter.components, targetParameter.components, args[parameterIndex]);
|
|
1566
|
+
const types = [sourceParameter.type, targetParameter.type];
|
|
1567
|
+
const ambiguous = (() => {
|
|
1568
|
+
if (types.includes("address") && types.includes("bytes20"))
|
|
1569
|
+
return true;
|
|
1570
|
+
if (types.includes("address") && types.includes("string"))
|
|
1571
|
+
return isAddress(args[parameterIndex], { strict: false });
|
|
1572
|
+
if (types.includes("address") && types.includes("bytes"))
|
|
1573
|
+
return isAddress(args[parameterIndex], { strict: false });
|
|
1574
|
+
return false;
|
|
1575
|
+
})();
|
|
1576
|
+
if (ambiguous)
|
|
1577
|
+
return types;
|
|
1578
|
+
}
|
|
1579
|
+
return;
|
|
1580
|
+
}
|
|
1581
|
+
var init_getAbiItem = __esm({
|
|
1582
|
+
"node_modules/viem/_esm/utils/abi/getAbiItem.js"() {
|
|
1583
|
+
"use strict";
|
|
1584
|
+
init_abi();
|
|
1585
|
+
init_isHex();
|
|
1586
|
+
init_isAddress();
|
|
1587
|
+
init_toEventSelector();
|
|
1588
|
+
init_toFunctionSelector();
|
|
1589
|
+
}
|
|
1590
|
+
});
|
|
1591
|
+
|
|
20
1592
|
// src/index.ts
|
|
21
1593
|
var src_exports = {};
|
|
22
1594
|
__export(src_exports, {
|
|
1595
|
+
PremintConfigVersion: () => PremintConfigVersion,
|
|
23
1596
|
contracts1155: () => __exports,
|
|
1597
|
+
encodePremintConfig: () => encodePremintConfig,
|
|
24
1598
|
erc20MinterABI: () => erc20MinterABI,
|
|
25
1599
|
erc20MinterAddress: () => erc20MinterAddress,
|
|
26
1600
|
erc20MinterConfig: () => erc20MinterConfig,
|
|
1601
|
+
iPremintDefinitionsABI: () => iPremintDefinitionsABI,
|
|
27
1602
|
iUnwrapAndForwardActionABI: () => iUnwrapAndForwardActionABI,
|
|
28
1603
|
mints: () => mints_exports,
|
|
29
1604
|
mintsEthUnwrapperAndCallerABI: () => mintsEthUnwrapperAndCallerABI,
|
|
@@ -31,6 +1606,7 @@ __export(src_exports, {
|
|
|
31
1606
|
mintsEthUnwrapperAndCallerConfig: () => mintsEthUnwrapperAndCallerConfig,
|
|
32
1607
|
mintsSafeTransferBatchTypedDataDefinition: () => mintsSafeTransferBatchTypedDataDefinition,
|
|
33
1608
|
mintsSafeTransferTypedDataDefinition: () => mintsSafeTransferTypedDataDefinition,
|
|
1609
|
+
premintTypedDataDefinition: () => premintTypedDataDefinition,
|
|
34
1610
|
premintV1TypedDataDefinition: () => premintV1TypedDataDefinition,
|
|
35
1611
|
premintV2TypedDataDefinition: () => premintV2TypedDataDefinition,
|
|
36
1612
|
protocolRewardsABI: () => protocolRewardsABI,
|
|
@@ -70,6 +1646,48 @@ var erc20MinterABI = [
|
|
|
70
1646
|
name: "acceptOwnership",
|
|
71
1647
|
outputs: []
|
|
72
1648
|
},
|
|
1649
|
+
{
|
|
1650
|
+
stateMutability: "view",
|
|
1651
|
+
type: "function",
|
|
1652
|
+
inputs: [
|
|
1653
|
+
{
|
|
1654
|
+
name: "config",
|
|
1655
|
+
internalType: "struct IERC20Minter.PremintSalesConfig",
|
|
1656
|
+
type: "tuple",
|
|
1657
|
+
components: [
|
|
1658
|
+
{ name: "duration", internalType: "uint64", type: "uint64" },
|
|
1659
|
+
{
|
|
1660
|
+
name: "maxTokensPerAddress",
|
|
1661
|
+
internalType: "uint64",
|
|
1662
|
+
type: "uint64"
|
|
1663
|
+
},
|
|
1664
|
+
{ name: "pricePerToken", internalType: "uint256", type: "uint256" },
|
|
1665
|
+
{ name: "fundsRecipient", internalType: "address", type: "address" },
|
|
1666
|
+
{ name: "currency", internalType: "address", type: "address" }
|
|
1667
|
+
]
|
|
1668
|
+
}
|
|
1669
|
+
],
|
|
1670
|
+
name: "buildSalesConfigForPremint",
|
|
1671
|
+
outputs: [
|
|
1672
|
+
{
|
|
1673
|
+
name: "",
|
|
1674
|
+
internalType: "struct IERC20Minter.SalesConfig",
|
|
1675
|
+
type: "tuple",
|
|
1676
|
+
components: [
|
|
1677
|
+
{ name: "saleStart", internalType: "uint64", type: "uint64" },
|
|
1678
|
+
{ name: "saleEnd", internalType: "uint64", type: "uint64" },
|
|
1679
|
+
{
|
|
1680
|
+
name: "maxTokensPerAddress",
|
|
1681
|
+
internalType: "uint64",
|
|
1682
|
+
type: "uint64"
|
|
1683
|
+
},
|
|
1684
|
+
{ name: "pricePerToken", internalType: "uint256", type: "uint256" },
|
|
1685
|
+
{ name: "fundsRecipient", internalType: "address", type: "address" },
|
|
1686
|
+
{ name: "currency", internalType: "address", type: "address" }
|
|
1687
|
+
]
|
|
1688
|
+
}
|
|
1689
|
+
]
|
|
1690
|
+
},
|
|
73
1691
|
{
|
|
74
1692
|
stateMutability: "nonpayable",
|
|
75
1693
|
type: "function",
|
|
@@ -223,7 +1841,7 @@ var erc20MinterABI = [
|
|
|
223
1841
|
internalType: "address",
|
|
224
1842
|
type: "address"
|
|
225
1843
|
},
|
|
226
|
-
{ name: "
|
|
1844
|
+
{ name: "_owner", internalType: "address", type: "address" },
|
|
227
1845
|
{ name: "_rewardPct", internalType: "uint256", type: "uint256" },
|
|
228
1846
|
{ name: "_ethReward", internalType: "uint256", type: "uint256" }
|
|
229
1847
|
],
|
|
@@ -389,6 +2007,20 @@ var erc20MinterABI = [
|
|
|
389
2007
|
name: "setERC20MinterConfig",
|
|
390
2008
|
outputs: []
|
|
391
2009
|
},
|
|
2010
|
+
{
|
|
2011
|
+
stateMutability: "nonpayable",
|
|
2012
|
+
type: "function",
|
|
2013
|
+
inputs: [
|
|
2014
|
+
{ name: "tokenId", internalType: "uint256", type: "uint256" },
|
|
2015
|
+
{
|
|
2016
|
+
name: "encodedPremintSalesConfig",
|
|
2017
|
+
internalType: "bytes",
|
|
2018
|
+
type: "bytes"
|
|
2019
|
+
}
|
|
2020
|
+
],
|
|
2021
|
+
name: "setPremintSale",
|
|
2022
|
+
outputs: []
|
|
2023
|
+
},
|
|
392
2024
|
{
|
|
393
2025
|
stateMutability: "nonpayable",
|
|
394
2026
|
type: "function",
|
|
@@ -688,6 +2320,14 @@ var erc20MinterABI = [
|
|
|
688
2320
|
name: "INITIALIZABLE_CONTRACT_IS_NOT_INITIALIZING"
|
|
689
2321
|
},
|
|
690
2322
|
{ type: "error", inputs: [], name: "InvalidCurrency" },
|
|
2323
|
+
{
|
|
2324
|
+
type: "error",
|
|
2325
|
+
inputs: [
|
|
2326
|
+
{ name: "expectedValue", internalType: "uint256", type: "uint256" },
|
|
2327
|
+
{ name: "actualValue", internalType: "uint256", type: "uint256" }
|
|
2328
|
+
],
|
|
2329
|
+
name: "InvalidETHValue"
|
|
2330
|
+
},
|
|
691
2331
|
{ type: "error", inputs: [], name: "InvalidValue" },
|
|
692
2332
|
{ type: "error", inputs: [], name: "ONLY_OWNER" },
|
|
693
2333
|
{ type: "error", inputs: [], name: "ONLY_PENDING_OWNER" },
|
|
@@ -717,12 +2357,111 @@ var erc20MinterAddress = {
|
|
|
717
2357
|
421614: "0x777777E8850d8D6d98De2B5f64fae401F96eFF31",
|
|
718
2358
|
7777777: "0x777777E8850d8D6d98De2B5f64fae401F96eFF31",
|
|
719
2359
|
11155111: "0x777777E8850d8D6d98De2B5f64fae401F96eFF31",
|
|
720
|
-
999999999: "
|
|
2360
|
+
999999999: "0x8Ec7f068A77fa5FC1925110f82381374BA054Ff2"
|
|
721
2361
|
};
|
|
722
2362
|
var erc20MinterConfig = {
|
|
723
2363
|
address: erc20MinterAddress,
|
|
724
2364
|
abi: erc20MinterABI
|
|
725
2365
|
};
|
|
2366
|
+
var iPremintDefinitionsABI = [
|
|
2367
|
+
{
|
|
2368
|
+
stateMutability: "nonpayable",
|
|
2369
|
+
type: "function",
|
|
2370
|
+
inputs: [
|
|
2371
|
+
{
|
|
2372
|
+
name: "",
|
|
2373
|
+
internalType: "struct TokenCreationConfig",
|
|
2374
|
+
type: "tuple",
|
|
2375
|
+
components: [
|
|
2376
|
+
{ name: "tokenURI", internalType: "string", type: "string" },
|
|
2377
|
+
{ name: "maxSupply", internalType: "uint256", type: "uint256" },
|
|
2378
|
+
{
|
|
2379
|
+
name: "maxTokensPerAddress",
|
|
2380
|
+
internalType: "uint64",
|
|
2381
|
+
type: "uint64"
|
|
2382
|
+
},
|
|
2383
|
+
{ name: "pricePerToken", internalType: "uint96", type: "uint96" },
|
|
2384
|
+
{ name: "mintStart", internalType: "uint64", type: "uint64" },
|
|
2385
|
+
{ name: "mintDuration", internalType: "uint64", type: "uint64" },
|
|
2386
|
+
{
|
|
2387
|
+
name: "royaltyMintSchedule",
|
|
2388
|
+
internalType: "uint32",
|
|
2389
|
+
type: "uint32"
|
|
2390
|
+
},
|
|
2391
|
+
{ name: "royaltyBPS", internalType: "uint32", type: "uint32" },
|
|
2392
|
+
{
|
|
2393
|
+
name: "royaltyRecipient",
|
|
2394
|
+
internalType: "address",
|
|
2395
|
+
type: "address"
|
|
2396
|
+
},
|
|
2397
|
+
{
|
|
2398
|
+
name: "fixedPriceMinter",
|
|
2399
|
+
internalType: "address",
|
|
2400
|
+
type: "address"
|
|
2401
|
+
}
|
|
2402
|
+
]
|
|
2403
|
+
}
|
|
2404
|
+
],
|
|
2405
|
+
name: "tokenConfigV1Definition",
|
|
2406
|
+
outputs: []
|
|
2407
|
+
},
|
|
2408
|
+
{
|
|
2409
|
+
stateMutability: "nonpayable",
|
|
2410
|
+
type: "function",
|
|
2411
|
+
inputs: [
|
|
2412
|
+
{
|
|
2413
|
+
name: "",
|
|
2414
|
+
internalType: "struct TokenCreationConfigV2",
|
|
2415
|
+
type: "tuple",
|
|
2416
|
+
components: [
|
|
2417
|
+
{ name: "tokenURI", internalType: "string", type: "string" },
|
|
2418
|
+
{ name: "maxSupply", internalType: "uint256", type: "uint256" },
|
|
2419
|
+
{
|
|
2420
|
+
name: "maxTokensPerAddress",
|
|
2421
|
+
internalType: "uint64",
|
|
2422
|
+
type: "uint64"
|
|
2423
|
+
},
|
|
2424
|
+
{ name: "pricePerToken", internalType: "uint96", type: "uint96" },
|
|
2425
|
+
{ name: "mintStart", internalType: "uint64", type: "uint64" },
|
|
2426
|
+
{ name: "mintDuration", internalType: "uint64", type: "uint64" },
|
|
2427
|
+
{ name: "royaltyBPS", internalType: "uint32", type: "uint32" },
|
|
2428
|
+
{ name: "payoutRecipient", internalType: "address", type: "address" },
|
|
2429
|
+
{
|
|
2430
|
+
name: "fixedPriceMinter",
|
|
2431
|
+
internalType: "address",
|
|
2432
|
+
type: "address"
|
|
2433
|
+
},
|
|
2434
|
+
{ name: "createReferral", internalType: "address", type: "address" }
|
|
2435
|
+
]
|
|
2436
|
+
}
|
|
2437
|
+
],
|
|
2438
|
+
name: "tokenConfigV2Definition",
|
|
2439
|
+
outputs: []
|
|
2440
|
+
},
|
|
2441
|
+
{
|
|
2442
|
+
stateMutability: "nonpayable",
|
|
2443
|
+
type: "function",
|
|
2444
|
+
inputs: [
|
|
2445
|
+
{
|
|
2446
|
+
name: "",
|
|
2447
|
+
internalType: "struct TokenCreationConfigV3",
|
|
2448
|
+
type: "tuple",
|
|
2449
|
+
components: [
|
|
2450
|
+
{ name: "tokenURI", internalType: "string", type: "string" },
|
|
2451
|
+
{ name: "maxSupply", internalType: "uint256", type: "uint256" },
|
|
2452
|
+
{ name: "royaltyBPS", internalType: "uint32", type: "uint32" },
|
|
2453
|
+
{ name: "payoutRecipient", internalType: "address", type: "address" },
|
|
2454
|
+
{ name: "createReferral", internalType: "address", type: "address" },
|
|
2455
|
+
{ name: "mintStart", internalType: "uint64", type: "uint64" },
|
|
2456
|
+
{ name: "minter", internalType: "address", type: "address" },
|
|
2457
|
+
{ name: "premintSalesConfig", internalType: "bytes", type: "bytes" }
|
|
2458
|
+
]
|
|
2459
|
+
}
|
|
2460
|
+
],
|
|
2461
|
+
name: "tokenConfigV3Definition",
|
|
2462
|
+
outputs: []
|
|
2463
|
+
}
|
|
2464
|
+
];
|
|
726
2465
|
var iUnwrapAndForwardActionABI = [
|
|
727
2466
|
{
|
|
728
2467
|
stateMutability: "payable",
|
|
@@ -824,6 +2563,7 @@ var mintsEthUnwrapperAndCallerABI = [
|
|
|
824
2563
|
{ type: "error", inputs: [], name: "UnknownUserAction" }
|
|
825
2564
|
];
|
|
826
2565
|
var mintsEthUnwrapperAndCallerAddress = {
|
|
2566
|
+
84532: "0xb0994EB9520C98C97e1F3953a5964535C2bd271A",
|
|
827
2567
|
7777777: "0xb0994EB9520C98C97e1F3953a5964535C2bd271A",
|
|
828
2568
|
999999999: "0xb0994EB9520C98C97e1F3953a5964535C2bd271A"
|
|
829
2569
|
};
|
|
@@ -1254,6 +2994,19 @@ var zoraCreator1155FactoryImplABI = [
|
|
|
1254
2994
|
name: "deterministicContractAddress",
|
|
1255
2995
|
outputs: [{ name: "", internalType: "address", type: "address" }]
|
|
1256
2996
|
},
|
|
2997
|
+
{
|
|
2998
|
+
stateMutability: "view",
|
|
2999
|
+
type: "function",
|
|
3000
|
+
inputs: [
|
|
3001
|
+
{ name: "msgSender", internalType: "address", type: "address" },
|
|
3002
|
+
{ name: "newContractURI", internalType: "string", type: "string" },
|
|
3003
|
+
{ name: "name", internalType: "string", type: "string" },
|
|
3004
|
+
{ name: "contractAdmin", internalType: "address", type: "address" },
|
|
3005
|
+
{ name: "setupActions", internalType: "bytes[]", type: "bytes[]" }
|
|
3006
|
+
],
|
|
3007
|
+
name: "deterministicContractAddressWithSetupActions",
|
|
3008
|
+
outputs: [{ name: "", internalType: "address", type: "address" }]
|
|
3009
|
+
},
|
|
1257
3010
|
{
|
|
1258
3011
|
stateMutability: "view",
|
|
1259
3012
|
type: "function",
|
|
@@ -1579,7 +3332,7 @@ var zoraCreator1155FactoryImplAddress = {
|
|
|
1579
3332
|
8453: "0x777777C338d93e2C7adf08D102d45CA7CC4Ed021",
|
|
1580
3333
|
42161: "0x777777C338d93e2C7adf08D102d45CA7CC4Ed021",
|
|
1581
3334
|
81457: "0x777777C338d93e2C7adf08D102d45CA7CC4Ed021",
|
|
1582
|
-
84532: "
|
|
3335
|
+
84532: "0x777777C338d93e2C7adf08D102d45CA7CC4Ed021",
|
|
1583
3336
|
421614: "0x777777C338d93e2C7adf08D102d45CA7CC4Ed021",
|
|
1584
3337
|
7777777: "0x777777C338d93e2C7adf08D102d45CA7CC4Ed021",
|
|
1585
3338
|
11155111: "0x777777C338d93e2C7adf08D102d45CA7CC4Ed021",
|
|
@@ -3010,6 +4763,13 @@ var zoraCreator1155PremintExecutorImplABI = [
|
|
|
3010
4763
|
name: "contractName",
|
|
3011
4764
|
outputs: [{ name: "", internalType: "string", type: "string" }]
|
|
3012
4765
|
},
|
|
4766
|
+
{
|
|
4767
|
+
stateMutability: "pure",
|
|
4768
|
+
type: "function",
|
|
4769
|
+
inputs: [],
|
|
4770
|
+
name: "contractVersion",
|
|
4771
|
+
outputs: [{ name: "", internalType: "string", type: "string" }]
|
|
4772
|
+
},
|
|
3013
4773
|
{
|
|
3014
4774
|
stateMutability: "view",
|
|
3015
4775
|
type: "function",
|
|
@@ -3028,6 +4788,29 @@ var zoraCreator1155PremintExecutorImplABI = [
|
|
|
3028
4788
|
name: "getContractAddress",
|
|
3029
4789
|
outputs: [{ name: "", internalType: "address", type: "address" }]
|
|
3030
4790
|
},
|
|
4791
|
+
{
|
|
4792
|
+
stateMutability: "view",
|
|
4793
|
+
type: "function",
|
|
4794
|
+
inputs: [
|
|
4795
|
+
{
|
|
4796
|
+
name: "contractConfig",
|
|
4797
|
+
internalType: "struct ContractWithAdditionalAdminsCreationConfig",
|
|
4798
|
+
type: "tuple",
|
|
4799
|
+
components: [
|
|
4800
|
+
{ name: "contractAdmin", internalType: "address", type: "address" },
|
|
4801
|
+
{ name: "contractURI", internalType: "string", type: "string" },
|
|
4802
|
+
{ name: "contractName", internalType: "string", type: "string" },
|
|
4803
|
+
{
|
|
4804
|
+
name: "additionalAdmins",
|
|
4805
|
+
internalType: "address[]",
|
|
4806
|
+
type: "address[]"
|
|
4807
|
+
}
|
|
4808
|
+
]
|
|
4809
|
+
}
|
|
4810
|
+
],
|
|
4811
|
+
name: "getContractWithAdditionalAdminsAddress",
|
|
4812
|
+
outputs: [{ name: "", internalType: "address", type: "address" }]
|
|
4813
|
+
},
|
|
3031
4814
|
{
|
|
3032
4815
|
stateMutability: "view",
|
|
3033
4816
|
type: "function",
|
|
@@ -3059,6 +4842,26 @@ var zoraCreator1155PremintExecutorImplABI = [
|
|
|
3059
4842
|
name: "isAuthorizedToCreatePremint",
|
|
3060
4843
|
outputs: [{ name: "isAuthorized", internalType: "bool", type: "bool" }]
|
|
3061
4844
|
},
|
|
4845
|
+
{
|
|
4846
|
+
stateMutability: "view",
|
|
4847
|
+
type: "function",
|
|
4848
|
+
inputs: [
|
|
4849
|
+
{ name: "signer", internalType: "address", type: "address" },
|
|
4850
|
+
{
|
|
4851
|
+
name: "premintContractConfigContractAdmin",
|
|
4852
|
+
internalType: "address",
|
|
4853
|
+
type: "address"
|
|
4854
|
+
},
|
|
4855
|
+
{ name: "contractAddress", internalType: "address", type: "address" },
|
|
4856
|
+
{
|
|
4857
|
+
name: "additionalAdmins",
|
|
4858
|
+
internalType: "address[]",
|
|
4859
|
+
type: "address[]"
|
|
4860
|
+
}
|
|
4861
|
+
],
|
|
4862
|
+
name: "isAuthorizedToCreatePremintWithAdditionalAdmins",
|
|
4863
|
+
outputs: [{ name: "isAuthorized", internalType: "bool", type: "bool" }]
|
|
4864
|
+
},
|
|
3062
4865
|
{
|
|
3063
4866
|
stateMutability: "view",
|
|
3064
4867
|
type: "function",
|
|
@@ -3149,61 +4952,39 @@ var zoraCreator1155PremintExecutorImplABI = [
|
|
|
3149
4952
|
outputs: [{ name: "", internalType: "address", type: "address" }]
|
|
3150
4953
|
},
|
|
3151
4954
|
{
|
|
3152
|
-
stateMutability: "
|
|
4955
|
+
stateMutability: "payable",
|
|
3153
4956
|
type: "function",
|
|
3154
4957
|
inputs: [
|
|
3155
4958
|
{
|
|
3156
4959
|
name: "contractConfig",
|
|
3157
|
-
internalType: "struct
|
|
4960
|
+
internalType: "struct ContractWithAdditionalAdminsCreationConfig",
|
|
3158
4961
|
type: "tuple",
|
|
3159
4962
|
components: [
|
|
3160
4963
|
{ name: "contractAdmin", internalType: "address", type: "address" },
|
|
3161
4964
|
{ name: "contractURI", internalType: "string", type: "string" },
|
|
3162
|
-
{ name: "contractName", internalType: "string", type: "string" }
|
|
4965
|
+
{ name: "contractName", internalType: "string", type: "string" },
|
|
4966
|
+
{
|
|
4967
|
+
name: "additionalAdmins",
|
|
4968
|
+
internalType: "address[]",
|
|
4969
|
+
type: "address[]"
|
|
4970
|
+
}
|
|
3163
4971
|
]
|
|
3164
4972
|
},
|
|
4973
|
+
{ name: "premintCollection", internalType: "address", type: "address" },
|
|
3165
4974
|
{
|
|
3166
|
-
name: "
|
|
3167
|
-
internalType: "struct
|
|
4975
|
+
name: "encodedPremintConfig",
|
|
4976
|
+
internalType: "struct PremintConfigEncoded",
|
|
3168
4977
|
type: "tuple",
|
|
3169
4978
|
components: [
|
|
3170
|
-
{
|
|
3171
|
-
name: "tokenConfig",
|
|
3172
|
-
internalType: "struct Erc20TokenCreationConfigV1",
|
|
3173
|
-
type: "tuple",
|
|
3174
|
-
components: [
|
|
3175
|
-
{ name: "tokenURI", internalType: "string", type: "string" },
|
|
3176
|
-
{ name: "maxSupply", internalType: "uint256", type: "uint256" },
|
|
3177
|
-
{ name: "royaltyBPS", internalType: "uint32", type: "uint32" },
|
|
3178
|
-
{
|
|
3179
|
-
name: "payoutRecipient",
|
|
3180
|
-
internalType: "address",
|
|
3181
|
-
type: "address"
|
|
3182
|
-
},
|
|
3183
|
-
{
|
|
3184
|
-
name: "createReferral",
|
|
3185
|
-
internalType: "address",
|
|
3186
|
-
type: "address"
|
|
3187
|
-
},
|
|
3188
|
-
{ name: "erc20Minter", internalType: "address", type: "address" },
|
|
3189
|
-
{ name: "mintStart", internalType: "uint64", type: "uint64" },
|
|
3190
|
-
{ name: "mintDuration", internalType: "uint64", type: "uint64" },
|
|
3191
|
-
{
|
|
3192
|
-
name: "maxTokensPerAddress",
|
|
3193
|
-
internalType: "uint64",
|
|
3194
|
-
type: "uint64"
|
|
3195
|
-
},
|
|
3196
|
-
{ name: "currency", internalType: "address", type: "address" },
|
|
3197
|
-
{
|
|
3198
|
-
name: "pricePerToken",
|
|
3199
|
-
internalType: "uint256",
|
|
3200
|
-
type: "uint256"
|
|
3201
|
-
}
|
|
3202
|
-
]
|
|
3203
|
-
},
|
|
3204
4979
|
{ name: "uid", internalType: "uint32", type: "uint32" },
|
|
3205
4980
|
{ name: "version", internalType: "uint32", type: "uint32" },
|
|
3206
|
-
{ name: "deleted", internalType: "bool", type: "bool" }
|
|
4981
|
+
{ name: "deleted", internalType: "bool", type: "bool" },
|
|
4982
|
+
{ name: "tokenConfig", internalType: "bytes", type: "bytes" },
|
|
4983
|
+
{
|
|
4984
|
+
name: "premintConfigVersion",
|
|
4985
|
+
internalType: "bytes32",
|
|
4986
|
+
type: "bytes32"
|
|
4987
|
+
}
|
|
3207
4988
|
]
|
|
3208
4989
|
},
|
|
3209
4990
|
{ name: "signature", internalType: "bytes", type: "bytes" },
|
|
@@ -3225,10 +5006,10 @@ var zoraCreator1155PremintExecutorImplABI = [
|
|
|
3225
5006
|
{ name: "firstMinter", internalType: "address", type: "address" },
|
|
3226
5007
|
{ name: "signerContract", internalType: "address", type: "address" }
|
|
3227
5008
|
],
|
|
3228
|
-
name: "
|
|
5009
|
+
name: "premint",
|
|
3229
5010
|
outputs: [
|
|
3230
5011
|
{
|
|
3231
|
-
name: "
|
|
5012
|
+
name: "premintResult",
|
|
3232
5013
|
internalType: "struct PremintResult",
|
|
3233
5014
|
type: "tuple",
|
|
3234
5015
|
components: [
|
|
@@ -3329,7 +5110,7 @@ var zoraCreator1155PremintExecutorImplABI = [
|
|
|
3329
5110
|
name: "premintV1",
|
|
3330
5111
|
outputs: [
|
|
3331
5112
|
{
|
|
3332
|
-
name: "
|
|
5113
|
+
name: "",
|
|
3333
5114
|
internalType: "struct PremintResult",
|
|
3334
5115
|
type: "tuple",
|
|
3335
5116
|
components: [
|
|
@@ -3417,97 +5198,7 @@ var zoraCreator1155PremintExecutorImplABI = [
|
|
|
3417
5198
|
name: "premintV2",
|
|
3418
5199
|
outputs: [
|
|
3419
5200
|
{
|
|
3420
|
-
name: "
|
|
3421
|
-
internalType: "struct PremintResult",
|
|
3422
|
-
type: "tuple",
|
|
3423
|
-
components: [
|
|
3424
|
-
{ name: "contractAddress", internalType: "address", type: "address" },
|
|
3425
|
-
{ name: "tokenId", internalType: "uint256", type: "uint256" },
|
|
3426
|
-
{ name: "createdNewContract", internalType: "bool", type: "bool" }
|
|
3427
|
-
]
|
|
3428
|
-
}
|
|
3429
|
-
]
|
|
3430
|
-
},
|
|
3431
|
-
{
|
|
3432
|
-
stateMutability: "payable",
|
|
3433
|
-
type: "function",
|
|
3434
|
-
inputs: [
|
|
3435
|
-
{
|
|
3436
|
-
name: "contractConfig",
|
|
3437
|
-
internalType: "struct ContractCreationConfig",
|
|
3438
|
-
type: "tuple",
|
|
3439
|
-
components: [
|
|
3440
|
-
{ name: "contractAdmin", internalType: "address", type: "address" },
|
|
3441
|
-
{ name: "contractURI", internalType: "string", type: "string" },
|
|
3442
|
-
{ name: "contractName", internalType: "string", type: "string" }
|
|
3443
|
-
]
|
|
3444
|
-
},
|
|
3445
|
-
{
|
|
3446
|
-
name: "premintConfig",
|
|
3447
|
-
internalType: "struct PremintConfigV2",
|
|
3448
|
-
type: "tuple",
|
|
3449
|
-
components: [
|
|
3450
|
-
{
|
|
3451
|
-
name: "tokenConfig",
|
|
3452
|
-
internalType: "struct TokenCreationConfigV2",
|
|
3453
|
-
type: "tuple",
|
|
3454
|
-
components: [
|
|
3455
|
-
{ name: "tokenURI", internalType: "string", type: "string" },
|
|
3456
|
-
{ name: "maxSupply", internalType: "uint256", type: "uint256" },
|
|
3457
|
-
{
|
|
3458
|
-
name: "maxTokensPerAddress",
|
|
3459
|
-
internalType: "uint64",
|
|
3460
|
-
type: "uint64"
|
|
3461
|
-
},
|
|
3462
|
-
{ name: "pricePerToken", internalType: "uint96", type: "uint96" },
|
|
3463
|
-
{ name: "mintStart", internalType: "uint64", type: "uint64" },
|
|
3464
|
-
{ name: "mintDuration", internalType: "uint64", type: "uint64" },
|
|
3465
|
-
{ name: "royaltyBPS", internalType: "uint32", type: "uint32" },
|
|
3466
|
-
{
|
|
3467
|
-
name: "payoutRecipient",
|
|
3468
|
-
internalType: "address",
|
|
3469
|
-
type: "address"
|
|
3470
|
-
},
|
|
3471
|
-
{
|
|
3472
|
-
name: "fixedPriceMinter",
|
|
3473
|
-
internalType: "address",
|
|
3474
|
-
type: "address"
|
|
3475
|
-
},
|
|
3476
|
-
{
|
|
3477
|
-
name: "createReferral",
|
|
3478
|
-
internalType: "address",
|
|
3479
|
-
type: "address"
|
|
3480
|
-
}
|
|
3481
|
-
]
|
|
3482
|
-
},
|
|
3483
|
-
{ name: "uid", internalType: "uint32", type: "uint32" },
|
|
3484
|
-
{ name: "version", internalType: "uint32", type: "uint32" },
|
|
3485
|
-
{ name: "deleted", internalType: "bool", type: "bool" }
|
|
3486
|
-
]
|
|
3487
|
-
},
|
|
3488
|
-
{ name: "signature", internalType: "bytes", type: "bytes" },
|
|
3489
|
-
{ name: "quantityToMint", internalType: "uint256", type: "uint256" },
|
|
3490
|
-
{
|
|
3491
|
-
name: "mintArguments",
|
|
3492
|
-
internalType: "struct MintArguments",
|
|
3493
|
-
type: "tuple",
|
|
3494
|
-
components: [
|
|
3495
|
-
{ name: "mintRecipient", internalType: "address", type: "address" },
|
|
3496
|
-
{ name: "mintComment", internalType: "string", type: "string" },
|
|
3497
|
-
{
|
|
3498
|
-
name: "mintRewardsRecipients",
|
|
3499
|
-
internalType: "address[]",
|
|
3500
|
-
type: "address[]"
|
|
3501
|
-
}
|
|
3502
|
-
]
|
|
3503
|
-
},
|
|
3504
|
-
{ name: "firstMinter", internalType: "address", type: "address" },
|
|
3505
|
-
{ name: "signerContract", internalType: "address", type: "address" }
|
|
3506
|
-
],
|
|
3507
|
-
name: "premintV2WithSignerContract",
|
|
3508
|
-
outputs: [
|
|
3509
|
-
{
|
|
3510
|
-
name: "result",
|
|
5201
|
+
name: "",
|
|
3511
5202
|
internalType: "struct PremintResult",
|
|
3512
5203
|
type: "tuple",
|
|
3513
5204
|
components: [
|
|
@@ -4005,6 +5696,7 @@ var zoraCreator1155PremintExecutorImplAddress = {
|
|
|
4005
5696
|
8453: "0x7777773606e7e46C8Ba8B98C08f5cD218e31d340",
|
|
4006
5697
|
42161: "0x7777773606e7e46C8Ba8B98C08f5cD218e31d340",
|
|
4007
5698
|
81457: "0x7777773606e7e46C8Ba8B98C08f5cD218e31d340",
|
|
5699
|
+
84532: "0x7777773606e7e46C8Ba8B98C08f5cD218e31d340",
|
|
4008
5700
|
421614: "0x7777773606e7e46C8Ba8B98C08f5cD218e31d340",
|
|
4009
5701
|
7777777: "0x7777773606e7e46C8Ba8B98C08f5cD218e31d340",
|
|
4010
5702
|
11155111: "0x7777773606e7e46C8Ba8B98C08f5cD218e31d340",
|
|
@@ -5408,6 +7100,7 @@ var zoraMints1155ABI = [
|
|
|
5408
7100
|
{ type: "error", inputs: [], name: "TokenNotMintable" }
|
|
5409
7101
|
];
|
|
5410
7102
|
var zoraMints1155Address = {
|
|
7103
|
+
84532: "0x7777777d57c1C6e472fa379b7b3B6c6ba3835073",
|
|
5411
7104
|
7777777: "0x7777777d57c1C6e472fa379b7b3B6c6ba3835073",
|
|
5412
7105
|
999999999: "0x7777777d57c1C6e472fa379b7b3B6c6ba3835073"
|
|
5413
7106
|
};
|
|
@@ -5422,7 +7115,7 @@ var zoraMintsManagerImplABI = [
|
|
|
5422
7115
|
inputs: [
|
|
5423
7116
|
{
|
|
5424
7117
|
name: "_premintExecutor",
|
|
5425
|
-
internalType: "contract
|
|
7118
|
+
internalType: "contract IZoraCreator1155PremintExecutorAllVersions",
|
|
5426
7119
|
type: "address"
|
|
5427
7120
|
}
|
|
5428
7121
|
]
|
|
@@ -5500,6 +7193,73 @@ var zoraMintsManagerImplABI = [
|
|
|
5500
7193
|
name: "collect",
|
|
5501
7194
|
outputs: []
|
|
5502
7195
|
},
|
|
7196
|
+
{
|
|
7197
|
+
stateMutability: "payable",
|
|
7198
|
+
type: "function",
|
|
7199
|
+
inputs: [
|
|
7200
|
+
{
|
|
7201
|
+
name: "contractConfig",
|
|
7202
|
+
internalType: "struct ContractWithAdditionalAdminsCreationConfig",
|
|
7203
|
+
type: "tuple",
|
|
7204
|
+
components: [
|
|
7205
|
+
{ name: "contractAdmin", internalType: "address", type: "address" },
|
|
7206
|
+
{ name: "contractURI", internalType: "string", type: "string" },
|
|
7207
|
+
{ name: "contractName", internalType: "string", type: "string" },
|
|
7208
|
+
{
|
|
7209
|
+
name: "additionalAdmins",
|
|
7210
|
+
internalType: "address[]",
|
|
7211
|
+
type: "address[]"
|
|
7212
|
+
}
|
|
7213
|
+
]
|
|
7214
|
+
},
|
|
7215
|
+
{ name: "tokenContract", internalType: "address", type: "address" },
|
|
7216
|
+
{
|
|
7217
|
+
name: "premintConfig",
|
|
7218
|
+
internalType: "struct PremintConfigEncoded",
|
|
7219
|
+
type: "tuple",
|
|
7220
|
+
components: [
|
|
7221
|
+
{ name: "uid", internalType: "uint32", type: "uint32" },
|
|
7222
|
+
{ name: "version", internalType: "uint32", type: "uint32" },
|
|
7223
|
+
{ name: "deleted", internalType: "bool", type: "bool" },
|
|
7224
|
+
{ name: "tokenConfig", internalType: "bytes", type: "bytes" },
|
|
7225
|
+
{
|
|
7226
|
+
name: "premintConfigVersion",
|
|
7227
|
+
internalType: "bytes32",
|
|
7228
|
+
type: "bytes32"
|
|
7229
|
+
}
|
|
7230
|
+
]
|
|
7231
|
+
},
|
|
7232
|
+
{ name: "signature", internalType: "bytes", type: "bytes" },
|
|
7233
|
+
{
|
|
7234
|
+
name: "mintArguments",
|
|
7235
|
+
internalType: "struct MintArguments",
|
|
7236
|
+
type: "tuple",
|
|
7237
|
+
components: [
|
|
7238
|
+
{ name: "mintRecipient", internalType: "address", type: "address" },
|
|
7239
|
+
{ name: "mintComment", internalType: "string", type: "string" },
|
|
7240
|
+
{
|
|
7241
|
+
name: "mintRewardsRecipients",
|
|
7242
|
+
internalType: "address[]",
|
|
7243
|
+
type: "address[]"
|
|
7244
|
+
}
|
|
7245
|
+
]
|
|
7246
|
+
},
|
|
7247
|
+
{ name: "signerContract", internalType: "address", type: "address" }
|
|
7248
|
+
],
|
|
7249
|
+
name: "collectPremint",
|
|
7250
|
+
outputs: [
|
|
7251
|
+
{
|
|
7252
|
+
name: "result",
|
|
7253
|
+
internalType: "struct PremintResult",
|
|
7254
|
+
type: "tuple",
|
|
7255
|
+
components: [
|
|
7256
|
+
{ name: "contractAddress", internalType: "address", type: "address" },
|
|
7257
|
+
{ name: "tokenId", internalType: "uint256", type: "uint256" },
|
|
7258
|
+
{ name: "createdNewContract", internalType: "bool", type: "bool" }
|
|
7259
|
+
]
|
|
7260
|
+
}
|
|
7261
|
+
]
|
|
7262
|
+
},
|
|
5503
7263
|
{
|
|
5504
7264
|
stateMutability: "payable",
|
|
5505
7265
|
type: "function",
|
|
@@ -6235,6 +7995,7 @@ var zoraMintsManagerImplABI = [
|
|
|
6235
7995
|
{ type: "error", inputs: [], name: "premintSignerContractNotAContract" }
|
|
6236
7996
|
];
|
|
6237
7997
|
var zoraMintsManagerImplAddress = {
|
|
7998
|
+
84532: "0x77777770cA269366c7208aFcF36FE2C6F7f7608B",
|
|
6238
7999
|
7777777: "0x77777770cA269366c7208aFcF36FE2C6F7f7608B",
|
|
6239
8000
|
999999999: "0x77777770cA269366c7208aFcF36FE2C6F7f7608B"
|
|
6240
8001
|
};
|
|
@@ -6243,15 +8004,29 @@ var zoraMintsManagerImplConfig = {
|
|
|
6243
8004
|
abi: zoraMintsManagerImplABI
|
|
6244
8005
|
};
|
|
6245
8006
|
|
|
8007
|
+
// node_modules/viem/_esm/index.js
|
|
8008
|
+
init_encodeAbiParameters();
|
|
8009
|
+
init_getAbiItem();
|
|
8010
|
+
init_toHex();
|
|
8011
|
+
init_keccak256();
|
|
8012
|
+
|
|
8013
|
+
// src/types.ts
|
|
8014
|
+
var PremintConfigVersion = /* @__PURE__ */ ((PremintConfigVersion2) => {
|
|
8015
|
+
PremintConfigVersion2["V1"] = "1";
|
|
8016
|
+
PremintConfigVersion2["V2"] = "2";
|
|
8017
|
+
PremintConfigVersion2["V3"] = "3";
|
|
8018
|
+
return PremintConfigVersion2;
|
|
8019
|
+
})(PremintConfigVersion || {});
|
|
8020
|
+
|
|
6246
8021
|
// src/typedData.ts
|
|
6247
8022
|
var premintTypedDataDomain = ({
|
|
6248
8023
|
chainId,
|
|
6249
|
-
version,
|
|
8024
|
+
version: version2,
|
|
6250
8025
|
creator1155Contract: verifyingContract
|
|
6251
8026
|
}) => ({
|
|
6252
8027
|
chainId,
|
|
6253
8028
|
name: "Preminter",
|
|
6254
|
-
version,
|
|
8029
|
+
version: version2,
|
|
6255
8030
|
verifyingContract
|
|
6256
8031
|
});
|
|
6257
8032
|
var premintV1TypedDataType = {
|
|
@@ -6278,6 +8053,58 @@ var premintV1TypedDataType = {
|
|
|
6278
8053
|
{ name: "fixedPriceMinter", type: "address" }
|
|
6279
8054
|
]
|
|
6280
8055
|
};
|
|
8056
|
+
var encodeTokenConfigV1 = (config) => {
|
|
8057
|
+
const abiItem = getAbiItem({
|
|
8058
|
+
abi: iPremintDefinitionsABI,
|
|
8059
|
+
name: "tokenConfigV1Definition"
|
|
8060
|
+
});
|
|
8061
|
+
return encodeAbiParameters(abiItem.inputs, [config]);
|
|
8062
|
+
};
|
|
8063
|
+
var encodeTokenConfigV2 = (config) => {
|
|
8064
|
+
const abiItem = getAbiItem({
|
|
8065
|
+
abi: iPremintDefinitionsABI,
|
|
8066
|
+
name: "tokenConfigV2Definition"
|
|
8067
|
+
});
|
|
8068
|
+
return encodeAbiParameters(abiItem.inputs, [config]);
|
|
8069
|
+
};
|
|
8070
|
+
var encodeTokenConfigV3 = (config) => {
|
|
8071
|
+
const abiItem = getAbiItem({
|
|
8072
|
+
abi: iPremintDefinitionsABI,
|
|
8073
|
+
name: "tokenConfigV3Definition"
|
|
8074
|
+
});
|
|
8075
|
+
return encodeAbiParameters(abiItem.inputs, [config]);
|
|
8076
|
+
};
|
|
8077
|
+
var encodeTokenConfig = ({
|
|
8078
|
+
tokenConfig,
|
|
8079
|
+
premintConfigVersion
|
|
8080
|
+
}) => {
|
|
8081
|
+
if (premintConfigVersion === "1" /* V1 */) {
|
|
8082
|
+
return encodeTokenConfigV1(tokenConfig);
|
|
8083
|
+
}
|
|
8084
|
+
if (premintConfigVersion === "2" /* V2 */) {
|
|
8085
|
+
return encodeTokenConfigV2(tokenConfig);
|
|
8086
|
+
}
|
|
8087
|
+
if (premintConfigVersion === "3" /* V3 */) {
|
|
8088
|
+
return encodeTokenConfigV3(tokenConfig);
|
|
8089
|
+
}
|
|
8090
|
+
throw new Error("Invalid PremintConfigVersion: " + premintConfigVersion);
|
|
8091
|
+
};
|
|
8092
|
+
var encodePremintConfig = ({
|
|
8093
|
+
premintConfig,
|
|
8094
|
+
premintConfigVersion
|
|
8095
|
+
}) => {
|
|
8096
|
+
const encodedTokenConfig = encodeTokenConfig({
|
|
8097
|
+
premintConfigVersion,
|
|
8098
|
+
tokenConfig: premintConfig.tokenConfig
|
|
8099
|
+
});
|
|
8100
|
+
return {
|
|
8101
|
+
deleted: premintConfig.deleted,
|
|
8102
|
+
uid: premintConfig.uid,
|
|
8103
|
+
version: premintConfig.version,
|
|
8104
|
+
premintConfigVersion: keccak256(toHex(premintConfigVersion)),
|
|
8105
|
+
tokenConfig: encodedTokenConfig
|
|
8106
|
+
};
|
|
8107
|
+
};
|
|
6281
8108
|
var premintV1TypedDataDefinition = ({
|
|
6282
8109
|
chainId,
|
|
6283
8110
|
creator1155Contract,
|
|
@@ -6287,7 +8114,7 @@ var premintV1TypedDataDefinition = ({
|
|
|
6287
8114
|
primaryType: "CreatorAttribution",
|
|
6288
8115
|
domain: premintTypedDataDomain({
|
|
6289
8116
|
chainId,
|
|
6290
|
-
version: "1"
|
|
8117
|
+
version: "1" /* V1 */,
|
|
6291
8118
|
creator1155Contract
|
|
6292
8119
|
}),
|
|
6293
8120
|
message
|
|
@@ -6325,11 +8152,32 @@ var premintV2TypedDataDefinition = ({
|
|
|
6325
8152
|
primaryType: "CreatorAttribution",
|
|
6326
8153
|
domain: premintTypedDataDomain({
|
|
6327
8154
|
chainId,
|
|
6328
|
-
version: "2"
|
|
8155
|
+
version: "2" /* V2 */,
|
|
6329
8156
|
creator1155Contract
|
|
6330
8157
|
}),
|
|
6331
8158
|
message
|
|
6332
8159
|
});
|
|
8160
|
+
var premintTypedDataDefinition = ({
|
|
8161
|
+
verifyingContract,
|
|
8162
|
+
chainId,
|
|
8163
|
+
premintConfigVersion: version2,
|
|
8164
|
+
premintConfig
|
|
8165
|
+
}) => {
|
|
8166
|
+
if (version2 === "1" /* V1 */)
|
|
8167
|
+
return premintV1TypedDataDefinition({
|
|
8168
|
+
chainId,
|
|
8169
|
+
creator1155Contract: verifyingContract,
|
|
8170
|
+
message: premintConfig
|
|
8171
|
+
});
|
|
8172
|
+
if (version2 === "2" /* V2 */) {
|
|
8173
|
+
return premintV2TypedDataDefinition({
|
|
8174
|
+
chainId,
|
|
8175
|
+
creator1155Contract: verifyingContract,
|
|
8176
|
+
message: premintConfig
|
|
8177
|
+
});
|
|
8178
|
+
}
|
|
8179
|
+
throw new Error(`Invalid version ${version2}`);
|
|
8180
|
+
};
|
|
6333
8181
|
var permitSafeTransferTypedDataType = {
|
|
6334
8182
|
PermitSafeTransfer: [
|
|
6335
8183
|
{ name: "owner", type: "address" },
|
|
@@ -6440,8 +8288,8 @@ var chainConfigs = {
|
|
|
6440
8288
|
PROTOCOL_REWARDS: "0x7777777F279eba3d3Ad8F4E708545291A6fDBA8B"
|
|
6441
8289
|
},
|
|
6442
8290
|
84532: {
|
|
6443
|
-
FACTORY_OWNER: "
|
|
6444
|
-
MINT_FEE_RECIPIENT: "
|
|
8291
|
+
FACTORY_OWNER: "0x5F14C23983c9e0840Dc60dA880349622f0785420",
|
|
8292
|
+
MINT_FEE_RECIPIENT: "0x5F14C23983c9e0840Dc60dA880349622f0785420",
|
|
6445
8293
|
PROTOCOL_REWARDS: "0x7777777F279eba3d3Ad8F4E708545291A6fDBA8B"
|
|
6446
8294
|
},
|
|
6447
8295
|
421614: {
|
|
@@ -6555,18 +8403,18 @@ var addresses = {
|
|
|
6555
8403
|
timestamp: 1709235955
|
|
6556
8404
|
},
|
|
6557
8405
|
84532: {
|
|
6558
|
-
CONTRACT_1155_IMPL: "
|
|
6559
|
-
CONTRACT_1155_IMPL_VERSION: "2.
|
|
6560
|
-
FACTORY_IMPL: "
|
|
6561
|
-
FACTORY_PROXY: "
|
|
8406
|
+
CONTRACT_1155_IMPL: "0x2C49E95303734eE3826307783d5fDD180B2131D3",
|
|
8407
|
+
CONTRACT_1155_IMPL_VERSION: "2.9.0",
|
|
8408
|
+
FACTORY_IMPL: "0xB2696570215c3158eB1D218FB1a3DF92a418B034",
|
|
8409
|
+
FACTORY_PROXY: "0x777777C338d93e2C7adf08D102d45CA7CC4Ed021",
|
|
6562
8410
|
FIXED_PRICE_SALE_STRATEGY: "0xd34872BE0cdb6b09d45FCa067B07f04a1A9aE1aE",
|
|
6563
8411
|
MERKLE_MINT_SALE_STRATEGY: "0x3E8524770adD176bE381a0529E09f1c6c3502A5a",
|
|
6564
|
-
PREMINTER_IMPL: "",
|
|
6565
|
-
PREMINTER_PROXY: "",
|
|
8412
|
+
PREMINTER_IMPL: "0xD754417BDABFCc3a3997B9A15E9F6922a8131Ac1",
|
|
8413
|
+
PREMINTER_PROXY: "0x7777773606e7e46C8Ba8B98C08f5cD218e31d340",
|
|
6566
8414
|
REDEEM_MINTER_FACTORY: "0x805E0a08dE70f85C01F7848370d5e3fc08aAd0ea",
|
|
6567
|
-
UPGRADE_GATE: "
|
|
8415
|
+
UPGRADE_GATE: "0xbC50029836A59A4E5e1Bb8988272F46ebA0F9900",
|
|
6568
8416
|
ERC20_MINTER: "0x777777E8850d8D6d98De2B5f64fae401F96eFF31",
|
|
6569
|
-
timestamp:
|
|
8417
|
+
timestamp: 1713468185
|
|
6570
8418
|
},
|
|
6571
8419
|
421614: {
|
|
6572
8420
|
CONTRACT_1155_IMPL: "0xc288fe9B145fC31D9aFBa771d0FeB986F6eb49e3",
|
|
@@ -6626,16 +8474,16 @@ var addresses = {
|
|
|
6626
8474
|
999999999: {
|
|
6627
8475
|
CONTRACT_1155_IMPL: "0xaDf7F654d8E416aaD85d4f06fDf4cA3D05BDA1A1",
|
|
6628
8476
|
CONTRACT_1155_IMPL_VERSION: "2.9.0",
|
|
6629
|
-
|
|
8477
|
+
ERC20_MINTER: "0x8Ec7f068A77fa5FC1925110f82381374BA054Ff2",
|
|
8478
|
+
FACTORY_IMPL: "0x7228C5BE6093cf57BC085aaFFB18D0b7886f0651",
|
|
6630
8479
|
FACTORY_PROXY: "0x777777C338d93e2C7adf08D102d45CA7CC4Ed021",
|
|
6631
8480
|
FIXED_PRICE_SALE_STRATEGY: "0x6d28164C3CE04A190D5F9f0f8881fc807EAD975A",
|
|
6632
8481
|
MERKLE_MINT_SALE_STRATEGY: "0x5e5fD4b758076BAD940db0284b711A67E8a3B88c",
|
|
6633
|
-
PREMINTER_IMPL: "
|
|
8482
|
+
PREMINTER_IMPL: "0xdABa152A152a14844E627444B55a543beF7c4365",
|
|
6634
8483
|
PREMINTER_PROXY: "0x7777773606e7e46C8Ba8B98C08f5cD218e31d340",
|
|
6635
8484
|
REDEEM_MINTER_FACTORY: "0x25cFb6dd9cDE8425e781d6718a29Ccbca3F038d6",
|
|
6636
8485
|
UPGRADE_GATE: "0x0000000000000000000000000000000000000000",
|
|
6637
|
-
|
|
6638
|
-
timestamp: 1712339316
|
|
8486
|
+
timestamp: 1715977010
|
|
6639
8487
|
}
|
|
6640
8488
|
};
|
|
6641
8489
|
|
|
@@ -6670,6 +8518,7 @@ var chainConfigs2 = {
|
|
|
6670
8518
|
PROXY_ADMIN: "0x02539E813cA450C2c7334e885423f4A899a063Fe",
|
|
6671
8519
|
MINTS_OWNER: "0x02539E813cA450C2c7334e885423f4A899a063Fe"
|
|
6672
8520
|
},
|
|
8521
|
+
84532: { PROXY_ADMIN: "0x5F14C23983c9e0840Dc60dA880349622f0785420" },
|
|
6673
8522
|
7777777: {
|
|
6674
8523
|
PROXY_ADMIN: "0xdEA20c96253dc2d64897D2b8d27A8d935dE74955",
|
|
6675
8524
|
MINTS_OWNER: "0xEcfc2ee50409E459c554a2b0376F882Ce916D853"
|
|
@@ -6684,6 +8533,11 @@ var chainConfigs2 = {
|
|
|
6684
8533
|
}
|
|
6685
8534
|
};
|
|
6686
8535
|
var addresses2 = {
|
|
8536
|
+
84532: {
|
|
8537
|
+
MINTS_ETH_UNWRAPPER_AND_CALLER: "0x0000000000000000000000000000000000000000",
|
|
8538
|
+
MINTS_MANAGER_IMPL: "0x32C49770cC95F6A606Ae5a22A0a70e8F8ff64C75",
|
|
8539
|
+
MINTS_MANAGER_IMPL_VERSION: "0.1.3"
|
|
8540
|
+
},
|
|
6687
8541
|
7777777: {
|
|
6688
8542
|
MINTS_ETH_UNWRAPPER_AND_CALLER: "0xb0994EB9520C98C97e1F3953a5964535C2bd271A",
|
|
6689
8543
|
MINTS_MANAGER_IMPL: "0x978685ad10B829F17e6c2C6E8EeABd7dFDdC1678",
|
|
@@ -6691,16 +8545,19 @@ var addresses2 = {
|
|
|
6691
8545
|
},
|
|
6692
8546
|
999999999: {
|
|
6693
8547
|
MINTS_ETH_UNWRAPPER_AND_CALLER: "0xb0994EB9520C98C97e1F3953a5964535C2bd271A",
|
|
6694
|
-
MINTS_MANAGER_IMPL: "
|
|
6695
|
-
MINTS_MANAGER_IMPL_VERSION: "0.1.
|
|
8548
|
+
MINTS_MANAGER_IMPL: "0x65690B699591aDE72b30aa10B0c34BB78cAc61c0",
|
|
8549
|
+
MINTS_MANAGER_IMPL_VERSION: "0.1.3"
|
|
6696
8550
|
}
|
|
6697
8551
|
};
|
|
6698
8552
|
// Annotate the CommonJS export names for ESM import in node:
|
|
6699
8553
|
0 && (module.exports = {
|
|
8554
|
+
PremintConfigVersion,
|
|
6700
8555
|
contracts1155,
|
|
8556
|
+
encodePremintConfig,
|
|
6701
8557
|
erc20MinterABI,
|
|
6702
8558
|
erc20MinterAddress,
|
|
6703
8559
|
erc20MinterConfig,
|
|
8560
|
+
iPremintDefinitionsABI,
|
|
6704
8561
|
iUnwrapAndForwardActionABI,
|
|
6705
8562
|
mints,
|
|
6706
8563
|
mintsEthUnwrapperAndCallerABI,
|
|
@@ -6708,6 +8565,7 @@ var addresses2 = {
|
|
|
6708
8565
|
mintsEthUnwrapperAndCallerConfig,
|
|
6709
8566
|
mintsSafeTransferBatchTypedDataDefinition,
|
|
6710
8567
|
mintsSafeTransferTypedDataDefinition,
|
|
8568
|
+
premintTypedDataDefinition,
|
|
6711
8569
|
premintV1TypedDataDefinition,
|
|
6712
8570
|
premintV2TypedDataDefinition,
|
|
6713
8571
|
protocolRewardsABI,
|
|
@@ -6736,4 +8594,9 @@ var addresses2 = {
|
|
|
6736
8594
|
zoraMintsManagerImplAddress,
|
|
6737
8595
|
zoraMintsManagerImplConfig
|
|
6738
8596
|
});
|
|
8597
|
+
/*! Bundled license information:
|
|
8598
|
+
|
|
8599
|
+
@noble/hashes/esm/utils.js:
|
|
8600
|
+
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
8601
|
+
*/
|
|
6739
8602
|
//# sourceMappingURL=index.cjs.map
|