damm-sdk 1.4.11 → 1.4.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +763 -245
- package/dist/index.cjs.map +14 -5
- package/dist/index.js +20139 -16913
- package/dist/index.js.map +77 -43
- package/dist/integrations/gnosis/gnosis.multisend.d.ts +0 -16
- package/dist/integrations/gnosis/gnosis.multisend.d.ts.map +1 -1
- package/dist/lib/addresses.d.ts +1 -1
- package/dist/lib/addresses.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/integrations/gnosis/gnosis.multisend.ts +5 -41
- package/src/lib/addresses.ts +2 -2
- package/src/lib/contractsRegistry.json +30 -26
package/dist/index.cjs
CHANGED
|
@@ -244,6 +244,36 @@ var init_fromHex = __esm(() => {
|
|
|
244
244
|
});
|
|
245
245
|
|
|
246
246
|
// node_modules/viem/_esm/utils/encoding/toHex.js
|
|
247
|
+
function toHex(value, opts = {}) {
|
|
248
|
+
if (typeof value === "number" || typeof value === "bigint")
|
|
249
|
+
return numberToHex(value, opts);
|
|
250
|
+
if (typeof value === "string") {
|
|
251
|
+
return stringToHex(value, opts);
|
|
252
|
+
}
|
|
253
|
+
if (typeof value === "boolean")
|
|
254
|
+
return boolToHex(value, opts);
|
|
255
|
+
return bytesToHex(value, opts);
|
|
256
|
+
}
|
|
257
|
+
function boolToHex(value, opts = {}) {
|
|
258
|
+
const hex = `0x${Number(value)}`;
|
|
259
|
+
if (typeof opts.size === "number") {
|
|
260
|
+
assertSize(hex, { size: opts.size });
|
|
261
|
+
return pad(hex, { size: opts.size });
|
|
262
|
+
}
|
|
263
|
+
return hex;
|
|
264
|
+
}
|
|
265
|
+
function bytesToHex(value, opts = {}) {
|
|
266
|
+
let string = "";
|
|
267
|
+
for (let i = 0;i < value.length; i++) {
|
|
268
|
+
string += hexes[value[i]];
|
|
269
|
+
}
|
|
270
|
+
const hex = `0x${string}`;
|
|
271
|
+
if (typeof opts.size === "number") {
|
|
272
|
+
assertSize(hex, { size: opts.size });
|
|
273
|
+
return pad(hex, { dir: "right", size: opts.size });
|
|
274
|
+
}
|
|
275
|
+
return hex;
|
|
276
|
+
}
|
|
247
277
|
function numberToHex(value_, opts = {}) {
|
|
248
278
|
const { signed, size: size2 } = opts;
|
|
249
279
|
const value = BigInt(value_);
|
|
@@ -272,9 +302,497 @@ function numberToHex(value_, opts = {}) {
|
|
|
272
302
|
return pad(hex, { size: size2 });
|
|
273
303
|
return hex;
|
|
274
304
|
}
|
|
305
|
+
function stringToHex(value_, opts = {}) {
|
|
306
|
+
const value = encoder.encode(value_);
|
|
307
|
+
return bytesToHex(value, opts);
|
|
308
|
+
}
|
|
309
|
+
var hexes, encoder;
|
|
275
310
|
var init_toHex = __esm(() => {
|
|
276
311
|
init_encoding();
|
|
277
312
|
init_pad();
|
|
313
|
+
init_fromHex();
|
|
314
|
+
hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_v, i) => i.toString(16).padStart(2, "0"));
|
|
315
|
+
encoder = /* @__PURE__ */ new TextEncoder;
|
|
316
|
+
});
|
|
317
|
+
|
|
318
|
+
// node_modules/viem/_esm/utils/encoding/toBytes.js
|
|
319
|
+
function toBytes(value, opts = {}) {
|
|
320
|
+
if (typeof value === "number" || typeof value === "bigint")
|
|
321
|
+
return numberToBytes(value, opts);
|
|
322
|
+
if (typeof value === "boolean")
|
|
323
|
+
return boolToBytes(value, opts);
|
|
324
|
+
if (isHex(value))
|
|
325
|
+
return hexToBytes(value, opts);
|
|
326
|
+
return stringToBytes(value, opts);
|
|
327
|
+
}
|
|
328
|
+
function boolToBytes(value, opts = {}) {
|
|
329
|
+
const bytes = new Uint8Array(1);
|
|
330
|
+
bytes[0] = Number(value);
|
|
331
|
+
if (typeof opts.size === "number") {
|
|
332
|
+
assertSize(bytes, { size: opts.size });
|
|
333
|
+
return pad(bytes, { size: opts.size });
|
|
334
|
+
}
|
|
335
|
+
return bytes;
|
|
336
|
+
}
|
|
337
|
+
function charCodeToBase16(char) {
|
|
338
|
+
if (char >= charCodeMap.zero && char <= charCodeMap.nine)
|
|
339
|
+
return char - charCodeMap.zero;
|
|
340
|
+
if (char >= charCodeMap.A && char <= charCodeMap.F)
|
|
341
|
+
return char - (charCodeMap.A - 10);
|
|
342
|
+
if (char >= charCodeMap.a && char <= charCodeMap.f)
|
|
343
|
+
return char - (charCodeMap.a - 10);
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
346
|
+
function hexToBytes(hex_, opts = {}) {
|
|
347
|
+
let hex = hex_;
|
|
348
|
+
if (opts.size) {
|
|
349
|
+
assertSize(hex, { size: opts.size });
|
|
350
|
+
hex = pad(hex, { dir: "right", size: opts.size });
|
|
351
|
+
}
|
|
352
|
+
let hexString = hex.slice(2);
|
|
353
|
+
if (hexString.length % 2)
|
|
354
|
+
hexString = `0${hexString}`;
|
|
355
|
+
const length = hexString.length / 2;
|
|
356
|
+
const bytes = new Uint8Array(length);
|
|
357
|
+
for (let index = 0, j = 0;index < length; index++) {
|
|
358
|
+
const nibbleLeft = charCodeToBase16(hexString.charCodeAt(j++));
|
|
359
|
+
const nibbleRight = charCodeToBase16(hexString.charCodeAt(j++));
|
|
360
|
+
if (nibbleLeft === undefined || nibbleRight === undefined) {
|
|
361
|
+
throw new BaseError(`Invalid byte sequence ("${hexString[j - 2]}${hexString[j - 1]}" in "${hexString}").`);
|
|
362
|
+
}
|
|
363
|
+
bytes[index] = nibbleLeft * 16 + nibbleRight;
|
|
364
|
+
}
|
|
365
|
+
return bytes;
|
|
366
|
+
}
|
|
367
|
+
function numberToBytes(value, opts) {
|
|
368
|
+
const hex = numberToHex(value, opts);
|
|
369
|
+
return hexToBytes(hex);
|
|
370
|
+
}
|
|
371
|
+
function stringToBytes(value, opts = {}) {
|
|
372
|
+
const bytes = encoder2.encode(value);
|
|
373
|
+
if (typeof opts.size === "number") {
|
|
374
|
+
assertSize(bytes, { size: opts.size });
|
|
375
|
+
return pad(bytes, { dir: "right", size: opts.size });
|
|
376
|
+
}
|
|
377
|
+
return bytes;
|
|
378
|
+
}
|
|
379
|
+
var encoder2, charCodeMap;
|
|
380
|
+
var init_toBytes = __esm(() => {
|
|
381
|
+
init_base();
|
|
382
|
+
init_pad();
|
|
383
|
+
init_fromHex();
|
|
384
|
+
init_toHex();
|
|
385
|
+
encoder2 = /* @__PURE__ */ new TextEncoder;
|
|
386
|
+
charCodeMap = {
|
|
387
|
+
zero: 48,
|
|
388
|
+
nine: 57,
|
|
389
|
+
A: 65,
|
|
390
|
+
F: 70,
|
|
391
|
+
a: 97,
|
|
392
|
+
f: 102
|
|
393
|
+
};
|
|
394
|
+
});
|
|
395
|
+
|
|
396
|
+
// node_modules/@noble/hashes/esm/_u64.js
|
|
397
|
+
function fromBig(n, le = false) {
|
|
398
|
+
if (le)
|
|
399
|
+
return { h: Number(n & U32_MASK64), l: Number(n >> _32n & U32_MASK64) };
|
|
400
|
+
return { h: Number(n >> _32n & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };
|
|
401
|
+
}
|
|
402
|
+
function split(lst, le = false) {
|
|
403
|
+
const len = lst.length;
|
|
404
|
+
let Ah = new Uint32Array(len);
|
|
405
|
+
let Al = new Uint32Array(len);
|
|
406
|
+
for (let i = 0;i < len; i++) {
|
|
407
|
+
const { h, l } = fromBig(lst[i], le);
|
|
408
|
+
[Ah[i], Al[i]] = [h, l];
|
|
409
|
+
}
|
|
410
|
+
return [Ah, Al];
|
|
411
|
+
}
|
|
412
|
+
var U32_MASK64, _32n, rotlSH = (h, l, s) => h << s | l >>> 32 - s, rotlSL = (h, l, s) => l << s | h >>> 32 - s, rotlBH = (h, l, s) => l << s - 32 | h >>> 64 - s, rotlBL = (h, l, s) => h << s - 32 | l >>> 64 - s;
|
|
413
|
+
var init__u64 = __esm(() => {
|
|
414
|
+
U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);
|
|
415
|
+
_32n = /* @__PURE__ */ BigInt(32);
|
|
416
|
+
});
|
|
417
|
+
|
|
418
|
+
// node_modules/@noble/hashes/esm/utils.js
|
|
419
|
+
function isBytes(a) {
|
|
420
|
+
return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
|
|
421
|
+
}
|
|
422
|
+
function anumber(n) {
|
|
423
|
+
if (!Number.isSafeInteger(n) || n < 0)
|
|
424
|
+
throw new Error("positive integer expected, got " + n);
|
|
425
|
+
}
|
|
426
|
+
function abytes(b, ...lengths) {
|
|
427
|
+
if (!isBytes(b))
|
|
428
|
+
throw new Error("Uint8Array expected");
|
|
429
|
+
if (lengths.length > 0 && !lengths.includes(b.length))
|
|
430
|
+
throw new Error("Uint8Array expected of length " + lengths + ", got length=" + b.length);
|
|
431
|
+
}
|
|
432
|
+
function aexists(instance, checkFinished = true) {
|
|
433
|
+
if (instance.destroyed)
|
|
434
|
+
throw new Error("Hash instance has been destroyed");
|
|
435
|
+
if (checkFinished && instance.finished)
|
|
436
|
+
throw new Error("Hash#digest() has already been called");
|
|
437
|
+
}
|
|
438
|
+
function aoutput(out, instance) {
|
|
439
|
+
abytes(out);
|
|
440
|
+
const min = instance.outputLen;
|
|
441
|
+
if (out.length < min) {
|
|
442
|
+
throw new Error("digestInto() expects output buffer of length at least " + min);
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
function u32(arr) {
|
|
446
|
+
return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
|
|
447
|
+
}
|
|
448
|
+
function clean(...arrays) {
|
|
449
|
+
for (let i = 0;i < arrays.length; i++) {
|
|
450
|
+
arrays[i].fill(0);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
function byteSwap(word) {
|
|
454
|
+
return word << 24 & 4278190080 | word << 8 & 16711680 | word >>> 8 & 65280 | word >>> 24 & 255;
|
|
455
|
+
}
|
|
456
|
+
function byteSwap32(arr) {
|
|
457
|
+
for (let i = 0;i < arr.length; i++) {
|
|
458
|
+
arr[i] = byteSwap(arr[i]);
|
|
459
|
+
}
|
|
460
|
+
return arr;
|
|
461
|
+
}
|
|
462
|
+
function utf8ToBytes(str) {
|
|
463
|
+
if (typeof str !== "string")
|
|
464
|
+
throw new Error("string expected");
|
|
465
|
+
return new Uint8Array(new TextEncoder().encode(str));
|
|
466
|
+
}
|
|
467
|
+
function toBytes2(data) {
|
|
468
|
+
if (typeof data === "string")
|
|
469
|
+
data = utf8ToBytes(data);
|
|
470
|
+
abytes(data);
|
|
471
|
+
return data;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
class Hash {
|
|
475
|
+
}
|
|
476
|
+
function createHasher(hashCons) {
|
|
477
|
+
const hashC = (msg) => hashCons().update(toBytes2(msg)).digest();
|
|
478
|
+
const tmp = hashCons();
|
|
479
|
+
hashC.outputLen = tmp.outputLen;
|
|
480
|
+
hashC.blockLen = tmp.blockLen;
|
|
481
|
+
hashC.create = () => hashCons();
|
|
482
|
+
return hashC;
|
|
483
|
+
}
|
|
484
|
+
var isLE, swap32IfBE;
|
|
485
|
+
var init_utils = __esm(() => {
|
|
486
|
+
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
487
|
+
isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68)();
|
|
488
|
+
swap32IfBE = isLE ? (u) => u : byteSwap32;
|
|
489
|
+
});
|
|
490
|
+
|
|
491
|
+
// node_modules/@noble/hashes/esm/sha3.js
|
|
492
|
+
function keccakP(s, rounds = 24) {
|
|
493
|
+
const B = new Uint32Array(5 * 2);
|
|
494
|
+
for (let round = 24 - rounds;round < 24; round++) {
|
|
495
|
+
for (let x = 0;x < 10; x++)
|
|
496
|
+
B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];
|
|
497
|
+
for (let x = 0;x < 10; x += 2) {
|
|
498
|
+
const idx1 = (x + 8) % 10;
|
|
499
|
+
const idx0 = (x + 2) % 10;
|
|
500
|
+
const B0 = B[idx0];
|
|
501
|
+
const B1 = B[idx0 + 1];
|
|
502
|
+
const Th = rotlH(B0, B1, 1) ^ B[idx1];
|
|
503
|
+
const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1];
|
|
504
|
+
for (let y = 0;y < 50; y += 10) {
|
|
505
|
+
s[x + y] ^= Th;
|
|
506
|
+
s[x + y + 1] ^= Tl;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
let curH = s[2];
|
|
510
|
+
let curL = s[3];
|
|
511
|
+
for (let t = 0;t < 24; t++) {
|
|
512
|
+
const shift = SHA3_ROTL[t];
|
|
513
|
+
const Th = rotlH(curH, curL, shift);
|
|
514
|
+
const Tl = rotlL(curH, curL, shift);
|
|
515
|
+
const PI = SHA3_PI[t];
|
|
516
|
+
curH = s[PI];
|
|
517
|
+
curL = s[PI + 1];
|
|
518
|
+
s[PI] = Th;
|
|
519
|
+
s[PI + 1] = Tl;
|
|
520
|
+
}
|
|
521
|
+
for (let y = 0;y < 50; y += 10) {
|
|
522
|
+
for (let x = 0;x < 10; x++)
|
|
523
|
+
B[x] = s[y + x];
|
|
524
|
+
for (let x = 0;x < 10; x++)
|
|
525
|
+
s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10];
|
|
526
|
+
}
|
|
527
|
+
s[0] ^= SHA3_IOTA_H[round];
|
|
528
|
+
s[1] ^= SHA3_IOTA_L[round];
|
|
529
|
+
}
|
|
530
|
+
clean(B);
|
|
531
|
+
}
|
|
532
|
+
var _0n, _1n, _2n, _7n, _256n, _0x71n, SHA3_PI, SHA3_ROTL, _SHA3_IOTA, IOTAS, SHA3_IOTA_H, SHA3_IOTA_L, rotlH = (h, l, s) => s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s), rotlL = (h, l, s) => s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s), Keccak, gen = (suffix, blockLen, outputLen) => createHasher(() => new Keccak(blockLen, suffix, outputLen)), keccak_256;
|
|
533
|
+
var init_sha3 = __esm(() => {
|
|
534
|
+
init__u64();
|
|
535
|
+
init_utils();
|
|
536
|
+
_0n = BigInt(0);
|
|
537
|
+
_1n = BigInt(1);
|
|
538
|
+
_2n = BigInt(2);
|
|
539
|
+
_7n = BigInt(7);
|
|
540
|
+
_256n = BigInt(256);
|
|
541
|
+
_0x71n = BigInt(113);
|
|
542
|
+
SHA3_PI = [];
|
|
543
|
+
SHA3_ROTL = [];
|
|
544
|
+
_SHA3_IOTA = [];
|
|
545
|
+
for (let round = 0, R = _1n, x = 1, y = 0;round < 24; round++) {
|
|
546
|
+
[x, y] = [y, (2 * x + 3 * y) % 5];
|
|
547
|
+
SHA3_PI.push(2 * (5 * y + x));
|
|
548
|
+
SHA3_ROTL.push((round + 1) * (round + 2) / 2 % 64);
|
|
549
|
+
let t = _0n;
|
|
550
|
+
for (let j = 0;j < 7; j++) {
|
|
551
|
+
R = (R << _1n ^ (R >> _7n) * _0x71n) % _256n;
|
|
552
|
+
if (R & _2n)
|
|
553
|
+
t ^= _1n << (_1n << /* @__PURE__ */ BigInt(j)) - _1n;
|
|
554
|
+
}
|
|
555
|
+
_SHA3_IOTA.push(t);
|
|
556
|
+
}
|
|
557
|
+
IOTAS = split(_SHA3_IOTA, true);
|
|
558
|
+
SHA3_IOTA_H = IOTAS[0];
|
|
559
|
+
SHA3_IOTA_L = IOTAS[1];
|
|
560
|
+
Keccak = class Keccak extends Hash {
|
|
561
|
+
constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {
|
|
562
|
+
super();
|
|
563
|
+
this.pos = 0;
|
|
564
|
+
this.posOut = 0;
|
|
565
|
+
this.finished = false;
|
|
566
|
+
this.destroyed = false;
|
|
567
|
+
this.enableXOF = false;
|
|
568
|
+
this.blockLen = blockLen;
|
|
569
|
+
this.suffix = suffix;
|
|
570
|
+
this.outputLen = outputLen;
|
|
571
|
+
this.enableXOF = enableXOF;
|
|
572
|
+
this.rounds = rounds;
|
|
573
|
+
anumber(outputLen);
|
|
574
|
+
if (!(0 < blockLen && blockLen < 200))
|
|
575
|
+
throw new Error("only keccak-f1600 function is supported");
|
|
576
|
+
this.state = new Uint8Array(200);
|
|
577
|
+
this.state32 = u32(this.state);
|
|
578
|
+
}
|
|
579
|
+
clone() {
|
|
580
|
+
return this._cloneInto();
|
|
581
|
+
}
|
|
582
|
+
keccak() {
|
|
583
|
+
swap32IfBE(this.state32);
|
|
584
|
+
keccakP(this.state32, this.rounds);
|
|
585
|
+
swap32IfBE(this.state32);
|
|
586
|
+
this.posOut = 0;
|
|
587
|
+
this.pos = 0;
|
|
588
|
+
}
|
|
589
|
+
update(data) {
|
|
590
|
+
aexists(this);
|
|
591
|
+
data = toBytes2(data);
|
|
592
|
+
abytes(data);
|
|
593
|
+
const { blockLen, state } = this;
|
|
594
|
+
const len = data.length;
|
|
595
|
+
for (let pos = 0;pos < len; ) {
|
|
596
|
+
const take = Math.min(blockLen - this.pos, len - pos);
|
|
597
|
+
for (let i = 0;i < take; i++)
|
|
598
|
+
state[this.pos++] ^= data[pos++];
|
|
599
|
+
if (this.pos === blockLen)
|
|
600
|
+
this.keccak();
|
|
601
|
+
}
|
|
602
|
+
return this;
|
|
603
|
+
}
|
|
604
|
+
finish() {
|
|
605
|
+
if (this.finished)
|
|
606
|
+
return;
|
|
607
|
+
this.finished = true;
|
|
608
|
+
const { state, suffix, pos, blockLen } = this;
|
|
609
|
+
state[pos] ^= suffix;
|
|
610
|
+
if ((suffix & 128) !== 0 && pos === blockLen - 1)
|
|
611
|
+
this.keccak();
|
|
612
|
+
state[blockLen - 1] ^= 128;
|
|
613
|
+
this.keccak();
|
|
614
|
+
}
|
|
615
|
+
writeInto(out) {
|
|
616
|
+
aexists(this, false);
|
|
617
|
+
abytes(out);
|
|
618
|
+
this.finish();
|
|
619
|
+
const bufferOut = this.state;
|
|
620
|
+
const { blockLen } = this;
|
|
621
|
+
for (let pos = 0, len = out.length;pos < len; ) {
|
|
622
|
+
if (this.posOut >= blockLen)
|
|
623
|
+
this.keccak();
|
|
624
|
+
const take = Math.min(blockLen - this.posOut, len - pos);
|
|
625
|
+
out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);
|
|
626
|
+
this.posOut += take;
|
|
627
|
+
pos += take;
|
|
628
|
+
}
|
|
629
|
+
return out;
|
|
630
|
+
}
|
|
631
|
+
xofInto(out) {
|
|
632
|
+
if (!this.enableXOF)
|
|
633
|
+
throw new Error("XOF is not possible for this instance");
|
|
634
|
+
return this.writeInto(out);
|
|
635
|
+
}
|
|
636
|
+
xof(bytes) {
|
|
637
|
+
anumber(bytes);
|
|
638
|
+
return this.xofInto(new Uint8Array(bytes));
|
|
639
|
+
}
|
|
640
|
+
digestInto(out) {
|
|
641
|
+
aoutput(out, this);
|
|
642
|
+
if (this.finished)
|
|
643
|
+
throw new Error("digest() was already called");
|
|
644
|
+
this.writeInto(out);
|
|
645
|
+
this.destroy();
|
|
646
|
+
return out;
|
|
647
|
+
}
|
|
648
|
+
digest() {
|
|
649
|
+
return this.digestInto(new Uint8Array(this.outputLen));
|
|
650
|
+
}
|
|
651
|
+
destroy() {
|
|
652
|
+
this.destroyed = true;
|
|
653
|
+
clean(this.state);
|
|
654
|
+
}
|
|
655
|
+
_cloneInto(to) {
|
|
656
|
+
const { blockLen, suffix, outputLen, rounds, enableXOF } = this;
|
|
657
|
+
to || (to = new Keccak(blockLen, suffix, outputLen, enableXOF, rounds));
|
|
658
|
+
to.state32.set(this.state32);
|
|
659
|
+
to.pos = this.pos;
|
|
660
|
+
to.posOut = this.posOut;
|
|
661
|
+
to.finished = this.finished;
|
|
662
|
+
to.rounds = rounds;
|
|
663
|
+
to.suffix = suffix;
|
|
664
|
+
to.outputLen = outputLen;
|
|
665
|
+
to.enableXOF = enableXOF;
|
|
666
|
+
to.destroyed = this.destroyed;
|
|
667
|
+
return to;
|
|
668
|
+
}
|
|
669
|
+
};
|
|
670
|
+
keccak_256 = /* @__PURE__ */ (() => gen(1, 136, 256 / 8))();
|
|
671
|
+
});
|
|
672
|
+
|
|
673
|
+
// node_modules/viem/_esm/utils/hash/keccak256.js
|
|
674
|
+
function keccak256(value, to_) {
|
|
675
|
+
const to = to_ || "hex";
|
|
676
|
+
const bytes = keccak_256(isHex(value, { strict: false }) ? toBytes(value) : value);
|
|
677
|
+
if (to === "bytes")
|
|
678
|
+
return bytes;
|
|
679
|
+
return toHex(bytes);
|
|
680
|
+
}
|
|
681
|
+
var init_keccak256 = __esm(() => {
|
|
682
|
+
init_sha3();
|
|
683
|
+
init_toBytes();
|
|
684
|
+
init_toHex();
|
|
685
|
+
});
|
|
686
|
+
|
|
687
|
+
// node_modules/viem/_esm/errors/address.js
|
|
688
|
+
var InvalidAddressError;
|
|
689
|
+
var init_address = __esm(() => {
|
|
690
|
+
init_base();
|
|
691
|
+
InvalidAddressError = class InvalidAddressError extends BaseError {
|
|
692
|
+
constructor({ address }) {
|
|
693
|
+
super(`Address "${address}" is invalid.`, {
|
|
694
|
+
metaMessages: [
|
|
695
|
+
"- Address must be a hex value of 20 bytes (40 hex characters).",
|
|
696
|
+
"- Address must match its checksum counterpart."
|
|
697
|
+
],
|
|
698
|
+
name: "InvalidAddressError"
|
|
699
|
+
});
|
|
700
|
+
}
|
|
701
|
+
};
|
|
702
|
+
});
|
|
703
|
+
|
|
704
|
+
// node_modules/viem/_esm/utils/lru.js
|
|
705
|
+
var LruMap;
|
|
706
|
+
var init_lru = __esm(() => {
|
|
707
|
+
LruMap = class LruMap extends Map {
|
|
708
|
+
constructor(size2) {
|
|
709
|
+
super();
|
|
710
|
+
Object.defineProperty(this, "maxSize", {
|
|
711
|
+
enumerable: true,
|
|
712
|
+
configurable: true,
|
|
713
|
+
writable: true,
|
|
714
|
+
value: undefined
|
|
715
|
+
});
|
|
716
|
+
this.maxSize = size2;
|
|
717
|
+
}
|
|
718
|
+
get(key) {
|
|
719
|
+
const value = super.get(key);
|
|
720
|
+
if (super.has(key) && value !== undefined) {
|
|
721
|
+
this.delete(key);
|
|
722
|
+
super.set(key, value);
|
|
723
|
+
}
|
|
724
|
+
return value;
|
|
725
|
+
}
|
|
726
|
+
set(key, value) {
|
|
727
|
+
super.set(key, value);
|
|
728
|
+
if (this.maxSize && this.size > this.maxSize) {
|
|
729
|
+
const firstKey = this.keys().next().value;
|
|
730
|
+
if (firstKey)
|
|
731
|
+
this.delete(firstKey);
|
|
732
|
+
}
|
|
733
|
+
return this;
|
|
734
|
+
}
|
|
735
|
+
};
|
|
736
|
+
});
|
|
737
|
+
|
|
738
|
+
// node_modules/viem/_esm/utils/address/getAddress.js
|
|
739
|
+
function checksumAddress(address_, chainId) {
|
|
740
|
+
if (checksumAddressCache.has(`${address_}.${chainId}`))
|
|
741
|
+
return checksumAddressCache.get(`${address_}.${chainId}`);
|
|
742
|
+
const hexAddress = chainId ? `${chainId}${address_.toLowerCase()}` : address_.substring(2).toLowerCase();
|
|
743
|
+
const hash = keccak256(stringToBytes(hexAddress), "bytes");
|
|
744
|
+
const address = (chainId ? hexAddress.substring(`${chainId}0x`.length) : hexAddress).split("");
|
|
745
|
+
for (let i = 0;i < 40; i += 2) {
|
|
746
|
+
if (hash[i >> 1] >> 4 >= 8 && address[i]) {
|
|
747
|
+
address[i] = address[i].toUpperCase();
|
|
748
|
+
}
|
|
749
|
+
if ((hash[i >> 1] & 15) >= 8 && address[i + 1]) {
|
|
750
|
+
address[i + 1] = address[i + 1].toUpperCase();
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
const result = `0x${address.join("")}`;
|
|
754
|
+
checksumAddressCache.set(`${address_}.${chainId}`, result);
|
|
755
|
+
return result;
|
|
756
|
+
}
|
|
757
|
+
function getAddress(address, chainId) {
|
|
758
|
+
if (!isAddress(address, { strict: false }))
|
|
759
|
+
throw new InvalidAddressError({ address });
|
|
760
|
+
return checksumAddress(address, chainId);
|
|
761
|
+
}
|
|
762
|
+
var checksumAddressCache;
|
|
763
|
+
var init_getAddress = __esm(() => {
|
|
764
|
+
init_address();
|
|
765
|
+
init_toBytes();
|
|
766
|
+
init_keccak256();
|
|
767
|
+
init_lru();
|
|
768
|
+
init_isAddress();
|
|
769
|
+
checksumAddressCache = /* @__PURE__ */ new LruMap(8192);
|
|
770
|
+
});
|
|
771
|
+
|
|
772
|
+
// node_modules/viem/_esm/utils/address/isAddress.js
|
|
773
|
+
function isAddress(address, options) {
|
|
774
|
+
const { strict = true } = options ?? {};
|
|
775
|
+
const cacheKey = `${address}.${strict}`;
|
|
776
|
+
if (isAddressCache.has(cacheKey))
|
|
777
|
+
return isAddressCache.get(cacheKey);
|
|
778
|
+
const result = (() => {
|
|
779
|
+
if (!addressRegex.test(address))
|
|
780
|
+
return false;
|
|
781
|
+
if (address.toLowerCase() === address)
|
|
782
|
+
return true;
|
|
783
|
+
if (strict)
|
|
784
|
+
return checksumAddress(address) === address;
|
|
785
|
+
return true;
|
|
786
|
+
})();
|
|
787
|
+
isAddressCache.set(cacheKey, result);
|
|
788
|
+
return result;
|
|
789
|
+
}
|
|
790
|
+
var addressRegex, isAddressCache;
|
|
791
|
+
var init_isAddress = __esm(() => {
|
|
792
|
+
init_lru();
|
|
793
|
+
init_getAddress();
|
|
794
|
+
addressRegex = /^0x[a-fA-F0-9]{40}$/;
|
|
795
|
+
isAddressCache = /* @__PURE__ */ new LruMap(8192);
|
|
278
796
|
});
|
|
279
797
|
|
|
280
798
|
// node_modules/viem/_esm/constants/number.js
|
|
@@ -438,8 +956,8 @@ function fromByteArray(uint8) {
|
|
|
438
956
|
tmp = (uint8[len2 - 2] << 8) + uint8[len2 - 1], parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "=");
|
|
439
957
|
return parts.join("");
|
|
440
958
|
}
|
|
441
|
-
function read(buffer, offset,
|
|
442
|
-
var e, m, eLen = nBytes * 8 - mLen - 1, eMax = (1 << eLen) - 1, eBias = eMax >> 1, nBits = -7, i2 =
|
|
959
|
+
function read(buffer, offset, isLE2, mLen, nBytes) {
|
|
960
|
+
var e, m, eLen = nBytes * 8 - mLen - 1, eMax = (1 << eLen) - 1, eBias = eMax >> 1, nBits = -7, i2 = isLE2 ? nBytes - 1 : 0, d = isLE2 ? -1 : 1, s = buffer[offset + i2];
|
|
443
961
|
i2 += d, e = s & (1 << -nBits) - 1, s >>= -nBits, nBits += eLen;
|
|
444
962
|
for (;nBits > 0; e = e * 256 + buffer[offset + i2], i2 += d, nBits -= 8)
|
|
445
963
|
;
|
|
@@ -454,8 +972,8 @@ function read(buffer, offset, isLE, mLen, nBytes) {
|
|
|
454
972
|
m = m + Math.pow(2, mLen), e = e - eBias;
|
|
455
973
|
return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
|
|
456
974
|
}
|
|
457
|
-
function write(buffer, value, offset,
|
|
458
|
-
var e, m, c, eLen = nBytes * 8 - mLen - 1, eMax = (1 << eLen) - 1, eBias = eMax >> 1, rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, i2 =
|
|
975
|
+
function write(buffer, value, offset, isLE2, mLen, nBytes) {
|
|
976
|
+
var e, m, c, eLen = nBytes * 8 - mLen - 1, eMax = (1 << eLen) - 1, eBias = eMax >> 1, rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, i2 = isLE2 ? 0 : nBytes - 1, d = isLE2 ? 1 : -1, s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
|
|
459
977
|
if (value = Math.abs(value), isNaN(value) || value === 1 / 0)
|
|
460
978
|
m = isNaN(value) ? 1 : 0, e = eMax;
|
|
461
979
|
else {
|
|
@@ -627,7 +1145,7 @@ function byteLength(string, encoding) {
|
|
|
627
1145
|
return len2;
|
|
628
1146
|
case "utf8":
|
|
629
1147
|
case "utf-8":
|
|
630
|
-
return
|
|
1148
|
+
return utf8ToBytes2(string).length;
|
|
631
1149
|
case "ucs2":
|
|
632
1150
|
case "ucs-2":
|
|
633
1151
|
case "utf16le":
|
|
@@ -639,7 +1157,7 @@ function byteLength(string, encoding) {
|
|
|
639
1157
|
return base64ToBytes(string).length;
|
|
640
1158
|
default:
|
|
641
1159
|
if (loweredCase)
|
|
642
|
-
return mustMatch ? -1 :
|
|
1160
|
+
return mustMatch ? -1 : utf8ToBytes2(string).length;
|
|
643
1161
|
encoding = ("" + encoding).toLowerCase(), loweredCase = true;
|
|
644
1162
|
}
|
|
645
1163
|
}
|
|
@@ -790,7 +1308,7 @@ function hexWrite(buf, string, offset, length) {
|
|
|
790
1308
|
return i2;
|
|
791
1309
|
}
|
|
792
1310
|
function utf8Write(buf, string, offset, length) {
|
|
793
|
-
return blitBuffer(
|
|
1311
|
+
return blitBuffer(utf8ToBytes2(string, buf.length - offset), buf, offset, length);
|
|
794
1312
|
}
|
|
795
1313
|
function asciiWrite(buf, string, offset, length) {
|
|
796
1314
|
return blitBuffer(asciiToBytes(string), buf, offset, length);
|
|
@@ -972,7 +1490,7 @@ function base64clean(str) {
|
|
|
972
1490
|
str = str + "=";
|
|
973
1491
|
return str;
|
|
974
1492
|
}
|
|
975
|
-
function
|
|
1493
|
+
function utf8ToBytes2(string, units) {
|
|
976
1494
|
units = units || 1 / 0;
|
|
977
1495
|
let codePoint, length = string.length, leadSurrogate = null, bytes = [];
|
|
978
1496
|
for (let i2 = 0;i2 < length; ++i2) {
|
|
@@ -4720,12 +5238,12 @@ var require_sha3 = __commonJS((exports2, module2) => {
|
|
|
4720
5238
|
}
|
|
4721
5239
|
var createOutputMethod = function(bits2, padding, outputType) {
|
|
4722
5240
|
return function(message) {
|
|
4723
|
-
return new
|
|
5241
|
+
return new Keccak2(bits2, padding, bits2).update(message)[outputType]();
|
|
4724
5242
|
};
|
|
4725
5243
|
};
|
|
4726
5244
|
var createShakeOutputMethod = function(bits2, padding, outputType) {
|
|
4727
5245
|
return function(message, outputBits) {
|
|
4728
|
-
return new
|
|
5246
|
+
return new Keccak2(bits2, padding, outputBits).update(message)[outputType]();
|
|
4729
5247
|
};
|
|
4730
5248
|
};
|
|
4731
5249
|
var createCshakeOutputMethod = function(bits2, padding, outputType) {
|
|
@@ -4748,7 +5266,7 @@ var require_sha3 = __commonJS((exports2, module2) => {
|
|
|
4748
5266
|
var createMethod = function(bits2, padding) {
|
|
4749
5267
|
var method = createOutputMethod(bits2, padding, "hex");
|
|
4750
5268
|
method.create = function() {
|
|
4751
|
-
return new
|
|
5269
|
+
return new Keccak2(bits2, padding, bits2);
|
|
4752
5270
|
};
|
|
4753
5271
|
method.update = function(message) {
|
|
4754
5272
|
return method.create().update(message);
|
|
@@ -4758,7 +5276,7 @@ var require_sha3 = __commonJS((exports2, module2) => {
|
|
|
4758
5276
|
var createShakeMethod = function(bits2, padding) {
|
|
4759
5277
|
var method = createShakeOutputMethod(bits2, padding, "hex");
|
|
4760
5278
|
method.create = function(outputBits) {
|
|
4761
|
-
return new
|
|
5279
|
+
return new Keccak2(bits2, padding, outputBits);
|
|
4762
5280
|
};
|
|
4763
5281
|
method.update = function(message, outputBits) {
|
|
4764
5282
|
return method.create(outputBits).update(message);
|
|
@@ -4772,7 +5290,7 @@ var require_sha3 = __commonJS((exports2, module2) => {
|
|
|
4772
5290
|
if (!n && !s) {
|
|
4773
5291
|
return methods["shake" + bits2].create(outputBits);
|
|
4774
5292
|
} else {
|
|
4775
|
-
return new
|
|
5293
|
+
return new Keccak2(bits2, padding, outputBits).bytepad([n, s], w);
|
|
4776
5294
|
}
|
|
4777
5295
|
};
|
|
4778
5296
|
method.update = function(message, outputBits, n, s) {
|
|
@@ -4813,7 +5331,7 @@ var require_sha3 = __commonJS((exports2, module2) => {
|
|
|
4813
5331
|
}
|
|
4814
5332
|
}
|
|
4815
5333
|
}
|
|
4816
|
-
function
|
|
5334
|
+
function Keccak2(bits2, padding, outputBits) {
|
|
4817
5335
|
this.blocks = [];
|
|
4818
5336
|
this.s = [];
|
|
4819
5337
|
this.padding = padding;
|
|
@@ -4830,7 +5348,7 @@ var require_sha3 = __commonJS((exports2, module2) => {
|
|
|
4830
5348
|
this.s[i3] = 0;
|
|
4831
5349
|
}
|
|
4832
5350
|
}
|
|
4833
|
-
|
|
5351
|
+
Keccak2.prototype.update = function(message) {
|
|
4834
5352
|
if (this.finalized) {
|
|
4835
5353
|
throw new Error(FINALIZE_ERROR);
|
|
4836
5354
|
}
|
|
@@ -4900,7 +5418,7 @@ var require_sha3 = __commonJS((exports2, module2) => {
|
|
|
4900
5418
|
}
|
|
4901
5419
|
return this;
|
|
4902
5420
|
};
|
|
4903
|
-
|
|
5421
|
+
Keccak2.prototype.encode = function(x, right) {
|
|
4904
5422
|
var o = x & 255, n = 1;
|
|
4905
5423
|
var bytes = [o];
|
|
4906
5424
|
x = x >> 8;
|
|
@@ -4919,7 +5437,7 @@ var require_sha3 = __commonJS((exports2, module2) => {
|
|
|
4919
5437
|
this.update(bytes);
|
|
4920
5438
|
return bytes.length;
|
|
4921
5439
|
};
|
|
4922
|
-
|
|
5440
|
+
Keccak2.prototype.encodeString = function(str) {
|
|
4923
5441
|
var notString, type = typeof str;
|
|
4924
5442
|
if (type !== "string") {
|
|
4925
5443
|
if (type === "object") {
|
|
@@ -4959,7 +5477,7 @@ var require_sha3 = __commonJS((exports2, module2) => {
|
|
|
4959
5477
|
this.update(str);
|
|
4960
5478
|
return bytes;
|
|
4961
5479
|
};
|
|
4962
|
-
|
|
5480
|
+
Keccak2.prototype.bytepad = function(strs, w) {
|
|
4963
5481
|
var bytes = this.encode(w);
|
|
4964
5482
|
for (var i3 = 0;i3 < strs.length; ++i3) {
|
|
4965
5483
|
bytes += this.encodeString(strs[i3]);
|
|
@@ -4970,7 +5488,7 @@ var require_sha3 = __commonJS((exports2, module2) => {
|
|
|
4970
5488
|
this.update(zeros2);
|
|
4971
5489
|
return this;
|
|
4972
5490
|
};
|
|
4973
|
-
|
|
5491
|
+
Keccak2.prototype.finalize = function() {
|
|
4974
5492
|
if (this.finalized) {
|
|
4975
5493
|
return;
|
|
4976
5494
|
}
|
|
@@ -4989,7 +5507,7 @@ var require_sha3 = __commonJS((exports2, module2) => {
|
|
|
4989
5507
|
}
|
|
4990
5508
|
f(s);
|
|
4991
5509
|
};
|
|
4992
|
-
|
|
5510
|
+
Keccak2.prototype.toString = Keccak2.prototype.hex = function() {
|
|
4993
5511
|
this.finalize();
|
|
4994
5512
|
var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks, extraBytes = this.extraBytes, i3 = 0, j2 = 0;
|
|
4995
5513
|
var hex = "", block;
|
|
@@ -5015,7 +5533,7 @@ var require_sha3 = __commonJS((exports2, module2) => {
|
|
|
5015
5533
|
}
|
|
5016
5534
|
return hex;
|
|
5017
5535
|
};
|
|
5018
|
-
|
|
5536
|
+
Keccak2.prototype.arrayBuffer = function() {
|
|
5019
5537
|
this.finalize();
|
|
5020
5538
|
var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks, extraBytes = this.extraBytes, i3 = 0, j2 = 0;
|
|
5021
5539
|
var bytes = this.outputBits >> 3;
|
|
@@ -5040,8 +5558,8 @@ var require_sha3 = __commonJS((exports2, module2) => {
|
|
|
5040
5558
|
}
|
|
5041
5559
|
return buffer;
|
|
5042
5560
|
};
|
|
5043
|
-
|
|
5044
|
-
|
|
5561
|
+
Keccak2.prototype.buffer = Keccak2.prototype.arrayBuffer;
|
|
5562
|
+
Keccak2.prototype.digest = Keccak2.prototype.array = function() {
|
|
5045
5563
|
this.finalize();
|
|
5046
5564
|
var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks, extraBytes = this.extraBytes, i3 = 0, j2 = 0;
|
|
5047
5565
|
var array = [], offset, block;
|
|
@@ -5072,12 +5590,12 @@ var require_sha3 = __commonJS((exports2, module2) => {
|
|
|
5072
5590
|
return array;
|
|
5073
5591
|
};
|
|
5074
5592
|
function Kmac(bits2, padding, outputBits) {
|
|
5075
|
-
|
|
5593
|
+
Keccak2.call(this, bits2, padding, outputBits);
|
|
5076
5594
|
}
|
|
5077
|
-
Kmac.prototype = new
|
|
5595
|
+
Kmac.prototype = new Keccak2;
|
|
5078
5596
|
Kmac.prototype.finalize = function() {
|
|
5079
5597
|
this.encode(this.outputBits, true);
|
|
5080
|
-
return
|
|
5598
|
+
return Keccak2.prototype.finalize.call(this);
|
|
5081
5599
|
};
|
|
5082
5600
|
var f = function(s) {
|
|
5083
5601
|
var h, l, n, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16, b17, b18, b19, b20, b21, b22, b23, b24, b25, b26, b27, b28, b29, b30, b31, b32, b33, b34, b35, b36, b37, b38, b39, b40, b41, b42, b43, b44, b45, b46, b47, b48, b49;
|
|
@@ -7192,13 +7710,13 @@ var require_lib2 = __commonJS((exports2) => {
|
|
|
7192
7710
|
return array;
|
|
7193
7711
|
}
|
|
7194
7712
|
function isBytesLike2(value) {
|
|
7195
|
-
return isHexString2(value) && !(value.length % 2) ||
|
|
7713
|
+
return isHexString2(value) && !(value.length % 2) || isBytes3(value);
|
|
7196
7714
|
}
|
|
7197
7715
|
exports2.isBytesLike = isBytesLike2;
|
|
7198
7716
|
function isInteger2(value) {
|
|
7199
7717
|
return typeof value === "number" && value == value && value % 1 === 0;
|
|
7200
7718
|
}
|
|
7201
|
-
function
|
|
7719
|
+
function isBytes3(value) {
|
|
7202
7720
|
if (value == null) {
|
|
7203
7721
|
return false;
|
|
7204
7722
|
}
|
|
@@ -7219,7 +7737,7 @@ var require_lib2 = __commonJS((exports2) => {
|
|
|
7219
7737
|
}
|
|
7220
7738
|
return true;
|
|
7221
7739
|
}
|
|
7222
|
-
exports2.isBytes =
|
|
7740
|
+
exports2.isBytes = isBytes3;
|
|
7223
7741
|
function arrayify2(value, options) {
|
|
7224
7742
|
if (!options) {
|
|
7225
7743
|
options = {};
|
|
@@ -7259,7 +7777,7 @@ var require_lib2 = __commonJS((exports2) => {
|
|
|
7259
7777
|
}
|
|
7260
7778
|
return addSlice2(new Uint8Array(result));
|
|
7261
7779
|
}
|
|
7262
|
-
if (
|
|
7780
|
+
if (isBytes3(value)) {
|
|
7263
7781
|
return addSlice2(new Uint8Array(value));
|
|
7264
7782
|
}
|
|
7265
7783
|
return logger20.throwArgumentError("invalid arrayify value", "value", value);
|
|
@@ -7360,7 +7878,7 @@ var require_lib2 = __commonJS((exports2) => {
|
|
|
7360
7878
|
}
|
|
7361
7879
|
return value.toLowerCase();
|
|
7362
7880
|
}
|
|
7363
|
-
if (
|
|
7881
|
+
if (isBytes3(value)) {
|
|
7364
7882
|
var result = "0x";
|
|
7365
7883
|
for (var i2 = 0;i2 < value.length; i2++) {
|
|
7366
7884
|
var v = value[i2];
|
|
@@ -7746,7 +8264,7 @@ var require_aes_js = __commonJS((exports2, module2) => {
|
|
|
7746
8264
|
targetArray.set(sourceArray, targetStart);
|
|
7747
8265
|
}
|
|
7748
8266
|
var convertUtf8 = function() {
|
|
7749
|
-
function
|
|
8267
|
+
function toBytes3(text) {
|
|
7750
8268
|
var result = [], i2 = 0;
|
|
7751
8269
|
text = encodeURI(text);
|
|
7752
8270
|
while (i2 < text.length) {
|
|
@@ -7778,12 +8296,12 @@ var require_aes_js = __commonJS((exports2, module2) => {
|
|
|
7778
8296
|
return result.join("");
|
|
7779
8297
|
}
|
|
7780
8298
|
return {
|
|
7781
|
-
toBytes,
|
|
8299
|
+
toBytes: toBytes3,
|
|
7782
8300
|
fromBytes
|
|
7783
8301
|
};
|
|
7784
8302
|
}();
|
|
7785
8303
|
var convertHex = function() {
|
|
7786
|
-
function
|
|
8304
|
+
function toBytes3(text) {
|
|
7787
8305
|
var result = [];
|
|
7788
8306
|
for (var i2 = 0;i2 < text.length; i2 += 2) {
|
|
7789
8307
|
result.push(parseInt(text.substr(i2, 2), 16));
|
|
@@ -7800,7 +8318,7 @@ var require_aes_js = __commonJS((exports2, module2) => {
|
|
|
7800
8318
|
return result.join("");
|
|
7801
8319
|
}
|
|
7802
8320
|
return {
|
|
7803
|
-
toBytes,
|
|
8321
|
+
toBytes: toBytes3,
|
|
7804
8322
|
fromBytes
|
|
7805
8323
|
};
|
|
7806
8324
|
}();
|
|
@@ -8776,13 +9294,13 @@ var require_bech32 = __commonJS((exports2, module2) => {
|
|
|
8776
9294
|
if (str !== lowered && str !== uppered)
|
|
8777
9295
|
return "Mixed-case string " + str;
|
|
8778
9296
|
str = lowered;
|
|
8779
|
-
var
|
|
8780
|
-
if (
|
|
9297
|
+
var split2 = str.lastIndexOf("1");
|
|
9298
|
+
if (split2 === -1)
|
|
8781
9299
|
return "No separator character for " + str;
|
|
8782
|
-
if (
|
|
9300
|
+
if (split2 === 0)
|
|
8783
9301
|
return "Missing prefix for " + str;
|
|
8784
|
-
var prefix = str.slice(0,
|
|
8785
|
-
var wordChars = str.slice(
|
|
9302
|
+
var prefix = str.slice(0, split2);
|
|
9303
|
+
var wordChars = str.slice(split2 + 1);
|
|
8786
9304
|
if (wordChars.length < 6)
|
|
8787
9305
|
return "Data too short";
|
|
8788
9306
|
var chk = prefixChk(prefix);
|
|
@@ -13727,10 +14245,10 @@ var require_lib7 = __commonJS((exports2) => {
|
|
|
13727
14245
|
exports2.keccak256 = undefined;
|
|
13728
14246
|
var js_sha3_1 = __importDefault(require_sha3());
|
|
13729
14247
|
var bytes_1 = require_lib2();
|
|
13730
|
-
function
|
|
14248
|
+
function keccak2564(data) {
|
|
13731
14249
|
return "0x" + js_sha3_1.default.keccak_256((0, bytes_1.arrayify)(data));
|
|
13732
14250
|
}
|
|
13733
|
-
exports2.keccak256 =
|
|
14251
|
+
exports2.keccak256 = keccak2564;
|
|
13734
14252
|
});
|
|
13735
14253
|
|
|
13736
14254
|
// node_modules/@ethersproject/rlp/lib/_version.js
|
|
@@ -13931,7 +14449,7 @@ var require_lib9 = __commonJS((exports2) => {
|
|
|
13931
14449
|
}
|
|
13932
14450
|
return checksum;
|
|
13933
14451
|
}
|
|
13934
|
-
function
|
|
14452
|
+
function getAddress3(address) {
|
|
13935
14453
|
var result = null;
|
|
13936
14454
|
if (typeof address !== "string") {
|
|
13937
14455
|
logger47.throwArgumentError("invalid address", "address", address);
|
|
@@ -13958,17 +14476,17 @@ var require_lib9 = __commonJS((exports2) => {
|
|
|
13958
14476
|
}
|
|
13959
14477
|
return result;
|
|
13960
14478
|
}
|
|
13961
|
-
exports2.getAddress =
|
|
13962
|
-
function
|
|
14479
|
+
exports2.getAddress = getAddress3;
|
|
14480
|
+
function isAddress3(address) {
|
|
13963
14481
|
try {
|
|
13964
|
-
|
|
14482
|
+
getAddress3(address);
|
|
13965
14483
|
return true;
|
|
13966
14484
|
} catch (error) {}
|
|
13967
14485
|
return false;
|
|
13968
14486
|
}
|
|
13969
|
-
exports2.isAddress =
|
|
14487
|
+
exports2.isAddress = isAddress3;
|
|
13970
14488
|
function getIcapAddress2(address) {
|
|
13971
|
-
var base36 = (0, bignumber_1._base16To36)(
|
|
14489
|
+
var base36 = (0, bignumber_1._base16To36)(getAddress3(address).substring(2)).toUpperCase();
|
|
13972
14490
|
while (base36.length < 30) {
|
|
13973
14491
|
base36 = "0" + base36;
|
|
13974
14492
|
}
|
|
@@ -13978,12 +14496,12 @@ var require_lib9 = __commonJS((exports2) => {
|
|
|
13978
14496
|
function getContractAddress2(transaction) {
|
|
13979
14497
|
var from2 = null;
|
|
13980
14498
|
try {
|
|
13981
|
-
from2 =
|
|
14499
|
+
from2 = getAddress3(transaction.from);
|
|
13982
14500
|
} catch (error) {
|
|
13983
14501
|
logger47.throwArgumentError("missing from address", "transaction", transaction);
|
|
13984
14502
|
}
|
|
13985
14503
|
var nonce = (0, bytes_1.stripZeros)((0, bytes_1.arrayify)(bignumber_1.BigNumber.from(transaction.nonce).toHexString()));
|
|
13986
|
-
return
|
|
14504
|
+
return getAddress3((0, bytes_1.hexDataSlice)((0, keccak256_1.keccak256)((0, rlp_1.encode)([from2, nonce])), 12));
|
|
13987
14505
|
}
|
|
13988
14506
|
exports2.getContractAddress = getContractAddress2;
|
|
13989
14507
|
function getCreate2Address2(from2, salt, initCodeHash) {
|
|
@@ -13993,7 +14511,7 @@ var require_lib9 = __commonJS((exports2) => {
|
|
|
13993
14511
|
if ((0, bytes_1.hexDataLength)(initCodeHash) !== 32) {
|
|
13994
14512
|
logger47.throwArgumentError("initCodeHash must be 32 bytes", "initCodeHash", initCodeHash);
|
|
13995
14513
|
}
|
|
13996
|
-
return
|
|
14514
|
+
return getAddress3((0, bytes_1.hexDataSlice)((0, keccak256_1.keccak256)((0, bytes_1.concat)(["0xff", getAddress3(from2), salt, initCodeHash])), 12));
|
|
13997
14515
|
}
|
|
13998
14516
|
exports2.getCreate2Address = getCreate2Address2;
|
|
13999
14517
|
});
|
|
@@ -16215,8 +16733,8 @@ var require_typed_data = __commonJS((exports2) => {
|
|
|
16215
16733
|
if (baseType === name_12) {
|
|
16216
16734
|
logger47.throwArgumentError("circular type reference to " + JSON.stringify(baseType), "types", types2);
|
|
16217
16735
|
}
|
|
16218
|
-
var
|
|
16219
|
-
if (
|
|
16736
|
+
var encoder3 = getBaseEncoder2(baseType);
|
|
16737
|
+
if (encoder3) {
|
|
16220
16738
|
return;
|
|
16221
16739
|
}
|
|
16222
16740
|
if (!parents[baseType]) {
|
|
@@ -16266,18 +16784,18 @@ var require_typed_data = __commonJS((exports2) => {
|
|
|
16266
16784
|
}
|
|
16267
16785
|
}
|
|
16268
16786
|
TypedDataEncoder3.prototype.getEncoder = function(type) {
|
|
16269
|
-
var
|
|
16270
|
-
if (!
|
|
16271
|
-
|
|
16787
|
+
var encoder3 = this._encoderCache[type];
|
|
16788
|
+
if (!encoder3) {
|
|
16789
|
+
encoder3 = this._encoderCache[type] = this._getEncoder(type);
|
|
16272
16790
|
}
|
|
16273
|
-
return
|
|
16791
|
+
return encoder3;
|
|
16274
16792
|
};
|
|
16275
16793
|
TypedDataEncoder3.prototype._getEncoder = function(type) {
|
|
16276
16794
|
var _this = this;
|
|
16277
16795
|
{
|
|
16278
|
-
var
|
|
16279
|
-
if (
|
|
16280
|
-
return
|
|
16796
|
+
var encoder3 = getBaseEncoder2(type);
|
|
16797
|
+
if (encoder3) {
|
|
16798
|
+
return encoder3;
|
|
16281
16799
|
}
|
|
16282
16800
|
}
|
|
16283
16801
|
var match = type.match(/^(.*)(\x5b(\d*)\x5d)$/);
|
|
@@ -16336,8 +16854,8 @@ var require_typed_data = __commonJS((exports2) => {
|
|
|
16336
16854
|
TypedDataEncoder3.prototype._visit = function(type, value, callback) {
|
|
16337
16855
|
var _this = this;
|
|
16338
16856
|
{
|
|
16339
|
-
var
|
|
16340
|
-
if (
|
|
16857
|
+
var encoder3 = getBaseEncoder2(type);
|
|
16858
|
+
if (encoder3) {
|
|
16341
16859
|
return callback(type, value);
|
|
16342
16860
|
}
|
|
16343
16861
|
}
|
|
@@ -16400,7 +16918,7 @@ var require_typed_data = __commonJS((exports2) => {
|
|
|
16400
16918
|
};
|
|
16401
16919
|
TypedDataEncoder3.resolveNames = function(domain, types2, value, resolveName2) {
|
|
16402
16920
|
return __awaiter17(this, undefined, undefined, function() {
|
|
16403
|
-
var ensCache,
|
|
16921
|
+
var ensCache, encoder3, _a, _b, _i, name_4, _c, _d;
|
|
16404
16922
|
return __generator(this, function(_e) {
|
|
16405
16923
|
switch (_e.label) {
|
|
16406
16924
|
case 0:
|
|
@@ -16409,8 +16927,8 @@ var require_typed_data = __commonJS((exports2) => {
|
|
|
16409
16927
|
if (domain.verifyingContract && !(0, bytes_1.isHexString)(domain.verifyingContract, 20)) {
|
|
16410
16928
|
ensCache[domain.verifyingContract] = "0x";
|
|
16411
16929
|
}
|
|
16412
|
-
|
|
16413
|
-
|
|
16930
|
+
encoder3 = TypedDataEncoder3.from(types2);
|
|
16931
|
+
encoder3.visit(value, function(type, value2) {
|
|
16414
16932
|
if (type === "address" && !(0, bytes_1.isHexString)(value2, 20)) {
|
|
16415
16933
|
ensCache[value2] = "0x";
|
|
16416
16934
|
}
|
|
@@ -16438,7 +16956,7 @@ var require_typed_data = __commonJS((exports2) => {
|
|
|
16438
16956
|
if (domain.verifyingContract && ensCache[domain.verifyingContract]) {
|
|
16439
16957
|
domain.verifyingContract = ensCache[domain.verifyingContract];
|
|
16440
16958
|
}
|
|
16441
|
-
value =
|
|
16959
|
+
value = encoder3.visit(value, function(type, value2) {
|
|
16442
16960
|
if (type === "address" && ensCache[value2]) {
|
|
16443
16961
|
return ensCache[value2];
|
|
16444
16962
|
}
|
|
@@ -16461,19 +16979,19 @@ var require_typed_data = __commonJS((exports2) => {
|
|
|
16461
16979
|
domainValues[name] = domainChecks2[name](value2);
|
|
16462
16980
|
domainTypes.push({ name, type: domainFieldTypes2[name] });
|
|
16463
16981
|
});
|
|
16464
|
-
var
|
|
16982
|
+
var encoder3 = TypedDataEncoder3.from(types2);
|
|
16465
16983
|
var typesWithDomain = (0, properties_1.shallowCopy)(types2);
|
|
16466
16984
|
if (typesWithDomain.EIP712Domain) {
|
|
16467
16985
|
logger47.throwArgumentError("types must not contain EIP712Domain type", "types.EIP712Domain", types2);
|
|
16468
16986
|
} else {
|
|
16469
16987
|
typesWithDomain.EIP712Domain = domainTypes;
|
|
16470
16988
|
}
|
|
16471
|
-
|
|
16989
|
+
encoder3.encode(value);
|
|
16472
16990
|
return {
|
|
16473
16991
|
types: typesWithDomain,
|
|
16474
16992
|
domain: domainValues,
|
|
16475
|
-
primaryType:
|
|
16476
|
-
message:
|
|
16993
|
+
primaryType: encoder3.primaryType,
|
|
16994
|
+
message: encoder3.visit(value, function(type, value2) {
|
|
16477
16995
|
if (type.match(/^bytes(\d*)/)) {
|
|
16478
16996
|
return (0, bytes_1.hexlify)((0, bytes_1.arrayify)(value2));
|
|
16479
16997
|
}
|
|
@@ -27308,12 +27826,12 @@ var init_crypto = __esm(() => {
|
|
|
27308
27826
|
ShortCurve2.prototype._endoWnafMulAdd = function _endoWnafMulAdd(points, coeffs, jacobianResult) {
|
|
27309
27827
|
var npoints = this._endoWnafT1, ncoeffs = this._endoWnafT2;
|
|
27310
27828
|
for (var i2 = 0;i2 < points.length; i2++) {
|
|
27311
|
-
var
|
|
27312
|
-
if (
|
|
27313
|
-
|
|
27314
|
-
if (
|
|
27315
|
-
|
|
27316
|
-
npoints[i2 * 2] = p, npoints[i2 * 2 + 1] = beta, ncoeffs[i2 * 2] =
|
|
27829
|
+
var split2 = this._endoSplit(coeffs[i2]), p = points[i2], beta = p._getBeta();
|
|
27830
|
+
if (split2.k1.negative)
|
|
27831
|
+
split2.k1.ineg(), p = p.neg(true);
|
|
27832
|
+
if (split2.k2.negative)
|
|
27833
|
+
split2.k2.ineg(), beta = beta.neg(true);
|
|
27834
|
+
npoints[i2 * 2] = p, npoints[i2 * 2 + 1] = beta, ncoeffs[i2 * 2] = split2.k1, ncoeffs[i2 * 2 + 1] = split2.k2;
|
|
27317
27835
|
}
|
|
27318
27836
|
var res = this._wnafMulAdd(1, npoints, ncoeffs, i2 * 2, jacobianResult);
|
|
27319
27837
|
for (var j = 0;j < i2 * 2; j++)
|
|
@@ -37002,21 +37520,21 @@ var require_short2 = __commonJS((exports2, module2) => {
|
|
|
37002
37520
|
var npoints = this._endoWnafT1;
|
|
37003
37521
|
var ncoeffs = this._endoWnafT2;
|
|
37004
37522
|
for (var i2 = 0;i2 < points.length; i2++) {
|
|
37005
|
-
var
|
|
37523
|
+
var split2 = this._endoSplit(coeffs[i2]);
|
|
37006
37524
|
var p = points[i2];
|
|
37007
37525
|
var beta = p._getBeta();
|
|
37008
|
-
if (
|
|
37009
|
-
|
|
37526
|
+
if (split2.k1.negative) {
|
|
37527
|
+
split2.k1.ineg();
|
|
37010
37528
|
p = p.neg(true);
|
|
37011
37529
|
}
|
|
37012
|
-
if (
|
|
37013
|
-
|
|
37530
|
+
if (split2.k2.negative) {
|
|
37531
|
+
split2.k2.ineg();
|
|
37014
37532
|
beta = beta.neg(true);
|
|
37015
37533
|
}
|
|
37016
37534
|
npoints[i2 * 2] = p;
|
|
37017
37535
|
npoints[i2 * 2 + 1] = beta;
|
|
37018
|
-
ncoeffs[i2 * 2] =
|
|
37019
|
-
ncoeffs[i2 * 2 + 1] =
|
|
37536
|
+
ncoeffs[i2 * 2] = split2.k1;
|
|
37537
|
+
ncoeffs[i2 * 2 + 1] = split2.k2;
|
|
37020
37538
|
}
|
|
37021
37539
|
var res = this._wnafMulAdd(1, npoints, ncoeffs, i2 * 2, jacobianResult);
|
|
37022
37540
|
for (var j = 0;j < i2 * 2; j++) {
|
|
@@ -42045,10 +42563,10 @@ var require_lib23 = __commonJS((exports2) => {
|
|
|
42045
42563
|
return (0, bytes_1.hexlify)((0, bytes_1.concat)(tight));
|
|
42046
42564
|
}
|
|
42047
42565
|
exports2.pack = pack4;
|
|
42048
|
-
function
|
|
42566
|
+
function keccak2564(types3, values) {
|
|
42049
42567
|
return (0, keccak256_1.keccak256)(pack4(types3, values));
|
|
42050
42568
|
}
|
|
42051
|
-
exports2.keccak256 =
|
|
42569
|
+
exports2.keccak256 = keccak2564;
|
|
42052
42570
|
function sha2563(types3, values) {
|
|
42053
42571
|
return (0, sha2_1.sha256)(pack4(types3, values));
|
|
42054
42572
|
}
|
|
@@ -44952,6 +45470,7 @@ var zeroAddress = "0x0000000000000000000000000000000000000000";
|
|
|
44952
45470
|
init_number();
|
|
44953
45471
|
init_toHex();
|
|
44954
45472
|
init_fromHex();
|
|
45473
|
+
init_getAddress();
|
|
44955
45474
|
init_pad();
|
|
44956
45475
|
|
|
44957
45476
|
// src/types/primitives.ts
|
|
@@ -45302,12 +45821,12 @@ function addSlice(array) {
|
|
|
45302
45821
|
return array;
|
|
45303
45822
|
}
|
|
45304
45823
|
function isBytesLike(value) {
|
|
45305
|
-
return isHexString(value) && !(value.length % 2) ||
|
|
45824
|
+
return isHexString(value) && !(value.length % 2) || isBytes2(value);
|
|
45306
45825
|
}
|
|
45307
45826
|
function isInteger(value) {
|
|
45308
45827
|
return typeof value === "number" && value == value && value % 1 === 0;
|
|
45309
45828
|
}
|
|
45310
|
-
function
|
|
45829
|
+
function isBytes2(value) {
|
|
45311
45830
|
if (value == null) {
|
|
45312
45831
|
return false;
|
|
45313
45832
|
}
|
|
@@ -45367,7 +45886,7 @@ function arrayify(value, options) {
|
|
|
45367
45886
|
}
|
|
45368
45887
|
return addSlice(new Uint8Array(result));
|
|
45369
45888
|
}
|
|
45370
|
-
if (
|
|
45889
|
+
if (isBytes2(value)) {
|
|
45371
45890
|
return addSlice(new Uint8Array(value));
|
|
45372
45891
|
}
|
|
45373
45892
|
return logger.throwArgumentError("invalid arrayify value", "value", value);
|
|
@@ -45459,7 +45978,7 @@ function hexlify(value, options) {
|
|
|
45459
45978
|
}
|
|
45460
45979
|
return value.toLowerCase();
|
|
45461
45980
|
}
|
|
45462
|
-
if (
|
|
45981
|
+
if (isBytes2(value)) {
|
|
45463
45982
|
let result = "0x";
|
|
45464
45983
|
for (let i2 = 0;i2 < value.length; i2++) {
|
|
45465
45984
|
let v = value[i2];
|
|
@@ -45660,7 +46179,7 @@ var logger2 = new Logger(version4);
|
|
|
45660
46179
|
var _constructorGuard = {};
|
|
45661
46180
|
var MAX_SAFE = 9007199254740991;
|
|
45662
46181
|
function isBigNumberish(value) {
|
|
45663
|
-
return value != null && (BigNumber.isBigNumber(value) || typeof value === "number" && value % 1 === 0 || typeof value === "string" && !!value.match(/^-?[0-9]+$/) || isHexString(value) || typeof value === "bigint" ||
|
|
46182
|
+
return value != null && (BigNumber.isBigNumber(value) || typeof value === "number" && value % 1 === 0 || typeof value === "string" && !!value.match(/^-?[0-9]+$/) || isHexString(value) || typeof value === "bigint" || isBytes2(value));
|
|
45664
46183
|
}
|
|
45665
46184
|
var _warnedToStringRadix = false;
|
|
45666
46185
|
|
|
@@ -45840,7 +46359,7 @@ class BigNumber {
|
|
|
45840
46359
|
if (typeof anyValue === "bigint") {
|
|
45841
46360
|
return BigNumber.from(anyValue.toString());
|
|
45842
46361
|
}
|
|
45843
|
-
if (
|
|
46362
|
+
if (isBytes2(anyValue)) {
|
|
45844
46363
|
return BigNumber.from(hexlify(anyValue));
|
|
45845
46364
|
}
|
|
45846
46365
|
if (anyValue) {
|
|
@@ -46240,7 +46759,7 @@ class FixedNumber {
|
|
|
46240
46759
|
if (typeof value === "string") {
|
|
46241
46760
|
return FixedNumber.fromString(value, format);
|
|
46242
46761
|
}
|
|
46243
|
-
if (
|
|
46762
|
+
if (isBytes2(value)) {
|
|
46244
46763
|
return FixedNumber.fromBytes(value, format);
|
|
46245
46764
|
}
|
|
46246
46765
|
try {
|
|
@@ -47350,7 +47869,7 @@ class Reader {
|
|
|
47350
47869
|
|
|
47351
47870
|
// node_modules/@ethersproject/keccak256/lib.esm/index.js
|
|
47352
47871
|
var import_js_sha3 = __toESM(require_sha3());
|
|
47353
|
-
function
|
|
47872
|
+
function keccak2562(data) {
|
|
47354
47873
|
return "0x" + import_js_sha3.default.keccak_256(arrayify(data));
|
|
47355
47874
|
}
|
|
47356
47875
|
|
|
@@ -47489,7 +48008,7 @@ function getChecksumAddress(address) {
|
|
|
47489
48008
|
for (let i2 = 0;i2 < 40; i2++) {
|
|
47490
48009
|
expanded[i2] = chars[i2].charCodeAt(0);
|
|
47491
48010
|
}
|
|
47492
|
-
const hashed = arrayify(
|
|
48011
|
+
const hashed = arrayify(keccak2562(expanded));
|
|
47493
48012
|
for (let i2 = 0;i2 < 40; i2 += 2) {
|
|
47494
48013
|
if (hashed[i2 >> 1] >> 4 >= 8) {
|
|
47495
48014
|
chars[i2] = chars[i2].toUpperCase();
|
|
@@ -47531,7 +48050,7 @@ function ibanChecksum(address) {
|
|
|
47531
48050
|
}
|
|
47532
48051
|
return checksum;
|
|
47533
48052
|
}
|
|
47534
|
-
function
|
|
48053
|
+
function getAddress2(address) {
|
|
47535
48054
|
let result = null;
|
|
47536
48055
|
if (typeof address !== "string") {
|
|
47537
48056
|
logger8.throwArgumentError("invalid address", "address", address);
|
|
@@ -47558,15 +48077,15 @@ function getAddress(address) {
|
|
|
47558
48077
|
}
|
|
47559
48078
|
return result;
|
|
47560
48079
|
}
|
|
47561
|
-
function
|
|
48080
|
+
function isAddress2(address) {
|
|
47562
48081
|
try {
|
|
47563
|
-
|
|
48082
|
+
getAddress2(address);
|
|
47564
48083
|
return true;
|
|
47565
48084
|
} catch (error) {}
|
|
47566
48085
|
return false;
|
|
47567
48086
|
}
|
|
47568
48087
|
function getIcapAddress(address) {
|
|
47569
|
-
let base36 = _base16To36(
|
|
48088
|
+
let base36 = _base16To36(getAddress2(address).substring(2)).toUpperCase();
|
|
47570
48089
|
while (base36.length < 30) {
|
|
47571
48090
|
base36 = "0" + base36;
|
|
47572
48091
|
}
|
|
@@ -47575,12 +48094,12 @@ function getIcapAddress(address) {
|
|
|
47575
48094
|
function getContractAddress(transaction) {
|
|
47576
48095
|
let from2 = null;
|
|
47577
48096
|
try {
|
|
47578
|
-
from2 =
|
|
48097
|
+
from2 = getAddress2(transaction.from);
|
|
47579
48098
|
} catch (error) {
|
|
47580
48099
|
logger8.throwArgumentError("missing from address", "transaction", transaction);
|
|
47581
48100
|
}
|
|
47582
48101
|
const nonce = stripZeros(arrayify(BigNumber.from(transaction.nonce).toHexString()));
|
|
47583
|
-
return
|
|
48102
|
+
return getAddress2(hexDataSlice(keccak2562(encode([from2, nonce])), 12));
|
|
47584
48103
|
}
|
|
47585
48104
|
function getCreate2Address(from2, salt, initCodeHash) {
|
|
47586
48105
|
if (hexDataLength(salt) !== 32) {
|
|
@@ -47589,7 +48108,7 @@ function getCreate2Address(from2, salt, initCodeHash) {
|
|
|
47589
48108
|
if (hexDataLength(initCodeHash) !== 32) {
|
|
47590
48109
|
logger8.throwArgumentError("initCodeHash must be 32 bytes", "initCodeHash", initCodeHash);
|
|
47591
48110
|
}
|
|
47592
|
-
return
|
|
48111
|
+
return getAddress2(hexDataSlice(keccak2562(concat2(["0xff", getAddress2(from2), salt, initCodeHash])), 12));
|
|
47593
48112
|
}
|
|
47594
48113
|
|
|
47595
48114
|
// node_modules/@ethersproject/abi/lib.esm/coders/address.js
|
|
@@ -47602,14 +48121,14 @@ class AddressCoder extends Coder {
|
|
|
47602
48121
|
}
|
|
47603
48122
|
encode(writer, value) {
|
|
47604
48123
|
try {
|
|
47605
|
-
value =
|
|
48124
|
+
value = getAddress2(value);
|
|
47606
48125
|
} catch (error) {
|
|
47607
48126
|
this._throwError(error.message, value);
|
|
47608
48127
|
}
|
|
47609
48128
|
return writer.writeValue(value);
|
|
47610
48129
|
}
|
|
47611
48130
|
decode(reader) {
|
|
47612
|
-
return
|
|
48131
|
+
return getAddress2(hexZeroPad(reader.readValue().toHexString(), 20));
|
|
47613
48132
|
}
|
|
47614
48133
|
}
|
|
47615
48134
|
|
|
@@ -48523,7 +49042,7 @@ var defaultAbiCoder = new AbiCoder;
|
|
|
48523
49042
|
|
|
48524
49043
|
// node_modules/@ethersproject/hash/lib.esm/id.js
|
|
48525
49044
|
function id(text) {
|
|
48526
|
-
return
|
|
49045
|
+
return keccak2562(toUtf8Bytes(text));
|
|
48527
49046
|
}
|
|
48528
49047
|
|
|
48529
49048
|
// node_modules/@ethersproject/hash/lib.esm/_version.js
|
|
@@ -48922,7 +49441,7 @@ function namehash(name) {
|
|
|
48922
49441
|
let result = Zeros;
|
|
48923
49442
|
const comps = ensNameSplit(name);
|
|
48924
49443
|
while (comps.length) {
|
|
48925
|
-
result =
|
|
49444
|
+
result = keccak2562(concat2([result, keccak2562(comps.pop())]));
|
|
48926
49445
|
}
|
|
48927
49446
|
return hexlify(result);
|
|
48928
49447
|
}
|
|
@@ -48945,7 +49464,7 @@ function hashMessage(message) {
|
|
|
48945
49464
|
if (typeof message === "string") {
|
|
48946
49465
|
message = toUtf8Bytes(message);
|
|
48947
49466
|
}
|
|
48948
|
-
return
|
|
49467
|
+
return keccak2562(concat2([
|
|
48949
49468
|
toUtf8Bytes(messagePrefix),
|
|
48950
49469
|
toUtf8Bytes(String(message.length)),
|
|
48951
49470
|
message
|
|
@@ -49030,7 +49549,7 @@ var domainChecks = {
|
|
|
49030
49549
|
},
|
|
49031
49550
|
verifyingContract: function(value) {
|
|
49032
49551
|
try {
|
|
49033
|
-
return
|
|
49552
|
+
return getAddress2(value).toLowerCase();
|
|
49034
49553
|
} catch (error) {}
|
|
49035
49554
|
return logger13.throwArgumentError(`invalid domain value "verifyingContract"`, "domain.verifyingContract", value);
|
|
49036
49555
|
},
|
|
@@ -49084,7 +49603,7 @@ function getBaseEncoder(type) {
|
|
|
49084
49603
|
switch (type) {
|
|
49085
49604
|
case "address":
|
|
49086
49605
|
return function(value) {
|
|
49087
|
-
return hexZeroPad(
|
|
49606
|
+
return hexZeroPad(getAddress2(value), 32);
|
|
49088
49607
|
};
|
|
49089
49608
|
case "bool":
|
|
49090
49609
|
return function(value) {
|
|
@@ -49092,7 +49611,7 @@ function getBaseEncoder(type) {
|
|
|
49092
49611
|
};
|
|
49093
49612
|
case "bytes":
|
|
49094
49613
|
return function(value) {
|
|
49095
|
-
return
|
|
49614
|
+
return keccak2562(value);
|
|
49096
49615
|
};
|
|
49097
49616
|
case "string":
|
|
49098
49617
|
return function(value) {
|
|
@@ -49129,8 +49648,8 @@ class TypedDataEncoder {
|
|
|
49129
49648
|
if (baseType === name) {
|
|
49130
49649
|
logger13.throwArgumentError(`circular type reference to ${JSON.stringify(baseType)}`, "types", types);
|
|
49131
49650
|
}
|
|
49132
|
-
const
|
|
49133
|
-
if (
|
|
49651
|
+
const encoder3 = getBaseEncoder(baseType);
|
|
49652
|
+
if (encoder3) {
|
|
49134
49653
|
return;
|
|
49135
49654
|
}
|
|
49136
49655
|
if (!parents[baseType]) {
|
|
@@ -49171,17 +49690,17 @@ class TypedDataEncoder {
|
|
|
49171
49690
|
}
|
|
49172
49691
|
}
|
|
49173
49692
|
getEncoder(type) {
|
|
49174
|
-
let
|
|
49175
|
-
if (!
|
|
49176
|
-
|
|
49693
|
+
let encoder3 = this._encoderCache[type];
|
|
49694
|
+
if (!encoder3) {
|
|
49695
|
+
encoder3 = this._encoderCache[type] = this._getEncoder(type);
|
|
49177
49696
|
}
|
|
49178
|
-
return
|
|
49697
|
+
return encoder3;
|
|
49179
49698
|
}
|
|
49180
49699
|
_getEncoder(type) {
|
|
49181
49700
|
{
|
|
49182
|
-
const
|
|
49183
|
-
if (
|
|
49184
|
-
return
|
|
49701
|
+
const encoder3 = getBaseEncoder(type);
|
|
49702
|
+
if (encoder3) {
|
|
49703
|
+
return encoder3;
|
|
49185
49704
|
}
|
|
49186
49705
|
}
|
|
49187
49706
|
const match = type.match(/^(.*)(\x5b(\d*)\x5d)$/);
|
|
@@ -49195,9 +49714,9 @@ class TypedDataEncoder {
|
|
|
49195
49714
|
}
|
|
49196
49715
|
let result = value.map(subEncoder);
|
|
49197
49716
|
if (this._types[subtype]) {
|
|
49198
|
-
result = result.map(
|
|
49717
|
+
result = result.map(keccak2562);
|
|
49199
49718
|
}
|
|
49200
|
-
return
|
|
49719
|
+
return keccak2562(hexConcat(result));
|
|
49201
49720
|
};
|
|
49202
49721
|
}
|
|
49203
49722
|
const fields = this.types[type];
|
|
@@ -49207,7 +49726,7 @@ class TypedDataEncoder {
|
|
|
49207
49726
|
const values = fields.map(({ name, type: type2 }) => {
|
|
49208
49727
|
const result = this.getEncoder(type2)(value[name]);
|
|
49209
49728
|
if (this._types[type2]) {
|
|
49210
|
-
return
|
|
49729
|
+
return keccak2562(result);
|
|
49211
49730
|
}
|
|
49212
49731
|
return result;
|
|
49213
49732
|
});
|
|
@@ -49228,7 +49747,7 @@ class TypedDataEncoder {
|
|
|
49228
49747
|
return this.getEncoder(type)(value);
|
|
49229
49748
|
}
|
|
49230
49749
|
hashStruct(name, value) {
|
|
49231
|
-
return
|
|
49750
|
+
return keccak2562(this.encodeData(name, value));
|
|
49232
49751
|
}
|
|
49233
49752
|
encode(value) {
|
|
49234
49753
|
return this.encodeData(this.primaryType, value);
|
|
@@ -49238,8 +49757,8 @@ class TypedDataEncoder {
|
|
|
49238
49757
|
}
|
|
49239
49758
|
_visit(type, value, callback) {
|
|
49240
49759
|
{
|
|
49241
|
-
const
|
|
49242
|
-
if (
|
|
49760
|
+
const encoder3 = getBaseEncoder(type);
|
|
49761
|
+
if (encoder3) {
|
|
49243
49762
|
return callback(type, value);
|
|
49244
49763
|
}
|
|
49245
49764
|
}
|
|
@@ -49295,7 +49814,7 @@ class TypedDataEncoder {
|
|
|
49295
49814
|
]);
|
|
49296
49815
|
}
|
|
49297
49816
|
static hash(domain, types, value) {
|
|
49298
|
-
return
|
|
49817
|
+
return keccak2562(TypedDataEncoder.encode(domain, types, value));
|
|
49299
49818
|
}
|
|
49300
49819
|
static resolveNames(domain, types, value, resolveName) {
|
|
49301
49820
|
return __awaiter2(this, undefined, undefined, function* () {
|
|
@@ -49304,8 +49823,8 @@ class TypedDataEncoder {
|
|
|
49304
49823
|
if (domain.verifyingContract && !isHexString(domain.verifyingContract, 20)) {
|
|
49305
49824
|
ensCache[domain.verifyingContract] = "0x";
|
|
49306
49825
|
}
|
|
49307
|
-
const
|
|
49308
|
-
|
|
49826
|
+
const encoder3 = TypedDataEncoder.from(types);
|
|
49827
|
+
encoder3.visit(value, (type, value2) => {
|
|
49309
49828
|
if (type === "address" && !isHexString(value2, 20)) {
|
|
49310
49829
|
ensCache[value2] = "0x";
|
|
49311
49830
|
}
|
|
@@ -49317,7 +49836,7 @@ class TypedDataEncoder {
|
|
|
49317
49836
|
if (domain.verifyingContract && ensCache[domain.verifyingContract]) {
|
|
49318
49837
|
domain.verifyingContract = ensCache[domain.verifyingContract];
|
|
49319
49838
|
}
|
|
49320
|
-
value =
|
|
49839
|
+
value = encoder3.visit(value, (type, value2) => {
|
|
49321
49840
|
if (type === "address" && ensCache[value2]) {
|
|
49322
49841
|
return ensCache[value2];
|
|
49323
49842
|
}
|
|
@@ -49338,19 +49857,19 @@ class TypedDataEncoder {
|
|
|
49338
49857
|
domainValues[name] = domainChecks[name](value2);
|
|
49339
49858
|
domainTypes.push({ name, type: domainFieldTypes[name] });
|
|
49340
49859
|
});
|
|
49341
|
-
const
|
|
49860
|
+
const encoder3 = TypedDataEncoder.from(types);
|
|
49342
49861
|
const typesWithDomain = shallowCopy(types);
|
|
49343
49862
|
if (typesWithDomain.EIP712Domain) {
|
|
49344
49863
|
logger13.throwArgumentError("types must not contain EIP712Domain type", "types.EIP712Domain", types);
|
|
49345
49864
|
} else {
|
|
49346
49865
|
typesWithDomain.EIP712Domain = domainTypes;
|
|
49347
49866
|
}
|
|
49348
|
-
|
|
49867
|
+
encoder3.encode(value);
|
|
49349
49868
|
return {
|
|
49350
49869
|
types: typesWithDomain,
|
|
49351
49870
|
domain: domainValues,
|
|
49352
|
-
primaryType:
|
|
49353
|
-
message:
|
|
49871
|
+
primaryType: encoder3.primaryType,
|
|
49872
|
+
message: encoder3.visit(value, (type, value2) => {
|
|
49354
49873
|
if (type.match(/^bytes(\d*)/)) {
|
|
49355
49874
|
return hexlify(arrayify(value2));
|
|
49356
49875
|
}
|
|
@@ -49470,7 +49989,7 @@ class Interface {
|
|
|
49470
49989
|
return defaultAbiCoder;
|
|
49471
49990
|
}
|
|
49472
49991
|
static getAddress(address) {
|
|
49473
|
-
return
|
|
49992
|
+
return getAddress2(address);
|
|
49474
49993
|
}
|
|
49475
49994
|
static getSighash(fragment) {
|
|
49476
49995
|
return hexDataSlice(id(fragment.format()), 0, 4);
|
|
@@ -49698,7 +50217,7 @@ class Interface {
|
|
|
49698
50217
|
if (param.type === "string") {
|
|
49699
50218
|
return id(value);
|
|
49700
50219
|
} else if (param.type === "bytes") {
|
|
49701
|
-
return
|
|
50220
|
+
return keccak2562(hexlify(value));
|
|
49702
50221
|
}
|
|
49703
50222
|
if (param.type === "bool" && typeof value === "boolean") {
|
|
49704
50223
|
value = value ? "0x01" : "0x00";
|
|
@@ -49753,7 +50272,7 @@ class Interface {
|
|
|
49753
50272
|
if (param.type === "string") {
|
|
49754
50273
|
topics.push(id(value));
|
|
49755
50274
|
} else if (param.type === "bytes") {
|
|
49756
|
-
topics.push(
|
|
50275
|
+
topics.push(keccak2562(value));
|
|
49757
50276
|
} else if (param.baseType === "tuple" || param.baseType === "array") {
|
|
49758
50277
|
throw new Error("not implemented");
|
|
49759
50278
|
} else {
|
|
@@ -50904,21 +51423,21 @@ ShortCurve.prototype._endoWnafMulAdd = function _endoWnafMulAdd(points, coeffs,
|
|
|
50904
51423
|
var npoints = this._endoWnafT1;
|
|
50905
51424
|
var ncoeffs = this._endoWnafT2;
|
|
50906
51425
|
for (var i2 = 0;i2 < points.length; i2++) {
|
|
50907
|
-
var
|
|
51426
|
+
var split2 = this._endoSplit(coeffs[i2]);
|
|
50908
51427
|
var p = points[i2];
|
|
50909
51428
|
var beta = p._getBeta();
|
|
50910
|
-
if (
|
|
50911
|
-
|
|
51429
|
+
if (split2.k1.negative) {
|
|
51430
|
+
split2.k1.ineg();
|
|
50912
51431
|
p = p.neg(true);
|
|
50913
51432
|
}
|
|
50914
|
-
if (
|
|
50915
|
-
|
|
51433
|
+
if (split2.k2.negative) {
|
|
51434
|
+
split2.k2.ineg();
|
|
50916
51435
|
beta = beta.neg(true);
|
|
50917
51436
|
}
|
|
50918
51437
|
npoints[i2 * 2] = p;
|
|
50919
51438
|
npoints[i2 * 2 + 1] = beta;
|
|
50920
|
-
ncoeffs[i2 * 2] =
|
|
50921
|
-
ncoeffs[i2 * 2 + 1] =
|
|
51439
|
+
ncoeffs[i2 * 2] = split2.k1;
|
|
51440
|
+
ncoeffs[i2 * 2 + 1] = split2.k2;
|
|
50922
51441
|
}
|
|
50923
51442
|
var res = this._wnafMulAdd(1, npoints, ncoeffs, i2 * 2, jacobianResult);
|
|
50924
51443
|
for (var j = 0;j < i2 * 2; j++) {
|
|
@@ -52174,7 +52693,7 @@ function handleAddress(value) {
|
|
|
52174
52693
|
if (value === "0x") {
|
|
52175
52694
|
return null;
|
|
52176
52695
|
}
|
|
52177
|
-
return
|
|
52696
|
+
return getAddress2(value);
|
|
52178
52697
|
}
|
|
52179
52698
|
function handleNumber(value) {
|
|
52180
52699
|
if (value === "0x") {
|
|
@@ -52202,7 +52721,7 @@ var allowedTransactionKeys2 = {
|
|
|
52202
52721
|
};
|
|
52203
52722
|
function computeAddress(key2) {
|
|
52204
52723
|
const publicKey = computePublicKey(key2);
|
|
52205
|
-
return
|
|
52724
|
+
return getAddress2(hexDataSlice(keccak2562(hexDataSlice(publicKey, 1)), 12));
|
|
52206
52725
|
}
|
|
52207
52726
|
function recoverAddress(digest, signature2) {
|
|
52208
52727
|
return computeAddress(recoverPublicKey(arrayify(digest), signature2));
|
|
@@ -52216,7 +52735,7 @@ function formatNumber(value, name) {
|
|
|
52216
52735
|
}
|
|
52217
52736
|
function accessSetify(addr, storageKeys) {
|
|
52218
52737
|
return {
|
|
52219
|
-
address:
|
|
52738
|
+
address: getAddress2(addr),
|
|
52220
52739
|
storageKeys: (storageKeys || []).map((storageKey, index) => {
|
|
52221
52740
|
if (hexDataLength(storageKey) !== 32) {
|
|
52222
52741
|
logger18.throwArgumentError("invalid access list storageKey", `accessList[${addr}:${index}]`, storageKey);
|
|
@@ -52267,7 +52786,7 @@ function _serializeEip1559(transaction, signature2) {
|
|
|
52267
52786
|
formatNumber(transaction.maxPriorityFeePerGas || 0, "maxPriorityFeePerGas"),
|
|
52268
52787
|
formatNumber(transaction.maxFeePerGas || 0, "maxFeePerGas"),
|
|
52269
52788
|
formatNumber(transaction.gasLimit || 0, "gasLimit"),
|
|
52270
|
-
transaction.to != null ?
|
|
52789
|
+
transaction.to != null ? getAddress2(transaction.to) : "0x",
|
|
52271
52790
|
formatNumber(transaction.value || 0, "value"),
|
|
52272
52791
|
transaction.data || "0x",
|
|
52273
52792
|
formatAccessList(transaction.accessList || [])
|
|
@@ -52286,7 +52805,7 @@ function _serializeEip2930(transaction, signature2) {
|
|
|
52286
52805
|
formatNumber(transaction.nonce || 0, "nonce"),
|
|
52287
52806
|
formatNumber(transaction.gasPrice || 0, "gasPrice"),
|
|
52288
52807
|
formatNumber(transaction.gasLimit || 0, "gasLimit"),
|
|
52289
|
-
transaction.to != null ?
|
|
52808
|
+
transaction.to != null ? getAddress2(transaction.to) : "0x",
|
|
52290
52809
|
formatNumber(transaction.value || 0, "value"),
|
|
52291
52810
|
transaction.data || "0x",
|
|
52292
52811
|
formatAccessList(transaction.accessList || [])
|
|
@@ -52388,7 +52907,7 @@ function _parseEipSignature(tx, fields, serialize2) {
|
|
|
52388
52907
|
tx.r = hexZeroPad(fields[1], 32);
|
|
52389
52908
|
tx.s = hexZeroPad(fields[2], 32);
|
|
52390
52909
|
try {
|
|
52391
|
-
const digest =
|
|
52910
|
+
const digest = keccak2562(serialize2(tx));
|
|
52392
52911
|
tx.from = recoverAddress(digest, { r: tx.r, s: tx.s, recoveryParam: tx.v });
|
|
52393
52912
|
} catch (error) {}
|
|
52394
52913
|
}
|
|
@@ -52415,7 +52934,7 @@ function _parseEip1559(payload) {
|
|
|
52415
52934
|
if (transaction.length === 9) {
|
|
52416
52935
|
return tx;
|
|
52417
52936
|
}
|
|
52418
|
-
tx.hash =
|
|
52937
|
+
tx.hash = keccak2562(payload);
|
|
52419
52938
|
_parseEipSignature(tx, transaction.slice(9), _serializeEip1559);
|
|
52420
52939
|
return tx;
|
|
52421
52940
|
}
|
|
@@ -52438,7 +52957,7 @@ function _parseEip2930(payload) {
|
|
|
52438
52957
|
if (transaction.length === 8) {
|
|
52439
52958
|
return tx;
|
|
52440
52959
|
}
|
|
52441
|
-
tx.hash =
|
|
52960
|
+
tx.hash = keccak2562(payload);
|
|
52442
52961
|
_parseEipSignature(tx, transaction.slice(8), _serializeEip2930);
|
|
52443
52962
|
return tx;
|
|
52444
52963
|
}
|
|
@@ -52482,11 +53001,11 @@ function _parse(rawTransaction) {
|
|
|
52482
53001
|
raw.push("0x");
|
|
52483
53002
|
recoveryParam -= tx.chainId * 2 + 8;
|
|
52484
53003
|
}
|
|
52485
|
-
const digest =
|
|
53004
|
+
const digest = keccak2562(encode(raw));
|
|
52486
53005
|
try {
|
|
52487
53006
|
tx.from = recoverAddress(digest, { r: hexlify(tx.r), s: hexlify(tx.s), recoveryParam });
|
|
52488
53007
|
} catch (error) {}
|
|
52489
|
-
tx.hash =
|
|
53008
|
+
tx.hash = keccak2562(rawTransaction);
|
|
52490
53009
|
}
|
|
52491
53010
|
tx.type = null;
|
|
52492
53011
|
return tx;
|
|
@@ -52565,7 +53084,7 @@ function resolveName(resolver, nameOrPromise) {
|
|
|
52565
53084
|
logger19.throwArgumentError("invalid address or ENS name", "name", name);
|
|
52566
53085
|
}
|
|
52567
53086
|
try {
|
|
52568
|
-
return
|
|
53087
|
+
return getAddress2(name);
|
|
52569
53088
|
} catch (error) {}
|
|
52570
53089
|
if (!resolver) {
|
|
52571
53090
|
logger19.throwError("a provider or signer is needed to resolve ENS names", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
@@ -52617,7 +53136,7 @@ function populateTransaction(contract, fragment, args) {
|
|
|
52617
53136
|
override: resolveName(contract.signer, overrides.from),
|
|
52618
53137
|
signer: contract.signer.getAddress()
|
|
52619
53138
|
}).then((check) => __awaiter5(this, undefined, undefined, function* () {
|
|
52620
|
-
if (
|
|
53139
|
+
if (getAddress2(check.signer) !== check.override) {
|
|
52621
53140
|
logger19.throwError("Contract with a Signer cannot override from", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
52622
53141
|
operation: "overrides.from"
|
|
52623
53142
|
});
|
|
@@ -53008,7 +53527,7 @@ class BaseContract {
|
|
|
53008
53527
|
defineReadOnly(this, "resolvedAddress", resolveName(this.provider, addressOrName));
|
|
53009
53528
|
} else {
|
|
53010
53529
|
try {
|
|
53011
|
-
defineReadOnly(this, "resolvedAddress", Promise.resolve(
|
|
53530
|
+
defineReadOnly(this, "resolvedAddress", Promise.resolve(getAddress2(addressOrName)));
|
|
53012
53531
|
} catch (error) {
|
|
53013
53532
|
logger19.throwError("provider is required to use ENS name as contract address", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
53014
53533
|
operation: "new Contract"
|
|
@@ -53334,7 +53853,7 @@ class ContractFactory {
|
|
|
53334
53853
|
let bytecodeHex = null;
|
|
53335
53854
|
if (typeof bytecode === "string") {
|
|
53336
53855
|
bytecodeHex = bytecode;
|
|
53337
|
-
} else if (
|
|
53856
|
+
} else if (isBytes2(bytecode)) {
|
|
53338
53857
|
bytecodeHex = hexlify(bytecode);
|
|
53339
53858
|
} else if (bytecode && typeof bytecode.object === "string") {
|
|
53340
53859
|
bytecodeHex = bytecode.object;
|
|
@@ -54024,7 +54543,7 @@ class CrowdsaleAccount extends Description {
|
|
|
54024
54543
|
function decrypt(json, password) {
|
|
54025
54544
|
const data = JSON.parse(json);
|
|
54026
54545
|
password = getPassword(password);
|
|
54027
|
-
const ethaddr =
|
|
54546
|
+
const ethaddr = getAddress2(searchPath(data, "ethaddr"));
|
|
54028
54547
|
const encseed = looseArrayify(searchPath(data, "encseed"));
|
|
54029
54548
|
if (!encseed || encseed.length % 16 !== 0) {
|
|
54030
54549
|
logger24.throwArgumentError("invalid encseed", "json", json);
|
|
@@ -54039,7 +54558,7 @@ function decrypt(json, password) {
|
|
|
54039
54558
|
seedHex += String.fromCharCode(seed[i2]);
|
|
54040
54559
|
}
|
|
54041
54560
|
const seedHexBytes = toUtf8Bytes(seedHex);
|
|
54042
|
-
const privateKey =
|
|
54561
|
+
const privateKey = keccak2562(seedHexBytes);
|
|
54043
54562
|
return new CrowdsaleAccount({
|
|
54044
54563
|
_isCrowdsaleAccount: true,
|
|
54045
54564
|
address: ethaddr,
|
|
@@ -54072,14 +54591,14 @@ function isKeystoreWallet(json) {
|
|
|
54072
54591
|
function getJsonWalletAddress(json) {
|
|
54073
54592
|
if (isCrowdsaleWallet(json)) {
|
|
54074
54593
|
try {
|
|
54075
|
-
return
|
|
54594
|
+
return getAddress2(JSON.parse(json).ethaddr);
|
|
54076
54595
|
} catch (error) {
|
|
54077
54596
|
return null;
|
|
54078
54597
|
}
|
|
54079
54598
|
}
|
|
54080
54599
|
if (isKeystoreWallet(json)) {
|
|
54081
54600
|
try {
|
|
54082
|
-
return
|
|
54601
|
+
return getAddress2(JSON.parse(json).address);
|
|
54083
54602
|
} catch (error) {
|
|
54084
54603
|
return null;
|
|
54085
54604
|
}
|
|
@@ -54140,7 +54659,7 @@ function _decrypt(data, key2, ciphertext) {
|
|
|
54140
54659
|
}
|
|
54141
54660
|
function _getAccount(data, key2) {
|
|
54142
54661
|
const ciphertext = looseArrayify(searchPath(data, "crypto/ciphertext"));
|
|
54143
|
-
const computedMAC = hexlify(
|
|
54662
|
+
const computedMAC = hexlify(keccak2562(concat2([key2.slice(16, 32), ciphertext]))).substring(2);
|
|
54144
54663
|
if (computedMAC !== searchPath(data, "crypto/mac").toLowerCase()) {
|
|
54145
54664
|
throw new Error("invalid password");
|
|
54146
54665
|
}
|
|
@@ -54157,7 +54676,7 @@ function _getAccount(data, key2) {
|
|
|
54157
54676
|
if (check.substring(0, 2) !== "0x") {
|
|
54158
54677
|
check = "0x" + check;
|
|
54159
54678
|
}
|
|
54160
|
-
if (
|
|
54679
|
+
if (getAddress2(check) !== address) {
|
|
54161
54680
|
throw new Error("address mismatch");
|
|
54162
54681
|
}
|
|
54163
54682
|
}
|
|
@@ -54253,7 +54772,7 @@ function decrypt2(json, password, progressCallback) {
|
|
|
54253
54772
|
}
|
|
54254
54773
|
function encrypt(account, password, options, progressCallback) {
|
|
54255
54774
|
try {
|
|
54256
|
-
if (
|
|
54775
|
+
if (getAddress2(account.address) !== computeAddress(account.privateKey)) {
|
|
54257
54776
|
throw new Error("address/privateKey mismatch");
|
|
54258
54777
|
}
|
|
54259
54778
|
if (hasMnemonic(account)) {
|
|
@@ -54332,7 +54851,7 @@ function encrypt(account, password, options, progressCallback) {
|
|
|
54332
54851
|
const counter = new import_aes_js2.default.Counter(iv);
|
|
54333
54852
|
const aesCtr = new import_aes_js2.default.ModeOfOperation.ctr(derivedKey, counter);
|
|
54334
54853
|
const ciphertext = arrayify(aesCtr.encrypt(privateKey));
|
|
54335
|
-
const mac =
|
|
54854
|
+
const mac = keccak2562(concat2([macPrefix, ciphertext]));
|
|
54336
54855
|
const data = {
|
|
54337
54856
|
address: account.address.substring(2).toLowerCase(),
|
|
54338
54857
|
id: uuidV4(uuidRandom),
|
|
@@ -54449,7 +54968,7 @@ class Wallet extends Signer {
|
|
|
54449
54968
|
const signingKey = new SigningKey(privateKey.privateKey);
|
|
54450
54969
|
defineReadOnly(this, "_signingKey", () => signingKey);
|
|
54451
54970
|
defineReadOnly(this, "address", computeAddress(this.publicKey));
|
|
54452
|
-
if (this.address !==
|
|
54971
|
+
if (this.address !== getAddress2(privateKey.address)) {
|
|
54453
54972
|
logger26.throwArgumentError("privateKey/address mismatch", "privateKey", "[REDACTED]");
|
|
54454
54973
|
}
|
|
54455
54974
|
if (hasMnemonic2(privateKey)) {
|
|
@@ -54508,12 +55027,12 @@ class Wallet extends Signer {
|
|
|
54508
55027
|
signTransaction(transaction) {
|
|
54509
55028
|
return resolveProperties(transaction).then((tx) => {
|
|
54510
55029
|
if (tx.from != null) {
|
|
54511
|
-
if (
|
|
55030
|
+
if (getAddress2(tx.from) !== this.address) {
|
|
54512
55031
|
logger26.throwArgumentError("transaction from address mismatch", "transaction.from", transaction.from);
|
|
54513
55032
|
}
|
|
54514
55033
|
delete tx.from;
|
|
54515
55034
|
}
|
|
54516
|
-
const signature2 = this._signingKey().signDigest(
|
|
55035
|
+
const signature2 = this._signingKey().signDigest(keccak2562(serialize(tx)));
|
|
54517
55036
|
return serialize(tx, signature2);
|
|
54518
55037
|
});
|
|
54519
55038
|
}
|
|
@@ -54555,7 +55074,7 @@ class Wallet extends Signer {
|
|
|
54555
55074
|
options = {};
|
|
54556
55075
|
}
|
|
54557
55076
|
if (options.extraEntropy) {
|
|
54558
|
-
entropy = arrayify(hexDataSlice(
|
|
55077
|
+
entropy = arrayify(hexDataSlice(keccak2562(concat2([entropy, options.extraEntropy])), 0, 16));
|
|
54559
55078
|
}
|
|
54560
55079
|
const mnemonic = entropyToMnemonic(entropy, options.locale);
|
|
54561
55080
|
return Wallet.fromMnemonic(mnemonic, options.path, options.locale);
|
|
@@ -55480,13 +55999,13 @@ class Formatter {
|
|
|
55480
55999
|
return result;
|
|
55481
56000
|
}
|
|
55482
56001
|
address(value) {
|
|
55483
|
-
return
|
|
56002
|
+
return getAddress2(value);
|
|
55484
56003
|
}
|
|
55485
56004
|
callAddress(value) {
|
|
55486
56005
|
if (!isHexString(value, 32)) {
|
|
55487
56006
|
return null;
|
|
55488
56007
|
}
|
|
55489
|
-
const address =
|
|
56008
|
+
const address = getAddress2(hexDataSlice(value, 12));
|
|
55490
56009
|
return address === AddressZero ? null : address;
|
|
55491
56010
|
}
|
|
55492
56011
|
contractAddress(value) {
|
|
@@ -60123,7 +60642,7 @@ __export(exports_utils, {
|
|
|
60123
60642
|
splitSignature: () => splitSignature,
|
|
60124
60643
|
soliditySha256: () => sha2562,
|
|
60125
60644
|
solidityPack: () => pack2,
|
|
60126
|
-
solidityKeccak256: () =>
|
|
60645
|
+
solidityKeccak256: () => keccak2563,
|
|
60127
60646
|
shuffled: () => shuffled,
|
|
60128
60647
|
shallowCopy: () => shallowCopy,
|
|
60129
60648
|
sha512: () => sha512,
|
|
@@ -60143,14 +60662,14 @@ __export(exports_utils, {
|
|
|
60143
60662
|
namehash: () => namehash,
|
|
60144
60663
|
mnemonicToSeed: () => mnemonicToSeed,
|
|
60145
60664
|
mnemonicToEntropy: () => mnemonicToEntropy,
|
|
60146
|
-
keccak256: () =>
|
|
60665
|
+
keccak256: () => keccak2562,
|
|
60147
60666
|
joinSignature: () => joinSignature,
|
|
60148
60667
|
isValidName: () => isValidName,
|
|
60149
60668
|
isValidMnemonic: () => isValidMnemonic,
|
|
60150
60669
|
isHexString: () => isHexString,
|
|
60151
60670
|
isBytesLike: () => isBytesLike,
|
|
60152
|
-
isBytes: () =>
|
|
60153
|
-
isAddress: () =>
|
|
60671
|
+
isBytes: () => isBytes2,
|
|
60672
|
+
isAddress: () => isAddress2,
|
|
60154
60673
|
id: () => id,
|
|
60155
60674
|
hexlify: () => hexlify,
|
|
60156
60675
|
hexZeroPad: () => hexZeroPad,
|
|
@@ -60165,7 +60684,7 @@ __export(exports_utils, {
|
|
|
60165
60684
|
getIcapAddress: () => getIcapAddress,
|
|
60166
60685
|
getCreate2Address: () => getCreate2Address,
|
|
60167
60686
|
getContractAddress: () => getContractAddress,
|
|
60168
|
-
getAddress: () =>
|
|
60687
|
+
getAddress: () => getAddress2,
|
|
60169
60688
|
getAccountPath: () => getAccountPath,
|
|
60170
60689
|
formatUnits: () => formatUnits,
|
|
60171
60690
|
formatEther: () => formatEther,
|
|
@@ -60292,8 +60811,8 @@ function pack2(types, values) {
|
|
|
60292
60811
|
});
|
|
60293
60812
|
return hexlify(concat2(tight));
|
|
60294
60813
|
}
|
|
60295
|
-
function
|
|
60296
|
-
return
|
|
60814
|
+
function keccak2563(types, values) {
|
|
60815
|
+
return keccak2562(pack2(types, values));
|
|
60297
60816
|
}
|
|
60298
60817
|
function sha2562(types, values) {
|
|
60299
60818
|
return sha256(pack2(types, values));
|
|
@@ -60996,7 +61515,6 @@ var contractsRegistry_default = {
|
|
|
60996
61515
|
v1_4_1: {
|
|
60997
61516
|
safeL1Singleton: "0x41675C099F32341bf84BFc5382aF534df5C7461a",
|
|
60998
61517
|
multisend: "0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526",
|
|
60999
|
-
multisendCallOnly: "0x9641d764fc13c8B624c04430C7356C1C7C8102e2",
|
|
61000
61518
|
safeL2Singleton: "0x29fcB43b46531BcA003ddC8FCB67FFE91900C762",
|
|
61001
61519
|
proxyFactory: "0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67"
|
|
61002
61520
|
}
|
|
@@ -61073,7 +61591,8 @@ var contractsRegistry_default = {
|
|
|
61073
61591
|
weth: "0x4200000000000000000000000000000000000006",
|
|
61074
61592
|
aero: "0x940181a94A35A4569E4529A3CDfB74e38FD98631",
|
|
61075
61593
|
ausd: "0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a",
|
|
61076
|
-
usde: "0x5d3a1ff2b6bab83b63cd9ad0787074081a52ef34"
|
|
61594
|
+
usde: "0x5d3a1ff2b6bab83b63cd9ad0787074081a52ef34",
|
|
61595
|
+
weeth: "0x04C0599Ae5A44757c0af6F9eC3b93da8976c150A"
|
|
61077
61596
|
},
|
|
61078
61597
|
cow: {
|
|
61079
61598
|
gpV2VaultRelayer: "0xC92E8bdf79f0507f65a392b0ab4667716BFE0110",
|
|
@@ -61091,7 +61610,6 @@ var contractsRegistry_default = {
|
|
|
61091
61610
|
v1_4_1: {
|
|
61092
61611
|
safeL1Singleton: "0x41675C099F32341bf84BFc5382aF534df5C7461a",
|
|
61093
61612
|
multisend: "0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526",
|
|
61094
|
-
multisendCallOnly: "0x9641d764fc13c8B624c04430C7356C1C7C8102e2",
|
|
61095
61613
|
safeL2Singleton: "0x29fcB43b46531BcA003ddC8FCB67FFE91900C762",
|
|
61096
61614
|
proxyFactory: "0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67"
|
|
61097
61615
|
}
|
|
@@ -61140,7 +61658,8 @@ var contractsRegistry_default = {
|
|
|
61140
61658
|
},
|
|
61141
61659
|
OFTAdapters: {
|
|
61142
61660
|
"0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a": "0x9CaB7Ede13dc56652E44D2404E969C212f22689b",
|
|
61143
|
-
"0x5d3a1ff2b6bab83b63cd9ad0787074081a52ef34": "0x5d3a1ff2b6bab83b63cd9ad0787074081a52ef34"
|
|
61661
|
+
"0x5d3a1ff2b6bab83b63cd9ad0787074081a52ef34": "0x5d3a1ff2b6bab83b63cd9ad0787074081a52ef34",
|
|
61662
|
+
"0x04C0599Ae5A44757c0af6F9eC3b93da8976c150A": "0x04C0599Ae5A44757c0af6F9eC3b93da8976c150A"
|
|
61144
61663
|
},
|
|
61145
61664
|
poster: "0x000000000000cd17345801aa8147b8D3950260FF"
|
|
61146
61665
|
},
|
|
@@ -61180,7 +61699,6 @@ var contractsRegistry_default = {
|
|
|
61180
61699
|
v1_4_1: {
|
|
61181
61700
|
safeL1Singleton: "0x41675C099F32341bf84BFc5382aF534df5C7461a",
|
|
61182
61701
|
multisend: "0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526",
|
|
61183
|
-
multisendCallOnly: "0x9641d764fc13c8B624c04430C7356C1C7C8102e2",
|
|
61184
61702
|
safeL2Singleton: "0x29fcB43b46531BcA003ddC8FCB67FFE91900C762",
|
|
61185
61703
|
proxyFactory: "0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67"
|
|
61186
61704
|
}
|
|
@@ -61251,7 +61769,6 @@ var contractsRegistry_default = {
|
|
|
61251
61769
|
v1_4_1: {
|
|
61252
61770
|
safeL1Singleton: "0x41675C099F32341bf84BFc5382aF534df5C7461a",
|
|
61253
61771
|
multisend: "0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526",
|
|
61254
|
-
multisendCallOnly: "0x9641d764fc13c8B624c04430C7356C1C7C8102e2",
|
|
61255
61772
|
safeL2Singleton: "0x29fcB43b46531BcA003ddC8FCB67FFE91900C762",
|
|
61256
61773
|
proxyFactory: "0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67"
|
|
61257
61774
|
}
|
|
@@ -61262,7 +61779,8 @@ var contractsRegistry_default = {
|
|
|
61262
61779
|
wbnb: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
|
|
61263
61780
|
usdc: "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",
|
|
61264
61781
|
usdt: "0x55d398326f99059fF775485246999027B3197955",
|
|
61265
|
-
sand: "0xac531Eb26Ca1d21b85126De8FB87E80E09002DcF"
|
|
61782
|
+
sand: "0xac531Eb26Ca1d21b85126De8FB87E80E09002DcF",
|
|
61783
|
+
weeth: "0x04C0599Ae5A44757c0af6F9eC3b93da8976c150A"
|
|
61266
61784
|
},
|
|
61267
61785
|
zodiac: {
|
|
61268
61786
|
rolesModule: "0x9646fDAD06d3e24444381f44362a3B0eB343D337",
|
|
@@ -61283,7 +61801,10 @@ var contractsRegistry_default = {
|
|
|
61283
61801
|
feeLibV1USDT: "0xDd002227d9bC27f10066ED9A17bE89c43bCafC31",
|
|
61284
61802
|
stargatePoolUSDC: "0x962Bd449E630b0d928f308Ce63f1A21F02576057"
|
|
61285
61803
|
},
|
|
61286
|
-
wrappedNativeToken: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"
|
|
61804
|
+
wrappedNativeToken: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
|
|
61805
|
+
OFTAdapters: {
|
|
61806
|
+
"0x04C0599Ae5A44757c0af6F9eC3b93da8976c150A": "0x04C0599Ae5A44757c0af6F9eC3b93da8976c150A"
|
|
61807
|
+
}
|
|
61287
61808
|
},
|
|
61288
61809
|
optimism: {
|
|
61289
61810
|
aaveV3: {
|
|
@@ -61311,13 +61832,13 @@ var contractsRegistry_default = {
|
|
|
61311
61832
|
wbtc: "0x68f180fcCe6836688e9084f035309E29Bf0A2095",
|
|
61312
61833
|
tbtc: "0x6c84a8f1c29108F47a79964b5Fe888D4f4D0dE40",
|
|
61313
61834
|
op: "0x4200000000000000000000000000000000000042",
|
|
61314
|
-
usde: "0x5d3a1ff2b6bab83b63cd9ad0787074081a52ef34"
|
|
61835
|
+
usde: "0x5d3a1ff2b6bab83b63cd9ad0787074081a52ef34",
|
|
61836
|
+
weeth: "0x5A7fACB970D094B6C7FF1df0eA68D99E6e73CBFF"
|
|
61315
61837
|
},
|
|
61316
61838
|
gnosisSafe: {
|
|
61317
61839
|
v1_4_1: {
|
|
61318
61840
|
safeL1Singleton: "0x41675C099F32341bf84BFc5382aF534df5C7461a",
|
|
61319
61841
|
multisend: "0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526",
|
|
61320
|
-
multisendCallOnly: "0x9641d764fc13c8B624c04430C7356C1C7C8102e2",
|
|
61321
61842
|
safeL2Singleton: "0x29fcB43b46531BcA003ddC8FCB67FFE91900C762",
|
|
61322
61843
|
proxyFactory: "0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67"
|
|
61323
61844
|
}
|
|
@@ -61352,7 +61873,8 @@ var contractsRegistry_default = {
|
|
|
61352
61873
|
},
|
|
61353
61874
|
OFTAdapters: {
|
|
61354
61875
|
"0x01bFF41798a0BcF287b996046Ca68b395DbC1071": "0xF03b4d9AC1D5d1E7c4cEf54C2A313b9fe051A0aD",
|
|
61355
|
-
"0x5d3a1ff2b6bab83b63cd9ad0787074081a52ef34": "0x5d3a1ff2b6bab83b63cd9ad0787074081a52ef34"
|
|
61876
|
+
"0x5d3a1ff2b6bab83b63cd9ad0787074081a52ef34": "0x5d3a1ff2b6bab83b63cd9ad0787074081a52ef34",
|
|
61877
|
+
"0x5A7fACB970D094B6C7FF1df0eA68D99E6e73CBFF": "0x5A7fACB970D094B6C7FF1df0eA68D99E6e73CBFF"
|
|
61356
61878
|
},
|
|
61357
61879
|
stargate: {
|
|
61358
61880
|
feeLibV1ETH: "0x80F755e3091b2Ad99c08Da8D13E9c7635C1b8161",
|
|
@@ -61417,7 +61939,6 @@ var contractsRegistry_default = {
|
|
|
61417
61939
|
v1_4_1: {
|
|
61418
61940
|
safeL1Singleton: "0x41675C099F32341bf84BFc5382aF534df5C7461a",
|
|
61419
61941
|
multisend: "0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526",
|
|
61420
|
-
multisendCallOnly: "0x9641d764fc13c8B624c04430C7356C1C7C8102e2",
|
|
61421
61942
|
safeL2Singleton: "0x29fcB43b46531BcA003ddC8FCB67FFE91900C762",
|
|
61422
61943
|
proxyFactory: "0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67"
|
|
61423
61944
|
}
|
|
@@ -61493,7 +62014,8 @@ var contractsRegistry_default = {
|
|
|
61493
62014
|
OFTAdapters: {
|
|
61494
62015
|
"0xdAC17F958D2ee523a2206206994597C13D831ec7": "0x6C96dE32CEa08842dcc4058c14d3aaAD7Fa41dee",
|
|
61495
62016
|
"0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a": "0x9CaB7Ede13dc56652E44D2404E969C212f22689b",
|
|
61496
|
-
"0x4c9EDD5852cd905f086C759E8383e09bff1E68B3": "0x5d3a1ff2b6bab83b63cd9ad0787074081a52ef34"
|
|
62017
|
+
"0x4c9EDD5852cd905f086C759E8383e09bff1E68B3": "0x5d3a1ff2b6bab83b63cd9ad0787074081a52ef34",
|
|
62018
|
+
"0xCd5fE23C85820F7B72D0926FC9b05b43E359b7ee": "0xcd2eb13D6831d4602D80E5db9230A57596CDCA63"
|
|
61497
62019
|
},
|
|
61498
62020
|
stargate: {
|
|
61499
62021
|
feeLibV1ETH: "0x3E368B6C95c6fEfB7A16dCc0D756389F3c658a06",
|
|
@@ -61575,7 +62097,8 @@ var contractsRegistry_default = {
|
|
|
61575
62097
|
usdc: "0x078D782b760474a361dDA0AF3839290b0EF57AD6",
|
|
61576
62098
|
usdt0: "0x9151434b16b9763660705744891fA906F660EcC5",
|
|
61577
62099
|
dai: "0x20CAb320A855b39F724131C69424240519573f81",
|
|
61578
|
-
weth: "0x4200000000000000000000000000000000000006"
|
|
62100
|
+
weth: "0x4200000000000000000000000000000000000006",
|
|
62101
|
+
weeth: "0x7DCC39B4d1C53CB31e1aBc0e358b43987FEF80f7"
|
|
61579
62102
|
},
|
|
61580
62103
|
zodiac: {
|
|
61581
62104
|
rolesModule: "0x9646fDAD06d3e24444381f44362a3B0eB343D337",
|
|
@@ -61587,7 +62110,6 @@ var contractsRegistry_default = {
|
|
|
61587
62110
|
v1_4_1: {
|
|
61588
62111
|
safeL1Singleton: "0x41675C099F32341bf84BFc5382aF534df5C7461a",
|
|
61589
62112
|
multisend: "0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526",
|
|
61590
|
-
multisendCallOnly: "0x9641d764fc13c8B624c04430C7356C1C7C8102e2",
|
|
61591
62113
|
safeL2Singleton: "0x29fcB43b46531BcA003ddC8FCB67FFE91900C762",
|
|
61592
62114
|
proxyFactory: "0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67"
|
|
61593
62115
|
}
|
|
@@ -61605,7 +62127,8 @@ var contractsRegistry_default = {
|
|
|
61605
62127
|
},
|
|
61606
62128
|
OFTAdapters: {
|
|
61607
62129
|
"0x9151434b16b9763660705744891fA906F660EcC5": "0xc07be8994d035631c36fb4a89c918cefb2f03ec3",
|
|
61608
|
-
"0x5d3a1ff2b6bab83b63cd9ad0787074081a52ef34": "0x5d3a1ff2b6bab83b63cd9ad0787074081a52ef34"
|
|
62130
|
+
"0x5d3a1ff2b6bab83b63cd9ad0787074081a52ef34": "0x5d3a1ff2b6bab83b63cd9ad0787074081a52ef34",
|
|
62131
|
+
"0x7DCC39B4d1C53CB31e1aBc0e358b43987FEF80f7": "0x7DCC39B4d1C53CB31e1aBc0e358b43987FEF80f7"
|
|
61609
62132
|
},
|
|
61610
62133
|
stargate: {
|
|
61611
62134
|
creditMessaging: "0xAf368c91793CB22739386DFCbBb2F1A9e4bCBeBf",
|
|
@@ -61629,7 +62152,6 @@ var contractsRegistry_default = {
|
|
|
61629
62152
|
v1_4_1: {
|
|
61630
62153
|
safeL1Singleton: "0x41675C099F32341bf84BFc5382aF534df5C7461a",
|
|
61631
62154
|
multisend: "0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526",
|
|
61632
|
-
multisendCallOnly: "0x9641d764fc13c8B624c04430C7356C1C7C8102e2",
|
|
61633
62155
|
safeL2Singleton: "0x29fcB43b46531BcA003ddC8FCB67FFE91900C762",
|
|
61634
62156
|
proxyFactory: "0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67"
|
|
61635
62157
|
}
|
|
@@ -61716,7 +62238,6 @@ var contractsRegistry_default = {
|
|
|
61716
62238
|
v1_4_1: {
|
|
61717
62239
|
safeL1Singleton: "0x41675C099F32341bf84BFc5382aF534df5C7461a",
|
|
61718
62240
|
multisend: "0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526",
|
|
61719
|
-
multisendCallOnly: "0x9641d764fc13c8B624c04430C7356C1C7C8102e2",
|
|
61720
62241
|
safeL2Singleton: "0x29fcB43b46531BcA003ddC8FCB67FFE91900C762",
|
|
61721
62242
|
proxyFactory: "0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67"
|
|
61722
62243
|
}
|
|
@@ -61757,7 +62278,6 @@ var contractsRegistry_default = {
|
|
|
61757
62278
|
v1_4_1: {
|
|
61758
62279
|
safeL1Singleton: "0x41675C099F32341bf84BFc5382aF534df5C7461a",
|
|
61759
62280
|
multisend: "0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526",
|
|
61760
|
-
multisendCallOnly: "0x9641d764fc13c8B624c04430C7356C1C7C8102e2",
|
|
61761
62281
|
safeL2Singleton: "0x29fcB43b46531BcA003ddC8FCB67FFE91900C762",
|
|
61762
62282
|
proxyFactory: "0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67"
|
|
61763
62283
|
}
|
|
@@ -61797,7 +62317,6 @@ var contractsRegistry_default = {
|
|
|
61797
62317
|
v1_4_1: {
|
|
61798
62318
|
safeL1Singleton: "0x41675C099F32341bf84BFc5382aF534df5C7461a",
|
|
61799
62319
|
multisend: "0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526",
|
|
61800
|
-
multisendCallOnly: "0x9641d764fc13c8B624c04430C7356C1C7C8102e2",
|
|
61801
62320
|
safeL2Singleton: "0x29fcB43b46531BcA003ddC8FCB67FFE91900C762",
|
|
61802
62321
|
proxyFactory: "0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67"
|
|
61803
62322
|
}
|
|
@@ -61827,7 +62346,10 @@ var contractsRegistry_default = {
|
|
|
61827
62346
|
usdt0: "0xe7cd86e13AC4309349F30B3435a9d337750fC82D",
|
|
61828
62347
|
usdc: "0x754704Bc059F8C67012fEd69BC8A327a5aafb603",
|
|
61829
62348
|
ausd: "0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a",
|
|
61830
|
-
wmon: "0x3bd359C1119dA7Da1D913D1C4D2B7c461115433A"
|
|
62349
|
+
wmon: "0x3bd359C1119dA7Da1D913D1C4D2B7c461115433A",
|
|
62350
|
+
weeth: "0xA3D68b74bF0528fdD07263c60d6488749044914b",
|
|
62351
|
+
wsteth: "0x10Aeaf63194db8d453d4D85a06E5eFE1dd0b5417",
|
|
62352
|
+
weth: "0xEE8c0E9f1BFFb4Eb878d8f15f368A02a35481242"
|
|
61831
62353
|
},
|
|
61832
62354
|
uniswapV4: {
|
|
61833
62355
|
universalRouter: "0x0D97Dc33264bfC1c226207428A79b26757fb9dc3",
|
|
@@ -61856,14 +62378,14 @@ var contractsRegistry_default = {
|
|
|
61856
62378
|
v1_4_1: {
|
|
61857
62379
|
safeL1Singleton: "0x41675C099F32341bf84BFc5382aF534df5C7461a",
|
|
61858
62380
|
multisend: "0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526",
|
|
61859
|
-
multisendCallOnly: "0x9641d764fc13c8B624c04430C7356C1C7C8102e2",
|
|
61860
62381
|
safeL2Singleton: "0x29fcB43b46531BcA003ddC8FCB67FFE91900C762",
|
|
61861
62382
|
proxyFactory: "0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67"
|
|
61862
62383
|
}
|
|
61863
62384
|
},
|
|
61864
62385
|
OFTAdapters: {
|
|
61865
62386
|
"0xe7cd86e13AC4309349F30B3435a9d337750fC82D": "0x9151434b16b9763660705744891fa906f660ecc5",
|
|
61866
|
-
"0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a": "0x9CaB7Ede13dc56652E44D2404E969C212f22689b"
|
|
62387
|
+
"0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a": "0x9CaB7Ede13dc56652E44D2404E969C212f22689b",
|
|
62388
|
+
"0xA3D68b74bF0528fdD07263c60d6488749044914b": "0xA3D68b74bF0528fdD07263c60d6488749044914b"
|
|
61867
62389
|
},
|
|
61868
62390
|
multicall3: "0xcA11bde05977b3631167028862bE2a173976CA11",
|
|
61869
62391
|
cctp: {
|
|
@@ -61888,7 +62410,6 @@ var contractsRegistry_default = {
|
|
|
61888
62410
|
v1_4_1: {
|
|
61889
62411
|
safeL1Singleton: "0x41675C099F32341bf84BFc5382aF534df5C7461a",
|
|
61890
62412
|
multisend: "0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526",
|
|
61891
|
-
multisendCallOnly: "0x9641d764fc13c8B624c04430C7356C1C7C8102e2",
|
|
61892
62413
|
safeL2Singleton: "0x29fcB43b46531BcA003ddC8FCB67FFE91900C762",
|
|
61893
62414
|
proxyFactory: "0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67"
|
|
61894
62415
|
}
|
|
@@ -61902,11 +62423,13 @@ var contractsRegistry_default = {
|
|
|
61902
62423
|
usdt0: "0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb",
|
|
61903
62424
|
wxlp: "0x6100E367285b01F48D07953803A2d8dCA5D19873",
|
|
61904
62425
|
syrupUSDT: "0xC4374775489CB9C56003BF2C9b12495fC64F0771",
|
|
61905
|
-
usde: "0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34"
|
|
62426
|
+
usde: "0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34",
|
|
62427
|
+
weeth: "0xA3D68b74bF0528fdD07263c60d6488749044914b"
|
|
61906
62428
|
},
|
|
61907
62429
|
OFTAdapters: {
|
|
61908
62430
|
"0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb": "0x02ca37966753bdddf11216b73b16c1de756a7cf9",
|
|
61909
|
-
"0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34": "0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34"
|
|
62431
|
+
"0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34": "0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34",
|
|
62432
|
+
"0xA3D68b74bF0528fdD07263c60d6488749044914b": "0xA3D68b74bF0528fdD07263c60d6488749044914b"
|
|
61910
62433
|
},
|
|
61911
62434
|
enso: {
|
|
61912
62435
|
routerV2: "0xCfBAa9Cfce952Ca4F4069874fF1Df8c05e37a3c7"
|
|
@@ -61957,7 +62480,7 @@ function getAddressOrThrow(chainId, key2) {
|
|
|
61957
62480
|
if (typeof current !== "string") {
|
|
61958
62481
|
throw new Error(`DAMM-sdk: Key "${key2}" does not resolve to an address for chainId ${chainId} (${chainName})`);
|
|
61959
62482
|
}
|
|
61960
|
-
return current;
|
|
62483
|
+
return getAddress(current);
|
|
61961
62484
|
}
|
|
61962
62485
|
function findAddressPath(obj, targetAddress, currentPath = []) {
|
|
61963
62486
|
if (typeof obj === "string") {
|
|
@@ -62015,12 +62538,10 @@ var pack3 = (payload) => {
|
|
|
62015
62538
|
class MultisendBuilder {
|
|
62016
62539
|
payload;
|
|
62017
62540
|
multisendAddress;
|
|
62018
|
-
defaultOperation;
|
|
62019
62541
|
value;
|
|
62020
|
-
constructor(multisendAddress,
|
|
62542
|
+
constructor(multisendAddress, payload, value) {
|
|
62021
62543
|
this.payload = payload || [];
|
|
62022
62544
|
this.multisendAddress = multisendAddress;
|
|
62023
|
-
this.defaultOperation = defaultOperation;
|
|
62024
62545
|
this.value = value;
|
|
62025
62546
|
}
|
|
62026
62547
|
addSubcall(call) {
|
|
@@ -62028,10 +62549,10 @@ class MultisendBuilder {
|
|
|
62028
62549
|
...call,
|
|
62029
62550
|
dataLength: numberToHex(call.data.slice(2).length / 2, { size: 32 })
|
|
62030
62551
|
};
|
|
62031
|
-
return new MultisendBuilder(this.multisendAddress,
|
|
62552
|
+
return new MultisendBuilder(this.multisendAddress, add3(callWithLength, this.payload), this.value);
|
|
62032
62553
|
}
|
|
62033
62554
|
setValue(value) {
|
|
62034
|
-
return new MultisendBuilder(this.multisendAddress, this.
|
|
62555
|
+
return new MultisendBuilder(this.multisendAddress, this.payload, value);
|
|
62035
62556
|
}
|
|
62036
62557
|
build(config) {
|
|
62037
62558
|
const inter = new exports_ethers.utils.Interface(multisend_abi_default);
|
|
@@ -62039,15 +62560,12 @@ class MultisendBuilder {
|
|
|
62039
62560
|
return createCall({
|
|
62040
62561
|
to: this.multisendAddress,
|
|
62041
62562
|
value: config?.value || this.value || 0n,
|
|
62042
|
-
operation: config?.operation ||
|
|
62563
|
+
operation: config?.operation || 1,
|
|
62043
62564
|
data
|
|
62044
62565
|
});
|
|
62045
62566
|
}
|
|
62046
62567
|
static new(chainId, version28 = "v1_4_1") {
|
|
62047
|
-
return new MultisendBuilder(getAddressOrThrow(chainId, `gnosisSafe.${version28}.multisend`)
|
|
62048
|
-
}
|
|
62049
|
-
static newCallOnly(chainId, version28 = "v1_4_1") {
|
|
62050
|
-
return new MultisendBuilder(getAddressOrThrow(chainId, `gnosisSafe.${version28}.multisendCallOnly`), 0);
|
|
62568
|
+
return new MultisendBuilder(getAddressOrThrow(chainId, `gnosisSafe.${version28}.multisend`));
|
|
62051
62569
|
}
|
|
62052
62570
|
}
|
|
62053
62571
|
// src/integrations/gnosis/safe.L2.abi.ts
|
|
@@ -66846,7 +67364,7 @@ var NativeCurrency = /* @__PURE__ */ function(_BaseCurrency) {
|
|
|
66846
67364
|
}(BaseCurrency);
|
|
66847
67365
|
function validateAndParseAddress(address) {
|
|
66848
67366
|
try {
|
|
66849
|
-
return
|
|
67367
|
+
return getAddress2(address);
|
|
66850
67368
|
} catch (error) {
|
|
66851
67369
|
throw new Error(address + " is not a valid address.");
|
|
66852
67370
|
}
|
|
@@ -70265,9 +70783,9 @@ var SwapRouter_default = {
|
|
|
70265
70783
|
};
|
|
70266
70784
|
|
|
70267
70785
|
// node_modules/@uniswap/v3-sdk/dist/v3-sdk.esm.js
|
|
70268
|
-
function asyncGeneratorStep(
|
|
70786
|
+
function asyncGeneratorStep(gen2, resolve, reject, _next, _throw, key2, arg) {
|
|
70269
70787
|
try {
|
|
70270
|
-
var info =
|
|
70788
|
+
var info = gen2[key2](arg);
|
|
70271
70789
|
var value = info.value;
|
|
70272
70790
|
} catch (error) {
|
|
70273
70791
|
reject(error);
|
|
@@ -70283,12 +70801,12 @@ function _asyncToGenerator(fn) {
|
|
|
70283
70801
|
return function() {
|
|
70284
70802
|
var self2 = this, args = arguments;
|
|
70285
70803
|
return new Promise(function(resolve, reject) {
|
|
70286
|
-
var
|
|
70804
|
+
var gen2 = fn.apply(self2, args);
|
|
70287
70805
|
function _next(value) {
|
|
70288
|
-
asyncGeneratorStep(
|
|
70806
|
+
asyncGeneratorStep(gen2, resolve, reject, _next, _throw, "next", value);
|
|
70289
70807
|
}
|
|
70290
70808
|
function _throw(err) {
|
|
70291
|
-
asyncGeneratorStep(
|
|
70809
|
+
asyncGeneratorStep(gen2, resolve, reject, _next, _throw, "throw", err);
|
|
70292
70810
|
}
|
|
70293
70811
|
_next(undefined);
|
|
70294
70812
|
});
|
|
@@ -70879,7 +71397,7 @@ var Q192 = /* @__PURE__ */ import_jsbi2.default.exponentiate(Q96, /* @__PURE__ *
|
|
|
70879
71397
|
function computePoolAddress(_ref) {
|
|
70880
71398
|
var { factoryAddress, tokenA, tokenB, fee, initCodeHashManualOverride } = _ref;
|
|
70881
71399
|
var _ref2 = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA], token0 = _ref2[0], token1 = _ref2[1];
|
|
70882
|
-
return getCreate2Address(factoryAddress,
|
|
71400
|
+
return getCreate2Address(factoryAddress, keccak2563(["bytes"], [defaultAbiCoder.encode(["address", "address", "uint24"], [token0.address, token1.address, fee])]), initCodeHashManualOverride != null ? initCodeHashManualOverride : POOL_INIT_CODE_HASH);
|
|
70883
71401
|
}
|
|
70884
71402
|
var LiquidityMath = /* @__PURE__ */ function() {
|
|
70885
71403
|
function LiquidityMath2() {}
|
|
@@ -72952,7 +73470,7 @@ var NativeCurrency2 = /* @__PURE__ */ function(_BaseCurrency) {
|
|
|
72952
73470
|
}(BaseCurrency3);
|
|
72953
73471
|
function validateAndParseAddress2(address) {
|
|
72954
73472
|
try {
|
|
72955
|
-
return
|
|
73473
|
+
return getAddress2(address);
|
|
72956
73474
|
} catch (error) {
|
|
72957
73475
|
throw new Error(address + " is not a valid address.");
|
|
72958
73476
|
}
|
|
@@ -73056,10 +73574,10 @@ function computeZksyncCreate2Address(sender, bytecodeHash, salt, input) {
|
|
|
73056
73574
|
if (input === undefined) {
|
|
73057
73575
|
input = "0x";
|
|
73058
73576
|
}
|
|
73059
|
-
var prefix2 =
|
|
73060
|
-
var inputHash =
|
|
73061
|
-
var addressBytes =
|
|
73062
|
-
return
|
|
73577
|
+
var prefix2 = keccak2562(toUtf8Bytes("zksyncCreate2"));
|
|
73578
|
+
var inputHash = keccak2562(input);
|
|
73579
|
+
var addressBytes = keccak2562(concat2([prefix2, hexZeroPad(sender, 32), salt, bytecodeHash, inputHash])).slice(26);
|
|
73580
|
+
return getAddress2(addressBytes);
|
|
73063
73581
|
}
|
|
73064
73582
|
var MAX_SAFE_INTEGER3 = /* @__PURE__ */ import_jsbi3.default.BigInt(Number.MAX_SAFE_INTEGER);
|
|
73065
73583
|
var ZERO3 = /* @__PURE__ */ import_jsbi3.default.BigInt(0);
|
|
@@ -73527,7 +74045,7 @@ var Q1922 = /* @__PURE__ */ import_jsbi4.default.exponentiate(Q962, /* @__PURE__
|
|
|
73527
74045
|
function computePoolAddress2(_ref) {
|
|
73528
74046
|
var { factoryAddress, tokenA, tokenB, fee, initCodeHashManualOverride, chainId } = _ref;
|
|
73529
74047
|
var _ref2 = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA], token0 = _ref2[0], token1 = _ref2[1];
|
|
73530
|
-
var salt =
|
|
74048
|
+
var salt = keccak2563(["bytes"], [defaultAbiCoder.encode(["address", "address", "uint24"], [token0.address, token1.address, fee])]);
|
|
73531
74049
|
var initCodeHash = initCodeHashManualOverride != null ? initCodeHashManualOverride : poolInitCodeHash(chainId);
|
|
73532
74050
|
switch (chainId) {
|
|
73533
74051
|
case ChainId2.ZKSYNC:
|
|
@@ -74941,7 +75459,7 @@ var SwapRouter2 = /* @__PURE__ */ function() {
|
|
|
74941
75459
|
SwapRouter2.INTERFACE = /* @__PURE__ */ new Interface(SwapRouter_default.abi);
|
|
74942
75460
|
|
|
74943
75461
|
// node_modules/@uniswap/v4-sdk/dist/v4-sdk.esm.js
|
|
74944
|
-
var
|
|
75462
|
+
var import_utils4 = __toESM(require_utils6());
|
|
74945
75463
|
var import_jsbi5 = __toESM(require_jsbi_umd());
|
|
74946
75464
|
function _arrayLikeToArray3(r2, a) {
|
|
74947
75465
|
(a == null || a > r2.length) && (a = r2.length);
|
|
@@ -75413,7 +75931,7 @@ var Hook = /* @__PURE__ */ function() {
|
|
|
75413
75931
|
return !!(parseInt(address, 16) & 1 << hookFlagIndex[hookOption]);
|
|
75414
75932
|
};
|
|
75415
75933
|
Hook2._checkAddress = function _checkAddress(address) {
|
|
75416
|
-
!
|
|
75934
|
+
!import_utils4.isAddress(address) && invariant(false, "invalid address");
|
|
75417
75935
|
};
|
|
75418
75936
|
return Hook2;
|
|
75419
75937
|
}();
|
|
@@ -75452,7 +75970,7 @@ var Pool3 = /* @__PURE__ */ function() {
|
|
|
75452
75970
|
if (ticks === undefined) {
|
|
75453
75971
|
ticks = NO_TICK_DATA_PROVIDER_DEFAULT3;
|
|
75454
75972
|
}
|
|
75455
|
-
!
|
|
75973
|
+
!import_utils4.isAddress(hooks) && invariant(false, "Invalid hook address");
|
|
75456
75974
|
!(Number.isInteger(fee) && (fee === DYNAMIC_FEE_FLAG || fee < 1e6)) && invariant(false, "FEE");
|
|
75457
75975
|
if (fee === DYNAMIC_FEE_FLAG) {
|
|
75458
75976
|
!(Number(hooks) > 0) && invariant(false, "Dynamic fee pool requires a hook");
|
|
@@ -75474,7 +75992,7 @@ var Pool3 = /* @__PURE__ */ function() {
|
|
|
75474
75992
|
this.poolId = Pool4.getPoolId(this.currency0, this.currency1, this.fee, this.tickSpacing, this.hooks);
|
|
75475
75993
|
}
|
|
75476
75994
|
Pool4.getPoolKey = function getPoolKey(currencyA, currencyB, fee, tickSpacing, hooks) {
|
|
75477
|
-
!
|
|
75995
|
+
!import_utils4.isAddress(hooks) && invariant(false, "Invalid hook address");
|
|
75478
75996
|
var _ref2 = sortsBefore(currencyA, currencyB) ? [currencyA, currencyB] : [currencyB, currencyA], currency0 = _ref2[0], currency1 = _ref2[1];
|
|
75479
75997
|
var currency0Addr = currency0.isNative ? ADDRESS_ZERO3 : currency0.wrapped.address;
|
|
75480
75998
|
var currency1Addr = currency1.isNative ? ADDRESS_ZERO3 : currency1.wrapped.address;
|
|
@@ -75490,7 +76008,7 @@ var Pool3 = /* @__PURE__ */ function() {
|
|
|
75490
76008
|
var _ref3 = sortsBefore(currencyA, currencyB) ? [currencyA, currencyB] : [currencyB, currencyA], currency0 = _ref3[0], currency1 = _ref3[1];
|
|
75491
76009
|
var currency0Addr = currency0.isNative ? ADDRESS_ZERO3 : currency0.wrapped.address;
|
|
75492
76010
|
var currency1Addr = currency1.isNative ? ADDRESS_ZERO3 : currency1.wrapped.address;
|
|
75493
|
-
return
|
|
76011
|
+
return keccak2563(["bytes"], [import_utils4.defaultAbiCoder.encode(["address", "address", "uint24", "int24", "address"], [currency0Addr, currency1Addr, fee, tickSpacing, hooks])]);
|
|
75494
76012
|
};
|
|
75495
76013
|
var _proto = Pool4.prototype;
|
|
75496
76014
|
_proto.involvesCurrency = function involvesCurrency(currency) {
|
|
@@ -76080,7 +76598,7 @@ var V4Planner = /* @__PURE__ */ function() {
|
|
|
76080
76598
|
return this;
|
|
76081
76599
|
};
|
|
76082
76600
|
_proto.finalize = function finalize() {
|
|
76083
|
-
return
|
|
76601
|
+
return import_utils4.defaultAbiCoder.encode(["bytes", "bytes[]"], [this.actions, this.params]);
|
|
76084
76602
|
};
|
|
76085
76603
|
return V4Planner2;
|
|
76086
76604
|
}();
|
|
@@ -76088,7 +76606,7 @@ function currencyAddress(currency) {
|
|
|
76088
76606
|
return currency.isNative ? ADDRESS_ZERO3 : currency.wrapped.address;
|
|
76089
76607
|
}
|
|
76090
76608
|
function createAction(action, parameters) {
|
|
76091
|
-
var encodedInput =
|
|
76609
|
+
var encodedInput = import_utils4.defaultAbiCoder.encode(V4_BASE_ACTIONS_ABI_DEFINITION[action].map(function(v) {
|
|
76092
76610
|
return v.type;
|
|
76093
76611
|
}), parameters);
|
|
76094
76612
|
return {
|
|
@@ -77387,7 +77905,7 @@ var SwapExactInputSingleCalldataV4 = ({
|
|
|
77387
77905
|
hookData = "0x",
|
|
77388
77906
|
recipient
|
|
77389
77907
|
}) => {
|
|
77390
|
-
const
|
|
77908
|
+
const getAddress3 = (currency) => {
|
|
77391
77909
|
return currency.address;
|
|
77392
77910
|
};
|
|
77393
77911
|
const commands = exports_ethers.utils.solidityPack(["uint8"], [16 /* V4_SWAP */]);
|
|
@@ -77395,15 +77913,15 @@ var SwapExactInputSingleCalldataV4 = ({
|
|
|
77395
77913
|
const params = [
|
|
77396
77914
|
exports_ethers.utils.defaultAbiCoder.encode(["tuple(tuple(address,address,uint24,int24,address),bool,uint128,uint128,bytes)"], [
|
|
77397
77915
|
[
|
|
77398
|
-
[
|
|
77916
|
+
[getAddress3(pool.currency0), getAddress3(pool.currency1), pool.fee, pool.tickSpacing, pool.hooks],
|
|
77399
77917
|
zeroForOne,
|
|
77400
77918
|
amountIn,
|
|
77401
77919
|
amountOutMinimum,
|
|
77402
77920
|
hookData
|
|
77403
77921
|
]
|
|
77404
77922
|
]),
|
|
77405
|
-
exports_ethers.utils.defaultAbiCoder.encode(["address", "uint256"], [zeroForOne ?
|
|
77406
|
-
exports_ethers.utils.defaultAbiCoder.encode(["address", "uint256"], [zeroForOne ?
|
|
77923
|
+
exports_ethers.utils.defaultAbiCoder.encode(["address", "uint256"], [zeroForOne ? getAddress3(pool.currency0) : getAddress3(pool.currency1), amountIn]),
|
|
77924
|
+
exports_ethers.utils.defaultAbiCoder.encode(["address", "uint256"], [zeroForOne ? getAddress3(pool.currency1) : getAddress3(pool.currency0), amountOutMinimum])
|
|
77407
77925
|
];
|
|
77408
77926
|
const actionsList = [];
|
|
77409
77927
|
actionsList.push(Actions2.SWAP_EXACT_IN_SINGLE);
|
|
@@ -84730,7 +85248,7 @@ var silo_abi_default = [
|
|
|
84730
85248
|
}
|
|
84731
85249
|
];
|
|
84732
85250
|
// src/integrations/lagoonV1/lagoon.v1.ts
|
|
84733
|
-
var
|
|
85251
|
+
var import_utils5 = __toESM(require_utils6());
|
|
84734
85252
|
var factoryInterface = new exports_ethers.utils.Interface(factory_abi_default);
|
|
84735
85253
|
var vaultInterface = new exports_ethers.utils.Interface(vault_abi_default);
|
|
84736
85254
|
var CreateVaultProxyCalldata = ({
|
|
@@ -84882,7 +85400,7 @@ var calculateDeterministicVaultAddress = ({
|
|
|
84882
85400
|
wrappedNativeToken,
|
|
84883
85401
|
initStruct
|
|
84884
85402
|
}) => {
|
|
84885
|
-
const initEncoded =
|
|
85403
|
+
const initEncoded = import_utils5.defaultAbiCoder.encode(["tuple(address,string,string,address,address,address,address,address,uint16,uint16,bool,uint256)"], [
|
|
84886
85404
|
[
|
|
84887
85405
|
initStruct.underlying,
|
|
84888
85406
|
initStruct.name,
|
|
@@ -84902,11 +85420,11 @@ var calculateDeterministicVaultAddress = ({
|
|
|
84902
85420
|
"function initialize(bytes data, address feeRegistry, address wrappedNativeToken)"
|
|
84903
85421
|
]);
|
|
84904
85422
|
const initCall = iface.encodeFunctionData("initialize", [initEncoded, registry, wrappedNativeToken]);
|
|
84905
|
-
const constructorEncoded =
|
|
85423
|
+
const constructorEncoded = import_utils5.defaultAbiCoder.encode(["address", "address", "address", "uint256", "bytes"], [initStruct.logic, registry, initStruct.initialOwner, initStruct.initialDelay, initCall]);
|
|
84906
85424
|
const initCode = OPTIN_PROXY_CREATION_BYTECODE + constructorEncoded.slice(2);
|
|
84907
|
-
const create2Inputs =
|
|
84908
|
-
const computedAddress = `0x${
|
|
84909
|
-
return
|
|
85425
|
+
const create2Inputs = import_utils5.solidityPack(["bytes1", "address", "bytes32", "bytes32"], ["0xff", factoryAddress, initStruct.salt, import_utils5.keccak256(initCode)]);
|
|
85426
|
+
const computedAddress = `0x${import_utils5.keccak256(create2Inputs).slice(-40)}`;
|
|
85427
|
+
return import_utils5.getAddress(computedAddress);
|
|
84910
85428
|
};
|
|
84911
85429
|
// src/integrations/lendleV1/lendle.pool.abi.ts
|
|
84912
85430
|
var lendle_pool_abi_default = [
|
|
@@ -95019,4 +95537,4 @@ var simulateOrThrow = async (env2) => {
|
|
|
95019
95537
|
};
|
|
95020
95538
|
};
|
|
95021
95539
|
|
|
95022
|
-
//# debugId=
|
|
95540
|
+
//# debugId=8018B52D9C45487464756E2164756E21
|