@imtbl/sdk 0.38.0 → 0.39.1

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 CHANGED
@@ -4256,7 +4256,7 @@ class MultiRollupApiClients {
4256
4256
  }
4257
4257
 
4258
4258
  // eslint-disable-next-line @typescript-eslint/naming-convention
4259
- const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.38.0' };
4259
+ const defaultHeaders$1 = { 'x-sdk-version': 'ts-immutable-sdk-0.39.1' };
4260
4260
  const createConfig = ({ basePath, headers, }) => {
4261
4261
  if (!basePath.trim()) {
4262
4262
  throw Error('basePath can not be empty');
@@ -4316,7 +4316,7 @@ class APIError extends Error {
4316
4316
 
4317
4317
  /* eslint-disable implicit-arrow-linebreak */
4318
4318
  const defaultHeaders = {
4319
- sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.38.0',
4319
+ sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.39.1',
4320
4320
  };
4321
4321
  /**
4322
4322
  * createAPIConfiguration to create a custom Configuration
@@ -4755,7 +4755,7 @@ const createImmutableXConfiguration = ({ basePath, chainID, coreContractAddress,
4755
4755
  chainID,
4756
4756
  coreContractAddress,
4757
4757
  registrationContractAddress,
4758
- sdkVersion: 'ts-immutable-sdk-0.38.0',
4758
+ sdkVersion: 'ts-immutable-sdk-0.39.1',
4759
4759
  });
4760
4760
  /**
4761
4761
  * Sets `sdkVersion` at the time of build
@@ -20889,7 +20889,7 @@ var require$$0 = /*@__PURE__*/getAugmentedNamespace(_nodeResolve_empty$1);
20889
20889
  var bnExports = bn.exports;
20890
20890
  var BN$1 = /*@__PURE__*/getDefaultExportFromCjs(bnExports);
20891
20891
 
20892
- const version$c = "logger/5.7.0";
20892
+ const version$b = "logger/5.7.0";
20893
20893
 
20894
20894
  let _permanentCensorErrors = false;
20895
20895
  let _censorErrors = false;
@@ -21204,7 +21204,7 @@ class Logger {
21204
21204
  }
21205
21205
  static globalLogger() {
21206
21206
  if (!_globalLogger) {
21207
- _globalLogger = new Logger(version$c);
21207
+ _globalLogger = new Logger(version$b);
21208
21208
  }
21209
21209
  return _globalLogger;
21210
21210
  }
@@ -21240,9 +21240,9 @@ class Logger {
21240
21240
  Logger.errors = ErrorCode;
21241
21241
  Logger.levels = LogLevel;
21242
21242
 
21243
- const version$b = "bytes/5.7.0";
21243
+ const version$a = "bytes/5.7.0";
21244
21244
 
21245
- const logger$g = new Logger(version$b);
21245
+ const logger$e = new Logger(version$a);
21246
21246
  ///////////////////////////////
21247
21247
  function isHexable(value) {
21248
21248
  return !!(value.toHexString);
@@ -21289,7 +21289,7 @@ function arrayify(value, options) {
21289
21289
  options = {};
21290
21290
  }
21291
21291
  if (typeof (value) === "number") {
21292
- logger$g.checkSafeUint53(value, "invalid arrayify value");
21292
+ logger$e.checkSafeUint53(value, "invalid arrayify value");
21293
21293
  const result = [];
21294
21294
  while (value) {
21295
21295
  result.unshift(value & 0xff);
@@ -21316,7 +21316,7 @@ function arrayify(value, options) {
21316
21316
  hex += "0";
21317
21317
  }
21318
21318
  else {
21319
- logger$g.throwArgumentError("hex data is odd-length", "value", value);
21319
+ logger$e.throwArgumentError("hex data is odd-length", "value", value);
21320
21320
  }
21321
21321
  }
21322
21322
  const result = [];
@@ -21328,7 +21328,7 @@ function arrayify(value, options) {
21328
21328
  if (isBytes(value)) {
21329
21329
  return addSlice(new Uint8Array(value));
21330
21330
  }
21331
- return logger$g.throwArgumentError("invalid arrayify value", "value", value);
21331
+ return logger$e.throwArgumentError("invalid arrayify value", "value", value);
21332
21332
  }
21333
21333
  function concat(items) {
21334
21334
  const objects = items.map(item => arrayify(item));
@@ -21371,7 +21371,7 @@ function hexlify(value, options) {
21371
21371
  options = {};
21372
21372
  }
21373
21373
  if (typeof (value) === "number") {
21374
- logger$g.checkSafeUint53(value, "invalid hexlify value");
21374
+ logger$e.checkSafeUint53(value, "invalid hexlify value");
21375
21375
  let hex = "";
21376
21376
  while (value) {
21377
21377
  hex = HexCharacters[value & 0xf] + hex;
@@ -21407,7 +21407,7 @@ function hexlify(value, options) {
21407
21407
  value += "0";
21408
21408
  }
21409
21409
  else {
21410
- logger$g.throwArgumentError("hex data is odd-length", "value", value);
21410
+ logger$e.throwArgumentError("hex data is odd-length", "value", value);
21411
21411
  }
21412
21412
  }
21413
21413
  return value.toLowerCase();
@@ -21420,7 +21420,7 @@ function hexlify(value, options) {
21420
21420
  }
21421
21421
  return result;
21422
21422
  }
21423
- return logger$g.throwArgumentError("invalid hexlify value", "value", value);
21423
+ return logger$e.throwArgumentError("invalid hexlify value", "value", value);
21424
21424
  }
21425
21425
  /*
21426
21426
  function unoddify(value: BytesLike | Hexable | number): BytesLike | Hexable | number {
@@ -21444,7 +21444,7 @@ function hexDataSlice(data, offset, endOffset) {
21444
21444
  data = hexlify(data);
21445
21445
  }
21446
21446
  else if (!isHexString(data) || (data.length % 2)) {
21447
- logger$g.throwArgumentError("invalid hexData", "value", data);
21447
+ logger$e.throwArgumentError("invalid hexData", "value", data);
21448
21448
  }
21449
21449
  offset = 2 + 2 * offset;
21450
21450
  if (endOffset != null) {
@@ -21464,10 +21464,10 @@ function hexZeroPad(value, length) {
21464
21464
  value = hexlify(value);
21465
21465
  }
21466
21466
  else if (!isHexString(value)) {
21467
- logger$g.throwArgumentError("invalid hex string", "value", value);
21467
+ logger$e.throwArgumentError("invalid hex string", "value", value);
21468
21468
  }
21469
21469
  if (value.length > 2 * length + 2) {
21470
- logger$g.throwArgumentError("value out of range", "value", arguments[1]);
21470
+ logger$e.throwArgumentError("value out of range", "value", arguments[1]);
21471
21471
  }
21472
21472
  while (value.length < 2 * length + 2) {
21473
21473
  value = "0x0" + value.substring(2);
@@ -21475,26 +21475,18 @@ function hexZeroPad(value, length) {
21475
21475
  return value;
21476
21476
  }
21477
21477
 
21478
- const version$a = "bignumber/5.7.0";
21478
+ const version$9 = "bignumber/5.7.0";
21479
21479
 
21480
21480
  var BN = BN$1.BN;
21481
- const logger$f = new Logger(version$a);
21482
- const _constructorGuard$2 = {};
21481
+ const logger$d = new Logger(version$9);
21482
+ const _constructorGuard$1 = {};
21483
21483
  const MAX_SAFE = 0x1fffffffffffff;
21484
- function isBigNumberish(value) {
21485
- return (value != null) && (BigNumber.isBigNumber(value) ||
21486
- (typeof (value) === "number" && (value % 1) === 0) ||
21487
- (typeof (value) === "string" && !!value.match(/^-?[0-9]+$/)) ||
21488
- isHexString(value) ||
21489
- (typeof (value) === "bigint") ||
21490
- isBytes(value));
21491
- }
21492
21484
  // Only warn about passing 10 into radix once
21493
21485
  let _warnedToStringRadix = false;
21494
21486
  class BigNumber {
21495
21487
  constructor(constructorGuard, hex) {
21496
- if (constructorGuard !== _constructorGuard$2) {
21497
- logger$f.throwError("cannot call constructor directly; use BigNumber.from", Logger.errors.UNSUPPORTED_OPERATION, {
21488
+ if (constructorGuard !== _constructorGuard$1) {
21489
+ logger$d.throwError("cannot call constructor directly; use BigNumber.from", Logger.errors.UNSUPPORTED_OPERATION, {
21498
21490
  operation: "new (BigNumber)"
21499
21491
  });
21500
21492
  }
@@ -21523,7 +21515,7 @@ class BigNumber {
21523
21515
  div(other) {
21524
21516
  const o = BigNumber.from(other);
21525
21517
  if (o.isZero()) {
21526
- throwFault$1("division-by-zero", "div");
21518
+ throwFault("division-by-zero", "div");
21527
21519
  }
21528
21520
  return toBigNumber(toBN(this).div(toBN(other)));
21529
21521
  }
@@ -21533,53 +21525,53 @@ class BigNumber {
21533
21525
  mod(other) {
21534
21526
  const value = toBN(other);
21535
21527
  if (value.isNeg()) {
21536
- throwFault$1("division-by-zero", "mod");
21528
+ throwFault("division-by-zero", "mod");
21537
21529
  }
21538
21530
  return toBigNumber(toBN(this).umod(value));
21539
21531
  }
21540
21532
  pow(other) {
21541
21533
  const value = toBN(other);
21542
21534
  if (value.isNeg()) {
21543
- throwFault$1("negative-power", "pow");
21535
+ throwFault("negative-power", "pow");
21544
21536
  }
21545
21537
  return toBigNumber(toBN(this).pow(value));
21546
21538
  }
21547
21539
  and(other) {
21548
21540
  const value = toBN(other);
21549
21541
  if (this.isNegative() || value.isNeg()) {
21550
- throwFault$1("unbound-bitwise-result", "and");
21542
+ throwFault("unbound-bitwise-result", "and");
21551
21543
  }
21552
21544
  return toBigNumber(toBN(this).and(value));
21553
21545
  }
21554
21546
  or(other) {
21555
21547
  const value = toBN(other);
21556
21548
  if (this.isNegative() || value.isNeg()) {
21557
- throwFault$1("unbound-bitwise-result", "or");
21549
+ throwFault("unbound-bitwise-result", "or");
21558
21550
  }
21559
21551
  return toBigNumber(toBN(this).or(value));
21560
21552
  }
21561
21553
  xor(other) {
21562
21554
  const value = toBN(other);
21563
21555
  if (this.isNegative() || value.isNeg()) {
21564
- throwFault$1("unbound-bitwise-result", "xor");
21556
+ throwFault("unbound-bitwise-result", "xor");
21565
21557
  }
21566
21558
  return toBigNumber(toBN(this).xor(value));
21567
21559
  }
21568
21560
  mask(value) {
21569
21561
  if (this.isNegative() || value < 0) {
21570
- throwFault$1("negative-width", "mask");
21562
+ throwFault("negative-width", "mask");
21571
21563
  }
21572
21564
  return toBigNumber(toBN(this).maskn(value));
21573
21565
  }
21574
21566
  shl(value) {
21575
21567
  if (this.isNegative() || value < 0) {
21576
- throwFault$1("negative-width", "shl");
21568
+ throwFault("negative-width", "shl");
21577
21569
  }
21578
21570
  return toBigNumber(toBN(this).shln(value));
21579
21571
  }
21580
21572
  shr(value) {
21581
21573
  if (this.isNegative() || value < 0) {
21582
- throwFault$1("negative-width", "shr");
21574
+ throwFault("negative-width", "shr");
21583
21575
  }
21584
21576
  return toBigNumber(toBN(this).shrn(value));
21585
21577
  }
@@ -21609,7 +21601,7 @@ class BigNumber {
21609
21601
  return toBN(this).toNumber();
21610
21602
  }
21611
21603
  catch (error) {
21612
- throwFault$1("overflow", "toNumber", this.toString());
21604
+ throwFault("overflow", "toNumber", this.toString());
21613
21605
  }
21614
21606
  return null;
21615
21607
  }
@@ -21618,7 +21610,7 @@ class BigNumber {
21618
21610
  return BigInt(this.toString());
21619
21611
  }
21620
21612
  catch (e) { }
21621
- return logger$f.throwError("this platform does not support BigInt", Logger.errors.UNSUPPORTED_OPERATION, {
21613
+ return logger$d.throwError("this platform does not support BigInt", Logger.errors.UNSUPPORTED_OPERATION, {
21622
21614
  value: this.toString()
21623
21615
  });
21624
21616
  }
@@ -21628,14 +21620,14 @@ class BigNumber {
21628
21620
  if (arguments[0] === 10) {
21629
21621
  if (!_warnedToStringRadix) {
21630
21622
  _warnedToStringRadix = true;
21631
- logger$f.warn("BigNumber.toString does not accept any parameters; base-10 is assumed");
21623
+ logger$d.warn("BigNumber.toString does not accept any parameters; base-10 is assumed");
21632
21624
  }
21633
21625
  }
21634
21626
  else if (arguments[0] === 16) {
21635
- logger$f.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()", Logger.errors.UNEXPECTED_ARGUMENT, {});
21627
+ logger$d.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()", Logger.errors.UNEXPECTED_ARGUMENT, {});
21636
21628
  }
21637
21629
  else {
21638
- logger$f.throwError("BigNumber.toString does not accept parameters", Logger.errors.UNEXPECTED_ARGUMENT, {});
21630
+ logger$d.throwError("BigNumber.toString does not accept parameters", Logger.errors.UNEXPECTED_ARGUMENT, {});
21639
21631
  }
21640
21632
  }
21641
21633
  return toBN(this).toString(10);
@@ -21652,19 +21644,19 @@ class BigNumber {
21652
21644
  }
21653
21645
  if (typeof (value) === "string") {
21654
21646
  if (value.match(/^-?0x[0-9a-f]+$/i)) {
21655
- return new BigNumber(_constructorGuard$2, toHex(value));
21647
+ return new BigNumber(_constructorGuard$1, toHex(value));
21656
21648
  }
21657
21649
  if (value.match(/^-?[0-9]+$/)) {
21658
- return new BigNumber(_constructorGuard$2, toHex(new BN(value)));
21650
+ return new BigNumber(_constructorGuard$1, toHex(new BN(value)));
21659
21651
  }
21660
- return logger$f.throwArgumentError("invalid BigNumber string", "value", value);
21652
+ return logger$d.throwArgumentError("invalid BigNumber string", "value", value);
21661
21653
  }
21662
21654
  if (typeof (value) === "number") {
21663
21655
  if (value % 1) {
21664
- throwFault$1("underflow", "BigNumber.from", value);
21656
+ throwFault("underflow", "BigNumber.from", value);
21665
21657
  }
21666
21658
  if (value >= MAX_SAFE || value <= -MAX_SAFE) {
21667
- throwFault$1("overflow", "BigNumber.from", value);
21659
+ throwFault("overflow", "BigNumber.from", value);
21668
21660
  }
21669
21661
  return BigNumber.from(String(value));
21670
21662
  }
@@ -21697,7 +21689,7 @@ class BigNumber {
21697
21689
  }
21698
21690
  }
21699
21691
  }
21700
- return logger$f.throwArgumentError("invalid BigNumber value", "value", value);
21692
+ return logger$d.throwArgumentError("invalid BigNumber value", "value", value);
21701
21693
  }
21702
21694
  static isBigNumber(value) {
21703
21695
  return !!(value && value._isBigNumber);
@@ -21715,7 +21707,7 @@ function toHex(value) {
21715
21707
  value = value.substring(1);
21716
21708
  // Cannot have multiple negative signs (e.g. "--0x04")
21717
21709
  if (value[0] === "-") {
21718
- logger$f.throwArgumentError("invalid hex", "value", value);
21710
+ logger$d.throwArgumentError("invalid hex", "value", value);
21719
21711
  }
21720
21712
  // Call toHex on the positive component
21721
21713
  value = toHex(value);
@@ -21754,373 +21746,19 @@ function toBN(value) {
21754
21746
  }
21755
21747
  return new BN(hex.substring(2), 16);
21756
21748
  }
21757
- function throwFault$1(fault, operation, value) {
21749
+ function throwFault(fault, operation, value) {
21758
21750
  const params = { fault: fault, operation: operation };
21759
21751
  if (value != null) {
21760
21752
  params.value = value;
21761
21753
  }
21762
- return logger$f.throwError(fault, Logger.errors.NUMERIC_FAULT, params);
21754
+ return logger$d.throwError(fault, Logger.errors.NUMERIC_FAULT, params);
21763
21755
  }
21764
21756
  // value should have no prefix
21765
21757
  function _base36To16(value) {
21766
21758
  return (new BN(value, 36)).toString(16);
21767
21759
  }
21768
21760
 
21769
- const logger$e = new Logger(version$a);
21770
- const _constructorGuard$1 = {};
21771
- const Zero$1 = BigNumber.from(0);
21772
- const NegativeOne$1 = BigNumber.from(-1);
21773
- function throwFault(message, fault, operation, value) {
21774
- const params = { fault: fault, operation: operation };
21775
- if (value !== undefined) {
21776
- params.value = value;
21777
- }
21778
- return logger$e.throwError(message, Logger.errors.NUMERIC_FAULT, params);
21779
- }
21780
- // Constant to pull zeros from for multipliers
21781
- let zeros = "0";
21782
- while (zeros.length < 256) {
21783
- zeros += zeros;
21784
- }
21785
- // Returns a string "1" followed by decimal "0"s
21786
- function getMultiplier(decimals) {
21787
- if (typeof (decimals) !== "number") {
21788
- try {
21789
- decimals = BigNumber.from(decimals).toNumber();
21790
- }
21791
- catch (e) { }
21792
- }
21793
- if (typeof (decimals) === "number" && decimals >= 0 && decimals <= 256 && !(decimals % 1)) {
21794
- return ("1" + zeros.substring(0, decimals));
21795
- }
21796
- return logger$e.throwArgumentError("invalid decimal size", "decimals", decimals);
21797
- }
21798
- function formatFixed(value, decimals) {
21799
- if (decimals == null) {
21800
- decimals = 0;
21801
- }
21802
- const multiplier = getMultiplier(decimals);
21803
- // Make sure wei is a big number (convert as necessary)
21804
- value = BigNumber.from(value);
21805
- const negative = value.lt(Zero$1);
21806
- if (negative) {
21807
- value = value.mul(NegativeOne$1);
21808
- }
21809
- let fraction = value.mod(multiplier).toString();
21810
- while (fraction.length < multiplier.length - 1) {
21811
- fraction = "0" + fraction;
21812
- }
21813
- // Strip training 0
21814
- fraction = fraction.match(/^([0-9]*[1-9]|0)(0*)/)[1];
21815
- const whole = value.div(multiplier).toString();
21816
- if (multiplier.length === 1) {
21817
- value = whole;
21818
- }
21819
- else {
21820
- value = whole + "." + fraction;
21821
- }
21822
- if (negative) {
21823
- value = "-" + value;
21824
- }
21825
- return value;
21826
- }
21827
- function parseFixed(value, decimals) {
21828
- if (decimals == null) {
21829
- decimals = 0;
21830
- }
21831
- const multiplier = getMultiplier(decimals);
21832
- if (typeof (value) !== "string" || !value.match(/^-?[0-9.]+$/)) {
21833
- logger$e.throwArgumentError("invalid decimal value", "value", value);
21834
- }
21835
- // Is it negative?
21836
- const negative = (value.substring(0, 1) === "-");
21837
- if (negative) {
21838
- value = value.substring(1);
21839
- }
21840
- if (value === ".") {
21841
- logger$e.throwArgumentError("missing value", "value", value);
21842
- }
21843
- // Split it into a whole and fractional part
21844
- const comps = value.split(".");
21845
- if (comps.length > 2) {
21846
- logger$e.throwArgumentError("too many decimal points", "value", value);
21847
- }
21848
- let whole = comps[0], fraction = comps[1];
21849
- if (!whole) {
21850
- whole = "0";
21851
- }
21852
- if (!fraction) {
21853
- fraction = "0";
21854
- }
21855
- // Trim trailing zeros
21856
- while (fraction[fraction.length - 1] === "0") {
21857
- fraction = fraction.substring(0, fraction.length - 1);
21858
- }
21859
- // Check the fraction doesn't exceed our decimals size
21860
- if (fraction.length > multiplier.length - 1) {
21861
- throwFault("fractional component exceeds decimals", "underflow", "parseFixed");
21862
- }
21863
- // If decimals is 0, we have an empty string for fraction
21864
- if (fraction === "") {
21865
- fraction = "0";
21866
- }
21867
- // Fully pad the string with zeros to get to wei
21868
- while (fraction.length < multiplier.length - 1) {
21869
- fraction += "0";
21870
- }
21871
- const wholeValue = BigNumber.from(whole);
21872
- const fractionValue = BigNumber.from(fraction);
21873
- let wei = (wholeValue.mul(multiplier)).add(fractionValue);
21874
- if (negative) {
21875
- wei = wei.mul(NegativeOne$1);
21876
- }
21877
- return wei;
21878
- }
21879
- class FixedFormat {
21880
- constructor(constructorGuard, signed, width, decimals) {
21881
- if (constructorGuard !== _constructorGuard$1) {
21882
- logger$e.throwError("cannot use FixedFormat constructor; use FixedFormat.from", Logger.errors.UNSUPPORTED_OPERATION, {
21883
- operation: "new FixedFormat"
21884
- });
21885
- }
21886
- this.signed = signed;
21887
- this.width = width;
21888
- this.decimals = decimals;
21889
- this.name = (signed ? "" : "u") + "fixed" + String(width) + "x" + String(decimals);
21890
- this._multiplier = getMultiplier(decimals);
21891
- Object.freeze(this);
21892
- }
21893
- static from(value) {
21894
- if (value instanceof FixedFormat) {
21895
- return value;
21896
- }
21897
- if (typeof (value) === "number") {
21898
- value = `fixed128x${value}`;
21899
- }
21900
- let signed = true;
21901
- let width = 128;
21902
- let decimals = 18;
21903
- if (typeof (value) === "string") {
21904
- if (value === "fixed") ;
21905
- else if (value === "ufixed") {
21906
- signed = false;
21907
- }
21908
- else {
21909
- const match = value.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);
21910
- if (!match) {
21911
- logger$e.throwArgumentError("invalid fixed format", "format", value);
21912
- }
21913
- signed = (match[1] !== "u");
21914
- width = parseInt(match[2]);
21915
- decimals = parseInt(match[3]);
21916
- }
21917
- }
21918
- else if (value) {
21919
- const check = (key, type, defaultValue) => {
21920
- if (value[key] == null) {
21921
- return defaultValue;
21922
- }
21923
- if (typeof (value[key]) !== type) {
21924
- logger$e.throwArgumentError("invalid fixed format (" + key + " not " + type + ")", "format." + key, value[key]);
21925
- }
21926
- return value[key];
21927
- };
21928
- signed = check("signed", "boolean", signed);
21929
- width = check("width", "number", width);
21930
- decimals = check("decimals", "number", decimals);
21931
- }
21932
- if (width % 8) {
21933
- logger$e.throwArgumentError("invalid fixed format width (not byte aligned)", "format.width", width);
21934
- }
21935
- if (decimals > 80) {
21936
- logger$e.throwArgumentError("invalid fixed format (decimals too large)", "format.decimals", decimals);
21937
- }
21938
- return new FixedFormat(_constructorGuard$1, signed, width, decimals);
21939
- }
21940
- }
21941
- class FixedNumber {
21942
- constructor(constructorGuard, hex, value, format) {
21943
- if (constructorGuard !== _constructorGuard$1) {
21944
- logger$e.throwError("cannot use FixedNumber constructor; use FixedNumber.from", Logger.errors.UNSUPPORTED_OPERATION, {
21945
- operation: "new FixedFormat"
21946
- });
21947
- }
21948
- this.format = format;
21949
- this._hex = hex;
21950
- this._value = value;
21951
- this._isFixedNumber = true;
21952
- Object.freeze(this);
21953
- }
21954
- _checkFormat(other) {
21955
- if (this.format.name !== other.format.name) {
21956
- logger$e.throwArgumentError("incompatible format; use fixedNumber.toFormat", "other", other);
21957
- }
21958
- }
21959
- addUnsafe(other) {
21960
- this._checkFormat(other);
21961
- const a = parseFixed(this._value, this.format.decimals);
21962
- const b = parseFixed(other._value, other.format.decimals);
21963
- return FixedNumber.fromValue(a.add(b), this.format.decimals, this.format);
21964
- }
21965
- subUnsafe(other) {
21966
- this._checkFormat(other);
21967
- const a = parseFixed(this._value, this.format.decimals);
21968
- const b = parseFixed(other._value, other.format.decimals);
21969
- return FixedNumber.fromValue(a.sub(b), this.format.decimals, this.format);
21970
- }
21971
- mulUnsafe(other) {
21972
- this._checkFormat(other);
21973
- const a = parseFixed(this._value, this.format.decimals);
21974
- const b = parseFixed(other._value, other.format.decimals);
21975
- return FixedNumber.fromValue(a.mul(b).div(this.format._multiplier), this.format.decimals, this.format);
21976
- }
21977
- divUnsafe(other) {
21978
- this._checkFormat(other);
21979
- const a = parseFixed(this._value, this.format.decimals);
21980
- const b = parseFixed(other._value, other.format.decimals);
21981
- return FixedNumber.fromValue(a.mul(this.format._multiplier).div(b), this.format.decimals, this.format);
21982
- }
21983
- floor() {
21984
- const comps = this.toString().split(".");
21985
- if (comps.length === 1) {
21986
- comps.push("0");
21987
- }
21988
- let result = FixedNumber.from(comps[0], this.format);
21989
- const hasFraction = !comps[1].match(/^(0*)$/);
21990
- if (this.isNegative() && hasFraction) {
21991
- result = result.subUnsafe(ONE.toFormat(result.format));
21992
- }
21993
- return result;
21994
- }
21995
- ceiling() {
21996
- const comps = this.toString().split(".");
21997
- if (comps.length === 1) {
21998
- comps.push("0");
21999
- }
22000
- let result = FixedNumber.from(comps[0], this.format);
22001
- const hasFraction = !comps[1].match(/^(0*)$/);
22002
- if (!this.isNegative() && hasFraction) {
22003
- result = result.addUnsafe(ONE.toFormat(result.format));
22004
- }
22005
- return result;
22006
- }
22007
- // @TODO: Support other rounding algorithms
22008
- round(decimals) {
22009
- if (decimals == null) {
22010
- decimals = 0;
22011
- }
22012
- // If we are already in range, we're done
22013
- const comps = this.toString().split(".");
22014
- if (comps.length === 1) {
22015
- comps.push("0");
22016
- }
22017
- if (decimals < 0 || decimals > 80 || (decimals % 1)) {
22018
- logger$e.throwArgumentError("invalid decimal count", "decimals", decimals);
22019
- }
22020
- if (comps[1].length <= decimals) {
22021
- return this;
22022
- }
22023
- const factor = FixedNumber.from("1" + zeros.substring(0, decimals), this.format);
22024
- const bump = BUMP.toFormat(this.format);
22025
- return this.mulUnsafe(factor).addUnsafe(bump).floor().divUnsafe(factor);
22026
- }
22027
- isZero() {
22028
- return (this._value === "0.0" || this._value === "0");
22029
- }
22030
- isNegative() {
22031
- return (this._value[0] === "-");
22032
- }
22033
- toString() { return this._value; }
22034
- toHexString(width) {
22035
- if (width == null) {
22036
- return this._hex;
22037
- }
22038
- if (width % 8) {
22039
- logger$e.throwArgumentError("invalid byte width", "width", width);
22040
- }
22041
- const hex = BigNumber.from(this._hex).fromTwos(this.format.width).toTwos(width).toHexString();
22042
- return hexZeroPad(hex, width / 8);
22043
- }
22044
- toUnsafeFloat() { return parseFloat(this.toString()); }
22045
- toFormat(format) {
22046
- return FixedNumber.fromString(this._value, format);
22047
- }
22048
- static fromValue(value, decimals, format) {
22049
- // If decimals looks more like a format, and there is no format, shift the parameters
22050
- if (format == null && decimals != null && !isBigNumberish(decimals)) {
22051
- format = decimals;
22052
- decimals = null;
22053
- }
22054
- if (decimals == null) {
22055
- decimals = 0;
22056
- }
22057
- if (format == null) {
22058
- format = "fixed";
22059
- }
22060
- return FixedNumber.fromString(formatFixed(value, decimals), FixedFormat.from(format));
22061
- }
22062
- static fromString(value, format) {
22063
- if (format == null) {
22064
- format = "fixed";
22065
- }
22066
- const fixedFormat = FixedFormat.from(format);
22067
- const numeric = parseFixed(value, fixedFormat.decimals);
22068
- if (!fixedFormat.signed && numeric.lt(Zero$1)) {
22069
- throwFault("unsigned value cannot be negative", "overflow", "value", value);
22070
- }
22071
- let hex = null;
22072
- if (fixedFormat.signed) {
22073
- hex = numeric.toTwos(fixedFormat.width).toHexString();
22074
- }
22075
- else {
22076
- hex = numeric.toHexString();
22077
- hex = hexZeroPad(hex, fixedFormat.width / 8);
22078
- }
22079
- const decimal = formatFixed(numeric, fixedFormat.decimals);
22080
- return new FixedNumber(_constructorGuard$1, hex, decimal, fixedFormat);
22081
- }
22082
- static fromBytes(value, format) {
22083
- if (format == null) {
22084
- format = "fixed";
22085
- }
22086
- const fixedFormat = FixedFormat.from(format);
22087
- if (arrayify(value).length > fixedFormat.width / 8) {
22088
- throw new Error("overflow");
22089
- }
22090
- let numeric = BigNumber.from(value);
22091
- if (fixedFormat.signed) {
22092
- numeric = numeric.fromTwos(fixedFormat.width);
22093
- }
22094
- const hex = numeric.toTwos((fixedFormat.signed ? 0 : 1) + fixedFormat.width).toHexString();
22095
- const decimal = formatFixed(numeric, fixedFormat.decimals);
22096
- return new FixedNumber(_constructorGuard$1, hex, decimal, fixedFormat);
22097
- }
22098
- static from(value, format) {
22099
- if (typeof (value) === "string") {
22100
- return FixedNumber.fromString(value, format);
22101
- }
22102
- if (isBytes(value)) {
22103
- return FixedNumber.fromBytes(value, format);
22104
- }
22105
- try {
22106
- return FixedNumber.fromValue(value, 0, format);
22107
- }
22108
- catch (error) {
22109
- // Allow NUMERIC_FAULT to bubble up
22110
- if (error.code !== Logger.errors.INVALID_ARGUMENT) {
22111
- throw error;
22112
- }
22113
- }
22114
- return logger$e.throwArgumentError("invalid FixedNumber value", "value", value);
22115
- }
22116
- static isFixedNumber(value) {
22117
- return !!(value && value._isFixedNumber);
22118
- }
22119
- }
22120
- const ONE = FixedNumber.from(1);
22121
- const BUMP = FixedNumber.from("0.5");
22122
-
22123
- const version$9 = "properties/5.7.0";
21761
+ const version$8 = "properties/5.7.0";
22124
21762
 
22125
21763
  var __awaiter$3 = function (thisArg, _arguments, P, generator) {
22126
21764
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
@@ -22131,7 +21769,7 @@ var __awaiter$3 = function (thisArg, _arguments, P, generator) {
22131
21769
  step((generator = generator.apply(thisArg, _arguments || [])).next());
22132
21770
  });
22133
21771
  };
22134
- const logger$d = new Logger(version$9);
21772
+ const logger$c = new Logger(version$8);
22135
21773
  function defineReadOnly(object, name, value) {
22136
21774
  Object.defineProperty(object, name, {
22137
21775
  enumerable: true,
@@ -22199,7 +21837,7 @@ function _isFrozen(object) {
22199
21837
  }
22200
21838
  return true;
22201
21839
  }
22202
- return logger$d.throwArgumentError(`Cannot deepCopy ${typeof (object)}`, "object", object);
21840
+ return logger$c.throwArgumentError(`Cannot deepCopy ${typeof (object)}`, "object", object);
22203
21841
  }
22204
21842
  // Returns a new copy of object, such that no properties may be replaced.
22205
21843
  // New properties may be added only to objects.
@@ -22222,7 +21860,7 @@ function _deepCopy(object) {
22222
21860
  }
22223
21861
  return result;
22224
21862
  }
22225
- return logger$d.throwArgumentError(`Cannot deepCopy ${typeof (object)}`, "object", object);
21863
+ return logger$c.throwArgumentError(`Cannot deepCopy ${typeof (object)}`, "object", object);
22226
21864
  }
22227
21865
  function deepCopy(object) {
22228
21866
  return _deepCopy(object);
@@ -22235,9 +21873,9 @@ class Description {
22235
21873
  }
22236
21874
  }
22237
21875
 
22238
- const version$8 = "abi/5.7.0";
21876
+ const version$7 = "abi/5.7.0";
22239
21877
 
22240
- const logger$c = new Logger(version$8);
21878
+ const logger$b = new Logger(version$7);
22241
21879
  const _constructorGuard = {};
22242
21880
  let ModifiersBytes = { calldata: true, memory: true, storage: true };
22243
21881
  let ModifiersNest = { calldata: true, memory: true };
@@ -22258,7 +21896,7 @@ function checkModifier(type, name) {
22258
21896
  }
22259
21897
  }
22260
21898
  if (ModifiersBytes[name] || name === "payable") {
22261
- logger$c.throwArgumentError("invalid modifier", "name", name);
21899
+ logger$b.throwArgumentError("invalid modifier", "name", name);
22262
21900
  }
22263
21901
  return false;
22264
21902
  }
@@ -22266,7 +21904,7 @@ function checkModifier(type, name) {
22266
21904
  function parseParamType(param, allowIndexed) {
22267
21905
  let originalParam = param;
22268
21906
  function throwError(i) {
22269
- logger$c.throwArgumentError(`unexpected character at position ${i}`, "param", param);
21907
+ logger$b.throwArgumentError(`unexpected character at position ${i}`, "param", param);
22270
21908
  }
22271
21909
  param = param.replace(/\s/g, " ");
22272
21910
  function newNode(parent) {
@@ -22405,7 +22043,7 @@ function parseParamType(param, allowIndexed) {
22405
22043
  }
22406
22044
  }
22407
22045
  if (node.parent) {
22408
- logger$c.throwArgumentError("unexpected eof", "param", param);
22046
+ logger$b.throwArgumentError("unexpected eof", "param", param);
22409
22047
  }
22410
22048
  delete parent.state;
22411
22049
  if (node.name === "indexed") {
@@ -22443,7 +22081,7 @@ const paramTypeArray = new RegExp(/^(.*)\[([0-9]*)\]$/);
22443
22081
  class ParamType {
22444
22082
  constructor(constructorGuard, params) {
22445
22083
  if (constructorGuard !== _constructorGuard) {
22446
- logger$c.throwError("use fromString", Logger.errors.UNSUPPORTED_OPERATION, {
22084
+ logger$b.throwError("use fromString", Logger.errors.UNSUPPORTED_OPERATION, {
22447
22085
  operation: "new ParamType()"
22448
22086
  });
22449
22087
  }
@@ -22478,7 +22116,7 @@ class ParamType {
22478
22116
  format = FormatTypes.sighash;
22479
22117
  }
22480
22118
  if (!FormatTypes[format]) {
22481
- logger$c.throwArgumentError("invalid format type", "format", format);
22119
+ logger$b.throwArgumentError("invalid format type", "format", format);
22482
22120
  }
22483
22121
  if (format === FormatTypes.json) {
22484
22122
  let result = {
@@ -22558,7 +22196,7 @@ function parseParams(value, allowIndex) {
22558
22196
  class Fragment {
22559
22197
  constructor(constructorGuard, params) {
22560
22198
  if (constructorGuard !== _constructorGuard) {
22561
- logger$c.throwError("use a static from method", Logger.errors.UNSUPPORTED_OPERATION, {
22199
+ logger$b.throwError("use a static from method", Logger.errors.UNSUPPORTED_OPERATION, {
22562
22200
  operation: "new Fragment()"
22563
22201
  });
22564
22202
  }
@@ -22593,7 +22231,7 @@ class Fragment {
22593
22231
  // @TODO: Something? Maybe return a FunctionFragment? A custom DefaultFunctionFragment?
22594
22232
  return null;
22595
22233
  }
22596
- return logger$c.throwArgumentError("invalid fragment object", "value", value);
22234
+ return logger$b.throwArgumentError("invalid fragment object", "value", value);
22597
22235
  }
22598
22236
  static fromString(value) {
22599
22237
  // Make sure the "returns" is surrounded by a space and all whitespace is exactly one space
@@ -22612,7 +22250,7 @@ class Fragment {
22612
22250
  else if (value.split(" ")[0] === "error") {
22613
22251
  return ErrorFragment.fromString(value.substring(5).trim());
22614
22252
  }
22615
- return logger$c.throwArgumentError("unsupported fragment", "value", value);
22253
+ return logger$b.throwArgumentError("unsupported fragment", "value", value);
22616
22254
  }
22617
22255
  static isFragment(value) {
22618
22256
  return !!(value && value._isFragment);
@@ -22624,7 +22262,7 @@ class EventFragment extends Fragment {
22624
22262
  format = FormatTypes.sighash;
22625
22263
  }
22626
22264
  if (!FormatTypes[format]) {
22627
- logger$c.throwArgumentError("invalid format type", "format", format);
22265
+ logger$b.throwArgumentError("invalid format type", "format", format);
22628
22266
  }
22629
22267
  if (format === FormatTypes.json) {
22630
22268
  return JSON.stringify({
@@ -22657,7 +22295,7 @@ class EventFragment extends Fragment {
22657
22295
  return value;
22658
22296
  }
22659
22297
  if (value.type !== "event") {
22660
- logger$c.throwArgumentError("invalid event object", "value", value);
22298
+ logger$b.throwArgumentError("invalid event object", "value", value);
22661
22299
  }
22662
22300
  const params = {
22663
22301
  name: verifyIdentifier(value.name),
@@ -22670,7 +22308,7 @@ class EventFragment extends Fragment {
22670
22308
  static fromString(value) {
22671
22309
  let match = value.match(regexParen);
22672
22310
  if (!match) {
22673
- logger$c.throwArgumentError("invalid event string", "value", value);
22311
+ logger$b.throwArgumentError("invalid event string", "value", value);
22674
22312
  }
22675
22313
  let anonymous = false;
22676
22314
  match[3].split(" ").forEach((modifier) => {
@@ -22681,7 +22319,7 @@ class EventFragment extends Fragment {
22681
22319
  case "":
22682
22320
  break;
22683
22321
  default:
22684
- logger$c.warn("unknown modifier: " + modifier);
22322
+ logger$b.warn("unknown modifier: " + modifier);
22685
22323
  }
22686
22324
  });
22687
22325
  return EventFragment.fromObject({
@@ -22700,10 +22338,10 @@ function parseGas(value, params) {
22700
22338
  let comps = value.split("@");
22701
22339
  if (comps.length !== 1) {
22702
22340
  if (comps.length > 2) {
22703
- logger$c.throwArgumentError("invalid human-readable ABI signature", "value", value);
22341
+ logger$b.throwArgumentError("invalid human-readable ABI signature", "value", value);
22704
22342
  }
22705
22343
  if (!comps[1].match(/^[0-9]+$/)) {
22706
- logger$c.throwArgumentError("invalid human-readable ABI signature gas", "value", value);
22344
+ logger$b.throwArgumentError("invalid human-readable ABI signature gas", "value", value);
22707
22345
  }
22708
22346
  params.gas = BigNumber.from(comps[1]);
22709
22347
  return comps[0];
@@ -22756,14 +22394,14 @@ function verifyState(value) {
22756
22394
  result.constant = (result.stateMutability === "view" || result.stateMutability === "pure");
22757
22395
  if (value.constant != null) {
22758
22396
  if ((!!value.constant) !== result.constant) {
22759
- logger$c.throwArgumentError("cannot have constant function with mutability " + result.stateMutability, "value", value);
22397
+ logger$b.throwArgumentError("cannot have constant function with mutability " + result.stateMutability, "value", value);
22760
22398
  }
22761
22399
  }
22762
22400
  // Set (and check things are consistent) the payable property
22763
22401
  result.payable = (result.stateMutability === "payable");
22764
22402
  if (value.payable != null) {
22765
22403
  if ((!!value.payable) !== result.payable) {
22766
- logger$c.throwArgumentError("cannot have payable function with mutability " + result.stateMutability, "value", value);
22404
+ logger$b.throwArgumentError("cannot have payable function with mutability " + result.stateMutability, "value", value);
22767
22405
  }
22768
22406
  }
22769
22407
  }
@@ -22771,7 +22409,7 @@ function verifyState(value) {
22771
22409
  result.payable = !!value.payable;
22772
22410
  // If payable we can assume non-constant; otherwise we can't assume
22773
22411
  if (value.constant == null && !result.payable && value.type !== "constructor") {
22774
- logger$c.throwArgumentError("unable to determine stateMutability", "value", value);
22412
+ logger$b.throwArgumentError("unable to determine stateMutability", "value", value);
22775
22413
  }
22776
22414
  result.constant = !!value.constant;
22777
22415
  if (result.constant) {
@@ -22781,7 +22419,7 @@ function verifyState(value) {
22781
22419
  result.stateMutability = (result.payable ? "payable" : "nonpayable");
22782
22420
  }
22783
22421
  if (result.payable && result.constant) {
22784
- logger$c.throwArgumentError("cannot have constant payable function", "value", value);
22422
+ logger$b.throwArgumentError("cannot have constant payable function", "value", value);
22785
22423
  }
22786
22424
  }
22787
22425
  else if (value.constant != null) {
@@ -22790,7 +22428,7 @@ function verifyState(value) {
22790
22428
  result.stateMutability = (result.constant ? "view" : "payable");
22791
22429
  }
22792
22430
  else if (value.type !== "constructor") {
22793
- logger$c.throwArgumentError("unable to determine stateMutability", "value", value);
22431
+ logger$b.throwArgumentError("unable to determine stateMutability", "value", value);
22794
22432
  }
22795
22433
  return result;
22796
22434
  }
@@ -22800,7 +22438,7 @@ class ConstructorFragment extends Fragment {
22800
22438
  format = FormatTypes.sighash;
22801
22439
  }
22802
22440
  if (!FormatTypes[format]) {
22803
- logger$c.throwArgumentError("invalid format type", "format", format);
22441
+ logger$b.throwArgumentError("invalid format type", "format", format);
22804
22442
  }
22805
22443
  if (format === FormatTypes.json) {
22806
22444
  return JSON.stringify({
@@ -22812,7 +22450,7 @@ class ConstructorFragment extends Fragment {
22812
22450
  });
22813
22451
  }
22814
22452
  if (format === FormatTypes.sighash) {
22815
- logger$c.throwError("cannot format a constructor for sighash", Logger.errors.UNSUPPORTED_OPERATION, {
22453
+ logger$b.throwError("cannot format a constructor for sighash", Logger.errors.UNSUPPORTED_OPERATION, {
22816
22454
  operation: "format(sighash)"
22817
22455
  });
22818
22456
  }
@@ -22833,11 +22471,11 @@ class ConstructorFragment extends Fragment {
22833
22471
  return value;
22834
22472
  }
22835
22473
  if (value.type !== "constructor") {
22836
- logger$c.throwArgumentError("invalid constructor object", "value", value);
22474
+ logger$b.throwArgumentError("invalid constructor object", "value", value);
22837
22475
  }
22838
22476
  let state = verifyState(value);
22839
22477
  if (state.constant) {
22840
- logger$c.throwArgumentError("constructor cannot be constant", "value", value);
22478
+ logger$b.throwArgumentError("constructor cannot be constant", "value", value);
22841
22479
  }
22842
22480
  const params = {
22843
22481
  name: null,
@@ -22854,7 +22492,7 @@ class ConstructorFragment extends Fragment {
22854
22492
  value = parseGas(value, params);
22855
22493
  let parens = value.match(regexParen);
22856
22494
  if (!parens || parens[1].trim() !== "constructor") {
22857
- logger$c.throwArgumentError("invalid constructor string", "value", value);
22495
+ logger$b.throwArgumentError("invalid constructor string", "value", value);
22858
22496
  }
22859
22497
  params.inputs = parseParams(parens[2].trim(), false);
22860
22498
  parseModifiers(parens[3].trim(), params);
@@ -22870,7 +22508,7 @@ class FunctionFragment extends ConstructorFragment {
22870
22508
  format = FormatTypes.sighash;
22871
22509
  }
22872
22510
  if (!FormatTypes[format]) {
22873
- logger$c.throwArgumentError("invalid format type", "format", format);
22511
+ logger$b.throwArgumentError("invalid format type", "format", format);
22874
22512
  }
22875
22513
  if (format === FormatTypes.json) {
22876
22514
  return JSON.stringify({
@@ -22918,7 +22556,7 @@ class FunctionFragment extends ConstructorFragment {
22918
22556
  return value;
22919
22557
  }
22920
22558
  if (value.type !== "function") {
22921
- logger$c.throwArgumentError("invalid function object", "value", value);
22559
+ logger$b.throwArgumentError("invalid function object", "value", value);
22922
22560
  }
22923
22561
  let state = verifyState(value);
22924
22562
  const params = {
@@ -22938,11 +22576,11 @@ class FunctionFragment extends ConstructorFragment {
22938
22576
  value = parseGas(value, params);
22939
22577
  let comps = value.split(" returns ");
22940
22578
  if (comps.length > 2) {
22941
- logger$c.throwArgumentError("invalid function string", "value", value);
22579
+ logger$b.throwArgumentError("invalid function string", "value", value);
22942
22580
  }
22943
22581
  let parens = comps[0].match(regexParen);
22944
22582
  if (!parens) {
22945
- logger$c.throwArgumentError("invalid function signature", "value", value);
22583
+ logger$b.throwArgumentError("invalid function signature", "value", value);
22946
22584
  }
22947
22585
  params.name = parens[1].trim();
22948
22586
  if (params.name) {
@@ -22954,7 +22592,7 @@ class FunctionFragment extends ConstructorFragment {
22954
22592
  if (comps.length > 1) {
22955
22593
  let returns = comps[1].match(regexParen);
22956
22594
  if (returns[1].trim() != "" || returns[3].trim() != "") {
22957
- logger$c.throwArgumentError("unexpected tokens", "value", value);
22595
+ logger$b.throwArgumentError("unexpected tokens", "value", value);
22958
22596
  }
22959
22597
  params.outputs = parseParams(returns[2], false);
22960
22598
  }
@@ -22972,7 +22610,7 @@ class FunctionFragment extends ConstructorFragment {
22972
22610
  function checkForbidden(fragment) {
22973
22611
  const sig = fragment.format();
22974
22612
  if (sig === "Error(string)" || sig === "Panic(uint256)") {
22975
- logger$c.throwArgumentError(`cannot specify user defined ${sig} error`, "fragment", fragment);
22613
+ logger$b.throwArgumentError(`cannot specify user defined ${sig} error`, "fragment", fragment);
22976
22614
  }
22977
22615
  return fragment;
22978
22616
  }
@@ -22982,7 +22620,7 @@ class ErrorFragment extends Fragment {
22982
22620
  format = FormatTypes.sighash;
22983
22621
  }
22984
22622
  if (!FormatTypes[format]) {
22985
- logger$c.throwArgumentError("invalid format type", "format", format);
22623
+ logger$b.throwArgumentError("invalid format type", "format", format);
22986
22624
  }
22987
22625
  if (format === FormatTypes.json) {
22988
22626
  return JSON.stringify({
@@ -23009,7 +22647,7 @@ class ErrorFragment extends Fragment {
23009
22647
  return value;
23010
22648
  }
23011
22649
  if (value.type !== "error") {
23012
- logger$c.throwArgumentError("invalid error object", "value", value);
22650
+ logger$b.throwArgumentError("invalid error object", "value", value);
23013
22651
  }
23014
22652
  const params = {
23015
22653
  type: value.type,
@@ -23022,7 +22660,7 @@ class ErrorFragment extends Fragment {
23022
22660
  let params = { type: "error" };
23023
22661
  let parens = value.match(regexParen);
23024
22662
  if (!parens) {
23025
- logger$c.throwArgumentError("invalid error signature", "value", value);
22663
+ logger$b.throwArgumentError("invalid error signature", "value", value);
23026
22664
  }
23027
22665
  params.name = parens[1].trim();
23028
22666
  if (params.name) {
@@ -23050,7 +22688,7 @@ function verifyType(type) {
23050
22688
  const regexIdentifier = new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");
23051
22689
  function verifyIdentifier(value) {
23052
22690
  if (!value || !value.match(regexIdentifier)) {
23053
- logger$c.throwArgumentError(`invalid identifier "${value}"`, "value", value);
22691
+ logger$b.throwArgumentError(`invalid identifier "${value}"`, "value", value);
23054
22692
  }
23055
22693
  return value;
23056
22694
  }
@@ -23074,7 +22712,7 @@ function splitNesting(value) {
23074
22712
  else if (c === ")") {
23075
22713
  depth--;
23076
22714
  if (depth === -1) {
23077
- logger$c.throwArgumentError("unbalanced parenthesis", "value", value);
22715
+ logger$b.throwArgumentError("unbalanced parenthesis", "value", value);
23078
22716
  }
23079
22717
  }
23080
22718
  }
@@ -23085,7 +22723,7 @@ function splitNesting(value) {
23085
22723
  return result;
23086
22724
  }
23087
22725
 
23088
- const logger$b = new Logger(version$8);
22726
+ const logger$a = new Logger(version$7);
23089
22727
  function checkResultErrors(result) {
23090
22728
  // Find the first error (if any)
23091
22729
  const errors = [];
@@ -23116,7 +22754,7 @@ class Coder {
23116
22754
  this.dynamic = dynamic;
23117
22755
  }
23118
22756
  _throwError(message, value) {
23119
- logger$b.throwArgumentError(message, this.localName, value);
22757
+ logger$a.throwArgumentError(message, this.localName, value);
23120
22758
  }
23121
22759
  }
23122
22760
  class Writer {
@@ -23150,7 +22788,7 @@ class Writer {
23150
22788
  _getValue(value) {
23151
22789
  let bytes = arrayify(BigNumber.from(value));
23152
22790
  if (bytes.length > this.wordSize) {
23153
- logger$b.throwError("value out-of-bounds", Logger.errors.BUFFER_OVERRUN, {
22791
+ logger$a.throwError("value out-of-bounds", Logger.errors.BUFFER_OVERRUN, {
23154
22792
  length: this.wordSize,
23155
22793
  offset: bytes.length
23156
22794
  });
@@ -23204,7 +22842,7 @@ class Reader {
23204
22842
  alignedLength = length;
23205
22843
  }
23206
22844
  else {
23207
- logger$b.throwError("data out-of-bounds", Logger.errors.BUFFER_OVERRUN, {
22845
+ logger$a.throwError("data out-of-bounds", Logger.errors.BUFFER_OVERRUN, {
23208
22846
  length: this._data.length,
23209
22847
  offset: this._offset + alignedLength
23210
22848
  });
@@ -23888,9 +23526,9 @@ function keccak256(data) {
23888
23526
  return '0x' + sha3.keccak_256(arrayify(data));
23889
23527
  }
23890
23528
 
23891
- const version$7 = "rlp/5.7.0";
23529
+ const version$6 = "rlp/5.7.0";
23892
23530
 
23893
- const logger$a = new Logger(version$7);
23531
+ const logger$9 = new Logger(version$6);
23894
23532
  function arrayifyInteger(value) {
23895
23533
  const result = [];
23896
23534
  while (value) {
@@ -23914,7 +23552,7 @@ function _encode(object) {
23914
23552
  return length.concat(payload);
23915
23553
  }
23916
23554
  if (!isBytesLike(object)) {
23917
- logger$a.throwArgumentError("RLP object must be BytesLike", "object", object);
23555
+ logger$9.throwArgumentError("RLP object must be BytesLike", "object", object);
23918
23556
  }
23919
23557
  const data = Array.prototype.slice.call(arrayify(object));
23920
23558
  if (data.length === 1 && data[0] <= 0x7f) {
@@ -23932,12 +23570,12 @@ function encode(object) {
23932
23570
  return hexlify(_encode(object));
23933
23571
  }
23934
23572
 
23935
- const version$6 = "address/5.7.0";
23573
+ const version$5 = "address/5.7.0";
23936
23574
 
23937
- const logger$9 = new Logger(version$6);
23575
+ const logger$8 = new Logger(version$5);
23938
23576
  function getChecksumAddress(address) {
23939
23577
  if (!isHexString(address, 20)) {
23940
- logger$9.throwArgumentError("invalid address", "address", address);
23578
+ logger$8.throwArgumentError("invalid address", "address", address);
23941
23579
  }
23942
23580
  address = address.toLowerCase();
23943
23581
  const chars = address.substring(2).split("");
@@ -23993,7 +23631,7 @@ function ibanChecksum(address) {
23993
23631
  function getAddress(address) {
23994
23632
  let result = null;
23995
23633
  if (typeof (address) !== "string") {
23996
- logger$9.throwArgumentError("invalid address", "address", address);
23634
+ logger$8.throwArgumentError("invalid address", "address", address);
23997
23635
  }
23998
23636
  if (address.match(/^(0x)?[0-9a-fA-F]{40}$/)) {
23999
23637
  // Missing the 0x prefix
@@ -24003,14 +23641,14 @@ function getAddress(address) {
24003
23641
  result = getChecksumAddress(address);
24004
23642
  // It is a checksummed address with a bad checksum
24005
23643
  if (address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) && result !== address) {
24006
- logger$9.throwArgumentError("bad address checksum", "address", address);
23644
+ logger$8.throwArgumentError("bad address checksum", "address", address);
24007
23645
  }
24008
23646
  // Maybe ICAP? (we only support direct mode)
24009
23647
  }
24010
23648
  else if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {
24011
23649
  // It is an ICAP address with a bad checksum
24012
23650
  if (address.substring(2, 4) !== ibanChecksum(address)) {
24013
- logger$9.throwArgumentError("bad icap checksum", "address", address);
23651
+ logger$8.throwArgumentError("bad icap checksum", "address", address);
24014
23652
  }
24015
23653
  result = _base36To16(address.substring(4));
24016
23654
  while (result.length < 40) {
@@ -24019,7 +23657,7 @@ function getAddress(address) {
24019
23657
  result = getChecksumAddress("0x" + result);
24020
23658
  }
24021
23659
  else {
24022
- logger$9.throwArgumentError("invalid address", "address", address);
23660
+ logger$8.throwArgumentError("invalid address", "address", address);
24023
23661
  }
24024
23662
  return result;
24025
23663
  }
@@ -24038,7 +23676,7 @@ function getContractAddress(transaction) {
24038
23676
  from = getAddress(transaction.from);
24039
23677
  }
24040
23678
  catch (error) {
24041
- logger$9.throwArgumentError("missing from address", "transaction", transaction);
23679
+ logger$8.throwArgumentError("missing from address", "transaction", transaction);
24042
23680
  }
24043
23681
  const nonce = stripZeros(arrayify(BigNumber.from(transaction.nonce).toHexString()));
24044
23682
  return getAddress(hexDataSlice(keccak256(encode([from, nonce])), 12));
@@ -24082,7 +23720,7 @@ class AnonymousCoder extends Coder {
24082
23720
  }
24083
23721
  }
24084
23722
 
24085
- const logger$8 = new Logger(version$8);
23723
+ const logger$7 = new Logger(version$7);
24086
23724
  function pack(writer, coders, values) {
24087
23725
  let arrayValues = null;
24088
23726
  if (Array.isArray(values)) {
@@ -24093,14 +23731,14 @@ function pack(writer, coders, values) {
24093
23731
  arrayValues = coders.map((coder) => {
24094
23732
  const name = coder.localName;
24095
23733
  if (!name) {
24096
- logger$8.throwError("cannot encode object for signature with missing names", Logger.errors.INVALID_ARGUMENT, {
23734
+ logger$7.throwError("cannot encode object for signature with missing names", Logger.errors.INVALID_ARGUMENT, {
24097
23735
  argument: "values",
24098
23736
  coder: coder,
24099
23737
  value: values
24100
23738
  });
24101
23739
  }
24102
23740
  if (unique[name]) {
24103
- logger$8.throwError("cannot encode object for signature with duplicate names", Logger.errors.INVALID_ARGUMENT, {
23741
+ logger$7.throwError("cannot encode object for signature with duplicate names", Logger.errors.INVALID_ARGUMENT, {
24104
23742
  argument: "values",
24105
23743
  coder: coder,
24106
23744
  value: values
@@ -24111,10 +23749,10 @@ function pack(writer, coders, values) {
24111
23749
  });
24112
23750
  }
24113
23751
  else {
24114
- logger$8.throwArgumentError("invalid tuple value", "tuple", values);
23752
+ logger$7.throwArgumentError("invalid tuple value", "tuple", values);
24115
23753
  }
24116
23754
  if (coders.length !== arrayValues.length) {
24117
- logger$8.throwArgumentError("types/value length mismatch", "tuple", values);
23755
+ logger$7.throwArgumentError("types/value length mismatch", "tuple", values);
24118
23756
  }
24119
23757
  let staticWriter = new Writer(writer.wordSize);
24120
23758
  let dynamicWriter = new Writer(writer.wordSize);
@@ -24255,7 +23893,7 @@ class ArrayCoder extends Coder {
24255
23893
  count = value.length;
24256
23894
  writer.writeValue(value.length);
24257
23895
  }
24258
- logger$8.checkArgumentCount(value.length, count, "coder array" + (this.localName ? (" " + this.localName) : ""));
23896
+ logger$7.checkArgumentCount(value.length, count, "coder array" + (this.localName ? (" " + this.localName) : ""));
24259
23897
  let coders = [];
24260
23898
  for (let i = 0; i < value.length; i++) {
24261
23899
  coders.push(this.coder);
@@ -24272,7 +23910,7 @@ class ArrayCoder extends Coder {
24272
23910
  // bytes as a link to the data). This could use a much
24273
23911
  // tighter bound, but we are erroring on the side of safety.
24274
23912
  if (count * 32 > reader._data.length) {
24275
- logger$8.throwError("insufficient data length", Logger.errors.BUFFER_OVERRUN, {
23913
+ logger$7.throwError("insufficient data length", Logger.errors.BUFFER_OVERRUN, {
24276
23914
  length: reader._data.length,
24277
23915
  count: count
24278
23916
  });
@@ -24368,6 +24006,8 @@ class NullCoder extends Coder {
24368
24006
  }
24369
24007
  }
24370
24008
 
24009
+ const AddressZero = "0x0000000000000000000000000000000000000000";
24010
+
24371
24011
  const NegativeOne = ( /*#__PURE__*/BigNumber.from(-1));
24372
24012
  const Zero = ( /*#__PURE__*/BigNumber.from(0));
24373
24013
  const One = ( /*#__PURE__*/BigNumber.from(1));
@@ -24411,9 +24051,9 @@ class NumberCoder extends Coder {
24411
24051
  }
24412
24052
  }
24413
24053
 
24414
- const version$5 = "strings/5.7.0";
24054
+ const version$4 = "strings/5.7.0";
24415
24055
 
24416
- const logger$7 = new Logger(version$5);
24056
+ const logger$6 = new Logger(version$4);
24417
24057
  ///////////////////////////////
24418
24058
  var UnicodeNormalizationForm;
24419
24059
  (function (UnicodeNormalizationForm) {
@@ -24451,7 +24091,7 @@ var Utf8ErrorReason;
24451
24091
  Utf8ErrorReason["OVERLONG"] = "overlong representation";
24452
24092
  })(Utf8ErrorReason || (Utf8ErrorReason = {}));
24453
24093
  function errorFunc(reason, offset, bytes, output, badCodepoint) {
24454
- return logger$7.throwArgumentError(`invalid codepoint at offset ${offset}; ${reason}`, "bytes", bytes);
24094
+ return logger$6.throwArgumentError(`invalid codepoint at offset ${offset}; ${reason}`, "bytes", bytes);
24455
24095
  }
24456
24096
  function ignoreFunc(reason, offset, bytes, output, badCodepoint) {
24457
24097
  // If there is an invalid prefix (including stray continuation), skip any additional continuation bytes
@@ -24577,7 +24217,7 @@ function getUtf8CodePoints(bytes, onError) {
24577
24217
  // http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array
24578
24218
  function toUtf8Bytes(str, form = UnicodeNormalizationForm.current) {
24579
24219
  if (form != UnicodeNormalizationForm.current) {
24580
- logger$7.checkNormalize();
24220
+ logger$6.checkNormalize();
24581
24221
  str = str.normalize(form);
24582
24222
  }
24583
24223
  let result = [];
@@ -24693,7 +24333,7 @@ class TupleCoder extends Coder {
24693
24333
  }
24694
24334
  }
24695
24335
 
24696
- const logger$6 = new Logger(version$8);
24336
+ const logger$5 = new Logger(version$7);
24697
24337
  const paramTypeBytes = new RegExp(/^bytes([0-9]*)$/);
24698
24338
  const paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/);
24699
24339
  class AbiCoder {
@@ -24724,7 +24364,7 @@ class AbiCoder {
24724
24364
  if (match) {
24725
24365
  let size = parseInt(match[2] || "256");
24726
24366
  if (size === 0 || size > 256 || (size % 8) !== 0) {
24727
- logger$6.throwArgumentError("invalid " + match[1] + " bit length", "param", param);
24367
+ logger$5.throwArgumentError("invalid " + match[1] + " bit length", "param", param);
24728
24368
  }
24729
24369
  return new NumberCoder(size / 8, (match[1] === "int"), param.name);
24730
24370
  }
@@ -24733,11 +24373,11 @@ class AbiCoder {
24733
24373
  if (match) {
24734
24374
  let size = parseInt(match[1]);
24735
24375
  if (size === 0 || size > 32) {
24736
- logger$6.throwArgumentError("invalid bytes length", "param", param);
24376
+ logger$5.throwArgumentError("invalid bytes length", "param", param);
24737
24377
  }
24738
24378
  return new FixedBytesCoder(size, param.name);
24739
24379
  }
24740
- return logger$6.throwArgumentError("invalid type", "type", param.type);
24380
+ return logger$5.throwArgumentError("invalid type", "type", param.type);
24741
24381
  }
24742
24382
  _getWordSize() { return 32; }
24743
24383
  _getReader(data, allowLoose) {
@@ -24753,7 +24393,7 @@ class AbiCoder {
24753
24393
  }
24754
24394
  encode(types, values) {
24755
24395
  if (types.length !== values.length) {
24756
- logger$6.throwError("types/values length mismatch", Logger.errors.INVALID_ARGUMENT, {
24396
+ logger$5.throwError("types/values length mismatch", Logger.errors.INVALID_ARGUMENT, {
24757
24397
  count: { types: types.length, values: values.length },
24758
24398
  value: { types: types, values: values }
24759
24399
  });
@@ -24776,7 +24416,7 @@ function id(text) {
24776
24416
  return keccak256(toUtf8Bytes(text));
24777
24417
  }
24778
24418
 
24779
- const logger$5 = new Logger(version$8);
24419
+ const logger$4 = new Logger(version$7);
24780
24420
  class LogDescription extends Description {
24781
24421
  }
24782
24422
  class TransactionDescription extends Description {
@@ -24833,7 +24473,7 @@ class Interface {
24833
24473
  switch (fragment.type) {
24834
24474
  case "constructor":
24835
24475
  if (this.deploy) {
24836
- logger$5.warn("duplicate definition - constructor");
24476
+ logger$4.warn("duplicate definition - constructor");
24837
24477
  return;
24838
24478
  }
24839
24479
  //checkNames(fragment, "input", fragment.inputs);
@@ -24856,7 +24496,7 @@ class Interface {
24856
24496
  }
24857
24497
  let signature = fragment.format();
24858
24498
  if (bucket[signature]) {
24859
- logger$5.warn("duplicate definition - " + signature);
24499
+ logger$4.warn("duplicate definition - " + signature);
24860
24500
  return;
24861
24501
  }
24862
24502
  bucket[signature] = fragment;
@@ -24875,7 +24515,7 @@ class Interface {
24875
24515
  format = FormatTypes.full;
24876
24516
  }
24877
24517
  if (format === FormatTypes.sighash) {
24878
- logger$5.throwArgumentError("interface does not support formatting sighash", "format", format);
24518
+ logger$4.throwArgumentError("interface does not support formatting sighash", "format", format);
24879
24519
  }
24880
24520
  const abi = this.fragments.map((fragment) => fragment.format(format));
24881
24521
  // We need to re-bundle the JSON fragments a bit
@@ -24905,24 +24545,24 @@ class Interface {
24905
24545
  return this.functions[name];
24906
24546
  }
24907
24547
  }
24908
- logger$5.throwArgumentError("no matching function", "sighash", nameOrSignatureOrSighash);
24548
+ logger$4.throwArgumentError("no matching function", "sighash", nameOrSignatureOrSighash);
24909
24549
  }
24910
24550
  // It is a bare name, look up the function (will return null if ambiguous)
24911
24551
  if (nameOrSignatureOrSighash.indexOf("(") === -1) {
24912
24552
  const name = nameOrSignatureOrSighash.trim();
24913
24553
  const matching = Object.keys(this.functions).filter((f) => (f.split("(" /* fix:) */)[0] === name));
24914
24554
  if (matching.length === 0) {
24915
- logger$5.throwArgumentError("no matching function", "name", name);
24555
+ logger$4.throwArgumentError("no matching function", "name", name);
24916
24556
  }
24917
24557
  else if (matching.length > 1) {
24918
- logger$5.throwArgumentError("multiple matching functions", "name", name);
24558
+ logger$4.throwArgumentError("multiple matching functions", "name", name);
24919
24559
  }
24920
24560
  return this.functions[matching[0]];
24921
24561
  }
24922
24562
  // Normalize the signature and lookup the function
24923
24563
  const result = this.functions[FunctionFragment.fromString(nameOrSignatureOrSighash).format()];
24924
24564
  if (!result) {
24925
- logger$5.throwArgumentError("no matching function", "signature", nameOrSignatureOrSighash);
24565
+ logger$4.throwArgumentError("no matching function", "signature", nameOrSignatureOrSighash);
24926
24566
  }
24927
24567
  return result;
24928
24568
  }
@@ -24935,24 +24575,24 @@ class Interface {
24935
24575
  return this.events[name];
24936
24576
  }
24937
24577
  }
24938
- logger$5.throwArgumentError("no matching event", "topichash", topichash);
24578
+ logger$4.throwArgumentError("no matching event", "topichash", topichash);
24939
24579
  }
24940
24580
  // It is a bare name, look up the function (will return null if ambiguous)
24941
24581
  if (nameOrSignatureOrTopic.indexOf("(") === -1) {
24942
24582
  const name = nameOrSignatureOrTopic.trim();
24943
24583
  const matching = Object.keys(this.events).filter((f) => (f.split("(" /* fix:) */)[0] === name));
24944
24584
  if (matching.length === 0) {
24945
- logger$5.throwArgumentError("no matching event", "name", name);
24585
+ logger$4.throwArgumentError("no matching event", "name", name);
24946
24586
  }
24947
24587
  else if (matching.length > 1) {
24948
- logger$5.throwArgumentError("multiple matching events", "name", name);
24588
+ logger$4.throwArgumentError("multiple matching events", "name", name);
24949
24589
  }
24950
24590
  return this.events[matching[0]];
24951
24591
  }
24952
24592
  // Normalize the signature and lookup the function
24953
24593
  const result = this.events[EventFragment.fromString(nameOrSignatureOrTopic).format()];
24954
24594
  if (!result) {
24955
- logger$5.throwArgumentError("no matching event", "signature", nameOrSignatureOrTopic);
24595
+ logger$4.throwArgumentError("no matching event", "signature", nameOrSignatureOrTopic);
24956
24596
  }
24957
24597
  return result;
24958
24598
  }
@@ -24966,24 +24606,24 @@ class Interface {
24966
24606
  return this.errors[name];
24967
24607
  }
24968
24608
  }
24969
- logger$5.throwArgumentError("no matching error", "sighash", nameOrSignatureOrSighash);
24609
+ logger$4.throwArgumentError("no matching error", "sighash", nameOrSignatureOrSighash);
24970
24610
  }
24971
24611
  // It is a bare name, look up the function (will return null if ambiguous)
24972
24612
  if (nameOrSignatureOrSighash.indexOf("(") === -1) {
24973
24613
  const name = nameOrSignatureOrSighash.trim();
24974
24614
  const matching = Object.keys(this.errors).filter((f) => (f.split("(" /* fix:) */)[0] === name));
24975
24615
  if (matching.length === 0) {
24976
- logger$5.throwArgumentError("no matching error", "name", name);
24616
+ logger$4.throwArgumentError("no matching error", "name", name);
24977
24617
  }
24978
24618
  else if (matching.length > 1) {
24979
- logger$5.throwArgumentError("multiple matching errors", "name", name);
24619
+ logger$4.throwArgumentError("multiple matching errors", "name", name);
24980
24620
  }
24981
24621
  return this.errors[matching[0]];
24982
24622
  }
24983
24623
  // Normalize the signature and lookup the function
24984
24624
  const result = this.errors[FunctionFragment.fromString(nameOrSignatureOrSighash).format()];
24985
24625
  if (!result) {
24986
- logger$5.throwArgumentError("no matching error", "signature", nameOrSignatureOrSighash);
24626
+ logger$4.throwArgumentError("no matching error", "signature", nameOrSignatureOrSighash);
24987
24627
  }
24988
24628
  return result;
24989
24629
  }
@@ -25026,7 +24666,7 @@ class Interface {
25026
24666
  }
25027
24667
  const bytes = arrayify(data);
25028
24668
  if (hexlify(bytes.slice(0, 4)) !== this.getSighash(fragment)) {
25029
- logger$5.throwArgumentError(`data signature does not match error ${fragment.name}.`, "data", hexlify(bytes));
24669
+ logger$4.throwArgumentError(`data signature does not match error ${fragment.name}.`, "data", hexlify(bytes));
25030
24670
  }
25031
24671
  return this._decodeParams(fragment.inputs, bytes.slice(4));
25032
24672
  }
@@ -25046,7 +24686,7 @@ class Interface {
25046
24686
  }
25047
24687
  const bytes = arrayify(data);
25048
24688
  if (hexlify(bytes.slice(0, 4)) !== this.getSighash(functionFragment)) {
25049
- logger$5.throwArgumentError(`data signature does not match function ${functionFragment.name}.`, "data", hexlify(bytes));
24689
+ logger$4.throwArgumentError(`data signature does not match function ${functionFragment.name}.`, "data", hexlify(bytes));
25050
24690
  }
25051
24691
  return this._decodeParams(functionFragment.inputs, bytes.slice(4));
25052
24692
  }
@@ -25107,7 +24747,7 @@ class Interface {
25107
24747
  break;
25108
24748
  }
25109
24749
  }
25110
- return logger$5.throwError("call revert exception" + message, Logger.errors.CALL_EXCEPTION, {
24750
+ return logger$4.throwError("call revert exception" + message, Logger.errors.CALL_EXCEPTION, {
25111
24751
  method: functionFragment.format(),
25112
24752
  data: hexlify(data), errorArgs, errorName, errorSignature, reason
25113
24753
  });
@@ -25125,7 +24765,7 @@ class Interface {
25125
24765
  eventFragment = this.getEvent(eventFragment);
25126
24766
  }
25127
24767
  if (values.length > eventFragment.inputs.length) {
25128
- logger$5.throwError("too many arguments for " + eventFragment.format(), Logger.errors.UNEXPECTED_ARGUMENT, {
24768
+ logger$4.throwError("too many arguments for " + eventFragment.format(), Logger.errors.UNEXPECTED_ARGUMENT, {
25129
24769
  argument: "values",
25130
24770
  value: values
25131
24771
  });
@@ -25157,7 +24797,7 @@ class Interface {
25157
24797
  let param = eventFragment.inputs[index];
25158
24798
  if (!param.indexed) {
25159
24799
  if (value != null) {
25160
- logger$5.throwArgumentError("cannot filter non-indexed parameters; must be null", ("contract." + param.name), value);
24800
+ logger$4.throwArgumentError("cannot filter non-indexed parameters; must be null", ("contract." + param.name), value);
25161
24801
  }
25162
24802
  return;
25163
24803
  }
@@ -25165,7 +24805,7 @@ class Interface {
25165
24805
  topics.push(null);
25166
24806
  }
25167
24807
  else if (param.baseType === "array" || param.baseType === "tuple") {
25168
- logger$5.throwArgumentError("filtering with tuples or arrays not supported", ("contract." + param.name), value);
24808
+ logger$4.throwArgumentError("filtering with tuples or arrays not supported", ("contract." + param.name), value);
25169
24809
  }
25170
24810
  else if (Array.isArray(value)) {
25171
24811
  topics.push(value.map((value) => encodeTopic(param, value)));
@@ -25191,7 +24831,7 @@ class Interface {
25191
24831
  topics.push(this.getEventTopic(eventFragment));
25192
24832
  }
25193
24833
  if (values.length !== eventFragment.inputs.length) {
25194
- logger$5.throwArgumentError("event arguments/values mismatch", "values", values);
24834
+ logger$4.throwArgumentError("event arguments/values mismatch", "values", values);
25195
24835
  }
25196
24836
  eventFragment.inputs.forEach((param, index) => {
25197
24837
  const value = values[index];
@@ -25228,7 +24868,7 @@ class Interface {
25228
24868
  if (topics != null && !eventFragment.anonymous) {
25229
24869
  let topicHash = this.getEventTopic(eventFragment);
25230
24870
  if (!isHexString(topics[0], 32) || topics[0].toLowerCase() !== topicHash) {
25231
- logger$5.throwError("fragment/topic mismatch", Logger.errors.INVALID_ARGUMENT, { argument: "topics[0]", expected: topicHash, value: topics[0] });
24871
+ logger$4.throwError("fragment/topic mismatch", Logger.errors.INVALID_ARGUMENT, { argument: "topics[0]", expected: topicHash, value: topics[0] });
25232
24872
  }
25233
24873
  topics = topics.slice(1);
25234
24874
  }
@@ -25373,7 +25013,7 @@ class Interface {
25373
25013
  }
25374
25014
  }
25375
25015
 
25376
- const version$4 = "abstract-provider/5.7.0";
25016
+ const version$3 = "abstract-provider/5.7.0";
25377
25017
 
25378
25018
  var __awaiter$2 = function (thisArg, _arguments, P, generator) {
25379
25019
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
@@ -25384,12 +25024,12 @@ var __awaiter$2 = function (thisArg, _arguments, P, generator) {
25384
25024
  step((generator = generator.apply(thisArg, _arguments || [])).next());
25385
25025
  });
25386
25026
  };
25387
- const logger$4 = new Logger(version$4);
25027
+ const logger$3 = new Logger(version$3);
25388
25028
  ///////////////////////////////
25389
25029
  // Exported Abstracts
25390
25030
  class Provider {
25391
25031
  constructor() {
25392
- logger$4.checkAbstract(new.target, Provider);
25032
+ logger$3.checkAbstract(new.target, Provider);
25393
25033
  defineReadOnly(this, "_isProvider", true);
25394
25034
  }
25395
25035
  getFeeData() {
@@ -25427,7 +25067,7 @@ class Provider {
25427
25067
  }
25428
25068
  }
25429
25069
 
25430
- const version$3 = "abstract-signer/5.7.0";
25070
+ const version$2 = "abstract-signer/5.7.0";
25431
25071
 
25432
25072
  var __awaiter$1 = function (thisArg, _arguments, P, generator) {
25433
25073
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
@@ -25438,7 +25078,7 @@ var __awaiter$1 = function (thisArg, _arguments, P, generator) {
25438
25078
  step((generator = generator.apply(thisArg, _arguments || [])).next());
25439
25079
  });
25440
25080
  };
25441
- const logger$3 = new Logger(version$3);
25081
+ const logger$2 = new Logger(version$2);
25442
25082
  const allowedTransactionKeys = [
25443
25083
  "accessList", "ccipReadEnabled", "chainId", "customData", "data", "from", "gasLimit", "gasPrice", "maxFeePerGas", "maxPriorityFeePerGas", "nonce", "to", "type", "value"
25444
25084
  ];
@@ -25451,7 +25091,7 @@ class Signer {
25451
25091
  ///////////////////
25452
25092
  // Sub-classes MUST call super
25453
25093
  constructor() {
25454
- logger$3.checkAbstract(new.target, Signer);
25094
+ logger$2.checkAbstract(new.target, Signer);
25455
25095
  defineReadOnly(this, "_isSigner", true);
25456
25096
  }
25457
25097
  ///////////////////
@@ -25530,7 +25170,7 @@ class Signer {
25530
25170
  checkTransaction(transaction) {
25531
25171
  for (const key in transaction) {
25532
25172
  if (allowedTransactionKeys.indexOf(key) === -1) {
25533
- logger$3.throwArgumentError("invalid transaction key: " + key, "transaction", transaction);
25173
+ logger$2.throwArgumentError("invalid transaction key: " + key, "transaction", transaction);
25534
25174
  }
25535
25175
  }
25536
25176
  const tx = shallowCopy(transaction);
@@ -25544,7 +25184,7 @@ class Signer {
25544
25184
  this.getAddress()
25545
25185
  ]).then((result) => {
25546
25186
  if (result[0].toLowerCase() !== result[1].toLowerCase()) {
25547
- logger$3.throwArgumentError("from address mismatch", "transaction", transaction);
25187
+ logger$2.throwArgumentError("from address mismatch", "transaction", transaction);
25548
25188
  }
25549
25189
  return result[0];
25550
25190
  });
@@ -25568,7 +25208,7 @@ class Signer {
25568
25208
  }
25569
25209
  const address = yield this.resolveName(to);
25570
25210
  if (address == null) {
25571
- logger$3.throwArgumentError("provided ENS name resolves to null", "tx.to", to);
25211
+ logger$2.throwArgumentError("provided ENS name resolves to null", "tx.to", to);
25572
25212
  }
25573
25213
  return address;
25574
25214
  }));
@@ -25578,10 +25218,10 @@ class Signer {
25578
25218
  // Do not allow mixing pre-eip-1559 and eip-1559 properties
25579
25219
  const hasEip1559 = (tx.maxFeePerGas != null || tx.maxPriorityFeePerGas != null);
25580
25220
  if (tx.gasPrice != null && (tx.type === 2 || hasEip1559)) {
25581
- logger$3.throwArgumentError("eip-1559 transaction do not support gasPrice", "transaction", transaction);
25221
+ logger$2.throwArgumentError("eip-1559 transaction do not support gasPrice", "transaction", transaction);
25582
25222
  }
25583
25223
  else if ((tx.type === 0 || tx.type === 1) && hasEip1559) {
25584
- logger$3.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas", "transaction", transaction);
25224
+ logger$2.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas", "transaction", transaction);
25585
25225
  }
25586
25226
  if ((tx.type === 2 || tx.type == null) && (tx.maxFeePerGas != null && tx.maxPriorityFeePerGas != null)) {
25587
25227
  // Fully-formed EIP-1559 transaction (skip getFeeData)
@@ -25625,7 +25265,7 @@ class Signer {
25625
25265
  // Network doesn't support EIP-1559...
25626
25266
  // ...but they are trying to use EIP-1559 properties
25627
25267
  if (hasEip1559) {
25628
- logger$3.throwError("network does not support EIP-1559", Logger.errors.UNSUPPORTED_OPERATION, {
25268
+ logger$2.throwError("network does not support EIP-1559", Logger.errors.UNSUPPORTED_OPERATION, {
25629
25269
  operation: "populateTransaction"
25630
25270
  });
25631
25271
  }
@@ -25638,7 +25278,7 @@ class Signer {
25638
25278
  }
25639
25279
  else {
25640
25280
  // getFeeData has failed us.
25641
- logger$3.throwError("failed to get consistent fee data", Logger.errors.UNSUPPORTED_OPERATION, {
25281
+ logger$2.throwError("failed to get consistent fee data", Logger.errors.UNSUPPORTED_OPERATION, {
25642
25282
  operation: "signer.getFeeData"
25643
25283
  });
25644
25284
  }
@@ -25662,7 +25302,7 @@ class Signer {
25662
25302
  if (forwardErrors.indexOf(error.code) >= 0) {
25663
25303
  throw error;
25664
25304
  }
25665
- return logger$3.throwError("cannot estimate gas; transaction may fail or may require manual gas limit", Logger.errors.UNPREDICTABLE_GAS_LIMIT, {
25305
+ return logger$2.throwError("cannot estimate gas; transaction may fail or may require manual gas limit", Logger.errors.UNPREDICTABLE_GAS_LIMIT, {
25666
25306
  error: error,
25667
25307
  tx: tx
25668
25308
  });
@@ -25677,7 +25317,7 @@ class Signer {
25677
25317
  this.getChainId()
25678
25318
  ]).then((results) => {
25679
25319
  if (results[1] !== 0 && results[0] !== results[1]) {
25680
- logger$3.throwArgumentError("chainId address mismatch", "transaction", transaction);
25320
+ logger$2.throwArgumentError("chainId address mismatch", "transaction", transaction);
25681
25321
  }
25682
25322
  return results[0];
25683
25323
  });
@@ -25689,7 +25329,7 @@ class Signer {
25689
25329
  // Sub-classes SHOULD leave these alone
25690
25330
  _checkProvider(operation) {
25691
25331
  if (!this.provider) {
25692
- logger$3.throwError("missing provider", Logger.errors.UNSUPPORTED_OPERATION, {
25332
+ logger$2.throwError("missing provider", Logger.errors.UNSUPPORTED_OPERATION, {
25693
25333
  operation: (operation || "_checkProvider")
25694
25334
  });
25695
25335
  }
@@ -25709,7 +25349,7 @@ class VoidSigner extends Signer {
25709
25349
  }
25710
25350
  _fail(message, operation) {
25711
25351
  return Promise.resolve().then(() => {
25712
- logger$3.throwError(message, Logger.errors.UNSUPPORTED_OPERATION, { operation: operation });
25352
+ logger$2.throwError(message, Logger.errors.UNSUPPORTED_OPERATION, { operation: operation });
25713
25353
  });
25714
25354
  }
25715
25355
  signMessage(message) {
@@ -25726,9 +25366,9 @@ class VoidSigner extends Signer {
25726
25366
  }
25727
25367
  }
25728
25368
 
25729
- const version$2 = "transactions/5.7.0";
25369
+ const version$1 = "transactions/5.7.0";
25730
25370
 
25731
- const logger$2 = new Logger(version$2);
25371
+ const logger$1 = new Logger(version$1);
25732
25372
  var TransactionTypes;
25733
25373
  (function (TransactionTypes) {
25734
25374
  TransactionTypes[TransactionTypes["legacy"] = 0] = "legacy";
@@ -25740,7 +25380,7 @@ function accessSetify(addr, storageKeys) {
25740
25380
  address: getAddress(addr),
25741
25381
  storageKeys: (storageKeys || []).map((storageKey, index) => {
25742
25382
  if (hexDataLength(storageKey) !== 32) {
25743
- logger$2.throwArgumentError("invalid access list storageKey", `accessList[${addr}:${index}]`, storageKey);
25383
+ logger$1.throwArgumentError("invalid access list storageKey", `accessList[${addr}:${index}]`, storageKey);
25744
25384
  }
25745
25385
  return storageKey.toLowerCase();
25746
25386
  })
@@ -25751,7 +25391,7 @@ function accessListify(value) {
25751
25391
  return value.map((set, index) => {
25752
25392
  if (Array.isArray(set)) {
25753
25393
  if (set.length > 2) {
25754
- logger$2.throwArgumentError("access list expected to be [ address, storageKeys[] ]", `value[${index}]`, set);
25394
+ logger$1.throwArgumentError("access list expected to be [ address, storageKeys[] ]", `value[${index}]`, set);
25755
25395
  }
25756
25396
  return accessSetify(set[0], set[1]);
25757
25397
  }
@@ -25769,7 +25409,7 @@ function accessListify(value) {
25769
25409
  return result;
25770
25410
  }
25771
25411
 
25772
- const version$1 = "contracts/5.7.0";
25412
+ const version = "contracts/5.7.0";
25773
25413
 
25774
25414
  var __awaiter = function (thisArg, _arguments, P, generator) {
25775
25415
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
@@ -25780,12 +25420,12 @@ var __awaiter = function (thisArg, _arguments, P, generator) {
25780
25420
  step((generator = generator.apply(thisArg, _arguments || [])).next());
25781
25421
  });
25782
25422
  };
25783
- const logger$1 = new Logger(version$1);
25423
+ const logger = new Logger(version);
25784
25424
  function resolveName(resolver, nameOrPromise) {
25785
25425
  return __awaiter(this, void 0, void 0, function* () {
25786
25426
  const name = yield nameOrPromise;
25787
25427
  if (typeof (name) !== "string") {
25788
- logger$1.throwArgumentError("invalid address or ENS name", "name", name);
25428
+ logger.throwArgumentError("invalid address or ENS name", "name", name);
25789
25429
  }
25790
25430
  // If it is already an address, just use it (after adding checksum)
25791
25431
  try {
@@ -25793,13 +25433,13 @@ function resolveName(resolver, nameOrPromise) {
25793
25433
  }
25794
25434
  catch (error) { }
25795
25435
  if (!resolver) {
25796
- logger$1.throwError("a provider or signer is needed to resolve ENS names", Logger.errors.UNSUPPORTED_OPERATION, {
25436
+ logger.throwError("a provider or signer is needed to resolve ENS names", Logger.errors.UNSUPPORTED_OPERATION, {
25797
25437
  operation: "resolveName"
25798
25438
  });
25799
25439
  }
25800
25440
  const address = yield resolver.resolveName(name);
25801
25441
  if (address == null) {
25802
- logger$1.throwArgumentError("resolver or addr is not configured for ENS name", "name", name);
25442
+ logger.throwArgumentError("resolver or addr is not configured for ENS name", "name", name);
25803
25443
  }
25804
25444
  return address;
25805
25445
  });
@@ -25820,7 +25460,7 @@ function resolveAddresses(resolver, value, paramType) {
25820
25460
  }
25821
25461
  if (paramType.baseType === "array") {
25822
25462
  if (!Array.isArray(value)) {
25823
- return Promise.reject(logger$1.makeError("invalid value for array", Logger.errors.INVALID_ARGUMENT, {
25463
+ return Promise.reject(logger.makeError("invalid value for array", Logger.errors.INVALID_ARGUMENT, {
25824
25464
  argument: "value",
25825
25465
  value
25826
25466
  }));
@@ -25838,7 +25478,7 @@ function populateTransaction(contract, fragment, args) {
25838
25478
  overrides = shallowCopy(args.pop());
25839
25479
  }
25840
25480
  // Make sure the parameter count matches
25841
- logger$1.checkArgumentCount(args.length, fragment.inputs.length, "passed to contract");
25481
+ logger.checkArgumentCount(args.length, fragment.inputs.length, "passed to contract");
25842
25482
  // Populate "from" override (allow promises)
25843
25483
  if (contract.signer) {
25844
25484
  if (overrides.from) {
@@ -25849,7 +25489,7 @@ function populateTransaction(contract, fragment, args) {
25849
25489
  signer: contract.signer.getAddress()
25850
25490
  }).then((check) => __awaiter(this, void 0, void 0, function* () {
25851
25491
  if (getAddress(check.signer) !== check.override) {
25852
- logger$1.throwError("Contract with a Signer cannot override from", Logger.errors.UNSUPPORTED_OPERATION, {
25492
+ logger.throwError("Contract with a Signer cannot override from", Logger.errors.UNSUPPORTED_OPERATION, {
25853
25493
  operation: "overrides.from"
25854
25494
  });
25855
25495
  }
@@ -25927,7 +25567,7 @@ function populateTransaction(contract, fragment, args) {
25927
25567
  if (ro.value) {
25928
25568
  const roValue = BigNumber.from(ro.value);
25929
25569
  if (!roValue.isZero() && !fragment.payable) {
25930
- logger$1.throwError("non-payable method cannot override value", Logger.errors.UNSUPPORTED_OPERATION, {
25570
+ logger.throwError("non-payable method cannot override value", Logger.errors.UNSUPPORTED_OPERATION, {
25931
25571
  operation: "overrides.value",
25932
25572
  value: overrides.value
25933
25573
  });
@@ -25956,7 +25596,7 @@ function populateTransaction(contract, fragment, args) {
25956
25596
  // typo or using an unsupported key.
25957
25597
  const leftovers = Object.keys(overrides).filter((key) => (overrides[key] != null));
25958
25598
  if (leftovers.length) {
25959
- logger$1.throwError(`cannot override ${leftovers.map((l) => JSON.stringify(l)).join(",")}`, Logger.errors.UNSUPPORTED_OPERATION, {
25599
+ logger.throwError(`cannot override ${leftovers.map((l) => JSON.stringify(l)).join(",")}`, Logger.errors.UNSUPPORTED_OPERATION, {
25960
25600
  operation: "overrides",
25961
25601
  overrides: leftovers
25962
25602
  });
@@ -25974,7 +25614,7 @@ function buildEstimate(contract, fragment) {
25974
25614
  return function (...args) {
25975
25615
  return __awaiter(this, void 0, void 0, function* () {
25976
25616
  if (!signerOrProvider) {
25977
- logger$1.throwError("estimate require a provider or signer", Logger.errors.UNSUPPORTED_OPERATION, {
25617
+ logger.throwError("estimate require a provider or signer", Logger.errors.UNSUPPORTED_OPERATION, {
25978
25618
  operation: "estimateGas"
25979
25619
  });
25980
25620
  }
@@ -26063,7 +25703,7 @@ function buildSend(contract, fragment) {
26063
25703
  return function (...args) {
26064
25704
  return __awaiter(this, void 0, void 0, function* () {
26065
25705
  if (!contract.signer) {
26066
- logger$1.throwError("sending a transaction requires a signer", Logger.errors.UNSUPPORTED_OPERATION, {
25706
+ logger.throwError("sending a transaction requires a signer", Logger.errors.UNSUPPORTED_OPERATION, {
26067
25707
  operation: "sendTransaction"
26068
25708
  });
26069
25709
  }
@@ -26162,7 +25802,7 @@ class FragmentRunningEvent extends RunningEvent {
26162
25802
  let topic = contractInterface.getEventTopic(fragment);
26163
25803
  if (topics) {
26164
25804
  if (topic !== topics[0]) {
26165
- logger$1.throwArgumentError("topic mismatch", "topics", topics);
25805
+ logger.throwArgumentError("topic mismatch", "topics", topics);
26166
25806
  }
26167
25807
  filter.topics = topics.slice();
26168
25808
  }
@@ -26244,7 +25884,7 @@ class BaseContract {
26244
25884
  defineReadOnly(this, "signer", null);
26245
25885
  }
26246
25886
  else {
26247
- logger$1.throwArgumentError("invalid signer or provider", "signerOrProvider", signerOrProvider);
25887
+ logger.throwArgumentError("invalid signer or provider", "signerOrProvider", signerOrProvider);
26248
25888
  }
26249
25889
  defineReadOnly(this, "callStatic", {});
26250
25890
  defineReadOnly(this, "estimateGas", {});
@@ -26272,14 +25912,14 @@ class BaseContract {
26272
25912
  defineReadOnly(this.filters, name, this.filters[filters[0]]);
26273
25913
  }
26274
25914
  else {
26275
- logger$1.warn(`Duplicate definition of ${name} (${filters.join(", ")})`);
25915
+ logger.warn(`Duplicate definition of ${name} (${filters.join(", ")})`);
26276
25916
  }
26277
25917
  });
26278
25918
  }
26279
25919
  defineReadOnly(this, "_runningEvents", {});
26280
25920
  defineReadOnly(this, "_wrappedEmits", {});
26281
25921
  if (addressOrName == null) {
26282
- logger$1.throwArgumentError("invalid contract address or ENS name", "addressOrName", addressOrName);
25922
+ logger.throwArgumentError("invalid contract address or ENS name", "addressOrName", addressOrName);
26283
25923
  }
26284
25924
  defineReadOnly(this, "address", addressOrName);
26285
25925
  if (this.provider) {
@@ -26291,7 +25931,7 @@ class BaseContract {
26291
25931
  }
26292
25932
  catch (error) {
26293
25933
  // Without a provider, we cannot use ENS names
26294
- logger$1.throwError("provider is required to use ENS name as contract address", Logger.errors.UNSUPPORTED_OPERATION, {
25934
+ logger.throwError("provider is required to use ENS name as contract address", Logger.errors.UNSUPPORTED_OPERATION, {
26295
25935
  operation: "new Contract"
26296
25936
  });
26297
25937
  }
@@ -26305,7 +25945,7 @@ class BaseContract {
26305
25945
  // Check that the signature is unique; if not the ABI generation has
26306
25946
  // not been cleaned or may be incorrectly generated
26307
25947
  if (uniqueSignatures[signature]) {
26308
- logger$1.warn(`Duplicate ABI entry for ${JSON.stringify(signature)}`);
25948
+ logger.warn(`Duplicate ABI entry for ${JSON.stringify(signature)}`);
26309
25949
  return;
26310
25950
  }
26311
25951
  uniqueSignatures[signature] = true;
@@ -26394,7 +26034,7 @@ class BaseContract {
26394
26034
  // Otherwise, poll for our code to be deployed
26395
26035
  this._deployedPromise = this.provider.getCode(this.address, blockTag).then((code) => {
26396
26036
  if (code === "0x") {
26397
- logger$1.throwError("contract not deployed", Logger.errors.UNSUPPORTED_OPERATION, {
26037
+ logger.throwError("contract not deployed", Logger.errors.UNSUPPORTED_OPERATION, {
26398
26038
  contractAddress: this.address,
26399
26039
  operation: "getDeployed"
26400
26040
  });
@@ -26411,14 +26051,14 @@ class BaseContract {
26411
26051
  // estimateDeploy(bytecode: string, ...args): Promise<BigNumber>
26412
26052
  fallback(overrides) {
26413
26053
  if (!this.signer) {
26414
- logger$1.throwError("sending a transactions require a signer", Logger.errors.UNSUPPORTED_OPERATION, { operation: "sendTransaction(fallback)" });
26054
+ logger.throwError("sending a transactions require a signer", Logger.errors.UNSUPPORTED_OPERATION, { operation: "sendTransaction(fallback)" });
26415
26055
  }
26416
26056
  const tx = shallowCopy(overrides || {});
26417
26057
  ["from", "to"].forEach(function (key) {
26418
26058
  if (tx[key] == null) {
26419
26059
  return;
26420
26060
  }
26421
- logger$1.throwError("cannot override " + key, Logger.errors.UNSUPPORTED_OPERATION, { operation: key });
26061
+ logger.throwError("cannot override " + key, Logger.errors.UNSUPPORTED_OPERATION, { operation: key });
26422
26062
  });
26423
26063
  tx.to = this.resolvedAddress;
26424
26064
  return this.deployed().then(() => {
@@ -26521,7 +26161,7 @@ class BaseContract {
26521
26161
  }
26522
26162
  _addEventListener(runningEvent, listener, once) {
26523
26163
  if (!this.provider) {
26524
- logger$1.throwError("events require a provider or a signer with a provider", Logger.errors.UNSUPPORTED_OPERATION, { operation: "once" });
26164
+ logger.throwError("events require a provider or a signer with a provider", Logger.errors.UNSUPPORTED_OPERATION, { operation: "once" });
26525
26165
  }
26526
26166
  runningEvent.addListener(listener, once);
26527
26167
  // Track this running event and its listeners (may already be there; but no hard in updating)
@@ -26561,7 +26201,7 @@ class BaseContract {
26561
26201
  const filter = shallowCopy(runningEvent.filter);
26562
26202
  if (typeof (fromBlockOrBlockhash) === "string" && isHexString(fromBlockOrBlockhash, 32)) {
26563
26203
  if (toBlock != null) {
26564
- logger$1.throwArgumentError("cannot specify toBlock with blockhash", "toBlock", toBlock);
26204
+ logger.throwArgumentError("cannot specify toBlock with blockhash", "toBlock", toBlock);
26565
26205
  }
26566
26206
  filter.blockHash = fromBlockOrBlockhash;
26567
26207
  }
@@ -26651,31 +26291,6 @@ class BaseContract {
26651
26291
  class Contract extends BaseContract {
26652
26292
  }
26653
26293
 
26654
- const version = "units/5.7.0";
26655
-
26656
- const logger = new Logger(version);
26657
- const names = [
26658
- "wei",
26659
- "kwei",
26660
- "mwei",
26661
- "gwei",
26662
- "szabo",
26663
- "finney",
26664
- "ether",
26665
- ];
26666
- function parseUnits(value, unitName) {
26667
- if (typeof (value) !== "string") {
26668
- logger.throwArgumentError("value must be a string", "value", value);
26669
- }
26670
- if (typeof (unitName) === "string") {
26671
- const index = names.indexOf(unitName);
26672
- if (index !== -1) {
26673
- unitName = 3 * index;
26674
- }
26675
- }
26676
- return parseFixed(value, (unitName != null) ? unitName : 18);
26677
- }
26678
-
26679
26294
  /* eslint-disable @typescript-eslint/naming-convention */
26680
26295
  /**
26681
26296
  * @constant {string} ETH_SEPOLIA_CHAIN_ID - The chain ID for the Ethereum Sepolia testnet (EIP-155 compatible format).
@@ -26697,6 +26312,10 @@ const ZKEVM_TESTNET_CHAIN_ID = '13473';
26697
26312
  * @constant {string} ZKEVM_MAINNET_CHAIN_ID - The chain ID for the zkEVM mainnet (EIP-155 compatible format).
26698
26313
  */
26699
26314
  const ZKEVM_MAINNET_CHAIN_ID = '13371'; // @TODO confirm this is still correct
26315
+ /**
26316
+ * @constant {string} CHILD_CHAIN_NATIVE_TOKEN_ADDRESS - Address of the native token on the child chain.
26317
+ */
26318
+ const ETHEREUM_NATIVE_TOKEN_ADDRESS = '0x0000000000000000000000000000000000000eee';
26700
26319
  /**
26701
26320
  * @constant {BridgeInstance} ETH_SEPOLIA_TO_ZKEVM_DEVNET - A bridge instance configuration for bridging between
26702
26321
  * the Ethereum Sepolia testnet and the zkEVM devnet.
@@ -29036,6 +28655,7 @@ var BridgeErrorType;
29036
28655
  BridgeErrorType["AXELAR_GAS_ESTIMATE_FAILED"] = "AXELAR_GAS_ESTIMATE_FAILED";
29037
28656
  BridgeErrorType["INVALID_RECIPIENT"] = "INVALID_RECIPIENT";
29038
28657
  BridgeErrorType["FLOW_RATE_ERROR"] = "FLOW_RATE_ERROR";
28658
+ BridgeErrorType["INVALID_FLOWRATE_INDEX"] = "INVALID_FLOWRATE_INDEX";
29039
28659
  })(BridgeErrorType || (BridgeErrorType = {}));
29040
28660
  /**
29041
28661
  * Represents a custom error for bridge operations.
@@ -30975,6 +30595,7 @@ class TokenBridge {
30975
30595
  }, BridgeErrorType.INTERNAL_ERROR);
30976
30596
  }
30977
30597
  const flowRatePromises = [];
30598
+ const flowRateLengthPromises = [];
30978
30599
  const flowRatePromisesReceivers = [];
30979
30600
  for (let i = 0, l = statusResponses.length; i < l; i++) {
30980
30601
  let metaStatus;
@@ -31022,26 +30643,40 @@ class TokenBridge {
31022
30643
  ...txItem,
31023
30644
  token: decodedData[1],
31024
30645
  sender: decodedData[2],
31025
- receiver: decodedData[3],
30646
+ recipient: decodedData[3],
31026
30647
  amount: decodedData[4],
31027
30648
  };
31028
30649
  }
31029
- let flowRatePromiseIndex;
30650
+ let flowRatePromiseIndex = flowRatePromisesReceivers.findIndex((el) => el === txItem.recipient);
31030
30651
  if (metaStatus === StatusResponse.COMPLETE
31031
- && isWithdraw && txItem.receiver) {
30652
+ && isWithdraw && txItem.recipient) {
31032
30653
  // consolidate the calls we have to make to the flow rate by receiver
31033
- if (!flowRatePromisesReceivers.includes(txItem.receiver)) {
31034
- flowRatePromises.push(rootBridge.getPendingWithdrawals(txItem.receiver, [0]));
31035
- flowRatePromisesReceivers.push(txItem.receiver);
30654
+ if (flowRatePromiseIndex === -1) {
30655
+ flowRatePromisesReceivers.push(txItem.recipient);
31036
30656
  flowRatePromiseIndex = flowRatePromisesReceivers.length - 1;
31037
30657
  }
31038
- else {
31039
- flowRatePromiseIndex = flowRatePromisesReceivers.findIndex((el) => el === txItem.receiver);
31040
- }
31041
30658
  txItem.data.flowRatePromiseIndex = flowRatePromiseIndex;
31042
30659
  }
31043
30660
  txStatusResponse.transactions.push(txItem);
31044
30661
  } // for
30662
+ for (const flowRateReceiver of flowRatePromisesReceivers) {
30663
+ flowRateLengthPromises.push(rootBridge.getPendingWithdrawalsLength(flowRateReceiver));
30664
+ }
30665
+ let flowRateLengthResponses = [];
30666
+ try {
30667
+ flowRateLengthResponses = await Promise.all(flowRateLengthPromises);
30668
+ }
30669
+ catch (err) {
30670
+ throw new BridgeError(`Failed to fetch the Flow Rate pending lengths with the reason: ${err}`, BridgeErrorType.FLOW_RATE_ERROR);
30671
+ }
30672
+ for (let i = 0, l = flowRatePromisesReceivers.length; i < l; i++) {
30673
+ const indices = [];
30674
+ const indicesLength = flowRateLengthResponses[i].toNumber();
30675
+ for (let j = 0; j < indicesLength; j++) {
30676
+ indices.push(j);
30677
+ }
30678
+ flowRatePromises.push(rootBridge.getPendingWithdrawals(flowRatePromisesReceivers[i], indices));
30679
+ }
31045
30680
  let flowRateResponses = [];
31046
30681
  if (flowRatePromises.length > 0) {
31047
30682
  try {
@@ -31076,33 +30711,49 @@ class TokenBridge {
31076
30711
  * @throws {BridgeError} - If an error occurs during the query, a BridgeError will be thrown with a specific error type.
31077
30712
  * @dev this SDK method is currently stubbed
31078
30713
  */
31079
- async getFlowRateInfo(req = {}) {
31080
- // eslint-disable-next-line no-console
31081
- console.log('stubbed response with req', req);
30714
+ async getFlowRateInfo(req) {
30715
+ if (!req.tokens || req.tokens.length === 0) {
30716
+ throw new BridgeError(`invalid tokens array ${req.tokens}`, BridgeErrorType.INVALID_TOKEN);
30717
+ }
30718
+ const rootBridge = await withBridgeError(async () => {
30719
+ const contract = new Contract(this.config.bridgeContracts.rootERC20BridgeFlowRate, ROOT_ERC20_BRIDGE_FLOW_RATE, this.config.rootProvider);
30720
+ return contract;
30721
+ }, BridgeErrorType.INTERNAL_ERROR);
30722
+ const contractPromises = [];
30723
+ contractPromises.push(rootBridge.withdrawalQueueActivated());
30724
+ contractPromises.push(rootBridge.withdrawalDelay());
30725
+ for (let token of req.tokens) {
30726
+ if (token.toUpperCase() === 'NATIVE') {
30727
+ token = ETHEREUM_NATIVE_TOKEN_ADDRESS;
30728
+ }
30729
+ contractPromises.push(rootBridge.flowRateBuckets(token));
30730
+ }
30731
+ let contractPromisesRes;
30732
+ try {
30733
+ contractPromisesRes = await Promise.all(contractPromises);
30734
+ }
30735
+ catch (err) {
30736
+ throw new BridgeError('unable to query contract for flowrate info', BridgeErrorType.INTERNAL_ERROR);
30737
+ }
30738
+ const tokensRes = {};
30739
+ // @note it's i + 2 because the first 2 promises are not token buckets
30740
+ for (let i = 0, l = req.tokens.length; i < l; i++) {
30741
+ tokensRes[req.tokens[i]] = {
30742
+ capacity: contractPromisesRes[i + 2].capacity,
30743
+ depth: contractPromisesRes[i + 2].depth,
30744
+ refillTime: contractPromisesRes[i + 2].refillTime.toNumber(),
30745
+ refillRate: contractPromisesRes[i + 2].refillRate,
30746
+ };
30747
+ }
31082
30748
  // Return the token mappings
31083
30749
  return {
31084
- withdrawalQueueActivated: false,
31085
- withdrawalDelay: 86400,
31086
- tokens: {
31087
- // eslint-disable-next-line @typescript-eslint/naming-convention
31088
- NATIVE: {
31089
- capacity: parseUnits('10', 18).toString(),
31090
- depth: parseUnits('10', 18).toString(),
31091
- refillTime: 1701227629,
31092
- refillRate: parseUnits('10', 18).toString(),
31093
- },
31094
- // eslint-disable-next-line @typescript-eslint/naming-convention
31095
- '0xF57e7e7C23978C3cAEC3C3548E3D615c346e79fF': {
31096
- capacity: parseUnits('10', 18).toString(),
31097
- depth: parseUnits('10', 18).toString(),
31098
- refillTime: 1701227629,
31099
- refillRate: parseUnits('10', 18).toString(),
31100
- },
31101
- },
30750
+ withdrawalQueueActivated: contractPromisesRes[0],
30751
+ withdrawalDelay: contractPromisesRes[1].toNumber(),
30752
+ tokens: tokensRes,
31102
30753
  };
31103
30754
  }
31104
30755
  /**
31105
- * Queries the status of a bridge transaction.
30756
+ * Fetches the pending withdrawals for a given address.
31106
30757
  *
31107
30758
  * @param {PendingWithdrawalsRequest} req - The request object containing the reciever address.
31108
30759
  * @returns {Promise<PendingWithdrawalsResponse>} - A promise that resolves to an object containing the child token address.
@@ -31111,25 +30762,46 @@ class TokenBridge {
31111
30762
  */
31112
30763
  async getPendingWithdrawals(req) {
31113
30764
  // eslint-disable-next-line no-console
31114
- console.log('stubbed response with req', req);
31115
- return {
31116
- pending: [{
31117
- canWithdraw: true,
31118
- withdrawer: '0xEac347177DbA4a190B632C7d9b8da2AbfF57c772',
31119
- token: '0xF57e7e7C23978C3cAEC3C3548E3D615c346e79fF',
31120
- amount: parseUnits('1', 18).toString(),
31121
- timeoutStart: 1698502429,
31122
- timeoutEnd: 1701227629,
31123
- },
31124
- {
31125
- canWithdraw: false,
31126
- withdrawer: '0xEac347177DbA4a190B632C7d9b8da2AbfF57c772',
31127
- token: '0xF57e7e7C23978C3cAEC3C3548E3D615c346e79fF',
31128
- amount: parseUnits('2', 18).toString(),
31129
- timeoutStart: 1698416029,
31130
- timeoutEnd: 1698502429,
31131
- }],
30765
+ if (!req.recipient) {
30766
+ throw new BridgeError(`invalid recipient ${req.recipient}`, BridgeErrorType.INVALID_RECIPIENT);
30767
+ }
30768
+ const rootBridge = await withBridgeError(async () => {
30769
+ const contract = new Contract(this.config.bridgeContracts.rootERC20BridgeFlowRate, ROOT_ERC20_BRIDGE_FLOW_RATE, this.config.rootProvider);
30770
+ return contract;
30771
+ }, BridgeErrorType.INTERNAL_ERROR);
30772
+ const pendingLength = await rootBridge.getPendingWithdrawalsLength(req.recipient);
30773
+ const pendingWithdrawals = {
30774
+ pending: [],
31132
30775
  };
30776
+ if (pendingLength.toNumber() === 0) {
30777
+ return pendingWithdrawals;
30778
+ }
30779
+ const indices = [];
30780
+ for (let i = 0; i < pendingLength.toNumber(); i++) {
30781
+ indices.push(i);
30782
+ }
30783
+ const pending = await rootBridge.getPendingWithdrawals(req.recipient, indices);
30784
+ const timestampNow = Math.floor(Date.now() / 1000);
30785
+ const withdrawalDelay = await rootBridge.withdrawalDelay();
30786
+ for (let i = 0, l = pending.length; i < l; i++) {
30787
+ const timeoutEnd = pending[i].timestamp.add(withdrawalDelay).toNumber();
30788
+ if (timeoutEnd > timestampNow) {
30789
+ pendingWithdrawals.pending[i] = {
30790
+ canWithdraw: false,
30791
+ };
30792
+ }
30793
+ else {
30794
+ pendingWithdrawals.pending[i] = {
30795
+ canWithdraw: true,
30796
+ };
30797
+ }
30798
+ pendingWithdrawals.pending[i].withdrawer = pending[i].withdrawer;
30799
+ pendingWithdrawals.pending[i].token = pending[i].token;
30800
+ pendingWithdrawals.pending[i].amount = pending[i].amount;
30801
+ pendingWithdrawals.pending[i].timeoutStart = pending[i].timestamp.toNumber();
30802
+ pendingWithdrawals.pending[i].timeoutEnd = timeoutEnd;
30803
+ }
30804
+ return pendingWithdrawals;
31133
30805
  }
31134
30806
  /**
31135
30807
  * Retrieves the unsigned flow rate withdrawal transaction
@@ -31141,12 +30813,54 @@ class TokenBridge {
31141
30813
  */
31142
30814
  async getFlowRateWithdrawTx(req) {
31143
30815
  // eslint-disable-next-line no-console
31144
- console.log('stubbed response with req', req);
30816
+ if (!req.recipient) {
30817
+ throw new BridgeError(`invalid recipient ${req.recipient}`, BridgeErrorType.INVALID_RECIPIENT);
30818
+ }
30819
+ if (req.index < 0) {
30820
+ throw new BridgeError(`invalid index ${req.index}`, BridgeErrorType.INVALID_FLOWRATE_INDEX);
30821
+ }
30822
+ const rootBridge = await withBridgeError(async () => {
30823
+ const contract = new Contract(this.config.bridgeContracts.rootERC20BridgeFlowRate, ROOT_ERC20_BRIDGE_FLOW_RATE, this.config.rootProvider);
30824
+ return contract;
30825
+ }, BridgeErrorType.INTERNAL_ERROR);
30826
+ const pending = await rootBridge.getPendingWithdrawals(req.recipient, [req.index]);
30827
+ if (pending[0].withdrawer === AddressZero
30828
+ || pending[0].token === AddressZero
30829
+ || pending[0].amount === BigNumber.from(0)
30830
+ || pending[0].timestamp === BigNumber.from(0)) {
30831
+ throw new BridgeError(`pending withdrawal not found for ${req.recipient} at index ${req.index}`, BridgeErrorType.FLOW_RATE_ERROR);
30832
+ }
30833
+ const withdrawalDelay = await rootBridge.withdrawalDelay();
30834
+ const timeoutEnd = pending[0].timestamp.add(withdrawalDelay).toNumber();
30835
+ const timestampNow = Math.floor(Date.now() / 1000);
30836
+ if (timeoutEnd > timestampNow) {
30837
+ return {
30838
+ pendingWithdrawal: {
30839
+ canWithdraw: false,
30840
+ withdrawer: pending[0].withdrawer,
30841
+ token: pending[0].token,
30842
+ amount: pending[0].amount,
30843
+ timeoutStart: pending[0].timestamp.toNumber(),
30844
+ timeoutEnd,
30845
+ },
30846
+ unsignedTx: null,
30847
+ };
30848
+ }
30849
+ const data = await withBridgeError(async () => rootBridge.interface.encodeFunctionData('finaliseQueuedWithdrawal', [req.recipient, req.index]), BridgeErrorType.INTERNAL_ERROR);
31145
30850
  return {
30851
+ pendingWithdrawal: {
30852
+ canWithdraw: true,
30853
+ withdrawer: pending[0].withdrawer,
30854
+ token: pending[0].token,
30855
+ amount: pending[0].amount,
30856
+ timeoutStart: pending[0].timestamp.toNumber(),
30857
+ timeoutEnd,
30858
+ },
31146
30859
  unsignedTx: {
31147
- data: 'stubbed flow rate withdrawal data',
31148
- to: '0x0',
30860
+ data,
30861
+ to: this.config.bridgeContracts.rootERC20BridgeFlowRate,
31149
30862
  value: 0,
30863
+ chainId: parseInt(this.config.bridgeInstance.rootChainID, 10),
31150
30864
  },
31151
30865
  };
31152
30866
  }
@@ -31200,17 +30914,26 @@ const CONTRACTS_FOR_BRIDGE = new Map()
31200
30914
  .set(ETH_SEPOLIA_TO_ZKEVM_DEVNET, {
31201
30915
  rootERC20BridgeFlowRate: '0x0',
31202
30916
  childERC20Bridge: '0x0',
31203
- wrappedIMX: '0x0',
30917
+ rootChainIMX: '0x0',
30918
+ rootChainWrappedETH: '0x0',
30919
+ childChainWrappedETH: '0x0',
30920
+ childChainWrappedIMX: '0x0',
31204
30921
  })
31205
30922
  .set(ETH_SEPOLIA_TO_ZKEVM_TESTNET, {
31206
30923
  rootERC20BridgeFlowRate: '0x0D3C59c779Fd552C27b23F723E80246c840100F5',
31207
30924
  childERC20Bridge: '0x0D3C59c779Fd552C27b23F723E80246c840100F5',
31208
- wrappedIMX: '0x1CcCa691501174B4A623CeDA58cC8f1a76dc3439',
30925
+ rootChainIMX: '0xe2629e08f4125d14e446660028bD98ee60EE69F2',
30926
+ rootChainWrappedETH: '0x7b79995e5f793A07Bc00c21412e50Ecae098E7f9',
30927
+ childChainWrappedETH: '0xe9E96d1aad82562b7588F03f49aD34186f996478',
30928
+ childChainWrappedIMX: '0x1CcCa691501174B4A623CeDA58cC8f1a76dc3439',
31209
30929
  })
31210
30930
  .set(ETH_MAINNET_TO_ZKEVM_MAINNET, {
31211
- rootERC20BridgeFlowRate: '0x0',
31212
- childERC20Bridge: '0x0',
31213
- wrappedIMX: '0x0',
30931
+ rootERC20BridgeFlowRate: '0xBa5E35E26Ae59c7aea6F029B68c6460De2d13eB6',
30932
+ childERC20Bridge: '0xBa5E35E26Ae59c7aea6F029B68c6460De2d13eB6',
30933
+ rootChainIMX: '0xF57e7e7C23978C3cAEC3C3548E3D615c346e79fF',
30934
+ rootChainWrappedETH: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
30935
+ childChainWrappedETH: '0x52a6c53869ce09a731cd772f245b97a4401d3348',
30936
+ childChainWrappedIMX: '0x3a0c2ba54d6cbd3121f01b96dfd20e99d1696c9d',
31214
30937
  });
31215
30938
  /**
31216
30939
  * Represents the configuration for a bridge between two chains.
@@ -31573,134 +31296,6 @@ class ERC20__factory {
31573
31296
  /* tslint:disable */
31574
31297
  /* eslint-disable */
31575
31298
  const _abi$2 = [
31576
- {
31577
- inputs: [],
31578
- name: "getCurrentBlockTimestamp",
31579
- outputs: [
31580
- {
31581
- internalType: "uint256",
31582
- name: "timestamp",
31583
- type: "uint256",
31584
- },
31585
- ],
31586
- stateMutability: "view",
31587
- type: "function",
31588
- },
31589
- {
31590
- inputs: [
31591
- {
31592
- internalType: "address",
31593
- name: "addr",
31594
- type: "address",
31595
- },
31596
- ],
31597
- name: "getEthBalance",
31598
- outputs: [
31599
- {
31600
- internalType: "uint256",
31601
- name: "balance",
31602
- type: "uint256",
31603
- },
31604
- ],
31605
- stateMutability: "view",
31606
- type: "function",
31607
- },
31608
- {
31609
- inputs: [
31610
- {
31611
- components: [
31612
- {
31613
- internalType: "address",
31614
- name: "target",
31615
- type: "address",
31616
- },
31617
- {
31618
- internalType: "uint256",
31619
- name: "gasLimit",
31620
- type: "uint256",
31621
- },
31622
- {
31623
- internalType: "bytes",
31624
- name: "callData",
31625
- type: "bytes",
31626
- },
31627
- ],
31628
- internalType: "struct UniswapInterfaceMulticall.Call[]",
31629
- name: "calls",
31630
- type: "tuple[]",
31631
- },
31632
- ],
31633
- name: "multicall",
31634
- outputs: [
31635
- {
31636
- internalType: "uint256",
31637
- name: "blockNumber",
31638
- type: "uint256",
31639
- },
31640
- {
31641
- components: [
31642
- {
31643
- internalType: "bool",
31644
- name: "success",
31645
- type: "bool",
31646
- },
31647
- {
31648
- internalType: "uint256",
31649
- name: "gasUsed",
31650
- type: "uint256",
31651
- },
31652
- {
31653
- internalType: "bytes",
31654
- name: "returnData",
31655
- type: "bytes",
31656
- },
31657
- ],
31658
- internalType: "struct UniswapInterfaceMulticall.Result[]",
31659
- name: "returnData",
31660
- type: "tuple[]",
31661
- },
31662
- ],
31663
- stateMutability: "nonpayable",
31664
- type: "function",
31665
- },
31666
- ];
31667
- const _bytecode$2 = "0x608060405234801561001057600080fd5b50610567806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80630f28c97d146100465780631749e1e3146100645780634d2301cc14610085575b600080fd5b61004e610098565b60405161005b919061041f565b60405180910390f35b6100776100723660046102a7565b61009c565b60405161005b929190610428565b61004e610093366004610286565b610220565b4290565b8051439060609067ffffffffffffffff811180156100b957600080fd5b506040519080825280602002602001820160405280156100f357816020015b6100e061023a565b8152602001906001900390816100d85790505b50905060005b835181101561021a57600080600086848151811061011357fe5b60200260200101516000015187858151811061012b57fe5b60200260200101516020015188868151811061014357fe5b60200260200101516040015192509250925060005a90506000808573ffffffffffffffffffffffffffffffffffffffff1685856040516101839190610403565b60006040518083038160008787f1925050503d80600081146101c1576040519150601f19603f3d011682016040523d82523d6000602084013e6101c6565b606091505b509150915060005a8403905060405180606001604052808415158152602001828152602001838152508989815181106101fb57fe5b60200260200101819052505050505050505080806001019150506100f9565b50915091565b73ffffffffffffffffffffffffffffffffffffffff163190565b604051806060016040528060001515815260200160008152602001606081525090565b803573ffffffffffffffffffffffffffffffffffffffff8116811461028157600080fd5b919050565b600060208284031215610297578081fd5b6102a08261025d565b9392505050565b600060208083850312156102b9578182fd5b823567ffffffffffffffff808211156102d0578384fd5b818501915085601f8301126102e3578384fd5b8135818111156102ef57fe5b6102fc8485830201610506565b81815284810190848601875b848110156103f457813587017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0606081838f03011215610346578a8bfd5b60408051606081018181108b8211171561035c57fe5b8252610369848d0161025d565b8152818401358c82015260608401358a811115610384578d8efd5b8085019450508e603f850112610398578c8dfd5b8b8401358a8111156103a657fe5b6103b68d85601f84011601610506565b93508084528f838287010111156103cb578d8efd5b808386018e86013783018c018d9052908101919091528552509287019290870190600101610308565b50909998505050505050505050565b6000825161041581846020870161052a565b9190910192915050565b90815260200190565b600060408083018584526020828186015281865180845260609350838701915083838202880101838901875b838110156104f6578983037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa001855281518051151584528681015187850152880151888401889052805188850181905260806104b582828801858c0161052a565b96880196601f919091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01694909401909301925090850190600101610454565b50909a9950505050505050505050565b60405181810167ffffffffffffffff8111828210171561052257fe5b604052919050565b60005b8381101561054557818101518382015260200161052d565b83811115610554576000848401525b5050505056fea164736f6c6343000706000a";
31668
- const isSuperArgs$2 = (xs) => xs.length > 1;
31669
- class Multicall__factory extends ethers.ContractFactory {
31670
- constructor(...args) {
31671
- if (isSuperArgs$2(args)) {
31672
- super(...args);
31673
- }
31674
- else {
31675
- super(_abi$2, _bytecode$2, args[0]);
31676
- }
31677
- }
31678
- deploy(overrides) {
31679
- return super.deploy(overrides || {});
31680
- }
31681
- getDeployTransaction(overrides) {
31682
- return super.getDeployTransaction(overrides || {});
31683
- }
31684
- attach(address) {
31685
- return super.attach(address);
31686
- }
31687
- connect(signer) {
31688
- return super.connect(signer);
31689
- }
31690
- static bytecode = _bytecode$2;
31691
- static abi = _abi$2;
31692
- static createInterface() {
31693
- return new ethers.utils.Interface(_abi$2);
31694
- }
31695
- static connect(address, signerOrProvider) {
31696
- return new ethers.Contract(address, _abi$2, signerOrProvider);
31697
- }
31698
- }
31699
-
31700
- /* Autogenerated file. Do not edit manually. */
31701
- /* tslint:disable */
31702
- /* eslint-disable */
31703
- const _abi$1 = [
31704
31299
  {
31705
31300
  inputs: [
31706
31301
  {
@@ -31984,7 +31579,7 @@ const _abi$1 = [
31984
31579
  type: "uint256",
31985
31580
  },
31986
31581
  ],
31987
- internalType: "struct ISecondaryFee.SecondaryFeeParams[]",
31582
+ internalType: "struct IImmutableSwapProxy.SecondaryFeeParams[]",
31988
31583
  name: "secondaryFees",
31989
31584
  type: "tuple[]",
31990
31585
  },
@@ -32057,7 +31652,7 @@ const _abi$1 = [
32057
31652
  type: "uint256",
32058
31653
  },
32059
31654
  ],
32060
- internalType: "struct ISecondaryFee.SecondaryFeeParams[]",
31655
+ internalType: "struct IImmutableSwapProxy.SecondaryFeeParams[]",
32061
31656
  name: "secondaryFees",
32062
31657
  type: "tuple[]",
32063
31658
  },
@@ -32115,7 +31710,7 @@ const _abi$1 = [
32115
31710
  type: "uint256",
32116
31711
  },
32117
31712
  ],
32118
- internalType: "struct ISecondaryFee.SecondaryFeeParams[]",
31713
+ internalType: "struct IImmutableSwapProxy.SecondaryFeeParams[]",
32119
31714
  name: "secondaryFees",
32120
31715
  type: "tuple[]",
32121
31716
  },
@@ -32166,7 +31761,7 @@ const _abi$1 = [
32166
31761
  outputs: [
32167
31762
  {
32168
31763
  internalType: "uint256",
32169
- name: "",
31764
+ name: "amountIn",
32170
31765
  type: "uint256",
32171
31766
  },
32172
31767
  ],
@@ -32188,7 +31783,7 @@ const _abi$1 = [
32188
31783
  type: "uint256",
32189
31784
  },
32190
31785
  ],
32191
- internalType: "struct ISecondaryFee.SecondaryFeeParams[]",
31786
+ internalType: "struct IImmutableSwapProxy.SecondaryFeeParams[]",
32192
31787
  name: "secondaryFees",
32193
31788
  type: "tuple[]",
32194
31789
  },
@@ -32224,7 +31819,7 @@ const _abi$1 = [
32224
31819
  outputs: [
32225
31820
  {
32226
31821
  internalType: "uint256",
32227
- name: "",
31822
+ name: "amountIn",
32228
31823
  type: "uint256",
32229
31824
  },
32230
31825
  ],
@@ -32466,15 +32061,15 @@ const _abi$1 = [
32466
32061
  type: "receive",
32467
32062
  },
32468
32063
  ];
32469
- const _bytecode$1 = "0x60806040523480156200001157600080fd5b50604051620031e1380380620031e183398101604081905262000034916200015c565b6001805460ff191690556200004b6000846200009e565b600180546001600160a01b039384166101008102610100600160a81b03199092169190911790915560038054929093166001600160a01b03199283161790925560028054909116909117905550620001a6565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166200013b576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620000fa3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b80516001600160a01b03811681146200015757600080fd5b919050565b6000806000606084860312156200017257600080fd5b6200017d846200013f565b92506200018d602085016200013f565b91506200019d604085016200013f565b90509250925092565b61302b80620001b66000396000f3fe6080604052600436106101175760003560e01c806358e81a50116100a05780638456cb59116100645780638456cb59146102c457806391d14854146102d9578063a217fddf146102f9578063ac9650d81461030e578063d547741f1461032e57600080fd5b806358e81a50146102465780635ae401dc146102595780635c975abb146102795780635ebca7991461029157806368742da6146102a457600080fd5b80632f2ff15d116100e75780632f2ff15d146101cb57806336568abe146101eb578063383ebb0b1461020b5780633f4ba83a1461021e5780635640f6591461023357600080fd5b80620fa9fb1461012357806301ffc9a714610145578063116944b21461017a578063248a9ca31461019b57600080fd5b3661011e57005b600080fd5b34801561012f57600080fd5b5061014361013e3660046127c3565b61034e565b005b34801561015157600080fd5b506101656101603660046127fc565b61041a565b60405190151581526020015b60405180910390f35b61018d61018836600461298d565b610451565b604051908152602001610171565b3480156101a757600080fd5b5061018d6101b63660046129e2565b60009081526020819052604090206001015490565b3480156101d757600080fd5b506101436101e63660046129fb565b6106d3565b3480156101f757600080fd5b506101436102063660046129fb565b6106f8565b61018d610219366004612ae3565b61077b565b34801561022a57600080fd5b50610143610ae7565b61018d610241366004612ae3565b610b37565b61018d61025436600461298d565b610db2565b61026c610267366004612b8f565b6110e4565b6040516101719190612c2a565b34801561028557600080fd5b5060015460ff16610165565b61014361029f3660046129e2565b611119565b3480156102b057600080fd5b506101436102bf366004612c8c565b611266565b3480156102d057600080fd5b506101436112e1565b3480156102e557600080fd5b506101656102f43660046129fb565b61132f565b34801561030557600080fd5b5061018d600081565b34801561031a57600080fd5b5061026c610329366004612ca9565b611358565b34801561033a57600080fd5b506101436103493660046129fb565b61144c565b6103787f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e9828693361132f565b610394576040516282b42960e81b815260040160405180910390fd5b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa1580156103db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ff9190612cea565b90506104156001600160a01b0383168483611471565b505050565b60006001600160e01b03198216637965db0b60e01b148061044b57506301ffc9a760e01b6001600160e01b03198316145b92915050565b600061045f60015460ff1690565b1561047d5760405163ab35696f60e01b815260040160405180910390fd5b61048a82606001516114d4565b6104a75760405163519bdea760e01b815260040160405180910390fd5b4780156105e757826080015181146104d2576040516342f7487960e11b815260040160405180910390fd5b60035483516001600160a01b03908116911614610502576040516324d0121760e01b815260040160405180910390fd5b61056283608001518686808060200260200160405190810160405280939291908181526020016000905b828210156105585761054960408302860136819003810190612d03565b8152602001906001019061052c565b50505050506114fa565b608084018190526001546040516304e45aaf60e01b81526101009091046001600160a01b0316916304e45aaf9161059d908790600401612d5a565b60206040518083038185885af11580156105bb573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906105e09190612cea565b91506106cb565b61064c836000015184608001518787808060200260200160405190810160405280939291908181526020016000905b828210156106425761063360408302860136819003810190612d03565b81526020019060010190610616565b505050505061154c565b60808401526001546040516304e45aaf60e01b81526101009091046001600160a01b0316906304e45aaf90610685908690600401612d5a565b6020604051808303816000875af11580156106a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c89190612cea565b91505b509392505050565b6000828152602081905260409020600101546106ee816115a9565b61041583836115b3565b6001600160a01b038116331461076d5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6107778282611637565b5050565b600061078960015460ff1690565b156107a75760405163ab35696f60e01b815260040160405180910390fd5b6107b482602001516114d4565b6107d15760405163519bdea760e01b815260040160405180910390fd5b60006107e0836000015161169c565b9050478015610992576003546001600160a01b03838116911614610817576040516324d0121760e01b815260040160405180910390fd5b8360600151811461083b576040516342f7487960e11b815260040160405180910390fd5b60008061089e86606001518989808060200260200160405190810160405280939291908181526020016000905b828210156108945761088560408302860136819003810190612d03565b81526020019060010190610868565b50505050506116ca565b606088018190526001546040516304dc09a360e11b81529294509092506000916101009091046001600160a01b0316906309b813469084906108e4908b90600401612e00565b60206040518083038185885af1158015610902573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109279190612cea565b905061098681848b8b808060200260200160405190810160405280939291908181526020016000905b8282101561097c5761096d60408302860136819003810190612d03565b81526020019060010190610950565b505050505061171d565b95505050505050610ae0565b6000806109f68487606001518a8a808060200260200160405190810160405280939291908181526020016000905b828210156109ec576109dd60408302860136819003810190612d03565b815260200190600101906109c0565b5050505050611811565b606088018190526001546040516304dc09a360e11b81529294509092506000916101009091046001600160a01b0316906309b8134690610a3a908a90600401612e00565b6020604051808303816000875af1158015610a59573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7d9190612cea565b90506109868582858c8c808060200260200160405190810160405280939291908181526020016000905b82821015610ad357610ac460408302860136819003810190612d03565b81526020019060010190610aa7565b505050505061186b565b50505b9392505050565b610b117fe7276a2a84d8de556657ec9cf93a55a7d66f096e529d0582ed08e9e2208b92b53361132f565b610b2d576040516282b42960e81b815260040160405180910390fd5b610b356118c7565b565b6000610b4560015460ff1690565b15610b635760405163ab35696f60e01b815260040160405180910390fd5b610b7082602001516114d4565b610b8d5760405163519bdea760e01b815260040160405180910390fd5b6000610b9c8360000151611919565b9050478015610cd25783604001518114610bc9576040516342f7487960e11b815260040160405180910390fd5b6003546001600160a01b03838116911614610bf7576040516324d0121760e01b815260040160405180910390fd5b610c4d84604001518787808060200260200160405190810160405280939291908181526020016000905b8282101561055857610c3e60408302860136819003810190612d03565b81526020019060010190610c21565b6040858101829052600154905163b858183f60e01b81526101009091046001600160a01b03169163b858183f91610c88908890600401612e00565b60206040518083038185885af1158015610ca6573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ccb9190612cea565b9250610add565b610d298285604001518888808060200260200160405190810160405280939291908181526020016000905b8282101561064257610d1a60408302860136819003810190612d03565b81526020019060010190610cfd565b604085810191909152600154905163b858183f60e01b81526101009091046001600160a01b03169063b858183f90610d65908790600401612e00565b6020604051808303816000875af1158015610d84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610da89190612cea565b9695505050505050565b6000610dc060015460ff1690565b15610dde5760405163ab35696f60e01b815260040160405180910390fd5b610deb82606001516114d4565b610e085760405163519bdea760e01b815260040160405180910390fd5b478015610fa55760035483516001600160a01b03908116911614610e3f576040516324d0121760e01b815260040160405180910390fd5b8260a001518114610e63576040516342f7487960e11b815260040160405180910390fd5b600080610ebc8560a001518888808060200260200160405190810160405280939291908181526020016000905b8282101561089457610ead60408302860136819003810190612d03565b81526020019060010190610e90565b60a08701819052600154604051635023b4df60e01b81529294509092506000916101009091046001600160a01b031690635023b4df908490610f02908a90600401612d5a565b60206040518083038185885af1158015610f20573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f459190612cea565b9050610f9a81848a8a808060200260200160405190810160405280939291908181526020016000905b8282101561097c57610f8b60408302860136819003810190612d03565b81526020019060010190610f6e565b945050505050610ae0565b60008061100385600001518660a001518989808060200260200160405190810160405280939291908181526020016000905b828210156109ec57610ff460408302860136819003810190612d03565b81526020019060010190610fd7565b60a08701819052600154604051635023b4df60e01b81529294509092506000916101009091046001600160a01b031690635023b4df90611047908990600401612d5a565b6020604051808303816000875af1158015611066573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108a9190612cea565b9050610f9a866000015182858b8b808060200260200160405190810160405280939291908181526020016000905b82821015610ad3576110d560408302860136819003810190612d03565b815260200190600101906110b8565b6060834211156111075760405163387b2e5560e11b815260040160405180910390fd5b6111118383611358565b949350505050565b6003546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015611162573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111869190612cea565b9050818110156111cc5760405162461bcd60e51b8152602060048201526011602482015270092dce6eaccccd2c6d2cadce840ae929ab607b1b6044820152606401610764565b801561077757600354604051632e1a7d4d60e01b8152600481018390526001600160a01b0390911690632e1a7d4d90602401600060405180830381600087803b15801561121857600080fd5b505af115801561122c573d6000803e3d6000fd5b50505050600061123c3383611925565b905080610415576040516342fb4ceb60e11b81526004810184905260248101839052604401610764565b6112907f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e9828693361132f565b6112ac576040516282b42960e81b815260040160405180910390fd5b47156112de5760006112be8247611925565b90508061077757604051633398652560e11b815260040160405180910390fd5b50565b61130b7ffcb9fcbfa83b897fb2d5cf4b58962164105c1e71489a37ef3ae0db3fdce576f63361132f565b611327576040516282b42960e81b815260040160405180910390fd5b610b356119cf565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6060816001600160401b038111156113725761137261286a565b6040519080825280602002602001820160405280156113a557816020015b60608152602001906001900390816113905790505b50905060005b8281101561144557611415308585848181106113c9576113c9612e13565b90506020028101906113db9190612e29565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611a0a92505050565b82828151811061142757611427612e13565b6020026020010181905250808061143d90612e85565b9150506113ab565b5092915050565b600082815260208190526040902060010154611467816115a9565b6104158383611637565b6040516001600160a01b03831660248201526044810182905261041590849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611a2f565b60006001600160a01b03821633148061044b57506001600160a01b038216301492915050565b600061150582611b04565b506000806115138585611b77565b90925090506115228286612e9e565b945061152d81611ca0565b600354611543906001600160a01b031686611d7f565b50929392505050565b600061155782611b04565b506000806115658585611b77565b90925090506115748286612e9e565b94506115808682611e7c565b6115956001600160a01b038716333088611f85565b61159f8686611d7f565b5092949350505050565b6112de8133611fc3565b6115bd828261132f565b610777576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556115f33390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b611641828261132f565b15610777576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600080601483516116ad9190612e9e565b905060006116bd8483601461201c565b9050611111816000612129565b60008060006116d884611b04565b905060006116e882612710612eb1565b90506116f7866127108361218e565b600354909350611710906001600160a01b031684611d7f565b85935050505b9250929050565b600080600061172c8685611b77565b9150915061173981611ca0565b600260009054906101000a90046001600160a01b03166001600160a01b03166312210e8a6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561178957600080fd5b505af115801561179d573d6000803e3d6000fd5b5050505060008287876117b09190612e9e565b6117ba9190612e9e565b604051909150600090339083156108fc0290849084818181858888f193505050509050806117fb576040516382e4f46960e01b815260040160405180910390fd5b6118058489612eb1565b98975050505050505050565b600080600061181f84611b04565b9050600061182f82612710612eb1565b905061183e866127108361218e565b925061184a8784611d7f565b61185f6001600160a01b038816333089611f85565b50939590945092505050565b600080600061187a8685611b77565b9150915061188887826121ce565b6118b233836118978989612e9e565b6118a19190612e9e565b6001600160a01b038a169190611471565b6118bc8287612eb1565b979650505050505050565b6118cf6122d5565b6001805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600061044b8282612129565b6000814710156119775760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610764565b6040516001600160a01b038416908390600081818185875af1925050503d80600081146119c0576040519150601f19603f3d011682016040523d82523d6000602084013e6119c5565b606091505b5090949350505050565b6119d761231e565b6001805460ff1916811790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258336118fc565b6060610ae08383604051806060016040528060278152602001612fcf60279139612364565b6000611a84826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166123d29092919063ffffffff16565b9050805160001480611aa5575080806020019051810190611aa59190612ec4565b6104155760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610764565b6000805b8251811015611b4e57828181518110611b2357611b23612e13565b60200260200101516020015182611b3a9190612eb1565b915080611b4681612e85565b915050611b08565b506103e8811115611b725760405163cd4e616760e01b815260040160405180910390fd5b919050565b6000606082516001600160401b03811115611b9457611b9461286a565b604051908082528060200260200182016040528015611bd957816020015b6040805180820190915260008082526020820152815260200190600190039081611bb25790505b50905060005b8351811015611c98576000611c1e858381518110611bff57611bff612e13565b602002602001015160200151612710886123e19092919063ffffffff16565b90506040518060400160405280868481518110611c3d57611c3d612e13565b6020026020010151600001516001600160a01b0316815260200182815250838381518110611c6d57611c6d612e13565b6020908102919091010152611c828185612eb1565b9350508080611c9090612e85565b915050611bdf565b509250929050565b60005b8151811015610777576000828281518110611cc057611cc0612e13565b602002602001015190506000611cde82600001518360200151611925565b905080611d1557815160208301516040516208c3b360e61b81526001600160a01b0390921660048301526024820152604401610764565b81600001516001600160a01b0316336001600160a01b03167fe0e765ab26c1caf691c510426951246128b96830e49cc81d8c093fd551abac358460200151604051611d6291815260200190565b60405180910390a350508080611d7790612e85565b915050611ca3565b600154604051636eb1769f60e11b81523060048201526001600160a01b0361010090920482166024820152829184169063dd62ed3e90604401602060405180830381865afa158015611dd5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611df99190612cea565b10156107775760015460405163095ea7b360e01b81526101009091046001600160a01b039081166004830152600019602483015283169063095ea7b3906044016020604051808303816000875af1158015611e58573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104159190612ec4565b60005b815181101561041557611ee233838381518110611e9e57611e9e612e13565b602002602001015160000151848481518110611ebc57611ebc612e13565b602002602001015160200151866001600160a01b0316611f85909392919063ffffffff16565b818181518110611ef457611ef4612e13565b6020026020010151600001516001600160a01b0316336001600160a01b0316846001600160a01b03167f1f9a9fdac86b6ca3c5300bec0b61555cded1f1a234378602dcca6c27085eac8e858581518110611f5057611f50612e13565b602002602001015160200151604051611f6b91815260200190565b60405180910390a480611f7d81612e85565b915050611e7f565b6040516001600160a01b0380851660248301528316604482015260648101829052611fbd9085906323b872dd60e01b9060840161149d565b50505050565b611fcd828261132f565b61077757611fda81612483565b611fe5836020612495565b604051602001611ff6929190612ee6565b60408051601f198184030181529082905262461bcd60e51b825261076491600401612f5b565b60608161202a81601f612eb1565b10156120695760405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b6044820152606401610764565b6120738284612eb1565b845110156120b75760405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b6044820152606401610764565b6060821580156120d65760405191506000825260208201604052612120565b6040519150601f8416801560200281840101858101878315602002848b0101015b8183101561210f5780518352602092830192016120f7565b5050858452601f01601f1916604052505b50949350505050565b6000612136826014612eb1565b8351101561217e5760405162461bcd60e51b8152602060048201526015602482015274746f416464726573735f6f75744f66426f756e647360581b6044820152606401610764565b500160200151600160601b900490565b600061219b8484846123e1565b9050600082806121ad576121ad612f6e565b8486091115610ae05760001981106121c457600080fd5b6001019392505050565b60005b8151811015610415576122328282815181106121ef576121ef612e13565b60200260200101516000015183838151811061220d5761220d612e13565b602002602001015160200151856001600160a01b03166114719092919063ffffffff16565b81818151811061224457612244612e13565b6020026020010151600001516001600160a01b0316336001600160a01b0316846001600160a01b03167f1f9a9fdac86b6ca3c5300bec0b61555cded1f1a234378602dcca6c27085eac8e8585815181106122a0576122a0612e13565b6020026020010151602001516040516122bb91815260200190565b60405180910390a4806122cd81612e85565b9150506121d1565b60015460ff16610b355760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610764565b60015460ff1615610b355760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610764565b6060600080856001600160a01b0316856040516123819190612f84565b600060405180830381855af49150503d80600081146123bc576040519150601f19603f3d011682016040523d82523d6000602084013e6123c1565b606091505b5091509150610da886838387612630565b606061111184846000856126a9565b6000838302816000198587098281108382030391505080841161240357600080fd5b8060000361241657508290049050610ae0565b6000848688096000868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150509392505050565b606061044b6001600160a01b03831660145b606060006124a4836002612fa0565b6124af906002612eb1565b6001600160401b038111156124c6576124c661286a565b6040519080825280601f01601f1916602001820160405280156124f0576020820181803683370190505b509050600360fc1b8160008151811061250b5761250b612e13565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061253a5761253a612e13565b60200101906001600160f81b031916908160001a905350600061255e846002612fa0565b612569906001612eb1565b90505b60018111156125e1576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061259d5761259d612e13565b1a60f81b8282815181106125b3576125b3612e13565b60200101906001600160f81b031916908160001a90535060049490941c936125da81612fb7565b905061256c565b508315610ae05760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610764565b6060831561269f578251600003612698576001600160a01b0385163b6126985760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610764565b5081611111565b6111118383612779565b60608247101561270a5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610764565b600080866001600160a01b031685876040516127269190612f84565b60006040518083038185875af1925050503d8060008114612763576040519150601f19603f3d011682016040523d82523d6000602084013e612768565b606091505b50915091506118bc87838387612630565b8151156127895781518083602001fd5b8060405162461bcd60e51b81526004016107649190612f5b565b6001600160a01b03811681146112de57600080fd5b8035611b72816127a3565b600080604083850312156127d657600080fd5b82356127e1816127a3565b915060208301356127f1816127a3565b809150509250929050565b60006020828403121561280e57600080fd5b81356001600160e01b031981168114610ae057600080fd5b60008083601f84011261283857600080fd5b5081356001600160401b0381111561284f57600080fd5b6020830191508360208260061b850101111561171657600080fd5b634e487b7160e01b600052604160045260246000fd5b60405160e081016001600160401b03811182821017156128a2576128a261286a565b60405290565b604051608081016001600160401b03811182821017156128a2576128a261286a565b604051601f8201601f191681016001600160401b03811182821017156128f2576128f261286a565b604052919050565b600060e0828403121561290c57600080fd5b612914612880565b90508135612921816127a3565b81526020820135612931816127a3565b6020820152604082013562ffffff8116811461294c57600080fd5b604082015261295d606083016127b8565b60608201526080820135608082015260a082013560a082015261298260c083016127b8565b60c082015292915050565b600080600061010084860312156129a357600080fd5b83356001600160401b038111156129b957600080fd5b6129c586828701612826565b90945092506129d9905085602086016128fa565b90509250925092565b6000602082840312156129f457600080fd5b5035919050565b60008060408385031215612a0e57600080fd5b8235915060208301356127f1816127a3565b600060808284031215612a3257600080fd5b612a3a6128a8565b905081356001600160401b0380821115612a5357600080fd5b818401915084601f830112612a6757600080fd5b8135602082821115612a7b57612a7b61286a565b612a8d601f8301601f191682016128ca565b92508183528681838601011115612aa357600080fd5b81818501828501376000818385010152828552612ac18187016127b8565b8186015250505050604082013560408201526060820135606082015292915050565b600080600060408486031215612af857600080fd5b83356001600160401b0380821115612b0f57600080fd5b612b1b87838801612826565b90955093506020860135915080821115612b3457600080fd5b50612b4186828701612a20565b9150509250925092565b60008083601f840112612b5d57600080fd5b5081356001600160401b03811115612b7457600080fd5b6020830191508360208260051b850101111561171657600080fd5b600080600060408486031215612ba457600080fd5b8335925060208401356001600160401b03811115612bc157600080fd5b612bcd86828701612b4b565b9497909650939450505050565b60005b83811015612bf5578181015183820152602001612bdd565b50506000910152565b60008151808452612c16816020860160208601612bda565b601f01601f19169290920160200192915050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015612c7f57603f19888603018452612c6d858351612bfe565b94509285019290850190600101612c51565b5092979650505050505050565b600060208284031215612c9e57600080fd5b8135610ae0816127a3565b60008060208385031215612cbc57600080fd5b82356001600160401b03811115612cd257600080fd5b612cde85828601612b4b565b90969095509350505050565b600060208284031215612cfc57600080fd5b5051919050565b600060408284031215612d1557600080fd5b604051604081018181106001600160401b0382111715612d3757612d3761286a565b6040528235612d45816127a3565b81526020928301359281019290925250919050565b60e0810161044b828480516001600160a01b03908116835260208083015182169084015260408083015162ffffff16908401526060808301518216908401526080808301519084015260a0828101519084015260c09182015116910152565b6000815160808452612dce6080850182612bfe565b6020848101516001600160a01b0316908601526040808501519086015260609384015193909401929092525090919050565b602081526000610ae06020830184612db9565b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112612e4057600080fd5b8301803591506001600160401b03821115612e5a57600080fd5b60200191503681900382131561171657600080fd5b634e487b7160e01b600052601160045260246000fd5b600060018201612e9757612e97612e6f565b5060010190565b8181038181111561044b5761044b612e6f565b8082018082111561044b5761044b612e6f565b600060208284031215612ed657600080fd5b81518015158114610ae057600080fd5b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351612f1e816017850160208801612bda565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351612f4f816028840160208801612bda565b01602801949350505050565b602081526000610ae06020830184612bfe565b634e487b7160e01b600052601260045260246000fd5b60008251612f96818460208701612bda565b9190910192915050565b808202811582820484141761044b5761044b612e6f565b600081612fc657612fc6612e6f565b50600019019056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122060463b8c42f8b619093981b0f594938e67042d40ad9d5eadd4922e9bc3000dde64736f6c63430008130033";
32470
- const isSuperArgs$1 = (xs) => xs.length > 1;
32471
- class SecondaryFee__factory extends ethers.ContractFactory {
32064
+ const _bytecode$2 = "0x60806040523480156200001157600080fd5b50604051620034dd380380620034dd83398101604081905262000034916200015c565b6001805460ff191690556200004b6000846200009e565b600180546001600160a01b039384166101008102610100600160a81b03199092169190911790915560038054929093166001600160a01b03199283161790925560028054909116909117905550620001a6565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166200013b576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620000fa3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b80516001600160a01b03811681146200015757600080fd5b919050565b6000806000606084860312156200017257600080fd5b6200017d846200013f565b92506200018d602085016200013f565b91506200019d604085016200013f565b90509250925092565b61332780620001b66000396000f3fe6080604052600436106101175760003560e01c806358e81a50116100a05780638456cb59116100645780638456cb59146102c457806391d14854146102d9578063a217fddf146102f9578063ac9650d81461030e578063d547741f1461032e57600080fd5b806358e81a50146102465780635ae401dc146102595780635c975abb146102795780635ebca7991461029157806368742da6146102a457600080fd5b80632f2ff15d116100e75780632f2ff15d146101cb57806336568abe146101eb578063383ebb0b1461020b5780633f4ba83a1461021e5780635640f6591461023357600080fd5b80620fa9fb1461012357806301ffc9a714610145578063116944b21461017a578063248a9ca31461019b57600080fd5b3661011e57005b600080fd5b34801561012f57600080fd5b5061014361013e366004612ab8565b61034e565b005b34801561015157600080fd5b50610165610160366004612af1565b61041a565b60405190151581526020015b60405180910390f35b61018d610188366004612c89565b610451565b604051908152602001610171565b3480156101a757600080fd5b5061018d6101b6366004612cde565b60009081526020819052604090206001015490565b3480156101d757600080fd5b506101436101e6366004612cf7565b610771565b3480156101f757600080fd5b50610143610206366004612cf7565b610796565b61018d610219366004612ddf565b610819565b34801561022a57600080fd5b50610143610b86565b61018d610241366004612ddf565b610bd6565b61018d610254366004612c89565b610ee4565b61026c610267366004612e8b565b61121e565b6040516101719190612f26565b34801561028557600080fd5b5060015460ff16610165565b61014361029f366004612cde565b611255565b3480156102b057600080fd5b506101436102bf366004612f88565b6113ad565b3480156102d057600080fd5b50610143611428565b3480156102e557600080fd5b506101656102f4366004612cf7565b611476565b34801561030557600080fd5b5061018d600081565b34801561031a57600080fd5b5061026c610329366004612fa5565b61149f565b34801561033a57600080fd5b50610143610349366004612cf7565b611593565b6103787f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e98286933611476565b610394576040516282b42960e81b815260040160405180910390fd5b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa1580156103db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ff9190612fe6565b90506104156001600160a01b03831684836115b8565b505050565b60006001600160e01b03198216637965db0b60e01b148061044b57506301ffc9a760e01b6001600160e01b03198316145b92915050565b600061045f60015460ff1690565b1561047d5760405163ab35696f60e01b815260040160405180910390fd5b61048a826060015161161b565b6104a75760405163519bdea760e01b815260040160405180910390fd5b608082015134801561065a57836080015181146104d7576040516342f7487960e11b815260040160405180910390fd5b60035484516001600160a01b03908116911614610507576040516324d0121760e01b815260040160405180910390fd5b60008061056f866000015187608001518a8a808060200260200160405190810160405280939291908181526020016000905b828210156105655761055660408302860136819003810190612fff565b81526020019060010190610539565b5050505050611641565b608088018290526001546040516304e45aaf60e01b815292945090925061010090046001600160a01b0316906304e45aaf9084906105b1908a90600401613056565b60206040518083038185885af11580156105cf573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906105f49190612fe6565b945061065384828a8a808060200260200160405190810160405280939291908181526020016000905b828210156106495761063a60408302860136819003810190612fff565b8152602001906001019061061d565b5050505050611679565b5050610768565b6000806106b8866000015187608001518a8a808060200260200160405190810160405280939291908181526020016000905b82821015610565576106a960408302860136819003810190612fff565b8152602001906001019061068c565b60808801829052875191935091506106db906001600160a01b031633308561170c565b6001546040516304e45aaf60e01b81526101009091046001600160a01b0316906304e45aaf9061070f908990600401613056565b6020604051808303816000875af115801561072e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107529190612fe6565b9450610765866000015185838b8b61174a565b50505b50509392505050565b60008281526020819052604090206001015461078c8161184b565b6104158383611855565b6001600160a01b038116331461080b5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b61081582826118d9565b5050565b600061082760015460ff1690565b156108455760405163ab35696f60e01b815260040160405180910390fd5b610852826020015161161b565b61086f5760405163519bdea760e01b815260040160405180910390fd5b600061087e836000015161193e565b606084015190915034908115610a30576003546001600160a01b038481169116146108bc576040516324d0121760e01b815260040160405180910390fd5b846060015182146108e0576040516342f7487960e11b815260040160405180910390fd5b600061094286606001518989808060200260200160405190810160405280939291908181526020016000905b828210156109385761092960408302860136819003810190612fff565b8152602001906001019061090c565b5050505050611974565b606087018190526001546040516304dc09a360e11b81529192506000916101009091046001600160a01b0316906309b81346908490610985908b906004016130fc565b60206040518083038185885af11580156109a3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109c89190612fe6565b9050610a2781848b8b808060200260200160405190810160405280939291908181526020016000905b82821015610a1d57610a0e60408302860136819003810190612fff565b815260200190600101906109f1565b50505050506119c3565b95505050610b7c565b6000610a938487606001518a8a808060200260200160405190810160405280939291908181526020016000905b82821015610a8957610a7a60408302860136819003810190612fff565b81526020019060010190610a5d565b5050505050611aab565b606087018190526001546040516304dc09a360e11b81529192506000916101009091046001600160a01b0316906309b8134690610ad4908a906004016130fc565b6020604051808303816000875af1158015610af3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b179190612fe6565b9050610b778582858c8c808060200260200160405190810160405280939291908181526020016000905b82821015610b6d57610b5e60408302860136819003810190612fff565b81526020019060010190610b41565b5050505050611b03565b955050505b5050509392505050565b610bb07fe7276a2a84d8de556657ec9cf93a55a7d66f096e529d0582ed08e9e2208b92b533611476565b610bcc576040516282b42960e81b815260040160405180910390fd5b610bd4611b57565b565b6000610be460015460ff1690565b15610c025760405163ab35696f60e01b815260040160405180910390fd5b610c0f826020015161161b565b610c2c5760405163519bdea760e01b815260040160405180910390fd5b6000610c3b8360000151611ba9565b6040840151909150348015610dd75784604001518114610c6e576040516342f7487960e11b815260040160405180910390fd5b6003546001600160a01b03848116911614610c9c576040516324d0121760e01b815260040160405180910390fd5b600080610cf68588604001518b8b808060200260200160405190810160405280939291908181526020016000905b8282101561056557610ce760408302860136819003810190612fff565b81526020019060010190610cca565b6040898101839052600154905163b858183f60e01b815292945090925061010090046001600160a01b03169063b858183f908490610d38908b906004016130fc565b60206040518083038185885af1158015610d56573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610d7b9190612fe6565b9550610dd084828b8b808060200260200160405190810160405280939291908181526020016000905b8282101561064957610dc160408302860136819003810190612fff565b81526020019060010190610da4565b5050610b7c565b600080610e318588604001518b8b808060200260200160405190810160405280939291908181526020016000905b8282101561056557610e2260408302860136819003810190612fff565b81526020019060010190610e05565b604089018290529092509050610e526001600160a01b03861633308561170c565b60015460405163b858183f60e01b81526101009091046001600160a01b03169063b858183f90610e86908a906004016130fc565b6020604051808303816000875af1158015610ea5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ec99190612fe6565b9550610ed88585838c8c61174a565b50505050509392505050565b6000610ef260015460ff1690565b15610f105760405163ab35696f60e01b815260040160405180910390fd5b610f1d826060015161161b565b610f3a5760405163519bdea760e01b815260040160405180910390fd5b60a0820151349081156110d75760035484516001600160a01b03908116911614610f77576040516324d0121760e01b815260040160405180910390fd5b8360a001518214610f9b576040516342f7487960e11b815260040160405180910390fd5b6000610ff38560a001518888808060200260200160405190810160405280939291908181526020016000905b8282101561093857610fe460408302860136819003810190612fff565b81526020019060010190610fc7565b60a08601819052600154604051635023b4df60e01b81529192506000916101009091046001600160a01b031690635023b4df908490611036908a90600401613056565b60206040518083038185885af1158015611054573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110799190612fe6565b90506110ce81848a8a808060200260200160405190810160405280939291908181526020016000905b82821015610a1d576110bf60408302860136819003810190612fff565b815260200190600101906110a2565b94505050610768565b600061113485600001518660a001518989808060200260200160405190810160405280939291908181526020016000905b82821015610a895761112560408302860136819003810190612fff565b81526020019060010190611108565b60a08601819052600154604051635023b4df60e01b81529192506000916101009091046001600160a01b031690635023b4df90611175908990600401613056565b6020604051808303816000875af1158015611194573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111b89190612fe6565b9050611212866000015182858b8b808060200260200160405190810160405280939291908181526020016000905b82821015610b6d5761120360408302860136819003810190612fff565b815260200190600101906111e6565b98975050505050505050565b6060834211156112415760405163387b2e5560e11b815260040160405180910390fd5b61124b838361149f565b90505b9392505050565b60015460ff16156112795760405163ab35696f60e01b815260040160405180910390fd5b6003546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa1580156112c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112e69190612fe6565b905081811015611313576040516342fb4ceb60e11b81526004810183905260248101829052604401610802565b801561081557600354604051632e1a7d4d60e01b8152600481018390526001600160a01b0390911690632e1a7d4d90602401600060405180830381600087803b15801561135f57600080fd5b505af1158015611373573d6000803e3d6000fd5b5050505060006113833383611bb5565b905080610415576040516342fb4ceb60e11b81526004810184905260248101839052604401610802565b6113d77f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e98286933611476565b6113f3576040516282b42960e81b815260040160405180910390fd5b47156114255760006114058247611bb5565b90508061081557604051633398652560e11b815260040160405180910390fd5b50565b6114527ffcb9fcbfa83b897fb2d5cf4b58962164105c1e71489a37ef3ae0db3fdce576f633611476565b61146e576040516282b42960e81b815260040160405180910390fd5b610bd4611c5f565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6060816001600160401b038111156114b9576114b9612b66565b6040519080825280602002602001820160405280156114ec57816020015b60608152602001906001900390816114d75790505b50905060005b8281101561158c5761155c308585848181106115105761151061310f565b90506020028101906115229190613125565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611c9a92505050565b82828151811061156e5761156e61310f565b6020026020010181905250808061158490613181565b9150506114f2565b5092915050565b6000828152602081905260409020600101546115ae8161184b565b61041583836118d9565b6040516001600160a01b03831660248201526044810182905261041590849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611cbf565b60006001600160a01b03821633148061044b57506001600160a01b038216301492915050565b60008061164d83611d94565b506116588484611e07565b509050611665818561319a565b91506116718583611f30565b935093915050565b600061168361202d565b905060006116928583866120a4565b90506000806116a18386611e07565b915091506116ae816120d0565b8315611703576000826116c1858a61319a565b6116cb919061319a565b905080156117015760006116df3383611bb5565b9050806116ff576040516382e4f46960e01b815260040160405180910390fd5b505b505b50505050505050565b6040516001600160a01b03808516602483015283166044820152606481018290526117449085906323b872dd60e01b906084016115e4565b50505050565b6040516370a0823160e01b81523060048201526000906001600160a01b038716906370a0823190602401602060405180830381865afa158015611791573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117b59190612fe6565b905060006117c48683876120a4565b90506000611824828686808060200260200160405190810160405280939291908181526020016000905b8282101561181a5761180b60408302860136819003810190612fff565b815260200190600101906117ee565b5050505050611e07565b91505061183188826121af565b8215611701576117016001600160a01b03891633856115b8565b61142581336122b8565b61185f8282611476565b610815576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556118953390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6118e38282611476565b15610815576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000806014835161194f919061319a565b9050600061195f84836014612311565b905061196c81600061241e565b949350505050565b60008061198083611d94565b90506000611990826127106131ad565b905060006119a18661271084612483565b6003549091506119ba906001600160a01b031682611f30565b95945050505050565b60008060006119d28685611e07565b915091506119df816120d0565b600260009054906101000a90046001600160a01b03166001600160a01b03166312210e8a6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015611a2f57600080fd5b505af1158015611a43573d6000803e3d6000fd5b505050506000828787611a56919061319a565b611a60919061319a565b90508015611a96576000611a743383611bb5565b905080611a94576040516382e4f46960e01b815260040160405180910390fd5b505b611aa083886131ad565b979650505050505050565b600080611ab783611d94565b90506000611ac7826127106131ad565b90506000611ad88661271084612483565b9050611ae48782611f30565b611af96001600160a01b03881633308961170c565b9695505050505050565b6000806000611b128685611e07565b91509150611b2087826124c3565b600082611b2d888861319a565b611b37919061319a565b9050611b4d6001600160a01b03891633836115b8565b61121283886131ad565b611b5f6125ca565b6001805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600061044b828261241e565b600081471015611c075760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610802565b6040516001600160a01b038416908390600081818185875af1925050503d8060008114611c50576040519150601f19603f3d011682016040523d82523d6000602084013e611c55565b606091505b5090949350505050565b611c67612613565b6001805460ff1916811790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833611b8c565b606061124e83836040518060600160405280602781526020016132cb60279139612659565b6000611d14826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166126c79092919063ffffffff16565b9050805160001480611d35575080806020019051810190611d3591906131c0565b6104155760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610802565b6000805b8251811015611dde57828181518110611db357611db361310f565b60200260200101516020015182611dca91906131ad565b915080611dd681613181565b915050611d98565b506103e8811115611e025760405163cd4e616760e01b815260040160405180910390fd5b919050565b6000606082516001600160401b03811115611e2457611e24612b66565b604051908082528060200260200182016040528015611e6957816020015b6040805180820190915260008082526020820152815260200190600190039081611e425790505b50905060005b8351811015611f28576000611eae858381518110611e8f57611e8f61310f565b602002602001015160200151612710886126d69092919063ffffffff16565b90506040518060400160405280868481518110611ecd57611ecd61310f565b6020026020010151600001516001600160a01b0316815260200182815250838381518110611efd57611efd61310f565b6020908102919091010152611f1281856131ad565b9350508080611f2090613181565b915050611e6f565b509250929050565b600154604051636eb1769f60e11b81523060048201526001600160a01b0361010090920482166024820152829184169063dd62ed3e90604401602060405180830381865afa158015611f86573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611faa9190612fe6565b10156108155760015460405163095ea7b360e01b81526101009091046001600160a01b039081166004830152600019602483015283169063095ea7b3906044016020604051808303816000875af1158015612009573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061041591906131c0565b60025460408051630910874560e11b8152905160009247926001600160a01b03909116916312210e8a91600480820192879290919082900301818387803b15801561207757600080fd5b505af115801561208b573d6000803e3d6000fd5b5047925061209d91508390508261319a565b9250505090565b600082156120c857816120b7848661319a565b6120c1919061319a565b905061124e565b509192915050565b60005b81518110156108155760008282815181106120f0576120f061310f565b60200260200101519050600061210e82600001518360200151611bb5565b90508061214557815160208301516040516208c3b360e61b81526001600160a01b0390921660048301526024820152604401610802565b81600001516001600160a01b0316336001600160a01b03167fe0e765ab26c1caf691c510426951246128b96830e49cc81d8c093fd551abac35846020015160405161219291815260200190565b60405180910390a3505080806121a790613181565b9150506120d3565b60005b815181101561041557612215338383815181106121d1576121d161310f565b6020026020010151600001518484815181106121ef576121ef61310f565b602002602001015160200151866001600160a01b031661170c909392919063ffffffff16565b8181815181106122275761222761310f565b6020026020010151600001516001600160a01b0316336001600160a01b0316846001600160a01b03167f1f9a9fdac86b6ca3c5300bec0b61555cded1f1a234378602dcca6c27085eac8e8585815181106122835761228361310f565b60200260200101516020015160405161229e91815260200190565b60405180910390a4806122b081613181565b9150506121b2565b6122c28282611476565b610815576122cf81612778565b6122da83602061278a565b6040516020016122eb9291906131e2565b60408051601f198184030181529082905262461bcd60e51b825261080291600401613257565b60608161231f81601f6131ad565b101561235e5760405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b6044820152606401610802565b61236882846131ad565b845110156123ac5760405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b6044820152606401610802565b6060821580156123cb5760405191506000825260208201604052612415565b6040519150601f8416801560200281840101858101878315602002848b0101015b818310156124045780518352602092830192016123ec565b5050858452601f01601f1916604052505b50949350505050565b600061242b8260146131ad565b835110156124735760405162461bcd60e51b8152602060048201526015602482015274746f416464726573735f6f75744f66426f756e647360581b6044820152606401610802565b500160200151600160601b900490565b60006124908484846126d6565b9050600082806124a2576124a261326a565b848609111561124e5760001981106124b957600080fd5b6001019392505050565b60005b8151811015610415576125278282815181106124e4576124e461310f565b6020026020010151600001518383815181106125025761250261310f565b602002602001015160200151856001600160a01b03166115b89092919063ffffffff16565b8181815181106125395761253961310f565b6020026020010151600001516001600160a01b0316336001600160a01b0316846001600160a01b03167f1f9a9fdac86b6ca3c5300bec0b61555cded1f1a234378602dcca6c27085eac8e8585815181106125955761259561310f565b6020026020010151602001516040516125b091815260200190565b60405180910390a4806125c281613181565b9150506124c6565b60015460ff16610bd45760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610802565b60015460ff1615610bd45760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610802565b6060600080856001600160a01b0316856040516126769190613280565b600060405180830381855af49150503d80600081146126b1576040519150601f19603f3d011682016040523d82523d6000602084013e6126b6565b606091505b5091509150611af986838387612925565b606061124b848460008561299e565b600083830281600019858709828110838203039150508084116126f857600080fd5b8060000361270b5750829004905061124e565b6000848688096000868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150509392505050565b606061044b6001600160a01b03831660145b6060600061279983600261329c565b6127a49060026131ad565b6001600160401b038111156127bb576127bb612b66565b6040519080825280601f01601f1916602001820160405280156127e5576020820181803683370190505b509050600360fc1b816000815181106128005761280061310f565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061282f5761282f61310f565b60200101906001600160f81b031916908160001a905350600061285384600261329c565b61285e9060016131ad565b90505b60018111156128d6576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106128925761289261310f565b1a60f81b8282815181106128a8576128a861310f565b60200101906001600160f81b031916908160001a90535060049490941c936128cf816132b3565b9050612861565b50831561124e5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610802565b6060831561299457825160000361298d576001600160a01b0385163b61298d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610802565b508161196c565b61196c8383612a6e565b6060824710156129ff5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610802565b600080866001600160a01b03168587604051612a1b9190613280565b60006040518083038185875af1925050503d8060008114612a58576040519150601f19603f3d011682016040523d82523d6000602084013e612a5d565b606091505b5091509150611aa087838387612925565b815115612a7e5781518083602001fd5b8060405162461bcd60e51b81526004016108029190613257565b6001600160a01b038116811461142557600080fd5b8035611e0281612a98565b60008060408385031215612acb57600080fd5b8235612ad681612a98565b91506020830135612ae681612a98565b809150509250929050565b600060208284031215612b0357600080fd5b81356001600160e01b03198116811461124e57600080fd5b60008083601f840112612b2d57600080fd5b5081356001600160401b03811115612b4457600080fd5b6020830191508360208260061b8501011115612b5f57600080fd5b9250929050565b634e487b7160e01b600052604160045260246000fd5b60405160e081016001600160401b0381118282101715612b9e57612b9e612b66565b60405290565b604051608081016001600160401b0381118282101715612b9e57612b9e612b66565b604051601f8201601f191681016001600160401b0381118282101715612bee57612bee612b66565b604052919050565b600060e08284031215612c0857600080fd5b612c10612b7c565b90508135612c1d81612a98565b81526020820135612c2d81612a98565b6020820152604082013562ffffff81168114612c4857600080fd5b6040820152612c5960608301612aad565b60608201526080820135608082015260a082013560a0820152612c7e60c08301612aad565b60c082015292915050565b60008060006101008486031215612c9f57600080fd5b83356001600160401b03811115612cb557600080fd5b612cc186828701612b1b565b9094509250612cd590508560208601612bf6565b90509250925092565b600060208284031215612cf057600080fd5b5035919050565b60008060408385031215612d0a57600080fd5b823591506020830135612ae681612a98565b600060808284031215612d2e57600080fd5b612d36612ba4565b905081356001600160401b0380821115612d4f57600080fd5b818401915084601f830112612d6357600080fd5b8135602082821115612d7757612d77612b66565b612d89601f8301601f19168201612bc6565b92508183528681838601011115612d9f57600080fd5b81818501828501376000818385010152828552612dbd818701612aad565b8186015250505050604082013560408201526060820135606082015292915050565b600080600060408486031215612df457600080fd5b83356001600160401b0380821115612e0b57600080fd5b612e1787838801612b1b565b90955093506020860135915080821115612e3057600080fd5b50612e3d86828701612d1c565b9150509250925092565b60008083601f840112612e5957600080fd5b5081356001600160401b03811115612e7057600080fd5b6020830191508360208260051b8501011115612b5f57600080fd5b600080600060408486031215612ea057600080fd5b8335925060208401356001600160401b03811115612ebd57600080fd5b612ec986828701612e47565b9497909650939450505050565b60005b83811015612ef1578181015183820152602001612ed9565b50506000910152565b60008151808452612f12816020860160208601612ed6565b601f01601f19169290920160200192915050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015612f7b57603f19888603018452612f69858351612efa565b94509285019290850190600101612f4d565b5092979650505050505050565b600060208284031215612f9a57600080fd5b813561124e81612a98565b60008060208385031215612fb857600080fd5b82356001600160401b03811115612fce57600080fd5b612fda85828601612e47565b90969095509350505050565b600060208284031215612ff857600080fd5b5051919050565b60006040828403121561301157600080fd5b604051604081018181106001600160401b038211171561303357613033612b66565b604052823561304181612a98565b81526020928301359281019290925250919050565b60e0810161044b828480516001600160a01b03908116835260208083015182169084015260408083015162ffffff16908401526060808301518216908401526080808301519084015260a0828101519084015260c09182015116910152565b60008151608084526130ca6080850182612efa565b6020848101516001600160a01b0316908601526040808501519086015260609384015193909401929092525090919050565b60208152600061124e60208301846130b5565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261313c57600080fd5b8301803591506001600160401b0382111561315657600080fd5b602001915036819003821315612b5f57600080fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016131935761319361316b565b5060010190565b8181038181111561044b5761044b61316b565b8082018082111561044b5761044b61316b565b6000602082840312156131d257600080fd5b8151801515811461124e57600080fd5b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161321a816017850160208801612ed6565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161324b816028840160208801612ed6565b01602801949350505050565b60208152600061124e6020830184612efa565b634e487b7160e01b600052601260045260246000fd5b60008251613292818460208701612ed6565b9190910192915050565b808202811582820484141761044b5761044b61316b565b6000816132c2576132c261316b565b50600019019056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220162c0f9d1b47c666f486fc65c7c7502bb0e7378e3166be6f93d98943154831c364736f6c63430008130033";
32065
+ const isSuperArgs$2 = (xs) => xs.length > 1;
32066
+ class ImmutableSwapProxy__factory extends ethers.ContractFactory {
32472
32067
  constructor(...args) {
32473
- if (isSuperArgs$1(args)) {
32068
+ if (isSuperArgs$2(args)) {
32474
32069
  super(...args);
32475
32070
  }
32476
32071
  else {
32477
- super(_abi$1, _bytecode$1, args[0]);
32072
+ super(_abi$2, _bytecode$2, args[0]);
32478
32073
  }
32479
32074
  }
32480
32075
  deploy(_admin, _uniRouter, _wimx, overrides) {
@@ -32489,6 +32084,134 @@ class SecondaryFee__factory extends ethers.ContractFactory {
32489
32084
  connect(signer) {
32490
32085
  return super.connect(signer);
32491
32086
  }
32087
+ static bytecode = _bytecode$2;
32088
+ static abi = _abi$2;
32089
+ static createInterface() {
32090
+ return new ethers.utils.Interface(_abi$2);
32091
+ }
32092
+ static connect(address, signerOrProvider) {
32093
+ return new ethers.Contract(address, _abi$2, signerOrProvider);
32094
+ }
32095
+ }
32096
+
32097
+ /* Autogenerated file. Do not edit manually. */
32098
+ /* tslint:disable */
32099
+ /* eslint-disable */
32100
+ const _abi$1 = [
32101
+ {
32102
+ inputs: [],
32103
+ name: "getCurrentBlockTimestamp",
32104
+ outputs: [
32105
+ {
32106
+ internalType: "uint256",
32107
+ name: "timestamp",
32108
+ type: "uint256",
32109
+ },
32110
+ ],
32111
+ stateMutability: "view",
32112
+ type: "function",
32113
+ },
32114
+ {
32115
+ inputs: [
32116
+ {
32117
+ internalType: "address",
32118
+ name: "addr",
32119
+ type: "address",
32120
+ },
32121
+ ],
32122
+ name: "getEthBalance",
32123
+ outputs: [
32124
+ {
32125
+ internalType: "uint256",
32126
+ name: "balance",
32127
+ type: "uint256",
32128
+ },
32129
+ ],
32130
+ stateMutability: "view",
32131
+ type: "function",
32132
+ },
32133
+ {
32134
+ inputs: [
32135
+ {
32136
+ components: [
32137
+ {
32138
+ internalType: "address",
32139
+ name: "target",
32140
+ type: "address",
32141
+ },
32142
+ {
32143
+ internalType: "uint256",
32144
+ name: "gasLimit",
32145
+ type: "uint256",
32146
+ },
32147
+ {
32148
+ internalType: "bytes",
32149
+ name: "callData",
32150
+ type: "bytes",
32151
+ },
32152
+ ],
32153
+ internalType: "struct UniswapInterfaceMulticall.Call[]",
32154
+ name: "calls",
32155
+ type: "tuple[]",
32156
+ },
32157
+ ],
32158
+ name: "multicall",
32159
+ outputs: [
32160
+ {
32161
+ internalType: "uint256",
32162
+ name: "blockNumber",
32163
+ type: "uint256",
32164
+ },
32165
+ {
32166
+ components: [
32167
+ {
32168
+ internalType: "bool",
32169
+ name: "success",
32170
+ type: "bool",
32171
+ },
32172
+ {
32173
+ internalType: "uint256",
32174
+ name: "gasUsed",
32175
+ type: "uint256",
32176
+ },
32177
+ {
32178
+ internalType: "bytes",
32179
+ name: "returnData",
32180
+ type: "bytes",
32181
+ },
32182
+ ],
32183
+ internalType: "struct UniswapInterfaceMulticall.Result[]",
32184
+ name: "returnData",
32185
+ type: "tuple[]",
32186
+ },
32187
+ ],
32188
+ stateMutability: "nonpayable",
32189
+ type: "function",
32190
+ },
32191
+ ];
32192
+ const _bytecode$1 = "0x608060405234801561001057600080fd5b50610567806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80630f28c97d146100465780631749e1e3146100645780634d2301cc14610085575b600080fd5b61004e610098565b60405161005b919061041f565b60405180910390f35b6100776100723660046102a7565b61009c565b60405161005b929190610428565b61004e610093366004610286565b610220565b4290565b8051439060609067ffffffffffffffff811180156100b957600080fd5b506040519080825280602002602001820160405280156100f357816020015b6100e061023a565b8152602001906001900390816100d85790505b50905060005b835181101561021a57600080600086848151811061011357fe5b60200260200101516000015187858151811061012b57fe5b60200260200101516020015188868151811061014357fe5b60200260200101516040015192509250925060005a90506000808573ffffffffffffffffffffffffffffffffffffffff1685856040516101839190610403565b60006040518083038160008787f1925050503d80600081146101c1576040519150601f19603f3d011682016040523d82523d6000602084013e6101c6565b606091505b509150915060005a8403905060405180606001604052808415158152602001828152602001838152508989815181106101fb57fe5b60200260200101819052505050505050505080806001019150506100f9565b50915091565b73ffffffffffffffffffffffffffffffffffffffff163190565b604051806060016040528060001515815260200160008152602001606081525090565b803573ffffffffffffffffffffffffffffffffffffffff8116811461028157600080fd5b919050565b600060208284031215610297578081fd5b6102a08261025d565b9392505050565b600060208083850312156102b9578182fd5b823567ffffffffffffffff808211156102d0578384fd5b818501915085601f8301126102e3578384fd5b8135818111156102ef57fe5b6102fc8485830201610506565b81815284810190848601875b848110156103f457813587017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0606081838f03011215610346578a8bfd5b60408051606081018181108b8211171561035c57fe5b8252610369848d0161025d565b8152818401358c82015260608401358a811115610384578d8efd5b8085019450508e603f850112610398578c8dfd5b8b8401358a8111156103a657fe5b6103b68d85601f84011601610506565b93508084528f838287010111156103cb578d8efd5b808386018e86013783018c018d9052908101919091528552509287019290870190600101610308565b50909998505050505050505050565b6000825161041581846020870161052a565b9190910192915050565b90815260200190565b600060408083018584526020828186015281865180845260609350838701915083838202880101838901875b838110156104f6578983037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa001855281518051151584528681015187850152880151888401889052805188850181905260806104b582828801858c0161052a565b96880196601f919091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01694909401909301925090850190600101610454565b50909a9950505050505050505050565b60405181810167ffffffffffffffff8111828210171561052257fe5b604052919050565b60005b8381101561054557818101518382015260200161052d565b83811115610554576000848401525b5050505056fea164736f6c6343000706000a";
32193
+ const isSuperArgs$1 = (xs) => xs.length > 1;
32194
+ class Multicall__factory extends ethers.ContractFactory {
32195
+ constructor(...args) {
32196
+ if (isSuperArgs$1(args)) {
32197
+ super(...args);
32198
+ }
32199
+ else {
32200
+ super(_abi$1, _bytecode$1, args[0]);
32201
+ }
32202
+ }
32203
+ deploy(overrides) {
32204
+ return super.deploy(overrides || {});
32205
+ }
32206
+ getDeployTransaction(overrides) {
32207
+ return super.getDeployTransaction(overrides || {});
32208
+ }
32209
+ attach(address) {
32210
+ return super.attach(address);
32211
+ }
32212
+ connect(signer) {
32213
+ return super.connect(signer);
32214
+ }
32492
32215
  static bytecode = _bytecode$1;
32493
32216
  static abi = _abi$1;
32494
32217
  static createInterface() {
@@ -34307,14 +34030,14 @@ function buildSinglePoolSwap(tokenIn, tokenOut, recipient, trade, route, amountI
34307
34030
  }
34308
34031
  return calldatas;
34309
34032
  }
34310
- function buildSinglePoolSwapWithFees(recipient, trade, route, amountIn, amountOut, secondaryFees, secondaryFeeContract, tokenOut) {
34033
+ function buildSinglePoolSwapWithFees(recipient, trade, route, amountIn, amountOut, secondaryFees, swapProxyContract, tokenOut) {
34311
34034
  const secondaryFeeValues = secondaryFees.map((fee) => ({
34312
34035
  feeBasisPoints: fee.basisPoints,
34313
34036
  recipient: fee.recipient,
34314
34037
  }));
34315
34038
  const calldatas = [];
34316
34039
  if (trade.tradeType === Uniswap__namespace.TradeType.EXACT_INPUT) {
34317
- calldatas.push(secondaryFeeContract.encodeFunctionData('exactInputSingleWithSecondaryFee', [
34040
+ calldatas.push(swapProxyContract.encodeFunctionData('exactInputSingleWithSecondaryFee', [
34318
34041
  secondaryFeeValues,
34319
34042
  {
34320
34043
  tokenIn: route.tokenPath[0].address,
@@ -34328,7 +34051,7 @@ function buildSinglePoolSwapWithFees(recipient, trade, route, amountIn, amountOu
34328
34051
  ]));
34329
34052
  }
34330
34053
  if (trade.tradeType === Uniswap__namespace.TradeType.EXACT_OUTPUT) {
34331
- calldatas.push(secondaryFeeContract.encodeFunctionData('exactOutputSingleWithSecondaryFee', [
34054
+ calldatas.push(swapProxyContract.encodeFunctionData('exactOutputSingleWithSecondaryFee', [
34332
34055
  secondaryFeeValues,
34333
34056
  {
34334
34057
  tokenIn: route.tokenPath[0].address,
@@ -34344,7 +34067,7 @@ function buildSinglePoolSwapWithFees(recipient, trade, route, amountIn, amountOu
34344
34067
  const shouldUnwrapTokens = isNative(tokenOut);
34345
34068
  if (shouldUnwrapTokens) {
34346
34069
  // Unwrap the output token if the user specified a native token as the output
34347
- calldatas.push(secondaryFeeContract.encodeFunctionData('unwrapNativeToken', [amountOut]));
34070
+ calldatas.push(swapProxyContract.encodeFunctionData('unwrapNativeToken', [amountOut]));
34348
34071
  }
34349
34072
  return calldatas;
34350
34073
  }
@@ -34386,7 +34109,7 @@ function buildMultiPoolSwap(tokenIn, tokenOut, recipient, trade, route, amountIn
34386
34109
  }
34387
34110
  return calldatas;
34388
34111
  }
34389
- function buildMultiPoolSwapWithFees(recipient, trade, route, amountIn, amountOut, secondaryFees, secondaryFeeContract, tokenOut) {
34112
+ function buildMultiPoolSwapWithFees(recipient, trade, route, amountIn, amountOut, secondaryFees, swapProxyContract, tokenOut) {
34390
34113
  const path = v3Sdk.encodeRouteToPath(route, trade.tradeType === Uniswap__namespace.TradeType.EXACT_OUTPUT);
34391
34114
  const secondaryFeeValues = secondaryFees.map((fee) => ({
34392
34115
  feeBasisPoints: fee.basisPoints,
@@ -34394,7 +34117,7 @@ function buildMultiPoolSwapWithFees(recipient, trade, route, amountIn, amountOut
34394
34117
  }));
34395
34118
  const calldatas = [];
34396
34119
  if (trade.tradeType === Uniswap__namespace.TradeType.EXACT_INPUT) {
34397
- calldatas.push(secondaryFeeContract.encodeFunctionData('exactInputWithSecondaryFee', [
34120
+ calldatas.push(swapProxyContract.encodeFunctionData('exactInputWithSecondaryFee', [
34398
34121
  secondaryFeeValues,
34399
34122
  {
34400
34123
  path,
@@ -34405,7 +34128,7 @@ function buildMultiPoolSwapWithFees(recipient, trade, route, amountIn, amountOut
34405
34128
  ]));
34406
34129
  }
34407
34130
  if (trade.tradeType === Uniswap__namespace.TradeType.EXACT_OUTPUT) {
34408
- calldatas.push(secondaryFeeContract.encodeFunctionData('exactOutputWithSecondaryFee', [
34131
+ calldatas.push(swapProxyContract.encodeFunctionData('exactOutputWithSecondaryFee', [
34409
34132
  secondaryFeeValues,
34410
34133
  {
34411
34134
  path,
@@ -34418,7 +34141,7 @@ function buildMultiPoolSwapWithFees(recipient, trade, route, amountIn, amountOut
34418
34141
  const shouldUnwrapTokens = isNative(tokenOut);
34419
34142
  if (shouldUnwrapTokens) {
34420
34143
  // Unwrap the output token if the user specified a native token as the output
34421
- calldatas.push(secondaryFeeContract.encodeFunctionData('unwrapNativeToken', [amountOut]));
34144
+ calldatas.push(swapProxyContract.encodeFunctionData('unwrapNativeToken', [amountOut]));
34422
34145
  }
34423
34146
  return calldatas;
34424
34147
  }
@@ -34429,14 +34152,14 @@ function buildMultiPoolSwapWithFees(recipient, trade, route, amountIn, amountOut
34429
34152
  * @param fromAddress The address of the user
34430
34153
  * @param trade The trade to be executed
34431
34154
  * @param secondaryFees Secondary fees to be applied to the swap
34432
- * @param secondaryFeeContract The SecondaryFee contract interface
34155
+ * @param swapProxyContract The SecondaryFee contract interface
34433
34156
  * @param routerContract The SwapRouter02 contract interface
34434
34157
  * @param paymentsContract The PaymentsExtended contract interface
34435
34158
  * @param maximumAmountIn The maximum amount of tokenIn to be swapped
34436
34159
  * @param minimumAmountOut The minimum amount of tokenOut to be received
34437
34160
  * @returns calldatas that make up the swap transaction
34438
34161
  */
34439
- function buildSwapParameters(tokenIn, tokenOut, recipient, trade, secondaryFees, secondaryFeeContract, routerContract, paymentsContract, maximumAmountIn, minimumAmountOut) {
34162
+ function buildSwapParameters(tokenIn, tokenOut, recipient, trade, secondaryFees, swapProxyContract, routerContract, paymentsContract, maximumAmountIn, minimumAmountOut) {
34440
34163
  // @dev we don't support multiple swaps in a single transaction
34441
34164
  // there will always be only one swap in the trade regardless of the trade type
34442
34165
  const { route } = trade.swaps[0];
@@ -34444,22 +34167,22 @@ function buildSwapParameters(tokenIn, tokenOut, recipient, trade, secondaryFees,
34444
34167
  const hasSecondaryFees = secondaryFees.length > 0;
34445
34168
  if (isSinglePoolSwap) {
34446
34169
  if (hasSecondaryFees) {
34447
- return buildSinglePoolSwapWithFees(recipient, trade, route, maximumAmountIn, minimumAmountOut, secondaryFees, secondaryFeeContract, tokenOut);
34170
+ return buildSinglePoolSwapWithFees(recipient, trade, route, maximumAmountIn, minimumAmountOut, secondaryFees, swapProxyContract, tokenOut);
34448
34171
  }
34449
34172
  return buildSinglePoolSwap(tokenIn, tokenOut, recipient, trade, route, maximumAmountIn, minimumAmountOut, routerContract, paymentsContract);
34450
34173
  }
34451
34174
  if (hasSecondaryFees) {
34452
- return buildMultiPoolSwapWithFees(recipient, trade, route, maximumAmountIn, minimumAmountOut, secondaryFees, secondaryFeeContract, tokenOut);
34175
+ return buildMultiPoolSwapWithFees(recipient, trade, route, maximumAmountIn, minimumAmountOut, secondaryFees, swapProxyContract, tokenOut);
34453
34176
  }
34454
34177
  return buildMultiPoolSwap(tokenIn, tokenOut, recipient, trade, route, maximumAmountIn, minimumAmountOut, routerContract, paymentsContract);
34455
34178
  }
34456
34179
  function createSwapCallParameters(tokenIn, tokenOut, trade, recipient, swapOptions, secondaryFees, maximumAmountIn, minimumAmountOut) {
34457
- const secondaryFeeContract = SecondaryFee__factory.createInterface();
34180
+ const swapProxyContract = ImmutableSwapProxy__factory.createInterface();
34458
34181
  const routerContract = routerSdk.SwapRouter.INTERFACE;
34459
34182
  const paymentsContract = routerSdk.PaymentsExtended.INTERFACE;
34460
- const calldatas = buildSwapParameters(tokenIn, tokenOut, recipient, trade, secondaryFees, secondaryFeeContract, routerContract, paymentsContract, maximumAmountIn, minimumAmountOut);
34183
+ const calldatas = buildSwapParameters(tokenIn, tokenOut, recipient, trade, secondaryFees, swapProxyContract, routerContract, paymentsContract, maximumAmountIn, minimumAmountOut);
34461
34184
  // Create the multicall transaction using the calldatas generated above
34462
- return secondaryFeeContract.encodeFunctionData(multicallWithDeadlineFunctionSignature, [
34185
+ return swapProxyContract.encodeFunctionData(multicallWithDeadlineFunctionSignature, [
34463
34186
  swapOptions.deadlineOrPreviousBlockhash,
34464
34187
  calldatas,
34465
34188
  ]);
@@ -34652,7 +34375,7 @@ class Exchange {
34652
34375
  wrappedNativeToken;
34653
34376
  secondaryFees;
34654
34377
  nativeTokenService;
34655
- secondaryFeeContractAddress;
34378
+ swapProxyContractAddress;
34656
34379
  routerContractAddress;
34657
34380
  constructor(configuration) {
34658
34381
  const config = new ExchangeConfiguration(configuration);
@@ -34662,7 +34385,7 @@ class Exchange {
34662
34385
  this.nativeTokenService = new NativeTokenService(this.nativeToken, this.wrappedNativeToken);
34663
34386
  this.secondaryFees = config.secondaryFees;
34664
34387
  this.routerContractAddress = config.chain.contracts.peripheryRouter;
34665
- this.secondaryFeeContractAddress = config.chain.contracts.secondaryFee;
34388
+ this.swapProxyContractAddress = config.chain.contracts.secondaryFee;
34666
34389
  this.provider = new ethers.ethers.providers.StaticJsonRpcProvider({
34667
34390
  url: config.chain.rpcUrl,
34668
34391
  skipFetchSetup: true,
@@ -34688,8 +34411,8 @@ class Exchange {
34688
34411
  if (this.secondaryFees.length === 0) {
34689
34412
  return [];
34690
34413
  }
34691
- const secondaryFeeContract = SecondaryFee__factory.connect(this.secondaryFeeContractAddress, provider);
34692
- if (await secondaryFeeContract.paused()) {
34414
+ const swapProxyContract = ImmutableSwapProxy__factory.connect(this.swapProxyContractAddress, provider);
34415
+ if (await swapProxyContract.paused()) {
34693
34416
  // Do not use secondary fees if the contract is paused
34694
34417
  return [];
34695
34418
  }
@@ -34726,11 +34449,11 @@ class Exchange {
34726
34449
  // Quotes will always use ERC20s. If the user-specified token is Native, we use the Wrapped Native Token pool
34727
34450
  const ourQuote = await this.router.findOptimalRoute(ourQuoteReqAmount, this.nativeTokenService.maybeWrapToken(otherToken), tradeType, maxHops);
34728
34451
  const adjustedQuote = adjustQuoteWithFees(ourQuote, amountSpecified, fees, this.nativeTokenService);
34729
- const swap = getSwap(tokenIn, tokenOut, adjustedQuote, fromAddress, slippagePercent, deadline, this.routerContractAddress, this.secondaryFeeContractAddress, gasPrice, secondaryFees);
34452
+ const swap = getSwap(tokenIn, tokenOut, adjustedQuote, fromAddress, slippagePercent, deadline, this.routerContractAddress, this.swapProxyContractAddress, gasPrice, secondaryFees);
34730
34453
  const { quotedAmount, quotedAmountWithMaxSlippage } = prepareUserQuote(this.nativeTokenService, adjustedQuote, slippagePercent, otherToken);
34731
34454
  const preparedApproval = prepareApproval(tradeType, amountSpecified, quotedAmountWithMaxSlippage, {
34732
34455
  routerAddress: this.routerContractAddress,
34733
- secondaryFeeAddress: this.secondaryFeeContractAddress,
34456
+ secondaryFeeAddress: this.swapProxyContractAddress,
34734
34457
  }, secondaryFees);
34735
34458
  // preparedApproval always uses the tokenIn address because we are always selling the tokenIn
34736
34459
  const approval = preparedApproval
@@ -35261,7 +34984,11 @@ async function addNetworkToWallet(networkMap, web3Provider, chainId) {
35261
34984
  async function getNetworkAllowList(config, { type = NetworkFilterTypes.ALL, exclude }) {
35262
34985
  const { networkMap } = config;
35263
34986
  const allowedNetworkConfig = (await config.remote.getConfig('allowedNetworks'));
35264
- const list = allowedNetworkConfig.filter((network) => {
34987
+ if (!allowedNetworkConfig) {
34988
+ // eslint-disable-next-line no-console
34989
+ console.warn('No allowed networks configured');
34990
+ }
34991
+ const list = (allowedNetworkConfig || []).filter((network) => {
35265
34992
  const allowAllTokens = type === NetworkFilterTypes.ALL;
35266
34993
  const networkNotExcluded = !(exclude || [])
35267
34994
  .map((exc) => exc.chainId)
@@ -35701,7 +35428,7 @@ const GAS_OVERRIDES = {
35701
35428
  maxPriorityFeePerGas: ethers.BigNumber.from(101e9),
35702
35429
  };
35703
35430
 
35704
- const SDK_VERSION_MARKER = '0.38.0';
35431
+ const SDK_VERSION_MARKER = '0.39.1';
35705
35432
  // This SDK version is replaced by the `yarn build` command ran on the root level
35706
35433
  const globalPackageVersion = () => SDK_VERSION_MARKER;
35707
35434
 
@@ -35724,18 +35451,33 @@ class RemoteConfigFetcher {
35724
35451
  return CHECKOUT_CDN_BASE_URL[Environment$1.PRODUCTION];
35725
35452
  return CHECKOUT_CDN_BASE_URL[Environment$1.SANDBOX];
35726
35453
  };
35454
+ // eslint-disable-next-line class-methods-use-this
35455
+ parseResponse(response) {
35456
+ let responseData = response.data;
35457
+ if (response.data && typeof response.data !== 'object') {
35458
+ try {
35459
+ responseData = JSON.parse(response.data);
35460
+ }
35461
+ catch (jsonError) {
35462
+ throw new CheckoutError('Invalid configuration', CheckoutErrorType.API_ERROR);
35463
+ }
35464
+ }
35465
+ return responseData;
35466
+ }
35727
35467
  async loadConfig() {
35728
35468
  if (this.configCache)
35729
35469
  return this.configCache;
35730
35470
  const response = await this.httpClient.get(`${this.getEndpoint()}/${this.version}/config`);
35731
- this.configCache = response.data;
35471
+ // Ensure that the configuration is valid
35472
+ this.configCache = this.parseResponse(response);
35732
35473
  return this.configCache;
35733
35474
  }
35734
35475
  async loadConfigTokens() {
35735
35476
  if (this.tokensCache)
35736
35477
  return this.tokensCache;
35737
35478
  const response = await this.httpClient.get(`${this.getEndpoint()}/${this.version}/config/tokens`);
35738
- this.tokensCache = response.data;
35479
+ // Ensure that the configuration is valid
35480
+ this.tokensCache = this.parseResponse(response);
35739
35481
  return this.tokensCache;
35740
35482
  }
35741
35483
  async getConfig(key) {
@@ -37889,8 +37631,8 @@ const bridgeRoute = async (config, readOnlyProviders, availableRoutingOptions, b
37889
37631
  if (tokenBalanceResult === undefined || tokenBalanceResult.success === false)
37890
37632
  return undefined;
37891
37633
  // todo: revert this back to using the allowlist
37892
- const allowedTokenList = await allowListCheckForBridge(config, tokenBalanceResults, availableRoutingOptions);
37893
- if (allowedTokenList.length === 0)
37634
+ const allowedL1TokenList = await allowListCheckForBridge(config, tokenBalanceResults, availableRoutingOptions);
37635
+ if (allowedL1TokenList.length === 0)
37894
37636
  return undefined;
37895
37637
  const l1RepresentationResult = await fetchL1Representation(config, bridgeRequirement.l2address);
37896
37638
  if (!l1RepresentationResult)
@@ -37898,10 +37640,10 @@ const bridgeRoute = async (config, readOnlyProviders, availableRoutingOptions, b
37898
37640
  // Ensure l1address is in the allowed token list
37899
37641
  const { l1address } = l1RepresentationResult;
37900
37642
  if (isNativeToken(l1address)) {
37901
- if (!allowedTokenList.find((token) => !('address' in token)))
37643
+ if (!allowedL1TokenList.find((token) => isNativeToken(token.address)))
37902
37644
  return undefined;
37903
37645
  }
37904
- else if (!allowedTokenList.find((token) => token.address === l1address)) {
37646
+ else if (!allowedL1TokenList.find((token) => token.address === l1address)) {
37905
37647
  return undefined;
37906
37648
  }
37907
37649
  const feesFromBridge = await getBridgeFeeEstimate(config, readOnlyProviders, l1ChainId, l2ChainId);