@imtbl/sdk 0.39.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/blockchain_data.js +1 -1
- package/dist/browser/checkout/sdk.js +6 -6
- package/dist/browser/checkout/widgets.js +61 -58
- package/dist/checkout.js +510 -787
- package/dist/immutablex_client.js +1 -1
- package/dist/index.browser.js +11 -11
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +512 -789
- package/dist/index.js +515 -792
- package/dist/passport.js +2 -2
- package/package.json +1 -1
package/dist/checkout.js
CHANGED
|
@@ -6633,7 +6633,7 @@ var require$$0 = /*@__PURE__*/getAugmentedNamespace(_nodeResolve_empty$1);
|
|
|
6633
6633
|
var bnExports = bn.exports;
|
|
6634
6634
|
var BN$1 = /*@__PURE__*/getDefaultExportFromCjs(bnExports);
|
|
6635
6635
|
|
|
6636
|
-
const version$
|
|
6636
|
+
const version$b = "logger/5.7.0";
|
|
6637
6637
|
|
|
6638
6638
|
let _permanentCensorErrors = false;
|
|
6639
6639
|
let _censorErrors = false;
|
|
@@ -6948,7 +6948,7 @@ class Logger {
|
|
|
6948
6948
|
}
|
|
6949
6949
|
static globalLogger() {
|
|
6950
6950
|
if (!_globalLogger) {
|
|
6951
|
-
_globalLogger = new Logger(version$
|
|
6951
|
+
_globalLogger = new Logger(version$b);
|
|
6952
6952
|
}
|
|
6953
6953
|
return _globalLogger;
|
|
6954
6954
|
}
|
|
@@ -6984,9 +6984,9 @@ class Logger {
|
|
|
6984
6984
|
Logger.errors = ErrorCode;
|
|
6985
6985
|
Logger.levels = LogLevel;
|
|
6986
6986
|
|
|
6987
|
-
const version$
|
|
6987
|
+
const version$a = "bytes/5.7.0";
|
|
6988
6988
|
|
|
6989
|
-
const logger$
|
|
6989
|
+
const logger$e = new Logger(version$a);
|
|
6990
6990
|
///////////////////////////////
|
|
6991
6991
|
function isHexable(value) {
|
|
6992
6992
|
return !!(value.toHexString);
|
|
@@ -7033,7 +7033,7 @@ function arrayify(value, options) {
|
|
|
7033
7033
|
options = {};
|
|
7034
7034
|
}
|
|
7035
7035
|
if (typeof (value) === "number") {
|
|
7036
|
-
logger$
|
|
7036
|
+
logger$e.checkSafeUint53(value, "invalid arrayify value");
|
|
7037
7037
|
const result = [];
|
|
7038
7038
|
while (value) {
|
|
7039
7039
|
result.unshift(value & 0xff);
|
|
@@ -7060,7 +7060,7 @@ function arrayify(value, options) {
|
|
|
7060
7060
|
hex += "0";
|
|
7061
7061
|
}
|
|
7062
7062
|
else {
|
|
7063
|
-
logger$
|
|
7063
|
+
logger$e.throwArgumentError("hex data is odd-length", "value", value);
|
|
7064
7064
|
}
|
|
7065
7065
|
}
|
|
7066
7066
|
const result = [];
|
|
@@ -7072,7 +7072,7 @@ function arrayify(value, options) {
|
|
|
7072
7072
|
if (isBytes(value)) {
|
|
7073
7073
|
return addSlice(new Uint8Array(value));
|
|
7074
7074
|
}
|
|
7075
|
-
return logger$
|
|
7075
|
+
return logger$e.throwArgumentError("invalid arrayify value", "value", value);
|
|
7076
7076
|
}
|
|
7077
7077
|
function concat(items) {
|
|
7078
7078
|
const objects = items.map(item => arrayify(item));
|
|
@@ -7115,7 +7115,7 @@ function hexlify(value, options) {
|
|
|
7115
7115
|
options = {};
|
|
7116
7116
|
}
|
|
7117
7117
|
if (typeof (value) === "number") {
|
|
7118
|
-
logger$
|
|
7118
|
+
logger$e.checkSafeUint53(value, "invalid hexlify value");
|
|
7119
7119
|
let hex = "";
|
|
7120
7120
|
while (value) {
|
|
7121
7121
|
hex = HexCharacters[value & 0xf] + hex;
|
|
@@ -7151,7 +7151,7 @@ function hexlify(value, options) {
|
|
|
7151
7151
|
value += "0";
|
|
7152
7152
|
}
|
|
7153
7153
|
else {
|
|
7154
|
-
logger$
|
|
7154
|
+
logger$e.throwArgumentError("hex data is odd-length", "value", value);
|
|
7155
7155
|
}
|
|
7156
7156
|
}
|
|
7157
7157
|
return value.toLowerCase();
|
|
@@ -7164,7 +7164,7 @@ function hexlify(value, options) {
|
|
|
7164
7164
|
}
|
|
7165
7165
|
return result;
|
|
7166
7166
|
}
|
|
7167
|
-
return logger$
|
|
7167
|
+
return logger$e.throwArgumentError("invalid hexlify value", "value", value);
|
|
7168
7168
|
}
|
|
7169
7169
|
/*
|
|
7170
7170
|
function unoddify(value: BytesLike | Hexable | number): BytesLike | Hexable | number {
|
|
@@ -7188,7 +7188,7 @@ function hexDataSlice(data, offset, endOffset) {
|
|
|
7188
7188
|
data = hexlify(data);
|
|
7189
7189
|
}
|
|
7190
7190
|
else if (!isHexString(data) || (data.length % 2)) {
|
|
7191
|
-
logger$
|
|
7191
|
+
logger$e.throwArgumentError("invalid hexData", "value", data);
|
|
7192
7192
|
}
|
|
7193
7193
|
offset = 2 + 2 * offset;
|
|
7194
7194
|
if (endOffset != null) {
|
|
@@ -7208,10 +7208,10 @@ function hexZeroPad(value, length) {
|
|
|
7208
7208
|
value = hexlify(value);
|
|
7209
7209
|
}
|
|
7210
7210
|
else if (!isHexString(value)) {
|
|
7211
|
-
logger$
|
|
7211
|
+
logger$e.throwArgumentError("invalid hex string", "value", value);
|
|
7212
7212
|
}
|
|
7213
7213
|
if (value.length > 2 * length + 2) {
|
|
7214
|
-
logger$
|
|
7214
|
+
logger$e.throwArgumentError("value out of range", "value", arguments[1]);
|
|
7215
7215
|
}
|
|
7216
7216
|
while (value.length < 2 * length + 2) {
|
|
7217
7217
|
value = "0x0" + value.substring(2);
|
|
@@ -7219,26 +7219,18 @@ function hexZeroPad(value, length) {
|
|
|
7219
7219
|
return value;
|
|
7220
7220
|
}
|
|
7221
7221
|
|
|
7222
|
-
const version$
|
|
7222
|
+
const version$9 = "bignumber/5.7.0";
|
|
7223
7223
|
|
|
7224
7224
|
var BN = BN$1.BN;
|
|
7225
|
-
const logger$
|
|
7226
|
-
const _constructorGuard$
|
|
7225
|
+
const logger$d = new Logger(version$9);
|
|
7226
|
+
const _constructorGuard$1 = {};
|
|
7227
7227
|
const MAX_SAFE = 0x1fffffffffffff;
|
|
7228
|
-
function isBigNumberish(value) {
|
|
7229
|
-
return (value != null) && (BigNumber.isBigNumber(value) ||
|
|
7230
|
-
(typeof (value) === "number" && (value % 1) === 0) ||
|
|
7231
|
-
(typeof (value) === "string" && !!value.match(/^-?[0-9]+$/)) ||
|
|
7232
|
-
isHexString(value) ||
|
|
7233
|
-
(typeof (value) === "bigint") ||
|
|
7234
|
-
isBytes(value));
|
|
7235
|
-
}
|
|
7236
7228
|
// Only warn about passing 10 into radix once
|
|
7237
7229
|
let _warnedToStringRadix = false;
|
|
7238
7230
|
class BigNumber {
|
|
7239
7231
|
constructor(constructorGuard, hex) {
|
|
7240
|
-
if (constructorGuard !== _constructorGuard$
|
|
7241
|
-
logger$
|
|
7232
|
+
if (constructorGuard !== _constructorGuard$1) {
|
|
7233
|
+
logger$d.throwError("cannot call constructor directly; use BigNumber.from", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
7242
7234
|
operation: "new (BigNumber)"
|
|
7243
7235
|
});
|
|
7244
7236
|
}
|
|
@@ -7267,7 +7259,7 @@ class BigNumber {
|
|
|
7267
7259
|
div(other) {
|
|
7268
7260
|
const o = BigNumber.from(other);
|
|
7269
7261
|
if (o.isZero()) {
|
|
7270
|
-
throwFault
|
|
7262
|
+
throwFault("division-by-zero", "div");
|
|
7271
7263
|
}
|
|
7272
7264
|
return toBigNumber(toBN(this).div(toBN(other)));
|
|
7273
7265
|
}
|
|
@@ -7277,53 +7269,53 @@ class BigNumber {
|
|
|
7277
7269
|
mod(other) {
|
|
7278
7270
|
const value = toBN(other);
|
|
7279
7271
|
if (value.isNeg()) {
|
|
7280
|
-
throwFault
|
|
7272
|
+
throwFault("division-by-zero", "mod");
|
|
7281
7273
|
}
|
|
7282
7274
|
return toBigNumber(toBN(this).umod(value));
|
|
7283
7275
|
}
|
|
7284
7276
|
pow(other) {
|
|
7285
7277
|
const value = toBN(other);
|
|
7286
7278
|
if (value.isNeg()) {
|
|
7287
|
-
throwFault
|
|
7279
|
+
throwFault("negative-power", "pow");
|
|
7288
7280
|
}
|
|
7289
7281
|
return toBigNumber(toBN(this).pow(value));
|
|
7290
7282
|
}
|
|
7291
7283
|
and(other) {
|
|
7292
7284
|
const value = toBN(other);
|
|
7293
7285
|
if (this.isNegative() || value.isNeg()) {
|
|
7294
|
-
throwFault
|
|
7286
|
+
throwFault("unbound-bitwise-result", "and");
|
|
7295
7287
|
}
|
|
7296
7288
|
return toBigNumber(toBN(this).and(value));
|
|
7297
7289
|
}
|
|
7298
7290
|
or(other) {
|
|
7299
7291
|
const value = toBN(other);
|
|
7300
7292
|
if (this.isNegative() || value.isNeg()) {
|
|
7301
|
-
throwFault
|
|
7293
|
+
throwFault("unbound-bitwise-result", "or");
|
|
7302
7294
|
}
|
|
7303
7295
|
return toBigNumber(toBN(this).or(value));
|
|
7304
7296
|
}
|
|
7305
7297
|
xor(other) {
|
|
7306
7298
|
const value = toBN(other);
|
|
7307
7299
|
if (this.isNegative() || value.isNeg()) {
|
|
7308
|
-
throwFault
|
|
7300
|
+
throwFault("unbound-bitwise-result", "xor");
|
|
7309
7301
|
}
|
|
7310
7302
|
return toBigNumber(toBN(this).xor(value));
|
|
7311
7303
|
}
|
|
7312
7304
|
mask(value) {
|
|
7313
7305
|
if (this.isNegative() || value < 0) {
|
|
7314
|
-
throwFault
|
|
7306
|
+
throwFault("negative-width", "mask");
|
|
7315
7307
|
}
|
|
7316
7308
|
return toBigNumber(toBN(this).maskn(value));
|
|
7317
7309
|
}
|
|
7318
7310
|
shl(value) {
|
|
7319
7311
|
if (this.isNegative() || value < 0) {
|
|
7320
|
-
throwFault
|
|
7312
|
+
throwFault("negative-width", "shl");
|
|
7321
7313
|
}
|
|
7322
7314
|
return toBigNumber(toBN(this).shln(value));
|
|
7323
7315
|
}
|
|
7324
7316
|
shr(value) {
|
|
7325
7317
|
if (this.isNegative() || value < 0) {
|
|
7326
|
-
throwFault
|
|
7318
|
+
throwFault("negative-width", "shr");
|
|
7327
7319
|
}
|
|
7328
7320
|
return toBigNumber(toBN(this).shrn(value));
|
|
7329
7321
|
}
|
|
@@ -7353,7 +7345,7 @@ class BigNumber {
|
|
|
7353
7345
|
return toBN(this).toNumber();
|
|
7354
7346
|
}
|
|
7355
7347
|
catch (error) {
|
|
7356
|
-
throwFault
|
|
7348
|
+
throwFault("overflow", "toNumber", this.toString());
|
|
7357
7349
|
}
|
|
7358
7350
|
return null;
|
|
7359
7351
|
}
|
|
@@ -7362,7 +7354,7 @@ class BigNumber {
|
|
|
7362
7354
|
return BigInt(this.toString());
|
|
7363
7355
|
}
|
|
7364
7356
|
catch (e) { }
|
|
7365
|
-
return logger$
|
|
7357
|
+
return logger$d.throwError("this platform does not support BigInt", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
7366
7358
|
value: this.toString()
|
|
7367
7359
|
});
|
|
7368
7360
|
}
|
|
@@ -7372,14 +7364,14 @@ class BigNumber {
|
|
|
7372
7364
|
if (arguments[0] === 10) {
|
|
7373
7365
|
if (!_warnedToStringRadix) {
|
|
7374
7366
|
_warnedToStringRadix = true;
|
|
7375
|
-
logger$
|
|
7367
|
+
logger$d.warn("BigNumber.toString does not accept any parameters; base-10 is assumed");
|
|
7376
7368
|
}
|
|
7377
7369
|
}
|
|
7378
7370
|
else if (arguments[0] === 16) {
|
|
7379
|
-
logger$
|
|
7371
|
+
logger$d.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()", Logger.errors.UNEXPECTED_ARGUMENT, {});
|
|
7380
7372
|
}
|
|
7381
7373
|
else {
|
|
7382
|
-
logger$
|
|
7374
|
+
logger$d.throwError("BigNumber.toString does not accept parameters", Logger.errors.UNEXPECTED_ARGUMENT, {});
|
|
7383
7375
|
}
|
|
7384
7376
|
}
|
|
7385
7377
|
return toBN(this).toString(10);
|
|
@@ -7396,19 +7388,19 @@ class BigNumber {
|
|
|
7396
7388
|
}
|
|
7397
7389
|
if (typeof (value) === "string") {
|
|
7398
7390
|
if (value.match(/^-?0x[0-9a-f]+$/i)) {
|
|
7399
|
-
return new BigNumber(_constructorGuard$
|
|
7391
|
+
return new BigNumber(_constructorGuard$1, toHex(value));
|
|
7400
7392
|
}
|
|
7401
7393
|
if (value.match(/^-?[0-9]+$/)) {
|
|
7402
|
-
return new BigNumber(_constructorGuard$
|
|
7394
|
+
return new BigNumber(_constructorGuard$1, toHex(new BN(value)));
|
|
7403
7395
|
}
|
|
7404
|
-
return logger$
|
|
7396
|
+
return logger$d.throwArgumentError("invalid BigNumber string", "value", value);
|
|
7405
7397
|
}
|
|
7406
7398
|
if (typeof (value) === "number") {
|
|
7407
7399
|
if (value % 1) {
|
|
7408
|
-
throwFault
|
|
7400
|
+
throwFault("underflow", "BigNumber.from", value);
|
|
7409
7401
|
}
|
|
7410
7402
|
if (value >= MAX_SAFE || value <= -MAX_SAFE) {
|
|
7411
|
-
throwFault
|
|
7403
|
+
throwFault("overflow", "BigNumber.from", value);
|
|
7412
7404
|
}
|
|
7413
7405
|
return BigNumber.from(String(value));
|
|
7414
7406
|
}
|
|
@@ -7441,7 +7433,7 @@ class BigNumber {
|
|
|
7441
7433
|
}
|
|
7442
7434
|
}
|
|
7443
7435
|
}
|
|
7444
|
-
return logger$
|
|
7436
|
+
return logger$d.throwArgumentError("invalid BigNumber value", "value", value);
|
|
7445
7437
|
}
|
|
7446
7438
|
static isBigNumber(value) {
|
|
7447
7439
|
return !!(value && value._isBigNumber);
|
|
@@ -7459,7 +7451,7 @@ function toHex(value) {
|
|
|
7459
7451
|
value = value.substring(1);
|
|
7460
7452
|
// Cannot have multiple negative signs (e.g. "--0x04")
|
|
7461
7453
|
if (value[0] === "-") {
|
|
7462
|
-
logger$
|
|
7454
|
+
logger$d.throwArgumentError("invalid hex", "value", value);
|
|
7463
7455
|
}
|
|
7464
7456
|
// Call toHex on the positive component
|
|
7465
7457
|
value = toHex(value);
|
|
@@ -7498,373 +7490,19 @@ function toBN(value) {
|
|
|
7498
7490
|
}
|
|
7499
7491
|
return new BN(hex.substring(2), 16);
|
|
7500
7492
|
}
|
|
7501
|
-
function throwFault
|
|
7493
|
+
function throwFault(fault, operation, value) {
|
|
7502
7494
|
const params = { fault: fault, operation: operation };
|
|
7503
7495
|
if (value != null) {
|
|
7504
7496
|
params.value = value;
|
|
7505
7497
|
}
|
|
7506
|
-
return logger$
|
|
7498
|
+
return logger$d.throwError(fault, Logger.errors.NUMERIC_FAULT, params);
|
|
7507
7499
|
}
|
|
7508
7500
|
// value should have no prefix
|
|
7509
7501
|
function _base36To16(value) {
|
|
7510
7502
|
return (new BN(value, 36)).toString(16);
|
|
7511
7503
|
}
|
|
7512
7504
|
|
|
7513
|
-
const
|
|
7514
|
-
const _constructorGuard$1 = {};
|
|
7515
|
-
const Zero$1 = BigNumber.from(0);
|
|
7516
|
-
const NegativeOne$1 = BigNumber.from(-1);
|
|
7517
|
-
function throwFault(message, fault, operation, value) {
|
|
7518
|
-
const params = { fault: fault, operation: operation };
|
|
7519
|
-
if (value !== undefined) {
|
|
7520
|
-
params.value = value;
|
|
7521
|
-
}
|
|
7522
|
-
return logger$e.throwError(message, Logger.errors.NUMERIC_FAULT, params);
|
|
7523
|
-
}
|
|
7524
|
-
// Constant to pull zeros from for multipliers
|
|
7525
|
-
let zeros = "0";
|
|
7526
|
-
while (zeros.length < 256) {
|
|
7527
|
-
zeros += zeros;
|
|
7528
|
-
}
|
|
7529
|
-
// Returns a string "1" followed by decimal "0"s
|
|
7530
|
-
function getMultiplier(decimals) {
|
|
7531
|
-
if (typeof (decimals) !== "number") {
|
|
7532
|
-
try {
|
|
7533
|
-
decimals = BigNumber.from(decimals).toNumber();
|
|
7534
|
-
}
|
|
7535
|
-
catch (e) { }
|
|
7536
|
-
}
|
|
7537
|
-
if (typeof (decimals) === "number" && decimals >= 0 && decimals <= 256 && !(decimals % 1)) {
|
|
7538
|
-
return ("1" + zeros.substring(0, decimals));
|
|
7539
|
-
}
|
|
7540
|
-
return logger$e.throwArgumentError("invalid decimal size", "decimals", decimals);
|
|
7541
|
-
}
|
|
7542
|
-
function formatFixed(value, decimals) {
|
|
7543
|
-
if (decimals == null) {
|
|
7544
|
-
decimals = 0;
|
|
7545
|
-
}
|
|
7546
|
-
const multiplier = getMultiplier(decimals);
|
|
7547
|
-
// Make sure wei is a big number (convert as necessary)
|
|
7548
|
-
value = BigNumber.from(value);
|
|
7549
|
-
const negative = value.lt(Zero$1);
|
|
7550
|
-
if (negative) {
|
|
7551
|
-
value = value.mul(NegativeOne$1);
|
|
7552
|
-
}
|
|
7553
|
-
let fraction = value.mod(multiplier).toString();
|
|
7554
|
-
while (fraction.length < multiplier.length - 1) {
|
|
7555
|
-
fraction = "0" + fraction;
|
|
7556
|
-
}
|
|
7557
|
-
// Strip training 0
|
|
7558
|
-
fraction = fraction.match(/^([0-9]*[1-9]|0)(0*)/)[1];
|
|
7559
|
-
const whole = value.div(multiplier).toString();
|
|
7560
|
-
if (multiplier.length === 1) {
|
|
7561
|
-
value = whole;
|
|
7562
|
-
}
|
|
7563
|
-
else {
|
|
7564
|
-
value = whole + "." + fraction;
|
|
7565
|
-
}
|
|
7566
|
-
if (negative) {
|
|
7567
|
-
value = "-" + value;
|
|
7568
|
-
}
|
|
7569
|
-
return value;
|
|
7570
|
-
}
|
|
7571
|
-
function parseFixed(value, decimals) {
|
|
7572
|
-
if (decimals == null) {
|
|
7573
|
-
decimals = 0;
|
|
7574
|
-
}
|
|
7575
|
-
const multiplier = getMultiplier(decimals);
|
|
7576
|
-
if (typeof (value) !== "string" || !value.match(/^-?[0-9.]+$/)) {
|
|
7577
|
-
logger$e.throwArgumentError("invalid decimal value", "value", value);
|
|
7578
|
-
}
|
|
7579
|
-
// Is it negative?
|
|
7580
|
-
const negative = (value.substring(0, 1) === "-");
|
|
7581
|
-
if (negative) {
|
|
7582
|
-
value = value.substring(1);
|
|
7583
|
-
}
|
|
7584
|
-
if (value === ".") {
|
|
7585
|
-
logger$e.throwArgumentError("missing value", "value", value);
|
|
7586
|
-
}
|
|
7587
|
-
// Split it into a whole and fractional part
|
|
7588
|
-
const comps = value.split(".");
|
|
7589
|
-
if (comps.length > 2) {
|
|
7590
|
-
logger$e.throwArgumentError("too many decimal points", "value", value);
|
|
7591
|
-
}
|
|
7592
|
-
let whole = comps[0], fraction = comps[1];
|
|
7593
|
-
if (!whole) {
|
|
7594
|
-
whole = "0";
|
|
7595
|
-
}
|
|
7596
|
-
if (!fraction) {
|
|
7597
|
-
fraction = "0";
|
|
7598
|
-
}
|
|
7599
|
-
// Trim trailing zeros
|
|
7600
|
-
while (fraction[fraction.length - 1] === "0") {
|
|
7601
|
-
fraction = fraction.substring(0, fraction.length - 1);
|
|
7602
|
-
}
|
|
7603
|
-
// Check the fraction doesn't exceed our decimals size
|
|
7604
|
-
if (fraction.length > multiplier.length - 1) {
|
|
7605
|
-
throwFault("fractional component exceeds decimals", "underflow", "parseFixed");
|
|
7606
|
-
}
|
|
7607
|
-
// If decimals is 0, we have an empty string for fraction
|
|
7608
|
-
if (fraction === "") {
|
|
7609
|
-
fraction = "0";
|
|
7610
|
-
}
|
|
7611
|
-
// Fully pad the string with zeros to get to wei
|
|
7612
|
-
while (fraction.length < multiplier.length - 1) {
|
|
7613
|
-
fraction += "0";
|
|
7614
|
-
}
|
|
7615
|
-
const wholeValue = BigNumber.from(whole);
|
|
7616
|
-
const fractionValue = BigNumber.from(fraction);
|
|
7617
|
-
let wei = (wholeValue.mul(multiplier)).add(fractionValue);
|
|
7618
|
-
if (negative) {
|
|
7619
|
-
wei = wei.mul(NegativeOne$1);
|
|
7620
|
-
}
|
|
7621
|
-
return wei;
|
|
7622
|
-
}
|
|
7623
|
-
class FixedFormat {
|
|
7624
|
-
constructor(constructorGuard, signed, width, decimals) {
|
|
7625
|
-
if (constructorGuard !== _constructorGuard$1) {
|
|
7626
|
-
logger$e.throwError("cannot use FixedFormat constructor; use FixedFormat.from", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
7627
|
-
operation: "new FixedFormat"
|
|
7628
|
-
});
|
|
7629
|
-
}
|
|
7630
|
-
this.signed = signed;
|
|
7631
|
-
this.width = width;
|
|
7632
|
-
this.decimals = decimals;
|
|
7633
|
-
this.name = (signed ? "" : "u") + "fixed" + String(width) + "x" + String(decimals);
|
|
7634
|
-
this._multiplier = getMultiplier(decimals);
|
|
7635
|
-
Object.freeze(this);
|
|
7636
|
-
}
|
|
7637
|
-
static from(value) {
|
|
7638
|
-
if (value instanceof FixedFormat) {
|
|
7639
|
-
return value;
|
|
7640
|
-
}
|
|
7641
|
-
if (typeof (value) === "number") {
|
|
7642
|
-
value = `fixed128x${value}`;
|
|
7643
|
-
}
|
|
7644
|
-
let signed = true;
|
|
7645
|
-
let width = 128;
|
|
7646
|
-
let decimals = 18;
|
|
7647
|
-
if (typeof (value) === "string") {
|
|
7648
|
-
if (value === "fixed") ;
|
|
7649
|
-
else if (value === "ufixed") {
|
|
7650
|
-
signed = false;
|
|
7651
|
-
}
|
|
7652
|
-
else {
|
|
7653
|
-
const match = value.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);
|
|
7654
|
-
if (!match) {
|
|
7655
|
-
logger$e.throwArgumentError("invalid fixed format", "format", value);
|
|
7656
|
-
}
|
|
7657
|
-
signed = (match[1] !== "u");
|
|
7658
|
-
width = parseInt(match[2]);
|
|
7659
|
-
decimals = parseInt(match[3]);
|
|
7660
|
-
}
|
|
7661
|
-
}
|
|
7662
|
-
else if (value) {
|
|
7663
|
-
const check = (key, type, defaultValue) => {
|
|
7664
|
-
if (value[key] == null) {
|
|
7665
|
-
return defaultValue;
|
|
7666
|
-
}
|
|
7667
|
-
if (typeof (value[key]) !== type) {
|
|
7668
|
-
logger$e.throwArgumentError("invalid fixed format (" + key + " not " + type + ")", "format." + key, value[key]);
|
|
7669
|
-
}
|
|
7670
|
-
return value[key];
|
|
7671
|
-
};
|
|
7672
|
-
signed = check("signed", "boolean", signed);
|
|
7673
|
-
width = check("width", "number", width);
|
|
7674
|
-
decimals = check("decimals", "number", decimals);
|
|
7675
|
-
}
|
|
7676
|
-
if (width % 8) {
|
|
7677
|
-
logger$e.throwArgumentError("invalid fixed format width (not byte aligned)", "format.width", width);
|
|
7678
|
-
}
|
|
7679
|
-
if (decimals > 80) {
|
|
7680
|
-
logger$e.throwArgumentError("invalid fixed format (decimals too large)", "format.decimals", decimals);
|
|
7681
|
-
}
|
|
7682
|
-
return new FixedFormat(_constructorGuard$1, signed, width, decimals);
|
|
7683
|
-
}
|
|
7684
|
-
}
|
|
7685
|
-
class FixedNumber {
|
|
7686
|
-
constructor(constructorGuard, hex, value, format) {
|
|
7687
|
-
if (constructorGuard !== _constructorGuard$1) {
|
|
7688
|
-
logger$e.throwError("cannot use FixedNumber constructor; use FixedNumber.from", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
7689
|
-
operation: "new FixedFormat"
|
|
7690
|
-
});
|
|
7691
|
-
}
|
|
7692
|
-
this.format = format;
|
|
7693
|
-
this._hex = hex;
|
|
7694
|
-
this._value = value;
|
|
7695
|
-
this._isFixedNumber = true;
|
|
7696
|
-
Object.freeze(this);
|
|
7697
|
-
}
|
|
7698
|
-
_checkFormat(other) {
|
|
7699
|
-
if (this.format.name !== other.format.name) {
|
|
7700
|
-
logger$e.throwArgumentError("incompatible format; use fixedNumber.toFormat", "other", other);
|
|
7701
|
-
}
|
|
7702
|
-
}
|
|
7703
|
-
addUnsafe(other) {
|
|
7704
|
-
this._checkFormat(other);
|
|
7705
|
-
const a = parseFixed(this._value, this.format.decimals);
|
|
7706
|
-
const b = parseFixed(other._value, other.format.decimals);
|
|
7707
|
-
return FixedNumber.fromValue(a.add(b), this.format.decimals, this.format);
|
|
7708
|
-
}
|
|
7709
|
-
subUnsafe(other) {
|
|
7710
|
-
this._checkFormat(other);
|
|
7711
|
-
const a = parseFixed(this._value, this.format.decimals);
|
|
7712
|
-
const b = parseFixed(other._value, other.format.decimals);
|
|
7713
|
-
return FixedNumber.fromValue(a.sub(b), this.format.decimals, this.format);
|
|
7714
|
-
}
|
|
7715
|
-
mulUnsafe(other) {
|
|
7716
|
-
this._checkFormat(other);
|
|
7717
|
-
const a = parseFixed(this._value, this.format.decimals);
|
|
7718
|
-
const b = parseFixed(other._value, other.format.decimals);
|
|
7719
|
-
return FixedNumber.fromValue(a.mul(b).div(this.format._multiplier), this.format.decimals, this.format);
|
|
7720
|
-
}
|
|
7721
|
-
divUnsafe(other) {
|
|
7722
|
-
this._checkFormat(other);
|
|
7723
|
-
const a = parseFixed(this._value, this.format.decimals);
|
|
7724
|
-
const b = parseFixed(other._value, other.format.decimals);
|
|
7725
|
-
return FixedNumber.fromValue(a.mul(this.format._multiplier).div(b), this.format.decimals, this.format);
|
|
7726
|
-
}
|
|
7727
|
-
floor() {
|
|
7728
|
-
const comps = this.toString().split(".");
|
|
7729
|
-
if (comps.length === 1) {
|
|
7730
|
-
comps.push("0");
|
|
7731
|
-
}
|
|
7732
|
-
let result = FixedNumber.from(comps[0], this.format);
|
|
7733
|
-
const hasFraction = !comps[1].match(/^(0*)$/);
|
|
7734
|
-
if (this.isNegative() && hasFraction) {
|
|
7735
|
-
result = result.subUnsafe(ONE.toFormat(result.format));
|
|
7736
|
-
}
|
|
7737
|
-
return result;
|
|
7738
|
-
}
|
|
7739
|
-
ceiling() {
|
|
7740
|
-
const comps = this.toString().split(".");
|
|
7741
|
-
if (comps.length === 1) {
|
|
7742
|
-
comps.push("0");
|
|
7743
|
-
}
|
|
7744
|
-
let result = FixedNumber.from(comps[0], this.format);
|
|
7745
|
-
const hasFraction = !comps[1].match(/^(0*)$/);
|
|
7746
|
-
if (!this.isNegative() && hasFraction) {
|
|
7747
|
-
result = result.addUnsafe(ONE.toFormat(result.format));
|
|
7748
|
-
}
|
|
7749
|
-
return result;
|
|
7750
|
-
}
|
|
7751
|
-
// @TODO: Support other rounding algorithms
|
|
7752
|
-
round(decimals) {
|
|
7753
|
-
if (decimals == null) {
|
|
7754
|
-
decimals = 0;
|
|
7755
|
-
}
|
|
7756
|
-
// If we are already in range, we're done
|
|
7757
|
-
const comps = this.toString().split(".");
|
|
7758
|
-
if (comps.length === 1) {
|
|
7759
|
-
comps.push("0");
|
|
7760
|
-
}
|
|
7761
|
-
if (decimals < 0 || decimals > 80 || (decimals % 1)) {
|
|
7762
|
-
logger$e.throwArgumentError("invalid decimal count", "decimals", decimals);
|
|
7763
|
-
}
|
|
7764
|
-
if (comps[1].length <= decimals) {
|
|
7765
|
-
return this;
|
|
7766
|
-
}
|
|
7767
|
-
const factor = FixedNumber.from("1" + zeros.substring(0, decimals), this.format);
|
|
7768
|
-
const bump = BUMP.toFormat(this.format);
|
|
7769
|
-
return this.mulUnsafe(factor).addUnsafe(bump).floor().divUnsafe(factor);
|
|
7770
|
-
}
|
|
7771
|
-
isZero() {
|
|
7772
|
-
return (this._value === "0.0" || this._value === "0");
|
|
7773
|
-
}
|
|
7774
|
-
isNegative() {
|
|
7775
|
-
return (this._value[0] === "-");
|
|
7776
|
-
}
|
|
7777
|
-
toString() { return this._value; }
|
|
7778
|
-
toHexString(width) {
|
|
7779
|
-
if (width == null) {
|
|
7780
|
-
return this._hex;
|
|
7781
|
-
}
|
|
7782
|
-
if (width % 8) {
|
|
7783
|
-
logger$e.throwArgumentError("invalid byte width", "width", width);
|
|
7784
|
-
}
|
|
7785
|
-
const hex = BigNumber.from(this._hex).fromTwos(this.format.width).toTwos(width).toHexString();
|
|
7786
|
-
return hexZeroPad(hex, width / 8);
|
|
7787
|
-
}
|
|
7788
|
-
toUnsafeFloat() { return parseFloat(this.toString()); }
|
|
7789
|
-
toFormat(format) {
|
|
7790
|
-
return FixedNumber.fromString(this._value, format);
|
|
7791
|
-
}
|
|
7792
|
-
static fromValue(value, decimals, format) {
|
|
7793
|
-
// If decimals looks more like a format, and there is no format, shift the parameters
|
|
7794
|
-
if (format == null && decimals != null && !isBigNumberish(decimals)) {
|
|
7795
|
-
format = decimals;
|
|
7796
|
-
decimals = null;
|
|
7797
|
-
}
|
|
7798
|
-
if (decimals == null) {
|
|
7799
|
-
decimals = 0;
|
|
7800
|
-
}
|
|
7801
|
-
if (format == null) {
|
|
7802
|
-
format = "fixed";
|
|
7803
|
-
}
|
|
7804
|
-
return FixedNumber.fromString(formatFixed(value, decimals), FixedFormat.from(format));
|
|
7805
|
-
}
|
|
7806
|
-
static fromString(value, format) {
|
|
7807
|
-
if (format == null) {
|
|
7808
|
-
format = "fixed";
|
|
7809
|
-
}
|
|
7810
|
-
const fixedFormat = FixedFormat.from(format);
|
|
7811
|
-
const numeric = parseFixed(value, fixedFormat.decimals);
|
|
7812
|
-
if (!fixedFormat.signed && numeric.lt(Zero$1)) {
|
|
7813
|
-
throwFault("unsigned value cannot be negative", "overflow", "value", value);
|
|
7814
|
-
}
|
|
7815
|
-
let hex = null;
|
|
7816
|
-
if (fixedFormat.signed) {
|
|
7817
|
-
hex = numeric.toTwos(fixedFormat.width).toHexString();
|
|
7818
|
-
}
|
|
7819
|
-
else {
|
|
7820
|
-
hex = numeric.toHexString();
|
|
7821
|
-
hex = hexZeroPad(hex, fixedFormat.width / 8);
|
|
7822
|
-
}
|
|
7823
|
-
const decimal = formatFixed(numeric, fixedFormat.decimals);
|
|
7824
|
-
return new FixedNumber(_constructorGuard$1, hex, decimal, fixedFormat);
|
|
7825
|
-
}
|
|
7826
|
-
static fromBytes(value, format) {
|
|
7827
|
-
if (format == null) {
|
|
7828
|
-
format = "fixed";
|
|
7829
|
-
}
|
|
7830
|
-
const fixedFormat = FixedFormat.from(format);
|
|
7831
|
-
if (arrayify(value).length > fixedFormat.width / 8) {
|
|
7832
|
-
throw new Error("overflow");
|
|
7833
|
-
}
|
|
7834
|
-
let numeric = BigNumber.from(value);
|
|
7835
|
-
if (fixedFormat.signed) {
|
|
7836
|
-
numeric = numeric.fromTwos(fixedFormat.width);
|
|
7837
|
-
}
|
|
7838
|
-
const hex = numeric.toTwos((fixedFormat.signed ? 0 : 1) + fixedFormat.width).toHexString();
|
|
7839
|
-
const decimal = formatFixed(numeric, fixedFormat.decimals);
|
|
7840
|
-
return new FixedNumber(_constructorGuard$1, hex, decimal, fixedFormat);
|
|
7841
|
-
}
|
|
7842
|
-
static from(value, format) {
|
|
7843
|
-
if (typeof (value) === "string") {
|
|
7844
|
-
return FixedNumber.fromString(value, format);
|
|
7845
|
-
}
|
|
7846
|
-
if (isBytes(value)) {
|
|
7847
|
-
return FixedNumber.fromBytes(value, format);
|
|
7848
|
-
}
|
|
7849
|
-
try {
|
|
7850
|
-
return FixedNumber.fromValue(value, 0, format);
|
|
7851
|
-
}
|
|
7852
|
-
catch (error) {
|
|
7853
|
-
// Allow NUMERIC_FAULT to bubble up
|
|
7854
|
-
if (error.code !== Logger.errors.INVALID_ARGUMENT) {
|
|
7855
|
-
throw error;
|
|
7856
|
-
}
|
|
7857
|
-
}
|
|
7858
|
-
return logger$e.throwArgumentError("invalid FixedNumber value", "value", value);
|
|
7859
|
-
}
|
|
7860
|
-
static isFixedNumber(value) {
|
|
7861
|
-
return !!(value && value._isFixedNumber);
|
|
7862
|
-
}
|
|
7863
|
-
}
|
|
7864
|
-
const ONE = FixedNumber.from(1);
|
|
7865
|
-
const BUMP = FixedNumber.from("0.5");
|
|
7866
|
-
|
|
7867
|
-
const version$9 = "properties/5.7.0";
|
|
7505
|
+
const version$8 = "properties/5.7.0";
|
|
7868
7506
|
|
|
7869
7507
|
var __awaiter$3 = function (thisArg, _arguments, P, generator) {
|
|
7870
7508
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -7875,7 +7513,7 @@ var __awaiter$3 = function (thisArg, _arguments, P, generator) {
|
|
|
7875
7513
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
7876
7514
|
});
|
|
7877
7515
|
};
|
|
7878
|
-
const logger$
|
|
7516
|
+
const logger$c = new Logger(version$8);
|
|
7879
7517
|
function defineReadOnly(object, name, value) {
|
|
7880
7518
|
Object.defineProperty(object, name, {
|
|
7881
7519
|
enumerable: true,
|
|
@@ -7943,7 +7581,7 @@ function _isFrozen(object) {
|
|
|
7943
7581
|
}
|
|
7944
7582
|
return true;
|
|
7945
7583
|
}
|
|
7946
|
-
return logger$
|
|
7584
|
+
return logger$c.throwArgumentError(`Cannot deepCopy ${typeof (object)}`, "object", object);
|
|
7947
7585
|
}
|
|
7948
7586
|
// Returns a new copy of object, such that no properties may be replaced.
|
|
7949
7587
|
// New properties may be added only to objects.
|
|
@@ -7966,7 +7604,7 @@ function _deepCopy(object) {
|
|
|
7966
7604
|
}
|
|
7967
7605
|
return result;
|
|
7968
7606
|
}
|
|
7969
|
-
return logger$
|
|
7607
|
+
return logger$c.throwArgumentError(`Cannot deepCopy ${typeof (object)}`, "object", object);
|
|
7970
7608
|
}
|
|
7971
7609
|
function deepCopy(object) {
|
|
7972
7610
|
return _deepCopy(object);
|
|
@@ -7979,9 +7617,9 @@ class Description {
|
|
|
7979
7617
|
}
|
|
7980
7618
|
}
|
|
7981
7619
|
|
|
7982
|
-
const version$
|
|
7620
|
+
const version$7 = "abi/5.7.0";
|
|
7983
7621
|
|
|
7984
|
-
const logger$
|
|
7622
|
+
const logger$b = new Logger(version$7);
|
|
7985
7623
|
const _constructorGuard = {};
|
|
7986
7624
|
let ModifiersBytes = { calldata: true, memory: true, storage: true };
|
|
7987
7625
|
let ModifiersNest = { calldata: true, memory: true };
|
|
@@ -8002,7 +7640,7 @@ function checkModifier(type, name) {
|
|
|
8002
7640
|
}
|
|
8003
7641
|
}
|
|
8004
7642
|
if (ModifiersBytes[name] || name === "payable") {
|
|
8005
|
-
logger$
|
|
7643
|
+
logger$b.throwArgumentError("invalid modifier", "name", name);
|
|
8006
7644
|
}
|
|
8007
7645
|
return false;
|
|
8008
7646
|
}
|
|
@@ -8010,7 +7648,7 @@ function checkModifier(type, name) {
|
|
|
8010
7648
|
function parseParamType(param, allowIndexed) {
|
|
8011
7649
|
let originalParam = param;
|
|
8012
7650
|
function throwError(i) {
|
|
8013
|
-
logger$
|
|
7651
|
+
logger$b.throwArgumentError(`unexpected character at position ${i}`, "param", param);
|
|
8014
7652
|
}
|
|
8015
7653
|
param = param.replace(/\s/g, " ");
|
|
8016
7654
|
function newNode(parent) {
|
|
@@ -8149,7 +7787,7 @@ function parseParamType(param, allowIndexed) {
|
|
|
8149
7787
|
}
|
|
8150
7788
|
}
|
|
8151
7789
|
if (node.parent) {
|
|
8152
|
-
logger$
|
|
7790
|
+
logger$b.throwArgumentError("unexpected eof", "param", param);
|
|
8153
7791
|
}
|
|
8154
7792
|
delete parent.state;
|
|
8155
7793
|
if (node.name === "indexed") {
|
|
@@ -8187,7 +7825,7 @@ const paramTypeArray = new RegExp(/^(.*)\[([0-9]*)\]$/);
|
|
|
8187
7825
|
class ParamType {
|
|
8188
7826
|
constructor(constructorGuard, params) {
|
|
8189
7827
|
if (constructorGuard !== _constructorGuard) {
|
|
8190
|
-
logger$
|
|
7828
|
+
logger$b.throwError("use fromString", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
8191
7829
|
operation: "new ParamType()"
|
|
8192
7830
|
});
|
|
8193
7831
|
}
|
|
@@ -8222,7 +7860,7 @@ class ParamType {
|
|
|
8222
7860
|
format = FormatTypes.sighash;
|
|
8223
7861
|
}
|
|
8224
7862
|
if (!FormatTypes[format]) {
|
|
8225
|
-
logger$
|
|
7863
|
+
logger$b.throwArgumentError("invalid format type", "format", format);
|
|
8226
7864
|
}
|
|
8227
7865
|
if (format === FormatTypes.json) {
|
|
8228
7866
|
let result = {
|
|
@@ -8302,7 +7940,7 @@ function parseParams(value, allowIndex) {
|
|
|
8302
7940
|
class Fragment {
|
|
8303
7941
|
constructor(constructorGuard, params) {
|
|
8304
7942
|
if (constructorGuard !== _constructorGuard) {
|
|
8305
|
-
logger$
|
|
7943
|
+
logger$b.throwError("use a static from method", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
8306
7944
|
operation: "new Fragment()"
|
|
8307
7945
|
});
|
|
8308
7946
|
}
|
|
@@ -8337,7 +7975,7 @@ class Fragment {
|
|
|
8337
7975
|
// @TODO: Something? Maybe return a FunctionFragment? A custom DefaultFunctionFragment?
|
|
8338
7976
|
return null;
|
|
8339
7977
|
}
|
|
8340
|
-
return logger$
|
|
7978
|
+
return logger$b.throwArgumentError("invalid fragment object", "value", value);
|
|
8341
7979
|
}
|
|
8342
7980
|
static fromString(value) {
|
|
8343
7981
|
// Make sure the "returns" is surrounded by a space and all whitespace is exactly one space
|
|
@@ -8356,7 +7994,7 @@ class Fragment {
|
|
|
8356
7994
|
else if (value.split(" ")[0] === "error") {
|
|
8357
7995
|
return ErrorFragment.fromString(value.substring(5).trim());
|
|
8358
7996
|
}
|
|
8359
|
-
return logger$
|
|
7997
|
+
return logger$b.throwArgumentError("unsupported fragment", "value", value);
|
|
8360
7998
|
}
|
|
8361
7999
|
static isFragment(value) {
|
|
8362
8000
|
return !!(value && value._isFragment);
|
|
@@ -8368,7 +8006,7 @@ class EventFragment extends Fragment {
|
|
|
8368
8006
|
format = FormatTypes.sighash;
|
|
8369
8007
|
}
|
|
8370
8008
|
if (!FormatTypes[format]) {
|
|
8371
|
-
logger$
|
|
8009
|
+
logger$b.throwArgumentError("invalid format type", "format", format);
|
|
8372
8010
|
}
|
|
8373
8011
|
if (format === FormatTypes.json) {
|
|
8374
8012
|
return JSON.stringify({
|
|
@@ -8401,7 +8039,7 @@ class EventFragment extends Fragment {
|
|
|
8401
8039
|
return value;
|
|
8402
8040
|
}
|
|
8403
8041
|
if (value.type !== "event") {
|
|
8404
|
-
logger$
|
|
8042
|
+
logger$b.throwArgumentError("invalid event object", "value", value);
|
|
8405
8043
|
}
|
|
8406
8044
|
const params = {
|
|
8407
8045
|
name: verifyIdentifier(value.name),
|
|
@@ -8414,7 +8052,7 @@ class EventFragment extends Fragment {
|
|
|
8414
8052
|
static fromString(value) {
|
|
8415
8053
|
let match = value.match(regexParen);
|
|
8416
8054
|
if (!match) {
|
|
8417
|
-
logger$
|
|
8055
|
+
logger$b.throwArgumentError("invalid event string", "value", value);
|
|
8418
8056
|
}
|
|
8419
8057
|
let anonymous = false;
|
|
8420
8058
|
match[3].split(" ").forEach((modifier) => {
|
|
@@ -8425,7 +8063,7 @@ class EventFragment extends Fragment {
|
|
|
8425
8063
|
case "":
|
|
8426
8064
|
break;
|
|
8427
8065
|
default:
|
|
8428
|
-
logger$
|
|
8066
|
+
logger$b.warn("unknown modifier: " + modifier);
|
|
8429
8067
|
}
|
|
8430
8068
|
});
|
|
8431
8069
|
return EventFragment.fromObject({
|
|
@@ -8444,10 +8082,10 @@ function parseGas(value, params) {
|
|
|
8444
8082
|
let comps = value.split("@");
|
|
8445
8083
|
if (comps.length !== 1) {
|
|
8446
8084
|
if (comps.length > 2) {
|
|
8447
|
-
logger$
|
|
8085
|
+
logger$b.throwArgumentError("invalid human-readable ABI signature", "value", value);
|
|
8448
8086
|
}
|
|
8449
8087
|
if (!comps[1].match(/^[0-9]+$/)) {
|
|
8450
|
-
logger$
|
|
8088
|
+
logger$b.throwArgumentError("invalid human-readable ABI signature gas", "value", value);
|
|
8451
8089
|
}
|
|
8452
8090
|
params.gas = BigNumber.from(comps[1]);
|
|
8453
8091
|
return comps[0];
|
|
@@ -8500,14 +8138,14 @@ function verifyState(value) {
|
|
|
8500
8138
|
result.constant = (result.stateMutability === "view" || result.stateMutability === "pure");
|
|
8501
8139
|
if (value.constant != null) {
|
|
8502
8140
|
if ((!!value.constant) !== result.constant) {
|
|
8503
|
-
logger$
|
|
8141
|
+
logger$b.throwArgumentError("cannot have constant function with mutability " + result.stateMutability, "value", value);
|
|
8504
8142
|
}
|
|
8505
8143
|
}
|
|
8506
8144
|
// Set (and check things are consistent) the payable property
|
|
8507
8145
|
result.payable = (result.stateMutability === "payable");
|
|
8508
8146
|
if (value.payable != null) {
|
|
8509
8147
|
if ((!!value.payable) !== result.payable) {
|
|
8510
|
-
logger$
|
|
8148
|
+
logger$b.throwArgumentError("cannot have payable function with mutability " + result.stateMutability, "value", value);
|
|
8511
8149
|
}
|
|
8512
8150
|
}
|
|
8513
8151
|
}
|
|
@@ -8515,7 +8153,7 @@ function verifyState(value) {
|
|
|
8515
8153
|
result.payable = !!value.payable;
|
|
8516
8154
|
// If payable we can assume non-constant; otherwise we can't assume
|
|
8517
8155
|
if (value.constant == null && !result.payable && value.type !== "constructor") {
|
|
8518
|
-
logger$
|
|
8156
|
+
logger$b.throwArgumentError("unable to determine stateMutability", "value", value);
|
|
8519
8157
|
}
|
|
8520
8158
|
result.constant = !!value.constant;
|
|
8521
8159
|
if (result.constant) {
|
|
@@ -8525,7 +8163,7 @@ function verifyState(value) {
|
|
|
8525
8163
|
result.stateMutability = (result.payable ? "payable" : "nonpayable");
|
|
8526
8164
|
}
|
|
8527
8165
|
if (result.payable && result.constant) {
|
|
8528
|
-
logger$
|
|
8166
|
+
logger$b.throwArgumentError("cannot have constant payable function", "value", value);
|
|
8529
8167
|
}
|
|
8530
8168
|
}
|
|
8531
8169
|
else if (value.constant != null) {
|
|
@@ -8534,7 +8172,7 @@ function verifyState(value) {
|
|
|
8534
8172
|
result.stateMutability = (result.constant ? "view" : "payable");
|
|
8535
8173
|
}
|
|
8536
8174
|
else if (value.type !== "constructor") {
|
|
8537
|
-
logger$
|
|
8175
|
+
logger$b.throwArgumentError("unable to determine stateMutability", "value", value);
|
|
8538
8176
|
}
|
|
8539
8177
|
return result;
|
|
8540
8178
|
}
|
|
@@ -8544,7 +8182,7 @@ class ConstructorFragment extends Fragment {
|
|
|
8544
8182
|
format = FormatTypes.sighash;
|
|
8545
8183
|
}
|
|
8546
8184
|
if (!FormatTypes[format]) {
|
|
8547
|
-
logger$
|
|
8185
|
+
logger$b.throwArgumentError("invalid format type", "format", format);
|
|
8548
8186
|
}
|
|
8549
8187
|
if (format === FormatTypes.json) {
|
|
8550
8188
|
return JSON.stringify({
|
|
@@ -8556,7 +8194,7 @@ class ConstructorFragment extends Fragment {
|
|
|
8556
8194
|
});
|
|
8557
8195
|
}
|
|
8558
8196
|
if (format === FormatTypes.sighash) {
|
|
8559
|
-
logger$
|
|
8197
|
+
logger$b.throwError("cannot format a constructor for sighash", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
8560
8198
|
operation: "format(sighash)"
|
|
8561
8199
|
});
|
|
8562
8200
|
}
|
|
@@ -8577,11 +8215,11 @@ class ConstructorFragment extends Fragment {
|
|
|
8577
8215
|
return value;
|
|
8578
8216
|
}
|
|
8579
8217
|
if (value.type !== "constructor") {
|
|
8580
|
-
logger$
|
|
8218
|
+
logger$b.throwArgumentError("invalid constructor object", "value", value);
|
|
8581
8219
|
}
|
|
8582
8220
|
let state = verifyState(value);
|
|
8583
8221
|
if (state.constant) {
|
|
8584
|
-
logger$
|
|
8222
|
+
logger$b.throwArgumentError("constructor cannot be constant", "value", value);
|
|
8585
8223
|
}
|
|
8586
8224
|
const params = {
|
|
8587
8225
|
name: null,
|
|
@@ -8598,7 +8236,7 @@ class ConstructorFragment extends Fragment {
|
|
|
8598
8236
|
value = parseGas(value, params);
|
|
8599
8237
|
let parens = value.match(regexParen);
|
|
8600
8238
|
if (!parens || parens[1].trim() !== "constructor") {
|
|
8601
|
-
logger$
|
|
8239
|
+
logger$b.throwArgumentError("invalid constructor string", "value", value);
|
|
8602
8240
|
}
|
|
8603
8241
|
params.inputs = parseParams(parens[2].trim(), false);
|
|
8604
8242
|
parseModifiers(parens[3].trim(), params);
|
|
@@ -8614,7 +8252,7 @@ class FunctionFragment extends ConstructorFragment {
|
|
|
8614
8252
|
format = FormatTypes.sighash;
|
|
8615
8253
|
}
|
|
8616
8254
|
if (!FormatTypes[format]) {
|
|
8617
|
-
logger$
|
|
8255
|
+
logger$b.throwArgumentError("invalid format type", "format", format);
|
|
8618
8256
|
}
|
|
8619
8257
|
if (format === FormatTypes.json) {
|
|
8620
8258
|
return JSON.stringify({
|
|
@@ -8662,7 +8300,7 @@ class FunctionFragment extends ConstructorFragment {
|
|
|
8662
8300
|
return value;
|
|
8663
8301
|
}
|
|
8664
8302
|
if (value.type !== "function") {
|
|
8665
|
-
logger$
|
|
8303
|
+
logger$b.throwArgumentError("invalid function object", "value", value);
|
|
8666
8304
|
}
|
|
8667
8305
|
let state = verifyState(value);
|
|
8668
8306
|
const params = {
|
|
@@ -8682,11 +8320,11 @@ class FunctionFragment extends ConstructorFragment {
|
|
|
8682
8320
|
value = parseGas(value, params);
|
|
8683
8321
|
let comps = value.split(" returns ");
|
|
8684
8322
|
if (comps.length > 2) {
|
|
8685
|
-
logger$
|
|
8323
|
+
logger$b.throwArgumentError("invalid function string", "value", value);
|
|
8686
8324
|
}
|
|
8687
8325
|
let parens = comps[0].match(regexParen);
|
|
8688
8326
|
if (!parens) {
|
|
8689
|
-
logger$
|
|
8327
|
+
logger$b.throwArgumentError("invalid function signature", "value", value);
|
|
8690
8328
|
}
|
|
8691
8329
|
params.name = parens[1].trim();
|
|
8692
8330
|
if (params.name) {
|
|
@@ -8698,7 +8336,7 @@ class FunctionFragment extends ConstructorFragment {
|
|
|
8698
8336
|
if (comps.length > 1) {
|
|
8699
8337
|
let returns = comps[1].match(regexParen);
|
|
8700
8338
|
if (returns[1].trim() != "" || returns[3].trim() != "") {
|
|
8701
|
-
logger$
|
|
8339
|
+
logger$b.throwArgumentError("unexpected tokens", "value", value);
|
|
8702
8340
|
}
|
|
8703
8341
|
params.outputs = parseParams(returns[2], false);
|
|
8704
8342
|
}
|
|
@@ -8716,7 +8354,7 @@ class FunctionFragment extends ConstructorFragment {
|
|
|
8716
8354
|
function checkForbidden(fragment) {
|
|
8717
8355
|
const sig = fragment.format();
|
|
8718
8356
|
if (sig === "Error(string)" || sig === "Panic(uint256)") {
|
|
8719
|
-
logger$
|
|
8357
|
+
logger$b.throwArgumentError(`cannot specify user defined ${sig} error`, "fragment", fragment);
|
|
8720
8358
|
}
|
|
8721
8359
|
return fragment;
|
|
8722
8360
|
}
|
|
@@ -8726,7 +8364,7 @@ class ErrorFragment extends Fragment {
|
|
|
8726
8364
|
format = FormatTypes.sighash;
|
|
8727
8365
|
}
|
|
8728
8366
|
if (!FormatTypes[format]) {
|
|
8729
|
-
logger$
|
|
8367
|
+
logger$b.throwArgumentError("invalid format type", "format", format);
|
|
8730
8368
|
}
|
|
8731
8369
|
if (format === FormatTypes.json) {
|
|
8732
8370
|
return JSON.stringify({
|
|
@@ -8753,7 +8391,7 @@ class ErrorFragment extends Fragment {
|
|
|
8753
8391
|
return value;
|
|
8754
8392
|
}
|
|
8755
8393
|
if (value.type !== "error") {
|
|
8756
|
-
logger$
|
|
8394
|
+
logger$b.throwArgumentError("invalid error object", "value", value);
|
|
8757
8395
|
}
|
|
8758
8396
|
const params = {
|
|
8759
8397
|
type: value.type,
|
|
@@ -8766,7 +8404,7 @@ class ErrorFragment extends Fragment {
|
|
|
8766
8404
|
let params = { type: "error" };
|
|
8767
8405
|
let parens = value.match(regexParen);
|
|
8768
8406
|
if (!parens) {
|
|
8769
|
-
logger$
|
|
8407
|
+
logger$b.throwArgumentError("invalid error signature", "value", value);
|
|
8770
8408
|
}
|
|
8771
8409
|
params.name = parens[1].trim();
|
|
8772
8410
|
if (params.name) {
|
|
@@ -8794,7 +8432,7 @@ function verifyType(type) {
|
|
|
8794
8432
|
const regexIdentifier = new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");
|
|
8795
8433
|
function verifyIdentifier(value) {
|
|
8796
8434
|
if (!value || !value.match(regexIdentifier)) {
|
|
8797
|
-
logger$
|
|
8435
|
+
logger$b.throwArgumentError(`invalid identifier "${value}"`, "value", value);
|
|
8798
8436
|
}
|
|
8799
8437
|
return value;
|
|
8800
8438
|
}
|
|
@@ -8818,7 +8456,7 @@ function splitNesting(value) {
|
|
|
8818
8456
|
else if (c === ")") {
|
|
8819
8457
|
depth--;
|
|
8820
8458
|
if (depth === -1) {
|
|
8821
|
-
logger$
|
|
8459
|
+
logger$b.throwArgumentError("unbalanced parenthesis", "value", value);
|
|
8822
8460
|
}
|
|
8823
8461
|
}
|
|
8824
8462
|
}
|
|
@@ -8829,7 +8467,7 @@ function splitNesting(value) {
|
|
|
8829
8467
|
return result;
|
|
8830
8468
|
}
|
|
8831
8469
|
|
|
8832
|
-
const logger$
|
|
8470
|
+
const logger$a = new Logger(version$7);
|
|
8833
8471
|
function checkResultErrors(result) {
|
|
8834
8472
|
// Find the first error (if any)
|
|
8835
8473
|
const errors = [];
|
|
@@ -8860,7 +8498,7 @@ class Coder {
|
|
|
8860
8498
|
this.dynamic = dynamic;
|
|
8861
8499
|
}
|
|
8862
8500
|
_throwError(message, value) {
|
|
8863
|
-
logger$
|
|
8501
|
+
logger$a.throwArgumentError(message, this.localName, value);
|
|
8864
8502
|
}
|
|
8865
8503
|
}
|
|
8866
8504
|
class Writer {
|
|
@@ -8894,7 +8532,7 @@ class Writer {
|
|
|
8894
8532
|
_getValue(value) {
|
|
8895
8533
|
let bytes = arrayify(BigNumber.from(value));
|
|
8896
8534
|
if (bytes.length > this.wordSize) {
|
|
8897
|
-
logger$
|
|
8535
|
+
logger$a.throwError("value out-of-bounds", Logger.errors.BUFFER_OVERRUN, {
|
|
8898
8536
|
length: this.wordSize,
|
|
8899
8537
|
offset: bytes.length
|
|
8900
8538
|
});
|
|
@@ -8948,7 +8586,7 @@ class Reader {
|
|
|
8948
8586
|
alignedLength = length;
|
|
8949
8587
|
}
|
|
8950
8588
|
else {
|
|
8951
|
-
logger$
|
|
8589
|
+
logger$a.throwError("data out-of-bounds", Logger.errors.BUFFER_OVERRUN, {
|
|
8952
8590
|
length: this._data.length,
|
|
8953
8591
|
offset: this._offset + alignedLength
|
|
8954
8592
|
});
|
|
@@ -9632,9 +9270,9 @@ function keccak256(data) {
|
|
|
9632
9270
|
return '0x' + sha3.keccak_256(arrayify(data));
|
|
9633
9271
|
}
|
|
9634
9272
|
|
|
9635
|
-
const version$
|
|
9273
|
+
const version$6 = "rlp/5.7.0";
|
|
9636
9274
|
|
|
9637
|
-
const logger$
|
|
9275
|
+
const logger$9 = new Logger(version$6);
|
|
9638
9276
|
function arrayifyInteger(value) {
|
|
9639
9277
|
const result = [];
|
|
9640
9278
|
while (value) {
|
|
@@ -9658,7 +9296,7 @@ function _encode(object) {
|
|
|
9658
9296
|
return length.concat(payload);
|
|
9659
9297
|
}
|
|
9660
9298
|
if (!isBytesLike(object)) {
|
|
9661
|
-
logger$
|
|
9299
|
+
logger$9.throwArgumentError("RLP object must be BytesLike", "object", object);
|
|
9662
9300
|
}
|
|
9663
9301
|
const data = Array.prototype.slice.call(arrayify(object));
|
|
9664
9302
|
if (data.length === 1 && data[0] <= 0x7f) {
|
|
@@ -9676,12 +9314,12 @@ function encode(object) {
|
|
|
9676
9314
|
return hexlify(_encode(object));
|
|
9677
9315
|
}
|
|
9678
9316
|
|
|
9679
|
-
const version$
|
|
9317
|
+
const version$5 = "address/5.7.0";
|
|
9680
9318
|
|
|
9681
|
-
const logger$
|
|
9319
|
+
const logger$8 = new Logger(version$5);
|
|
9682
9320
|
function getChecksumAddress(address) {
|
|
9683
9321
|
if (!isHexString(address, 20)) {
|
|
9684
|
-
logger$
|
|
9322
|
+
logger$8.throwArgumentError("invalid address", "address", address);
|
|
9685
9323
|
}
|
|
9686
9324
|
address = address.toLowerCase();
|
|
9687
9325
|
const chars = address.substring(2).split("");
|
|
@@ -9737,7 +9375,7 @@ function ibanChecksum(address) {
|
|
|
9737
9375
|
function getAddress(address) {
|
|
9738
9376
|
let result = null;
|
|
9739
9377
|
if (typeof (address) !== "string") {
|
|
9740
|
-
logger$
|
|
9378
|
+
logger$8.throwArgumentError("invalid address", "address", address);
|
|
9741
9379
|
}
|
|
9742
9380
|
if (address.match(/^(0x)?[0-9a-fA-F]{40}$/)) {
|
|
9743
9381
|
// Missing the 0x prefix
|
|
@@ -9747,14 +9385,14 @@ function getAddress(address) {
|
|
|
9747
9385
|
result = getChecksumAddress(address);
|
|
9748
9386
|
// It is a checksummed address with a bad checksum
|
|
9749
9387
|
if (address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) && result !== address) {
|
|
9750
|
-
logger$
|
|
9388
|
+
logger$8.throwArgumentError("bad address checksum", "address", address);
|
|
9751
9389
|
}
|
|
9752
9390
|
// Maybe ICAP? (we only support direct mode)
|
|
9753
9391
|
}
|
|
9754
9392
|
else if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {
|
|
9755
9393
|
// It is an ICAP address with a bad checksum
|
|
9756
9394
|
if (address.substring(2, 4) !== ibanChecksum(address)) {
|
|
9757
|
-
logger$
|
|
9395
|
+
logger$8.throwArgumentError("bad icap checksum", "address", address);
|
|
9758
9396
|
}
|
|
9759
9397
|
result = _base36To16(address.substring(4));
|
|
9760
9398
|
while (result.length < 40) {
|
|
@@ -9763,7 +9401,7 @@ function getAddress(address) {
|
|
|
9763
9401
|
result = getChecksumAddress("0x" + result);
|
|
9764
9402
|
}
|
|
9765
9403
|
else {
|
|
9766
|
-
logger$
|
|
9404
|
+
logger$8.throwArgumentError("invalid address", "address", address);
|
|
9767
9405
|
}
|
|
9768
9406
|
return result;
|
|
9769
9407
|
}
|
|
@@ -9782,7 +9420,7 @@ function getContractAddress(transaction) {
|
|
|
9782
9420
|
from = getAddress(transaction.from);
|
|
9783
9421
|
}
|
|
9784
9422
|
catch (error) {
|
|
9785
|
-
logger$
|
|
9423
|
+
logger$8.throwArgumentError("missing from address", "transaction", transaction);
|
|
9786
9424
|
}
|
|
9787
9425
|
const nonce = stripZeros(arrayify(BigNumber.from(transaction.nonce).toHexString()));
|
|
9788
9426
|
return getAddress(hexDataSlice(keccak256(encode([from, nonce])), 12));
|
|
@@ -9826,7 +9464,7 @@ class AnonymousCoder extends Coder {
|
|
|
9826
9464
|
}
|
|
9827
9465
|
}
|
|
9828
9466
|
|
|
9829
|
-
const logger$
|
|
9467
|
+
const logger$7 = new Logger(version$7);
|
|
9830
9468
|
function pack(writer, coders, values) {
|
|
9831
9469
|
let arrayValues = null;
|
|
9832
9470
|
if (Array.isArray(values)) {
|
|
@@ -9837,14 +9475,14 @@ function pack(writer, coders, values) {
|
|
|
9837
9475
|
arrayValues = coders.map((coder) => {
|
|
9838
9476
|
const name = coder.localName;
|
|
9839
9477
|
if (!name) {
|
|
9840
|
-
logger$
|
|
9478
|
+
logger$7.throwError("cannot encode object for signature with missing names", Logger.errors.INVALID_ARGUMENT, {
|
|
9841
9479
|
argument: "values",
|
|
9842
9480
|
coder: coder,
|
|
9843
9481
|
value: values
|
|
9844
9482
|
});
|
|
9845
9483
|
}
|
|
9846
9484
|
if (unique[name]) {
|
|
9847
|
-
logger$
|
|
9485
|
+
logger$7.throwError("cannot encode object for signature with duplicate names", Logger.errors.INVALID_ARGUMENT, {
|
|
9848
9486
|
argument: "values",
|
|
9849
9487
|
coder: coder,
|
|
9850
9488
|
value: values
|
|
@@ -9855,10 +9493,10 @@ function pack(writer, coders, values) {
|
|
|
9855
9493
|
});
|
|
9856
9494
|
}
|
|
9857
9495
|
else {
|
|
9858
|
-
logger$
|
|
9496
|
+
logger$7.throwArgumentError("invalid tuple value", "tuple", values);
|
|
9859
9497
|
}
|
|
9860
9498
|
if (coders.length !== arrayValues.length) {
|
|
9861
|
-
logger$
|
|
9499
|
+
logger$7.throwArgumentError("types/value length mismatch", "tuple", values);
|
|
9862
9500
|
}
|
|
9863
9501
|
let staticWriter = new Writer(writer.wordSize);
|
|
9864
9502
|
let dynamicWriter = new Writer(writer.wordSize);
|
|
@@ -9999,7 +9637,7 @@ class ArrayCoder extends Coder {
|
|
|
9999
9637
|
count = value.length;
|
|
10000
9638
|
writer.writeValue(value.length);
|
|
10001
9639
|
}
|
|
10002
|
-
logger$
|
|
9640
|
+
logger$7.checkArgumentCount(value.length, count, "coder array" + (this.localName ? (" " + this.localName) : ""));
|
|
10003
9641
|
let coders = [];
|
|
10004
9642
|
for (let i = 0; i < value.length; i++) {
|
|
10005
9643
|
coders.push(this.coder);
|
|
@@ -10016,7 +9654,7 @@ class ArrayCoder extends Coder {
|
|
|
10016
9654
|
// bytes as a link to the data). This could use a much
|
|
10017
9655
|
// tighter bound, but we are erroring on the side of safety.
|
|
10018
9656
|
if (count * 32 > reader._data.length) {
|
|
10019
|
-
logger$
|
|
9657
|
+
logger$7.throwError("insufficient data length", Logger.errors.BUFFER_OVERRUN, {
|
|
10020
9658
|
length: reader._data.length,
|
|
10021
9659
|
count: count
|
|
10022
9660
|
});
|
|
@@ -10112,6 +9750,8 @@ class NullCoder extends Coder {
|
|
|
10112
9750
|
}
|
|
10113
9751
|
}
|
|
10114
9752
|
|
|
9753
|
+
const AddressZero = "0x0000000000000000000000000000000000000000";
|
|
9754
|
+
|
|
10115
9755
|
const NegativeOne = ( /*#__PURE__*/BigNumber.from(-1));
|
|
10116
9756
|
const Zero = ( /*#__PURE__*/BigNumber.from(0));
|
|
10117
9757
|
const One = ( /*#__PURE__*/BigNumber.from(1));
|
|
@@ -10155,9 +9795,9 @@ class NumberCoder extends Coder {
|
|
|
10155
9795
|
}
|
|
10156
9796
|
}
|
|
10157
9797
|
|
|
10158
|
-
const version$
|
|
9798
|
+
const version$4 = "strings/5.7.0";
|
|
10159
9799
|
|
|
10160
|
-
const logger$
|
|
9800
|
+
const logger$6 = new Logger(version$4);
|
|
10161
9801
|
///////////////////////////////
|
|
10162
9802
|
var UnicodeNormalizationForm;
|
|
10163
9803
|
(function (UnicodeNormalizationForm) {
|
|
@@ -10195,7 +9835,7 @@ var Utf8ErrorReason;
|
|
|
10195
9835
|
Utf8ErrorReason["OVERLONG"] = "overlong representation";
|
|
10196
9836
|
})(Utf8ErrorReason || (Utf8ErrorReason = {}));
|
|
10197
9837
|
function errorFunc(reason, offset, bytes, output, badCodepoint) {
|
|
10198
|
-
return logger$
|
|
9838
|
+
return logger$6.throwArgumentError(`invalid codepoint at offset ${offset}; ${reason}`, "bytes", bytes);
|
|
10199
9839
|
}
|
|
10200
9840
|
function ignoreFunc(reason, offset, bytes, output, badCodepoint) {
|
|
10201
9841
|
// If there is an invalid prefix (including stray continuation), skip any additional continuation bytes
|
|
@@ -10321,7 +9961,7 @@ function getUtf8CodePoints(bytes, onError) {
|
|
|
10321
9961
|
// http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array
|
|
10322
9962
|
function toUtf8Bytes(str, form = UnicodeNormalizationForm.current) {
|
|
10323
9963
|
if (form != UnicodeNormalizationForm.current) {
|
|
10324
|
-
logger$
|
|
9964
|
+
logger$6.checkNormalize();
|
|
10325
9965
|
str = str.normalize(form);
|
|
10326
9966
|
}
|
|
10327
9967
|
let result = [];
|
|
@@ -10437,7 +10077,7 @@ class TupleCoder extends Coder {
|
|
|
10437
10077
|
}
|
|
10438
10078
|
}
|
|
10439
10079
|
|
|
10440
|
-
const logger$
|
|
10080
|
+
const logger$5 = new Logger(version$7);
|
|
10441
10081
|
const paramTypeBytes = new RegExp(/^bytes([0-9]*)$/);
|
|
10442
10082
|
const paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/);
|
|
10443
10083
|
class AbiCoder {
|
|
@@ -10468,7 +10108,7 @@ class AbiCoder {
|
|
|
10468
10108
|
if (match) {
|
|
10469
10109
|
let size = parseInt(match[2] || "256");
|
|
10470
10110
|
if (size === 0 || size > 256 || (size % 8) !== 0) {
|
|
10471
|
-
logger$
|
|
10111
|
+
logger$5.throwArgumentError("invalid " + match[1] + " bit length", "param", param);
|
|
10472
10112
|
}
|
|
10473
10113
|
return new NumberCoder(size / 8, (match[1] === "int"), param.name);
|
|
10474
10114
|
}
|
|
@@ -10477,11 +10117,11 @@ class AbiCoder {
|
|
|
10477
10117
|
if (match) {
|
|
10478
10118
|
let size = parseInt(match[1]);
|
|
10479
10119
|
if (size === 0 || size > 32) {
|
|
10480
|
-
logger$
|
|
10120
|
+
logger$5.throwArgumentError("invalid bytes length", "param", param);
|
|
10481
10121
|
}
|
|
10482
10122
|
return new FixedBytesCoder(size, param.name);
|
|
10483
10123
|
}
|
|
10484
|
-
return logger$
|
|
10124
|
+
return logger$5.throwArgumentError("invalid type", "type", param.type);
|
|
10485
10125
|
}
|
|
10486
10126
|
_getWordSize() { return 32; }
|
|
10487
10127
|
_getReader(data, allowLoose) {
|
|
@@ -10497,7 +10137,7 @@ class AbiCoder {
|
|
|
10497
10137
|
}
|
|
10498
10138
|
encode(types, values) {
|
|
10499
10139
|
if (types.length !== values.length) {
|
|
10500
|
-
logger$
|
|
10140
|
+
logger$5.throwError("types/values length mismatch", Logger.errors.INVALID_ARGUMENT, {
|
|
10501
10141
|
count: { types: types.length, values: values.length },
|
|
10502
10142
|
value: { types: types, values: values }
|
|
10503
10143
|
});
|
|
@@ -10520,7 +10160,7 @@ function id(text) {
|
|
|
10520
10160
|
return keccak256(toUtf8Bytes(text));
|
|
10521
10161
|
}
|
|
10522
10162
|
|
|
10523
|
-
const logger$
|
|
10163
|
+
const logger$4 = new Logger(version$7);
|
|
10524
10164
|
class LogDescription extends Description {
|
|
10525
10165
|
}
|
|
10526
10166
|
class TransactionDescription extends Description {
|
|
@@ -10577,7 +10217,7 @@ class Interface {
|
|
|
10577
10217
|
switch (fragment.type) {
|
|
10578
10218
|
case "constructor":
|
|
10579
10219
|
if (this.deploy) {
|
|
10580
|
-
logger$
|
|
10220
|
+
logger$4.warn("duplicate definition - constructor");
|
|
10581
10221
|
return;
|
|
10582
10222
|
}
|
|
10583
10223
|
//checkNames(fragment, "input", fragment.inputs);
|
|
@@ -10600,7 +10240,7 @@ class Interface {
|
|
|
10600
10240
|
}
|
|
10601
10241
|
let signature = fragment.format();
|
|
10602
10242
|
if (bucket[signature]) {
|
|
10603
|
-
logger$
|
|
10243
|
+
logger$4.warn("duplicate definition - " + signature);
|
|
10604
10244
|
return;
|
|
10605
10245
|
}
|
|
10606
10246
|
bucket[signature] = fragment;
|
|
@@ -10619,7 +10259,7 @@ class Interface {
|
|
|
10619
10259
|
format = FormatTypes.full;
|
|
10620
10260
|
}
|
|
10621
10261
|
if (format === FormatTypes.sighash) {
|
|
10622
|
-
logger$
|
|
10262
|
+
logger$4.throwArgumentError("interface does not support formatting sighash", "format", format);
|
|
10623
10263
|
}
|
|
10624
10264
|
const abi = this.fragments.map((fragment) => fragment.format(format));
|
|
10625
10265
|
// We need to re-bundle the JSON fragments a bit
|
|
@@ -10649,24 +10289,24 @@ class Interface {
|
|
|
10649
10289
|
return this.functions[name];
|
|
10650
10290
|
}
|
|
10651
10291
|
}
|
|
10652
|
-
logger$
|
|
10292
|
+
logger$4.throwArgumentError("no matching function", "sighash", nameOrSignatureOrSighash);
|
|
10653
10293
|
}
|
|
10654
10294
|
// It is a bare name, look up the function (will return null if ambiguous)
|
|
10655
10295
|
if (nameOrSignatureOrSighash.indexOf("(") === -1) {
|
|
10656
10296
|
const name = nameOrSignatureOrSighash.trim();
|
|
10657
10297
|
const matching = Object.keys(this.functions).filter((f) => (f.split("(" /* fix:) */)[0] === name));
|
|
10658
10298
|
if (matching.length === 0) {
|
|
10659
|
-
logger$
|
|
10299
|
+
logger$4.throwArgumentError("no matching function", "name", name);
|
|
10660
10300
|
}
|
|
10661
10301
|
else if (matching.length > 1) {
|
|
10662
|
-
logger$
|
|
10302
|
+
logger$4.throwArgumentError("multiple matching functions", "name", name);
|
|
10663
10303
|
}
|
|
10664
10304
|
return this.functions[matching[0]];
|
|
10665
10305
|
}
|
|
10666
10306
|
// Normalize the signature and lookup the function
|
|
10667
10307
|
const result = this.functions[FunctionFragment.fromString(nameOrSignatureOrSighash).format()];
|
|
10668
10308
|
if (!result) {
|
|
10669
|
-
logger$
|
|
10309
|
+
logger$4.throwArgumentError("no matching function", "signature", nameOrSignatureOrSighash);
|
|
10670
10310
|
}
|
|
10671
10311
|
return result;
|
|
10672
10312
|
}
|
|
@@ -10679,24 +10319,24 @@ class Interface {
|
|
|
10679
10319
|
return this.events[name];
|
|
10680
10320
|
}
|
|
10681
10321
|
}
|
|
10682
|
-
logger$
|
|
10322
|
+
logger$4.throwArgumentError("no matching event", "topichash", topichash);
|
|
10683
10323
|
}
|
|
10684
10324
|
// It is a bare name, look up the function (will return null if ambiguous)
|
|
10685
10325
|
if (nameOrSignatureOrTopic.indexOf("(") === -1) {
|
|
10686
10326
|
const name = nameOrSignatureOrTopic.trim();
|
|
10687
10327
|
const matching = Object.keys(this.events).filter((f) => (f.split("(" /* fix:) */)[0] === name));
|
|
10688
10328
|
if (matching.length === 0) {
|
|
10689
|
-
logger$
|
|
10329
|
+
logger$4.throwArgumentError("no matching event", "name", name);
|
|
10690
10330
|
}
|
|
10691
10331
|
else if (matching.length > 1) {
|
|
10692
|
-
logger$
|
|
10332
|
+
logger$4.throwArgumentError("multiple matching events", "name", name);
|
|
10693
10333
|
}
|
|
10694
10334
|
return this.events[matching[0]];
|
|
10695
10335
|
}
|
|
10696
10336
|
// Normalize the signature and lookup the function
|
|
10697
10337
|
const result = this.events[EventFragment.fromString(nameOrSignatureOrTopic).format()];
|
|
10698
10338
|
if (!result) {
|
|
10699
|
-
logger$
|
|
10339
|
+
logger$4.throwArgumentError("no matching event", "signature", nameOrSignatureOrTopic);
|
|
10700
10340
|
}
|
|
10701
10341
|
return result;
|
|
10702
10342
|
}
|
|
@@ -10710,24 +10350,24 @@ class Interface {
|
|
|
10710
10350
|
return this.errors[name];
|
|
10711
10351
|
}
|
|
10712
10352
|
}
|
|
10713
|
-
logger$
|
|
10353
|
+
logger$4.throwArgumentError("no matching error", "sighash", nameOrSignatureOrSighash);
|
|
10714
10354
|
}
|
|
10715
10355
|
// It is a bare name, look up the function (will return null if ambiguous)
|
|
10716
10356
|
if (nameOrSignatureOrSighash.indexOf("(") === -1) {
|
|
10717
10357
|
const name = nameOrSignatureOrSighash.trim();
|
|
10718
10358
|
const matching = Object.keys(this.errors).filter((f) => (f.split("(" /* fix:) */)[0] === name));
|
|
10719
10359
|
if (matching.length === 0) {
|
|
10720
|
-
logger$
|
|
10360
|
+
logger$4.throwArgumentError("no matching error", "name", name);
|
|
10721
10361
|
}
|
|
10722
10362
|
else if (matching.length > 1) {
|
|
10723
|
-
logger$
|
|
10363
|
+
logger$4.throwArgumentError("multiple matching errors", "name", name);
|
|
10724
10364
|
}
|
|
10725
10365
|
return this.errors[matching[0]];
|
|
10726
10366
|
}
|
|
10727
10367
|
// Normalize the signature and lookup the function
|
|
10728
10368
|
const result = this.errors[FunctionFragment.fromString(nameOrSignatureOrSighash).format()];
|
|
10729
10369
|
if (!result) {
|
|
10730
|
-
logger$
|
|
10370
|
+
logger$4.throwArgumentError("no matching error", "signature", nameOrSignatureOrSighash);
|
|
10731
10371
|
}
|
|
10732
10372
|
return result;
|
|
10733
10373
|
}
|
|
@@ -10770,7 +10410,7 @@ class Interface {
|
|
|
10770
10410
|
}
|
|
10771
10411
|
const bytes = arrayify(data);
|
|
10772
10412
|
if (hexlify(bytes.slice(0, 4)) !== this.getSighash(fragment)) {
|
|
10773
|
-
logger$
|
|
10413
|
+
logger$4.throwArgumentError(`data signature does not match error ${fragment.name}.`, "data", hexlify(bytes));
|
|
10774
10414
|
}
|
|
10775
10415
|
return this._decodeParams(fragment.inputs, bytes.slice(4));
|
|
10776
10416
|
}
|
|
@@ -10790,7 +10430,7 @@ class Interface {
|
|
|
10790
10430
|
}
|
|
10791
10431
|
const bytes = arrayify(data);
|
|
10792
10432
|
if (hexlify(bytes.slice(0, 4)) !== this.getSighash(functionFragment)) {
|
|
10793
|
-
logger$
|
|
10433
|
+
logger$4.throwArgumentError(`data signature does not match function ${functionFragment.name}.`, "data", hexlify(bytes));
|
|
10794
10434
|
}
|
|
10795
10435
|
return this._decodeParams(functionFragment.inputs, bytes.slice(4));
|
|
10796
10436
|
}
|
|
@@ -10851,7 +10491,7 @@ class Interface {
|
|
|
10851
10491
|
break;
|
|
10852
10492
|
}
|
|
10853
10493
|
}
|
|
10854
|
-
return logger$
|
|
10494
|
+
return logger$4.throwError("call revert exception" + message, Logger.errors.CALL_EXCEPTION, {
|
|
10855
10495
|
method: functionFragment.format(),
|
|
10856
10496
|
data: hexlify(data), errorArgs, errorName, errorSignature, reason
|
|
10857
10497
|
});
|
|
@@ -10869,7 +10509,7 @@ class Interface {
|
|
|
10869
10509
|
eventFragment = this.getEvent(eventFragment);
|
|
10870
10510
|
}
|
|
10871
10511
|
if (values.length > eventFragment.inputs.length) {
|
|
10872
|
-
logger$
|
|
10512
|
+
logger$4.throwError("too many arguments for " + eventFragment.format(), Logger.errors.UNEXPECTED_ARGUMENT, {
|
|
10873
10513
|
argument: "values",
|
|
10874
10514
|
value: values
|
|
10875
10515
|
});
|
|
@@ -10901,7 +10541,7 @@ class Interface {
|
|
|
10901
10541
|
let param = eventFragment.inputs[index];
|
|
10902
10542
|
if (!param.indexed) {
|
|
10903
10543
|
if (value != null) {
|
|
10904
|
-
logger$
|
|
10544
|
+
logger$4.throwArgumentError("cannot filter non-indexed parameters; must be null", ("contract." + param.name), value);
|
|
10905
10545
|
}
|
|
10906
10546
|
return;
|
|
10907
10547
|
}
|
|
@@ -10909,7 +10549,7 @@ class Interface {
|
|
|
10909
10549
|
topics.push(null);
|
|
10910
10550
|
}
|
|
10911
10551
|
else if (param.baseType === "array" || param.baseType === "tuple") {
|
|
10912
|
-
logger$
|
|
10552
|
+
logger$4.throwArgumentError("filtering with tuples or arrays not supported", ("contract." + param.name), value);
|
|
10913
10553
|
}
|
|
10914
10554
|
else if (Array.isArray(value)) {
|
|
10915
10555
|
topics.push(value.map((value) => encodeTopic(param, value)));
|
|
@@ -10935,7 +10575,7 @@ class Interface {
|
|
|
10935
10575
|
topics.push(this.getEventTopic(eventFragment));
|
|
10936
10576
|
}
|
|
10937
10577
|
if (values.length !== eventFragment.inputs.length) {
|
|
10938
|
-
logger$
|
|
10578
|
+
logger$4.throwArgumentError("event arguments/values mismatch", "values", values);
|
|
10939
10579
|
}
|
|
10940
10580
|
eventFragment.inputs.forEach((param, index) => {
|
|
10941
10581
|
const value = values[index];
|
|
@@ -10972,7 +10612,7 @@ class Interface {
|
|
|
10972
10612
|
if (topics != null && !eventFragment.anonymous) {
|
|
10973
10613
|
let topicHash = this.getEventTopic(eventFragment);
|
|
10974
10614
|
if (!isHexString(topics[0], 32) || topics[0].toLowerCase() !== topicHash) {
|
|
10975
|
-
logger$
|
|
10615
|
+
logger$4.throwError("fragment/topic mismatch", Logger.errors.INVALID_ARGUMENT, { argument: "topics[0]", expected: topicHash, value: topics[0] });
|
|
10976
10616
|
}
|
|
10977
10617
|
topics = topics.slice(1);
|
|
10978
10618
|
}
|
|
@@ -11117,7 +10757,7 @@ class Interface {
|
|
|
11117
10757
|
}
|
|
11118
10758
|
}
|
|
11119
10759
|
|
|
11120
|
-
const version$
|
|
10760
|
+
const version$3 = "abstract-provider/5.7.0";
|
|
11121
10761
|
|
|
11122
10762
|
var __awaiter$2 = function (thisArg, _arguments, P, generator) {
|
|
11123
10763
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -11128,12 +10768,12 @@ var __awaiter$2 = function (thisArg, _arguments, P, generator) {
|
|
|
11128
10768
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11129
10769
|
});
|
|
11130
10770
|
};
|
|
11131
|
-
const logger$
|
|
10771
|
+
const logger$3 = new Logger(version$3);
|
|
11132
10772
|
///////////////////////////////
|
|
11133
10773
|
// Exported Abstracts
|
|
11134
10774
|
class Provider {
|
|
11135
10775
|
constructor() {
|
|
11136
|
-
logger$
|
|
10776
|
+
logger$3.checkAbstract(new.target, Provider);
|
|
11137
10777
|
defineReadOnly(this, "_isProvider", true);
|
|
11138
10778
|
}
|
|
11139
10779
|
getFeeData() {
|
|
@@ -11171,7 +10811,7 @@ class Provider {
|
|
|
11171
10811
|
}
|
|
11172
10812
|
}
|
|
11173
10813
|
|
|
11174
|
-
const version$
|
|
10814
|
+
const version$2 = "abstract-signer/5.7.0";
|
|
11175
10815
|
|
|
11176
10816
|
var __awaiter$1 = function (thisArg, _arguments, P, generator) {
|
|
11177
10817
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -11182,7 +10822,7 @@ var __awaiter$1 = function (thisArg, _arguments, P, generator) {
|
|
|
11182
10822
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11183
10823
|
});
|
|
11184
10824
|
};
|
|
11185
|
-
const logger$
|
|
10825
|
+
const logger$2 = new Logger(version$2);
|
|
11186
10826
|
const allowedTransactionKeys = [
|
|
11187
10827
|
"accessList", "ccipReadEnabled", "chainId", "customData", "data", "from", "gasLimit", "gasPrice", "maxFeePerGas", "maxPriorityFeePerGas", "nonce", "to", "type", "value"
|
|
11188
10828
|
];
|
|
@@ -11195,7 +10835,7 @@ class Signer {
|
|
|
11195
10835
|
///////////////////
|
|
11196
10836
|
// Sub-classes MUST call super
|
|
11197
10837
|
constructor() {
|
|
11198
|
-
logger$
|
|
10838
|
+
logger$2.checkAbstract(new.target, Signer);
|
|
11199
10839
|
defineReadOnly(this, "_isSigner", true);
|
|
11200
10840
|
}
|
|
11201
10841
|
///////////////////
|
|
@@ -11274,7 +10914,7 @@ class Signer {
|
|
|
11274
10914
|
checkTransaction(transaction) {
|
|
11275
10915
|
for (const key in transaction) {
|
|
11276
10916
|
if (allowedTransactionKeys.indexOf(key) === -1) {
|
|
11277
|
-
logger$
|
|
10917
|
+
logger$2.throwArgumentError("invalid transaction key: " + key, "transaction", transaction);
|
|
11278
10918
|
}
|
|
11279
10919
|
}
|
|
11280
10920
|
const tx = shallowCopy(transaction);
|
|
@@ -11288,7 +10928,7 @@ class Signer {
|
|
|
11288
10928
|
this.getAddress()
|
|
11289
10929
|
]).then((result) => {
|
|
11290
10930
|
if (result[0].toLowerCase() !== result[1].toLowerCase()) {
|
|
11291
|
-
logger$
|
|
10931
|
+
logger$2.throwArgumentError("from address mismatch", "transaction", transaction);
|
|
11292
10932
|
}
|
|
11293
10933
|
return result[0];
|
|
11294
10934
|
});
|
|
@@ -11312,7 +10952,7 @@ class Signer {
|
|
|
11312
10952
|
}
|
|
11313
10953
|
const address = yield this.resolveName(to);
|
|
11314
10954
|
if (address == null) {
|
|
11315
|
-
logger$
|
|
10955
|
+
logger$2.throwArgumentError("provided ENS name resolves to null", "tx.to", to);
|
|
11316
10956
|
}
|
|
11317
10957
|
return address;
|
|
11318
10958
|
}));
|
|
@@ -11322,10 +10962,10 @@ class Signer {
|
|
|
11322
10962
|
// Do not allow mixing pre-eip-1559 and eip-1559 properties
|
|
11323
10963
|
const hasEip1559 = (tx.maxFeePerGas != null || tx.maxPriorityFeePerGas != null);
|
|
11324
10964
|
if (tx.gasPrice != null && (tx.type === 2 || hasEip1559)) {
|
|
11325
|
-
logger$
|
|
10965
|
+
logger$2.throwArgumentError("eip-1559 transaction do not support gasPrice", "transaction", transaction);
|
|
11326
10966
|
}
|
|
11327
10967
|
else if ((tx.type === 0 || tx.type === 1) && hasEip1559) {
|
|
11328
|
-
logger$
|
|
10968
|
+
logger$2.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas", "transaction", transaction);
|
|
11329
10969
|
}
|
|
11330
10970
|
if ((tx.type === 2 || tx.type == null) && (tx.maxFeePerGas != null && tx.maxPriorityFeePerGas != null)) {
|
|
11331
10971
|
// Fully-formed EIP-1559 transaction (skip getFeeData)
|
|
@@ -11369,7 +11009,7 @@ class Signer {
|
|
|
11369
11009
|
// Network doesn't support EIP-1559...
|
|
11370
11010
|
// ...but they are trying to use EIP-1559 properties
|
|
11371
11011
|
if (hasEip1559) {
|
|
11372
|
-
logger$
|
|
11012
|
+
logger$2.throwError("network does not support EIP-1559", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
11373
11013
|
operation: "populateTransaction"
|
|
11374
11014
|
});
|
|
11375
11015
|
}
|
|
@@ -11382,7 +11022,7 @@ class Signer {
|
|
|
11382
11022
|
}
|
|
11383
11023
|
else {
|
|
11384
11024
|
// getFeeData has failed us.
|
|
11385
|
-
logger$
|
|
11025
|
+
logger$2.throwError("failed to get consistent fee data", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
11386
11026
|
operation: "signer.getFeeData"
|
|
11387
11027
|
});
|
|
11388
11028
|
}
|
|
@@ -11406,7 +11046,7 @@ class Signer {
|
|
|
11406
11046
|
if (forwardErrors.indexOf(error.code) >= 0) {
|
|
11407
11047
|
throw error;
|
|
11408
11048
|
}
|
|
11409
|
-
return logger$
|
|
11049
|
+
return logger$2.throwError("cannot estimate gas; transaction may fail or may require manual gas limit", Logger.errors.UNPREDICTABLE_GAS_LIMIT, {
|
|
11410
11050
|
error: error,
|
|
11411
11051
|
tx: tx
|
|
11412
11052
|
});
|
|
@@ -11421,7 +11061,7 @@ class Signer {
|
|
|
11421
11061
|
this.getChainId()
|
|
11422
11062
|
]).then((results) => {
|
|
11423
11063
|
if (results[1] !== 0 && results[0] !== results[1]) {
|
|
11424
|
-
logger$
|
|
11064
|
+
logger$2.throwArgumentError("chainId address mismatch", "transaction", transaction);
|
|
11425
11065
|
}
|
|
11426
11066
|
return results[0];
|
|
11427
11067
|
});
|
|
@@ -11433,7 +11073,7 @@ class Signer {
|
|
|
11433
11073
|
// Sub-classes SHOULD leave these alone
|
|
11434
11074
|
_checkProvider(operation) {
|
|
11435
11075
|
if (!this.provider) {
|
|
11436
|
-
logger$
|
|
11076
|
+
logger$2.throwError("missing provider", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
11437
11077
|
operation: (operation || "_checkProvider")
|
|
11438
11078
|
});
|
|
11439
11079
|
}
|
|
@@ -11453,7 +11093,7 @@ class VoidSigner extends Signer {
|
|
|
11453
11093
|
}
|
|
11454
11094
|
_fail(message, operation) {
|
|
11455
11095
|
return Promise.resolve().then(() => {
|
|
11456
|
-
logger$
|
|
11096
|
+
logger$2.throwError(message, Logger.errors.UNSUPPORTED_OPERATION, { operation: operation });
|
|
11457
11097
|
});
|
|
11458
11098
|
}
|
|
11459
11099
|
signMessage(message) {
|
|
@@ -11470,9 +11110,9 @@ class VoidSigner extends Signer {
|
|
|
11470
11110
|
}
|
|
11471
11111
|
}
|
|
11472
11112
|
|
|
11473
|
-
const version$
|
|
11113
|
+
const version$1 = "transactions/5.7.0";
|
|
11474
11114
|
|
|
11475
|
-
const logger$
|
|
11115
|
+
const logger$1 = new Logger(version$1);
|
|
11476
11116
|
var TransactionTypes;
|
|
11477
11117
|
(function (TransactionTypes) {
|
|
11478
11118
|
TransactionTypes[TransactionTypes["legacy"] = 0] = "legacy";
|
|
@@ -11484,7 +11124,7 @@ function accessSetify(addr, storageKeys) {
|
|
|
11484
11124
|
address: getAddress(addr),
|
|
11485
11125
|
storageKeys: (storageKeys || []).map((storageKey, index) => {
|
|
11486
11126
|
if (hexDataLength(storageKey) !== 32) {
|
|
11487
|
-
logger$
|
|
11127
|
+
logger$1.throwArgumentError("invalid access list storageKey", `accessList[${addr}:${index}]`, storageKey);
|
|
11488
11128
|
}
|
|
11489
11129
|
return storageKey.toLowerCase();
|
|
11490
11130
|
})
|
|
@@ -11495,7 +11135,7 @@ function accessListify(value) {
|
|
|
11495
11135
|
return value.map((set, index) => {
|
|
11496
11136
|
if (Array.isArray(set)) {
|
|
11497
11137
|
if (set.length > 2) {
|
|
11498
|
-
logger$
|
|
11138
|
+
logger$1.throwArgumentError("access list expected to be [ address, storageKeys[] ]", `value[${index}]`, set);
|
|
11499
11139
|
}
|
|
11500
11140
|
return accessSetify(set[0], set[1]);
|
|
11501
11141
|
}
|
|
@@ -11513,7 +11153,7 @@ function accessListify(value) {
|
|
|
11513
11153
|
return result;
|
|
11514
11154
|
}
|
|
11515
11155
|
|
|
11516
|
-
const version
|
|
11156
|
+
const version = "contracts/5.7.0";
|
|
11517
11157
|
|
|
11518
11158
|
var __awaiter = function (thisArg, _arguments, P, generator) {
|
|
11519
11159
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -11524,12 +11164,12 @@ var __awaiter = function (thisArg, _arguments, P, generator) {
|
|
|
11524
11164
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11525
11165
|
});
|
|
11526
11166
|
};
|
|
11527
|
-
const logger
|
|
11167
|
+
const logger = new Logger(version);
|
|
11528
11168
|
function resolveName(resolver, nameOrPromise) {
|
|
11529
11169
|
return __awaiter(this, void 0, void 0, function* () {
|
|
11530
11170
|
const name = yield nameOrPromise;
|
|
11531
11171
|
if (typeof (name) !== "string") {
|
|
11532
|
-
logger
|
|
11172
|
+
logger.throwArgumentError("invalid address or ENS name", "name", name);
|
|
11533
11173
|
}
|
|
11534
11174
|
// If it is already an address, just use it (after adding checksum)
|
|
11535
11175
|
try {
|
|
@@ -11537,13 +11177,13 @@ function resolveName(resolver, nameOrPromise) {
|
|
|
11537
11177
|
}
|
|
11538
11178
|
catch (error) { }
|
|
11539
11179
|
if (!resolver) {
|
|
11540
|
-
logger
|
|
11180
|
+
logger.throwError("a provider or signer is needed to resolve ENS names", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
11541
11181
|
operation: "resolveName"
|
|
11542
11182
|
});
|
|
11543
11183
|
}
|
|
11544
11184
|
const address = yield resolver.resolveName(name);
|
|
11545
11185
|
if (address == null) {
|
|
11546
|
-
logger
|
|
11186
|
+
logger.throwArgumentError("resolver or addr is not configured for ENS name", "name", name);
|
|
11547
11187
|
}
|
|
11548
11188
|
return address;
|
|
11549
11189
|
});
|
|
@@ -11564,7 +11204,7 @@ function resolveAddresses(resolver, value, paramType) {
|
|
|
11564
11204
|
}
|
|
11565
11205
|
if (paramType.baseType === "array") {
|
|
11566
11206
|
if (!Array.isArray(value)) {
|
|
11567
|
-
return Promise.reject(logger
|
|
11207
|
+
return Promise.reject(logger.makeError("invalid value for array", Logger.errors.INVALID_ARGUMENT, {
|
|
11568
11208
|
argument: "value",
|
|
11569
11209
|
value
|
|
11570
11210
|
}));
|
|
@@ -11582,7 +11222,7 @@ function populateTransaction(contract, fragment, args) {
|
|
|
11582
11222
|
overrides = shallowCopy(args.pop());
|
|
11583
11223
|
}
|
|
11584
11224
|
// Make sure the parameter count matches
|
|
11585
|
-
logger
|
|
11225
|
+
logger.checkArgumentCount(args.length, fragment.inputs.length, "passed to contract");
|
|
11586
11226
|
// Populate "from" override (allow promises)
|
|
11587
11227
|
if (contract.signer) {
|
|
11588
11228
|
if (overrides.from) {
|
|
@@ -11593,7 +11233,7 @@ function populateTransaction(contract, fragment, args) {
|
|
|
11593
11233
|
signer: contract.signer.getAddress()
|
|
11594
11234
|
}).then((check) => __awaiter(this, void 0, void 0, function* () {
|
|
11595
11235
|
if (getAddress(check.signer) !== check.override) {
|
|
11596
|
-
logger
|
|
11236
|
+
logger.throwError("Contract with a Signer cannot override from", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
11597
11237
|
operation: "overrides.from"
|
|
11598
11238
|
});
|
|
11599
11239
|
}
|
|
@@ -11671,7 +11311,7 @@ function populateTransaction(contract, fragment, args) {
|
|
|
11671
11311
|
if (ro.value) {
|
|
11672
11312
|
const roValue = BigNumber.from(ro.value);
|
|
11673
11313
|
if (!roValue.isZero() && !fragment.payable) {
|
|
11674
|
-
logger
|
|
11314
|
+
logger.throwError("non-payable method cannot override value", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
11675
11315
|
operation: "overrides.value",
|
|
11676
11316
|
value: overrides.value
|
|
11677
11317
|
});
|
|
@@ -11700,7 +11340,7 @@ function populateTransaction(contract, fragment, args) {
|
|
|
11700
11340
|
// typo or using an unsupported key.
|
|
11701
11341
|
const leftovers = Object.keys(overrides).filter((key) => (overrides[key] != null));
|
|
11702
11342
|
if (leftovers.length) {
|
|
11703
|
-
logger
|
|
11343
|
+
logger.throwError(`cannot override ${leftovers.map((l) => JSON.stringify(l)).join(",")}`, Logger.errors.UNSUPPORTED_OPERATION, {
|
|
11704
11344
|
operation: "overrides",
|
|
11705
11345
|
overrides: leftovers
|
|
11706
11346
|
});
|
|
@@ -11718,7 +11358,7 @@ function buildEstimate(contract, fragment) {
|
|
|
11718
11358
|
return function (...args) {
|
|
11719
11359
|
return __awaiter(this, void 0, void 0, function* () {
|
|
11720
11360
|
if (!signerOrProvider) {
|
|
11721
|
-
logger
|
|
11361
|
+
logger.throwError("estimate require a provider or signer", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
11722
11362
|
operation: "estimateGas"
|
|
11723
11363
|
});
|
|
11724
11364
|
}
|
|
@@ -11807,7 +11447,7 @@ function buildSend(contract, fragment) {
|
|
|
11807
11447
|
return function (...args) {
|
|
11808
11448
|
return __awaiter(this, void 0, void 0, function* () {
|
|
11809
11449
|
if (!contract.signer) {
|
|
11810
|
-
logger
|
|
11450
|
+
logger.throwError("sending a transaction requires a signer", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
11811
11451
|
operation: "sendTransaction"
|
|
11812
11452
|
});
|
|
11813
11453
|
}
|
|
@@ -11906,7 +11546,7 @@ class FragmentRunningEvent extends RunningEvent {
|
|
|
11906
11546
|
let topic = contractInterface.getEventTopic(fragment);
|
|
11907
11547
|
if (topics) {
|
|
11908
11548
|
if (topic !== topics[0]) {
|
|
11909
|
-
logger
|
|
11549
|
+
logger.throwArgumentError("topic mismatch", "topics", topics);
|
|
11910
11550
|
}
|
|
11911
11551
|
filter.topics = topics.slice();
|
|
11912
11552
|
}
|
|
@@ -11988,7 +11628,7 @@ class BaseContract {
|
|
|
11988
11628
|
defineReadOnly(this, "signer", null);
|
|
11989
11629
|
}
|
|
11990
11630
|
else {
|
|
11991
|
-
logger
|
|
11631
|
+
logger.throwArgumentError("invalid signer or provider", "signerOrProvider", signerOrProvider);
|
|
11992
11632
|
}
|
|
11993
11633
|
defineReadOnly(this, "callStatic", {});
|
|
11994
11634
|
defineReadOnly(this, "estimateGas", {});
|
|
@@ -12016,14 +11656,14 @@ class BaseContract {
|
|
|
12016
11656
|
defineReadOnly(this.filters, name, this.filters[filters[0]]);
|
|
12017
11657
|
}
|
|
12018
11658
|
else {
|
|
12019
|
-
logger
|
|
11659
|
+
logger.warn(`Duplicate definition of ${name} (${filters.join(", ")})`);
|
|
12020
11660
|
}
|
|
12021
11661
|
});
|
|
12022
11662
|
}
|
|
12023
11663
|
defineReadOnly(this, "_runningEvents", {});
|
|
12024
11664
|
defineReadOnly(this, "_wrappedEmits", {});
|
|
12025
11665
|
if (addressOrName == null) {
|
|
12026
|
-
logger
|
|
11666
|
+
logger.throwArgumentError("invalid contract address or ENS name", "addressOrName", addressOrName);
|
|
12027
11667
|
}
|
|
12028
11668
|
defineReadOnly(this, "address", addressOrName);
|
|
12029
11669
|
if (this.provider) {
|
|
@@ -12035,7 +11675,7 @@ class BaseContract {
|
|
|
12035
11675
|
}
|
|
12036
11676
|
catch (error) {
|
|
12037
11677
|
// Without a provider, we cannot use ENS names
|
|
12038
|
-
logger
|
|
11678
|
+
logger.throwError("provider is required to use ENS name as contract address", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
12039
11679
|
operation: "new Contract"
|
|
12040
11680
|
});
|
|
12041
11681
|
}
|
|
@@ -12049,7 +11689,7 @@ class BaseContract {
|
|
|
12049
11689
|
// Check that the signature is unique; if not the ABI generation has
|
|
12050
11690
|
// not been cleaned or may be incorrectly generated
|
|
12051
11691
|
if (uniqueSignatures[signature]) {
|
|
12052
|
-
logger
|
|
11692
|
+
logger.warn(`Duplicate ABI entry for ${JSON.stringify(signature)}`);
|
|
12053
11693
|
return;
|
|
12054
11694
|
}
|
|
12055
11695
|
uniqueSignatures[signature] = true;
|
|
@@ -12138,7 +11778,7 @@ class BaseContract {
|
|
|
12138
11778
|
// Otherwise, poll for our code to be deployed
|
|
12139
11779
|
this._deployedPromise = this.provider.getCode(this.address, blockTag).then((code) => {
|
|
12140
11780
|
if (code === "0x") {
|
|
12141
|
-
logger
|
|
11781
|
+
logger.throwError("contract not deployed", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
12142
11782
|
contractAddress: this.address,
|
|
12143
11783
|
operation: "getDeployed"
|
|
12144
11784
|
});
|
|
@@ -12155,14 +11795,14 @@ class BaseContract {
|
|
|
12155
11795
|
// estimateDeploy(bytecode: string, ...args): Promise<BigNumber>
|
|
12156
11796
|
fallback(overrides) {
|
|
12157
11797
|
if (!this.signer) {
|
|
12158
|
-
logger
|
|
11798
|
+
logger.throwError("sending a transactions require a signer", Logger.errors.UNSUPPORTED_OPERATION, { operation: "sendTransaction(fallback)" });
|
|
12159
11799
|
}
|
|
12160
11800
|
const tx = shallowCopy(overrides || {});
|
|
12161
11801
|
["from", "to"].forEach(function (key) {
|
|
12162
11802
|
if (tx[key] == null) {
|
|
12163
11803
|
return;
|
|
12164
11804
|
}
|
|
12165
|
-
logger
|
|
11805
|
+
logger.throwError("cannot override " + key, Logger.errors.UNSUPPORTED_OPERATION, { operation: key });
|
|
12166
11806
|
});
|
|
12167
11807
|
tx.to = this.resolvedAddress;
|
|
12168
11808
|
return this.deployed().then(() => {
|
|
@@ -12265,7 +11905,7 @@ class BaseContract {
|
|
|
12265
11905
|
}
|
|
12266
11906
|
_addEventListener(runningEvent, listener, once) {
|
|
12267
11907
|
if (!this.provider) {
|
|
12268
|
-
logger
|
|
11908
|
+
logger.throwError("events require a provider or a signer with a provider", Logger.errors.UNSUPPORTED_OPERATION, { operation: "once" });
|
|
12269
11909
|
}
|
|
12270
11910
|
runningEvent.addListener(listener, once);
|
|
12271
11911
|
// Track this running event and its listeners (may already be there; but no hard in updating)
|
|
@@ -12305,7 +11945,7 @@ class BaseContract {
|
|
|
12305
11945
|
const filter = shallowCopy(runningEvent.filter);
|
|
12306
11946
|
if (typeof (fromBlockOrBlockhash) === "string" && isHexString(fromBlockOrBlockhash, 32)) {
|
|
12307
11947
|
if (toBlock != null) {
|
|
12308
|
-
logger
|
|
11948
|
+
logger.throwArgumentError("cannot specify toBlock with blockhash", "toBlock", toBlock);
|
|
12309
11949
|
}
|
|
12310
11950
|
filter.blockHash = fromBlockOrBlockhash;
|
|
12311
11951
|
}
|
|
@@ -12395,31 +12035,6 @@ class BaseContract {
|
|
|
12395
12035
|
class Contract extends BaseContract {
|
|
12396
12036
|
}
|
|
12397
12037
|
|
|
12398
|
-
const version = "units/5.7.0";
|
|
12399
|
-
|
|
12400
|
-
const logger = new Logger(version);
|
|
12401
|
-
const names = [
|
|
12402
|
-
"wei",
|
|
12403
|
-
"kwei",
|
|
12404
|
-
"mwei",
|
|
12405
|
-
"gwei",
|
|
12406
|
-
"szabo",
|
|
12407
|
-
"finney",
|
|
12408
|
-
"ether",
|
|
12409
|
-
];
|
|
12410
|
-
function parseUnits(value, unitName) {
|
|
12411
|
-
if (typeof (value) !== "string") {
|
|
12412
|
-
logger.throwArgumentError("value must be a string", "value", value);
|
|
12413
|
-
}
|
|
12414
|
-
if (typeof (unitName) === "string") {
|
|
12415
|
-
const index = names.indexOf(unitName);
|
|
12416
|
-
if (index !== -1) {
|
|
12417
|
-
unitName = 3 * index;
|
|
12418
|
-
}
|
|
12419
|
-
}
|
|
12420
|
-
return parseFixed(value, (unitName != null) ? unitName : 18);
|
|
12421
|
-
}
|
|
12422
|
-
|
|
12423
12038
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
12424
12039
|
/**
|
|
12425
12040
|
* @constant {string} ETH_SEPOLIA_CHAIN_ID - The chain ID for the Ethereum Sepolia testnet (EIP-155 compatible format).
|
|
@@ -12441,6 +12056,10 @@ const ZKEVM_TESTNET_CHAIN_ID = '13473';
|
|
|
12441
12056
|
* @constant {string} ZKEVM_MAINNET_CHAIN_ID - The chain ID for the zkEVM mainnet (EIP-155 compatible format).
|
|
12442
12057
|
*/
|
|
12443
12058
|
const ZKEVM_MAINNET_CHAIN_ID = '13371'; // @TODO confirm this is still correct
|
|
12059
|
+
/**
|
|
12060
|
+
* @constant {string} CHILD_CHAIN_NATIVE_TOKEN_ADDRESS - Address of the native token on the child chain.
|
|
12061
|
+
*/
|
|
12062
|
+
const ETHEREUM_NATIVE_TOKEN_ADDRESS = '0x0000000000000000000000000000000000000eee';
|
|
12444
12063
|
/**
|
|
12445
12064
|
* @constant {BridgeInstance} ETH_SEPOLIA_TO_ZKEVM_DEVNET - A bridge instance configuration for bridging between
|
|
12446
12065
|
* the Ethereum Sepolia testnet and the zkEVM devnet.
|
|
@@ -14780,6 +14399,7 @@ var BridgeErrorType;
|
|
|
14780
14399
|
BridgeErrorType["AXELAR_GAS_ESTIMATE_FAILED"] = "AXELAR_GAS_ESTIMATE_FAILED";
|
|
14781
14400
|
BridgeErrorType["INVALID_RECIPIENT"] = "INVALID_RECIPIENT";
|
|
14782
14401
|
BridgeErrorType["FLOW_RATE_ERROR"] = "FLOW_RATE_ERROR";
|
|
14402
|
+
BridgeErrorType["INVALID_FLOWRATE_INDEX"] = "INVALID_FLOWRATE_INDEX";
|
|
14783
14403
|
})(BridgeErrorType || (BridgeErrorType = {}));
|
|
14784
14404
|
/**
|
|
14785
14405
|
* Represents a custom error for bridge operations.
|
|
@@ -16719,6 +16339,7 @@ class TokenBridge {
|
|
|
16719
16339
|
}, BridgeErrorType.INTERNAL_ERROR);
|
|
16720
16340
|
}
|
|
16721
16341
|
const flowRatePromises = [];
|
|
16342
|
+
const flowRateLengthPromises = [];
|
|
16722
16343
|
const flowRatePromisesReceivers = [];
|
|
16723
16344
|
for (let i = 0, l = statusResponses.length; i < l; i++) {
|
|
16724
16345
|
let metaStatus;
|
|
@@ -16766,26 +16387,40 @@ class TokenBridge {
|
|
|
16766
16387
|
...txItem,
|
|
16767
16388
|
token: decodedData[1],
|
|
16768
16389
|
sender: decodedData[2],
|
|
16769
|
-
|
|
16390
|
+
recipient: decodedData[3],
|
|
16770
16391
|
amount: decodedData[4],
|
|
16771
16392
|
};
|
|
16772
16393
|
}
|
|
16773
|
-
let flowRatePromiseIndex;
|
|
16394
|
+
let flowRatePromiseIndex = flowRatePromisesReceivers.findIndex((el) => el === txItem.recipient);
|
|
16774
16395
|
if (metaStatus === StatusResponse.COMPLETE
|
|
16775
|
-
&& isWithdraw && txItem.
|
|
16396
|
+
&& isWithdraw && txItem.recipient) {
|
|
16776
16397
|
// consolidate the calls we have to make to the flow rate by receiver
|
|
16777
|
-
if (
|
|
16778
|
-
|
|
16779
|
-
flowRatePromisesReceivers.push(txItem.receiver);
|
|
16398
|
+
if (flowRatePromiseIndex === -1) {
|
|
16399
|
+
flowRatePromisesReceivers.push(txItem.recipient);
|
|
16780
16400
|
flowRatePromiseIndex = flowRatePromisesReceivers.length - 1;
|
|
16781
16401
|
}
|
|
16782
|
-
else {
|
|
16783
|
-
flowRatePromiseIndex = flowRatePromisesReceivers.findIndex((el) => el === txItem.receiver);
|
|
16784
|
-
}
|
|
16785
16402
|
txItem.data.flowRatePromiseIndex = flowRatePromiseIndex;
|
|
16786
16403
|
}
|
|
16787
16404
|
txStatusResponse.transactions.push(txItem);
|
|
16788
16405
|
} // for
|
|
16406
|
+
for (const flowRateReceiver of flowRatePromisesReceivers) {
|
|
16407
|
+
flowRateLengthPromises.push(rootBridge.getPendingWithdrawalsLength(flowRateReceiver));
|
|
16408
|
+
}
|
|
16409
|
+
let flowRateLengthResponses = [];
|
|
16410
|
+
try {
|
|
16411
|
+
flowRateLengthResponses = await Promise.all(flowRateLengthPromises);
|
|
16412
|
+
}
|
|
16413
|
+
catch (err) {
|
|
16414
|
+
throw new BridgeError(`Failed to fetch the Flow Rate pending lengths with the reason: ${err}`, BridgeErrorType.FLOW_RATE_ERROR);
|
|
16415
|
+
}
|
|
16416
|
+
for (let i = 0, l = flowRatePromisesReceivers.length; i < l; i++) {
|
|
16417
|
+
const indices = [];
|
|
16418
|
+
const indicesLength = flowRateLengthResponses[i].toNumber();
|
|
16419
|
+
for (let j = 0; j < indicesLength; j++) {
|
|
16420
|
+
indices.push(j);
|
|
16421
|
+
}
|
|
16422
|
+
flowRatePromises.push(rootBridge.getPendingWithdrawals(flowRatePromisesReceivers[i], indices));
|
|
16423
|
+
}
|
|
16789
16424
|
let flowRateResponses = [];
|
|
16790
16425
|
if (flowRatePromises.length > 0) {
|
|
16791
16426
|
try {
|
|
@@ -16820,33 +16455,49 @@ class TokenBridge {
|
|
|
16820
16455
|
* @throws {BridgeError} - If an error occurs during the query, a BridgeError will be thrown with a specific error type.
|
|
16821
16456
|
* @dev this SDK method is currently stubbed
|
|
16822
16457
|
*/
|
|
16823
|
-
async getFlowRateInfo(req
|
|
16824
|
-
|
|
16825
|
-
|
|
16458
|
+
async getFlowRateInfo(req) {
|
|
16459
|
+
if (!req.tokens || req.tokens.length === 0) {
|
|
16460
|
+
throw new BridgeError(`invalid tokens array ${req.tokens}`, BridgeErrorType.INVALID_TOKEN);
|
|
16461
|
+
}
|
|
16462
|
+
const rootBridge = await withBridgeError(async () => {
|
|
16463
|
+
const contract = new Contract(this.config.bridgeContracts.rootERC20BridgeFlowRate, ROOT_ERC20_BRIDGE_FLOW_RATE, this.config.rootProvider);
|
|
16464
|
+
return contract;
|
|
16465
|
+
}, BridgeErrorType.INTERNAL_ERROR);
|
|
16466
|
+
const contractPromises = [];
|
|
16467
|
+
contractPromises.push(rootBridge.withdrawalQueueActivated());
|
|
16468
|
+
contractPromises.push(rootBridge.withdrawalDelay());
|
|
16469
|
+
for (let token of req.tokens) {
|
|
16470
|
+
if (token.toUpperCase() === 'NATIVE') {
|
|
16471
|
+
token = ETHEREUM_NATIVE_TOKEN_ADDRESS;
|
|
16472
|
+
}
|
|
16473
|
+
contractPromises.push(rootBridge.flowRateBuckets(token));
|
|
16474
|
+
}
|
|
16475
|
+
let contractPromisesRes;
|
|
16476
|
+
try {
|
|
16477
|
+
contractPromisesRes = await Promise.all(contractPromises);
|
|
16478
|
+
}
|
|
16479
|
+
catch (err) {
|
|
16480
|
+
throw new BridgeError('unable to query contract for flowrate info', BridgeErrorType.INTERNAL_ERROR);
|
|
16481
|
+
}
|
|
16482
|
+
const tokensRes = {};
|
|
16483
|
+
// @note it's i + 2 because the first 2 promises are not token buckets
|
|
16484
|
+
for (let i = 0, l = req.tokens.length; i < l; i++) {
|
|
16485
|
+
tokensRes[req.tokens[i]] = {
|
|
16486
|
+
capacity: contractPromisesRes[i + 2].capacity,
|
|
16487
|
+
depth: contractPromisesRes[i + 2].depth,
|
|
16488
|
+
refillTime: contractPromisesRes[i + 2].refillTime.toNumber(),
|
|
16489
|
+
refillRate: contractPromisesRes[i + 2].refillRate,
|
|
16490
|
+
};
|
|
16491
|
+
}
|
|
16826
16492
|
// Return the token mappings
|
|
16827
16493
|
return {
|
|
16828
|
-
withdrawalQueueActivated:
|
|
16829
|
-
withdrawalDelay:
|
|
16830
|
-
tokens:
|
|
16831
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
16832
|
-
NATIVE: {
|
|
16833
|
-
capacity: parseUnits('10', 18).toString(),
|
|
16834
|
-
depth: parseUnits('10', 18).toString(),
|
|
16835
|
-
refillTime: 1701227629,
|
|
16836
|
-
refillRate: parseUnits('10', 18).toString(),
|
|
16837
|
-
},
|
|
16838
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
16839
|
-
'0xF57e7e7C23978C3cAEC3C3548E3D615c346e79fF': {
|
|
16840
|
-
capacity: parseUnits('10', 18).toString(),
|
|
16841
|
-
depth: parseUnits('10', 18).toString(),
|
|
16842
|
-
refillTime: 1701227629,
|
|
16843
|
-
refillRate: parseUnits('10', 18).toString(),
|
|
16844
|
-
},
|
|
16845
|
-
},
|
|
16494
|
+
withdrawalQueueActivated: contractPromisesRes[0],
|
|
16495
|
+
withdrawalDelay: contractPromisesRes[1].toNumber(),
|
|
16496
|
+
tokens: tokensRes,
|
|
16846
16497
|
};
|
|
16847
16498
|
}
|
|
16848
16499
|
/**
|
|
16849
|
-
*
|
|
16500
|
+
* Fetches the pending withdrawals for a given address.
|
|
16850
16501
|
*
|
|
16851
16502
|
* @param {PendingWithdrawalsRequest} req - The request object containing the reciever address.
|
|
16852
16503
|
* @returns {Promise<PendingWithdrawalsResponse>} - A promise that resolves to an object containing the child token address.
|
|
@@ -16855,25 +16506,46 @@ class TokenBridge {
|
|
|
16855
16506
|
*/
|
|
16856
16507
|
async getPendingWithdrawals(req) {
|
|
16857
16508
|
// eslint-disable-next-line no-console
|
|
16858
|
-
|
|
16859
|
-
|
|
16860
|
-
|
|
16861
|
-
|
|
16862
|
-
|
|
16863
|
-
|
|
16864
|
-
|
|
16865
|
-
|
|
16866
|
-
|
|
16867
|
-
|
|
16868
|
-
{
|
|
16869
|
-
canWithdraw: false,
|
|
16870
|
-
withdrawer: '0xEac347177DbA4a190B632C7d9b8da2AbfF57c772',
|
|
16871
|
-
token: '0xF57e7e7C23978C3cAEC3C3548E3D615c346e79fF',
|
|
16872
|
-
amount: parseUnits('2', 18).toString(),
|
|
16873
|
-
timeoutStart: 1698416029,
|
|
16874
|
-
timeoutEnd: 1698502429,
|
|
16875
|
-
}],
|
|
16509
|
+
if (!req.recipient) {
|
|
16510
|
+
throw new BridgeError(`invalid recipient ${req.recipient}`, BridgeErrorType.INVALID_RECIPIENT);
|
|
16511
|
+
}
|
|
16512
|
+
const rootBridge = await withBridgeError(async () => {
|
|
16513
|
+
const contract = new Contract(this.config.bridgeContracts.rootERC20BridgeFlowRate, ROOT_ERC20_BRIDGE_FLOW_RATE, this.config.rootProvider);
|
|
16514
|
+
return contract;
|
|
16515
|
+
}, BridgeErrorType.INTERNAL_ERROR);
|
|
16516
|
+
const pendingLength = await rootBridge.getPendingWithdrawalsLength(req.recipient);
|
|
16517
|
+
const pendingWithdrawals = {
|
|
16518
|
+
pending: [],
|
|
16876
16519
|
};
|
|
16520
|
+
if (pendingLength.toNumber() === 0) {
|
|
16521
|
+
return pendingWithdrawals;
|
|
16522
|
+
}
|
|
16523
|
+
const indices = [];
|
|
16524
|
+
for (let i = 0; i < pendingLength.toNumber(); i++) {
|
|
16525
|
+
indices.push(i);
|
|
16526
|
+
}
|
|
16527
|
+
const pending = await rootBridge.getPendingWithdrawals(req.recipient, indices);
|
|
16528
|
+
const timestampNow = Math.floor(Date.now() / 1000);
|
|
16529
|
+
const withdrawalDelay = await rootBridge.withdrawalDelay();
|
|
16530
|
+
for (let i = 0, l = pending.length; i < l; i++) {
|
|
16531
|
+
const timeoutEnd = pending[i].timestamp.add(withdrawalDelay).toNumber();
|
|
16532
|
+
if (timeoutEnd > timestampNow) {
|
|
16533
|
+
pendingWithdrawals.pending[i] = {
|
|
16534
|
+
canWithdraw: false,
|
|
16535
|
+
};
|
|
16536
|
+
}
|
|
16537
|
+
else {
|
|
16538
|
+
pendingWithdrawals.pending[i] = {
|
|
16539
|
+
canWithdraw: true,
|
|
16540
|
+
};
|
|
16541
|
+
}
|
|
16542
|
+
pendingWithdrawals.pending[i].withdrawer = pending[i].withdrawer;
|
|
16543
|
+
pendingWithdrawals.pending[i].token = pending[i].token;
|
|
16544
|
+
pendingWithdrawals.pending[i].amount = pending[i].amount;
|
|
16545
|
+
pendingWithdrawals.pending[i].timeoutStart = pending[i].timestamp.toNumber();
|
|
16546
|
+
pendingWithdrawals.pending[i].timeoutEnd = timeoutEnd;
|
|
16547
|
+
}
|
|
16548
|
+
return pendingWithdrawals;
|
|
16877
16549
|
}
|
|
16878
16550
|
/**
|
|
16879
16551
|
* Retrieves the unsigned flow rate withdrawal transaction
|
|
@@ -16885,12 +16557,54 @@ class TokenBridge {
|
|
|
16885
16557
|
*/
|
|
16886
16558
|
async getFlowRateWithdrawTx(req) {
|
|
16887
16559
|
// eslint-disable-next-line no-console
|
|
16888
|
-
|
|
16560
|
+
if (!req.recipient) {
|
|
16561
|
+
throw new BridgeError(`invalid recipient ${req.recipient}`, BridgeErrorType.INVALID_RECIPIENT);
|
|
16562
|
+
}
|
|
16563
|
+
if (req.index < 0) {
|
|
16564
|
+
throw new BridgeError(`invalid index ${req.index}`, BridgeErrorType.INVALID_FLOWRATE_INDEX);
|
|
16565
|
+
}
|
|
16566
|
+
const rootBridge = await withBridgeError(async () => {
|
|
16567
|
+
const contract = new Contract(this.config.bridgeContracts.rootERC20BridgeFlowRate, ROOT_ERC20_BRIDGE_FLOW_RATE, this.config.rootProvider);
|
|
16568
|
+
return contract;
|
|
16569
|
+
}, BridgeErrorType.INTERNAL_ERROR);
|
|
16570
|
+
const pending = await rootBridge.getPendingWithdrawals(req.recipient, [req.index]);
|
|
16571
|
+
if (pending[0].withdrawer === AddressZero
|
|
16572
|
+
|| pending[0].token === AddressZero
|
|
16573
|
+
|| pending[0].amount === BigNumber.from(0)
|
|
16574
|
+
|| pending[0].timestamp === BigNumber.from(0)) {
|
|
16575
|
+
throw new BridgeError(`pending withdrawal not found for ${req.recipient} at index ${req.index}`, BridgeErrorType.FLOW_RATE_ERROR);
|
|
16576
|
+
}
|
|
16577
|
+
const withdrawalDelay = await rootBridge.withdrawalDelay();
|
|
16578
|
+
const timeoutEnd = pending[0].timestamp.add(withdrawalDelay).toNumber();
|
|
16579
|
+
const timestampNow = Math.floor(Date.now() / 1000);
|
|
16580
|
+
if (timeoutEnd > timestampNow) {
|
|
16581
|
+
return {
|
|
16582
|
+
pendingWithdrawal: {
|
|
16583
|
+
canWithdraw: false,
|
|
16584
|
+
withdrawer: pending[0].withdrawer,
|
|
16585
|
+
token: pending[0].token,
|
|
16586
|
+
amount: pending[0].amount,
|
|
16587
|
+
timeoutStart: pending[0].timestamp.toNumber(),
|
|
16588
|
+
timeoutEnd,
|
|
16589
|
+
},
|
|
16590
|
+
unsignedTx: null,
|
|
16591
|
+
};
|
|
16592
|
+
}
|
|
16593
|
+
const data = await withBridgeError(async () => rootBridge.interface.encodeFunctionData('finaliseQueuedWithdrawal', [req.recipient, req.index]), BridgeErrorType.INTERNAL_ERROR);
|
|
16889
16594
|
return {
|
|
16595
|
+
pendingWithdrawal: {
|
|
16596
|
+
canWithdraw: true,
|
|
16597
|
+
withdrawer: pending[0].withdrawer,
|
|
16598
|
+
token: pending[0].token,
|
|
16599
|
+
amount: pending[0].amount,
|
|
16600
|
+
timeoutStart: pending[0].timestamp.toNumber(),
|
|
16601
|
+
timeoutEnd,
|
|
16602
|
+
},
|
|
16890
16603
|
unsignedTx: {
|
|
16891
|
-
data
|
|
16892
|
-
to:
|
|
16604
|
+
data,
|
|
16605
|
+
to: this.config.bridgeContracts.rootERC20BridgeFlowRate,
|
|
16893
16606
|
value: 0,
|
|
16607
|
+
chainId: parseInt(this.config.bridgeInstance.rootChainID, 10),
|
|
16894
16608
|
},
|
|
16895
16609
|
};
|
|
16896
16610
|
}
|
|
@@ -16944,17 +16658,26 @@ const CONTRACTS_FOR_BRIDGE = new Map()
|
|
|
16944
16658
|
.set(ETH_SEPOLIA_TO_ZKEVM_DEVNET, {
|
|
16945
16659
|
rootERC20BridgeFlowRate: '0x0',
|
|
16946
16660
|
childERC20Bridge: '0x0',
|
|
16947
|
-
|
|
16661
|
+
rootChainIMX: '0x0',
|
|
16662
|
+
rootChainWrappedETH: '0x0',
|
|
16663
|
+
childChainWrappedETH: '0x0',
|
|
16664
|
+
childChainWrappedIMX: '0x0',
|
|
16948
16665
|
})
|
|
16949
16666
|
.set(ETH_SEPOLIA_TO_ZKEVM_TESTNET, {
|
|
16950
16667
|
rootERC20BridgeFlowRate: '0x0D3C59c779Fd552C27b23F723E80246c840100F5',
|
|
16951
16668
|
childERC20Bridge: '0x0D3C59c779Fd552C27b23F723E80246c840100F5',
|
|
16952
|
-
|
|
16669
|
+
rootChainIMX: '0xe2629e08f4125d14e446660028bD98ee60EE69F2',
|
|
16670
|
+
rootChainWrappedETH: '0x7b79995e5f793A07Bc00c21412e50Ecae098E7f9',
|
|
16671
|
+
childChainWrappedETH: '0xe9E96d1aad82562b7588F03f49aD34186f996478',
|
|
16672
|
+
childChainWrappedIMX: '0x1CcCa691501174B4A623CeDA58cC8f1a76dc3439',
|
|
16953
16673
|
})
|
|
16954
16674
|
.set(ETH_MAINNET_TO_ZKEVM_MAINNET, {
|
|
16955
|
-
rootERC20BridgeFlowRate: '
|
|
16956
|
-
childERC20Bridge: '
|
|
16957
|
-
|
|
16675
|
+
rootERC20BridgeFlowRate: '0xBa5E35E26Ae59c7aea6F029B68c6460De2d13eB6',
|
|
16676
|
+
childERC20Bridge: '0xBa5E35E26Ae59c7aea6F029B68c6460De2d13eB6',
|
|
16677
|
+
rootChainIMX: '0xF57e7e7C23978C3cAEC3C3548E3D615c346e79fF',
|
|
16678
|
+
rootChainWrappedETH: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
|
|
16679
|
+
childChainWrappedETH: '0x52a6c53869ce09a731cd772f245b97a4401d3348',
|
|
16680
|
+
childChainWrappedIMX: '0x3a0c2ba54d6cbd3121f01b96dfd20e99d1696c9d',
|
|
16958
16681
|
});
|
|
16959
16682
|
/**
|
|
16960
16683
|
* Represents the configuration for a bridge between two chains.
|
|
@@ -17317,134 +17040,6 @@ class ERC20__factory {
|
|
|
17317
17040
|
/* tslint:disable */
|
|
17318
17041
|
/* eslint-disable */
|
|
17319
17042
|
const _abi$2 = [
|
|
17320
|
-
{
|
|
17321
|
-
inputs: [],
|
|
17322
|
-
name: "getCurrentBlockTimestamp",
|
|
17323
|
-
outputs: [
|
|
17324
|
-
{
|
|
17325
|
-
internalType: "uint256",
|
|
17326
|
-
name: "timestamp",
|
|
17327
|
-
type: "uint256",
|
|
17328
|
-
},
|
|
17329
|
-
],
|
|
17330
|
-
stateMutability: "view",
|
|
17331
|
-
type: "function",
|
|
17332
|
-
},
|
|
17333
|
-
{
|
|
17334
|
-
inputs: [
|
|
17335
|
-
{
|
|
17336
|
-
internalType: "address",
|
|
17337
|
-
name: "addr",
|
|
17338
|
-
type: "address",
|
|
17339
|
-
},
|
|
17340
|
-
],
|
|
17341
|
-
name: "getEthBalance",
|
|
17342
|
-
outputs: [
|
|
17343
|
-
{
|
|
17344
|
-
internalType: "uint256",
|
|
17345
|
-
name: "balance",
|
|
17346
|
-
type: "uint256",
|
|
17347
|
-
},
|
|
17348
|
-
],
|
|
17349
|
-
stateMutability: "view",
|
|
17350
|
-
type: "function",
|
|
17351
|
-
},
|
|
17352
|
-
{
|
|
17353
|
-
inputs: [
|
|
17354
|
-
{
|
|
17355
|
-
components: [
|
|
17356
|
-
{
|
|
17357
|
-
internalType: "address",
|
|
17358
|
-
name: "target",
|
|
17359
|
-
type: "address",
|
|
17360
|
-
},
|
|
17361
|
-
{
|
|
17362
|
-
internalType: "uint256",
|
|
17363
|
-
name: "gasLimit",
|
|
17364
|
-
type: "uint256",
|
|
17365
|
-
},
|
|
17366
|
-
{
|
|
17367
|
-
internalType: "bytes",
|
|
17368
|
-
name: "callData",
|
|
17369
|
-
type: "bytes",
|
|
17370
|
-
},
|
|
17371
|
-
],
|
|
17372
|
-
internalType: "struct UniswapInterfaceMulticall.Call[]",
|
|
17373
|
-
name: "calls",
|
|
17374
|
-
type: "tuple[]",
|
|
17375
|
-
},
|
|
17376
|
-
],
|
|
17377
|
-
name: "multicall",
|
|
17378
|
-
outputs: [
|
|
17379
|
-
{
|
|
17380
|
-
internalType: "uint256",
|
|
17381
|
-
name: "blockNumber",
|
|
17382
|
-
type: "uint256",
|
|
17383
|
-
},
|
|
17384
|
-
{
|
|
17385
|
-
components: [
|
|
17386
|
-
{
|
|
17387
|
-
internalType: "bool",
|
|
17388
|
-
name: "success",
|
|
17389
|
-
type: "bool",
|
|
17390
|
-
},
|
|
17391
|
-
{
|
|
17392
|
-
internalType: "uint256",
|
|
17393
|
-
name: "gasUsed",
|
|
17394
|
-
type: "uint256",
|
|
17395
|
-
},
|
|
17396
|
-
{
|
|
17397
|
-
internalType: "bytes",
|
|
17398
|
-
name: "returnData",
|
|
17399
|
-
type: "bytes",
|
|
17400
|
-
},
|
|
17401
|
-
],
|
|
17402
|
-
internalType: "struct UniswapInterfaceMulticall.Result[]",
|
|
17403
|
-
name: "returnData",
|
|
17404
|
-
type: "tuple[]",
|
|
17405
|
-
},
|
|
17406
|
-
],
|
|
17407
|
-
stateMutability: "nonpayable",
|
|
17408
|
-
type: "function",
|
|
17409
|
-
},
|
|
17410
|
-
];
|
|
17411
|
-
const _bytecode$2 = "0x608060405234801561001057600080fd5b50610567806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80630f28c97d146100465780631749e1e3146100645780634d2301cc14610085575b600080fd5b61004e610098565b60405161005b919061041f565b60405180910390f35b6100776100723660046102a7565b61009c565b60405161005b929190610428565b61004e610093366004610286565b610220565b4290565b8051439060609067ffffffffffffffff811180156100b957600080fd5b506040519080825280602002602001820160405280156100f357816020015b6100e061023a565b8152602001906001900390816100d85790505b50905060005b835181101561021a57600080600086848151811061011357fe5b60200260200101516000015187858151811061012b57fe5b60200260200101516020015188868151811061014357fe5b60200260200101516040015192509250925060005a90506000808573ffffffffffffffffffffffffffffffffffffffff1685856040516101839190610403565b60006040518083038160008787f1925050503d80600081146101c1576040519150601f19603f3d011682016040523d82523d6000602084013e6101c6565b606091505b509150915060005a8403905060405180606001604052808415158152602001828152602001838152508989815181106101fb57fe5b60200260200101819052505050505050505080806001019150506100f9565b50915091565b73ffffffffffffffffffffffffffffffffffffffff163190565b604051806060016040528060001515815260200160008152602001606081525090565b803573ffffffffffffffffffffffffffffffffffffffff8116811461028157600080fd5b919050565b600060208284031215610297578081fd5b6102a08261025d565b9392505050565b600060208083850312156102b9578182fd5b823567ffffffffffffffff808211156102d0578384fd5b818501915085601f8301126102e3578384fd5b8135818111156102ef57fe5b6102fc8485830201610506565b81815284810190848601875b848110156103f457813587017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0606081838f03011215610346578a8bfd5b60408051606081018181108b8211171561035c57fe5b8252610369848d0161025d565b8152818401358c82015260608401358a811115610384578d8efd5b8085019450508e603f850112610398578c8dfd5b8b8401358a8111156103a657fe5b6103b68d85601f84011601610506565b93508084528f838287010111156103cb578d8efd5b808386018e86013783018c018d9052908101919091528552509287019290870190600101610308565b50909998505050505050505050565b6000825161041581846020870161052a565b9190910192915050565b90815260200190565b600060408083018584526020828186015281865180845260609350838701915083838202880101838901875b838110156104f6578983037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa001855281518051151584528681015187850152880151888401889052805188850181905260806104b582828801858c0161052a565b96880196601f919091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01694909401909301925090850190600101610454565b50909a9950505050505050505050565b60405181810167ffffffffffffffff8111828210171561052257fe5b604052919050565b60005b8381101561054557818101518382015260200161052d565b83811115610554576000848401525b5050505056fea164736f6c6343000706000a";
|
|
17412
|
-
const isSuperArgs$2 = (xs) => xs.length > 1;
|
|
17413
|
-
class Multicall__factory extends ContractFactory {
|
|
17414
|
-
constructor(...args) {
|
|
17415
|
-
if (isSuperArgs$2(args)) {
|
|
17416
|
-
super(...args);
|
|
17417
|
-
}
|
|
17418
|
-
else {
|
|
17419
|
-
super(_abi$2, _bytecode$2, args[0]);
|
|
17420
|
-
}
|
|
17421
|
-
}
|
|
17422
|
-
deploy(overrides) {
|
|
17423
|
-
return super.deploy(overrides || {});
|
|
17424
|
-
}
|
|
17425
|
-
getDeployTransaction(overrides) {
|
|
17426
|
-
return super.getDeployTransaction(overrides || {});
|
|
17427
|
-
}
|
|
17428
|
-
attach(address) {
|
|
17429
|
-
return super.attach(address);
|
|
17430
|
-
}
|
|
17431
|
-
connect(signer) {
|
|
17432
|
-
return super.connect(signer);
|
|
17433
|
-
}
|
|
17434
|
-
static bytecode = _bytecode$2;
|
|
17435
|
-
static abi = _abi$2;
|
|
17436
|
-
static createInterface() {
|
|
17437
|
-
return new utils$1.Interface(_abi$2);
|
|
17438
|
-
}
|
|
17439
|
-
static connect(address, signerOrProvider) {
|
|
17440
|
-
return new Contract$1(address, _abi$2, signerOrProvider);
|
|
17441
|
-
}
|
|
17442
|
-
}
|
|
17443
|
-
|
|
17444
|
-
/* Autogenerated file. Do not edit manually. */
|
|
17445
|
-
/* tslint:disable */
|
|
17446
|
-
/* eslint-disable */
|
|
17447
|
-
const _abi$1 = [
|
|
17448
17043
|
{
|
|
17449
17044
|
inputs: [
|
|
17450
17045
|
{
|
|
@@ -17728,7 +17323,7 @@ const _abi$1 = [
|
|
|
17728
17323
|
type: "uint256",
|
|
17729
17324
|
},
|
|
17730
17325
|
],
|
|
17731
|
-
internalType: "struct
|
|
17326
|
+
internalType: "struct IImmutableSwapProxy.SecondaryFeeParams[]",
|
|
17732
17327
|
name: "secondaryFees",
|
|
17733
17328
|
type: "tuple[]",
|
|
17734
17329
|
},
|
|
@@ -17801,7 +17396,7 @@ const _abi$1 = [
|
|
|
17801
17396
|
type: "uint256",
|
|
17802
17397
|
},
|
|
17803
17398
|
],
|
|
17804
|
-
internalType: "struct
|
|
17399
|
+
internalType: "struct IImmutableSwapProxy.SecondaryFeeParams[]",
|
|
17805
17400
|
name: "secondaryFees",
|
|
17806
17401
|
type: "tuple[]",
|
|
17807
17402
|
},
|
|
@@ -17859,7 +17454,7 @@ const _abi$1 = [
|
|
|
17859
17454
|
type: "uint256",
|
|
17860
17455
|
},
|
|
17861
17456
|
],
|
|
17862
|
-
internalType: "struct
|
|
17457
|
+
internalType: "struct IImmutableSwapProxy.SecondaryFeeParams[]",
|
|
17863
17458
|
name: "secondaryFees",
|
|
17864
17459
|
type: "tuple[]",
|
|
17865
17460
|
},
|
|
@@ -17910,7 +17505,7 @@ const _abi$1 = [
|
|
|
17910
17505
|
outputs: [
|
|
17911
17506
|
{
|
|
17912
17507
|
internalType: "uint256",
|
|
17913
|
-
name: "",
|
|
17508
|
+
name: "amountIn",
|
|
17914
17509
|
type: "uint256",
|
|
17915
17510
|
},
|
|
17916
17511
|
],
|
|
@@ -17932,7 +17527,7 @@ const _abi$1 = [
|
|
|
17932
17527
|
type: "uint256",
|
|
17933
17528
|
},
|
|
17934
17529
|
],
|
|
17935
|
-
internalType: "struct
|
|
17530
|
+
internalType: "struct IImmutableSwapProxy.SecondaryFeeParams[]",
|
|
17936
17531
|
name: "secondaryFees",
|
|
17937
17532
|
type: "tuple[]",
|
|
17938
17533
|
},
|
|
@@ -17968,7 +17563,7 @@ const _abi$1 = [
|
|
|
17968
17563
|
outputs: [
|
|
17969
17564
|
{
|
|
17970
17565
|
internalType: "uint256",
|
|
17971
|
-
name: "",
|
|
17566
|
+
name: "amountIn",
|
|
17972
17567
|
type: "uint256",
|
|
17973
17568
|
},
|
|
17974
17569
|
],
|
|
@@ -18210,15 +17805,15 @@ const _abi$1 = [
|
|
|
18210
17805
|
type: "receive",
|
|
18211
17806
|
},
|
|
18212
17807
|
];
|
|
18213
|
-
const _bytecode$1 = "0x60806040523480156200001157600080fd5b50604051620031e1380380620031e183398101604081905262000034916200015c565b6001805460ff191690556200004b6000846200009e565b600180546001600160a01b039384166101008102610100600160a81b03199092169190911790915560038054929093166001600160a01b03199283161790925560028054909116909117905550620001a6565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166200013b576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620000fa3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b80516001600160a01b03811681146200015757600080fd5b919050565b6000806000606084860312156200017257600080fd5b6200017d846200013f565b92506200018d602085016200013f565b91506200019d604085016200013f565b90509250925092565b61302b80620001b66000396000f3fe6080604052600436106101175760003560e01c806358e81a50116100a05780638456cb59116100645780638456cb59146102c457806391d14854146102d9578063a217fddf146102f9578063ac9650d81461030e578063d547741f1461032e57600080fd5b806358e81a50146102465780635ae401dc146102595780635c975abb146102795780635ebca7991461029157806368742da6146102a457600080fd5b80632f2ff15d116100e75780632f2ff15d146101cb57806336568abe146101eb578063383ebb0b1461020b5780633f4ba83a1461021e5780635640f6591461023357600080fd5b80620fa9fb1461012357806301ffc9a714610145578063116944b21461017a578063248a9ca31461019b57600080fd5b3661011e57005b600080fd5b34801561012f57600080fd5b5061014361013e3660046127c3565b61034e565b005b34801561015157600080fd5b506101656101603660046127fc565b61041a565b60405190151581526020015b60405180910390f35b61018d61018836600461298d565b610451565b604051908152602001610171565b3480156101a757600080fd5b5061018d6101b63660046129e2565b60009081526020819052604090206001015490565b3480156101d757600080fd5b506101436101e63660046129fb565b6106d3565b3480156101f757600080fd5b506101436102063660046129fb565b6106f8565b61018d610219366004612ae3565b61077b565b34801561022a57600080fd5b50610143610ae7565b61018d610241366004612ae3565b610b37565b61018d61025436600461298d565b610db2565b61026c610267366004612b8f565b6110e4565b6040516101719190612c2a565b34801561028557600080fd5b5060015460ff16610165565b61014361029f3660046129e2565b611119565b3480156102b057600080fd5b506101436102bf366004612c8c565b611266565b3480156102d057600080fd5b506101436112e1565b3480156102e557600080fd5b506101656102f43660046129fb565b61132f565b34801561030557600080fd5b5061018d600081565b34801561031a57600080fd5b5061026c610329366004612ca9565b611358565b34801561033a57600080fd5b506101436103493660046129fb565b61144c565b6103787f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e9828693361132f565b610394576040516282b42960e81b815260040160405180910390fd5b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa1580156103db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ff9190612cea565b90506104156001600160a01b0383168483611471565b505050565b60006001600160e01b03198216637965db0b60e01b148061044b57506301ffc9a760e01b6001600160e01b03198316145b92915050565b600061045f60015460ff1690565b1561047d5760405163ab35696f60e01b815260040160405180910390fd5b61048a82606001516114d4565b6104a75760405163519bdea760e01b815260040160405180910390fd5b4780156105e757826080015181146104d2576040516342f7487960e11b815260040160405180910390fd5b60035483516001600160a01b03908116911614610502576040516324d0121760e01b815260040160405180910390fd5b61056283608001518686808060200260200160405190810160405280939291908181526020016000905b828210156105585761054960408302860136819003810190612d03565b8152602001906001019061052c565b50505050506114fa565b608084018190526001546040516304e45aaf60e01b81526101009091046001600160a01b0316916304e45aaf9161059d908790600401612d5a565b60206040518083038185885af11580156105bb573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906105e09190612cea565b91506106cb565b61064c836000015184608001518787808060200260200160405190810160405280939291908181526020016000905b828210156106425761063360408302860136819003810190612d03565b81526020019060010190610616565b505050505061154c565b60808401526001546040516304e45aaf60e01b81526101009091046001600160a01b0316906304e45aaf90610685908690600401612d5a565b6020604051808303816000875af11580156106a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c89190612cea565b91505b509392505050565b6000828152602081905260409020600101546106ee816115a9565b61041583836115b3565b6001600160a01b038116331461076d5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6107778282611637565b5050565b600061078960015460ff1690565b156107a75760405163ab35696f60e01b815260040160405180910390fd5b6107b482602001516114d4565b6107d15760405163519bdea760e01b815260040160405180910390fd5b60006107e0836000015161169c565b9050478015610992576003546001600160a01b03838116911614610817576040516324d0121760e01b815260040160405180910390fd5b8360600151811461083b576040516342f7487960e11b815260040160405180910390fd5b60008061089e86606001518989808060200260200160405190810160405280939291908181526020016000905b828210156108945761088560408302860136819003810190612d03565b81526020019060010190610868565b50505050506116ca565b606088018190526001546040516304dc09a360e11b81529294509092506000916101009091046001600160a01b0316906309b813469084906108e4908b90600401612e00565b60206040518083038185885af1158015610902573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109279190612cea565b905061098681848b8b808060200260200160405190810160405280939291908181526020016000905b8282101561097c5761096d60408302860136819003810190612d03565b81526020019060010190610950565b505050505061171d565b95505050505050610ae0565b6000806109f68487606001518a8a808060200260200160405190810160405280939291908181526020016000905b828210156109ec576109dd60408302860136819003810190612d03565b815260200190600101906109c0565b5050505050611811565b606088018190526001546040516304dc09a360e11b81529294509092506000916101009091046001600160a01b0316906309b8134690610a3a908a90600401612e00565b6020604051808303816000875af1158015610a59573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7d9190612cea565b90506109868582858c8c808060200260200160405190810160405280939291908181526020016000905b82821015610ad357610ac460408302860136819003810190612d03565b81526020019060010190610aa7565b505050505061186b565b50505b9392505050565b610b117fe7276a2a84d8de556657ec9cf93a55a7d66f096e529d0582ed08e9e2208b92b53361132f565b610b2d576040516282b42960e81b815260040160405180910390fd5b610b356118c7565b565b6000610b4560015460ff1690565b15610b635760405163ab35696f60e01b815260040160405180910390fd5b610b7082602001516114d4565b610b8d5760405163519bdea760e01b815260040160405180910390fd5b6000610b9c8360000151611919565b9050478015610cd25783604001518114610bc9576040516342f7487960e11b815260040160405180910390fd5b6003546001600160a01b03838116911614610bf7576040516324d0121760e01b815260040160405180910390fd5b610c4d84604001518787808060200260200160405190810160405280939291908181526020016000905b8282101561055857610c3e60408302860136819003810190612d03565b81526020019060010190610c21565b6040858101829052600154905163b858183f60e01b81526101009091046001600160a01b03169163b858183f91610c88908890600401612e00565b60206040518083038185885af1158015610ca6573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ccb9190612cea565b9250610add565b610d298285604001518888808060200260200160405190810160405280939291908181526020016000905b8282101561064257610d1a60408302860136819003810190612d03565b81526020019060010190610cfd565b604085810191909152600154905163b858183f60e01b81526101009091046001600160a01b03169063b858183f90610d65908790600401612e00565b6020604051808303816000875af1158015610d84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610da89190612cea565b9695505050505050565b6000610dc060015460ff1690565b15610dde5760405163ab35696f60e01b815260040160405180910390fd5b610deb82606001516114d4565b610e085760405163519bdea760e01b815260040160405180910390fd5b478015610fa55760035483516001600160a01b03908116911614610e3f576040516324d0121760e01b815260040160405180910390fd5b8260a001518114610e63576040516342f7487960e11b815260040160405180910390fd5b600080610ebc8560a001518888808060200260200160405190810160405280939291908181526020016000905b8282101561089457610ead60408302860136819003810190612d03565b81526020019060010190610e90565b60a08701819052600154604051635023b4df60e01b81529294509092506000916101009091046001600160a01b031690635023b4df908490610f02908a90600401612d5a565b60206040518083038185885af1158015610f20573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f459190612cea565b9050610f9a81848a8a808060200260200160405190810160405280939291908181526020016000905b8282101561097c57610f8b60408302860136819003810190612d03565b81526020019060010190610f6e565b945050505050610ae0565b60008061100385600001518660a001518989808060200260200160405190810160405280939291908181526020016000905b828210156109ec57610ff460408302860136819003810190612d03565b81526020019060010190610fd7565b60a08701819052600154604051635023b4df60e01b81529294509092506000916101009091046001600160a01b031690635023b4df90611047908990600401612d5a565b6020604051808303816000875af1158015611066573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108a9190612cea565b9050610f9a866000015182858b8b808060200260200160405190810160405280939291908181526020016000905b82821015610ad3576110d560408302860136819003810190612d03565b815260200190600101906110b8565b6060834211156111075760405163387b2e5560e11b815260040160405180910390fd5b6111118383611358565b949350505050565b6003546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015611162573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111869190612cea565b9050818110156111cc5760405162461bcd60e51b8152602060048201526011602482015270092dce6eaccccd2c6d2cadce840ae929ab607b1b6044820152606401610764565b801561077757600354604051632e1a7d4d60e01b8152600481018390526001600160a01b0390911690632e1a7d4d90602401600060405180830381600087803b15801561121857600080fd5b505af115801561122c573d6000803e3d6000fd5b50505050600061123c3383611925565b905080610415576040516342fb4ceb60e11b81526004810184905260248101839052604401610764565b6112907f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e9828693361132f565b6112ac576040516282b42960e81b815260040160405180910390fd5b47156112de5760006112be8247611925565b90508061077757604051633398652560e11b815260040160405180910390fd5b50565b61130b7ffcb9fcbfa83b897fb2d5cf4b58962164105c1e71489a37ef3ae0db3fdce576f63361132f565b611327576040516282b42960e81b815260040160405180910390fd5b610b356119cf565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6060816001600160401b038111156113725761137261286a565b6040519080825280602002602001820160405280156113a557816020015b60608152602001906001900390816113905790505b50905060005b8281101561144557611415308585848181106113c9576113c9612e13565b90506020028101906113db9190612e29565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611a0a92505050565b82828151811061142757611427612e13565b6020026020010181905250808061143d90612e85565b9150506113ab565b5092915050565b600082815260208190526040902060010154611467816115a9565b6104158383611637565b6040516001600160a01b03831660248201526044810182905261041590849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611a2f565b60006001600160a01b03821633148061044b57506001600160a01b038216301492915050565b600061150582611b04565b506000806115138585611b77565b90925090506115228286612e9e565b945061152d81611ca0565b600354611543906001600160a01b031686611d7f565b50929392505050565b600061155782611b04565b506000806115658585611b77565b90925090506115748286612e9e565b94506115808682611e7c565b6115956001600160a01b038716333088611f85565b61159f8686611d7f565b5092949350505050565b6112de8133611fc3565b6115bd828261132f565b610777576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556115f33390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b611641828261132f565b15610777576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600080601483516116ad9190612e9e565b905060006116bd8483601461201c565b9050611111816000612129565b60008060006116d884611b04565b905060006116e882612710612eb1565b90506116f7866127108361218e565b600354909350611710906001600160a01b031684611d7f565b85935050505b9250929050565b600080600061172c8685611b77565b9150915061173981611ca0565b600260009054906101000a90046001600160a01b03166001600160a01b03166312210e8a6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561178957600080fd5b505af115801561179d573d6000803e3d6000fd5b5050505060008287876117b09190612e9e565b6117ba9190612e9e565b604051909150600090339083156108fc0290849084818181858888f193505050509050806117fb576040516382e4f46960e01b815260040160405180910390fd5b6118058489612eb1565b98975050505050505050565b600080600061181f84611b04565b9050600061182f82612710612eb1565b905061183e866127108361218e565b925061184a8784611d7f565b61185f6001600160a01b038816333089611f85565b50939590945092505050565b600080600061187a8685611b77565b9150915061188887826121ce565b6118b233836118978989612e9e565b6118a19190612e9e565b6001600160a01b038a169190611471565b6118bc8287612eb1565b979650505050505050565b6118cf6122d5565b6001805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600061044b8282612129565b6000814710156119775760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610764565b6040516001600160a01b038416908390600081818185875af1925050503d80600081146119c0576040519150601f19603f3d011682016040523d82523d6000602084013e6119c5565b606091505b5090949350505050565b6119d761231e565b6001805460ff1916811790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258336118fc565b6060610ae08383604051806060016040528060278152602001612fcf60279139612364565b6000611a84826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166123d29092919063ffffffff16565b9050805160001480611aa5575080806020019051810190611aa59190612ec4565b6104155760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610764565b6000805b8251811015611b4e57828181518110611b2357611b23612e13565b60200260200101516020015182611b3a9190612eb1565b915080611b4681612e85565b915050611b08565b506103e8811115611b725760405163cd4e616760e01b815260040160405180910390fd5b919050565b6000606082516001600160401b03811115611b9457611b9461286a565b604051908082528060200260200182016040528015611bd957816020015b6040805180820190915260008082526020820152815260200190600190039081611bb25790505b50905060005b8351811015611c98576000611c1e858381518110611bff57611bff612e13565b602002602001015160200151612710886123e19092919063ffffffff16565b90506040518060400160405280868481518110611c3d57611c3d612e13565b6020026020010151600001516001600160a01b0316815260200182815250838381518110611c6d57611c6d612e13565b6020908102919091010152611c828185612eb1565b9350508080611c9090612e85565b915050611bdf565b509250929050565b60005b8151811015610777576000828281518110611cc057611cc0612e13565b602002602001015190506000611cde82600001518360200151611925565b905080611d1557815160208301516040516208c3b360e61b81526001600160a01b0390921660048301526024820152604401610764565b81600001516001600160a01b0316336001600160a01b03167fe0e765ab26c1caf691c510426951246128b96830e49cc81d8c093fd551abac358460200151604051611d6291815260200190565b60405180910390a350508080611d7790612e85565b915050611ca3565b600154604051636eb1769f60e11b81523060048201526001600160a01b0361010090920482166024820152829184169063dd62ed3e90604401602060405180830381865afa158015611dd5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611df99190612cea565b10156107775760015460405163095ea7b360e01b81526101009091046001600160a01b039081166004830152600019602483015283169063095ea7b3906044016020604051808303816000875af1158015611e58573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104159190612ec4565b60005b815181101561041557611ee233838381518110611e9e57611e9e612e13565b602002602001015160000151848481518110611ebc57611ebc612e13565b602002602001015160200151866001600160a01b0316611f85909392919063ffffffff16565b818181518110611ef457611ef4612e13565b6020026020010151600001516001600160a01b0316336001600160a01b0316846001600160a01b03167f1f9a9fdac86b6ca3c5300bec0b61555cded1f1a234378602dcca6c27085eac8e858581518110611f5057611f50612e13565b602002602001015160200151604051611f6b91815260200190565b60405180910390a480611f7d81612e85565b915050611e7f565b6040516001600160a01b0380851660248301528316604482015260648101829052611fbd9085906323b872dd60e01b9060840161149d565b50505050565b611fcd828261132f565b61077757611fda81612483565b611fe5836020612495565b604051602001611ff6929190612ee6565b60408051601f198184030181529082905262461bcd60e51b825261076491600401612f5b565b60608161202a81601f612eb1565b10156120695760405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b6044820152606401610764565b6120738284612eb1565b845110156120b75760405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b6044820152606401610764565b6060821580156120d65760405191506000825260208201604052612120565b6040519150601f8416801560200281840101858101878315602002848b0101015b8183101561210f5780518352602092830192016120f7565b5050858452601f01601f1916604052505b50949350505050565b6000612136826014612eb1565b8351101561217e5760405162461bcd60e51b8152602060048201526015602482015274746f416464726573735f6f75744f66426f756e647360581b6044820152606401610764565b500160200151600160601b900490565b600061219b8484846123e1565b9050600082806121ad576121ad612f6e565b8486091115610ae05760001981106121c457600080fd5b6001019392505050565b60005b8151811015610415576122328282815181106121ef576121ef612e13565b60200260200101516000015183838151811061220d5761220d612e13565b602002602001015160200151856001600160a01b03166114719092919063ffffffff16565b81818151811061224457612244612e13565b6020026020010151600001516001600160a01b0316336001600160a01b0316846001600160a01b03167f1f9a9fdac86b6ca3c5300bec0b61555cded1f1a234378602dcca6c27085eac8e8585815181106122a0576122a0612e13565b6020026020010151602001516040516122bb91815260200190565b60405180910390a4806122cd81612e85565b9150506121d1565b60015460ff16610b355760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610764565b60015460ff1615610b355760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610764565b6060600080856001600160a01b0316856040516123819190612f84565b600060405180830381855af49150503d80600081146123bc576040519150601f19603f3d011682016040523d82523d6000602084013e6123c1565b606091505b5091509150610da886838387612630565b606061111184846000856126a9565b6000838302816000198587098281108382030391505080841161240357600080fd5b8060000361241657508290049050610ae0565b6000848688096000868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150509392505050565b606061044b6001600160a01b03831660145b606060006124a4836002612fa0565b6124af906002612eb1565b6001600160401b038111156124c6576124c661286a565b6040519080825280601f01601f1916602001820160405280156124f0576020820181803683370190505b509050600360fc1b8160008151811061250b5761250b612e13565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061253a5761253a612e13565b60200101906001600160f81b031916908160001a905350600061255e846002612fa0565b612569906001612eb1565b90505b60018111156125e1576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061259d5761259d612e13565b1a60f81b8282815181106125b3576125b3612e13565b60200101906001600160f81b031916908160001a90535060049490941c936125da81612fb7565b905061256c565b508315610ae05760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610764565b6060831561269f578251600003612698576001600160a01b0385163b6126985760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610764565b5081611111565b6111118383612779565b60608247101561270a5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610764565b600080866001600160a01b031685876040516127269190612f84565b60006040518083038185875af1925050503d8060008114612763576040519150601f19603f3d011682016040523d82523d6000602084013e612768565b606091505b50915091506118bc87838387612630565b8151156127895781518083602001fd5b8060405162461bcd60e51b81526004016107649190612f5b565b6001600160a01b03811681146112de57600080fd5b8035611b72816127a3565b600080604083850312156127d657600080fd5b82356127e1816127a3565b915060208301356127f1816127a3565b809150509250929050565b60006020828403121561280e57600080fd5b81356001600160e01b031981168114610ae057600080fd5b60008083601f84011261283857600080fd5b5081356001600160401b0381111561284f57600080fd5b6020830191508360208260061b850101111561171657600080fd5b634e487b7160e01b600052604160045260246000fd5b60405160e081016001600160401b03811182821017156128a2576128a261286a565b60405290565b604051608081016001600160401b03811182821017156128a2576128a261286a565b604051601f8201601f191681016001600160401b03811182821017156128f2576128f261286a565b604052919050565b600060e0828403121561290c57600080fd5b612914612880565b90508135612921816127a3565b81526020820135612931816127a3565b6020820152604082013562ffffff8116811461294c57600080fd5b604082015261295d606083016127b8565b60608201526080820135608082015260a082013560a082015261298260c083016127b8565b60c082015292915050565b600080600061010084860312156129a357600080fd5b83356001600160401b038111156129b957600080fd5b6129c586828701612826565b90945092506129d9905085602086016128fa565b90509250925092565b6000602082840312156129f457600080fd5b5035919050565b60008060408385031215612a0e57600080fd5b8235915060208301356127f1816127a3565b600060808284031215612a3257600080fd5b612a3a6128a8565b905081356001600160401b0380821115612a5357600080fd5b818401915084601f830112612a6757600080fd5b8135602082821115612a7b57612a7b61286a565b612a8d601f8301601f191682016128ca565b92508183528681838601011115612aa357600080fd5b81818501828501376000818385010152828552612ac18187016127b8565b8186015250505050604082013560408201526060820135606082015292915050565b600080600060408486031215612af857600080fd5b83356001600160401b0380821115612b0f57600080fd5b612b1b87838801612826565b90955093506020860135915080821115612b3457600080fd5b50612b4186828701612a20565b9150509250925092565b60008083601f840112612b5d57600080fd5b5081356001600160401b03811115612b7457600080fd5b6020830191508360208260051b850101111561171657600080fd5b600080600060408486031215612ba457600080fd5b8335925060208401356001600160401b03811115612bc157600080fd5b612bcd86828701612b4b565b9497909650939450505050565b60005b83811015612bf5578181015183820152602001612bdd565b50506000910152565b60008151808452612c16816020860160208601612bda565b601f01601f19169290920160200192915050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015612c7f57603f19888603018452612c6d858351612bfe565b94509285019290850190600101612c51565b5092979650505050505050565b600060208284031215612c9e57600080fd5b8135610ae0816127a3565b60008060208385031215612cbc57600080fd5b82356001600160401b03811115612cd257600080fd5b612cde85828601612b4b565b90969095509350505050565b600060208284031215612cfc57600080fd5b5051919050565b600060408284031215612d1557600080fd5b604051604081018181106001600160401b0382111715612d3757612d3761286a565b6040528235612d45816127a3565b81526020928301359281019290925250919050565b60e0810161044b828480516001600160a01b03908116835260208083015182169084015260408083015162ffffff16908401526060808301518216908401526080808301519084015260a0828101519084015260c09182015116910152565b6000815160808452612dce6080850182612bfe565b6020848101516001600160a01b0316908601526040808501519086015260609384015193909401929092525090919050565b602081526000610ae06020830184612db9565b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112612e4057600080fd5b8301803591506001600160401b03821115612e5a57600080fd5b60200191503681900382131561171657600080fd5b634e487b7160e01b600052601160045260246000fd5b600060018201612e9757612e97612e6f565b5060010190565b8181038181111561044b5761044b612e6f565b8082018082111561044b5761044b612e6f565b600060208284031215612ed657600080fd5b81518015158114610ae057600080fd5b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351612f1e816017850160208801612bda565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351612f4f816028840160208801612bda565b01602801949350505050565b602081526000610ae06020830184612bfe565b634e487b7160e01b600052601260045260246000fd5b60008251612f96818460208701612bda565b9190910192915050565b808202811582820484141761044b5761044b612e6f565b600081612fc657612fc6612e6f565b50600019019056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122060463b8c42f8b619093981b0f594938e67042d40ad9d5eadd4922e9bc3000dde64736f6c63430008130033";
|
|
18214
|
-
const isSuperArgs$
|
|
18215
|
-
class
|
|
17808
|
+
const _bytecode$2 = "0x60806040523480156200001157600080fd5b50604051620034dd380380620034dd83398101604081905262000034916200015c565b6001805460ff191690556200004b6000846200009e565b600180546001600160a01b039384166101008102610100600160a81b03199092169190911790915560038054929093166001600160a01b03199283161790925560028054909116909117905550620001a6565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166200013b576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620000fa3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b80516001600160a01b03811681146200015757600080fd5b919050565b6000806000606084860312156200017257600080fd5b6200017d846200013f565b92506200018d602085016200013f565b91506200019d604085016200013f565b90509250925092565b61332780620001b66000396000f3fe6080604052600436106101175760003560e01c806358e81a50116100a05780638456cb59116100645780638456cb59146102c457806391d14854146102d9578063a217fddf146102f9578063ac9650d81461030e578063d547741f1461032e57600080fd5b806358e81a50146102465780635ae401dc146102595780635c975abb146102795780635ebca7991461029157806368742da6146102a457600080fd5b80632f2ff15d116100e75780632f2ff15d146101cb57806336568abe146101eb578063383ebb0b1461020b5780633f4ba83a1461021e5780635640f6591461023357600080fd5b80620fa9fb1461012357806301ffc9a714610145578063116944b21461017a578063248a9ca31461019b57600080fd5b3661011e57005b600080fd5b34801561012f57600080fd5b5061014361013e366004612ab8565b61034e565b005b34801561015157600080fd5b50610165610160366004612af1565b61041a565b60405190151581526020015b60405180910390f35b61018d610188366004612c89565b610451565b604051908152602001610171565b3480156101a757600080fd5b5061018d6101b6366004612cde565b60009081526020819052604090206001015490565b3480156101d757600080fd5b506101436101e6366004612cf7565b610771565b3480156101f757600080fd5b50610143610206366004612cf7565b610796565b61018d610219366004612ddf565b610819565b34801561022a57600080fd5b50610143610b86565b61018d610241366004612ddf565b610bd6565b61018d610254366004612c89565b610ee4565b61026c610267366004612e8b565b61121e565b6040516101719190612f26565b34801561028557600080fd5b5060015460ff16610165565b61014361029f366004612cde565b611255565b3480156102b057600080fd5b506101436102bf366004612f88565b6113ad565b3480156102d057600080fd5b50610143611428565b3480156102e557600080fd5b506101656102f4366004612cf7565b611476565b34801561030557600080fd5b5061018d600081565b34801561031a57600080fd5b5061026c610329366004612fa5565b61149f565b34801561033a57600080fd5b50610143610349366004612cf7565b611593565b6103787f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e98286933611476565b610394576040516282b42960e81b815260040160405180910390fd5b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa1580156103db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ff9190612fe6565b90506104156001600160a01b03831684836115b8565b505050565b60006001600160e01b03198216637965db0b60e01b148061044b57506301ffc9a760e01b6001600160e01b03198316145b92915050565b600061045f60015460ff1690565b1561047d5760405163ab35696f60e01b815260040160405180910390fd5b61048a826060015161161b565b6104a75760405163519bdea760e01b815260040160405180910390fd5b608082015134801561065a57836080015181146104d7576040516342f7487960e11b815260040160405180910390fd5b60035484516001600160a01b03908116911614610507576040516324d0121760e01b815260040160405180910390fd5b60008061056f866000015187608001518a8a808060200260200160405190810160405280939291908181526020016000905b828210156105655761055660408302860136819003810190612fff565b81526020019060010190610539565b5050505050611641565b608088018290526001546040516304e45aaf60e01b815292945090925061010090046001600160a01b0316906304e45aaf9084906105b1908a90600401613056565b60206040518083038185885af11580156105cf573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906105f49190612fe6565b945061065384828a8a808060200260200160405190810160405280939291908181526020016000905b828210156106495761063a60408302860136819003810190612fff565b8152602001906001019061061d565b5050505050611679565b5050610768565b6000806106b8866000015187608001518a8a808060200260200160405190810160405280939291908181526020016000905b82821015610565576106a960408302860136819003810190612fff565b8152602001906001019061068c565b60808801829052875191935091506106db906001600160a01b031633308561170c565b6001546040516304e45aaf60e01b81526101009091046001600160a01b0316906304e45aaf9061070f908990600401613056565b6020604051808303816000875af115801561072e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107529190612fe6565b9450610765866000015185838b8b61174a565b50505b50509392505050565b60008281526020819052604090206001015461078c8161184b565b6104158383611855565b6001600160a01b038116331461080b5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b61081582826118d9565b5050565b600061082760015460ff1690565b156108455760405163ab35696f60e01b815260040160405180910390fd5b610852826020015161161b565b61086f5760405163519bdea760e01b815260040160405180910390fd5b600061087e836000015161193e565b606084015190915034908115610a30576003546001600160a01b038481169116146108bc576040516324d0121760e01b815260040160405180910390fd5b846060015182146108e0576040516342f7487960e11b815260040160405180910390fd5b600061094286606001518989808060200260200160405190810160405280939291908181526020016000905b828210156109385761092960408302860136819003810190612fff565b8152602001906001019061090c565b5050505050611974565b606087018190526001546040516304dc09a360e11b81529192506000916101009091046001600160a01b0316906309b81346908490610985908b906004016130fc565b60206040518083038185885af11580156109a3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109c89190612fe6565b9050610a2781848b8b808060200260200160405190810160405280939291908181526020016000905b82821015610a1d57610a0e60408302860136819003810190612fff565b815260200190600101906109f1565b50505050506119c3565b95505050610b7c565b6000610a938487606001518a8a808060200260200160405190810160405280939291908181526020016000905b82821015610a8957610a7a60408302860136819003810190612fff565b81526020019060010190610a5d565b5050505050611aab565b606087018190526001546040516304dc09a360e11b81529192506000916101009091046001600160a01b0316906309b8134690610ad4908a906004016130fc565b6020604051808303816000875af1158015610af3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b179190612fe6565b9050610b778582858c8c808060200260200160405190810160405280939291908181526020016000905b82821015610b6d57610b5e60408302860136819003810190612fff565b81526020019060010190610b41565b5050505050611b03565b955050505b5050509392505050565b610bb07fe7276a2a84d8de556657ec9cf93a55a7d66f096e529d0582ed08e9e2208b92b533611476565b610bcc576040516282b42960e81b815260040160405180910390fd5b610bd4611b57565b565b6000610be460015460ff1690565b15610c025760405163ab35696f60e01b815260040160405180910390fd5b610c0f826020015161161b565b610c2c5760405163519bdea760e01b815260040160405180910390fd5b6000610c3b8360000151611ba9565b6040840151909150348015610dd75784604001518114610c6e576040516342f7487960e11b815260040160405180910390fd5b6003546001600160a01b03848116911614610c9c576040516324d0121760e01b815260040160405180910390fd5b600080610cf68588604001518b8b808060200260200160405190810160405280939291908181526020016000905b8282101561056557610ce760408302860136819003810190612fff565b81526020019060010190610cca565b6040898101839052600154905163b858183f60e01b815292945090925061010090046001600160a01b03169063b858183f908490610d38908b906004016130fc565b60206040518083038185885af1158015610d56573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610d7b9190612fe6565b9550610dd084828b8b808060200260200160405190810160405280939291908181526020016000905b8282101561064957610dc160408302860136819003810190612fff565b81526020019060010190610da4565b5050610b7c565b600080610e318588604001518b8b808060200260200160405190810160405280939291908181526020016000905b8282101561056557610e2260408302860136819003810190612fff565b81526020019060010190610e05565b604089018290529092509050610e526001600160a01b03861633308561170c565b60015460405163b858183f60e01b81526101009091046001600160a01b03169063b858183f90610e86908a906004016130fc565b6020604051808303816000875af1158015610ea5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ec99190612fe6565b9550610ed88585838c8c61174a565b50505050509392505050565b6000610ef260015460ff1690565b15610f105760405163ab35696f60e01b815260040160405180910390fd5b610f1d826060015161161b565b610f3a5760405163519bdea760e01b815260040160405180910390fd5b60a0820151349081156110d75760035484516001600160a01b03908116911614610f77576040516324d0121760e01b815260040160405180910390fd5b8360a001518214610f9b576040516342f7487960e11b815260040160405180910390fd5b6000610ff38560a001518888808060200260200160405190810160405280939291908181526020016000905b8282101561093857610fe460408302860136819003810190612fff565b81526020019060010190610fc7565b60a08601819052600154604051635023b4df60e01b81529192506000916101009091046001600160a01b031690635023b4df908490611036908a90600401613056565b60206040518083038185885af1158015611054573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110799190612fe6565b90506110ce81848a8a808060200260200160405190810160405280939291908181526020016000905b82821015610a1d576110bf60408302860136819003810190612fff565b815260200190600101906110a2565b94505050610768565b600061113485600001518660a001518989808060200260200160405190810160405280939291908181526020016000905b82821015610a895761112560408302860136819003810190612fff565b81526020019060010190611108565b60a08601819052600154604051635023b4df60e01b81529192506000916101009091046001600160a01b031690635023b4df90611175908990600401613056565b6020604051808303816000875af1158015611194573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111b89190612fe6565b9050611212866000015182858b8b808060200260200160405190810160405280939291908181526020016000905b82821015610b6d5761120360408302860136819003810190612fff565b815260200190600101906111e6565b98975050505050505050565b6060834211156112415760405163387b2e5560e11b815260040160405180910390fd5b61124b838361149f565b90505b9392505050565b60015460ff16156112795760405163ab35696f60e01b815260040160405180910390fd5b6003546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa1580156112c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112e69190612fe6565b905081811015611313576040516342fb4ceb60e11b81526004810183905260248101829052604401610802565b801561081557600354604051632e1a7d4d60e01b8152600481018390526001600160a01b0390911690632e1a7d4d90602401600060405180830381600087803b15801561135f57600080fd5b505af1158015611373573d6000803e3d6000fd5b5050505060006113833383611bb5565b905080610415576040516342fb4ceb60e11b81526004810184905260248101839052604401610802565b6113d77f7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e98286933611476565b6113f3576040516282b42960e81b815260040160405180910390fd5b47156114255760006114058247611bb5565b90508061081557604051633398652560e11b815260040160405180910390fd5b50565b6114527ffcb9fcbfa83b897fb2d5cf4b58962164105c1e71489a37ef3ae0db3fdce576f633611476565b61146e576040516282b42960e81b815260040160405180910390fd5b610bd4611c5f565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6060816001600160401b038111156114b9576114b9612b66565b6040519080825280602002602001820160405280156114ec57816020015b60608152602001906001900390816114d75790505b50905060005b8281101561158c5761155c308585848181106115105761151061310f565b90506020028101906115229190613125565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611c9a92505050565b82828151811061156e5761156e61310f565b6020026020010181905250808061158490613181565b9150506114f2565b5092915050565b6000828152602081905260409020600101546115ae8161184b565b61041583836118d9565b6040516001600160a01b03831660248201526044810182905261041590849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611cbf565b60006001600160a01b03821633148061044b57506001600160a01b038216301492915050565b60008061164d83611d94565b506116588484611e07565b509050611665818561319a565b91506116718583611f30565b935093915050565b600061168361202d565b905060006116928583866120a4565b90506000806116a18386611e07565b915091506116ae816120d0565b8315611703576000826116c1858a61319a565b6116cb919061319a565b905080156117015760006116df3383611bb5565b9050806116ff576040516382e4f46960e01b815260040160405180910390fd5b505b505b50505050505050565b6040516001600160a01b03808516602483015283166044820152606481018290526117449085906323b872dd60e01b906084016115e4565b50505050565b6040516370a0823160e01b81523060048201526000906001600160a01b038716906370a0823190602401602060405180830381865afa158015611791573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117b59190612fe6565b905060006117c48683876120a4565b90506000611824828686808060200260200160405190810160405280939291908181526020016000905b8282101561181a5761180b60408302860136819003810190612fff565b815260200190600101906117ee565b5050505050611e07565b91505061183188826121af565b8215611701576117016001600160a01b03891633856115b8565b61142581336122b8565b61185f8282611476565b610815576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556118953390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6118e38282611476565b15610815576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000806014835161194f919061319a565b9050600061195f84836014612311565b905061196c81600061241e565b949350505050565b60008061198083611d94565b90506000611990826127106131ad565b905060006119a18661271084612483565b6003549091506119ba906001600160a01b031682611f30565b95945050505050565b60008060006119d28685611e07565b915091506119df816120d0565b600260009054906101000a90046001600160a01b03166001600160a01b03166312210e8a6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015611a2f57600080fd5b505af1158015611a43573d6000803e3d6000fd5b505050506000828787611a56919061319a565b611a60919061319a565b90508015611a96576000611a743383611bb5565b905080611a94576040516382e4f46960e01b815260040160405180910390fd5b505b611aa083886131ad565b979650505050505050565b600080611ab783611d94565b90506000611ac7826127106131ad565b90506000611ad88661271084612483565b9050611ae48782611f30565b611af96001600160a01b03881633308961170c565b9695505050505050565b6000806000611b128685611e07565b91509150611b2087826124c3565b600082611b2d888861319a565b611b37919061319a565b9050611b4d6001600160a01b03891633836115b8565b61121283886131ad565b611b5f6125ca565b6001805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600061044b828261241e565b600081471015611c075760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610802565b6040516001600160a01b038416908390600081818185875af1925050503d8060008114611c50576040519150601f19603f3d011682016040523d82523d6000602084013e611c55565b606091505b5090949350505050565b611c67612613565b6001805460ff1916811790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833611b8c565b606061124e83836040518060600160405280602781526020016132cb60279139612659565b6000611d14826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166126c79092919063ffffffff16565b9050805160001480611d35575080806020019051810190611d3591906131c0565b6104155760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610802565b6000805b8251811015611dde57828181518110611db357611db361310f565b60200260200101516020015182611dca91906131ad565b915080611dd681613181565b915050611d98565b506103e8811115611e025760405163cd4e616760e01b815260040160405180910390fd5b919050565b6000606082516001600160401b03811115611e2457611e24612b66565b604051908082528060200260200182016040528015611e6957816020015b6040805180820190915260008082526020820152815260200190600190039081611e425790505b50905060005b8351811015611f28576000611eae858381518110611e8f57611e8f61310f565b602002602001015160200151612710886126d69092919063ffffffff16565b90506040518060400160405280868481518110611ecd57611ecd61310f565b6020026020010151600001516001600160a01b0316815260200182815250838381518110611efd57611efd61310f565b6020908102919091010152611f1281856131ad565b9350508080611f2090613181565b915050611e6f565b509250929050565b600154604051636eb1769f60e11b81523060048201526001600160a01b0361010090920482166024820152829184169063dd62ed3e90604401602060405180830381865afa158015611f86573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611faa9190612fe6565b10156108155760015460405163095ea7b360e01b81526101009091046001600160a01b039081166004830152600019602483015283169063095ea7b3906044016020604051808303816000875af1158015612009573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061041591906131c0565b60025460408051630910874560e11b8152905160009247926001600160a01b03909116916312210e8a91600480820192879290919082900301818387803b15801561207757600080fd5b505af115801561208b573d6000803e3d6000fd5b5047925061209d91508390508261319a565b9250505090565b600082156120c857816120b7848661319a565b6120c1919061319a565b905061124e565b509192915050565b60005b81518110156108155760008282815181106120f0576120f061310f565b60200260200101519050600061210e82600001518360200151611bb5565b90508061214557815160208301516040516208c3b360e61b81526001600160a01b0390921660048301526024820152604401610802565b81600001516001600160a01b0316336001600160a01b03167fe0e765ab26c1caf691c510426951246128b96830e49cc81d8c093fd551abac35846020015160405161219291815260200190565b60405180910390a3505080806121a790613181565b9150506120d3565b60005b815181101561041557612215338383815181106121d1576121d161310f565b6020026020010151600001518484815181106121ef576121ef61310f565b602002602001015160200151866001600160a01b031661170c909392919063ffffffff16565b8181815181106122275761222761310f565b6020026020010151600001516001600160a01b0316336001600160a01b0316846001600160a01b03167f1f9a9fdac86b6ca3c5300bec0b61555cded1f1a234378602dcca6c27085eac8e8585815181106122835761228361310f565b60200260200101516020015160405161229e91815260200190565b60405180910390a4806122b081613181565b9150506121b2565b6122c28282611476565b610815576122cf81612778565b6122da83602061278a565b6040516020016122eb9291906131e2565b60408051601f198184030181529082905262461bcd60e51b825261080291600401613257565b60608161231f81601f6131ad565b101561235e5760405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b6044820152606401610802565b61236882846131ad565b845110156123ac5760405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b6044820152606401610802565b6060821580156123cb5760405191506000825260208201604052612415565b6040519150601f8416801560200281840101858101878315602002848b0101015b818310156124045780518352602092830192016123ec565b5050858452601f01601f1916604052505b50949350505050565b600061242b8260146131ad565b835110156124735760405162461bcd60e51b8152602060048201526015602482015274746f416464726573735f6f75744f66426f756e647360581b6044820152606401610802565b500160200151600160601b900490565b60006124908484846126d6565b9050600082806124a2576124a261326a565b848609111561124e5760001981106124b957600080fd5b6001019392505050565b60005b8151811015610415576125278282815181106124e4576124e461310f565b6020026020010151600001518383815181106125025761250261310f565b602002602001015160200151856001600160a01b03166115b89092919063ffffffff16565b8181815181106125395761253961310f565b6020026020010151600001516001600160a01b0316336001600160a01b0316846001600160a01b03167f1f9a9fdac86b6ca3c5300bec0b61555cded1f1a234378602dcca6c27085eac8e8585815181106125955761259561310f565b6020026020010151602001516040516125b091815260200190565b60405180910390a4806125c281613181565b9150506124c6565b60015460ff16610bd45760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610802565b60015460ff1615610bd45760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610802565b6060600080856001600160a01b0316856040516126769190613280565b600060405180830381855af49150503d80600081146126b1576040519150601f19603f3d011682016040523d82523d6000602084013e6126b6565b606091505b5091509150611af986838387612925565b606061124b848460008561299e565b600083830281600019858709828110838203039150508084116126f857600080fd5b8060000361270b5750829004905061124e565b6000848688096000868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150509392505050565b606061044b6001600160a01b03831660145b6060600061279983600261329c565b6127a49060026131ad565b6001600160401b038111156127bb576127bb612b66565b6040519080825280601f01601f1916602001820160405280156127e5576020820181803683370190505b509050600360fc1b816000815181106128005761280061310f565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061282f5761282f61310f565b60200101906001600160f81b031916908160001a905350600061285384600261329c565b61285e9060016131ad565b90505b60018111156128d6576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106128925761289261310f565b1a60f81b8282815181106128a8576128a861310f565b60200101906001600160f81b031916908160001a90535060049490941c936128cf816132b3565b9050612861565b50831561124e5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610802565b6060831561299457825160000361298d576001600160a01b0385163b61298d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610802565b508161196c565b61196c8383612a6e565b6060824710156129ff5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610802565b600080866001600160a01b03168587604051612a1b9190613280565b60006040518083038185875af1925050503d8060008114612a58576040519150601f19603f3d011682016040523d82523d6000602084013e612a5d565b606091505b5091509150611aa087838387612925565b815115612a7e5781518083602001fd5b8060405162461bcd60e51b81526004016108029190613257565b6001600160a01b038116811461142557600080fd5b8035611e0281612a98565b60008060408385031215612acb57600080fd5b8235612ad681612a98565b91506020830135612ae681612a98565b809150509250929050565b600060208284031215612b0357600080fd5b81356001600160e01b03198116811461124e57600080fd5b60008083601f840112612b2d57600080fd5b5081356001600160401b03811115612b4457600080fd5b6020830191508360208260061b8501011115612b5f57600080fd5b9250929050565b634e487b7160e01b600052604160045260246000fd5b60405160e081016001600160401b0381118282101715612b9e57612b9e612b66565b60405290565b604051608081016001600160401b0381118282101715612b9e57612b9e612b66565b604051601f8201601f191681016001600160401b0381118282101715612bee57612bee612b66565b604052919050565b600060e08284031215612c0857600080fd5b612c10612b7c565b90508135612c1d81612a98565b81526020820135612c2d81612a98565b6020820152604082013562ffffff81168114612c4857600080fd5b6040820152612c5960608301612aad565b60608201526080820135608082015260a082013560a0820152612c7e60c08301612aad565b60c082015292915050565b60008060006101008486031215612c9f57600080fd5b83356001600160401b03811115612cb557600080fd5b612cc186828701612b1b565b9094509250612cd590508560208601612bf6565b90509250925092565b600060208284031215612cf057600080fd5b5035919050565b60008060408385031215612d0a57600080fd5b823591506020830135612ae681612a98565b600060808284031215612d2e57600080fd5b612d36612ba4565b905081356001600160401b0380821115612d4f57600080fd5b818401915084601f830112612d6357600080fd5b8135602082821115612d7757612d77612b66565b612d89601f8301601f19168201612bc6565b92508183528681838601011115612d9f57600080fd5b81818501828501376000818385010152828552612dbd818701612aad565b8186015250505050604082013560408201526060820135606082015292915050565b600080600060408486031215612df457600080fd5b83356001600160401b0380821115612e0b57600080fd5b612e1787838801612b1b565b90955093506020860135915080821115612e3057600080fd5b50612e3d86828701612d1c565b9150509250925092565b60008083601f840112612e5957600080fd5b5081356001600160401b03811115612e7057600080fd5b6020830191508360208260051b8501011115612b5f57600080fd5b600080600060408486031215612ea057600080fd5b8335925060208401356001600160401b03811115612ebd57600080fd5b612ec986828701612e47565b9497909650939450505050565b60005b83811015612ef1578181015183820152602001612ed9565b50506000910152565b60008151808452612f12816020860160208601612ed6565b601f01601f19169290920160200192915050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015612f7b57603f19888603018452612f69858351612efa565b94509285019290850190600101612f4d565b5092979650505050505050565b600060208284031215612f9a57600080fd5b813561124e81612a98565b60008060208385031215612fb857600080fd5b82356001600160401b03811115612fce57600080fd5b612fda85828601612e47565b90969095509350505050565b600060208284031215612ff857600080fd5b5051919050565b60006040828403121561301157600080fd5b604051604081018181106001600160401b038211171561303357613033612b66565b604052823561304181612a98565b81526020928301359281019290925250919050565b60e0810161044b828480516001600160a01b03908116835260208083015182169084015260408083015162ffffff16908401526060808301518216908401526080808301519084015260a0828101519084015260c09182015116910152565b60008151608084526130ca6080850182612efa565b6020848101516001600160a01b0316908601526040808501519086015260609384015193909401929092525090919050565b60208152600061124e60208301846130b5565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261313c57600080fd5b8301803591506001600160401b0382111561315657600080fd5b602001915036819003821315612b5f57600080fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016131935761319361316b565b5060010190565b8181038181111561044b5761044b61316b565b8082018082111561044b5761044b61316b565b6000602082840312156131d257600080fd5b8151801515811461124e57600080fd5b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161321a816017850160208801612ed6565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161324b816028840160208801612ed6565b01602801949350505050565b60208152600061124e6020830184612efa565b634e487b7160e01b600052601260045260246000fd5b60008251613292818460208701612ed6565b9190910192915050565b808202811582820484141761044b5761044b61316b565b6000816132c2576132c261316b565b50600019019056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220162c0f9d1b47c666f486fc65c7c7502bb0e7378e3166be6f93d98943154831c364736f6c63430008130033";
|
|
17809
|
+
const isSuperArgs$2 = (xs) => xs.length > 1;
|
|
17810
|
+
class ImmutableSwapProxy__factory extends ContractFactory {
|
|
18216
17811
|
constructor(...args) {
|
|
18217
|
-
if (isSuperArgs$
|
|
17812
|
+
if (isSuperArgs$2(args)) {
|
|
18218
17813
|
super(...args);
|
|
18219
17814
|
}
|
|
18220
17815
|
else {
|
|
18221
|
-
super(_abi$
|
|
17816
|
+
super(_abi$2, _bytecode$2, args[0]);
|
|
18222
17817
|
}
|
|
18223
17818
|
}
|
|
18224
17819
|
deploy(_admin, _uniRouter, _wimx, overrides) {
|
|
@@ -18233,6 +17828,134 @@ class SecondaryFee__factory extends ContractFactory {
|
|
|
18233
17828
|
connect(signer) {
|
|
18234
17829
|
return super.connect(signer);
|
|
18235
17830
|
}
|
|
17831
|
+
static bytecode = _bytecode$2;
|
|
17832
|
+
static abi = _abi$2;
|
|
17833
|
+
static createInterface() {
|
|
17834
|
+
return new utils$1.Interface(_abi$2);
|
|
17835
|
+
}
|
|
17836
|
+
static connect(address, signerOrProvider) {
|
|
17837
|
+
return new Contract$1(address, _abi$2, signerOrProvider);
|
|
17838
|
+
}
|
|
17839
|
+
}
|
|
17840
|
+
|
|
17841
|
+
/* Autogenerated file. Do not edit manually. */
|
|
17842
|
+
/* tslint:disable */
|
|
17843
|
+
/* eslint-disable */
|
|
17844
|
+
const _abi$1 = [
|
|
17845
|
+
{
|
|
17846
|
+
inputs: [],
|
|
17847
|
+
name: "getCurrentBlockTimestamp",
|
|
17848
|
+
outputs: [
|
|
17849
|
+
{
|
|
17850
|
+
internalType: "uint256",
|
|
17851
|
+
name: "timestamp",
|
|
17852
|
+
type: "uint256",
|
|
17853
|
+
},
|
|
17854
|
+
],
|
|
17855
|
+
stateMutability: "view",
|
|
17856
|
+
type: "function",
|
|
17857
|
+
},
|
|
17858
|
+
{
|
|
17859
|
+
inputs: [
|
|
17860
|
+
{
|
|
17861
|
+
internalType: "address",
|
|
17862
|
+
name: "addr",
|
|
17863
|
+
type: "address",
|
|
17864
|
+
},
|
|
17865
|
+
],
|
|
17866
|
+
name: "getEthBalance",
|
|
17867
|
+
outputs: [
|
|
17868
|
+
{
|
|
17869
|
+
internalType: "uint256",
|
|
17870
|
+
name: "balance",
|
|
17871
|
+
type: "uint256",
|
|
17872
|
+
},
|
|
17873
|
+
],
|
|
17874
|
+
stateMutability: "view",
|
|
17875
|
+
type: "function",
|
|
17876
|
+
},
|
|
17877
|
+
{
|
|
17878
|
+
inputs: [
|
|
17879
|
+
{
|
|
17880
|
+
components: [
|
|
17881
|
+
{
|
|
17882
|
+
internalType: "address",
|
|
17883
|
+
name: "target",
|
|
17884
|
+
type: "address",
|
|
17885
|
+
},
|
|
17886
|
+
{
|
|
17887
|
+
internalType: "uint256",
|
|
17888
|
+
name: "gasLimit",
|
|
17889
|
+
type: "uint256",
|
|
17890
|
+
},
|
|
17891
|
+
{
|
|
17892
|
+
internalType: "bytes",
|
|
17893
|
+
name: "callData",
|
|
17894
|
+
type: "bytes",
|
|
17895
|
+
},
|
|
17896
|
+
],
|
|
17897
|
+
internalType: "struct UniswapInterfaceMulticall.Call[]",
|
|
17898
|
+
name: "calls",
|
|
17899
|
+
type: "tuple[]",
|
|
17900
|
+
},
|
|
17901
|
+
],
|
|
17902
|
+
name: "multicall",
|
|
17903
|
+
outputs: [
|
|
17904
|
+
{
|
|
17905
|
+
internalType: "uint256",
|
|
17906
|
+
name: "blockNumber",
|
|
17907
|
+
type: "uint256",
|
|
17908
|
+
},
|
|
17909
|
+
{
|
|
17910
|
+
components: [
|
|
17911
|
+
{
|
|
17912
|
+
internalType: "bool",
|
|
17913
|
+
name: "success",
|
|
17914
|
+
type: "bool",
|
|
17915
|
+
},
|
|
17916
|
+
{
|
|
17917
|
+
internalType: "uint256",
|
|
17918
|
+
name: "gasUsed",
|
|
17919
|
+
type: "uint256",
|
|
17920
|
+
},
|
|
17921
|
+
{
|
|
17922
|
+
internalType: "bytes",
|
|
17923
|
+
name: "returnData",
|
|
17924
|
+
type: "bytes",
|
|
17925
|
+
},
|
|
17926
|
+
],
|
|
17927
|
+
internalType: "struct UniswapInterfaceMulticall.Result[]",
|
|
17928
|
+
name: "returnData",
|
|
17929
|
+
type: "tuple[]",
|
|
17930
|
+
},
|
|
17931
|
+
],
|
|
17932
|
+
stateMutability: "nonpayable",
|
|
17933
|
+
type: "function",
|
|
17934
|
+
},
|
|
17935
|
+
];
|
|
17936
|
+
const _bytecode$1 = "0x608060405234801561001057600080fd5b50610567806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80630f28c97d146100465780631749e1e3146100645780634d2301cc14610085575b600080fd5b61004e610098565b60405161005b919061041f565b60405180910390f35b6100776100723660046102a7565b61009c565b60405161005b929190610428565b61004e610093366004610286565b610220565b4290565b8051439060609067ffffffffffffffff811180156100b957600080fd5b506040519080825280602002602001820160405280156100f357816020015b6100e061023a565b8152602001906001900390816100d85790505b50905060005b835181101561021a57600080600086848151811061011357fe5b60200260200101516000015187858151811061012b57fe5b60200260200101516020015188868151811061014357fe5b60200260200101516040015192509250925060005a90506000808573ffffffffffffffffffffffffffffffffffffffff1685856040516101839190610403565b60006040518083038160008787f1925050503d80600081146101c1576040519150601f19603f3d011682016040523d82523d6000602084013e6101c6565b606091505b509150915060005a8403905060405180606001604052808415158152602001828152602001838152508989815181106101fb57fe5b60200260200101819052505050505050505080806001019150506100f9565b50915091565b73ffffffffffffffffffffffffffffffffffffffff163190565b604051806060016040528060001515815260200160008152602001606081525090565b803573ffffffffffffffffffffffffffffffffffffffff8116811461028157600080fd5b919050565b600060208284031215610297578081fd5b6102a08261025d565b9392505050565b600060208083850312156102b9578182fd5b823567ffffffffffffffff808211156102d0578384fd5b818501915085601f8301126102e3578384fd5b8135818111156102ef57fe5b6102fc8485830201610506565b81815284810190848601875b848110156103f457813587017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0606081838f03011215610346578a8bfd5b60408051606081018181108b8211171561035c57fe5b8252610369848d0161025d565b8152818401358c82015260608401358a811115610384578d8efd5b8085019450508e603f850112610398578c8dfd5b8b8401358a8111156103a657fe5b6103b68d85601f84011601610506565b93508084528f838287010111156103cb578d8efd5b808386018e86013783018c018d9052908101919091528552509287019290870190600101610308565b50909998505050505050505050565b6000825161041581846020870161052a565b9190910192915050565b90815260200190565b600060408083018584526020828186015281865180845260609350838701915083838202880101838901875b838110156104f6578983037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa001855281518051151584528681015187850152880151888401889052805188850181905260806104b582828801858c0161052a565b96880196601f919091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01694909401909301925090850190600101610454565b50909a9950505050505050505050565b60405181810167ffffffffffffffff8111828210171561052257fe5b604052919050565b60005b8381101561054557818101518382015260200161052d565b83811115610554576000848401525b5050505056fea164736f6c6343000706000a";
|
|
17937
|
+
const isSuperArgs$1 = (xs) => xs.length > 1;
|
|
17938
|
+
class Multicall__factory extends ContractFactory {
|
|
17939
|
+
constructor(...args) {
|
|
17940
|
+
if (isSuperArgs$1(args)) {
|
|
17941
|
+
super(...args);
|
|
17942
|
+
}
|
|
17943
|
+
else {
|
|
17944
|
+
super(_abi$1, _bytecode$1, args[0]);
|
|
17945
|
+
}
|
|
17946
|
+
}
|
|
17947
|
+
deploy(overrides) {
|
|
17948
|
+
return super.deploy(overrides || {});
|
|
17949
|
+
}
|
|
17950
|
+
getDeployTransaction(overrides) {
|
|
17951
|
+
return super.getDeployTransaction(overrides || {});
|
|
17952
|
+
}
|
|
17953
|
+
attach(address) {
|
|
17954
|
+
return super.attach(address);
|
|
17955
|
+
}
|
|
17956
|
+
connect(signer) {
|
|
17957
|
+
return super.connect(signer);
|
|
17958
|
+
}
|
|
18236
17959
|
static bytecode = _bytecode$1;
|
|
18237
17960
|
static abi = _abi$1;
|
|
18238
17961
|
static createInterface() {
|
|
@@ -20051,14 +19774,14 @@ function buildSinglePoolSwap(tokenIn, tokenOut, recipient, trade, route, amountI
|
|
|
20051
19774
|
}
|
|
20052
19775
|
return calldatas;
|
|
20053
19776
|
}
|
|
20054
|
-
function buildSinglePoolSwapWithFees(recipient, trade, route, amountIn, amountOut, secondaryFees,
|
|
19777
|
+
function buildSinglePoolSwapWithFees(recipient, trade, route, amountIn, amountOut, secondaryFees, swapProxyContract, tokenOut) {
|
|
20055
19778
|
const secondaryFeeValues = secondaryFees.map((fee) => ({
|
|
20056
19779
|
feeBasisPoints: fee.basisPoints,
|
|
20057
19780
|
recipient: fee.recipient,
|
|
20058
19781
|
}));
|
|
20059
19782
|
const calldatas = [];
|
|
20060
19783
|
if (trade.tradeType === Uniswap.TradeType.EXACT_INPUT) {
|
|
20061
|
-
calldatas.push(
|
|
19784
|
+
calldatas.push(swapProxyContract.encodeFunctionData('exactInputSingleWithSecondaryFee', [
|
|
20062
19785
|
secondaryFeeValues,
|
|
20063
19786
|
{
|
|
20064
19787
|
tokenIn: route.tokenPath[0].address,
|
|
@@ -20072,7 +19795,7 @@ function buildSinglePoolSwapWithFees(recipient, trade, route, amountIn, amountOu
|
|
|
20072
19795
|
]));
|
|
20073
19796
|
}
|
|
20074
19797
|
if (trade.tradeType === Uniswap.TradeType.EXACT_OUTPUT) {
|
|
20075
|
-
calldatas.push(
|
|
19798
|
+
calldatas.push(swapProxyContract.encodeFunctionData('exactOutputSingleWithSecondaryFee', [
|
|
20076
19799
|
secondaryFeeValues,
|
|
20077
19800
|
{
|
|
20078
19801
|
tokenIn: route.tokenPath[0].address,
|
|
@@ -20088,7 +19811,7 @@ function buildSinglePoolSwapWithFees(recipient, trade, route, amountIn, amountOu
|
|
|
20088
19811
|
const shouldUnwrapTokens = isNative(tokenOut);
|
|
20089
19812
|
if (shouldUnwrapTokens) {
|
|
20090
19813
|
// Unwrap the output token if the user specified a native token as the output
|
|
20091
|
-
calldatas.push(
|
|
19814
|
+
calldatas.push(swapProxyContract.encodeFunctionData('unwrapNativeToken', [amountOut]));
|
|
20092
19815
|
}
|
|
20093
19816
|
return calldatas;
|
|
20094
19817
|
}
|
|
@@ -20130,7 +19853,7 @@ function buildMultiPoolSwap(tokenIn, tokenOut, recipient, trade, route, amountIn
|
|
|
20130
19853
|
}
|
|
20131
19854
|
return calldatas;
|
|
20132
19855
|
}
|
|
20133
|
-
function buildMultiPoolSwapWithFees(recipient, trade, route, amountIn, amountOut, secondaryFees,
|
|
19856
|
+
function buildMultiPoolSwapWithFees(recipient, trade, route, amountIn, amountOut, secondaryFees, swapProxyContract, tokenOut) {
|
|
20134
19857
|
const path = encodeRouteToPath(route, trade.tradeType === Uniswap.TradeType.EXACT_OUTPUT);
|
|
20135
19858
|
const secondaryFeeValues = secondaryFees.map((fee) => ({
|
|
20136
19859
|
feeBasisPoints: fee.basisPoints,
|
|
@@ -20138,7 +19861,7 @@ function buildMultiPoolSwapWithFees(recipient, trade, route, amountIn, amountOut
|
|
|
20138
19861
|
}));
|
|
20139
19862
|
const calldatas = [];
|
|
20140
19863
|
if (trade.tradeType === Uniswap.TradeType.EXACT_INPUT) {
|
|
20141
|
-
calldatas.push(
|
|
19864
|
+
calldatas.push(swapProxyContract.encodeFunctionData('exactInputWithSecondaryFee', [
|
|
20142
19865
|
secondaryFeeValues,
|
|
20143
19866
|
{
|
|
20144
19867
|
path,
|
|
@@ -20149,7 +19872,7 @@ function buildMultiPoolSwapWithFees(recipient, trade, route, amountIn, amountOut
|
|
|
20149
19872
|
]));
|
|
20150
19873
|
}
|
|
20151
19874
|
if (trade.tradeType === Uniswap.TradeType.EXACT_OUTPUT) {
|
|
20152
|
-
calldatas.push(
|
|
19875
|
+
calldatas.push(swapProxyContract.encodeFunctionData('exactOutputWithSecondaryFee', [
|
|
20153
19876
|
secondaryFeeValues,
|
|
20154
19877
|
{
|
|
20155
19878
|
path,
|
|
@@ -20162,7 +19885,7 @@ function buildMultiPoolSwapWithFees(recipient, trade, route, amountIn, amountOut
|
|
|
20162
19885
|
const shouldUnwrapTokens = isNative(tokenOut);
|
|
20163
19886
|
if (shouldUnwrapTokens) {
|
|
20164
19887
|
// Unwrap the output token if the user specified a native token as the output
|
|
20165
|
-
calldatas.push(
|
|
19888
|
+
calldatas.push(swapProxyContract.encodeFunctionData('unwrapNativeToken', [amountOut]));
|
|
20166
19889
|
}
|
|
20167
19890
|
return calldatas;
|
|
20168
19891
|
}
|
|
@@ -20173,14 +19896,14 @@ function buildMultiPoolSwapWithFees(recipient, trade, route, amountIn, amountOut
|
|
|
20173
19896
|
* @param fromAddress The address of the user
|
|
20174
19897
|
* @param trade The trade to be executed
|
|
20175
19898
|
* @param secondaryFees Secondary fees to be applied to the swap
|
|
20176
|
-
* @param
|
|
19899
|
+
* @param swapProxyContract The SecondaryFee contract interface
|
|
20177
19900
|
* @param routerContract The SwapRouter02 contract interface
|
|
20178
19901
|
* @param paymentsContract The PaymentsExtended contract interface
|
|
20179
19902
|
* @param maximumAmountIn The maximum amount of tokenIn to be swapped
|
|
20180
19903
|
* @param minimumAmountOut The minimum amount of tokenOut to be received
|
|
20181
19904
|
* @returns calldatas that make up the swap transaction
|
|
20182
19905
|
*/
|
|
20183
|
-
function buildSwapParameters(tokenIn, tokenOut, recipient, trade, secondaryFees,
|
|
19906
|
+
function buildSwapParameters(tokenIn, tokenOut, recipient, trade, secondaryFees, swapProxyContract, routerContract, paymentsContract, maximumAmountIn, minimumAmountOut) {
|
|
20184
19907
|
// @dev we don't support multiple swaps in a single transaction
|
|
20185
19908
|
// there will always be only one swap in the trade regardless of the trade type
|
|
20186
19909
|
const { route } = trade.swaps[0];
|
|
@@ -20188,22 +19911,22 @@ function buildSwapParameters(tokenIn, tokenOut, recipient, trade, secondaryFees,
|
|
|
20188
19911
|
const hasSecondaryFees = secondaryFees.length > 0;
|
|
20189
19912
|
if (isSinglePoolSwap) {
|
|
20190
19913
|
if (hasSecondaryFees) {
|
|
20191
|
-
return buildSinglePoolSwapWithFees(recipient, trade, route, maximumAmountIn, minimumAmountOut, secondaryFees,
|
|
19914
|
+
return buildSinglePoolSwapWithFees(recipient, trade, route, maximumAmountIn, minimumAmountOut, secondaryFees, swapProxyContract, tokenOut);
|
|
20192
19915
|
}
|
|
20193
19916
|
return buildSinglePoolSwap(tokenIn, tokenOut, recipient, trade, route, maximumAmountIn, minimumAmountOut, routerContract, paymentsContract);
|
|
20194
19917
|
}
|
|
20195
19918
|
if (hasSecondaryFees) {
|
|
20196
|
-
return buildMultiPoolSwapWithFees(recipient, trade, route, maximumAmountIn, minimumAmountOut, secondaryFees,
|
|
19919
|
+
return buildMultiPoolSwapWithFees(recipient, trade, route, maximumAmountIn, minimumAmountOut, secondaryFees, swapProxyContract, tokenOut);
|
|
20197
19920
|
}
|
|
20198
19921
|
return buildMultiPoolSwap(tokenIn, tokenOut, recipient, trade, route, maximumAmountIn, minimumAmountOut, routerContract, paymentsContract);
|
|
20199
19922
|
}
|
|
20200
19923
|
function createSwapCallParameters(tokenIn, tokenOut, trade, recipient, swapOptions, secondaryFees, maximumAmountIn, minimumAmountOut) {
|
|
20201
|
-
const
|
|
19924
|
+
const swapProxyContract = ImmutableSwapProxy__factory.createInterface();
|
|
20202
19925
|
const routerContract = SwapRouter.INTERFACE;
|
|
20203
19926
|
const paymentsContract = PaymentsExtended.INTERFACE;
|
|
20204
|
-
const calldatas = buildSwapParameters(tokenIn, tokenOut, recipient, trade, secondaryFees,
|
|
19927
|
+
const calldatas = buildSwapParameters(tokenIn, tokenOut, recipient, trade, secondaryFees, swapProxyContract, routerContract, paymentsContract, maximumAmountIn, minimumAmountOut);
|
|
20205
19928
|
// Create the multicall transaction using the calldatas generated above
|
|
20206
|
-
return
|
|
19929
|
+
return swapProxyContract.encodeFunctionData(multicallWithDeadlineFunctionSignature, [
|
|
20207
19930
|
swapOptions.deadlineOrPreviousBlockhash,
|
|
20208
19931
|
calldatas,
|
|
20209
19932
|
]);
|
|
@@ -20396,7 +20119,7 @@ class Exchange {
|
|
|
20396
20119
|
wrappedNativeToken;
|
|
20397
20120
|
secondaryFees;
|
|
20398
20121
|
nativeTokenService;
|
|
20399
|
-
|
|
20122
|
+
swapProxyContractAddress;
|
|
20400
20123
|
routerContractAddress;
|
|
20401
20124
|
constructor(configuration) {
|
|
20402
20125
|
const config = new ExchangeConfiguration(configuration);
|
|
@@ -20406,7 +20129,7 @@ class Exchange {
|
|
|
20406
20129
|
this.nativeTokenService = new NativeTokenService(this.nativeToken, this.wrappedNativeToken);
|
|
20407
20130
|
this.secondaryFees = config.secondaryFees;
|
|
20408
20131
|
this.routerContractAddress = config.chain.contracts.peripheryRouter;
|
|
20409
|
-
this.
|
|
20132
|
+
this.swapProxyContractAddress = config.chain.contracts.secondaryFee;
|
|
20410
20133
|
this.provider = new ethers.providers.StaticJsonRpcProvider({
|
|
20411
20134
|
url: config.chain.rpcUrl,
|
|
20412
20135
|
skipFetchSetup: true,
|
|
@@ -20432,8 +20155,8 @@ class Exchange {
|
|
|
20432
20155
|
if (this.secondaryFees.length === 0) {
|
|
20433
20156
|
return [];
|
|
20434
20157
|
}
|
|
20435
|
-
const
|
|
20436
|
-
if (await
|
|
20158
|
+
const swapProxyContract = ImmutableSwapProxy__factory.connect(this.swapProxyContractAddress, provider);
|
|
20159
|
+
if (await swapProxyContract.paused()) {
|
|
20437
20160
|
// Do not use secondary fees if the contract is paused
|
|
20438
20161
|
return [];
|
|
20439
20162
|
}
|
|
@@ -20470,11 +20193,11 @@ class Exchange {
|
|
|
20470
20193
|
// Quotes will always use ERC20s. If the user-specified token is Native, we use the Wrapped Native Token pool
|
|
20471
20194
|
const ourQuote = await this.router.findOptimalRoute(ourQuoteReqAmount, this.nativeTokenService.maybeWrapToken(otherToken), tradeType, maxHops);
|
|
20472
20195
|
const adjustedQuote = adjustQuoteWithFees(ourQuote, amountSpecified, fees, this.nativeTokenService);
|
|
20473
|
-
const swap = getSwap(tokenIn, tokenOut, adjustedQuote, fromAddress, slippagePercent, deadline, this.routerContractAddress, this.
|
|
20196
|
+
const swap = getSwap(tokenIn, tokenOut, adjustedQuote, fromAddress, slippagePercent, deadline, this.routerContractAddress, this.swapProxyContractAddress, gasPrice, secondaryFees);
|
|
20474
20197
|
const { quotedAmount, quotedAmountWithMaxSlippage } = prepareUserQuote(this.nativeTokenService, adjustedQuote, slippagePercent, otherToken);
|
|
20475
20198
|
const preparedApproval = prepareApproval(tradeType, amountSpecified, quotedAmountWithMaxSlippage, {
|
|
20476
20199
|
routerAddress: this.routerContractAddress,
|
|
20477
|
-
secondaryFeeAddress: this.
|
|
20200
|
+
secondaryFeeAddress: this.swapProxyContractAddress,
|
|
20478
20201
|
}, secondaryFees);
|
|
20479
20202
|
// preparedApproval always uses the tokenIn address because we are always selling the tokenIn
|
|
20480
20203
|
const approval = preparedApproval
|
|
@@ -26051,7 +25774,7 @@ class APIError extends Error {
|
|
|
26051
25774
|
|
|
26052
25775
|
/* eslint-disable implicit-arrow-linebreak */
|
|
26053
25776
|
const defaultHeaders = {
|
|
26054
|
-
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.39.
|
|
25777
|
+
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.39.1',
|
|
26055
25778
|
};
|
|
26056
25779
|
/**
|
|
26057
25780
|
* createAPIConfiguration to create a custom Configuration
|
|
@@ -27400,7 +27123,7 @@ const GAS_OVERRIDES = {
|
|
|
27400
27123
|
maxPriorityFeePerGas: BigNumber$1.from(101e9),
|
|
27401
27124
|
};
|
|
27402
27125
|
|
|
27403
|
-
const SDK_VERSION_MARKER = '0.39.
|
|
27126
|
+
const SDK_VERSION_MARKER = '0.39.1';
|
|
27404
27127
|
// This SDK version is replaced by the `yarn build` command ran on the root level
|
|
27405
27128
|
const globalPackageVersion = () => SDK_VERSION_MARKER;
|
|
27406
27129
|
|