@gvnrdao/dh-mcp 0.5.28 → 0.5.29
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/boundary.js +859 -303
- package/dist/connector-embed.js +871 -315
- package/dist/connector.js +871 -315
- package/dist/index.js +868 -312
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -13699,7 +13699,7 @@ var require_follow_redirects = __commonJS({
|
|
|
13699
13699
|
return URL2 && value instanceof URL2;
|
|
13700
13700
|
}
|
|
13701
13701
|
function escapeRegex(regex) {
|
|
13702
|
-
return regex.replace(/[[\]
|
|
13702
|
+
return regex.replace(/[\^$\\.*+?()[\]{}|]/g, "\\$&");
|
|
13703
13703
|
}
|
|
13704
13704
|
module2.exports = wrap({ http: http4, https: https2 });
|
|
13705
13705
|
module2.exports.wrap = wrap;
|
|
@@ -15466,7 +15466,7 @@ ${errorReport}`);
|
|
|
15466
15466
|
}
|
|
15467
15467
|
init_debug_logger();
|
|
15468
15468
|
init_session_signature_cache();
|
|
15469
|
-
var
|
|
15469
|
+
var import_ethers62 = require("ethers");
|
|
15470
15470
|
var EXPIRED_LOAN_MIN_LIQUIDATION_THRESHOLD_BPS = 11e3;
|
|
15471
15471
|
var EXPIRED_LOAN_MAX_ESCALATION_ITERATIONS = 365;
|
|
15472
15472
|
var BASIS_POINTS_DENOMINATOR = 1e4;
|
|
@@ -18585,12 +18585,12 @@ ${auth.clientId}`;
|
|
|
18585
18585
|
throw new Error(`executeVaultSnapshot requires a positive integer chainId, got ${String(chainId)}`);
|
|
18586
18586
|
}
|
|
18587
18587
|
global.ethers = {
|
|
18588
|
-
...
|
|
18588
|
+
...import_ethers62.ethers,
|
|
18589
18589
|
providers: {
|
|
18590
|
-
StaticJsonRpcProvider:
|
|
18590
|
+
StaticJsonRpcProvider: import_ethers62.ethers.JsonRpcProvider
|
|
18591
18591
|
},
|
|
18592
|
-
Contract:
|
|
18593
|
-
utils:
|
|
18592
|
+
Contract: import_ethers62.ethers.Contract,
|
|
18593
|
+
utils: import_ethers62.ethers
|
|
18594
18594
|
// v6 moved utils to top level
|
|
18595
18595
|
};
|
|
18596
18596
|
global.Lit = {
|
|
@@ -20884,7 +20884,7 @@ var require_axios = __commonJS({
|
|
|
20884
20884
|
this.__CANCEL__ = true;
|
|
20885
20885
|
}
|
|
20886
20886
|
};
|
|
20887
|
-
function
|
|
20887
|
+
function settle3(resolve, reject, response) {
|
|
20888
20888
|
const validateStatus2 = response.config.validateStatus;
|
|
20889
20889
|
if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
|
|
20890
20890
|
resolve(response);
|
|
@@ -21020,7 +21020,7 @@ var require_axios = __commonJS({
|
|
|
21020
21020
|
function getEnv2(key) {
|
|
21021
21021
|
return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || "";
|
|
21022
21022
|
}
|
|
21023
|
-
var VERSION3 = "1.21.
|
|
21023
|
+
var VERSION3 = "1.21.1";
|
|
21024
21024
|
function parseProtocol2(url3) {
|
|
21025
21025
|
const match = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url3);
|
|
21026
21026
|
return match && match[1].toLowerCase() || "";
|
|
@@ -22455,7 +22455,7 @@ var require_axios = __commonJS({
|
|
|
22455
22455
|
}
|
|
22456
22456
|
let convertedData;
|
|
22457
22457
|
if (method !== "GET") {
|
|
22458
|
-
return
|
|
22458
|
+
return settle3(resolve, reject, {
|
|
22459
22459
|
status: 405,
|
|
22460
22460
|
statusText: "method not allowed",
|
|
22461
22461
|
headers: {},
|
|
@@ -22480,7 +22480,7 @@ var require_axios = __commonJS({
|
|
|
22480
22480
|
} else if (responseType === "stream") {
|
|
22481
22481
|
convertedData = stream4.Readable.from(convertedData);
|
|
22482
22482
|
}
|
|
22483
|
-
return
|
|
22483
|
+
return settle3(resolve, reject, {
|
|
22484
22484
|
data: convertedData,
|
|
22485
22485
|
status: 200,
|
|
22486
22486
|
statusText: "OK",
|
|
@@ -22776,7 +22776,7 @@ var require_axios = __commonJS({
|
|
|
22776
22776
|
});
|
|
22777
22777
|
}
|
|
22778
22778
|
response.data = responseStream;
|
|
22779
|
-
|
|
22779
|
+
settle3(resolve, reject, response);
|
|
22780
22780
|
} else {
|
|
22781
22781
|
const responseBuffer = [];
|
|
22782
22782
|
let totalResponseBytes = 0;
|
|
@@ -22814,7 +22814,7 @@ var require_axios = __commonJS({
|
|
|
22814
22814
|
} catch (err) {
|
|
22815
22815
|
return reject(AxiosError3.from(err, null, config, response.request, response));
|
|
22816
22816
|
}
|
|
22817
|
-
|
|
22817
|
+
settle3(resolve, reject, response);
|
|
22818
22818
|
});
|
|
22819
22819
|
}
|
|
22820
22820
|
abortEmitter.once("abort", (err) => {
|
|
@@ -23361,7 +23361,7 @@ var require_axios = __commonJS({
|
|
|
23361
23361
|
config,
|
|
23362
23362
|
request
|
|
23363
23363
|
};
|
|
23364
|
-
|
|
23364
|
+
settle3(function _resolve(value) {
|
|
23365
23365
|
resolve(value);
|
|
23366
23366
|
done();
|
|
23367
23367
|
}, function _reject(err) {
|
|
@@ -24076,7 +24076,7 @@ var require_axios = __commonJS({
|
|
|
24076
24076
|
}
|
|
24077
24077
|
!isStreamResponse && unsubscribe && unsubscribe();
|
|
24078
24078
|
return await new Promise((resolve, reject) => {
|
|
24079
|
-
|
|
24079
|
+
settle3(resolve, reject, {
|
|
24080
24080
|
data: responseData,
|
|
24081
24081
|
headers: AxiosHeaders3.from(response.headers),
|
|
24082
24082
|
status: response.status,
|
|
@@ -24228,8 +24228,11 @@ var require_axios = __commonJS({
|
|
|
24228
24228
|
throw new CanceledError3(null, config);
|
|
24229
24229
|
}
|
|
24230
24230
|
}
|
|
24231
|
-
function
|
|
24232
|
-
return
|
|
24231
|
+
function resolveClock2() {
|
|
24232
|
+
return typeof performance !== "undefined" && utils$1.isFunction(performance.now) ? () => performance.now() : Date.now;
|
|
24233
|
+
}
|
|
24234
|
+
function elapsedSince2(now, start) {
|
|
24235
|
+
return Math.max(0, Math.round(now() - start));
|
|
24233
24236
|
}
|
|
24234
24237
|
function dispatchRequest2(_config) {
|
|
24235
24238
|
const config = utils$1.toSafeFlatObject(_config);
|
|
@@ -24240,10 +24243,11 @@ var require_axios = __commonJS({
|
|
|
24240
24243
|
config.headers.setContentType("application/x-www-form-urlencoded", false);
|
|
24241
24244
|
}
|
|
24242
24245
|
const adapter2 = adapters.getAdapter(config.adapter || defaults2.adapter, config);
|
|
24243
|
-
const
|
|
24246
|
+
const now = resolveClock2();
|
|
24247
|
+
const start = now();
|
|
24244
24248
|
return adapter2(config).then(function onAdapterResolution(response) {
|
|
24245
24249
|
throwIfCancellationRequested2(config);
|
|
24246
|
-
response.duration = elapsedSince2(start);
|
|
24250
|
+
response.duration = elapsedSince2(now, start);
|
|
24247
24251
|
config.response = response;
|
|
24248
24252
|
try {
|
|
24249
24253
|
response.data = transformData2.call(config, config.transformResponse, response);
|
|
@@ -24256,7 +24260,7 @@ var require_axios = __commonJS({
|
|
|
24256
24260
|
if (!isCancel3(reason)) {
|
|
24257
24261
|
throwIfCancellationRequested2(config);
|
|
24258
24262
|
if (reason && reason.response) {
|
|
24259
|
-
reason.response.duration = elapsedSince2(start);
|
|
24263
|
+
reason.response.duration = elapsedSince2(now, start);
|
|
24260
24264
|
config.response = reason.response;
|
|
24261
24265
|
try {
|
|
24262
24266
|
reason.response.data = transformData2.call(config, config.transformResponse, reason.response);
|
|
@@ -41753,7 +41757,7 @@ function guardRelayFatal(core, health, onFatal) {
|
|
|
41753
41757
|
relayer.provider.on("error", record);
|
|
41754
41758
|
};
|
|
41755
41759
|
}
|
|
41756
|
-
var import_core, import_sign_client, os, path3, import_node_fs,
|
|
41760
|
+
var import_core, import_sign_client, os, path3, import_node_fs, import_ethers53, WC_SESSION_METHODS, WC_DAPP_METADATA, EVENTS, WcTransport;
|
|
41757
41761
|
var init_wc_transport = __esm({
|
|
41758
41762
|
"src/boundary/upstream/shared/external-bridge/wc-transport.ts"() {
|
|
41759
41763
|
"use strict";
|
|
@@ -41762,7 +41766,7 @@ var init_wc_transport = __esm({
|
|
|
41762
41766
|
os = __toESM(require("os"));
|
|
41763
41767
|
path3 = __toESM(require("path"));
|
|
41764
41768
|
import_node_fs = require("fs");
|
|
41765
|
-
|
|
41769
|
+
import_ethers53 = require("ethers");
|
|
41766
41770
|
WC_SESSION_METHODS = ["personal_sign", "eth_signTypedData_v4", "eth_sendTransaction"];
|
|
41767
41771
|
WC_DAPP_METADATA = {
|
|
41768
41772
|
name: "Diamond Hands MCP",
|
|
@@ -41846,7 +41850,7 @@ var init_wc_transport = __esm({
|
|
|
41846
41850
|
return await this.client.request({
|
|
41847
41851
|
topic: candidate.topic,
|
|
41848
41852
|
chainId: `eip155:${candidate.chainId}`,
|
|
41849
|
-
request: { method: "personal_sign", params: [
|
|
41853
|
+
request: { method: "personal_sign", params: [import_ethers53.ethers.hexlify(import_ethers53.ethers.toUtf8Bytes(statement)), candidate.account] }
|
|
41850
41854
|
});
|
|
41851
41855
|
};
|
|
41852
41856
|
const state = { deleted: false };
|
|
@@ -42143,14 +42147,14 @@ function resolveRealConfig(env) {
|
|
|
42143
42147
|
|
|
42144
42148
|
// src/boot.ts
|
|
42145
42149
|
var fs6 = __toESM(require("fs"));
|
|
42146
|
-
var
|
|
42150
|
+
var import_ethers59 = require("ethers");
|
|
42147
42151
|
|
|
42148
42152
|
// src/boundary/index.ts
|
|
42149
42153
|
var import_node_crypto8 = require("crypto");
|
|
42150
42154
|
var fs5 = __toESM(require("fs"));
|
|
42151
42155
|
var os2 = __toESM(require("os"));
|
|
42152
42156
|
var path4 = __toESM(require("path"));
|
|
42153
|
-
var
|
|
42157
|
+
var import_ethers58 = require("ethers");
|
|
42154
42158
|
|
|
42155
42159
|
// src/boundary/envelope.ts
|
|
42156
42160
|
function okEnvelope(data, source, warnings = []) {
|
|
@@ -42583,7 +42587,7 @@ var BoundaryCore = class {
|
|
|
42583
42587
|
const inToken = toUcd ? s.stablecoinSymbol : "UCD";
|
|
42584
42588
|
const inUnit = toUcd ? `${s.stablecoinSymbol} smallest units (${s.stablecoinDecimals} decimals)` : "UCD wei (18 decimals)";
|
|
42585
42589
|
const amountIn = parseDecimalUnits(p.amount, inDecimals);
|
|
42586
|
-
const
|
|
42590
|
+
const refuse4 = (refusal, message, details) => ({
|
|
42587
42591
|
env: errEnvelope(
|
|
42588
42592
|
boundaryError("UPSTREAM_REJECTED", message, {
|
|
42589
42593
|
source: statusR.source.id,
|
|
@@ -42594,13 +42598,13 @@ var BoundaryCore = class {
|
|
|
42594
42598
|
});
|
|
42595
42599
|
const named = (units) => `${formatDecimalUnits(units, inDecimals)} ${inToken} (${units} ${inUnit})`;
|
|
42596
42600
|
if (s.paused) {
|
|
42597
|
-
return
|
|
42601
|
+
return refuse4(
|
|
42598
42602
|
"psm-paused",
|
|
42599
42603
|
"the PSM is paused \u2014 BOTH exchange directions are disabled until an operator unpauses it (this is the PSM's own pause switch)."
|
|
42600
42604
|
);
|
|
42601
42605
|
}
|
|
42602
42606
|
if (!toUcd && !s.redeemEnabled) {
|
|
42603
|
-
return
|
|
42607
|
+
return refuse4(
|
|
42604
42608
|
"redeem-disabled",
|
|
42605
42609
|
`redemptions are disabled (redeemEnabled = false) \u2014 UCD -> ${s.stablecoinSymbol} is refused; ${s.stablecoinSymbol} -> UCD swaps are unaffected.`
|
|
42606
42610
|
);
|
|
@@ -42611,20 +42615,20 @@ var BoundaryCore = class {
|
|
|
42611
42615
|
const min = BigInt(toUcd ? s.minSwapAmount : s.minRedeemAmount);
|
|
42612
42616
|
const max = BigInt(toUcd ? s.maxSwapAmount : s.maxRedeemAmount);
|
|
42613
42617
|
if (amountIn < min) {
|
|
42614
|
-
return
|
|
42618
|
+
return refuse4(
|
|
42615
42619
|
"below-min",
|
|
42616
42620
|
`${named(amountIn)} is below the minimum of ${named(min)} for the ${p.direction} direction.`,
|
|
42617
42621
|
{ amount: amountIn.toString(), minimum: min.toString(), unit: inUnit }
|
|
42618
42622
|
);
|
|
42619
42623
|
}
|
|
42620
42624
|
if (max === 0n) {
|
|
42621
|
-
return
|
|
42625
|
+
return refuse4(
|
|
42622
42626
|
"direction-disabled",
|
|
42623
42627
|
`the ${p.direction} direction is DISABLED by configuration (${toUcd ? "maxSwapAmount" : "maxRedeemAmount"} is 0).`
|
|
42624
42628
|
);
|
|
42625
42629
|
}
|
|
42626
42630
|
if (amountIn > max) {
|
|
42627
|
-
return
|
|
42631
|
+
return refuse4(
|
|
42628
42632
|
"above-max",
|
|
42629
42633
|
`${named(amountIn)} is above the maximum of ${named(max)} per operation for the ${p.direction} direction.`,
|
|
42630
42634
|
{ amount: amountIn.toString(), maximum: max.toString(), unit: inUnit }
|
|
@@ -42644,7 +42648,7 @@ var BoundaryCore = class {
|
|
|
42644
42648
|
if (!toUcd) {
|
|
42645
42649
|
const available = BigInt(s.availableReserves);
|
|
42646
42650
|
if (available < amountOut) {
|
|
42647
|
-
return
|
|
42651
|
+
return refuse4(
|
|
42648
42652
|
"insufficient-reserves",
|
|
42649
42653
|
`the PSM cannot pay this redemption: available reserves ${formatDecimalUnits(available, s.stablecoinDecimals)} ${s.stablecoinSymbol} (${available} smallest units), required ${formatDecimalUnits(amountOut, s.stablecoinDecimals)} ${s.stablecoinSymbol} (${amountOut} smallest units).`,
|
|
42650
42654
|
{ available: available.toString(), required: amountOut.toString(), unit: outUnit }
|
|
@@ -46888,7 +46892,7 @@ var SafeModuleCeremony = class {
|
|
|
46888
46892
|
};
|
|
46889
46893
|
|
|
46890
46894
|
// src/boundary/upstream/real/plugin.ts
|
|
46891
|
-
var
|
|
46895
|
+
var import_ethers57 = require("ethers");
|
|
46892
46896
|
|
|
46893
46897
|
// node_modules/@gvnrdao/dh-sdk/dist/index.mjs
|
|
46894
46898
|
var import_ethers13 = require("ethers");
|
|
@@ -46902,6 +46906,7 @@ var import_ethers20 = require("ethers");
|
|
|
46902
46906
|
var import_ethers21 = require("ethers");
|
|
46903
46907
|
var import_ethers22 = require("ethers");
|
|
46904
46908
|
var import_ethers23 = require("ethers");
|
|
46909
|
+
var import_ethers24 = require("ethers");
|
|
46905
46910
|
|
|
46906
46911
|
// node_modules/@noble/hashes/esm/utils.js
|
|
46907
46912
|
function isBytes(a) {
|
|
@@ -47349,11 +47354,11 @@ var ripemd1602 = ripemd160;
|
|
|
47349
47354
|
// node_modules/@gvnrdao/dh-sdk/dist/index.mjs
|
|
47350
47355
|
var import_bech32 = __toESM(require_dist(), 1);
|
|
47351
47356
|
var import_bs58check = __toESM(require_bs58check(), 1);
|
|
47352
|
-
var import_ethers24 = require("ethers");
|
|
47353
47357
|
var import_ethers25 = require("ethers");
|
|
47354
47358
|
var import_ethers26 = require("ethers");
|
|
47355
47359
|
var import_ethers27 = require("ethers");
|
|
47356
47360
|
var import_ethers28 = require("ethers");
|
|
47361
|
+
var import_ethers29 = require("ethers");
|
|
47357
47362
|
|
|
47358
47363
|
// node_modules/axios/lib/helpers/bind.js
|
|
47359
47364
|
function bind(fn, thisArg) {
|
|
@@ -49428,7 +49433,7 @@ var import_follow_redirects = __toESM(require_follow_redirects(), 1);
|
|
|
49428
49433
|
var import_zlib = __toESM(require("zlib"), 1);
|
|
49429
49434
|
|
|
49430
49435
|
// node_modules/axios/lib/env/data.js
|
|
49431
|
-
var VERSION = "1.21.
|
|
49436
|
+
var VERSION = "1.21.1";
|
|
49432
49437
|
|
|
49433
49438
|
// node_modules/axios/lib/helpers/parseProtocol.js
|
|
49434
49439
|
function parseProtocol(url2) {
|
|
@@ -52929,8 +52934,11 @@ function throwIfCancellationRequested(config) {
|
|
|
52929
52934
|
throw new CanceledError_default(null, config);
|
|
52930
52935
|
}
|
|
52931
52936
|
}
|
|
52932
|
-
function
|
|
52933
|
-
return
|
|
52937
|
+
function resolveClock() {
|
|
52938
|
+
return typeof performance !== "undefined" && utils_default.isFunction(performance.now) ? () => performance.now() : Date.now;
|
|
52939
|
+
}
|
|
52940
|
+
function elapsedSince(now, start) {
|
|
52941
|
+
return Math.max(0, Math.round(now() - start));
|
|
52934
52942
|
}
|
|
52935
52943
|
function dispatchRequest(_config) {
|
|
52936
52944
|
const config = utils_default.toSafeFlatObject(_config);
|
|
@@ -52941,11 +52949,12 @@ function dispatchRequest(_config) {
|
|
|
52941
52949
|
config.headers.setContentType("application/x-www-form-urlencoded", false);
|
|
52942
52950
|
}
|
|
52943
52951
|
const adapter2 = adapters_default.getAdapter(config.adapter || defaults_default.adapter, config);
|
|
52944
|
-
const
|
|
52952
|
+
const now = resolveClock();
|
|
52953
|
+
const start = now();
|
|
52945
52954
|
return adapter2(config).then(
|
|
52946
52955
|
function onAdapterResolution(response) {
|
|
52947
52956
|
throwIfCancellationRequested(config);
|
|
52948
|
-
response.duration = elapsedSince(start);
|
|
52957
|
+
response.duration = elapsedSince(now, start);
|
|
52949
52958
|
config.response = response;
|
|
52950
52959
|
try {
|
|
52951
52960
|
response.data = transformData.call(config, config.transformResponse, response);
|
|
@@ -52959,7 +52968,7 @@ function dispatchRequest(_config) {
|
|
|
52959
52968
|
if (!isCancel(reason)) {
|
|
52960
52969
|
throwIfCancellationRequested(config);
|
|
52961
52970
|
if (reason && reason.response) {
|
|
52962
|
-
reason.response.duration = elapsedSince(start);
|
|
52971
|
+
reason.response.duration = elapsedSince(now, start);
|
|
52963
52972
|
config.response = reason.response;
|
|
52964
52973
|
try {
|
|
52965
52974
|
reason.response.data = transformData.call(
|
|
@@ -53549,16 +53558,17 @@ var {
|
|
|
53549
53558
|
} = axios_default;
|
|
53550
53559
|
|
|
53551
53560
|
// node_modules/@gvnrdao/dh-sdk/dist/index.mjs
|
|
53552
|
-
var import_ethers29 = require("ethers");
|
|
53553
53561
|
var import_ethers30 = require("ethers");
|
|
53554
53562
|
var import_ethers31 = require("ethers");
|
|
53555
53563
|
var import_ethers32 = require("ethers");
|
|
53556
53564
|
var import_ethers33 = require("ethers");
|
|
53557
53565
|
var import_ethers34 = require("ethers");
|
|
53558
53566
|
var import_ethers35 = require("ethers");
|
|
53559
|
-
var import_dh_lit_ops = __toESM(require_dist3(), 1);
|
|
53560
53567
|
var import_ethers36 = require("ethers");
|
|
53561
53568
|
var import_ethers37 = require("ethers");
|
|
53569
|
+
var import_dh_lit_ops = __toESM(require_dist3(), 1);
|
|
53570
|
+
var import_ethers38 = require("ethers");
|
|
53571
|
+
var import_ethers39 = require("ethers");
|
|
53562
53572
|
var __create2 = Object.create;
|
|
53563
53573
|
var __defProp2 = Object.defineProperty;
|
|
53564
53574
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -53656,8 +53666,6 @@ var init_deployment_addresses = __esm2({
|
|
|
53656
53666
|
BitcoinProviderRegistry: "0xbfA0c48B070D0a9A9CD27469AeacFD2d4261cEE2",
|
|
53657
53667
|
ContractVersionRegistry: "0x97E43AA6aFF2C0cf659d3aE501658D2Ef6777522",
|
|
53658
53668
|
usdcToken: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
|
|
53659
|
-
mockUsdcToken: "0x96409A98e0D322d6566b7F44a0fAbD1BD4ce2AEc",
|
|
53660
|
-
mockUsdtToken: "0xF8b7fB38b17a310960E47805Be9adba0b0e0394D",
|
|
53661
53669
|
PositionDelegateRegistry: "0x482369De283622E7b05731875ec137d4E3D208F9",
|
|
53662
53670
|
FeeRecipientRegistry: "0x95795F8403DDb629E8527B2934C4e71f5fC0C374",
|
|
53663
53671
|
BitcoinWithdrawalAddressRegistry: "0x6376D392097F0A81e51BD83960A97EA20eaf1dbe",
|
|
@@ -53842,10 +53850,10 @@ var init_deployment_addresses = __esm2({
|
|
|
53842
53850
|
},
|
|
53843
53851
|
StUSDCVault: {
|
|
53844
53852
|
previousImplementation: "0x3619b14C23c5F7d950EF845481C2299939873004",
|
|
53845
|
-
newImplementation: "
|
|
53846
|
-
upgradedAt: "2026-
|
|
53853
|
+
newImplementation: "0xE94DFBacA21fEFB0BB2e95D33510Ca702d2b6c5f",
|
|
53854
|
+
upgradedAt: "2026-11-08T16:07:36.867Z",
|
|
53847
53855
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
53848
|
-
reason: "
|
|
53856
|
+
reason: "StUSDCVault 1.1.0: Phase 5 desk (linked StUSDCDeskLib 0x0880ce721b0A50C8Fe8d5c911097F0c24e57b6aA)"
|
|
53849
53857
|
},
|
|
53850
53858
|
CarryFeeReceiver: {
|
|
53851
53859
|
previousImplementation: "0x9c43996C6f6BAD82F2A5152AbA61137E929EFA17",
|
|
@@ -53910,6 +53918,9 @@ var init_deployment_addresses = __esm2({
|
|
|
53910
53918
|
setPKPValidationRegistryTx: "0xab6b7e610c1ecf68da9a1e1150e61631e1f2a945bec12608c8357e03be25c4a5",
|
|
53911
53919
|
replacedAddress: "0xC8Ca02238fbCDAEbE6dbF804461D43F46F9406F4"
|
|
53912
53920
|
},
|
|
53921
|
+
libraries: {
|
|
53922
|
+
StUSDCDeskLib: "0x0880ce721b0A50C8Fe8d5c911097F0c24e57b6aA"
|
|
53923
|
+
},
|
|
53913
53924
|
latestEnv: {
|
|
53914
53925
|
UCD_TOKEN: "0xdd817Ff47C9b8f81335Ac579895D8EA321Fa86Df",
|
|
53915
53926
|
UCD_CONTROLLER: "0x360Bde4e489ee94E26601B206932De09EE60FF04",
|
|
@@ -53962,8 +53973,6 @@ var init_deployment_addresses = __esm2({
|
|
|
53962
53973
|
CONTRACT_VERSION_REGISTRY: "0x97E43AA6aFF2C0cf659d3aE501658D2Ef6777522",
|
|
53963
53974
|
CONTRACT_VERSION_REGISTRY_IMPL: "0xF3389De4bCeC735e4F6d35b9f71170D96037D1B7",
|
|
53964
53975
|
USDC_TOKEN: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
|
|
53965
|
-
MOCK_USDC_TOKEN: "0x96409A98e0D322d6566b7F44a0fAbD1BD4ce2AEc",
|
|
53966
|
-
MOCK_USDT_TOKEN: "0xF8b7fB38b17a310960E47805Be9adba0b0e0394D",
|
|
53967
53976
|
POSITION_DELEGATE_REGISTRY: "0x482369De283622E7b05731875ec137d4E3D208F9",
|
|
53968
53977
|
POSITION_DELEGATE_REGISTRY_IMPL: "0xc681c48688cdAA966119E265e4a378ef8Fe0eBcA",
|
|
53969
53978
|
AGENT_MODULE: "0xefb8C29C1e7e92ed7d81a52dbedaed74e37fe380",
|
|
@@ -53978,7 +53987,7 @@ var init_deployment_addresses = __esm2({
|
|
|
53978
53987
|
STUCD_VAULT: "0xc04Dd4d6799FFDE57feAfD5B3B1B038827014fd3",
|
|
53979
53988
|
STUCD_VAULT_IMPL: "0xd596A866ee5273aedaC21BC6e88649E087fC8EcB",
|
|
53980
53989
|
STUSDC_VAULT: "0x7aBac04d4Bf2b3A63AF363B9527970791346463a",
|
|
53981
|
-
STUSDC_VAULT_IMPL: "
|
|
53990
|
+
STUSDC_VAULT_IMPL: "0xE94DFBacA21fEFB0BB2e95D33510Ca702d2b6c5f",
|
|
53982
53991
|
CARRY_FEE_RECEIVER: "0x2C8e54f099Cf479182D7c87D76FeD88b4172cdB4",
|
|
53983
53992
|
CARRY_FEE_RECEIVER_IMPL: "0x3a86A23ff3cd6c26B1Fa2C5aeBAeEEdbF6095D69",
|
|
53984
53993
|
FEE_RECOGNITION_LEDGER: "0xA5EBfb856fe2b847cC6011B0fe2dB6ACE63D6C3c",
|
|
@@ -54010,8 +54019,6 @@ var init_deployment_addresses = __esm2({
|
|
|
54010
54019
|
BitcoinProviderRegistry: "0xbfA0c48B070D0a9A9CD27469AeacFD2d4261cEE2",
|
|
54011
54020
|
ContractVersionRegistry: "0x97E43AA6aFF2C0cf659d3aE501658D2Ef6777522",
|
|
54012
54021
|
usdcToken: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
|
|
54013
|
-
mockUsdcToken: "0x96409A98e0D322d6566b7F44a0fAbD1BD4ce2AEc",
|
|
54014
|
-
mockUsdtToken: "0xF8b7fB38b17a310960E47805Be9adba0b0e0394D",
|
|
54015
54022
|
PositionDelegateRegistry: "0x482369De283622E7b05731875ec137d4E3D208F9",
|
|
54016
54023
|
FeeRecipientRegistry: "0x95795F8403DDb629E8527B2934C4e71f5fC0C374",
|
|
54017
54024
|
BitcoinWithdrawalAddressRegistry: "0x6376D392097F0A81e51BD83960A97EA20eaf1dbe",
|
|
@@ -56038,7 +56045,7 @@ ${errorReport}`);
|
|
|
56038
56045
|
}
|
|
56039
56046
|
init_debug_logger();
|
|
56040
56047
|
init_session_signature_cache();
|
|
56041
|
-
var
|
|
56048
|
+
var import_ethers282 = __require("ethers");
|
|
56042
56049
|
var EXPIRED_LOAN_MIN_LIQUIDATION_THRESHOLD_BPS = 11e3;
|
|
56043
56050
|
var EXPIRED_LOAN_MAX_ESCALATION_ITERATIONS = 365;
|
|
56044
56051
|
var BASIS_POINTS_DENOMINATOR = 1e4;
|
|
@@ -59169,12 +59176,12 @@ ${auth.clientId}`;
|
|
|
59169
59176
|
throw new Error(`executeVaultSnapshot requires a positive integer chainId, got ${String(chainId)}`);
|
|
59170
59177
|
}
|
|
59171
59178
|
global.ethers = {
|
|
59172
|
-
...
|
|
59179
|
+
...import_ethers282.ethers,
|
|
59173
59180
|
providers: {
|
|
59174
|
-
StaticJsonRpcProvider:
|
|
59181
|
+
StaticJsonRpcProvider: import_ethers282.ethers.JsonRpcProvider
|
|
59175
59182
|
},
|
|
59176
|
-
Contract:
|
|
59177
|
-
utils:
|
|
59183
|
+
Contract: import_ethers282.ethers.Contract,
|
|
59184
|
+
utils: import_ethers282.ethers
|
|
59178
59185
|
// v6 moved utils to top level
|
|
59179
59186
|
};
|
|
59180
59187
|
global.Lit = {
|
|
@@ -59501,8 +59508,6 @@ function getSepoliaConfig() {
|
|
|
59501
59508
|
positionManagerViews: SEPOLIA_CONTRACTS.PositionManagerViews || "",
|
|
59502
59509
|
simplePsmV2: SEPOLIA_CONTRACTS.SimplePSMV2 || "",
|
|
59503
59510
|
usdcToken: SEPOLIA_CONTRACTS.usdcToken || "",
|
|
59504
|
-
mockUsdcToken: SEPOLIA_CONTRACTS.mockUsdcToken || "",
|
|
59505
|
-
mockUsdtToken: SEPOLIA_CONTRACTS.mockUsdtToken || "",
|
|
59506
59511
|
loanOperationsManager: SEPOLIA_CONTRACTS.LoanOperationsManagerModule || "",
|
|
59507
59512
|
termManager: SEPOLIA_CONTRACTS.TermManagerModule || "",
|
|
59508
59513
|
circuitBreaker: SEPOLIA_CONTRACTS.CircuitBreakerModule || "",
|
|
@@ -60072,12 +60077,6 @@ function assertFeeCeiling(gasLimit, maxFeePerGas, raise, ceiling = DEFAULT_FEE_C
|
|
|
60072
60077
|
);
|
|
60073
60078
|
}
|
|
60074
60079
|
}
|
|
60075
|
-
var MINT_UCD_GAS_CEILING = BigInt(13e5);
|
|
60076
|
-
var WITHDRAW_BTC_GAS_CEILING = BigInt(3e6);
|
|
60077
|
-
var MAKE_PAYMENT_GAS_CEILING = BigInt(1e6);
|
|
60078
|
-
var EXTEND_POSITION_GAS_CEILING = BigInt(1e6);
|
|
60079
|
-
var LIQUIDATION_COMMIT_GAS_CEILING = BigInt(2e6);
|
|
60080
|
-
var LIQUIDATION_REVEAL_GAS_CEILING = BigInt(25e5);
|
|
60081
60080
|
var FEE_HISTORY_BLOCK_COUNT = 20;
|
|
60082
60081
|
var FEE_HISTORY_REWARD_PERCENTILE = 75;
|
|
60083
60082
|
function isJsonRpcSendable(provider) {
|
|
@@ -61418,6 +61417,39 @@ var ServerSession = class {
|
|
|
61418
61417
|
}
|
|
61419
61418
|
}
|
|
61420
61419
|
};
|
|
61420
|
+
var GAS_LIMIT_MULTIPLIER_NUMERATOR = 12n;
|
|
61421
|
+
var GAS_LIMIT_MULTIPLIER_DENOMINATOR = 10n;
|
|
61422
|
+
var GAS_LIMIT_HEADROOM = 262500n;
|
|
61423
|
+
var GasLimitCeilingError = class extends Error {
|
|
61424
|
+
constructor(estimate, gasLimit) {
|
|
61425
|
+
super(
|
|
61426
|
+
`Sized gasLimit ${gasLimit} (from eth_estimateGas ${estimate}) exceeds the ${MAX_GAS_LIMIT} ceiling; refusing to send rather than clamp to a limit the call cannot complete within`
|
|
61427
|
+
);
|
|
61428
|
+
this.estimate = estimate;
|
|
61429
|
+
this.gasLimit = gasLimit;
|
|
61430
|
+
this.name = "GasLimitCeilingError";
|
|
61431
|
+
}
|
|
61432
|
+
};
|
|
61433
|
+
var GAS_ESTIMATE_RETRY_MARKER = "no gasLimit can be sized, so nothing was sent \u2014 retry";
|
|
61434
|
+
var GasEstimateUnavailableError = class extends Error {
|
|
61435
|
+
constructor(message, cause) {
|
|
61436
|
+
super(message);
|
|
61437
|
+
this.cause = cause;
|
|
61438
|
+
this.name = "GasEstimateUnavailableError";
|
|
61439
|
+
}
|
|
61440
|
+
retryable = true;
|
|
61441
|
+
};
|
|
61442
|
+
function sizeGasLimit(estimate) {
|
|
61443
|
+
if (estimate <= 0n) {
|
|
61444
|
+
throw new Error(`sizeGasLimit: estimate must be positive, got ${estimate}`);
|
|
61445
|
+
}
|
|
61446
|
+
const scaled = (estimate * GAS_LIMIT_MULTIPLIER_NUMERATOR + GAS_LIMIT_MULTIPLIER_DENOMINATOR - 1n) / GAS_LIMIT_MULTIPLIER_DENOMINATOR;
|
|
61447
|
+
const gasLimit = scaled + GAS_LIMIT_HEADROOM;
|
|
61448
|
+
if (gasLimit > MAX_GAS_LIMIT) {
|
|
61449
|
+
throw new GasLimitCeilingError(estimate, gasLimit);
|
|
61450
|
+
}
|
|
61451
|
+
return gasLimit;
|
|
61452
|
+
}
|
|
61421
61453
|
var DEAD_ZONE_VIOLATION_SELECTOR = "0xbe4b82c1";
|
|
61422
61454
|
var ERROR_STRING_SELECTOR = "0x08c379a0";
|
|
61423
61455
|
var PANIC_SELECTOR = "0x4e487b71";
|
|
@@ -61445,13 +61477,13 @@ function decodeQuantumRevert(e) {
|
|
|
61445
61477
|
if (!name && selector && data) {
|
|
61446
61478
|
try {
|
|
61447
61479
|
if (selector === ERROR_STRING_SELECTOR) {
|
|
61448
|
-
const [message] =
|
|
61480
|
+
const [message] = import_ethers20.AbiCoder.defaultAbiCoder().decode(
|
|
61449
61481
|
["string"],
|
|
61450
61482
|
"0x" + data.slice(10)
|
|
61451
61483
|
);
|
|
61452
61484
|
name = `Error("${message}")`;
|
|
61453
61485
|
} else if (selector === PANIC_SELECTOR) {
|
|
61454
|
-
const [code] =
|
|
61486
|
+
const [code] = import_ethers20.AbiCoder.defaultAbiCoder().decode(
|
|
61455
61487
|
["uint256"],
|
|
61456
61488
|
"0x" + data.slice(10)
|
|
61457
61489
|
);
|
|
@@ -61474,7 +61506,8 @@ function isRetryableQuantumFailure(message) {
|
|
|
61474
61506
|
if (message.includes("Transaction timeout") || message.includes("Transaction confirmation failed") || message.includes("Transaction receipt not found")) {
|
|
61475
61507
|
return false;
|
|
61476
61508
|
}
|
|
61477
|
-
return RETRYABLE_QUANTUM_ERROR_NAMES.some((name) => message.includes(name)) || message.includes("Transaction reverted");
|
|
61509
|
+
return RETRYABLE_QUANTUM_ERROR_NAMES.some((name) => message.includes(name)) || message.includes("Transaction reverted") || // No gas estimate → refused before broadcast; a fresh signature is safe.
|
|
61510
|
+
message.includes(GAS_ESTIMATE_RETRY_MARKER);
|
|
61478
61511
|
}
|
|
61479
61512
|
var MAX_DEADZONE_RESIMULATIONS = 3;
|
|
61480
61513
|
var QuantumRevertError = class extends Error {
|
|
@@ -61504,54 +61537,105 @@ async function assertSafeQuantumSubmission(opts) {
|
|
|
61504
61537
|
...opts.sleep ? { sleep: opts.sleep } : {},
|
|
61505
61538
|
...chainNow ? { chainNow } : {}
|
|
61506
61539
|
};
|
|
61540
|
+
const tx2 = { to, from, data };
|
|
61507
61541
|
await awaitSafeSubmissionWindow(quantumTimestamp, gateOpts);
|
|
61508
61542
|
const SAME_BLOCK_INTERACTION_SELECTOR = "0x3b53d1db";
|
|
61509
61543
|
const laneGuardActive = opts.laneGuardActive === true;
|
|
61544
|
+
const sigQuantum = Math.floor(quantumTimestamp / QUANTUM_WINDOW_SECONDS2) * QUANTUM_WINDOW_SECONDS2;
|
|
61545
|
+
const sigIsCurrent = () => sigQuantum === Math.floor(now() / QUANTUM_WINDOW_SECONDS2) * QUANTUM_WINDOW_SECONDS2;
|
|
61546
|
+
const resolveStaleHead = async (decoded) => {
|
|
61547
|
+
const deadZoneArtifact = decoded.selector === DEAD_ZONE_VIOLATION_SELECTOR && sigIsCurrent();
|
|
61548
|
+
if (laneGuardActive && (decoded.selector === SAME_BLOCK_INTERACTION_SELECTOR || deadZoneArtifact)) {
|
|
61549
|
+
onDebug(
|
|
61550
|
+
`\u21AA\uFE0F [lane-only] Simulated ${decoded.name ?? decoded.selector} is a stale-latest-block artifact \u2014 mining one block and re-estimating`
|
|
61551
|
+
);
|
|
61552
|
+
await requireSend(provider, "evm_mine on the local lane")("evm_mine", []);
|
|
61553
|
+
return settle2(await estimateOnce(provider, tx2));
|
|
61554
|
+
}
|
|
61555
|
+
if (deadZoneArtifact) {
|
|
61556
|
+
onDebug(
|
|
61557
|
+
"\u21AA\uFE0F Simulated DeadZoneViolation is a stale-latest-block artifact (signature is the current quantum) \u2014 re-estimating with the block time set to now"
|
|
61558
|
+
);
|
|
61559
|
+
return settle2(await estimateWithTimeOverride(provider, tx2, now()));
|
|
61560
|
+
}
|
|
61561
|
+
return null;
|
|
61562
|
+
};
|
|
61563
|
+
let estimate;
|
|
61510
61564
|
for (let sim = 1; ; sim++) {
|
|
61511
|
-
|
|
61512
|
-
|
|
61565
|
+
const outcome = await estimateOnce(provider, tx2);
|
|
61566
|
+
if (outcome.ok) {
|
|
61567
|
+
estimate = outcome.estimate;
|
|
61513
61568
|
break;
|
|
61514
|
-
}
|
|
61515
|
-
|
|
61516
|
-
|
|
61517
|
-
|
|
61518
|
-
|
|
61519
|
-
|
|
61520
|
-
|
|
61521
|
-
|
|
61522
|
-
if (
|
|
61523
|
-
const sigQuantum = Math.floor(quantumTimestamp / QUANTUM_WINDOW_SECONDS2) * QUANTUM_WINDOW_SECONDS2;
|
|
61524
|
-
const realCurrentQuantum = Math.floor(now() / QUANTUM_WINDOW_SECONDS2) * QUANTUM_WINDOW_SECONDS2;
|
|
61525
|
-
if (sigQuantum === realCurrentQuantum) {
|
|
61526
|
-
onDebug(
|
|
61527
|
-
"\u21AA\uFE0F Simulated DeadZoneViolation is a stale-latest-block artifact (signature is the current quantum) \u2014 proceeding to broadcast"
|
|
61528
|
-
);
|
|
61529
|
-
break;
|
|
61530
|
-
}
|
|
61531
|
-
const gate = await awaitSafeSubmissionWindow(quantumTimestamp, gateOpts);
|
|
61532
|
-
if (gate.waited) {
|
|
61533
|
-
onDebug(
|
|
61534
|
-
`\u{1F501} Re-simulating after crossing the quantum boundary (attempt ${sim}/${maxResimulations})`
|
|
61535
|
-
);
|
|
61536
|
-
continue;
|
|
61537
|
-
}
|
|
61538
|
-
}
|
|
61539
|
-
if (!decoded.data) {
|
|
61540
|
-
const label = simError instanceof Error ? simError.message : String(simError);
|
|
61569
|
+
}
|
|
61570
|
+
const resolved = await resolveStaleHead(outcome.decoded);
|
|
61571
|
+
if (resolved !== null) {
|
|
61572
|
+
estimate = resolved;
|
|
61573
|
+
break;
|
|
61574
|
+
}
|
|
61575
|
+
if (outcome.decoded.selector === DEAD_ZONE_VIOLATION_SELECTOR && sim <= maxResimulations) {
|
|
61576
|
+
const gate = await awaitSafeSubmissionWindow(quantumTimestamp, gateOpts);
|
|
61577
|
+
if (gate.waited) {
|
|
61541
61578
|
onDebug(
|
|
61542
|
-
`\
|
|
61579
|
+
`\u{1F501} Re-estimating after crossing the quantum boundary (attempt ${sim}/${maxResimulations})`
|
|
61543
61580
|
);
|
|
61544
|
-
|
|
61581
|
+
continue;
|
|
61545
61582
|
}
|
|
61546
|
-
throw new QuantumRevertError(
|
|
61547
|
-
decoded.name,
|
|
61548
|
-
decoded.selector,
|
|
61549
|
-
decoded.data,
|
|
61550
|
-
simError
|
|
61551
|
-
);
|
|
61552
61583
|
}
|
|
61584
|
+
settle2(outcome);
|
|
61553
61585
|
}
|
|
61554
|
-
await awaitSafeSubmissionWindow(quantumTimestamp, gateOpts);
|
|
61586
|
+
const finalGate = await awaitSafeSubmissionWindow(quantumTimestamp, gateOpts);
|
|
61587
|
+
if (finalGate.waited) {
|
|
61588
|
+
onDebug("\u{1F501} Re-estimating after the final re-gate waited");
|
|
61589
|
+
const outcome = await estimateOnce(provider, tx2);
|
|
61590
|
+
estimate = outcome.ok ? outcome.estimate : await resolveStaleHead(outcome.decoded) ?? settle2(outcome);
|
|
61591
|
+
}
|
|
61592
|
+
return { estimate, gasLimit: sizeGasLimit(estimate) };
|
|
61593
|
+
}
|
|
61594
|
+
async function estimateOnce(provider, tx2) {
|
|
61595
|
+
return provider.estimateGas(tx2).then(
|
|
61596
|
+
(estimate) => ({ ok: true, estimate }),
|
|
61597
|
+
(error) => ({
|
|
61598
|
+
ok: false,
|
|
61599
|
+
decoded: decodeQuantumRevert(error),
|
|
61600
|
+
error,
|
|
61601
|
+
via: "eth_estimateGas"
|
|
61602
|
+
})
|
|
61603
|
+
);
|
|
61604
|
+
}
|
|
61605
|
+
async function estimateWithTimeOverride(provider, tx2, timeSec) {
|
|
61606
|
+
const via = "eth_estimateGas with a blockOverrides time override";
|
|
61607
|
+
const send = requireSend(provider, via);
|
|
61608
|
+
return send("eth_estimateGas", [tx2, "latest", {}, { time: (0, import_ethers19.toQuantity)(timeSec) }]).then(
|
|
61609
|
+
(raw) => ({ ok: true, estimate: BigInt(raw) }),
|
|
61610
|
+
(error) => ({
|
|
61611
|
+
ok: false,
|
|
61612
|
+
decoded: decodeQuantumRevert(error),
|
|
61613
|
+
error,
|
|
61614
|
+
via
|
|
61615
|
+
})
|
|
61616
|
+
);
|
|
61617
|
+
}
|
|
61618
|
+
function requireSend(provider, purpose) {
|
|
61619
|
+
if (typeof provider.send !== "function") {
|
|
61620
|
+
throw new GasEstimateUnavailableError(
|
|
61621
|
+
`Cannot run ${purpose}: the SDK read provider exposes no JSON-RPC send() (use an ethers JsonRpcProvider)`,
|
|
61622
|
+
null
|
|
61623
|
+
);
|
|
61624
|
+
}
|
|
61625
|
+
return provider.send.bind(provider);
|
|
61626
|
+
}
|
|
61627
|
+
function settle2(outcome) {
|
|
61628
|
+
if (outcome.ok)
|
|
61629
|
+
return outcome.estimate;
|
|
61630
|
+
const { decoded, error, via } = outcome;
|
|
61631
|
+
if (!decoded.data) {
|
|
61632
|
+
const label = error instanceof Error ? error.message : String(error);
|
|
61633
|
+
throw new GasEstimateUnavailableError(
|
|
61634
|
+
`${via} failed without revert data (${label}); ${GAS_ESTIMATE_RETRY_MARKER}`,
|
|
61635
|
+
error
|
|
61636
|
+
);
|
|
61637
|
+
}
|
|
61638
|
+
throw new QuantumRevertError(decoded.name, decoded.selector, decoded.data, error);
|
|
61555
61639
|
}
|
|
61556
61640
|
var HARDHAT_CHAIN_IDS = /* @__PURE__ */ new Set([1337, 31337]);
|
|
61557
61641
|
function laneGuardEnvEnabled() {
|
|
@@ -61769,7 +61853,7 @@ var GET_AUTHORIZED_SPENDS_ABI = [
|
|
|
61769
61853
|
"function getAuthorizedSpends(bytes32 positionId) view returns (tuple(string txid, uint32 vout, uint256 satoshis, string targetAddress, uint256 targetAmount, uint256 authorizedAt)[])"
|
|
61770
61854
|
];
|
|
61771
61855
|
async function readAuthorizedSpend(params) {
|
|
61772
|
-
const authorizer = new
|
|
61856
|
+
const authorizer = new import_ethers22.Contract(
|
|
61773
61857
|
btcSpendAuthorizerAddress(params.chainId),
|
|
61774
61858
|
GET_AUTHORIZED_SPENDS_ABI,
|
|
61775
61859
|
params.runner
|
|
@@ -61941,7 +62025,7 @@ function hashBtcInputSet(utxos) {
|
|
|
61941
62025
|
seen.add(key);
|
|
61942
62026
|
}
|
|
61943
62027
|
const canonical = normalized.sort((a, b) => a.txid < b.txid ? -1 : a.txid > b.txid ? 1 : a.vout - b.vout).map((u) => `${u.txid}:${u.vout}:${u.value}`).join("|");
|
|
61944
|
-
return (0,
|
|
62028
|
+
return (0, import_ethers23.keccak256)((0, import_ethers23.toUtf8Bytes)(canonical));
|
|
61945
62029
|
}
|
|
61946
62030
|
async function buildBtcExecuteEnvelope(params) {
|
|
61947
62031
|
const { positionId, txid, vout, satoshis, networkFee, chainId, signer } = params;
|
|
@@ -62368,7 +62452,7 @@ function rowToStatus(row) {
|
|
|
62368
62452
|
return row;
|
|
62369
62453
|
}
|
|
62370
62454
|
async function fetchProtocolPauseStatus(provider, positionManagerAddress) {
|
|
62371
|
-
const iface = new
|
|
62455
|
+
const iface = new import_ethers25.Interface(GET_PROTOCOL_PAUSE_STATUS_ABI);
|
|
62372
62456
|
const data = iface.encodeFunctionData("getProtocolPauseStatus", []);
|
|
62373
62457
|
const raw = await provider.call({ to: positionManagerAddress, data });
|
|
62374
62458
|
const decoded = iface.decodeFunctionResult("getProtocolPauseStatus", raw);
|
|
@@ -62558,38 +62642,38 @@ var ContractManager = class {
|
|
|
62558
62642
|
}
|
|
62559
62643
|
const contractRunner = runner;
|
|
62560
62644
|
const contracts = {
|
|
62561
|
-
positionManager: new
|
|
62645
|
+
positionManager: new import_ethers26.Contract(
|
|
62562
62646
|
contractAddresses.positionManager,
|
|
62563
62647
|
POSITION_MANAGER_ABI,
|
|
62564
62648
|
contractRunner
|
|
62565
62649
|
),
|
|
62566
|
-
loanOperationsManager: new
|
|
62567
|
-
contractAddresses.loanOperationsManager ||
|
|
62650
|
+
loanOperationsManager: new import_ethers26.Contract(
|
|
62651
|
+
contractAddresses.loanOperationsManager || import_ethers26.ZeroAddress,
|
|
62568
62652
|
LOAN_OPS_ABI,
|
|
62569
62653
|
contractRunner
|
|
62570
62654
|
),
|
|
62571
|
-
ucdController: new
|
|
62655
|
+
ucdController: new import_ethers26.Contract(
|
|
62572
62656
|
contractAddresses.ucdToken,
|
|
62573
62657
|
UCD_CONTROLLER_ABI,
|
|
62574
62658
|
contractRunner
|
|
62575
62659
|
),
|
|
62576
|
-
termManager: new
|
|
62577
|
-
contractAddresses.termManager ||
|
|
62660
|
+
termManager: new import_ethers26.Contract(
|
|
62661
|
+
contractAddresses.termManager || import_ethers26.ZeroAddress,
|
|
62578
62662
|
TERM_MANAGER_ABI,
|
|
62579
62663
|
contractRunner
|
|
62580
62664
|
),
|
|
62581
|
-
circuitBreaker: new
|
|
62582
|
-
contractAddresses.circuitBreaker ||
|
|
62665
|
+
circuitBreaker: new import_ethers26.Contract(
|
|
62666
|
+
contractAddresses.circuitBreaker || import_ethers26.ZeroAddress,
|
|
62583
62667
|
CIRCUIT_BREAKER_ABI,
|
|
62584
62668
|
contractRunner
|
|
62585
62669
|
),
|
|
62586
|
-
liquidationManager: new
|
|
62587
|
-
contractAddresses.liquidationManager ||
|
|
62670
|
+
liquidationManager: new import_ethers26.Contract(
|
|
62671
|
+
contractAddresses.liquidationManager || import_ethers26.ZeroAddress,
|
|
62588
62672
|
LIQUIDATION_MANAGER_ABI,
|
|
62589
62673
|
contractRunner
|
|
62590
62674
|
),
|
|
62591
|
-
bitcoinWithdrawalAddressRegistry: new
|
|
62592
|
-
contractAddresses.bitcoinWithdrawalAddressRegistry ||
|
|
62675
|
+
bitcoinWithdrawalAddressRegistry: new import_ethers26.Contract(
|
|
62676
|
+
contractAddresses.bitcoinWithdrawalAddressRegistry || import_ethers26.ZeroAddress,
|
|
62593
62677
|
BITCOIN_WITHDRAWAL_ADDRESS_REGISTRY_ABI,
|
|
62594
62678
|
contractRunner
|
|
62595
62679
|
)
|
|
@@ -62638,13 +62722,13 @@ var ContractManager = class {
|
|
|
62638
62722
|
const address = addresses[key];
|
|
62639
62723
|
if (!address) {
|
|
62640
62724
|
missing.push(String(key));
|
|
62641
|
-
} else if (!(0,
|
|
62725
|
+
} else if (!(0, import_ethers26.isAddress)(address)) {
|
|
62642
62726
|
invalid.push(String(key));
|
|
62643
62727
|
}
|
|
62644
62728
|
}
|
|
62645
62729
|
for (const key of optionalAddresses) {
|
|
62646
62730
|
const address = addresses[key];
|
|
62647
|
-
if (address && !(0,
|
|
62731
|
+
if (address && !(0, import_ethers26.isAddress)(address)) {
|
|
62648
62732
|
invalid.push(String(key));
|
|
62649
62733
|
}
|
|
62650
62734
|
}
|
|
@@ -63959,11 +64043,11 @@ var LoanCreator = class {
|
|
|
63959
64043
|
try {
|
|
63960
64044
|
const mainnetVaultAddress = bitcoinAddresses.mainnet;
|
|
63961
64045
|
const regtestVaultAddress = bitcoinAddresses.regtest;
|
|
63962
|
-
const pkpIdBytes32 = (0,
|
|
63963
|
-
(0,
|
|
64046
|
+
const pkpIdBytes32 = (0, import_ethers27.zeroPadValue)(
|
|
64047
|
+
(0, import_ethers27.toBeHex)(BigInt(pkpData.tokenId)),
|
|
63964
64048
|
32
|
|
63965
64049
|
);
|
|
63966
|
-
const pkpPublicKeyUncompressed =
|
|
64050
|
+
const pkpPublicKeyUncompressed = import_ethers27.SigningKey.computePublicKey(
|
|
63967
64051
|
pkpData.publicKey,
|
|
63968
64052
|
false
|
|
63969
64053
|
);
|
|
@@ -63976,7 +64060,7 @@ var LoanCreator = class {
|
|
|
63976
64060
|
);
|
|
63977
64061
|
log.debug(`BigInt conversion: ${BigInt(pkpData.tokenId).toString()}`);
|
|
63978
64062
|
log.debug(
|
|
63979
|
-
`Hex from BigInt: ${(0,
|
|
64063
|
+
`Hex from BigInt: ${(0, import_ethers27.toBeHex)(BigInt(pkpData.tokenId))}`
|
|
63980
64064
|
);
|
|
63981
64065
|
log.debug(`Final bytes32 (zero-padded): ${pkpIdBytes32}`);
|
|
63982
64066
|
log.debug(
|
|
@@ -64148,8 +64232,8 @@ var LoanCreator = class {
|
|
|
64148
64232
|
}
|
|
64149
64233
|
}
|
|
64150
64234
|
if (this.config.debug) {
|
|
64151
|
-
const pkpIdBytes32Check = (0,
|
|
64152
|
-
(0,
|
|
64235
|
+
const pkpIdBytes32Check = (0, import_ethers27.zeroPadValue)(
|
|
64236
|
+
(0, import_ethers27.toBeHex)(BigInt(pkpData.tokenId)),
|
|
64153
64237
|
32
|
|
64154
64238
|
);
|
|
64155
64239
|
log.error("\u274C Loan creation transaction failed", {
|
|
@@ -64310,7 +64394,7 @@ var LoanCreator = class {
|
|
|
64310
64394
|
const coreAddress = this.config.contractManager.getContractAddresses().positionManagerCore;
|
|
64311
64395
|
if (coreAddress) {
|
|
64312
64396
|
try {
|
|
64313
|
-
const core = new
|
|
64397
|
+
const core = new import_ethers27.Contract(
|
|
64314
64398
|
coreAddress,
|
|
64315
64399
|
[
|
|
64316
64400
|
"function getPositionDetails(bytes32) view returns (tuple(bytes32 positionId, bytes32 pkpId, uint256 ucdDebt, string vaultAddress, address borrower, uint40 createdAt, uint40 lastUpdated, uint16 selectedTerm, uint40 expiryAt, uint8 status))"
|
|
@@ -64352,8 +64436,8 @@ var LoanCreator = class {
|
|
|
64352
64436
|
const newEventAbi = [
|
|
64353
64437
|
"event PositionCreated(bytes32 indexed positionId, bytes32 indexed pkpId, address indexed borrower, uint256 requestedCollateralRatio, uint256 selectedTerm, uint256 expiryAt)"
|
|
64354
64438
|
];
|
|
64355
|
-
const oldIface = new
|
|
64356
|
-
const newIface = new
|
|
64439
|
+
const oldIface = new import_ethers27.Interface(oldEventAbi);
|
|
64440
|
+
const newIface = new import_ethers27.Interface(newEventAbi);
|
|
64357
64441
|
let positionId;
|
|
64358
64442
|
if (this.config.debug) {
|
|
64359
64443
|
log.info("\u{1F50D} Parsing transaction receipt logs", {
|
|
@@ -64833,7 +64917,7 @@ var LoanQuery = class {
|
|
|
64833
64917
|
const isChipotlePkpId2 = typeof rawId === "string" && isNormalizedChipotlePkpId(rawId);
|
|
64834
64918
|
if (isChipotlePkpId2) {
|
|
64835
64919
|
if (this.config.positionManagerCoreAddress && this.config.provider) {
|
|
64836
|
-
const pmContract = new
|
|
64920
|
+
const pmContract = new import_ethers28.Contract(
|
|
64837
64921
|
this.config.positionManagerCoreAddress,
|
|
64838
64922
|
POSITION_CORE_ABI,
|
|
64839
64923
|
this.config.provider
|
|
@@ -64936,7 +65020,7 @@ var LoanQuery = class {
|
|
|
64936
65020
|
*/
|
|
64937
65021
|
async getBorrowerUcdDebtSummary(borrower) {
|
|
64938
65022
|
const trimmed = typeof borrower === "string" ? borrower.trim() : "";
|
|
64939
|
-
if (!(0,
|
|
65023
|
+
if (!(0, import_ethers28.isAddress)(trimmed)) {
|
|
64940
65024
|
return failure(
|
|
64941
65025
|
new SDKError({
|
|
64942
65026
|
message: `Borrower must be an EVM address for a UCD debt summary, got "${trimmed}"`,
|
|
@@ -65211,7 +65295,7 @@ var WithdrawalAddressModule = class {
|
|
|
65211
65295
|
if (!res.success)
|
|
65212
65296
|
return res;
|
|
65213
65297
|
const target = res.value.target;
|
|
65214
|
-
if (!target || target ===
|
|
65298
|
+
if (!target || target === import_ethers29.ZeroAddress) {
|
|
65215
65299
|
return failure(
|
|
65216
65300
|
new SDKError({
|
|
65217
65301
|
code: "SDK_WITHDRAWAL_REGISTRY_NOT_CONFIGURED",
|
|
@@ -65233,7 +65317,7 @@ var WithdrawalAddressModule = class {
|
|
|
65233
65317
|
* @throws on mixed-case bech32, which has no canonical spelling (BIP-173).
|
|
65234
65318
|
*/
|
|
65235
65319
|
static addressHash(btcAddress2) {
|
|
65236
|
-
return (0,
|
|
65320
|
+
return (0, import_ethers29.keccak256)((0, import_ethers29.toUtf8Bytes)(normalizeBitcoinAddress(btcAddress2)));
|
|
65237
65321
|
}
|
|
65238
65322
|
/**
|
|
65239
65323
|
* The canonical spelling the registry keys on, or a VALIDATION failure for mixed-case
|
|
@@ -71313,7 +71397,7 @@ var _abi = [
|
|
|
71313
71397
|
];
|
|
71314
71398
|
var _bytecode = "0x60a080604052346100ea57306080527ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005460ff8160401c166100d9576002600160401b03196001600160401b03821601610073575b6040516149a190816100f08239608051818181612896015261298f0152f35b6001600160401b0319166001600160401b039081177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005581527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a13880610054565b63f92ee8a960e01b60005260046000fd5b600080fdfe6080604052600436101561001257600080fd5b6000803560e01c8062f7fce91461393b57806301ffc9a7146138ca578063021d2893146138715780630871b20614613838578063114249d214610f7b57806311d954f81461380f57806313da3166146137d65780631d44a9041461372d5780631f77bf65146136f4578063248a9ca3146136d55780632b83cccd146132285780632f2ff15d146131f657806334bac370146131bd57806334e181251461318457806336568abe1461313f578063373c86b6146131065780633f4ba83a1461303f5780634373b572146130165780634451e89b14612c425780634ebd25a514612c095780634f1ef286146129145780635273b6f6146128eb57806352d1902d14612883578063568fafca146127f557806359d5d02a146125485780635bc26aea146125135780635c975abb146124e35780635ecc2708146123c55780638456cb59146122ca57806385c15d9a1461229157806389d3ad00146121d95780638bff608e146121a05780639010d07c1461214d57806390ad8b401461213157806391d14854146120d85780639b759bf7146120955780639baf58d2146120785780639f1d0f59146119bd578063a217fddf146119a1578063a3246ad3146118e4578063ad3cb1cc1461189d578063b492fc69146117b2578063b9f637af14611587578063bf7d911914611548578063c55f15ea14611525578063ca15c873146114ee578063ca2ce65d146114b5578063cc1f8ffa14611483578063cf46075e14611379578063d21a74ff1461133c578063d2f8253614611319578063d511b2891461115c578063d547741f14611121578063d5d3f78b14610fb4578063d66bd52414610f7b578063e1f1c4a714610f5e578063e1f3962c14610f32578063ec2f96fe14610f0e578063eda5a26a14610b11578063f1a1eb8414610ace578063f385116d14610a95578063f77c479114610a6e578063f8c8765e1461067b578063f95ec0461461055f578063faaebd2114610526578063facdfb5e14610377578063fe32e7281461033e5763ffa1ad741461030857600080fd5b3461033b578060031936011261033b57610337610323613b97565b604051918291602083526020830190613b0c565b0390f35b80fd5b503461033b57602036600319011261033b576020906040906001600160a01b03610366613a23565b168152601283522054604051908152f35b503461033b57602036600319011261033b57610391613a23565b610399614059565b6010546001600160a01b03163303610517576001600160a01b03168082526002602052604082205460ff161561050557808252600760205260408220546040516370a0823160e01b8152306004820152602081602481865afa9081156104fa5784916104c3575b50818111156104b4576104138282613c9b565b821590811561045f575b5050600080516020614975833981519152916040918486526007602052808387205582519182526020820152a260016000805160206149158339815191525580f35b61271081029080820461271014901517156104a057606484029184830460641417156104a0571161049157388061041d565b63a73af74d60e01b8452600484fd5b634e487b7160e01b86526011600452602486fd5b6104be8183613c9b565b610413565b90506020813d6020116104f2575b816104de60209383613ab8565b810103126104ed575138610400565b600080fd5b3d91506104d1565b6040513d86823e3d90fd5b6374ed46ad60e01b8252600452602490fd5b6349db3bd360e01b8252600482fd5b503461033b57602036600319011261033b576020906040906001600160a01b0361054e613a23565b168152600483522054604051908152f35b503461033b5761056e36613b5d565b601054909392906001600160a01b0316330361066c576001600160a01b03168083526002602052604083205460ff161561065a57811561064b576001600160a01b0384161561063c5780835260076020526040832054936105cf8386613df7565b85811061062d576001600160ff1b03811161061e576000805160206149758339815191526040869785938461061b9952600760205280838b205582519182526020820152a23091614363565b80f35b630700fcb360e11b8552600485fd5b63446c8cc960e01b8552600485fd5b634e46966960e11b8352600483fd5b63162908e360e11b8352600483fd5b6374ed46ad60e01b8352600452602482fd5b6349db3bd360e01b8352600483fd5b503461033b57608036600319011261033b57610695613a23565b61069d613a39565b6044356001600160a01b03811690818103610a6a576064356001600160a01b0381169390849003610a665760008051602061495583398151915254604081901c60ff161595906001600160401b031680159081610a5e575b6001149081610a54575b159081610a4b575b50610a3c5760008051602061495583398151915280546001600160401b031916600117905585610a17575b6001600160a01b0316908115610a08576001600160a01b03169081156109f95783156109ea576107606145d1565b6107686145d1565b6107706145d1565b6107786145d1565b6001600080516020614915833981519152556107926145d1565b61079a6145d1565b86546001600160a01b0319908116919091178755600180549182168317905560405163313ce56760e01b8152909190602081600481855afa8891816109b9575b506107ee57633a24e95b60e11b8852600488fd5b6001600160a81b03199092161760a091821b60ff60a01b16176001819055901c60ff1660111981016109a75750610825818661448f565b8061097f575b1561093a576108488160008051602061493583398151915261448f565b80610949575b1561093a5761086b9060008051602061485583398151915261448f565b9081610903575b50156108f457806108c9575b506108865780f35b60ff60401b19600080516020614955833981519152541660008051602061495583398151915255600080516020614835833981519152602060405160018152a180f35b601080546001600160a01b03191682179055826000805160206148958339815191528180a33861087e565b63cf5a8e3360e01b8352600483fd5b6109339060008051602061485583398151915286526000805160206147f583398151915260205260408620614617565b5038610872565b63cf5a8e3360e01b8552600485fd5b60008051602061493583398151915286526000805160206147f58339815191526020526109798360408820614617565b5061084e565b8580526000805160206147f58339815191526020526109a18360408820614617565b5061082b565b63167738cf60e21b8652600452602485fd5b6109dc91925060203d6020116109e3575b6109d48183613ab8565b810190613cd8565b90386107da565b503d6109ca565b630b5eba9f60e41b8752600487fd5b63c1ab6dc160e01b8752600487fd5b6336abb4df60e11b8752600487fd5b600080516020614955833981519152805460ff60401b1916600160401b179055610732565b63f92ee8a960e01b8752600487fd5b90501538610707565b303b1591506106ff565b8791506106f5565b8580fd5b8480fd5b503461033b578060031936011261033b57546040516001600160a01b039091168152602090f35b503461033b57602036600319011261033b576020906040906001600160a01b03610abd613a23565b168152600a83522054604051908152f35b503461033b57604036600319011261033b576020906040906001600160a01b03610af6613a23565b16815260158352818120602435825283522054604051908152f35b503461033b5761016036600319011261033b57610b2c613a23565b90606435604435602435610b3e613b4d565b9160a4359160c43560e43561010435916101243595610144359760018060a01b03601054163303610eff576001600160a01b038c16808c52600260205260408c2054909a9060ff16610eeb578a15610edc578615610ecd576127108811610eb3576103e88111610e9b5760ff82169c60128e118e8115610e90575b50610e7c57803b15610e68578915610e54578a15610e405782610bdb916143a7565b84151580610e37575b610e205785151580610e17575b610e00578b9c602460208d9e9d604051928380926370a0823160e01b82523060048301525afa9c8d15610df4579c610dc0575b506001600160ff1b038c11610db1578a8d8f9760408f97838f918f8f8f8f90859f988f99879f966000805160206148b58339815191529f978b9f988f8d6000805160206148158339815191529f988e8e610d699b6000805160206147d58339815191529f8f8f8487526002602052878720600160ff198254161790558487526003602052878720558386526004602052868620558285526006602052878686205582855260056020528585209060ff19825416179055818452600c6020528885852055818452600d6020528985852055818452600e6020528a85852055818452600f6020528b8585205581845260076020528484205582526012602052828220558d8152601360205220558a7f991d1ef1b5c0820d213328cba6682059e00a50e49c469a454eb3557e78eaf6668e80518b81528c6020820152a28c5198899889613e04565b0390a28151908b82526020820152a28151908782526020820152a280610d8d578280f35b6040600080516020614975833981519152918151908582526020820152a281808280f35b63556e7a8160e01b8e5260048efd5b909b506020813d602011610dec575b81610ddc60209383613ab8565b810103126104ed57519a38610c24565b3d9150610dcf565b604051903d90823e3d90fd5b60448c858863dd85772b60e01b8352600452602452fd5b50838610610bf1565b60448c8487637449915760e01b8352600452602452fd5b50828510610be4565b636835314760e11b8d52600160045260248dfd5b636835314760e11b8d5260048d905260248dfd5b63377e3f9960e21b8d5260048c905260248dfd5b63ca95039160e01b8d5260048e905260248dfd5b60069150108e610bb9565b631051834f60e11b8c526004526103e860245260448bfd5b63c1e9a14160e01b8c52600488905261271060245260448cfd5b63a2ec3a5560e01b8c5260048cfd5b63df407ac560e01b8c5260048cfd5b6317f4215b60e21b8c5260048b905260248cfd5b6349db3bd360e01b8b5260048bfd5b503461033b578060031936011261033b57602060ff60015460a01c16604051908152f35b503461033b57602036600319011261033b576020610f56610f51613a23565b613f3c565b604051908152f35b503461033b578060031936011261033b5760206040516127108152f35b503461033b57602036600319011261033b576020906040906001600160a01b03610fa3613a23565b168152600783522054604051908152f35b503461033b57602036600319011261033b57610fce613a23565b6010546001600160a01b03163303610517576001600160a01b03168082526002602052604082205460ff161561050557808252600760205260408220548061110b575080825260026020526040822060ff1981541690558082526003602052816040812055808252600460205281604081205580825260056020526040822060ff198154169055808252600c602052816040812055808252600d602052816040812055808252600e602052816040812055808252600f602052816040812055808252600660205281604081205580825260076020526040822054818352600760205282604081205560405190827f3302a1b37f04242bb55603f5449e7ecd690a35eef08ba1353c48c20e2aae9cda8580a2806110e8578380f35b816040916000805160206149758339815191529352846020820152a23880808380f35b604492916376bc059760e11b8352600452602452fd5b503461033b57604036600319011261033b57611158600435611141613a39565b9061115361114e82613ca8565b6141cf565b614261565b5080f35b503461033b5761116b36613b5d565b601054909392906001600160a01b0316330361066c576001600160a01b03168083526002602052604083205490939060ff161561130557811561064b576011546001600160a01b03169384156112f6576001600160a01b0382169485156112e75760206024916040519283809263babcc53960e01b82528a60048301525afa9081156112dc5785916112ad575b501561129e57808452600760205260408420549483861061128757816000805160206149758339815191526040886112348861061b9a9b613c9b565b848b526007602052828b2055838a526007602052818a205482519182526020820152a2817f96d682bdcb144aea9bb235442364e98309db373ac793e4807c1b36f7062fe0136020604051878152a3614193565b6044858786633cb8e07360e01b8352600452602452fd5b63133307bb60e21b8452600484fd5b6112cf915060203d6020116112d5575b6112c78183613ab8565b810190613d8d565b386111f8565b503d6112bd565b6040513d87823e3d90fd5b634e46966960e11b8552600485fd5b630e048e7160e41b8452600484fd5b6374ed46ad60e01b83526004849052602483fd5b503461033b578060031936011261033b57602060ff600854166040519015158152f35b503461033b57602036600319011261033b5760209060ff906040906001600160a01b03611367613a23565b16815260058452205416604051908152f35b503461033b57602036600319011261033b57611393613a23565b61139b614059565b6010546001600160a01b03163303610517576001600160a01b03168082526002602052604082205460ff161561050557808252600760205260408220546040516370a0823160e01b8152306004820152602081602481865afa9081156104fa578491611443575b50600080516020614975833981519152916040918486526007602052808387205582519182526020820152a260016000805160206149158339815191525580f35b90506020813d60201161147b575b8161145e60209383613ab8565b810103126104ed5751600080516020614975833981519152611402565b3d9150611451565b503461033b57604036600319011261033b5760206114ab6114a2613a23565b60243590613e3d565b6040519015158152f35b503461033b57602036600319011261033b576020906040906001600160a01b036114dd613a23565b168152601383522054604051908152f35b503461033b57602036600319011261033b57604060209160043581526000805160206147f583398151915283522054604051908152f35b503461033b578060031936011261033b576020604051670de0b6b3a76400008152f35b503461033b57602036600319011261033b5760209060ff906040906001600160a01b03611573613a23565b168152600284522054166040519015158152f35b503461033b5761012036600319011261033b576115a2613a23565b60643591906044356024356115b5613b4d565b601054610104359660e4359260c4359260a43592906001600160a01b031633036117a3576001600160a01b038816808a52600260205260408a205490989060ff161561178f578615611780576127108811611766576103e8821161174c5760ff831690601282118015611742575b61172e5783611631916143a7565b85151580611725575b61170e578a151580611705575b6116ee57926000805160206147d583398151915297969592828c956116e8979460408e8e80825260036020528c8383205580825260046020528d838320558152600660205220558b8d52600560205260408d209060ff198254161790558a8c52600c6020528260408d20558a8c52600d6020528360408d20558a8c52600e6020528460408d20558a8c52600f6020528560408d205560405198899889613e04565b0390a280f35b60448a868d63dd85772b60e01b8352600452602452fd5b50848b10611647565b60448a8588637449915760e01b8352600452602452fd5b5083861061163a565b63ca95039160e01b8b52600482905260248bfd5b5060068210611623565b631051834f60e11b8a5260048290526103e860245260448afd5b63c1e9a14160e01b8a52600488905261271060245260448afd5b63a2ec3a5560e01b8a5260048afd5b6374ed46ad60e01b8a52600489905260248afd5b6349db3bd360e01b8952600489fd5b503461033b57604036600319011261033b576117cc613a23565b6001600160a01b0316808252600260205260408220546024359060ff161561188957801561064b5761271061184e604085670de0b6b3a764000061183d6118569688859a52600560205260ff858520541690809160128110611863575b505088845260036020528484205490613bba565b049581526004602052205484613bba565b048092613c9b565b9082519182526020820152f35b611882925060ff61187661187c92613c03565b16613c14565b90613bba565b3880611829565b6374ed46ad60e01b83526004829052602483fd5b503461033b578060031936011261033b5761033760408051906118c08183613ab8565b60058252640352e302e360dc1b602083015251918291602083526020830190613b0c565b503461033b57602036600319011261033b5760043581526000805160206147f583398151915260205260408120604051908160208254918281520190819285526020852090855b81811061198b5750505082611941910383613ab8565b604051928392602084019060208552518091526040840192915b818110611969575050500390f35b82516001600160a01b031684528594506020938401939092019160010161195b565b825484526020909301926001928301920161192b565b503461033b578060031936011261033b57602090604051908152f35b503461033b576119cc36613a5e565b9190926119d7614059565b6119df614095565b33815260096020526040812054430361205657338152600a60205260036040822054101561204757338152600a60205260408120611a1d8154613cc9565b90555b6001600160a01b0382168082526002602052604082205490929060ff16611fa6575b828252600260205260ff60408320541615611f93578415611f84578315611f7557828252600c60205260408220548510611f5057828252600e60205260408220548015611f4157808611611f2a575084611a9b916142a5565b6040516370a0823160e01b8152306004820152602081602481865afa908115611f1f578291611eed575b50611ad285303386614363565b6040516370a0823160e01b8152306004820152602081602481875afa908115611e0457908692918491611eb4575b5090611b0b91613c9b565b10611ea55781815260076020526040812054611b278582613df7565b818110611e96576001600160ff1b038111611e875760408492600080516020614975833981519152928486526007602052808387205582519182526020820152a2818152600560205260ff604082205416849060128110611e26575b50611ba4670de0b6b3a7640000918484526003602052604084205490613bba565b04908281526004602052612710611bbf604083205484613bba565b0491611bcb8382613c9b565b94808610611e0f57506001546040516318160ddd60e01b815290602090829060049082906001600160a01b03165afa908115611e04578391611dd2575b5082546001600160a01b0316803b15611db95783809160846040518094819363ae494fa160e01b83523360048401528c60248401528b60448401528d60648401525af180156104fa57908491611dbd575b505083611d49575b6001546040516318160ddd60e01b81529190602090839060049082906001600160a01b03165afa80156104fa578490611d15575b611c9f9250613c9b565b90808203611cff575050507fb3e2773606abfd36b5bd91394b3a54d1398336c65005baf7bf7a05efeffaf75b611ce2602095604051918291339588429285613d0c565b0390a3600160008051602061491583398151915255604051908152f35b632d8562a360e11b835260045260245260449150fd5b506020823d602011611d41575b81611d2f60209383613ab8565b810103126104ed57611c9f9151611c95565b3d9150611d22565b82546001600160a01b0316803b15611db95783809160846040518094819363ae494fa160e01b83523060048401528a60248401528b60448401528160648401525af180156104fa57908491611da0575b5050611c61565b81611daa91613ab8565b611db5578238611d99565b8280fd5b8380fd5b81611dc791613ab8565b611db5578238611c59565b90506020813d602011611dfc575b81611ded60209383613ab8565b810103126104ed575138611c08565b3d9150611de0565b6040513d85823e3d90fd5b6371c4efed60e01b83526004869052602452604482fd5b611e36915061187660ff91613c03565b8015611e735780600019048511611e6457611ba4611e5d670de0b6b3a76400009287613bba565b9150611b83565b63035fc53d60e41b8252600482fd5b634e487b7160e01b82526012600452602482fd5b630700fcb360e11b8352600483fd5b63446c8cc960e01b8352600483fd5b639bfa3c1760e01b8152600490fd5b919250506020813d602011611ee5575b81611ed160209383613ab8565b810103126104ed5751859190611b0b611b00565b3d9150611ec4565b90506020813d602011611f17575b81611f0860209383613ab8565b810103126104ed575138611ac5565b3d9150611efb565b6040513d84823e3d90fd5b631d7f2ac360e01b83526004869052602452604482fd5b633b5db2f360e11b8352600483fd5b50908152600c6020526040812054630d54e9e160e01b82526004849052602452604490fd5b632cd84af360e01b8252600482fd5b63162908e360e11b8252600482fd5b506024916374ed46ad60e01b8252600452fd5b60405163313ce56760e01b815291939291602081600481865afa859181612026575b50611fdc5763105482c760e21b8552600485fd5b93919293838352600560205260ff8060408520541691169081036120005750611a42565b90506044928252600560205260ff604083205416631e43476360e11b8352600452602452fd5b61204091925060203d6020116109e3576109d48183613ab8565b9038611fc8565b63a74c1c5f60e01b8152600490fd5b3381526009602052436040822055338152600a60205260016040822055611a20565b503461033b578060031936011261033b5760206040516103e88152f35b503461033b57604036600319011261033b576020906040906001600160a01b036120bd613a23565b16815260148352818120602435825283522054604051908152f35b503461033b57604036600319011261033b5760406120f4613a39565b9160043581526000805160206148d5833981519152602052209060018060a01b0316600052602052602060ff604060002054166040519015158152f35b503461033b578060031936011261033b57602060405160648152f35b503461033b57604036600319011261033b5761218760209160043581526000805160206147f58339815191528352604060243591206145ff565b905460405160039290921b1c6001600160a01b03168152f35b503461033b57602036600319011261033b576020906040906001600160a01b036121c8613a23565b168152600983522054604051908152f35b503461033b57604036600319011261033b576121f3613a23565b60105460243591906001600160a01b0316330361066c576001600160a01b03169081156122825760406000805160206148b58339815191529183855260136020528185205490848652601360205280838720558486526015602052828620438752602052828620548587526019602052838720558486526017602052438387205582519182526020820152a280f35b63df407ac560e01b8352600483fd5b503461033b57602036600319011261033b576020906040906001600160a01b036122b9613a23565b168152600383522054604051908152f35b503461033b578060031936011261033b5760008051602061485583398151915281526000805160206148d583398151915260209081526040808320336000908152925290205460ff16156123a057612320614095565b600160ff196000805160206148f58339815191525416176000805160206148f5833981519152557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a16040514281527f80170b5fcdd2bf1e0660ef4b8851f86685f64d41b1a19de1471947ece8725aac60203392a280f35b63e2517d3f60e01b815233600452600080516020614855833981519152602452604490fd5b503461033b57602036600319011261033b576123df613a23565b6000805160206149558339815191525460ff8160401c169081156124cb575b506124bc5760008051602061495583398151915280546001600160481b0319166003600160401b011790558180526000805160206148d583398151915260209081526040808420336000908152925290205460ff16156124a45761246190613da5565b60ff60401b19600080516020614955833981519152541660008051602061495583398151915255600080516020614835833981519152602060405160038152a180f35b63e2517d3f60e01b8252336004526024829052604482fd5b63f92ee8a960e01b8252600482fd5b60036001600160401b039190911610159050386123fe565b503461033b578060031936011261033b57602060ff6000805160206148f583398151915254166040519015158152f35b503461033b57602036600319011261033b5761252d613a23565b6010546001600160a01b031633036105175761061b90613da5565b503461033b57606036600319011261033b57612562613a23565b61256a613a39565b60105490926044359290916001600160a01b031633036105175761258c614095565b6011546001600160a01b03169182156127e65760405163babcc53960e01b81526001600160a01b0386166004820181905293602090829060249082905afa908115611f1f5782916127c7575b50156127b85782156127a9576001546001600160a01b03928316921682036126f9576040516370a0823160e01b8152306004820152602081602481865afa908115611f1f5782916126c7575b50935b84156126b85760001981036126b25750835b84156126a35780851161268b5750506126558360209583614193565b7f0bf519e4b3821615dbdd874fa1a5fbb4bb651b4e6beabedd4ac318e770233b2c604080518581524287820152a3604051908152f35b630555ed4f60e31b8252600485905260245260449150fd5b632e11316f60e11b8252600482fd5b93612639565b63f09872eb60e01b8252600482fd5b90506020813d6020116126f1575b816126e260209383613ab8565b810103126104ed575138612624565b3d91506126d5565b8181526002602052604081205460ff1615612797576040516370a0823160e01b8152306004820152602081602481865afa908115611f1f578291612765575b50828252600760205260408220548082111561275d5761275791613c9b565b93612627565b505080612757565b90506020813d60201161278f575b8161278060209383613ab8565b810103126104ed575138612738565b3d9150612773565b60249163eef7849760e01b8252600452fd5b634e46966960e11b8152600490fd5b63133307bb60e21b8152600490fd5b6127e0915060203d6020116112d5576112c78183613ab8565b386125d8565b630e048e7160e41b8152600490fd5b503461033b57602036600319011261033b5761280f613a23565b6010546001600160a01b03163303610517576001600160a01b0316801561287457601180546001600160a01b0319811683179091556001600160a01b03167f1e9c406f2707909cfd9f61e744f73bcab77e5997d063276f67883c5257d51cf08380a380f35b634e46966960e11b8252600482fd5b503461033b578060031936011261033b577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031630036128dc5760206040516000805160206148758339815191528152f35b63703e46dd60e11b8152600490fd5b503461033b578060031936011261033b576010546040516001600160a01b039091168152602090f35b50604036600319011261033b57612929613a23565b602435906001600160401b038211611db55736602383011215611db5578160040135908361295683613af1565b936129646040519586613ab8565b83855260208501933660248284010111611db557806024602093018637850101526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016308114908115612be6575b50612bd7576010546001600160a01b03163303612bc8576001600160a01b038116928315612bb957813b15612baa576000805160206148758339815191525484612a02613b97565b7f6ea8b34d59b2818d3f37a08dddaa06f5886b9c20c907b36f03ca6528e106e86f612a3860405192604084526040840190613b0c565b4260208401526001600160a01b038516929081900390a36040516352d1902d60e01b8152602081600481895afa879181612b72575b50612a8657634c9c8ce360e01b87526004869052602487fd5b908160008051602061487583398151915288979303612b605750833b15612b4c576001600160a01b0319168117600080516020614875833981519152558491907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8380a2805115612b31576111589382915190845af43d15612b29573d91612b0d83613af1565b92612b1b6040519485613ab8565b83523d85602085013e614753565b606091614753565b5050505034612b3d5780f35b63b398979f60e01b8152600490fd5b634c9c8ce360e01b86526004829052602486fd5b632a87526960e21b8752600452602486fd5b9091506020813d602011612ba2575b81612b8e60209383613ab8565b81010312612b9e57519038612a6d565b8780fd5b3d9150612b81565b636f7c43f160e01b8552600485fd5b63e6c4247b60e01b8552600485fd5b6349db3bd360e01b8452600484fd5b63703e46dd60e11b8452600484fd5b600080516020614875833981519152546001600160a01b031614159050386129ba565b503461033b57602036600319011261033b576020906040906001600160a01b03612c31613a23565b168152600e83522054604051908152f35b503461033b57606036600319011261033b57612c5c613a4f565b6024356001600160401b038111611db557612c7b903690600401613a88565b916044356001600160401b038111610a6a57612c9b903690600401613a88565b6000805160206149558339815191529291925460ff8160401c16908115612ffe575b50612fef5760008051602061495583398151915280546001600160481b0319166002600160401b0117905560008051602061493583398151915286526000805160206148d583398151915260209081526040808820336000908152925290205460ff1615612fca57612d2d6145d1565b612d356145d1565b600160008051602061491583398151915255600b549160ff8316612fbb57818603612fac57612d6386613d28565b92612d716040519485613ab8565b868452601f19612d8088613d28565b01366020860137875b878110612eb7575060019060ff191617600b5515159460ff196008541660ff871617600855865b818110612e1457876000805160206147b5833981519152602089604051908152a160ff60401b19600080516020614955833981519152541660008051602061495583398151915255600080516020614835833981519152602060405160028152a180f35b80886000805160206149758339815191526040612e3c612e37600196888d613d3f565b613d65565b612e4785898c613d3f565b357f8f955fa878b4aae8b1ac37b1ab715307470f2822ceff87e23d33ef1e044814a783612e74888d613d79565b5193898060a01b0316968793848252600660205280838320558482526007602052858383205582519182526020820152a28151908d82526020820152a201612db0565b612ec5612e37828a8a613d3f565b612ed0828689613d3f565b6001600160a01b03909116808b52600260205260408b20549091359060ff1615612f98576103e88111612f805750906020602492604051938480926370a0823160e01b82523060048301525afa8015612f75578a90612f3f575b60019250612f388288613d79565b5201612d89565b509060203d8111612f6e575b612f558183613ab8565b6020826000928101031261033b57509060019151612f2a565b503d612f4b565b6040513d8c823e3d90fd5b631051834f60e11b8b526004526103e860245260448afd5b6351104c5960e01b8b52600482905260248bfd5b63512509d360e11b8752600487fd5b6324d0d1fd60e01b8752600487fd5b63e2517d3f60e01b865233600452600080516020614935833981519152602452604486fd5b63f92ee8a960e01b8652600486fd5b60026001600160401b03919091161015905038612cbd565b503461033b578060031936011261033b576011546040516001600160a01b039091168152602090f35b503461033b578060031936011261033b576010546001600160a01b031633036130f7576000805160206148f58339815191525460ff8116156130e85760ff19166000805160206148f5833981519152557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a16040514281527f107553d8191d85b405879cf752997865edd48d94e20bda4dd27223c94b31a7cc60203392a280f35b638dfc202b60e01b8252600482fd5b6349db3bd360e01b8152600490fd5b503461033b57602036600319011261033b576020906040906001600160a01b0361312e613a23565b168152601683522054604051908152f35b503461033b57604036600319011261033b57613159613a39565b336001600160a01b038216036131755761115890600435614261565b63334bd91960e11b8252600482fd5b503461033b57602036600319011261033b576020906040906001600160a01b036131ac613a23565b168152600c83522054604051908152f35b503461033b57602036600319011261033b576020906040906001600160a01b036131e5613a23565b168152601783522054604051908152f35b503461033b57604036600319011261033b57611158600435613216613a39565b9061322361114e82613ca8565b614219565b503461033b5761323736613a5e565b919092613242614059565b61324a614095565b3381526009602052604081205443036136b357338152600a60205260036040822054101561204757338152600a602052604081206132888154613cc9565b90555b6001600160a01b0382168082526002602052604082205490929060ff16613638575b828252600260205260ff60408320541615611f935760ff6008541615613629578415611f84578315611f7557828252600d60205260408220548086106136125750828252600f60205260408220548015613603578086116135ed575084613313916140bf565b670de0b6b3a76400008402848104670de0b6b3a7640000036135d9578282526003602052604082205461334591613be3565b90828152600560205260ff604082205416601281106135b9575b508281526006602052612710613379604083205484613bba565b04916133858382613c9b565b94808610611e0f5750838252600760205280604083205410613596578382526007602052604082205490808210613587576040826133d3600080516020614975833981519152938895613c9b565b8486526007602052808387205582519182526020820152a26001546040516318160ddd60e01b815290602090829060049082906001600160a01b03165afa908115611f1f578291613551575b5081546001600160a01b0316803b15611db557826040518092633a52b90760e11b82528183816134538d3360048401613cf1565b03925af18015611e045761353c575b506001546040516318160ddd60e01b81529190602090839060049082906001600160a01b03165afa908115611e04578391613506575b6134a29250613c9b565b8581036134ee5750507f8caf04742286d017f9ac3924388e188c73e6e5094311c5e59a61a7ef86dda8bf611ce26020956134dd863387614193565b604051918291339588429285613d0c565b635ab6e2db60e01b8252600486905260245260449150fd5b90506020823d602011613534575b8161352160209383613ab8565b810103126104ed576134a2915190613498565b3d9150613514565b9161354a8160049394613ab8565b9190613462565b90506020813d60201161357f575b8161356c60209383613ab8565b8101031261357b57513861341f565b5080fd5b3d915061355f565b6308aed4ef60e31b8352600483fd5b83825260076020526040822054635960d22160e01b835260045260245260449150fd5b916135cc60ff6118766135d29495613c03565b90613be3565b903861335f565b634e487b7160e01b82526011600452602482fd5b625502a360e91b83526004869052602452604482fd5b636c6ff70d60e11b8352600483fd5b6361767b8560e01b83526004869052602452604482fd5b630df65d9f60e01b8252600482fd5b60405163313ce56760e01b815291939291602081600481865afa859181613692575b5061366e5763105482c760e21b8552600485fd5b93919293838352600560205260ff80604085205416911690810361200057506132ad565b6136ac91925060203d6020116109e3576109d48183613ab8565b903861365a565b3381526009602052436040822055338152600a6020526001604082205561328b565b503461033b57602036600319011261033b576020610f56600435613ca8565b503461033b57602036600319011261033b576020906040906001600160a01b0361371c613a23565b168152600f83522054604051908152f35b503461033b57604036600319011261033b57613747613a23565b60105460243591906001600160a01b0316330361066c576001600160a01b03169081156122825760406000805160206148158339815191529183855260126020528185205490848652601260205280838720558486526014602052828620438752602052828620548587526018602052838720558486526016602052438387205582519182526020820152a280f35b503461033b57602036600319011261033b576020906040906001600160a01b036137fe613a23565b168152600683522054604051908152f35b503461033b578060031936011261033b576001546040516001600160a01b039091168152602090f35b503461033b57602036600319011261033b576020906040906001600160a01b03613860613a23565b168152600d83522054604051908152f35b503461033b57602036600319011261033b5761388b613a4f565b6010546001600160a01b031633036105175760206000805160206147b583398151915291151560ff196008541660ff821617600855604051908152a180f35b503461033b57602036600319011261033b5760043563ffffffff60e01b811680910361357b57602090635a05180f60e01b8114908115613910575b506040519015158152f35b637965db0b60e01b81149150811561392a575b5082613905565b6301ffc9a760e01b14905082613923565b503461033b57604036600319011261033b57613955613a23565b6001600160a01b0316808252600260205260408220546024359060ff161561188957670de0b6b3a7640000810290808204670de0b6b3a76400001490151715613a0f57916139b160409383835260036020528483205490613be3565b91808252600560205260ff8483205416601281106139e6575b5061184e84836127109361185695526006602052205484613bba565b8461185693613a0461271094966135cc60ff61187661184e97613c03565b9593509350506139ca565b634e487b7160e01b83526011600452602483fd5b600435906001600160a01b03821682036104ed57565b602435906001600160a01b03821682036104ed57565b6004359081151582036104ed57565b60609060031901126104ed576004356001600160a01b03811681036104ed57906024359060443590565b9181601f840112156104ed578235916001600160401b0383116104ed576020808501948460051b0101116104ed57565b601f909101601f19168101906001600160401b03821190821017613adb57604052565b634e487b7160e01b600052604160045260246000fd5b6001600160401b038111613adb57601f01601f191660200190565b919082519283825260005b848110613b38575050826000602080949584010152601f8019910116010190565b80602080928401015182828601015201613b17565b6084359060ff821682036104ed57565b60609060031901126104ed576004356001600160a01b03811681036104ed5790602435906044356001600160a01b03811681036104ed5790565b60405190613ba6604083613ab8565b6005825264322e342e3160d81b6020830152565b81810292918115918404141715613bcd57565b634e487b7160e01b600052601160045260246000fd5b8115613bed570490565b634e487b7160e01b600052601260045260246000fd5b60ff166012039060ff8211613bcd57565b8015613c955760009060208110600116604e821060011617613c8d57600a916001915b60018111613c64575082600019048211613c5057500290565b634e487b7160e01b81526011600452602490fd5b92806000190481116135d95760018416613c84575b80029260011c613c37565b80920291613c79565b9050600a0a90565b50600190565b91908203918211613bcd57565b6000526000805160206148d583398151915260205260016040600020015490565b6000198114613bcd5760010190565b908160209103126104ed575160ff811681036104ed5790565b6001600160a01b039091168152602081019190915260400190565b9094939260609260808301968352602083015260408201520152565b6001600160401b038111613adb5760051b60200190565b9190811015613d4f5760051b0190565b634e487b7160e01b600052603260045260246000fd5b356001600160a01b03811681036104ed5790565b8051821015613d4f5760209160051b010190565b908160209103126104ed575180151581036104ed5790565b6001600160a01b03168015613de657601080546001600160a01b0319811683179091556001600160a01b0316600080516020614895833981519152600080a3565b63e6c4247b60e01b60005260046000fd5b91908201809211613bcd57565b94919360e0969360ff929a99989561010088019b885260208801526040870152166060850152608084015260a083015260c08201520152565b6001600160a01b03811660008181526002602052604090205490919060ff16158015613f2f575b8015613f27575b613f155781600052600f6020526040600020548015908115613f1d575b50613f1557613ead926040918251948592839262f7fce960e01b845260048401613cf1565b0381305afa918215613f0957600092613ed5575b506000526007602052604060002054101590565b9091506040813d604011613f01575b81613ef160409383613ab8565b810103126104ed57519038613ec1565b3d9150613ee4565b6040513d6000823e3d90fd5b505050600090565b9050831138613e88565b508215613e6b565b5060ff6008541615613e64565b6001546001600160a01b0391821691168103613fb1576020602491604051928380926370a0823160e01b82523060048301525afa908115613f0957600091613f82575090565b90506020813d602011613fa9575b81613f9d60209383613ab8565b810103126104ed575190565b3d9150613f90565b80600052600260205260ff60406000205416613fcd5750600090565b6040516370a0823160e01b815230600482015290602082602481845afa918215613f0957600092614025575b50600052600760205260406000205480821160001461401e5761401b91613c9b565b90565b5050600090565b90916020823d602011614051575b8161404060209383613ab8565b8101031261033b5750519038613ff9565b3d9150614033565b6002600080516020614915833981519152541461408457600260008051602061491583398151915255565b633ee5aeb560e01b60005260046000fd5b60ff6000805160206148f583398151915254166140ae57565b63d93c066560e01b60005260046000fd5b6001600160a01b0316600081815260136020526040902054801561418e578160005260156020526040600020436000526020526141026040600020549384613df7565b92831061417d5780826000526017602052436040600020541461415f575b831161414357506000526015602052604060002043600052602052604060002055565b925063029359d560e41b60005260045260245260445260646000fd5b5081600052601960205261417860406000205482613df7565b614120565b63446c8cc960e01b60005260046000fd5b505050565b6141c86141cd93926141ba60405194859263a9059cbb60e01b602085015260248401613cf1565b03601f198101845283613ab8565b614434565b565b60008181526000805160206148d58339815191526020908152604080832033845290915290205460ff16156142015750565b63e2517d3f60e01b6000523360045260245260446000fd5b614223828261448f565b918261422e57505090565b60009182526000805160206147f5833981519152602052604090912061425d916001600160a01b031690614617565b5090565b61426b8282614531565b918261427657505090565b60009182526000805160206147f5833981519152602052604090912061425d916001600160a01b031690614680565b6001600160a01b0316600081815260126020526040902054801561418e578160005260146020526040600020436000526020526142e86040600020549384613df7565b92831061417d57808260005260166020524360406000205414614345575b831161432957506000526014602052604060002043600052602052604060002055565b92506319a4e2a760e01b60005260045260245260445260646000fd5b5081600052601860205261435e60406000205482613df7565b614306565b6040516323b872dd60e01b60208201526001600160a01b0392831660248201529290911660448301526064808301939093529181526141cd916141c8608483613ab8565b60405163313ce56760e01b81529190602090839060049082906001600160a01b03165afa60009281614413575b506143ea57631eecbb6560e01b60005260046000fd5b60ff91821691168082036143fc575050565b631e43476360e11b60005260045260245260446000fd5b61442d91935060203d6020116109e3576109d48183613ab8565b91386143d4565b906000602091828151910182855af115613f09576000513d61448657506001600160a01b0381163b155b6144655750565b635274afe760e01b60009081526001600160a01b0391909116600452602490fd5b6001141561445e565b60008181526000805160206148d5833981519152602090815260408083206001600160a01b038616845290915290205460ff1661401e5760008181526000805160206148d5833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19166001179055339291907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a4600190565b60008181526000805160206148d5833981519152602090815260408083206001600160a01b038616845290915290205460ff161561401e5760008181526000805160206148d5833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19169055339291907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9080a4600190565b60ff6000805160206149558339815191525460401c16156145ee57565b631afcd79f60e31b60005260046000fd5b8054821015613d4f5760005260206000200190600090565b6001810190826000528160205260406000205415600014613f15578054600160401b811015613adb5761466b6146548260018794018555846145ff565b819391549060031b91821b91600019901b19161790565b90555491600052602052604060002055600190565b906001820191816000528260205260406000205480151560001461474a576000198101818111613bcd578254600019810191908211613bcd57818103614713575b505050805480156146fd5760001901906146db82826145ff565b8154906000199060031b1b191690555560005260205260006040812055600190565b634e487b7160e01b600052603160045260246000fd5b61473361472361465493866145ff565b90549060031b1c928392866145ff565b9055600052836020526040600020553880806146c1565b50505050600090565b90614779575080511561476857602081519101fd5b63d6bda27560e01b60005260046000fd5b815115806147ab575b61478a575090565b639996b31560e01b60009081526001600160a01b0391909116600452602490fd5b50803b1561478256fe2c0a5f5ab0ba371221bb3612c2d2f90d36566279309f526000c5b354efd1b0658c67aaac7f77de07240e5a9b36dfdccb2a89c438635abbb27a73142d2aa0f629c1f6fe24621ce81ec5827caf0253cadb74709b061630e6b55e8237170593200048b07fab687f450848f1df8a96db08fef7840f53415f18fdc2ec8e9f810f0930c7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d275027301df982f5215b4963a854cf9c73219df80cb6acd8f098189c9480c7bbc360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc17dc5b1290f7495d7f8cc68476e6941aaf510598fa925d0d2720edc8805a846c4460507c21097c15f6883572ebd157a9ee4b1d989a312314e93afd9d2ecd494002dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800cd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033009b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00a49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a006d129bd71f2401cbe77f49f546d7d5f58992faecfca6e51ba06b50b261e83331a164736f6c6343000822000a";
|
|
71315
71399
|
var isSuperArgs = (xs) => xs.length > 1;
|
|
71316
|
-
var SimplePSMV2__factory = class extends
|
|
71400
|
+
var SimplePSMV2__factory = class extends import_ethers30.ContractFactory {
|
|
71317
71401
|
constructor(...args) {
|
|
71318
71402
|
if (isSuperArgs(args)) {
|
|
71319
71403
|
super(...args);
|
|
@@ -71333,10 +71417,10 @@ var SimplePSMV2__factory = class extends import_ethers29.ContractFactory {
|
|
|
71333
71417
|
static bytecode = _bytecode;
|
|
71334
71418
|
static abi = _abi;
|
|
71335
71419
|
static createInterface() {
|
|
71336
|
-
return new
|
|
71420
|
+
return new import_ethers30.Interface(_abi);
|
|
71337
71421
|
}
|
|
71338
71422
|
static connect(address, runner) {
|
|
71339
|
-
return new
|
|
71423
|
+
return new import_ethers30.Contract(address, _abi, runner);
|
|
71340
71424
|
}
|
|
71341
71425
|
};
|
|
71342
71426
|
var _abi2 = [
|
|
@@ -73132,7 +73216,7 @@ var _abi2 = [
|
|
|
73132
73216
|
];
|
|
73133
73217
|
var _bytecode2 = "0x60a080604052346100ea57306080527ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005460ff8160401c166100d9576002600160401b03196001600160401b03821601610073575b60405161394690816100f082396080518181816112d4015261148b0152f35b6001600160401b0319166001600160401b039081177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005581527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a13880610054565b63f92ee8a960e01b60005260046000fd5b600080fdfe608080604052600436101561001357600080fd5b60003560e01c90816301ffc9a7146124f5575080630d33f3c2146124d15780630f3f4a94146124865780631459457a14611d3e57806318c38b8914611c2d5780631d44454114611b5c5780632106764c14611b35578063248a9ca314611b175780632ec22d4c14611a565780632f0647ce146119db5780632f2ff15d146119aa57806332420744146118d657806336568abe14611890578063392f10871461185a5780633f4ba83a146117625780633f5aadc9146116f35780634f1ef2861461143d57806352340363146113545780635273b6f61461132b57806352d1902d146112c1578063554c4f4b146112315780635bc26aea146111a45780635c975abb146111745780636289d18c146110f35780636711cc0b146110d75780636e852a7814610fd65780637e35bf6e14610fa25780638343f67414610f755780638456cb5914610e7f57806384b0196e14610d545780638c02cabd14610d2b5780638f33527f14610cf15780639010d07c14610c9d57806391d1485414610c435780639b9d30c114610c1a578063a19af3f614610b69578063a217fddf14610b4d578063a3246ad314610a8b578063a878086414610a6f578063ac3c0e3014610962578063ad3cb1cc1461091b578063b3fad63814610876578063b48d36de14610842578063c040b8ae14610726578063c34e9c261461070a578063c86deb31146106ee578063ca15c873146106b5578063d547741f1461067d578063dd71d99a1461063b578063e0922fa11461058e578063efa9b4ae1461051f578063f2f4eb26146104f6578063f68e9553146104cd578063f94f67ab146103f6578063fcc1f21a146102c05763ffa1ad741461028757600080fd5b346102bb5760003660031901126102bb576102b76102a3612780565b6040519182916020835260208301906126d1565b0390f35b600080fd5b346102bb576102ce366126f6565b91926102d8612e42565b6001600160a01b03851692338490036103e657836000526001602052604060002080549160ff8360e01c1660038110156103d0576001036103bf577fc5d5c5bbf10444998e0ea6d4725e79027b574e1c14ec929279e8a9a95c6c6e91948460016103a2946103498b6020998c613385565b818060a01b038316828060a01b03198254161781556103688b82612a4c565b0180546001600160401b031916426001600160401b03161790556001600160a01b0381166000818152600288526040902089905599613179565b6040516001600160401b0390951685526001600160a01b031693a4005b632437e77160e11b60005260046000fd5b634e487b7160e01b600052602160045260246000fd5b62fca64560e31b60005260046000fd5b346102bb5760403660031901126102bb576004356104126125c7565b9061041b612e42565b63ffffffff600554169163ffffffff8116928084109081156104c4575b506104b35760207f6b7727cc9c3df4a29acf0afe01594c1b7e845d20f40f4a14e4c292164a9ed8e19161046a84612e8d565b91610482600863ffffffff845460a01c1617836128c8565b81546001600160e01b031660e09190911b6001600160e01b0319161790556040519485526001600160a01b031693a3005b634346c13160e01b60005260046000fd5b90501584610438565b346102bb5760003660031901126102bb5760206040516000805160206138ba8339815191528152f35b346102bb5760003660031901126102bb576003546040516001600160a01b039091168152602090f35b346102bb5760203660031901126102bb5760043561053b612e42565b61055d61054782612e8d565b9190600163ffffffff825460a01c1617906128c8565b6001600160a01b0316907f812690e0a9dff5bf3add998111b8af5c8299608d859025bfe35662060ab4267d600080a3005b346102bb5760203660031901126102bb576004356001600160401b038116908181036102bb576000546001600160a01b038116330361062a57600160a01b600160e01b0319811660a092831b600160a01b600160e01b031617600055604080519190921c6001600160401b0316815260208101929092527f9c195448332abd01f716db873b329752ea02f19d33f7e311fb0daf082c4edd0391a1005b6349db3bd360e01b60005260046000fd5b346102bb5760203660031901126102bb576001600160a01b0361065c612578565b166000526002602052602060018060a01b0360406000205416604051908152f35b346102bb5760403660031901126102bb576106b360043561069c612562565b906106ae6106a9826128a7565b612d6c565b612dfe565b005b346102bb5760203660031901126102bb5760043560005260008051602061373a8339815191526020526020604060002054604051908152f35b346102bb5760003660031901126102bb57602060405160088152f35b346102bb5760003660031901126102bb57602060405160028152f35b346102bb57610734366126f6565b92909161073f612e42565b6001600160a01b03851693338590036103e65784600052600160205260406000209060ff825460e01c1660038110156103d057600114610831577ff223dc085722c94c84dcf67427e225799be616382a2a484d378f8921c69a2033948461081e936107ad866020988b613385565b80546001600160a01b0319166001600160a01b0383161781556107d08682612a4c565b6001810180546001600160801b031916426001600160401b0316179055805460ff60e01b1916600160e01b1790556001600160a01b0381166000818152600288526040902089905598613179565b6040516001600160401b039091168152a3005b639d2c8fdf60e01b60005260046000fd5b346102bb5760403660031901126102bb57602061086e610860612578565b610868612562565b90612984565b604051908152f35b346102bb5760203660031901126102bb57600060606040516108978161261e565b828152826020820152826040820152015260043560005260046020526080604060002063ffffffff604051916108cc8361261e565b548160018060a01b038216938481528160208201818560a01c16815260606040840193838760c01c168552019460e01c8552604051968752511660208601525116604084015251166060820152f35b346102bb5760003660031901126102bb576102b7604080519061093e8183612639565b60058252640352e302e360dc1b6020830152519182916020835260208301906126d1565b346102bb5760203660031901126102bb5761097b612578565b6000608060405161098b81612603565b828152826020820152826040820152826060820152015260018060a01b0316600052600160205260406000206040516109c381612603565b81546001600160a01b038116825260a081901c6001600160401b03166020830190815292604083019160e01c60ff169060038210156103d057908252600101546001600160401b0380821660608501908152604092831c821660808601908152925194516001600160a01b03168552945116602084015290519260038410156103d057604083019390935291516001600160401b0390811660608301529151909116608082015260a090f35b346102bb5760003660031901126102bb57602060405160018152f35b346102bb5760203660031901126102bb5760043560005260008051602061373a83398151915260205260406000206040518060208354918281520190819360005260206000209060005b818110610b375750505081610aeb910382612639565b6040519182916020830190602084525180915260408301919060005b818110610b15575050500390f35b82516001600160a01b0316845285945060209384019390920191600101610b07565b8254845260209093019260019283019201610ad5565b346102bb5760003660031901126102bb57602060405160008152f35b346102bb5760403660031901126102bb57600435610b856125c7565b90610b8e612e42565b63ffffffff600554169163ffffffff811692808410908115610c11575b506104b35760207f1da95b87b4c773f68c1447ffc5644e41a8a8887d55065beb64852014cf7140be91610bfe610be085612e8d565b9290610bf9600463ffffffff835460a01c1617826128c8565b6127f5565b6040519485526001600160a01b031693a3005b90501584610bab565b346102bb5760003660031901126102bb5760206040516000805160206137fa8339815191528152f35b346102bb5760403660031901126102bb57610c5c612562565b60043560005260008051602061389a83398151915260205260406000209060018060a01b0316600052602052602060ff604060002054166040519015158152f35b346102bb5760403660031901126102bb5760043560005260008051602061373a8339815191526020526020610cd86024356040600020613357565b905460405160039290921b1c6001600160a01b03168152f35b346102bb5760203660031901126102bb576001600160a01b03610d12612578565b1660005260026020526020604060002054604051908152f35b346102bb5760003660031901126102bb5760206040516000805160206137da8339815191528152f35b346102bb5760003660031901126102bb576000805160206137ba833981519152541580610e68575b15610e2b57610dcd610d8c6127a3565b610d946127d6565b6020610ddb60405192610da78385612639565b600084526000368137604051958695600f60f81b875260e08588015260e08701906126d1565b9085820360408701526126d1565b466060850152306080850152600060a085015283810360c085015281808451928381520193019160005b828110610e1457505050500390f35b835185528695509381019392810192600101610e05565b60405162461bcd60e51b81526020600482015260156024820152741152540dcc4c8e88155b9a5b9a5d1a585b1a5e9959605a1b6044820152606490fd5b5060008051602061391a8339815191525415610d7c565b346102bb5760003660031901126102bb573360009081527f0ac8cc3d209806126662940717264973110c39045b305f6ba49613325a615e09602052604090205460ff1615610f4e57610ecf612e42565b600160ff196000805160206138da8339815191525416176000805160206138da833981519152557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a16040514281527f80170b5fcdd2bf1e0660ef4b8851f86685f64d41b1a19de1471947ece8725aac60203392a2005b63e2517d3f60e01b600052336004526000805160206137fa83398151915260245260446000fd5b346102bb5760003660031901126102bb5760005460405160a09190911c6001600160401b03168152602090f35b346102bb5760403660031901126102bb57610fc6610fbe612562565b600435612951565b906102b760405192839283612598565b346102bb5760403660031901126102bb57610fef612578565b33600090815260008051602061383a833981519152602052604090205460ff1615806110c4575b6103e6576001600160a01b03166000818152600160205260409020805460e01c60ff1660038110156103d0576001036103bf57805460ff60e01b198116600160e11b1782556001919091018054600160401b600160801b03191642604090811b600160401b600160801b0316919091179091555160243581526001600160a01b0390911691907fc0499cc07ed9d734deec6857802d3f0fa8d5afaf79a7008beb8ba7bef62a271b90602090a3005b50336001600160a01b0382161415611016565b346102bb5760003660031901126102bb57602060405160048152f35b346102bb5760203660031901126102bb5761110c6125b4565b6000546001600160a01b0316330361062a5763ffffffff81169081156111635760008051602061387a8339815191529161115e63ffffffff926005549284198416176005556040519384931683612818565b0390a1005b6338f3377360e21b60005260046000fd5b346102bb5760003660031901126102bb57602060ff6000805160206138da83398151915254166040519015158152f35b346102bb5760203660031901126102bb576111bd612578565b6000546001600160a01b038116903382900361062a576001600160a01b038316928315611220573b1561120f576001600160a01b0319168217600090815560008051602061385a8339815191529080a3005b636f7c43f160e01b60005260046000fd5b63e6c4247b60e01b60005260046000fd5b346102bb5760203660031901126102bb576001600160a01b03611252612578565b166000526001602052604060002060ff6000805160206138da833981519152541615806112a5575b6020918161128e575b506040519015158152f35b5460a01c6001600160401b03164210905082611283565b5060ff815460e01c169060038210156103d0579060011461127a565b346102bb5760003660031901126102bb577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316300361131a57602060405160008051602061381a8339815191528152f35b63703e46dd60e11b60005260046000fd5b346102bb5760003660031901126102bb576000546040516001600160a01b039091168152602090f35b346102bb5760203660031901126102bb57600435604060008281526004602052209081549160018060a01b03831692831590811561142e575b5061141d5733600090815260008051602061383a833981519152602052604090205460ff161580611413575b61140257806113d563fffffffe6113db935460a01c16826128c8565b82612d48565b7fa5ffbdba01b15df97334e34ad816b9986b6057a5ddc97aba93b7e8ccd21759ed600080a3005b630a606ec360e11b60005260046000fd5b50823314156113b9565b6360eb6c2360e01b60005260046000fd5b6001915060a01c16158461138d565b60403660031901126102bb57611451612578565b6024356001600160401b0381116102bb57366023820112156102bb57611481903690602481600401359101612677565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163081149081156116d0575b5061131a576000546001600160a01b0316330361062a576001600160a01b03821691821561122057803b156116bf573083146116b05760008051602061381a8339815191525483611505612780565b7f6ea8b34d59b2818d3f37a08dddaa06f5886b9c20c907b36f03ca6528e106e86f61153b604051926040845260408401906126d1565b4260208401526001600160a01b038516929081900390a36040516352d1902d60e01b8152602081600481885afa6000918161167c575b5061158b5784634c9c8ce360e01b60005260045260246000fd5b908160008051602061381a8339815191528693036116685750823b15611653576001600160a01b031916811760008051602061381a833981519152557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a2815115611639576000808360206106b395519101845af43d15611631573d916116148361265c565b926116226040519485612639565b83523d6000602085013e61364d565b60609161364d565b50503461164257005b63b398979f60e01b60005260046000fd5b50634c9c8ce360e01b60005260045260246000fd5b632a87526960e21b60005260045260246000fd5b9091506020813d6020116116a8575b8161169860209383612639565b810103126102bb57519086611571565b3d915061168b565b614e8d60eb1b60005260046000fd5b632e07c4bd60e11b60005260046000fd5b60008051602061381a833981519152546001600160a01b031614159050836114b6565b346102bb5760203660031901126102bb5760043561170f612e42565b61173161171b82612e8d565b9190600263ffffffff825460a01c1617906128c8565b6001600160a01b0316907fc2713e691344add4705edc62a0ee5aede95ba66ad68f97316efef9cb50644edd600080a3005b346102bb5760003660031901126102bb5733600090815260008051602061383a833981519152602052604090205460ff161580611845575b611834576000805160206138da8339815191525460ff8116156118235760ff19166000805160206138da833981519152557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a16040514281527f107553d8191d85b405879cf752997865edd48d94e20bda4dd27223c94b31a7cc60203392a2005b638dfc202b60e01b60005260046000fd5b63659a07b360e11b60005260046000fd5b506000546001600160a01b031633141561179a565b346102bb5760403660031901126102bb576102b7611881611879612562565b6004356128eb565b604093919351938493846125da565b346102bb5760403660031901126102bb576118a9612562565b336001600160a01b038216036118c5576106b390600435612dfe565b63334bd91960e11b60005260046000fd5b346102bb5760203660031901126102bb57600435604060008281526004602052209081549160018060a01b03831692831590811561199b575b5061141d5733600090815260008051602061383a833981519152602052604090205460ff161580611991575b611402578061195763fffffff761196a935460a01c16826128c8565b80546001600160e01b0316815582612d48565b7f054490ec6650e07db9b97a06ea31d44cebd44b390c9975a380055e1b4d3cac21600080a3005b508233141561193b565b6008915060a01c16158461190f565b346102bb5760403660031901126102bb576106b36004356119c9612562565b906119d66106a9826128a7565b612db6565b346102bb5760203660031901126102bb57600435611a256119fb82612cd6565b9190611a1163fffffffb825460a01c16826128c8565b805463ffffffff60c01b1916815583612d48565b6001600160a01b0316907f09cb4ec44cdef8489412844b9682f87f7900758fa2bd7e039113e9125e538e0f600080a3005b346102bb5760203660031901126102bb57600435604060008281526004602052209081549160018060a01b038316928315908115611b08575b5061141d5733600090815260008051602061383a833981519152602052604090205460ff161580611afe575b61140257806113d563fffffffd611ad7935460a01c16826128c8565b7fb390ab029eab314bd18190ebe73d7e5c1c336beaa5c83ac22578378dc9ccc405600080a3005b5082331415611abb565b6002915060a01c161584611a8f565b346102bb5760203660031901126102bb57602061086e6004356128a7565b346102bb5760403660031901126102bb576102b7611881611b54612562565b60043561282f565b346102bb5760403660031901126102bb57600435611b786125c7565b63ffffffff600554169063ffffffff811691808310908115611c24575b506104b357611ba383612cd6565b909263ffffffff845460c01c16809260018060a01b03163314159182611c19575b5050611c0857611bf4827e8a218591d4362499c38c38eb1c12e7a7cc97a9068818d1fe6046a42ba4a5ba946127f5565b611c0360405192839283612818565b0390a2005b634e80a40760e11b60005260046000fd5b111590508186611bc4565b90501584611b95565b346102bb5760203660031901126102bb57611c466125b4565b6000805160206138fa8339815191525460ff8160401c16908115611d26575b50611d15576000805160206138fa833981519152805460026001600160401b0319821681179092556000546001600160481b031990911690911791906001600160a01b0316330361062a5763ffffffff1680156111635760408160008051602061387a8339815191529263ffffffff196005541617600555815190600082526020820152a16000805160206138fa8339815191525560008051602061377a833981519152602060405160028152a1005b63f92ee8a960e01b60005260046000fd5b60026001600160401b03919091161015905082611c65565b346102bb5760a03660031901126102bb57611d57612578565b611d5f612562565b604435906001600160a01b0382168083036102bb576064356001600160a01b038116918282036102bb576084356001600160a01b03811695908690036102bb576000805160206138fa83398151915254604081901c60ff161597906001600160401b03168015908161247e575b6001149081612474575b15908161246b575b50611d15576000805160206138fa83398151915280546001600160401b031916600117905587612446575b611e116131e0565b611e196131e0565b611e216131e0565b611e296131e0565b6001600160a01b038116908115611220578315611220578515611220576001600160a01b038716968715611220573b1561120f578584146124355762aa36a74614801561242a575b801561241f575b158061240d575b61120f57611e8e90600061320e565b90816123c6575b501561230b57611eb3906000805160206138ba83398151915261320e565b9081612371575b501561230b57611ed8906000805160206137fa83398151915261320e565b908161231c575b501561230b57600080546001600160a01b0319168217815560008051602061385a8339815191528180a3611f116127a3565b91611f1a6127d6565b91611f236131e0565b611f2b6131e0565b83516001600160401b0381116121e05760008051602061375a83398151915254600181811c91168015612301575b60208210146121c057601f8111612282575b50602094601f8211600114612201579481929394956000926121f6575b50508160011b916000199060031b1c19161760008051602061375a833981519152555b82516001600160401b0381116121e05760008051602061379a83398151915254600181811c911680156121d6575b60208210146121c057601f8111612141575b506020601f82116001146120c057819293946000926120b5575b50508160011b916000199060031b1c19161760008051602061379a833981519152555b60006000805160206137ba83398151915255600060008051602061391a83398151915255801561122057803b1561120f57600380546001600160a01b03191691909117905561207357005b60ff60401b196000805160206138fa83398151915254166000805160206138fa8339815191525560008051602061377a833981519152602060405160018152a1005b015190508480612005565b601f1982169060008051602061379a833981519152600052806000209160005b81811061212957509583600195969710612110575b505050811b0160008051602061379a83398151915255612028565b015160001960f88460031b161c191690558480806120f5565b9192602060018192868b0151815501940192016120e0565b81811115611feb5760008051602061379a833981519152600052601f820160051c7f5f9ce34815f8e11431c7bb75a8e6886a91478f7ffc1dbb0a98dc240fddd76b75602084106121b7575b81601f9101920160051c039060005b8281106121a9575050611feb565b60008282015560010161219b565b6000915061218c565b634e487b7160e01b600052602260045260246000fd5b90607f1690611fd9565b634e487b7160e01b600052604160045260246000fd5b015190508580611f88565b601f1982169560008051602061375a833981519152600052806000209160005b88811061226a57508360019596979810612251575b505050811b0160008051602061375a83398151915255611fab565b015160001960f88460031b161c19169055858080612236565b91926020600181928685015181550194019201612221565b81811115611f6b5760008051602061375a833981519152600052601f820160051c7f42ad5d3e1f2e6e70edcf6d991b8a3023d3fca8047a131592f9edb9fd9b89d57d602084106122f8575b81601f9101920160051c039060005b8281106122ea575050611f6b565b6000828201556001016122dc565b600091506122cd565b90607f1690611f59565b63cf5a8e3360e01b60005260046000fd5b6000805160206137fa83398151915260005260008051602061373a83398151915260205261236a907ffff5b43478fa6840382eb63777e0da6941d320b940e3f70f0ea4780feff9582761348a565b5084611edf565b6000805160206138ba83398151915260005260008051602061373a8339815191526020526123bf907f32d31393d541a265984ec379cddd8b1fcbe5f2b0eb8ad81dddfead454f135eaa61348a565b5086611eba565b6000805260008051602061373a833981519152602052612406907f615f0f9e84155bea8cc509fe18befeb1baf65611e38a6ba60964480fb29dfd4461348a565b5088611e95565b50823b1580611e7f5750843b15611e7f565b50617a694614611e78565b506105394614611e71565b638135316560e01b60005260046000fd5b6000805160206138fa833981519152805460ff60401b1916600160401b179055611e09565b90501589611dde565b303b159150611dd6565b899150611dcc565b346102bb5760403660031901126102bb576102b76124ba6124a5612562565b60043560005260046020526040600020612a75565b6124c38161258e565b604051918183921583612598565b346102bb5760003660031901126102bb57602063ffffffff60055416604051908152f35b346102bb5760203660031901126102bb576004359063ffffffff60e01b82168092036102bb57602091635a05180f60e01b8114908115612537575b5015158152f35b637965db0b60e01b811491508115612551575b5083612530565b6301ffc9a760e01b1490508361254a565b602435906001600160a01b03821682036102bb57565b600435906001600160a01b03821682036102bb57565b600811156103d057565b9015158152604081019291906020906125b08361258e565b0152565b6004359063ffffffff821682036102bb57565b6024359063ffffffff821682036102bb57565b91604091949363ffffffff916060850196151585526125f88161258e565b602085015216910152565b60a081019081106001600160401b038211176121e057604052565b608081019081106001600160401b038211176121e057604052565b601f909101601f19168101906001600160401b038211908210176121e057604052565b6001600160401b0381116121e057601f01601f191660200190565b9291926126838261265c565b916126916040519384612639565b8294818452818301116102bb578281602093846000960137010152565b60005b8381106126c15750506000910152565b81810151838201526020016126b1565b906020916126ea815180928185528580860191016126ae565b601f01601f1916010190565b60806003198201126102bb576004356001600160a01b03811681036102bb57916024356001600160a01b03811681036102bb57916044356001600160401b03811681036102bb57916064356001600160401b0381116102bb57826023820112156102bb576004810135926001600160401b0384116102bb57602484830101116102bb576024019190565b6040519061278f604083612639565b60058252640332e302e360dc1b6020830152565b604051906127b2604083612639565b6015825274111a585b5bdb9912185b991ccb941c9bdd1bd8dbdb605a1b6020830152565b604051906127e5604083612639565b60018252603160f81b6020830152565b805463ffffffff60c01b191660c09290921b63ffffffff60c01b16919091179055565b63ffffffff91821681529116602082015260400190565b600052600460205261284660406000209182612b32565b61284f8161258e565b8061289d57505460e01c63ffffffff6005541681158015612895575b6128885780821061288157505b60019160009190565b9050612878565b5050600090600390600090565b50801561286b565b6000929091508290565b60005260008051602061389a83398151915260205260016040600020015490565b805463ffffffff60a01b191660a09290921b63ffffffff60a01b16919091179055565b919091600052600460205261290560406000209283612bbe565b9161290f8361258e565b826129475763ffffffff9192505460c01c1663ffffffff60055416811580156128955761288857808210612881575060019160009190565b5060009190600090565b906129689160005260046020526040600020612c4a565b6129718161258e565b8061297f5750600190600090565b600091565b6042916040519060208201926000805160206137da833981519152845260018060a01b0316604083015260018060a01b03166060820152606081526129ca608082612639565b5190206129d56136ae565b6129dd613706565b6040519060208201927f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f8452604083015260608201524660808201523060a082015260a08152612a2e60c082612639565b519020906040519161190160f01b8352600283015260228201522090565b8054600160a01b600160e01b03191660a09290921b600160a01b600160e01b0316919091179055565b60ff6000805160206138da8339815191525416612b2b57546001600160a01b038116908115612b235760a01c60021615612b1c5760005260016020526040600020549060ff8260e01c1660038110156103d0578015612b1457600214612b0d574260a083901c6001600160401b03161115612b06576001600160a01b03908116911603612b0157600090565b600790565b5050600690565b5050600590565b505050600490565b5050600390565b505050600290565b5050600190565b60ff6000805160206138da8339815191525416612b2b57546001600160a01b038116908115612b235760a01c60081615612b1c5760005260016020526040600020549060ff8260e01c1660038110156103d0578015612b1457600214612b0d574260a083901c6001600160401b03161115612b06576001600160a01b03908116911603612b0157600090565b60ff6000805160206138da8339815191525416612b2b57546001600160a01b038116908115612b235760a01c60041615612b1c5760005260016020526040600020549060ff8260e01c1660038110156103d0578015612b1457600214612b0d574260a083901c6001600160401b03161115612b06576001600160a01b03908116911603612b0157600090565b60ff6000805160206138da8339815191525416612b2b57546001600160a01b038116908115612b235760a01c60011615612b1c5760005260016020526040600020549060ff8260e01c1660038110156103d0578015612b1457600214612b0d574260a083901c6001600160401b03161115612b06576001600160a01b03908116911603612b0157600090565b6000908152600460205260409020805490916001600160a01b038216918215908115612d39575b5061141d5733600090815260008051602061383a833981519152602052604090205460ff161580612d2f575b61140257565b5081331415612d29565b6004915060a01c161538612cfd565b905460a01c63ffffffff1615612d5b5750565b600052600460205260006040812055565b600081815260008051602061389a8339815191526020908152604080832033845290915290205460ff1615612d9e5750565b63e2517d3f60e01b6000523360045260245260446000fd5b612dc0828261320e565b9182612dcb57505090565b600091825260008051602061373a8339815191526020526040909120612dfa916001600160a01b03169061348a565b5090565b612e0882826132b7565b9182612e1357505090565b600091825260008051602061373a8339815191526020526040909120612dfa916001600160a01b0316906134fb565b60ff6000805160206138da8339815191525416612e5b57565b63d93c066560e01b60005260046000fd5b519064ffffffffff821682036102bb57565b519061ffff821682036102bb57565b801561316857600354604051638d34875560e01b8152600481018390529190600090839060249082906001600160a01b03165afa91821561315c57600092612fb1575b5060808201516001600160a01b03169133839003611402576101200151612ef68161258e565b612eff8161258e565b60038114908115612f9c575b8115612f88575b50612f775781600052600160205260ff60406000205460e01c1660038110156103d057600103612f6657600090815260046020526040902080546001600160a01b0319166001600160a01b03831617815591565b632e68d1d360e21b60005260046000fd5b63e9f6db8560e01b60005260046000fd5b60079150612f958161258e565b1438612f12565b9050612fa78161258e565b6005811490612f0b565b90913d8082843e612fc28184612639565b82019160208184031261313c578051906001600160401b0382116131445701906101a08284031261313957604051926101a084016001600160401b038111858210176131485760409081528351855260208085015190860152838101519085015260608301516001600160401b03811161314457830181601f820112156131445780519061304f8261265c565b9261305d6040519485612639565b82845260208383010111613140579061307c91602080850191016126ae565b606084015260808201516001600160a01b038116810361313c5760808401526130a760a08301612e6c565b60a08401526130b860c08301612e6c565b60c08401526130c960e08301612e7e565b60e08401526130db6101008301612e6c565b610100840152610120820151906008821015613139575061312c916101809161012085015261310d6101408201612e6c565b6101408501526131206101608201612e7e565b61016085015201612e6c565b6101808201529038612ed0565b80fd5b5080fd5b8380fd5b8280fd5b634e487b7160e01b83526041600452602483fd5b6040513d6000823e3d90fd5b637bb0b62160e01b60005260046000fd5b61319b9261318d8361319593969496612984565b923691612677565b9061344e565b5060048110156103d05715918215926131c8575b50506131b757565b63cacba36560e01b60005260046000fd5b6001600160a01b0391821691161415905038806131af565b60ff6000805160206138fa8339815191525460401c16156131fd57565b631afcd79f60e31b60005260046000fd5b600081815260008051602061389a833981519152602090815260408083206001600160a01b038616845290915290205460ff166132b057600081815260008051602061389a833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19166001179055339291907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a4600190565b5050600090565b600081815260008051602061389a833981519152602090815260408083206001600160a01b038616845290915290205460ff16156132b057600081815260008051602061389a833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19169055339291907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9080a4600190565b805482101561336f5760005260206000200190600090565b634e487b7160e01b600052603260045260246000fd5b15801561343d575b611220576001600160a01b031660009081526002602052604090205461342c576001600160401b03164281111561341b5760005460a01c6001600160401b031680151591826133f0575b50506133df57565b63e774e7b560e01b60005260046000fd5b909150428103908111613405571138806133d7565b634e487b7160e01b600052601160045260246000fd5b63efa7aefd60e01b60005260046000fd5b633b53f64f60e21b60005260046000fd5b506001600160a01b0381161561338d565b815191906041830361347f5761347892506020820151906060604084015193015160001a906135ce565b9192909190565b505060009160029190565b60018101908260005281602052604060002054156000146134f3578054600160401b8110156121e0576134de6134c7826001879401855584613357565b819391549060031b91821b91600019901b19161790565b90555491600052602052604060002055600190565b505050600090565b90600182019181600052826020526040600020548015156000146135c55760001981018181116134055782546000198101919082116134055781810361358e575b505050805480156135785760001901906135568282613357565b8154906000199060031b1b191690555560005260205260006040812055600190565b634e487b7160e01b600052603160045260246000fd5b6135ae61359e6134c79386613357565b90549060031b1c92839286613357565b90556000528360205260406000205538808061353c565b50505050600090565b91906fa2a8918ca85bafe22016d0b997e4df60600160ff1b038411613641579160209360809260ff60009560405194855216868401526040830152606082015282805260015afa1561315c576000516001600160a01b038116156136355790600090600090565b50600090600190600090565b50505060009160039190565b90613673575080511561366257602081519101fd5b63d6bda27560e01b60005260046000fd5b815115806136a5575b613684575090565b639996b31560e01b60009081526001600160a01b0391909116600452602490fd5b50803b1561367c565b6136b66127a3565b80519081156136c6576020012090565b50506000805160206137ba8339815191525480156136e15790565b507fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47090565b61370e6127d6565b805190811561371e576020012090565b505060008051602061391a8339815191525480156136e1579056fec1f6fe24621ce81ec5827caf0253cadb74709b061630e6b55e82371705932000a16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d102c7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2a16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d103a16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d1002b26bde9d050a2447879fc2826d068ca8d51a693da5ddde56556964c09fea96875027301df982f5215b4963a854cf9c73219df80cb6acd8f098189c9480c7bbc360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc07966f2ab141347034724e9b2a472c2f77f5cd745aeba27cacba797b8fcb708617dc5b1290f7495d7f8cc68476e6941aaf510598fa925d0d2720edc8805a846cd37bc77615afefc793aa17d75d4249a9b517ba91b0e54a49c9c4a44b3d7e228302dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800edcc084d3dcd65a1f7f23c65c46722faca6953d28e43150a467cf43e5c309238cd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00a16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d101a164736f6c6343000822000a";
|
|
73134
73218
|
var isSuperArgs2 = (xs) => xs.length > 1;
|
|
73135
|
-
var AgentDelegationRegistry__factory = class extends
|
|
73219
|
+
var AgentDelegationRegistry__factory = class extends import_ethers31.ContractFactory {
|
|
73136
73220
|
constructor(...args) {
|
|
73137
73221
|
if (isSuperArgs2(args)) {
|
|
73138
73222
|
super(...args);
|
|
@@ -73152,10 +73236,10 @@ var AgentDelegationRegistry__factory = class extends import_ethers30.ContractFac
|
|
|
73152
73236
|
static bytecode = _bytecode2;
|
|
73153
73237
|
static abi = _abi2;
|
|
73154
73238
|
static createInterface() {
|
|
73155
|
-
return new
|
|
73239
|
+
return new import_ethers31.Interface(_abi2);
|
|
73156
73240
|
}
|
|
73157
73241
|
static connect(address, runner) {
|
|
73158
|
-
return new
|
|
73242
|
+
return new import_ethers31.Contract(
|
|
73159
73243
|
address,
|
|
73160
73244
|
_abi2,
|
|
73161
73245
|
runner
|
|
@@ -75333,7 +75417,7 @@ var _abi3 = [
|
|
|
75333
75417
|
];
|
|
75334
75418
|
var _bytecode3 = "0x60a080604052346100ea57306080527ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005460ff8160401c166100d9576002600160401b03196001600160401b03821601610073575b604051615a7e90816100f0823960805181818161197e01526125180152f35b6001600160401b0319166001600160401b039081177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005581527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a13880610054565b63f92ee8a960e01b60005260046000fd5b600080fdfe608080604052600436101561001357600080fd5b60003560e01c90816301ffc9a71461358e57508063033b66ba1461334d5780630d8e6e2c146102be5780630e0b21cc146131b25780631317cb371461300857806316efd94114612fdf5780631ef3a04c14612fb65780631f4cceff14612f9a57806320af137a14612ee657806323be345c14612ebd578063248a9ca314612e9757806329b6eca914612d805780632a6bc2dd14612c1b5780632f2ff15d14612bea57806336568abe14612ba4578063393d92cc14612b7b5780633c2ef15a14612b245780633f4ba83a14612a6b5780634a26bd95146127935780634a54e00a1461276a5780634f1ef286146124ca5780634f27e7fa1461244157806350c1d19d146119fe5780635273b6f6146119d557806352d1902d1461196b57806353f366c7146118e45780635760f2e31461185b57806358ca3941146118295780635bc26aea146117f55780635c975abb146117c5578063650e5cb41461140a5780636aa6c53f1461119a57806371b2f19c1461110057806375b238fc146110d757806376dc71be14611054578063791b98bc1461102b5780638456cb5914610f355780638b1702fc14610f1a5780639010d07c14610ec657806391d1485414610e6c57806392efff1614610de85780639b9d30c114610dbf5780639cfee37f14610d40578063a217fddf14610d24578063a3246ad314610c62578063a69a9ef714610936578063ad3cb1cc14610c1b578063b49cc29514610bf2578063bdc7647214610bd5578063ca15c87314610b9c578063cf786fc014610b2e578063d547741f14610af6578063dc5632531461093b578063e1f1c4a714610936578063e34ad47b1461089c578063eb33b7501461084d578063eb8c8d411461081d578063f2f4eb26146107f4578063f5e95acb14610321578063fd847e01146102f75763ffa1ad74146102be57600080fd5b346102f25760003660031901126102f2576102ee6102da613922565b60405191829160208352602083019061361e565b0390f35b600080fd5b346102f25760203660031901126102f2576040610315600435614d3f565b82519182526020820152f35b346102f2576101203660031901126102f25761033b61368d565b6103436136a3565b906044356001600160a01b038116908190036102f2576064356001600160a01b038116908190036102f2576084356001600160a01b03811692908390036102f25760a4356001600160a01b03811692908390036102f25760c4356001600160a01b038116949093908585036102f25760e4356001600160a01b03811693908490036102f257610104356001600160a01b038116999095908a87036102f257600080516020615a5283398151915254604081901c60ff16159a906001600160401b0316801590816107ec575b60011490816107e2575b1590816107d9575b506107c857600080516020615a5283398151915280546001600160401b03191660011790558a6107a3575b610453615746565b61045b615746565b610463615746565b61046b615746565b610473615746565b60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f005561049f615746565b6001600160a01b0316908115610792576001600160a01b0316908115610792578215610792578315610792578415610792578515610792578915610792578615610792578b156107925760018060a01b0319600554161760055560018060a01b0319600054161760005560018060a01b0319600154161760015560018060a01b0319600254161760025560018060a01b0319600354161760035560018060a01b0319600454161760045560018060a01b0319600654161760065561056482600061551b565b8061074c575b1561063e5761058782600080516020615a3283398151915261551b565b806106f8575b1561063e576105aa9060008051602061591283398151915261551b565b806106a4575b1561063e576105cd9060008051602061599283398151915261551b565b908161064f575b501561063e57600780546001600160a01b031916831790556040519160006000805160206159d28339815191528180a361060a57005b600080516020615a52833981519152805460ff60401b191690556001815260008051602061597283398151915290602090a1005b63cf5a8e3360e01b60005260046000fd5b60008051602061599283398151915260005260008051602061593283398151915260205261069d907ffff5b43478fa6840382eb63777e0da6941d320b940e3f70f0ea4780feff95827615774565b50836105d4565b6000805160206159128339815191526000526000805160206159328339815191526020526106f2857fdb30a1288f67da8a7b16afbbe7b3c5ab0a7a441f62fe00f878d5fff64f32a697615774565b506105b0565b600080516020615a32833981519152600052600080516020615932833981519152602052610746847f46448fd7a7b40360a1323cb3199d0aafeb92ce905bb512a6bb7d3d3f685cf1b1615774565b5061058d565b6000805260008051602061593283398151915260205261078c847f615f0f9e84155bea8cc509fe18befeb1baf65611e38a6ba60964480fb29dfd44615774565b5061056a565b63e6c4247b60e01b60005260046000fd5b600080516020615a52833981519152805460ff60401b1916600160401b17905561044b565b63f92ee8a960e01b60005260046000fd5b9050158d610420565b303b159150610418565b8c915061040e565b346102f25760003660031901126102f2576000546040516001600160a01b039091168152602090f35b346102f25760003660031901126102f2576060610838614c7d565b90604051921515835260208301526040820152f35b346102f25760603660031901126102f25761088d61087961086c61368d565b6044359060243590614aca565b6040519384936060855260608501906136b9565b91602084015260408301520390f35b346102f25760006108ac366136ed565b825460405163e34ad47b60e01b815260048101939093526024830191909152909190829060449082906001600160a01b03165afa801561092a576102ee91600091610907575b506040519182916020835260208301906136b9565b61092491503d806000833e61091c8183613756565b810190613b5b565b826108f2565b6040513d6000823e3d90fd5b613905565b346102f25760203660031901126102f257600061018060405161095d8161373a565b8281528260208201528260408201526060808201528260808201528260a08201528260c08201528260e08201528261010082015282610120820152826101408201528261016082015201526024600060018060a01b0381541660405192838092638d34875560e01b825260043560048301525afa90811561092a57600091610ad5575b506080810180519091906001600160a01b031615610ac4576101809164ffffffffff60405193849360208552805160208601526020810151604086015260408101516060860152610a4260608201516101a060808801526101c087019061361e565b9360018060a01b0390511660a08601528260a08201511660c08601528260c08201511660e086015261ffff60e0820151166101008601528261010082015116610120860152610a9b610120820151610140870190613680565b826101408201511661016086015261ffff61016082015116828601520151166101a08301520390f35b636ec9be1160e01b60005260046000fd5b610af0913d8091833e610ae88183613756565b810190613a0a565b816109e0565b346102f25760403660031901126102f257610b2c600435610b156136a3565b90610b27610b2282613bf4565b6150c2565b615154565b005b346102f25760203660031901126102f257610b4a600435614942565b9060405191829160408301901515835260406020840152815180915260206060840192019060005b818110610b80575050500390f35b825160ff16845285945060209384019390920191600101610b72565b346102f25760203660031901126102f2576004356000526000805160206159328339815191526020526020604060002054604051908152f35b346102f25760003660031901126102f25760206040516161a88152f35b346102f25760003660031901126102f25760206040516000805160206159128339815191528152f35b346102f25760003660031901126102f2576102ee6040805190610c3e8183613756565b60058252640352e302e360dc1b60208301525191829160208352602083019061361e565b346102f25760203660031901126102f25760043560005260008051602061593283398151915260205260406000206040518060208354918281520190819360005260206000209060005b818110610d0e5750505081610cc2910382613756565b6040519182916020830190602084525180915260408301919060005b818110610cec575050500390f35b82516001600160a01b0316845285945060209384019390920191600101610cde565b8254845260209093019260019283019201610cac565b346102f25760003660031901126102f257602060405160008152f35b346102f2576101603660031901126102f257610144356001600160401b0381116102f257366023820112156102f2576004810135906001600160401b0382116102f25736602483830101116102f2576102ee9160246102da9201610124356101043560e43560c43560a435608435606435604435602435600435613f04565b346102f25760003660031901126102f25760206040516000805160206159928339815191528152f35b346102f25760203660031901126102f2576024602060018060a01b036004541660405192838092634977ff8b60e11b825260043560048301525afa801561092a57602091600091610e3f575b506040519015158152f35b610e5f9150823d8411610e65575b610e578183613756565b810190613cc4565b82610e34565b503d610e4d565b346102f25760403660031901126102f257610e856136a3565b6004356000526000805160206159f283398151915260205260406000209060018060a01b0316600052602052602060ff604060002054166040519015158152f35b346102f25760403660031901126102f2576004356000526000805160206159328339815191526020526020610f0160243560406000206156ec565b905460405160039290921b1c6001600160a01b03168152f35b346102f25760003660031901126102f2576040610315613e12565b346102f25760003660031901126102f2573360009081527f0ac8cc3d209806126662940717264973110c39045b305f6ba49613325a615e09602052604090205460ff161561100457610f85615198565b600160ff19600080516020615a12833981519152541617600080516020615a12833981519152557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a16040514281527f80170b5fcdd2bf1e0660ef4b8851f86685f64d41b1a19de1471947ece8725aac60203392a2005b63e2517d3f60e01b6000523360045260008051602061599283398151915260245260446000fd5b346102f25760003660031901126102f2576005546040516001600160a01b039091168152602090f35b346102f25760003660031901126102f257600054604051633b6e38df60e11b815290602090829060049082906001600160a01b03165afa801561092a576000906110a4575b602090604051908152f35b506020813d6020116110cf575b816110be60209383613756565b810103126102f25760209051611099565b3d91506110b1565b346102f25760003660031901126102f2576020604051600080516020615a328339815191528152f35b346102f25760203660031901126102f25761111961368d565b6007546001600160a01b0316330361118957611133615198565b6001600160a01b0316801561079257600180546001600160a01b0319811683179091553391906001600160a01b03167fa06737e7750a5964f26df32519f3270980324efe72b046924980308f0c0fa45f600080a4005b6349db3bd360e01b60005260046000fd5b346102f25760603660031901126102f2576004356001600160401b0381116102f2576111ca9036906004016137ec565b60243590604435918215928315036102f2576101208201519260088410156113f4576002600094146112ac575b50600c810361127f575061121f6101009164ffffffffff6301e133809384925b015116613be7565b4281111561127057611232904290613e05565b8160011b918083046002149015171561125c571161124d5780f35b6309116a8160e11b8152600490fd5b634e487b7160e01b83526011600452602483fd5b6309116a8160e11b8352600483fd5b62278d0081029080820462278d00149015171561125c576101009164ffffffffff61121f92938492611217565b61010083019064ffffffffff825116421161139057156111f75761018083015164ffffffffff16806113e8575064ffffffffff8060a0850151165b1661ffff60e085015116600c81146000146113b0575064ffffffffff6301e13380925b511682808211156113a75761131e91613e05565b905b8082111561139f5750905b4282116113905762278d008111156113855762278cff1981019081116113715761135790915b42613e05565b1061136257836111f7565b63088502f160e21b8352600483fd5b634e487b7160e01b85526011600452602485fd5b506113578491611351565b63088502f160e21b8552600485fd5b90509061132b565b50508490611320565b62278d0081029080820462278d0014901517156113d45764ffffffffff909261130a565b634e487b7160e01b86526011600452602486fd5b64ffffffffff906112e7565b634e487b7160e01b600052602160045260246000fd5b346102f25760a03660031901126102f2576004356001600160401b0381116102f25761143a9036906004016137ec565b6024356044359160246064359260843593604060018060a01b03600454168151948580926353f366c760e01b82528660048301525afa92831561092a57600093611792575b5060408401805190936127109161149f916001600160581b031690613bd4565b0480861161177a5760018060a01b0360005416602086516024604051809481936375ca21bb60e01b835260048301525afa90811561092a57600091611748575b508082111561173f576114f191613e05565b808610611727575060018060a01b03600154169280519686880197881061171657604051637a3b9c6360e01b8152602081600481895afa90811561092a576000916116e4575b50670de0b6b3a7640000810290808204670de0b6b3a764000014901517156116ce5788116116bd57660775f05a07400083116116ac57662386f26fc10000811161169b5768327cb2734119d3b7a9601e1b881161168a5761159c6020916004946151c2565b946040519384809263100c48d360e21b82525afa91821561092a57600092611651575b50816115cc915185615664565b611640576115db908684615664565b61162f5761ffff60e06115f1876115fa95615235565b94015116613be7565b9061ffff821161161e57608093604051938452602084015260408301526060820152f35b6319a4c60960e21b60005260046000fd5b631300e8bd60e21b60005260046000fd5b63e5cace4160e01b60005260046000fd5b90916020823d602011611682575b8161166c60209383613756565b8101031261167f575051906115cc6115bf565b80fd5b3d915061165f565b638a94304d60e01b60005260046000fd5b63128df78360e01b60005260046000fd5b63e9ec682160e01b60005260046000fd5b63499e798560e01b60005260046000fd5b634e487b7160e01b600052601160045260246000fd5b906020823d60201161170e575b816116fe60209383613756565b8101031261167f57505189611537565b3d91506116f1565b63a421190b60e01b60005260046000fd5b856378279ed960e11b60005260045260245260446000fd5b505060006114f1565b906020823d602011611772575b8161176260209383613756565b8101031261167f575051886114df565b3d9150611755565b856373ab893560e11b60005260045260245260446000fd5b6117b591935060403d6040116117be575b6117ad8183613756565b810190613cdc565b9050918661147f565b503d6117a3565b346102f25760003660031901126102f257602060ff600080516020615a1283398151915254166040519015158152f35b346102f25760203660031901126102f25761180e61368d565b6007546001600160a01b0316330361118957610b2c90613c15565b346102f25760603660031901126102f257604061184d604435602435600435613d00565b825191825215156020820152f35b346102f25760203660031901126102f25761187461368d565b6007546001600160a01b031633036111895761188e615198565b6001600160a01b0316801561079257600580546001600160a01b0319811683179091553391906001600160a01b03167f95b04cc8ee34c3af50f5a566d34239ba1c449c913d700dfe0521073d3b584f41600080a4005b346102f25760203660031901126102f2576024604060018060a01b03600454168151928380926353f366c760e01b825260043560048301525afa90811561092a5760409160009160009161194c575b5082516001600160581b03928316815291166020820152f35b90506119659150823d84116117be576117ad8183613756565b83611933565b346102f25760003660031901126102f2577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031630036119c45760206040516000805160206159b28339815191528152f35b63703e46dd60e11b60005260046000fd5b346102f25760003660031901126102f2576007546040516001600160a01b039091168152602090f35b346102f25760003660031901126102f25760405161034081016001600160401b0381118282101761242b576040526000815260006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526000610100820152600061012082015260006101408201526000610160820152600061018082015260006101a082015260006101c082015260006101e0820152600061020082015260006102208201526000610300820152600061032082015260018060a01b03600054169081151561024082015260018060a01b03600154169182151561026083015260018060a01b0360025416151561028083015260018060a01b0360035416928315156102a084015260018060a01b036004541615156102c084015260018060a01b0360065416918215156102e0850152806123c8575b50610260830151611f46575b506102e0820151611da1575b6102a0820151611d1d575b610340925060ff600080516020615a12833981519152541615156103008301526102e0820151611cc7575b5061032060405191805183526020810151602084015260408101516040840152606081015160608401526080810151608084015260a081015160a084015260c081015160c084015260e081015160e08401526101008101516101008401526101208101516101208401526101408101516101408401526101608101516101608401526101808101516101808401526101a08101516101a08401526101c08101516101c08401526101e08101516101e08401526102008101516102008401526102208101516102208401526102408101511515610240840152610260810151151561026084015261028081015115156102808401526102a081015115156102a08401526102c081015115156102c08401526102e081015115156102e0840152610300810151151561030084015201511515610320820152f35b60206004916040519283809263f609844d60e01b82525afa60009181611cfc575b5015611b8f57151561032082015282611b8f565b611d1691925060203d602011610e6557610e578183613756565b9084611ce8565b6040805163a0eb92e360e01b815293849060049082905afa600081600092611d64575b6103409550611d51575b5050611b64565b6102008401526102208301528380611d4a565b9150506040843d604011611d99575b81611d8060409383613756565b810103126102f257836020610340955191015191611d40565b3d9150611d73565b60405163074e13b960e01b8152602081600481855afa60009181611f12575b50611f07575b50604051633087c5cf60e01b81526201518042046004820152602081602481855afa60009181611ed3575b50611ec8575b506040516285d89b60e21b8152602081600481855afa60009181611e94575b50611e88575b50604051636e252e0160e11b8152602081600481855afa60009181611e54575b50611e48575b50611b59565b61012083015283611e42565b9091506020813d602011611e80575b81611e7060209383613756565b810103126102f257519085611e3c565b3d9150611e63565b61010083015283611e1c565b9091506020813d602011611ec0575b81611eb060209383613756565b810103126102f257519085611e16565b3d9150611ea3565b60e083015283611df7565b9091506020813d602011611eff575b81611eef60209383613756565b810103126102f257519085611df1565b3d9150611ee2565b60c083015283611dc6565b9091506020813d602011611f3e575b81611f2e60209383613756565b810103126102f257519085611dc0565b3d9150611f21565b60405163100c48d360e21b8152602081600481855afa60009181612394575b50612389575b50604051631c42d7b960e21b8152602081600481855afa60009181612355575b5061234a575b50604051637a3b9c6360e01b8152602081600481855afa60009181612316575b5061230b575b50604051636759a85b60e11b8152602081600481855afa600091816122d4575b50916020916004936122c9575b506040516306d136bd60e21b815292839182905afa60009181612295575b5061228a575b506001600160a01b03612019614fe2565b168015611b4d576040516313cf87bf60e21b8152602081600481855afa60009181612256575b5061224a575b5060405163d5abeb0160e01b8152602081600481855afa60009181612216575b5061220a575b5060405162d5c44360e41b8152602081600481855afa600091816121d6575b506121ca575b50604051630b5570e560e31b8152602081600481855afa60009181612196575b5061218a575b506040516362680e4b60e01b8152602081600481855afa60009181612153575b5091602091600493612147575b5060405163d3303e4160e01b815292839182905afa60009181612113575b5015611b4d576101e083015283611b4d565b9091506020813d60201161213f575b8161212f60209383613756565b810103126102f257519085612101565b3d9150612122565b6101c0860152866120e3565b9150916020823d602011612182575b8161216f60209383613756565b810103126102f2579051909160046120d6565b3d9150612162565b6101a0840152846120b6565b9091506020813d6020116121c2575b816121b260209383613756565b810103126102f2575190866120b0565b3d91506121a5565b61018084015284612090565b9091506020813d602011612202575b816121f260209383613756565b810103126102f25751908661208a565b3d91506121e5565b6101608401528461206b565b9091506020813d602011612242575b8161223260209383613756565b810103126102f257519086612065565b3d9150612225565b61014084015284612045565b9091506020813d602011612282575b8161227260209383613756565b810103126102f25751908661203f565b3d9150612265565b60a083015283612008565b9091506020813d6020116122c1575b816122b160209383613756565b810103126102f257519085612002565b3d91506122a4565b608086015286611fe4565b9150916020823d602011612303575b816122f060209383613756565b810103126102f257905190916004611fd7565b3d91506122e3565b606084015284611fb7565b9091506020813d602011612342575b8161233260209383613756565b810103126102f257519086611fb1565b3d9150612325565b604084015284611f91565b9091506020813d602011612381575b8161237160209383613756565b810103126102f257519086611f8b565b3d9150612364565b602084015284611f6b565b9091506020813d6020116123c0575b816123b060209383613756565b810103126102f257519086611f65565b3d91506123a3565b602060049160405192838092633b6e38df60e11b82525afa600091816123f7575b5015611b4157835284611b41565b9091506020813d602011612423575b8161241360209383613756565b810103126102f2575190866123e9565b3d9150612406565b634e487b7160e01b600052604160045260246000fd5b346102f25760203660031901126102f25761245a61368d565b6007546001600160a01b0316330361118957612474615198565b6001600160a01b0316801561079257600680546001600160a01b0319811683179091553391906001600160a01b03167f8550087a253262ad1d569902c213043016c8e75d5a0dfcf70c0473c8e67eab50600080a4005b60403660031901126102f2576124de61368d565b6024356001600160401b0381116102f257366023820112156102f25761250e903690602481600401359101613794565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016308114908115612747575b506119c4576007546001600160a01b03163303611189576001600160a01b03821691821561079257803b15612736576000805160206159b2833981519152548361258b613922565b7f6ea8b34d59b2818d3f37a08dddaa06f5886b9c20c907b36f03ca6528e106e86f6125c16040519260408452604084019061361e565b4260208401526001600160a01b038516929081900390a36040516352d1902d60e01b8152602081600481885afa60009181612702575b506126115784634c9c8ce360e01b60005260045260246000fd5b90816000805160206159b28339815191528693036126ee5750823b156126d9576001600160a01b03191681176000805160206159b2833981519152557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a28151156126bf57600080836020610b2c95519101845af43d156126b7573d9161269a83613779565b926126a86040519485613756565b83523d6000602085013e6158b0565b6060916158b0565b5050346126c857005b63b398979f60e01b60005260046000fd5b50634c9c8ce360e01b60005260045260246000fd5b632a87526960e21b60005260045260246000fd5b90916020823d60201161272e575b8161271d60209383613756565b8101031261167f57505190866125f7565b3d9150612710565b636f7c43f160e01b60005260046000fd5b6000805160206159b2833981519152546001600160a01b03161415905083612543565b346102f25760003660031901126102f2576004546040516001600160a01b039091168152602090f35b346102f2576127a1366136ed565b808015612a5a57603210612a52575b600054604051633b6e38df60e11b81526001600160a01b03909116929091602083600481875afa92831561092a57600093612a1e575b506040519063e34ad47b60e01b82528260048301526024820152600081604481875afa90811561092a57600091612a03575b5061282581518093613be7565b9361282f83613945565b9261283d6040519485613756565b808452601f1961284c82613945565b0160005b8181106129d057505060009260005b8281106129045750505050815260405191606083016060845282518091526080840190602060808260051b8701019401916000905b8282106128af57505050508293602084015260408301520390f35b90919294602080600192607f198a820301855288519081518152606060ff816128e586860151608088870152608086019061361e565b9460408101516040860152015116910152970192019201909291612894565b61290e8183613c81565b519060405191638d34875560e01b83526004830152600082602481885afa91821561092a576000926129b5575b50604082015180612952575b50600191500161285f565b82519661012060608501519401519360088510156113f4576001946129ae9360ff926040519b6129818d61371f565b8c5260208c015260408b015216606089015261299c81613c95565b976129a7828b613c81565b5288613c81565b5089612947565b6129c991923d8091833e610ae88183613756565b908961293b565b6020906040516129df8161371f565b60008152606083820152600060408201526000606082015282828901015201612850565b612a1891503d806000833e61091c8183613756565b84612818565b9092506020813d602011612a4a575b81612a3a60209383613756565b810103126102f2575191846127e6565b3d9150612a2d565b5060326127b0565b63162908e360e11b60005260046000fd5b346102f25760003660031901126102f2576007546001600160a01b0316330361118957600080516020615a128339815191525460ff811615612b135760ff1916600080516020615a12833981519152557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a16040514281527f107553d8191d85b405879cf752997865edd48d94e20bda4dd27223c94b31a7cc60203392a2005b638dfc202b60e01b60005260046000fd5b346102f25760203660031901126102f257600054604051631e1778ad60e11b8152600480359082015290602090829060249082906001600160a01b03165afa801561092a576000906110a457602090604051908152f35b346102f25760003660031901126102f2576001546040516001600160a01b039091168152602090f35b346102f25760403660031901126102f257612bbd6136a3565b336001600160a01b03821603612bd957610b2c90600435615154565b63334bd91960e11b60005260046000fd5b346102f25760403660031901126102f257610b2c600435612c096136a3565b90612c16610b2282613bf4565b61510c565b346102f25760203660031901126102f257612c3461368d565b60008054604051632a6bc2dd60e01b81526001600160a01b0393841660048201529192168282602481845afa91821561092a57600092612d63575b5081516032811115612d5d57506032905b60005b828110612cad57612ca384866040519283926040845260408401906136b9565b9060208301520390f35b612cb78185613c81565b5160405190638d34875560e01b82526004820152600081602481865afa801561092a5761012091600091612d44575b50015160088110156113f457600281149060008215612d39575b8215612d2a575b5050612d16575b600101612c83565b93612d22600191613c95565b949050612d0e565b9091506113f457158680612d07565b600182149250612d00565b612d57913d8091833e610ae88183613756565b87612ce6565b90612c80565b612d799192503d806000833e61091c8183613756565b9083612c6f565b346102f25760203660031901126102f257612d9961368d565b600080516020615a528339815191525460ff8160401c16908115612e7f575b506107c857600080516020615a5283398151915280546001600160481b0319166002600160401b011790553360009081527fb7db2dd08fcb62d0c9e08c51941cae53c267786a0b75803fb7960902fc8ef97d602052604090205460ff1615612e6557612e2390613c15565b60ff60401b19600080516020615a528339815191525416600080516020615a5283398151915255600080516020615972833981519152602060405160028152a1005b63e2517d3f60e01b60005233600452600060245260446000fd5b60026001600160401b03919091161015905082612db8565b346102f25760203660031901126102f2576020612eb5600435613bf4565b604051908152f35b346102f25760003660031901126102f2576002546040516001600160a01b039091168152602090f35b346102f25760203660031901126102f257612eff61368d565b60008054604051632a6bc2dd60e01b81526001600160a01b0393841660048201529283916024918391165afa90811561092a57600091612f7f575b50516032811115612f795760325b61271081029080820461271014901517156116ce576161a801806161a8116116ce5760409182519182526020820152f35b80612f48565b612f9491503d806000833e61091c8183613756565b81612f3a565b346102f25760003660031901126102f257602060405160328152f35b346102f25760003660031901126102f2576003546040516001600160a01b039091168152602090f35b346102f25760003660031901126102f2576006546040516001600160a01b039091168152602090f35b346102f25760203660031901126102f257600061010060405161302a81613703565b8281528260208201528260408201528260608201528260808201528260a08201528260c08201528260e082015201526024600060018060a01b0381541660405192838092638d34875560e01b825260043560048301525afa90811561092a57600091613199575b508051602082015190604083015160018060a01b036080850151169364ffffffffff60a0820151169064ffffffffff60c0820151169561ffff60e08301511661012064ffffffffff610100850151169301519460088610156113f4576101209864ffffffffff809661ffff9582946131979b6040519061311082613703565b8152602081019d8e5260408101918252606081019283526080810193845260a0810195865260c0810197885260e08101998a5261010081019b8c5260206040519e8f92518352519101525160408d015260018060a01b0390511660608c0152511660808a0152511660a0880152511660c0860152511660e084015251610100830190613680565bf35b6131ac913d8091833e610ae88183613756565b81613091565b346102f25760003660031901126102f25760048054604051630382c87360e21b81529160009183919082906001600160a01b03165afa801561092a57600080928192613262575b5091906040519283926060840160608552825180915260206080860193019060005b818110613249575050508161323b91856102ee9594036020870152613643565b908382036040850152613643565b825185528796506020948501949092019160010161321b565b915091503d8083833e6132758183613756565b8101906060818303126133495780516001600160401b0381116133455781019180601f84011215613345578251926132ac84613945565b936132ba6040519586613756565b80855260208086019160051b8301019183831161334157602001905b8282106133315750505060208201516001600160401b03811161332d57816132ff918401613970565b604083015190926001600160401b038211613329576133219394955001613970565b9091836131f9565b8580fd5b8480fd5b81518152602091820191016132d6565b8680fd5b8380fd5b8280fd5b346102f25760003660031901126102f2576040516101c08101906001600160401b0382118183101761242b576101c0916040526000815260208101906000825260408101600081526060820160008152608083016000815260a084016000815260c085016000815260e08601600081526101008701916000835261012088019360008552610140890195600087526101608a0197600089526101808b019960008b526101a08c019b60008d528d61341a60018060a01b036005541661341181614e42565b15158452614ea4565b15159052600054613433906001600160a01b0316614e42565b1515825260015461344c906001600160a01b0316614e42565b15158352600254613465906001600160a01b0316614e42565b1515845260035461347e906001600160a01b0316614e42565b15158552600654613497906001600160a01b0316614e42565b151586526004546134b0906001600160a01b0316614e42565b15158a526134c46134bf614ede565b614e42565b15158b526134d36134bf614f6c565b15158c526134e26134bf614fa7565b15158d526134f16134bf614fe2565b151587526135006134bf615050565b1515885261350f6134bf615089565b1515895260206040519e8f92511515835251151591015251151560408d015251151560608c015251151560808b015251151560a08a015251151560c089015251151560e08801525115156101008701525115156101208601525115156101408501525115156101608401525115156101808301525115156101a0820152f35b346102f25760203660031901126102f2576004359063ffffffff60e01b82168092036102f257602091635a05180f60e01b81149081156135d0575b5015158152f35b637965db0b60e01b8114915081156135ea575b50836135c9565b6301ffc9a760e01b149050836135e3565b60005b83811061360e5750506000910152565b81810151838201526020016135fe565b90602091613637815180928185528580860191016135fb565b601f01601f1916010190565b906020808351928381520192019060005b8181106136615750505090565b82516001600160581b0316845260209384019390920191600101613654565b9060088210156113f45752565b600435906001600160a01b03821682036102f257565b602435906001600160a01b03821682036102f257565b906020808351928381520192019060005b8181106136d75750505090565b82518452602093840193909201916001016136ca565b60409060031901126102f2576004359060243590565b61012081019081106001600160401b0382111761242b57604052565b608081019081106001600160401b0382111761242b57604052565b6101a081019081106001600160401b0382111761242b57604052565b601f909101601f19168101906001600160401b0382119082101761242b57604052565b6001600160401b03811161242b57601f01601f191660200190565b9291926137a082613779565b916137ae6040519384613756565b8294818452818301116102f2578281602093846000960137010152565b359064ffffffffff821682036102f257565b359061ffff821682036102f257565b9190916101a0818403126102f257604051906138078261373a565b8193813583526020820135602084015260408201356040840152606082013560018060401b0381116102f25782019080601f830112156102f25781602061385093359101613794565b606083015260808101356001600160a01b03811681036102f257608083015261387b60a082016137cb565b60a083015261388c60c082016137cb565b60c083015261389d60e082016137dd565b60e08301526138af61010082016137cb565b6101008301526101208101359060088210156102f2576101806139009181936101208601526138e161014082016137cb565b6101408601526138f461016082016137dd565b610160860152016137cb565b910152565b346102f25760003660031901126102f25760206040516127108152f35b60405190613931604083613756565b6005825264312e312e3360d81b6020830152565b6001600160401b03811161242b5760051b60200190565b51906001600160581b03821682036102f257565b9080601f830112156102f257815161398781613945565b926139956040519485613756565b81845260208085019260051b8201019283116102f257602001905b8282106139bd5750505090565b602080916139ca8461395c565b8152019101906139b0565b51906001600160a01b03821682036102f257565b519064ffffffffff821682036102f257565b519061ffff821682036102f257565b6020818303126102f2578051906001600160401b0382116102f257016101a0818303126102f25760405191613a3e8361373a565b81518352602080830151908401526040808301519084015260608201516001600160401b0381116102f257820181601f820112156102f2578051613a8181613779565b92613a8f6040519485613756565b818452602082840101116102f257613aad91602080850191016135fb565b6060830152613abe608082016139d5565b6080830152613acf60a082016139e9565b60a0830152613ae060c082016139e9565b60c0830152613af160e082016139fb565b60e0830152613b0361010082016139e9565b61010083015261012081015160088110156102f257613b529161018091610120850152613b3361014082016139e9565b610140850152613b4661016082016139fb565b610160850152016139e9565b61018082015290565b6020818303126102f2578051906001600160401b0382116102f257019080601f830112156102f2578151613b8e81613945565b92613b9c6040519485613756565b81845260208085019260051b8201019283116102f257602001905b828210613bc45750505090565b8151815260209182019101613bb7565b818102929181159184041417156116ce57565b919082018092116116ce57565b6000526000805160206159f283398151915260205260016040600020015490565b6001600160a01b038116908115610792573b1561273657600780546001600160a01b0319811683179091556001600160a01b03166000805160206159d2833981519152600080a3565b805115613c6b5760200190565b634e487b7160e01b600052603260045260246000fd5b8051821015613c6b5760209160051b010190565b60001981146116ce5760010190565b8115613cae570490565b634e487b7160e01b600052601260045260246000fd5b908160209103126102f2575180151581036102f25790565b91908260409103126102f257613cfd6020613cf68461395c565b930161395c565b90565b60008054604051638d34875560e01b81526004810193909352929392829060249082906001600160a01b03165afa90811561092a57600091613dea575b5060808101516001600160a01b031615610ac45760400151908115613ddf57613d6e92613d69916151c2565b615235565b60015460405163100c48d360e21b815291929190602090829060049082906001600160a01b03165afa90811561092a57600091613dad575b5082101590565b90506020813d602011613dd7575b81613dc860209383613756565b810103126102f2575138613da6565b3d9150613dbb565b505050600090600190565b613dff91503d806000833e610ae88183613756565b38613d3d565b919082039182116116ce57565b6006546001600160a01b0316908115613ed757604051636e252e0160e11b8152602081600481865afa90811561092a57600091613ea4575b50602060049193604051928380926285d89b60e21b82525afa90811561092a57600091613e75575090565b90506020813d602011613e9c575b81613e9060209383613756565b810103126102f2575190565b3d9150613e83565b90506020813d602011613ecf575b81613ebf60209383613756565b810103126102f257516020613e4a565b3d9150613eb2565b600091508190565b60405190613eee604083613756565b60078252660161023b7ba1d160cd1b6020830152565b9590969198939997929460009a87156148c557881561487a57861561482f5781156147e457841561478e578c156147435764e8d4a5100082106146de57655af3107a400082116146795785156146225761012c86018087116145905742116145a45761012c420180421161459057861161450b57613f806152b5565b80860361442957508b54604051638d34875560e01b8152600481018a905297969594939291908d90899060249082906001600160a01b03165afa97881561441e578d98614401575b50875115614391576040880180516040516020810191825260208152613fef604082613756565b5190209081860361424c575050916101649795939160209a9997959360018060a01b036001541697608060018060a01b0391015116966040519e8f9c8d9b632fd74aa960e11b8d5260048d015260248c015260448b015260648a0152608489015260a488015260c487015260e48601526101048501526101248401526101448301525afa91821561424157839261420d575b5060055460405163fb7c6a0f60e01b815290602090829060049082906001600160a01b03165afa9081156142025784916141c0575b506001600160a01b031691823b15613345579184916084859460405197889586948593636b80155f60e01b8552632c545d9960e21b6004860152602485015260606044850152816064850152848401378181018301879052601f01601f191681010301915afa91826141b0575b509061417b5750604051614138606082613756565b602d81527f56616c69646174696f6e20393a20766572696679417574686f72697a6174696f60208201526c1b8818d85b1b0819985a5b1959609a1b604082015290565b5060405161418a604082613756565b6016815275105b1b081d985b1a59185d1a5bdb9cc81c185cdcd95960521b602082015290565b816141ba91613756565b38614123565b90506020813d6020116141fa575b816141db60209383613756565b8101031261334557516001600160a01b038116810361334557386140b6565b3d91506141ce565b6040513d86823e3d90fd5b9091506020813d602011614239575b8161422960209383613756565b8101031261334957519038614081565b3d915061421c565b6040513d85823e3d90fd5b9b509d505050509897505050505050506040519261426b606085613756565b602c845260208401947f56616c69646174696f6e20383a20446562742068617368206d69736d617463688652604085016b0171022bc3832b1ba32b21d160a51b90526142b690615386565b926142bf613edf565b916142c990615386565b9050604051916142da604084613756565b6010835260208301936f0161021bab93932b73a103232b13a1d160851b85525161430390615457565b9460405197889751908160208a0161431a926135fb565b870181519182602083019160200191614332926135fb565b01602001808251602081940191614348926135fb565b0180825160208194019161435b926135fb565b0191829151809361436b926135fb565b0180825160208194019161437e926135fb565b0103601f1981018252613cfd9082613756565b50505050505050505050505080915050506040516143b0606082613756565b603b81527f56616c69646174696f6e20383a20506f736974696f6e206e6f7420666f756e6460208201527a2028706f736974696f6e4964203d3d20627974657333322830292960281b604082015290565b6144179198508d3d8091833e610ae88183613756565b9638613fc8565b6040513d8f823e3d90fd5b98505050505095505050506144cb94506020915083613cfd9450506144fc8260405194614457606087613756565b603086526144ee826144a7818901967f56616c69646174696f6e20373a20436f6e74726163742068617368206d69736d88526f030ba31b4171022bc3832b1ba32b21d160851b60408b0152615386565b6144b86144b2613edf565b94615386565b966040519b8c9a518092858d01906135fb565b89016144df825180938580850191016135fb565b010191828151948592016135fb565b0191828151948592016135fb565b0103601f198101835282613756565b50505050505050505050508091505050604051614529608082613756565b6060815260008051602061595283398151915260208201527f6f6f2066617220696e2066757475726520287175616e74756d54696d6573746160408201527f6d70203e20626c6f636b2e74696d657374616d70202b204d41585f534b455729606082015290565b634e487b7160e01b8d52601160045260248dfd5b505050505050505050505080915050506040516145c2608082613756565b6056815260008051602061595283398151915260208201527f6f6f206f6c6420287175616e74756d54696d657374616d70202b204d41585f536040820152754b4557203c20626c6f636b2e74696d657374616d702960501b606082015290565b50505050505050505050508091505050604051614640606082613756565b602381527f56616c69646174696f6e20343a207175616e74756d54696d657374616d70203d60208201526203d20360ec1b604082015290565b50505050505050505050508091505050604051614697606082613756565b603181527f56616c69646174696f6e20333a206274635072696365203e20444941474e4f536020820152700a89286be84a886bea0a492868abe9a82b607b1b604082015290565b505050505050505050505080915050506040516146fc606082613756565b603181527f56616c69646174696f6e20333a206274635072696365203c20444941474e4f536020820152702a24a1afa12a21afa82924a1a2afa6a4a760791b604082015290565b50505050505050505050508091505050604051614761604082613756565b601d81527f56616c69646174696f6e20313a207369676e617475726520656d707479000000602082015290565b505050505050505050505080915050506040516147ac606082613756565b602281527f56616c69646174696f6e20313a20636f6e747261637448617368206973207a65602082015261726f60f01b604082015290565b50505050505050505050508091505050604051614802604082613756565b601e81527f56616c69646174696f6e20313a206274635072696365206973207a65726f0000602082015290565b5050505050505050505050809150505060405161484d604082613756565b601d81527f56616c69646174696f6e20313a206e657744656274206973207a65726f000000602082015290565b50505050505050505050508091505050604051614898604082613756565b602081527f56616c69646174696f6e20313a206d696e74416d6f756e74206973207a65726f602082015290565b505050505050505050505080915050506040516148e3604082613756565b602081527f56616c69646174696f6e20313a20706f736974696f6e4964206973207a65726f602082015290565b9061491a82613945565b6149276040519182613756565b8281528092614938601f1991613945565b0190602036910137565b60008054604051638d34875560e01b815260048101849052936001600160a01b0390911692909184602481865afa93841561092a57600094614aad575b5060808401516001600160a01b031615614a7957604051926101606149a48186613756565b600a8552601f19013660208601376020806000960151602460405180948193631e1778ad60e11b835260048301525afa908115614a6e578591614a3c575b5003614a27575b8215926149f581614910565b9260005b828110614a0557505050565b8060ff614a1460019385613c81565b5116614a208288613c81565b52016149f9565b600192506002614a3683613c5e565b526149e9565b90506020813d602011614a66575b81614a5760209383613756565b8101031261332d5751386149e2565b3d9150614a4a565b6040513d87823e3d90fd5b50915050604080519190614a8d8184613756565b60018352601f19013660208401376001614aa683613c5e565b5260009190565b614ac39194503d806000833e610ae88183613756565b923861497f565b60008054604051632a6bc2dd60e01b81526001600160a01b03938416600482015293959194939192168482602481845afa91821561092a57600092614c60575b50815193848710801590614c58575b614c335760328111614c2b575b614b309087613be7565b86858211614c23575b614b4291613e05565b91614b4c83614910565b9660005b848110614b5e575050505050565b614b71614b6b8284613be7565b84613c81565b5180614b7d838c613c81565b5260405190638d34875560e01b82526004820152600081602481885afa801561092a5761012091600091614c0a575b50015160088110156113f457600281149060008215614bff575b8215614bf0575b5050614bdc575b600101614b50565b96614be8600191613c95565b979050614bd4565b9091506113f457153880614bcd565b600182149250614bc6565b614c1d913d8091833e610ae88183613756565b38614bac565b859150614b39565b506032614b26565b50505092509050604051614c48602082613756565b6000815260003681379160009190565b508015614b19565b614c769192503d806000833e61091c8183613756565b9038614b0a565b6006546001600160a01b0316908115614d355760405163f609844d60e01b8152602081600481865afa90811561092a57600491602091600091614d18575b50936040519283809263074e13b960e01b82525afa90811561092a57600091614ce6575b5090600090565b90506020813d602011614d10575b81614d0160209383613756565b810103126102f2575138614cdf565b3d9150614cf4565b614d2f9150823d8411610e6557610e578183613756565b38614cbb565b6000915081908190565b6006546001600160a01b0316916000918315614e385760405190633087c5cf60e01b82526004820152602081602481875afa90811561092a57600091614e06575b50600460208295604051928380926285d89b60e21b82525afa90811561092a57600091614dd4575b5080614db2575050565b9091925061271082029180830461271014901517156116ce57613cfd91613ca4565b906020823d602011614dfe575b81614dee60209383613756565b8101031261167f57505138614da8565b3d9150614de1565b906020823d602011614e30575b81614e2060209383613756565b8101031261167f57505138614d80565b3d9150614e13565b5060009250829150565b6001600160a01b03168015614e9e57602060049160405192838092635c975abb60e01b82525afa60009181614e7d575b50613cfd5750600090565b614e9791925060203d602011610e6557610e578183613756565b9038614e72565b50600090565b6001600160a01b03168015614e9e5760206004916040519283809263d53dc73960e01b82525afa60009181614e7d5750613cfd5750600090565b6005546040516303e1469160e61b815290602090829060049082906001600160a01b03165afa8091600091614f26575b5090614f1a5750600090565b6001600160a01b031690565b6020813d602011614f64575b81614f3f60209383613756565b81010312614f605751906001600160a01b038216820361167f575038614f0e565b5080fd5b3d9150614f32565b60015460405163eb373f3f60e01b815290602090829060049082906001600160a01b03165afa8091600091614f26575090614f1a5750600090565b600054604051638998b7cf60e01b815290602090829060049082906001600160a01b03165afa8091600091614f26575090614f1a5750600090565b60015460405163b1d3354f60e01b815290602090829060049082906001600160a01b03165afa6000918161501b5750613cfd5750600090565b9091506020813d602011615048575b8161503760209383613756565b810103126102f257614e97906139d5565b3d915061502a565b60015460405163023b2a9f60e31b815290602090829060049082906001600160a01b03165afa6000918161501b5750613cfd5750600090565b60055460405163db19e96360e01b815290602090829060049082906001600160a01b03165afa6000918161501b5750613cfd5750600090565b60008181526000805160206159f28339815191526020908152604080832033845290915290205460ff16156150f45750565b63e2517d3f60e01b6000523360045260245260446000fd5b615116828261551b565b918261512157505090565b60009182526000805160206159328339815191526020526040909120615150916001600160a01b031690615774565b5090565b61515e82826155c4565b918261516957505090565b60009182526000805160206159328339815191526020526040909120615150916001600160a01b0316906157dd565b60ff600080516020615a1283398151915254166151b157565b63d93c066560e01b60005260046000fd5b90660775f05a07400082116116ac57662386f26fc10000811161169b5781158015908161521f575b5061520e576151f891613bd4565b6064810290808204606414901517156116ce5790565b63450d49cd60e01b60005260046000fd5b9050613cae5760648260001904048111386151ea565b9080156152a45768327cb2734119d3b7a9601e1b821161168a577e068db8bac710cb295e9e1b089a027525460aa64c2f837b4a2339c0ebedfa4382116152935761271082029180830461271014901517156116ce57613cfd91613ca4565b633da428df60e21b60005260046000fd5b6323d359a360e01b60005260046000fd5b60015460405163b1d3354f60e01b81526001600160a01b0390911690602081600481855afa60009181615339575b506152ef575050600090565b600554600454604080516001600160a01b0393841660208201908152918101959095529082166060850152911660808084019190915282529061533360a082613756565b51902090565b9091506020813d60201161536d575b8161535560209383613756565b810103126102f257615366906139d5565b90386152e3565b3d9150615348565b908151811015613c6b570160200190565b60405190615395608083613756565b60428252602082016060368237825115613c6b5760309053815160011015613c6b576078602183015360005b602081106153ce57505090565b81811a6153e060ff8260041c16615704565b908260011b91838304600214841517156116ce578260020191826002116116ce5761541c92615415600f9360001a9189615375565b5316615704565b600091600301918260031161544357600193929161543c911a9186615375565b53016153c1565b634e487b7160e01b81526011600452602490fd5b80156154fb5780816000925b6154e5575061547182613779565b9161547f6040519384613756565b80835281601f1961548f83613779565b013660208601375b6154a057505090565b60001981019081116116ce578091600a810660300191826030116116ce57600a9260f81b6001600160f81b03191660001a906154dc9086615375565b53049081615497565b90916154f2600a91613c95565b92910480615463565b5060405161550a604082613756565b60018152600360fc1b602082015290565b60008181526000805160206159f2833981519152602090815260408083206001600160a01b038616845290915290205460ff166155bd5760008181526000805160206159f2833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19166001179055339291907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a4600190565b5050600090565b60008181526000805160206159f2833981519152602090815260408083206001600160a01b038616845290915290205460ff16156155bd5760008181526000805160206159f2833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19169055339291907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9080a4600190565b9181156156e45768327cb2734119d3b7a9601e1b831161168a577e068db8bac710cb295e9e1b089a027525460aa64c2f837b4a2339c0ebedfa438311615293576000826000190482116156d55761271084029380850461271014901517156154435750906156d191613bd4565b1190565b633da428df60e21b8152600490fd5b505050600090565b8054821015613c6b5760005260206000200190600090565b60ff16600a81101561572b5760300160ff81116116ce5760f81b6001600160f81b03191690565b60570160ff81116116ce5760f81b6001600160f81b03191690565b60ff600080516020615a528339815191525460401c161561576357565b631afcd79f60e31b60005260046000fd5b60018101908260005281602052604060002054156000146156e4578054600160401b81101561242b576157c86157b18260018794018555846156ec565b819391549060031b91821b91600019901b19161790565b90555491600052602052604060002055600190565b90600182019181600052826020526040600020548015156000146158a75760001981018181116116ce5782546000198101919082116116ce57818103615870575b5050508054801561585a57600019019061583882826156ec565b8154906000199060031b1b191690555560005260205260006040812055600190565b634e487b7160e01b600052603160045260246000fd5b6158906158806157b193866156ec565b90549060031b1c928392866156ec565b90556000528360205260406000205538808061581e565b50505050600090565b906158d657508051156158c557602081519101fd5b63d6bda27560e01b60005260046000fd5b81511580615908575b6158e7575090565b639996b31560e01b60009081526001600160a01b0391909116600452602490fd5b50803b156158df56fe0073bca384c5694c6e96fcd606b93d29d3f9c8294a3638967da39aea012c8e58c1f6fe24621ce81ec5827caf0253cadb74709b061630e6b55e8237170593200056616c69646174696f6e20363a207175616e74756d54696d657374616d702074c7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d275027301df982f5215b4963a854cf9c73219df80cb6acd8f098189c9480c7bbc360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc17dc5b1290f7495d7f8cc68476e6941aaf510598fa925d0d2720edc8805a846c02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800cd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300a49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00a164736f6c6343000822000a";
|
|
75335
75419
|
var isSuperArgs3 = (xs) => xs.length > 1;
|
|
75336
|
-
var PositionManagerViews__factory = class extends
|
|
75420
|
+
var PositionManagerViews__factory = class extends import_ethers32.ContractFactory {
|
|
75337
75421
|
constructor(...args) {
|
|
75338
75422
|
if (isSuperArgs3(args)) {
|
|
75339
75423
|
super(...args);
|
|
@@ -75353,10 +75437,10 @@ var PositionManagerViews__factory = class extends import_ethers31.ContractFactor
|
|
|
75353
75437
|
static bytecode = _bytecode3;
|
|
75354
75438
|
static abi = _abi3;
|
|
75355
75439
|
static createInterface() {
|
|
75356
|
-
return new
|
|
75440
|
+
return new import_ethers32.Interface(_abi3);
|
|
75357
75441
|
}
|
|
75358
75442
|
static connect(address, runner) {
|
|
75359
|
-
return new
|
|
75443
|
+
return new import_ethers32.Contract(
|
|
75360
75444
|
address,
|
|
75361
75445
|
_abi3,
|
|
75362
75446
|
runner
|
|
@@ -75374,7 +75458,7 @@ var SET_DELEGATE_GATE_ABI = [
|
|
|
75374
75458
|
"function delegateBurned(address delegate) view returns (bool)"
|
|
75375
75459
|
];
|
|
75376
75460
|
async function getSetDelegateBlocker(delegate, provider, registryAddress) {
|
|
75377
|
-
const registry = new
|
|
75461
|
+
const registry = new import_ethers33.Contract(
|
|
75378
75462
|
registryAddress,
|
|
75379
75463
|
SET_DELEGATE_GATE_ABI,
|
|
75380
75464
|
provider
|
|
@@ -75391,7 +75475,7 @@ async function getSetDelegateBlocker(delegate, provider, registryAddress) {
|
|
|
75391
75475
|
return null;
|
|
75392
75476
|
}
|
|
75393
75477
|
async function setPositionDelegate(positionId, delegate, signer, registryAddress) {
|
|
75394
|
-
const registry = new
|
|
75478
|
+
const registry = new import_ethers33.Contract(
|
|
75395
75479
|
registryAddress,
|
|
75396
75480
|
POSITION_DELEGATE_REGISTRY_ABI,
|
|
75397
75481
|
signer
|
|
@@ -75399,7 +75483,7 @@ async function setPositionDelegate(positionId, delegate, signer, registryAddress
|
|
|
75399
75483
|
return registry["setPositionDelegate"](positionId, delegate);
|
|
75400
75484
|
}
|
|
75401
75485
|
async function getPositionDelegate(positionId, provider, registryAddress) {
|
|
75402
|
-
const registry = new
|
|
75486
|
+
const registry = new import_ethers33.Contract(
|
|
75403
75487
|
registryAddress,
|
|
75404
75488
|
POSITION_DELEGATE_REGISTRY_ABI,
|
|
75405
75489
|
provider
|
|
@@ -75606,9 +75690,13 @@ var SIGNABLE_FUNCTIONS2 = [
|
|
|
75606
75690
|
"function redeem(address stablecoin, uint256 ucdAmount, uint256 minStablecoinOut) external returns (uint256)",
|
|
75607
75691
|
// BitcoinWithdrawalAddressRegistry — `msg.sender` must be the borrower, so
|
|
75608
75692
|
// this too is client-only and never module-whitelisted.
|
|
75609
|
-
"function addAddress(string btcAddress) external"
|
|
75693
|
+
"function addAddress(string btcAddress) external",
|
|
75694
|
+
// StUSDCVault 1.1.0 — the hold-only UCD desk. Direct EOA calls like the PSM
|
|
75695
|
+
// pair (the vault pulls from `msg.sender`); never routed through AgentModule.
|
|
75696
|
+
"function sellUCD(uint256 amountUCD, uint256 minUSDC) external returns (uint256)",
|
|
75697
|
+
"function buyUCD(uint256 amountUSDC, uint256 minUCD) external returns (uint256)"
|
|
75610
75698
|
];
|
|
75611
|
-
var IFACE2 = new
|
|
75699
|
+
var IFACE2 = new import_ethers35.ethers.Interface(SIGNABLE_FUNCTIONS2);
|
|
75612
75700
|
function encodeSignable2(fn, args) {
|
|
75613
75701
|
return IFACE2.encodeFunctionData(fn, args);
|
|
75614
75702
|
}
|
|
@@ -75633,7 +75721,7 @@ function eqAddr2(a, b) {
|
|
|
75633
75721
|
if (!a || !b)
|
|
75634
75722
|
return false;
|
|
75635
75723
|
try {
|
|
75636
|
-
return
|
|
75724
|
+
return import_ethers36.ethers.getAddress(a) === import_ethers36.ethers.getAddress(b);
|
|
75637
75725
|
} catch {
|
|
75638
75726
|
return false;
|
|
75639
75727
|
}
|
|
@@ -75699,7 +75787,7 @@ function readValue2(tx2) {
|
|
|
75699
75787
|
}
|
|
75700
75788
|
function normalizePositionId2(id) {
|
|
75701
75789
|
const hex = id.startsWith("0x") ? id : `0x${id}`;
|
|
75702
|
-
return
|
|
75790
|
+
return import_ethers36.ethers.zeroPadValue(hex, 32).toLowerCase();
|
|
75703
75791
|
}
|
|
75704
75792
|
function requirePositionId(actual, expected) {
|
|
75705
75793
|
const txPositionId = String(actual).toLowerCase();
|
|
@@ -75958,6 +76046,53 @@ function validateUnsignedTx2(unsignedTx, expected, vctx) {
|
|
|
75958
76046
|
}
|
|
75959
76047
|
break;
|
|
75960
76048
|
}
|
|
76049
|
+
case "desk-approve": {
|
|
76050
|
+
if (name !== "approve") {
|
|
76051
|
+
throw new TxValidationError2(`expected ERC-20 approve, decoded ${name}`);
|
|
76052
|
+
}
|
|
76053
|
+
if (!eqAddr2(to, expected.tokenAddress)) {
|
|
76054
|
+
throw new TxValidationError2(`approve must target the token (${expected.tokenAddress}), got ${to}`);
|
|
76055
|
+
}
|
|
76056
|
+
if (!eqAddr2(String(args[0]), expected.vaultAddress)) {
|
|
76057
|
+
throw new TxValidationError2(`approve spender must be the StUSDCVault (${expected.vaultAddress}), got ${String(args[0])}`);
|
|
76058
|
+
}
|
|
76059
|
+
if (BigInt(String(args[1])).toString() !== expected.amount) {
|
|
76060
|
+
throw new TxValidationError2(
|
|
76061
|
+
`approve amount must be EXACTLY ${expected.amount} (exact-amount rule), got ${BigInt(String(args[1]))}`
|
|
76062
|
+
);
|
|
76063
|
+
}
|
|
76064
|
+
break;
|
|
76065
|
+
}
|
|
76066
|
+
case "desk-sell": {
|
|
76067
|
+
if (name !== "sellUCD")
|
|
76068
|
+
throw new TxValidationError2(`expected sellUCD, decoded ${name}`);
|
|
76069
|
+
if (!eqAddr2(to, expected.vaultAddress)) {
|
|
76070
|
+
throw new TxValidationError2(`sellUCD must target the StUSDCVault (${expected.vaultAddress}), got ${to}`);
|
|
76071
|
+
}
|
|
76072
|
+
if (BigInt(String(args[0])).toString() !== expected.amountUcdWei)
|
|
76073
|
+
throw new TxValidationError2(`sellUCD amountUCD mismatch`);
|
|
76074
|
+
if (BigInt(String(args[1])).toString() !== expected.minUsdc)
|
|
76075
|
+
throw new TxValidationError2(`sellUCD minUSDC mismatch`);
|
|
76076
|
+
if (BigInt(expected.minUsdc) === 0n) {
|
|
76077
|
+
throw new TxValidationError2(`sellUCD minUSDC is 0 \u2014 a slippage floor is mandatory`);
|
|
76078
|
+
}
|
|
76079
|
+
break;
|
|
76080
|
+
}
|
|
76081
|
+
case "desk-buy": {
|
|
76082
|
+
if (name !== "buyUCD")
|
|
76083
|
+
throw new TxValidationError2(`expected buyUCD, decoded ${name}`);
|
|
76084
|
+
if (!eqAddr2(to, expected.vaultAddress)) {
|
|
76085
|
+
throw new TxValidationError2(`buyUCD must target the StUSDCVault (${expected.vaultAddress}), got ${to}`);
|
|
76086
|
+
}
|
|
76087
|
+
if (BigInt(String(args[0])).toString() !== expected.amountUsdc)
|
|
76088
|
+
throw new TxValidationError2(`buyUCD amountUSDC mismatch`);
|
|
76089
|
+
if (BigInt(String(args[1])).toString() !== expected.minUcdWei)
|
|
76090
|
+
throw new TxValidationError2(`buyUCD minUCD mismatch`);
|
|
76091
|
+
if (BigInt(expected.minUcdWei) === 0n) {
|
|
76092
|
+
throw new TxValidationError2(`buyUCD minUCD is 0 \u2014 a slippage floor is mandatory`);
|
|
76093
|
+
}
|
|
76094
|
+
break;
|
|
76095
|
+
}
|
|
75961
76096
|
default: {
|
|
75962
76097
|
const _exhaustive = expected;
|
|
75963
76098
|
throw new TxValidationError2(`unhandled expected action kind: ${JSON.stringify(_exhaustive)}`);
|
|
@@ -75991,18 +76126,18 @@ function buildPsmRedeemTx2(p) {
|
|
|
75991
76126
|
var PSM_READS_ABI = ["function supportedStablecoins(address) view returns (bool)"];
|
|
75992
76127
|
var ERC20_READS_ABI = ["function allowance(address owner, address spender) view returns (uint256)"];
|
|
75993
76128
|
function psmExchangeReadsFromProvider(provider, psmAddress) {
|
|
75994
|
-
const psm = new
|
|
76129
|
+
const psm = new import_ethers34.ethers.Contract(psmAddress, PSM_READS_ABI, provider);
|
|
75995
76130
|
return {
|
|
75996
76131
|
isStablecoinSupported: async (stablecoin) => await psm.getFunction("supportedStablecoins")(stablecoin),
|
|
75997
|
-
allowance: async (token, owner, spender) => await new
|
|
76132
|
+
allowance: async (token, owner, spender) => await new import_ethers34.ethers.Contract(token, ERC20_READS_ABI, provider).getFunction("allowance")(owner, spender)
|
|
75998
76133
|
};
|
|
75999
76134
|
}
|
|
76000
76135
|
var refuse = (direction, msg) => new TxValidationError2(msg, `PSM ${direction}`);
|
|
76001
76136
|
function requireAddress(direction, label, value) {
|
|
76002
|
-
if (!value || !
|
|
76137
|
+
if (!value || !import_ethers34.ethers.isAddress(value)) {
|
|
76003
76138
|
throw refuse(direction, `${label} address is missing or invalid (${String(value)})`);
|
|
76004
76139
|
}
|
|
76005
|
-
return
|
|
76140
|
+
return import_ethers34.ethers.getAddress(value);
|
|
76006
76141
|
}
|
|
76007
76142
|
async function planPsmExchange(params) {
|
|
76008
76143
|
const { direction, amountIn, minOut, vctx, reads } = params;
|
|
@@ -76084,6 +76219,203 @@ async function executePsmPlan(plan, signer, vctx) {
|
|
|
76084
76219
|
});
|
|
76085
76220
|
return { ...exec, approvalHashes };
|
|
76086
76221
|
}
|
|
76222
|
+
var DESK_ABI = [
|
|
76223
|
+
"function quoteSellUCD(uint256 amountUCD) view returns (uint256 usdcOut, uint256 feeE18)",
|
|
76224
|
+
"function sellUCD(uint256 amountUCD, uint256 minUSDC) returns (uint256 usdcOut)",
|
|
76225
|
+
"function buyUCD(uint256 amountUSDC, uint256 minUCD) returns (uint256 ucdOut)",
|
|
76226
|
+
"function halted() view returns (bool)",
|
|
76227
|
+
"function haltReasons() view returns (bool psmPaused, bool redeemOff, bool reservesShort, bool oracleUnhealthy, bool unconfigured)",
|
|
76228
|
+
"function markE18() view returns (uint256)",
|
|
76229
|
+
"function freeUsdc() view returns (uint256)",
|
|
76230
|
+
"function deskParams() view returns ((uint256 iMax, uint256 sMax, uint256 rMin, uint32 haircutBps, uint32 feeSlopeBps, uint32 feeCapBps, uint32 reserveCoverageBps))",
|
|
76231
|
+
"function deskState() view returns (uint256 inventoryUCD, uint256 stUCDShares, uint256 claimableReserve, uint64 currentEpoch, uint64 oldestOpenEpoch, address backingOracle, address stUcd, address ucd)",
|
|
76232
|
+
"function exitsFrozen() view returns (bool)",
|
|
76233
|
+
"function paused() view returns (bool)",
|
|
76234
|
+
// IStUSDCDesk errors on the trade path.
|
|
76235
|
+
"error DeskHalted()",
|
|
76236
|
+
"error ZeroDeskAmount()",
|
|
76237
|
+
"error InventoryCapExceeded(uint256 inventoryAfter, uint256 iMax)",
|
|
76238
|
+
"error InsufficientLiquidity(uint256 free, uint256 needed)",
|
|
76239
|
+
"error InsufficientInventory(uint256 available, uint256 needed)",
|
|
76240
|
+
"error SlippageExceeded(uint256 out, uint256 min)",
|
|
76241
|
+
// StUSDCVault / OpenZeppelin gates the desk shares.
|
|
76242
|
+
"error ExitsAreFrozen(uint40 until)",
|
|
76243
|
+
"error EnforcedPause()"
|
|
76244
|
+
];
|
|
76245
|
+
function buildDeskApproveTx(p) {
|
|
76246
|
+
return {
|
|
76247
|
+
to: p.token,
|
|
76248
|
+
data: encodeSignable2("approve", [p.vault, p.amount]),
|
|
76249
|
+
value: "0x0",
|
|
76250
|
+
chainId: p.chainId
|
|
76251
|
+
};
|
|
76252
|
+
}
|
|
76253
|
+
function buildDeskSellTx(p) {
|
|
76254
|
+
return {
|
|
76255
|
+
to: p.vault,
|
|
76256
|
+
data: encodeSignable2("sellUCD", [p.amountUCD, p.minUSDC]),
|
|
76257
|
+
value: "0x0",
|
|
76258
|
+
chainId: p.chainId
|
|
76259
|
+
};
|
|
76260
|
+
}
|
|
76261
|
+
function buildDeskBuyTx(p) {
|
|
76262
|
+
return {
|
|
76263
|
+
to: p.vault,
|
|
76264
|
+
data: encodeSignable2("buyUCD", [p.amountUSDC, p.minUCD]),
|
|
76265
|
+
value: "0x0",
|
|
76266
|
+
chainId: p.chainId
|
|
76267
|
+
};
|
|
76268
|
+
}
|
|
76269
|
+
var ERC20_READS_ABI2 = ["function allowance(address owner, address spender) view returns (uint256)"];
|
|
76270
|
+
function deskReadsFromProvider(provider, vaultAddress) {
|
|
76271
|
+
const vault = new import_ethers37.ethers.Contract(vaultAddress, DESK_ABI, provider);
|
|
76272
|
+
return {
|
|
76273
|
+
quoteSellUCD: async (amountUCD) => {
|
|
76274
|
+
const r = await vault.getFunction("quoteSellUCD").staticCall(amountUCD);
|
|
76275
|
+
return { usdcOut: r[0], feeE18: r[1] };
|
|
76276
|
+
},
|
|
76277
|
+
status: async () => {
|
|
76278
|
+
const [halted, reasons, paused, exitsFrozen, markE18, freeUsdc, params, state] = await Promise.all([
|
|
76279
|
+
vault.getFunction("halted")(),
|
|
76280
|
+
vault.getFunction("haltReasons")(),
|
|
76281
|
+
vault.getFunction("paused")(),
|
|
76282
|
+
vault.getFunction("exitsFrozen")(),
|
|
76283
|
+
vault.getFunction("markE18")(),
|
|
76284
|
+
vault.getFunction("freeUsdc")(),
|
|
76285
|
+
vault.getFunction("deskParams")(),
|
|
76286
|
+
vault.getFunction("deskState")()
|
|
76287
|
+
]);
|
|
76288
|
+
return {
|
|
76289
|
+
halted,
|
|
76290
|
+
reasons: {
|
|
76291
|
+
psmPaused: reasons[0],
|
|
76292
|
+
redeemOff: reasons[1],
|
|
76293
|
+
reservesShort: reasons[2],
|
|
76294
|
+
oracleUnhealthy: reasons[3],
|
|
76295
|
+
unconfigured: reasons[4]
|
|
76296
|
+
},
|
|
76297
|
+
paused,
|
|
76298
|
+
exitsFrozen,
|
|
76299
|
+
markE18,
|
|
76300
|
+
freeUsdc,
|
|
76301
|
+
params: {
|
|
76302
|
+
iMax: params[0],
|
|
76303
|
+
sMax: params[1],
|
|
76304
|
+
rMin: params[2],
|
|
76305
|
+
haircutBps: Number(params[3]),
|
|
76306
|
+
feeSlopeBps: Number(params[4]),
|
|
76307
|
+
feeCapBps: Number(params[5]),
|
|
76308
|
+
reserveCoverageBps: Number(params[6])
|
|
76309
|
+
},
|
|
76310
|
+
state: {
|
|
76311
|
+
inventoryUCD: state[0],
|
|
76312
|
+
stUCDShares: state[1],
|
|
76313
|
+
claimableReserve: state[2],
|
|
76314
|
+
currentEpoch: state[3],
|
|
76315
|
+
oldestOpenEpoch: state[4],
|
|
76316
|
+
backingOracle: state[5],
|
|
76317
|
+
stUcd: state[6],
|
|
76318
|
+
ucd: state[7]
|
|
76319
|
+
}
|
|
76320
|
+
};
|
|
76321
|
+
},
|
|
76322
|
+
allowance: async (token, owner, spender) => await new import_ethers37.ethers.Contract(token, ERC20_READS_ABI2, provider).getFunction("allowance")(owner, spender)
|
|
76323
|
+
};
|
|
76324
|
+
}
|
|
76325
|
+
var refuse2 = (direction, msg) => new TxValidationError2(msg, `desk ${direction}`);
|
|
76326
|
+
function requireAddress2(direction, label, value) {
|
|
76327
|
+
if (!value || !import_ethers37.ethers.isAddress(value)) {
|
|
76328
|
+
throw refuse2(direction, `${label} address is missing or invalid (${String(value)})`);
|
|
76329
|
+
}
|
|
76330
|
+
return import_ethers37.ethers.getAddress(value);
|
|
76331
|
+
}
|
|
76332
|
+
async function planDesk(params) {
|
|
76333
|
+
const { direction, amountIn, minOut, vctx, reads } = params;
|
|
76334
|
+
const chainId = vctx.chainId;
|
|
76335
|
+
if (amountIn <= 0n) {
|
|
76336
|
+
throw refuse2(direction, `amount must be greater than zero (got ${amountIn})`);
|
|
76337
|
+
}
|
|
76338
|
+
if (minOut <= 0n) {
|
|
76339
|
+
throw refuse2(direction, `minimum-out floor must be greater than zero (got ${minOut}) \u2014 a zero floor is refused`);
|
|
76340
|
+
}
|
|
76341
|
+
const owner = requireAddress2(direction, "owner", params.owner);
|
|
76342
|
+
const vault = requireAddress2(direction, "StUSDCVault", params.vault);
|
|
76343
|
+
const token = requireAddress2(direction, params.tokenLabel, params.token);
|
|
76344
|
+
const approveExpected = (amount) => ({
|
|
76345
|
+
kind: "desk-approve",
|
|
76346
|
+
tokenAddress: token,
|
|
76347
|
+
vaultAddress: vault,
|
|
76348
|
+
amount: amount.toString()
|
|
76349
|
+
});
|
|
76350
|
+
const allowanceBefore = await reads.allowance(token, owner, vault);
|
|
76351
|
+
const approvals = [];
|
|
76352
|
+
if (allowanceBefore < amountIn) {
|
|
76353
|
+
if (allowanceBefore > 0n) {
|
|
76354
|
+
approvals.push({
|
|
76355
|
+
step: "reset-approve",
|
|
76356
|
+
tx: buildDeskApproveTx({ token, vault, amount: 0n, chainId }),
|
|
76357
|
+
expected: approveExpected(0n)
|
|
76358
|
+
});
|
|
76359
|
+
}
|
|
76360
|
+
approvals.push({
|
|
76361
|
+
step: "approve",
|
|
76362
|
+
tx: buildDeskApproveTx({ token, vault, amount: amountIn, chainId }),
|
|
76363
|
+
expected: approveExpected(amountIn)
|
|
76364
|
+
});
|
|
76365
|
+
}
|
|
76366
|
+
const exec = direction === "sell" ? {
|
|
76367
|
+
step: "sell",
|
|
76368
|
+
tx: buildDeskSellTx({ vault, amountUCD: amountIn, minUSDC: minOut, chainId }),
|
|
76369
|
+
expected: { kind: "desk-sell", vaultAddress: vault, amountUcdWei: amountIn.toString(), minUsdc: minOut.toString() }
|
|
76370
|
+
} : {
|
|
76371
|
+
step: "buy",
|
|
76372
|
+
tx: buildDeskBuyTx({ vault, amountUSDC: amountIn, minUCD: minOut, chainId }),
|
|
76373
|
+
expected: { kind: "desk-buy", vaultAddress: vault, amountUsdc: amountIn.toString(), minUcdWei: minOut.toString() }
|
|
76374
|
+
};
|
|
76375
|
+
for (const leg of [...approvals, exec]) {
|
|
76376
|
+
validateUnsignedTx2({ ...leg.tx }, leg.expected, vctx);
|
|
76377
|
+
}
|
|
76378
|
+
return { direction, owner, vault, token, amountIn, minOut, allowanceBefore, approvals, exec };
|
|
76379
|
+
}
|
|
76380
|
+
function planDeskSell(params) {
|
|
76381
|
+
return planDesk({
|
|
76382
|
+
direction: "sell",
|
|
76383
|
+
owner: params.owner,
|
|
76384
|
+
vault: params.addresses.vault,
|
|
76385
|
+
token: params.addresses.ucdToken,
|
|
76386
|
+
tokenLabel: "UCDToken",
|
|
76387
|
+
amountIn: params.amountUCD,
|
|
76388
|
+
minOut: params.minUSDC,
|
|
76389
|
+
vctx: params.vctx,
|
|
76390
|
+
reads: params.reads
|
|
76391
|
+
});
|
|
76392
|
+
}
|
|
76393
|
+
async function executeDeskPlan(plan, signer, vctx) {
|
|
76394
|
+
const approvalHashes = [];
|
|
76395
|
+
const residual = () => approvalHashes.length === 0 ? "" : ` An approval already landed (tx ${approvalHashes[approvalHashes.length - 1]}): an allowance of exactly ${plan.amountIn} to ${plan.vault} stands. It authorizes only that amount; the next trade uses or replaces it.`;
|
|
76396
|
+
const sendLeg = async (leg) => {
|
|
76397
|
+
const request = { to: leg.tx.to, data: leg.tx.data, value: 0n, chainId: leg.tx.chainId };
|
|
76398
|
+
validateUnsignedTx2({ ...request }, leg.expected, vctx);
|
|
76399
|
+
const sent = await signer.sendTransaction(request);
|
|
76400
|
+
const receipt = await sent.wait();
|
|
76401
|
+
if (!receipt)
|
|
76402
|
+
throw new Error(`desk ${leg.step} tx ${sent.hash} returned no receipt`);
|
|
76403
|
+
if (receipt.status !== 1)
|
|
76404
|
+
throw new Error(`desk ${leg.step} tx ${sent.hash} reverted`);
|
|
76405
|
+
return { hash: sent.hash, blockNumber: receipt.blockNumber };
|
|
76406
|
+
};
|
|
76407
|
+
for (const leg of plan.approvals) {
|
|
76408
|
+
const landed = await sendLeg(leg).catch((e) => {
|
|
76409
|
+
throw new Error(`desk ${leg.step} failed: ${e instanceof Error ? e.message : String(e)}.${residual()}`);
|
|
76410
|
+
});
|
|
76411
|
+
approvalHashes.push(landed.hash);
|
|
76412
|
+
}
|
|
76413
|
+
const exec = await sendLeg(plan.exec).catch((e) => {
|
|
76414
|
+
throw new Error(`desk ${plan.exec.step} failed: ${e instanceof Error ? e.message : String(e)}.${residual()}`);
|
|
76415
|
+
});
|
|
76416
|
+
return { ...exec, approvalHashes };
|
|
76417
|
+
}
|
|
76418
|
+
init_deployment_addresses();
|
|
76087
76419
|
var LIT_ACTION_CHAIN_NAMES = Object.freeze({
|
|
76088
76420
|
1: "ethereum",
|
|
76089
76421
|
11155111: "sepolia",
|
|
@@ -76322,14 +76654,18 @@ function formatLiquidationFailureMessage(loanId, errorMessage, btcVault, btcVaul
|
|
|
76322
76654
|
var CONTRACT_ERROR_FRAGMENTS = [
|
|
76323
76655
|
{ fragment: "error AboveMaxRedeem(uint256 amount, uint256 maximum)", contracts: ["SimplePSMV2"] },
|
|
76324
76656
|
{ fragment: "error AboveMaxSwap(uint256 amount, uint256 maximum)", contracts: ["SimplePSMV2"] },
|
|
76325
|
-
{ fragment: "error AccessControlBadConfirmation()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
76326
|
-
{ fragment: "error AccessControlUnauthorizedAccount(address account, bytes32 neededRole)", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
76327
|
-
{ fragment: "error AddressEmptyCode(address target)", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
76657
|
+
{ fragment: "error AccessControlBadConfirmation()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
|
|
76658
|
+
{ fragment: "error AccessControlUnauthorizedAccount(address account, bytes32 neededRole)", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
|
|
76659
|
+
{ fragment: "error AddressEmptyCode(address target)", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
|
|
76328
76660
|
{ fragment: "error AlreadyActive()", contracts: ["PositionManagerErrors"] },
|
|
76661
|
+
{ fragment: "error AlreadyClaimed()", contracts: ["StUSDCVault"] },
|
|
76662
|
+
{ fragment: "error AlreadySeeded()", contracts: ["StUSDCVault"] },
|
|
76329
76663
|
{ fragment: "error AlreadySigned()", contracts: ["PositionManagerErrors", "OperationAuthorizationRegistry"] },
|
|
76330
76664
|
{ fragment: "error AmountMustBePositive()", contracts: ["LoanOperationsManagerModule", "SimplePSMV2"] },
|
|
76331
76665
|
{ fragment: "error ArrayLengthMismatch()", contracts: ["BTCSpendAuthorizer", "SimplePSMV2"] },
|
|
76666
|
+
{ fragment: "error AssetMismatch()", contracts: ["StUSDCVault"] },
|
|
76332
76667
|
{ fragment: "error BTCSpendAuthorizerNotSet()", contracts: ["LoanOperationsManagerModule"] },
|
|
76668
|
+
{ fragment: "error BadRecoveryDestination(address to)", contracts: ["StUSDCVault"] },
|
|
76333
76669
|
{ fragment: "error BalanceMismatch()", contracts: ["UCDController"] },
|
|
76334
76670
|
{ fragment: "error BatchSizeTooLarge()", contracts: ["BTCSpendAuthorizer"] },
|
|
76335
76671
|
{ fragment: "error BelowMinRedeem(uint256 amount, uint256 minimum)", contracts: ["SimplePSMV2"] },
|
|
@@ -76344,7 +76680,7 @@ var CONTRACT_ERROR_FRAGMENTS = [
|
|
|
76344
76680
|
{ fragment: "error BurnGuardFailed(uint8 code)", contracts: ["UCDController"] },
|
|
76345
76681
|
{ fragment: "error BurnVerificationFailed()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
76346
76682
|
{ fragment: "error CannotRemoveLastTerm()", contracts: ["PositionManagerErrors"] },
|
|
76347
|
-
{ fragment: "error CannotUpgradeToSelf()", contracts: ["PositionManagerErrors", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer"] },
|
|
76683
|
+
{ fragment: "error CannotUpgradeToSelf()", contracts: ["PositionManagerErrors", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "StUSDCVault"] },
|
|
76348
76684
|
{ fragment: "error CircuitBreakerNotActive()", contracts: ["PositionManagerErrors"] },
|
|
76349
76685
|
{ fragment: "error CircuitBreakerTriggered()", contracts: ["PositionManagerErrors"] },
|
|
76350
76686
|
{ fragment: "error CollateralOverflow()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule"] },
|
|
@@ -76360,39 +76696,62 @@ var CONTRACT_ERROR_FRAGMENTS = [
|
|
|
76360
76696
|
{ fragment: "error DebtUpdateVerificationFailedDetailed(bytes32 positionId, uint256 currentDebt, uint256 newDebt, uint256 quantumTimestamp, uint256 supplyAfterMint, uint256 expectedIncrease)", contracts: ["LoanOperationsManagerModule"] },
|
|
76361
76697
|
{ fragment: "error DecimalsMismatch(uint8 provided, uint8 actual)", contracts: ["SimplePSMV2"] },
|
|
76362
76698
|
{ fragment: "error DecimalsQueryFailed()", contracts: ["SimplePSMV2"] },
|
|
76699
|
+
{ fragment: "error DeskHalted()", contracts: ["StUSDCVault"] },
|
|
76700
|
+
{ fragment: "error DeskParamOutOfRange()", contracts: ["StUSDCVault"] },
|
|
76363
76701
|
{ fragment: "error DivisionByZero()", contracts: ["PositionManager", "CollateralManagerModule"] },
|
|
76364
76702
|
{ fragment: "error ECDSAInvalidSignature()", contracts: ["BTCSpendAuthorizer"] },
|
|
76365
76703
|
{ fragment: "error ECDSAInvalidSignatureLength(uint256 length)", contracts: ["BTCSpendAuthorizer"] },
|
|
76366
76704
|
{ fragment: "error ECDSAInvalidSignatureS(bytes32 s)", contracts: ["BTCSpendAuthorizer"] },
|
|
76367
|
-
{ fragment: "error ERC1967InvalidImplementation(address implementation)", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
76368
|
-
{ fragment: "error ERC1967NonPayable()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
76369
|
-
{ fragment: "error
|
|
76705
|
+
{ fragment: "error ERC1967InvalidImplementation(address implementation)", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
|
|
76706
|
+
{ fragment: "error ERC1967NonPayable()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
|
|
76707
|
+
{ fragment: "error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed)", contracts: ["StUSDCVault"] },
|
|
76708
|
+
{ fragment: "error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed)", contracts: ["StUSDCVault"] },
|
|
76709
|
+
{ fragment: "error ERC20InvalidApprover(address approver)", contracts: ["StUSDCVault"] },
|
|
76710
|
+
{ fragment: "error ERC20InvalidReceiver(address receiver)", contracts: ["StUSDCVault"] },
|
|
76711
|
+
{ fragment: "error ERC20InvalidSender(address sender)", contracts: ["StUSDCVault"] },
|
|
76712
|
+
{ fragment: "error ERC20InvalidSpender(address spender)", contracts: ["StUSDCVault"] },
|
|
76713
|
+
{ fragment: "error ERC4626ExceededMaxDeposit(address receiver, uint256 assets, uint256 max)", contracts: ["StUSDCVault"] },
|
|
76714
|
+
{ fragment: "error ERC4626ExceededMaxMint(address receiver, uint256 shares, uint256 max)", contracts: ["StUSDCVault"] },
|
|
76715
|
+
{ fragment: "error ERC4626ExceededMaxRedeem(address owner, uint256 shares, uint256 max)", contracts: ["StUSDCVault"] },
|
|
76716
|
+
{ fragment: "error ERC4626ExceededMaxWithdraw(address owner, uint256 assets, uint256 max)", contracts: ["StUSDCVault"] },
|
|
76717
|
+
{ fragment: "error EnforcedPause()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
|
|
76370
76718
|
{ fragment: "error EntryFeeTooHigh(uint256 fee, uint256 max)", contracts: ["SimplePSMV2"] },
|
|
76719
|
+
{ fragment: "error EpochAlreadyPriced()", contracts: ["StUSDCVault"] },
|
|
76720
|
+
{ fragment: "error EpochNotComplete()", contracts: ["StUSDCVault"] },
|
|
76721
|
+
{ fragment: "error EpochNotOpen()", contracts: ["StUSDCVault"] },
|
|
76371
76722
|
{ fragment: "error ExceedsFeeBalance(uint256 requested, uint256 max)", contracts: ["SimplePSMV2"] },
|
|
76372
76723
|
{ fragment: "error ExceedsMaxLoan()", contracts: ["PositionManagerErrors"] },
|
|
76724
|
+
{ fragment: "error ExceedsUntracked(uint256 untracked, uint256 amount)", contracts: ["StUSDCVault"] },
|
|
76373
76725
|
{ fragment: "error ExitFeeTooHigh(uint256 fee, uint256 max)", contracts: ["SimplePSMV2"] },
|
|
76374
|
-
{ fragment: "error
|
|
76726
|
+
{ fragment: "error ExitsAreFrozen(uint40 until)", contracts: ["StUSDCVault"] },
|
|
76727
|
+
{ fragment: "error ExpectedPause()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
|
|
76375
76728
|
{ fragment: "error ExtensionFeeMintingFailed()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
76376
76729
|
{ fragment: "error ExtensionNotAllowed()", contracts: ["PositionManagerErrors"] },
|
|
76377
|
-
{ fragment: "error FailedCall()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
76730
|
+
{ fragment: "error FailedCall()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
|
|
76378
76731
|
{ fragment: "error FailedToGetStablecoinDecimals()", contracts: ["SimplePSMV2"] },
|
|
76379
76732
|
{ fragment: "error FailedToGetUCDDecimals()", contracts: ["SimplePSMV2"] },
|
|
76380
76733
|
{ fragment: "error FeeOnTransferNotSupported()", contracts: ["SimplePSMV2"] },
|
|
76381
76734
|
{ fragment: "error FeeTooHigh(uint256 fee, uint256 max)", contracts: ["PositionManagerErrors"] },
|
|
76382
76735
|
{ fragment: "error FeeTooLow(uint256 fee, uint256 min)", contracts: ["PositionManagerErrors"] },
|
|
76736
|
+
{ fragment: "error FreezeBoundOutOfRange(uint40 value, uint40 min, uint40 max)", contracts: ["StUSDCVault"] },
|
|
76737
|
+
{ fragment: "error FreezeCooldown(uint40 availableAt)", contracts: ["StUSDCVault"] },
|
|
76738
|
+
{ fragment: "error FreezeInPast(uint40 until)", contracts: ["StUSDCVault"] },
|
|
76739
|
+
{ fragment: "error FreezeTooLong(uint40 until, uint40 latestAllowed)", contracts: ["StUSDCVault"] },
|
|
76383
76740
|
{ fragment: "error GlobalReentrancyGuardReentrantCall()", contracts: ["PositionManager", "CollateralManagerModule"] },
|
|
76384
76741
|
{ fragment: "error ImplNotDeployed()", contracts: ["LoanOperationsManagerModule", "BTCSpendAuthorizer"] },
|
|
76385
|
-
{ fragment: "error ImplementationNotDeployed()", contracts: ["UCDController"] },
|
|
76742
|
+
{ fragment: "error ImplementationNotDeployed()", contracts: ["UCDController", "StUSDCVault"] },
|
|
76386
76743
|
{ fragment: "error InitialBalanceTooLarge()", contracts: ["SimplePSMV2"] },
|
|
76387
76744
|
{ fragment: "error InsufficientBalance()", contracts: ["PositionManagerErrors"] },
|
|
76388
76745
|
{ fragment: "error InsufficientCollateralForAmount()", contracts: ["PositionManagerErrors"] },
|
|
76389
76746
|
{ fragment: "error InsufficientCollateralRatio()", contracts: ["CollateralManagerModule"] },
|
|
76390
76747
|
{ fragment: "error InsufficientFeeBal()", contracts: ["LoanOperationsManagerModule"] },
|
|
76748
|
+
{ fragment: "error InsufficientInventory(uint256 available, uint256 needed)", contracts: ["StUSDCVault"] },
|
|
76749
|
+
{ fragment: "error InsufficientLiquidity(uint256 free, uint256 needed)", contracts: ["StUSDCVault"] },
|
|
76391
76750
|
{ fragment: "error InsufficientReserves(uint256 available, uint256 required)", contracts: ["SimplePSMV2"] },
|
|
76392
76751
|
{ fragment: "error InsufficientSignatures()", contracts: ["OperationAuthorizationRegistry"] },
|
|
76393
76752
|
{ fragment: "error IntegrityCheckFailed()", contracts: ["PositionManagerErrors"] },
|
|
76394
76753
|
{ fragment: "error InvalidActionHash()", contracts: ["CollateralManagerModule"] },
|
|
76395
|
-
{ fragment: "error InvalidAddress()", contracts: ["PositionManager", "PositionManagerErrors", "OperationAuthorizationRegistry", "CollateralManagerModule", "SimplePSMV2"] },
|
|
76754
|
+
{ fragment: "error InvalidAddress()", contracts: ["PositionManager", "PositionManagerErrors", "OperationAuthorizationRegistry", "CollateralManagerModule", "SimplePSMV2", "StUSDCVault"] },
|
|
76396
76755
|
{ fragment: "error InvalidAdmin()", contracts: ["LoanOperationsManagerModule", "BTCSpendAuthorizer", "SimplePSMV2"] },
|
|
76397
76756
|
{ fragment: "error InvalidAmount()", contracts: ["PositionManagerErrors", "SimplePSMV2"] },
|
|
76398
76757
|
{ fragment: "error InvalidBTCPrice()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
@@ -76403,7 +76762,7 @@ var CONTRACT_ERROR_FRAGMENTS = [
|
|
|
76403
76762
|
{ fragment: "error InvalidExchangeRate()", contracts: ["SimplePSMV2"] },
|
|
76404
76763
|
{ fragment: "error InvalidImpl()", contracts: ["LoanOperationsManagerModule", "BTCSpendAuthorizer"] },
|
|
76405
76764
|
{ fragment: "error InvalidImplementation()", contracts: ["UCDController"] },
|
|
76406
|
-
{ fragment: "error InvalidInitialization()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
76765
|
+
{ fragment: "error InvalidInitialization()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
|
|
76407
76766
|
{ fragment: "error InvalidLitSignature()", contracts: ["BTCSpendAuthorizer"] },
|
|
76408
76767
|
{ fragment: "error InvalidLoanOps()", contracts: ["BTCSpendAuthorizer"] },
|
|
76409
76768
|
{ fragment: "error InvalidModuleAddress()", contracts: ["UCDController"] },
|
|
@@ -76439,6 +76798,7 @@ var CONTRACT_ERROR_FRAGMENTS = [
|
|
|
76439
76798
|
{ fragment: "error InvalidVolumeCap(bool isRedeem)", contracts: ["SimplePSMV2"] },
|
|
76440
76799
|
{ fragment: "error InvalidWithdrawalAddress()", contracts: ["CollateralManagerModule"] },
|
|
76441
76800
|
{ fragment: "error InvalidWithdrawalLoanStatusType()", contracts: ["CollateralManagerModule"] },
|
|
76801
|
+
{ fragment: "error InventoryCapExceeded(uint256 totalUcdAfter, uint256 iMax)", contracts: ["StUSDCVault"] },
|
|
76442
76802
|
{ fragment: "error LiquidationsPaused()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
76443
76803
|
{ fragment: "error LoanAmountTooHigh()", contracts: ["PositionManagerErrors"] },
|
|
76444
76804
|
{ fragment: "error LoanAmountTooLow()", contracts: ["PositionManagerErrors"] },
|
|
@@ -76464,23 +76824,31 @@ var CONTRACT_ERROR_FRAGMENTS = [
|
|
|
76464
76824
|
{ fragment: "error NoVersion()", contracts: ["LoanOperationsManagerModule", "BTCSpendAuthorizer", "UCDController"] },
|
|
76465
76825
|
{ fragment: "error NonZeroReserves(address stablecoin, uint256 reserves)", contracts: ["SimplePSMV2"] },
|
|
76466
76826
|
{ fragment: "error NormalizationOverflow()", contracts: ["SimplePSMV2"] },
|
|
76467
|
-
{ fragment: "error
|
|
76827
|
+
{ fragment: "error NotATransferFee(bytes4 selector)", contracts: ["StUSDCVault"] },
|
|
76828
|
+
{ fragment: "error NotAdminModule()", contracts: ["PositionManager", "PositionManagerErrors", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
|
|
76829
|
+
{ fragment: "error NotArrived(uint256 available, uint256 amount)", contracts: ["StUSDCVault"] },
|
|
76468
76830
|
{ fragment: "error NotAuthorized()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
76469
76831
|
{ fragment: "error NotAuthorizedConsumer()", contracts: ["OperationAuthorizationRegistry"] },
|
|
76470
76832
|
{ fragment: "error NotAuthorizedSigner()", contracts: ["OperationAuthorizationRegistry"] },
|
|
76471
76833
|
{ fragment: "error NotBorrower()", contracts: ["PositionManager", "PositionManagerErrors", "LoanOperationsManagerModule"] },
|
|
76834
|
+
{ fragment: "error NotCarryReceiver(address caller)", contracts: ["StUSDCVault"] },
|
|
76472
76835
|
{ fragment: "error NotContract()", contracts: ["PositionManagerErrors", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "SimplePSMV2"] },
|
|
76473
|
-
{ fragment: "error
|
|
76836
|
+
{ fragment: "error NotController()", contracts: ["StUSDCVault"] },
|
|
76837
|
+
{ fragment: "error NotInitializing()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
|
|
76474
76838
|
{ fragment: "error NotLiquidationPkpOwner()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
76475
76839
|
{ fragment: "error NotLiquidator()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
76476
76840
|
{ fragment: "error NotOwner()", contracts: ["OperationAuthorizationRegistry"] },
|
|
76477
76841
|
{ fragment: "error NotPendingOwner()", contracts: ["OperationAuthorizationRegistry"] },
|
|
76478
76842
|
{ fragment: "error NotProductionAuthorizer()", contracts: ["PositionManagerErrors", "LoanOperationsManagerModule"] },
|
|
76479
76843
|
{ fragment: "error NotProductionRegistry()", contracts: ["PositionManager", "PositionManagerErrors", "LoanOperationsManagerModule"] },
|
|
76844
|
+
{ fragment: "error NotSeeded()", contracts: ["StUSDCVault"] },
|
|
76845
|
+
{ fragment: "error NotSeeder(address caller)", contracts: ["StUSDCVault"] },
|
|
76846
|
+
{ fragment: "error NothingToFulfil()", contracts: ["StUSDCVault"] },
|
|
76480
76847
|
{ fragment: "error OnlyCore()", contracts: ["CollateralManagerModule"] },
|
|
76481
76848
|
{ fragment: "error OnlyLoanOps()", contracts: ["BTCSpendAuthorizer"] },
|
|
76482
76849
|
{ fragment: "error OnlyPosMgr()", contracts: ["LoanOperationsManagerModule"] },
|
|
76483
76850
|
{ fragment: "error OnlyPositionManager()", contracts: ["LoanOperationsManagerModule"] },
|
|
76851
|
+
{ fragment: "error OpNotExecuted(bytes32 sweepId)", contracts: ["StUSDCVault"] },
|
|
76484
76852
|
{ fragment: "error OperationInProgress()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
76485
76853
|
{ fragment: "error OracleDecimalMismatch()", contracts: ["LoanOperationsManagerModule"] },
|
|
76486
76854
|
{ fragment: "error PKPAlreadyUsed()", contracts: ["PositionManagerErrors"] },
|
|
@@ -76488,6 +76856,7 @@ var CONTRACT_ERROR_FRAGMENTS = [
|
|
|
76488
76856
|
{ fragment: "error PaymentAmountZero()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
76489
76857
|
{ fragment: "error PaymentMustBeLessThanDebt()", contracts: ["LoanOperationsManagerModule"] },
|
|
76490
76858
|
{ fragment: "error PaymentMustBePositive()", contracts: ["LoanOperationsManagerModule"] },
|
|
76859
|
+
{ fragment: "error PeriodOutOfBounds(uint40 period, uint40 min, uint40 max)", contracts: ["StUSDCVault"] },
|
|
76491
76860
|
{ fragment: "error PositionAlreadyExists()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
76492
76861
|
{ fragment: "error PositionDoesNotExist()", contracts: ["CollateralManagerModule"] },
|
|
76493
76862
|
{ fragment: "error PositionLiquidatable()", contracts: ["PositionManagerErrors"] },
|
|
@@ -76518,22 +76887,29 @@ var CONTRACT_ERROR_FRAGMENTS = [
|
|
|
76518
76887
|
{ fragment: "error ReserveOverflow()", contracts: ["SimplePSMV2"] },
|
|
76519
76888
|
{ fragment: "error ReserveTooLarge()", contracts: ["SimplePSMV2"] },
|
|
76520
76889
|
{ fragment: "error ReserveUnderflow()", contracts: ["SimplePSMV2"] },
|
|
76521
|
-
{ fragment: "error
|
|
76890
|
+
{ fragment: "error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value)", contracts: ["StUSDCVault"] },
|
|
76891
|
+
{ fragment: "error SafeERC20FailedOperation(address token)", contracts: ["PositionManager", "LoanOperationsManagerModule", "SimplePSMV2", "StUSDCVault"] },
|
|
76522
76892
|
{ fragment: "error SameBlockInteraction()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
76523
76893
|
{ fragment: "error SameImpl()", contracts: ["LoanOperationsManagerModule", "BTCSpendAuthorizer"] },
|
|
76524
76894
|
{ fragment: "error SameImplementation()", contracts: ["PositionManagerErrors", "CollateralManagerModule"] },
|
|
76895
|
+
{ fragment: "error SeedTooSmall(uint256 amount, uint256 min)", contracts: ["StUSDCVault"] },
|
|
76525
76896
|
{ fragment: "error SignatureVerificationFailed(bytes4 selector, address recovered, address expected, bytes32 messageHash, uint8 errorCode)", contracts: ["OperationAuthorizationRegistry"] },
|
|
76526
76897
|
{ fragment: "error SlippageExceeded(uint256 got, uint256 minimum)", contracts: ["SimplePSMV2"] },
|
|
76898
|
+
{ fragment: "error SlippageExceeded(uint256 out, uint256 min)", contracts: ["StUSDCVault"] },
|
|
76527
76899
|
{ fragment: "error SlippageProtectionRequired()", contracts: ["SimplePSMV2"] },
|
|
76900
|
+
{ fragment: "error StUcdHeld()", contracts: ["StUSDCVault"] },
|
|
76528
76901
|
{ fragment: "error StablecoinAlreadySupported(address stablecoin)", contracts: ["SimplePSMV2"] },
|
|
76529
76902
|
{ fragment: "error StablecoinNotContract(address stablecoin)", contracts: ["SimplePSMV2"] },
|
|
76530
76903
|
{ fragment: "error StablecoinNotSupported(address stablecoin)", contracts: ["SimplePSMV2"] },
|
|
76531
76904
|
{ fragment: "error StablecoinNotSupportedInV1(address stablecoin)", contracts: ["SimplePSMV2"] },
|
|
76905
|
+
{ fragment: "error StakeCapExceeded(uint256 value, uint256 sMax)", contracts: ["StUSDCVault"] },
|
|
76532
76906
|
{ fragment: "error StaleAttestationMismatch()", contracts: ["BTCSpendAuthorizer"] },
|
|
76533
76907
|
{ fragment: "error StaleAttestationTooOld()", contracts: ["BTCSpendAuthorizer"] },
|
|
76534
76908
|
{ fragment: "error StaleSpendValidatorNotSet()", contracts: ["BTCSpendAuthorizer"] },
|
|
76535
76909
|
{ fragment: "error StateHashMismatch()", contracts: ["LoanOperationsValidation", "LoanOperationsManagerModule", "CollateralManagerModule"] },
|
|
76536
76910
|
{ fragment: "error SwapVolumeExceededThisBlock(address stablecoin, uint256 attempted, uint256 cap)", contracts: ["SimplePSMV2"] },
|
|
76911
|
+
{ fragment: "error SweepAlreadyCredited(bytes32 sweepId)", contracts: ["StUSDCVault"] },
|
|
76912
|
+
{ fragment: "error SweepMismatch()", contracts: ["StUSDCVault"] },
|
|
76537
76913
|
{ fragment: "error SyncDriftTooLarge()", contracts: ["SimplePSMV2"] },
|
|
76538
76914
|
{ fragment: "error TargetAddrRequired()", contracts: ["BTCSpendAuthorizer"] },
|
|
76539
76915
|
{ fragment: "error TargetExceedsInputValue()", contracts: ["BTCSpendAuthorizer"] },
|
|
@@ -76548,11 +76924,12 @@ var CONTRACT_ERROR_FRAGMENTS = [
|
|
|
76548
76924
|
{ fragment: "error TooManySigners()", contracts: ["OperationAuthorizationRegistry"] },
|
|
76549
76925
|
{ fragment: "error UTXOAlreadyAuthorized()", contracts: ["BTCSpendAuthorizer"] },
|
|
76550
76926
|
{ fragment: "error UTXONotAuthorized()", contracts: ["BTCSpendAuthorizer"] },
|
|
76551
|
-
{ fragment: "error UUPSUnauthorizedCallContext()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
76552
|
-
{ fragment: "error UUPSUnsupportedProxiableUUID(bytes32 slot)", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
76927
|
+
{ fragment: "error UUPSUnauthorizedCallContext()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
|
|
76928
|
+
{ fragment: "error UUPSUnsupportedProxiableUUID(bytes32 slot)", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
|
|
76553
76929
|
{ fragment: "error UcdAmountTooLarge()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule"] },
|
|
76554
76930
|
{ fragment: "error Unauthorized()", contracts: ["UCDController"] },
|
|
76555
|
-
{ fragment: "error UnexpectedRoleGrantFailure()", contracts: ["PositionManager", "PositionManagerErrors", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
76931
|
+
{ fragment: "error UnexpectedRoleGrantFailure()", contracts: ["PositionManager", "PositionManagerErrors", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
|
|
76932
|
+
{ fragment: "error UnknownSource(address target)", contracts: ["StUSDCVault"] },
|
|
76556
76933
|
{ fragment: "error UnsupportedFeeToken(address token)", contracts: ["SimplePSMV2"] },
|
|
76557
76934
|
{ fragment: "error UserDailyMintLimitExceeded()", contracts: ["LoanOperationsManagerModule"] },
|
|
76558
76935
|
{ fragment: "error V2AlreadyInitialized()", contracts: ["SimplePSMV2"] },
|
|
@@ -76561,32 +76938,29 @@ var CONTRACT_ERROR_FRAGMENTS = [
|
|
|
76561
76938
|
{ fragment: "error WithdrawalAddressNotApproved()", contracts: ["CollateralManagerModule"] },
|
|
76562
76939
|
{ fragment: "error WithdrawalExceedsReserves(uint256 amount, uint256 reserves)", contracts: ["SimplePSMV2"] },
|
|
76563
76940
|
{ fragment: "error ZeroAddress()", contracts: ["PositionManager", "UCDController"] },
|
|
76564
|
-
{ fragment: "error ZeroAmount()", contracts: ["UCDController"] }
|
|
76941
|
+
{ fragment: "error ZeroAmount()", contracts: ["UCDController", "StUSDCVault"] },
|
|
76942
|
+
{ fragment: "error ZeroDeskAmount()", contracts: ["StUSDCVault"] }
|
|
76565
76943
|
];
|
|
76566
76944
|
var TABLE = null;
|
|
76567
76945
|
function contractErrorTable() {
|
|
76568
76946
|
if (TABLE)
|
|
76569
76947
|
return TABLE;
|
|
76570
76948
|
const table = /* @__PURE__ */ new Map();
|
|
76571
|
-
const
|
|
76572
|
-
|
|
76573
|
-
CONTRACT_ERROR_FRAGMENTS.map((e) => [e.fragment.slice("error ".length, e.fragment.indexOf("(")), e.contracts])
|
|
76574
|
-
);
|
|
76575
|
-
iface.forEachError((fragment) => {
|
|
76949
|
+
for (const generated of CONTRACT_ERROR_FRAGMENTS) {
|
|
76950
|
+
const fragment = import_ethers38.ErrorFragment.from(generated.fragment);
|
|
76576
76951
|
const existing = table.get(fragment.selector);
|
|
76577
|
-
const contracts = contractsByName.get(fragment.name) ?? [];
|
|
76578
76952
|
if (existing) {
|
|
76579
|
-
for (const c of contracts)
|
|
76953
|
+
for (const c of generated.contracts)
|
|
76580
76954
|
if (!existing.contracts.includes(c))
|
|
76581
76955
|
existing.contracts.push(c);
|
|
76582
|
-
|
|
76956
|
+
continue;
|
|
76583
76957
|
}
|
|
76584
76958
|
table.set(fragment.selector, {
|
|
76585
76959
|
signature: fragment.format("sighash"),
|
|
76586
76960
|
fragment,
|
|
76587
|
-
contracts: [...contracts]
|
|
76961
|
+
contracts: [...generated.contracts]
|
|
76588
76962
|
});
|
|
76589
|
-
}
|
|
76963
|
+
}
|
|
76590
76964
|
TABLE = table;
|
|
76591
76965
|
return table;
|
|
76592
76966
|
}
|
|
@@ -76677,7 +77051,7 @@ function decodeContractError(error) {
|
|
|
76677
77051
|
const contract = entry.contracts.join(" | ");
|
|
76678
77052
|
let args = [];
|
|
76679
77053
|
try {
|
|
76680
|
-
const decoded = new
|
|
77054
|
+
const decoded = new import_ethers38.Interface([entry.fragment]).decodeErrorResult(entry.fragment, errorData);
|
|
76681
77055
|
args = Array.from(decoded);
|
|
76682
77056
|
} catch {
|
|
76683
77057
|
args = [];
|
|
@@ -77519,7 +77893,7 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
|
|
|
77519
77893
|
addEndpoint("config.provider", enrichedConfig.provider);
|
|
77520
77894
|
addEndpoint("the contractSigner's provider", enrichedConfig.contractSigner?.provider);
|
|
77521
77895
|
addEndpoint("the litOpsSigner's provider", enrichedConfig.litOpsSigner?.provider);
|
|
77522
|
-
if (enrichedConfig.ethRpcUrl?.trim()) {
|
|
77896
|
+
if (!enrichedConfig.provider && enrichedConfig.ethRpcUrl?.trim()) {
|
|
77523
77897
|
addEndpoint("ethRpcUrl", new import_ethers13.JsonRpcProvider(enrichedConfig.ethRpcUrl.trim()));
|
|
77524
77898
|
}
|
|
77525
77899
|
const refusal = await describeStandaloneMainnetRefusal(config.chainId, endpoints);
|
|
@@ -78858,15 +79232,13 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
|
|
|
78858
79232
|
signatureHexMint
|
|
78859
79233
|
]);
|
|
78860
79234
|
const fromAddress = await signer.getAddress();
|
|
79235
|
+
let mintSubmission;
|
|
78861
79236
|
try {
|
|
78862
|
-
await
|
|
78863
|
-
provider: signerProvider,
|
|
79237
|
+
mintSubmission = await this.prepareQuantumSend("mintUCD", {
|
|
78864
79238
|
to: positionManagerAddress,
|
|
78865
79239
|
from: fromAddress,
|
|
78866
79240
|
data: mintCalldata,
|
|
78867
|
-
quantumTimestamp: Number(validationResponse.timestamp)
|
|
78868
|
-
laneGuardActive: await this.isLocalLaneGuardActive(),
|
|
78869
|
-
onDebug: this.config.debug ? (msg) => log.info(msg, {}) : void 0
|
|
79241
|
+
quantumTimestamp: Number(validationResponse.timestamp)
|
|
78870
79242
|
});
|
|
78871
79243
|
} catch (simError) {
|
|
78872
79244
|
if (!(simError instanceof QuantumRevertError)) {
|
|
@@ -78884,7 +79256,7 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
|
|
|
78884
79256
|
[
|
|
78885
79257
|
"function diagnoseMintUCD(bytes32,uint256,uint256,uint256,uint256,uint256,bytes32,bytes32,bytes32,uint256,bytes) view returns (string)"
|
|
78886
79258
|
],
|
|
78887
|
-
|
|
79259
|
+
this.getProviderOrThrow()
|
|
78888
79260
|
);
|
|
78889
79261
|
diagnosis = await views["diagnoseMintUCD"](
|
|
78890
79262
|
request.positionId,
|
|
@@ -78991,7 +79363,7 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
|
|
|
78991
79363
|
feeProvider: this.getProviderOrThrow(),
|
|
78992
79364
|
to: positionManagerAddress,
|
|
78993
79365
|
data: mintCalldata,
|
|
78994
|
-
gasLimit:
|
|
79366
|
+
gasLimit: mintSubmission.gasLimit
|
|
78995
79367
|
});
|
|
78996
79368
|
const receipt = await signerProvider.waitForTransaction(
|
|
78997
79369
|
tx2.hash,
|
|
@@ -79652,16 +80024,26 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
|
|
|
79652
80024
|
if (this.config.debug) {
|
|
79653
80025
|
log.info(`\u{1F512} Executing commit phase...`);
|
|
79654
80026
|
}
|
|
79655
|
-
const
|
|
80027
|
+
const commitArgs = [
|
|
79656
80028
|
positionIdBytes32,
|
|
79657
80029
|
BigInt(quantumTimestamp.toString()),
|
|
79658
80030
|
BigInt(btcPrice.toString()),
|
|
79659
80031
|
BigInt(
|
|
79660
80032
|
(litActionResult.btcAmountSats || "0").toString()
|
|
79661
80033
|
),
|
|
79662
|
-
litActionResult.signature || "0x"
|
|
79663
|
-
|
|
79664
|
-
|
|
80034
|
+
litActionResult.signature || "0x"
|
|
80035
|
+
];
|
|
80036
|
+
const liquidationTarget = await positionManager.getAddress();
|
|
80037
|
+
const liquidationFrom = await this.getSignerOrThrow().getAddress();
|
|
80038
|
+
const commitSubmission = await this.prepareQuantumSend("commitLiquidation", {
|
|
80039
|
+
to: liquidationTarget,
|
|
80040
|
+
from: liquidationFrom,
|
|
80041
|
+
data: positionManager.interface.encodeFunctionData("commitLiquidation", [...commitArgs]),
|
|
80042
|
+
quantumTimestamp: Number(quantumTimestamp)
|
|
80043
|
+
});
|
|
80044
|
+
const commitTx = await positionManager["commitLiquidation"](
|
|
80045
|
+
...commitArgs,
|
|
80046
|
+
{ gasLimit: commitSubmission.gasLimit }
|
|
79665
80047
|
);
|
|
79666
80048
|
const commitReceipt = await commitTx.wait();
|
|
79667
80049
|
if (this.config.debug) {
|
|
@@ -79784,15 +80166,23 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
|
|
|
79784
80166
|
hasSignature: !!revealResult.signature
|
|
79785
80167
|
});
|
|
79786
80168
|
}
|
|
79787
|
-
const
|
|
80169
|
+
const revealArgs = [
|
|
79788
80170
|
positionIdBytes32,
|
|
79789
80171
|
revealQuantumTimestamp,
|
|
79790
80172
|
revealBtcPrice,
|
|
79791
80173
|
revealBtcAmountSats,
|
|
79792
80174
|
revealResult.signature || "0x",
|
|
79793
|
-
BigInt(revealDeadline.toString())
|
|
79794
|
-
|
|
79795
|
-
|
|
80175
|
+
BigInt(revealDeadline.toString())
|
|
80176
|
+
];
|
|
80177
|
+
const revealSubmission = await this.prepareQuantumSend("revealAndLiquidate", {
|
|
80178
|
+
to: liquidationTarget,
|
|
80179
|
+
from: liquidationFrom,
|
|
80180
|
+
data: positionManager.interface.encodeFunctionData("revealAndLiquidate", [...revealArgs]),
|
|
80181
|
+
quantumTimestamp: Number(revealQuantumTimestamp)
|
|
80182
|
+
});
|
|
80183
|
+
const revealTx = await positionManager["revealAndLiquidate"](
|
|
80184
|
+
...revealArgs,
|
|
80185
|
+
{ gasLimit: revealSubmission.gasLimit }
|
|
79796
80186
|
);
|
|
79797
80187
|
if (this.config.debug) {
|
|
79798
80188
|
log.info(` \u{1F4E4} Reveal TX submitted`, { txHash: revealTx.hash });
|
|
@@ -80194,15 +80584,13 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
|
|
|
80194
80584
|
]);
|
|
80195
80585
|
const extendTo = this.getContractAddressesOrThrow().positionManager;
|
|
80196
80586
|
const extendSigner = this.getSignerOrThrow();
|
|
80587
|
+
let extendSubmission;
|
|
80197
80588
|
try {
|
|
80198
|
-
await
|
|
80199
|
-
provider: this.getProviderOrThrow(),
|
|
80589
|
+
extendSubmission = await this.prepareQuantumSend("extendPosition", {
|
|
80200
80590
|
to: extendTo,
|
|
80201
80591
|
from: await extendSigner.getAddress(),
|
|
80202
80592
|
data: extendCalldata,
|
|
80203
|
-
quantumTimestamp: Number(quantumTimestamp)
|
|
80204
|
-
laneGuardActive: await this.isLocalLaneGuardActive(),
|
|
80205
|
-
onDebug: this.config.debug ? (msg) => log.info(msg, {}) : void 0
|
|
80593
|
+
quantumTimestamp: Number(quantumTimestamp)
|
|
80206
80594
|
});
|
|
80207
80595
|
} catch (simError) {
|
|
80208
80596
|
if (!(simError instanceof QuantumRevertError)) {
|
|
@@ -80217,7 +80605,7 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
|
|
|
80217
80605
|
feeProvider: this.getProviderOrThrow(),
|
|
80218
80606
|
to: extendTo,
|
|
80219
80607
|
data: extendCalldata,
|
|
80220
|
-
gasLimit:
|
|
80608
|
+
gasLimit: extendSubmission.gasLimit
|
|
80221
80609
|
});
|
|
80222
80610
|
const txWithProvider = tx2;
|
|
80223
80611
|
if (!txWithProvider.provider) {
|
|
@@ -81110,7 +81498,6 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
|
|
|
81110
81498
|
const paymentContractAddress = this.getContractAddressesOrThrow().positionManager;
|
|
81111
81499
|
const paymentSigner = this.getSignerOrThrow();
|
|
81112
81500
|
const paymentFrom = await paymentSigner.getAddress();
|
|
81113
|
-
const paymentProvider = contractManager.getProvider();
|
|
81114
81501
|
const paymentIface = new import_ethers13.Interface([
|
|
81115
81502
|
"function makePayment(bytes32 positionId, uint256 paymentAmount, uint256 quantumTimestamp, uint256 btcPrice, bytes calldata paymentValidatorSignature) external returns (bool)"
|
|
81116
81503
|
]);
|
|
@@ -81121,15 +81508,13 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
|
|
|
81121
81508
|
btcPriceStr,
|
|
81122
81509
|
signature
|
|
81123
81510
|
]);
|
|
81511
|
+
let paymentSubmission;
|
|
81124
81512
|
try {
|
|
81125
|
-
await
|
|
81126
|
-
provider: paymentProvider,
|
|
81513
|
+
paymentSubmission = await this.prepareQuantumSend("makePayment", {
|
|
81127
81514
|
to: paymentContractAddress,
|
|
81128
81515
|
from: paymentFrom,
|
|
81129
81516
|
data: paymentCalldata,
|
|
81130
|
-
quantumTimestamp: Number(quantumTimestamp)
|
|
81131
|
-
laneGuardActive: await this.isLocalLaneGuardActive(),
|
|
81132
|
-
onDebug: this.config.debug ? (msg) => log.info(msg, {}) : void 0
|
|
81517
|
+
quantumTimestamp: Number(quantumTimestamp)
|
|
81133
81518
|
});
|
|
81134
81519
|
} catch (simError) {
|
|
81135
81520
|
if (!(simError instanceof QuantumRevertError)) {
|
|
@@ -81152,7 +81537,7 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
|
|
|
81152
81537
|
feeProvider: this.getProviderOrThrow(),
|
|
81153
81538
|
to: paymentContractAddress,
|
|
81154
81539
|
data: paymentCalldata,
|
|
81155
|
-
gasLimit:
|
|
81540
|
+
gasLimit: paymentSubmission.gasLimit
|
|
81156
81541
|
});
|
|
81157
81542
|
if (this.config.debug) {
|
|
81158
81543
|
log.info("\u2705 makePayment broadcast", { txHash: tx2.hash });
|
|
@@ -81909,21 +82294,18 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
|
|
|
81909
82294
|
const withdrawSigner = this.getSignerOrThrow();
|
|
81910
82295
|
let tx2;
|
|
81911
82296
|
try {
|
|
81912
|
-
await
|
|
81913
|
-
provider: this.getProviderOrThrow(),
|
|
82297
|
+
const withdrawSubmission = await this.prepareQuantumSend("withdrawBTC", {
|
|
81914
82298
|
to: positionManagerAddress,
|
|
81915
82299
|
from: await withdrawSigner.getAddress(),
|
|
81916
82300
|
data: withdrawCalldata,
|
|
81917
|
-
quantumTimestamp: Number(withdrawalParams.quantumTimestamp)
|
|
81918
|
-
laneGuardActive: await this.isLocalLaneGuardActive(),
|
|
81919
|
-
onDebug: this.config.debug ? (msg) => log.info(msg, {}) : void 0
|
|
82301
|
+
quantumTimestamp: Number(withdrawalParams.quantumTimestamp)
|
|
81920
82302
|
});
|
|
81921
82303
|
tx2 = await sendEip1559Transaction({
|
|
81922
82304
|
signer: withdrawSigner,
|
|
81923
82305
|
feeProvider: this.getProviderOrThrow(),
|
|
81924
82306
|
to: positionManagerAddress,
|
|
81925
82307
|
data: withdrawCalldata,
|
|
81926
|
-
gasLimit:
|
|
82308
|
+
gasLimit: withdrawSubmission.gasLimit
|
|
81927
82309
|
});
|
|
81928
82310
|
} catch (txError) {
|
|
81929
82311
|
const txErrorMsg = txError instanceof QuantumRevertError ? `Withdrawal would revert (pre-send simulation): ${txError.errorName ?? txError.selector ?? "unknown"}` : txError instanceof Error ? txError.message : String(txError);
|
|
@@ -81934,6 +82316,12 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
|
|
|
81934
82316
|
signatureBytesLength: signatureBytes.length
|
|
81935
82317
|
});
|
|
81936
82318
|
}
|
|
82319
|
+
if (txError instanceof GasEstimateUnavailableError) {
|
|
82320
|
+
return {
|
|
82321
|
+
success: false,
|
|
82322
|
+
error: `Transaction submission failed: ${txErrorMsg}`
|
|
82323
|
+
};
|
|
82324
|
+
}
|
|
81937
82325
|
try {
|
|
81938
82326
|
const position = await this.getPosition(positionId);
|
|
81939
82327
|
const btcAmount = (Number(withdrawalAmount) / 1e8).toFixed(8);
|
|
@@ -83616,6 +84004,97 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
|
|
|
83616
84004
|
const { hash, blockNumber } = await executePsmPlan(plan, params.signer, vctx);
|
|
83617
84005
|
return { hash, blockNumber };
|
|
83618
84006
|
}
|
|
84007
|
+
// ============================================================================
|
|
84008
|
+
// HIGH-LEVEL API - stUSDC desk (StUSDCVault 1.1.0, hold-only UCD desk)
|
|
84009
|
+
// ============================================================================
|
|
84010
|
+
/**
|
|
84011
|
+
* The desk's addresses and the chain they belong to. The vault comes from the deployment
|
|
84012
|
+
* manifest (`getContractsByNetwork(network).StUSDCVault`); UCD and USDC from the SDK config,
|
|
84013
|
+
* the way `psmRedeem` resolves its tokens. Every address is required — nothing is guessed.
|
|
84014
|
+
*/
|
|
84015
|
+
resolveDeskAddresses() {
|
|
84016
|
+
const chainId = this.config.chainId ?? this.config.networkOverride?.chainId;
|
|
84017
|
+
if (typeof chainId !== "number") {
|
|
84018
|
+
throw new Error("desk needs the SDK's chainId \u2014 configure chainId");
|
|
84019
|
+
}
|
|
84020
|
+
const manifestKey = chainId === 1 ? "mainnet" : chainId === 11155111 ? "sepolia" : "localhost";
|
|
84021
|
+
const manifest = getContractsByNetwork(manifestKey);
|
|
84022
|
+
const vault = manifest?.StUSDCVault;
|
|
84023
|
+
if (!vault) {
|
|
84024
|
+
throw new Error(`StUSDCVault is not deployed on ${manifestKey} (chainId ${chainId}) \u2014 no manifest address`);
|
|
84025
|
+
}
|
|
84026
|
+
const ucdToken = this.config.contractAddresses?.ucdToken;
|
|
84027
|
+
const usdcToken = this.config.contractAddresses?.usdcToken;
|
|
84028
|
+
if (!ucdToken)
|
|
84029
|
+
throw new Error("UCDToken address not configured \u2014 provide contractAddresses.ucdToken");
|
|
84030
|
+
if (!usdcToken)
|
|
84031
|
+
throw new Error("USDC address not configured \u2014 provide contractAddresses.usdcToken");
|
|
84032
|
+
return { chainId, vault, ucdToken, usdcToken };
|
|
84033
|
+
}
|
|
84034
|
+
/**
|
|
84035
|
+
* Live desk status: halt matrix, pause, exit freeze, mark, free USDC, params and state —
|
|
84036
|
+
* one `Promise.all` over the vault's views.
|
|
84037
|
+
*/
|
|
84038
|
+
async getDeskStatus() {
|
|
84039
|
+
const { vault } = this.resolveDeskAddresses();
|
|
84040
|
+
return deskReadsFromProvider(this.getProviderOrThrow(), vault).status();
|
|
84041
|
+
}
|
|
84042
|
+
/**
|
|
84043
|
+
* What `sellUCD(amountUCDWei, ·)` would pay now. A static call: it reverts exactly as the sell
|
|
84044
|
+
* would (`ZeroDeskAmount`, `InventoryCapExceeded`, `InsufficientLiquidity`, `DeskHalted`,
|
|
84045
|
+
* `EnforcedPause`, `ExitsAreFrozen`), decoded by ethers against `DESK_ABI`.
|
|
84046
|
+
*
|
|
84047
|
+
* @param amountUCDWei - UCD to sell (18 decimals)
|
|
84048
|
+
*/
|
|
84049
|
+
async quoteDeskSell(amountUCDWei) {
|
|
84050
|
+
const { vault } = this.resolveDeskAddresses();
|
|
84051
|
+
return deskReadsFromProvider(this.getProviderOrThrow(), vault).quoteSellUCD(amountUCDWei);
|
|
84052
|
+
}
|
|
84053
|
+
/**
|
|
84054
|
+
* Build and validate the legs of a UCD → USDC desk sale for `owner`: an EXACT approve of UCD
|
|
84055
|
+
* to the vault when the allowance is short (reset to zero first when partial), then
|
|
84056
|
+
* `sellUCD(amountUCDWei, minUSDCWei)`. Nothing is sent — hand the plan to `executeDeskPlan`,
|
|
84057
|
+
* or take the validated legs into your own signing pipeline.
|
|
84058
|
+
*
|
|
84059
|
+
* @param amountUCDWei - UCD to sell (18 decimals)
|
|
84060
|
+
* @param minUSDCWei - Minimum USDC to receive (6 decimals); must be > 0 — see `deskSellMinOut`
|
|
84061
|
+
* @param owner - The seller; defaults to the configured contract signer
|
|
84062
|
+
*/
|
|
84063
|
+
async planDeskSell(amountUCDWei, minUSDCWei, owner) {
|
|
84064
|
+
const { chainId, vault, ucdToken } = this.resolveDeskAddresses();
|
|
84065
|
+
const seller = owner ?? await this.config.contractSigner?.getAddress();
|
|
84066
|
+
if (!seller)
|
|
84067
|
+
throw new Error("desk sell needs an owner \u2014 pass one or configure contractSigner");
|
|
84068
|
+
const provider = this.getProviderOrThrow();
|
|
84069
|
+
const vctx = { chainId, network: String(chainId), contracts: {} };
|
|
84070
|
+
return planDeskSell({
|
|
84071
|
+
addresses: { vault, ucdToken },
|
|
84072
|
+
owner: seller,
|
|
84073
|
+
amountUCD: amountUCDWei,
|
|
84074
|
+
minUSDC: minUSDCWei,
|
|
84075
|
+
vctx,
|
|
84076
|
+
reads: deskReadsFromProvider(provider, vault)
|
|
84077
|
+
});
|
|
84078
|
+
}
|
|
84079
|
+
/**
|
|
84080
|
+
* Send a desk plan through `signer`, approvals first, each leg re-validated against the chain
|
|
84081
|
+
* the SIGNER is on — which must be the SDK's configured chain, where the addresses came from.
|
|
84082
|
+
*/
|
|
84083
|
+
async executeDeskPlan(plan, signer) {
|
|
84084
|
+
const provider = signer.provider;
|
|
84085
|
+
if (!provider)
|
|
84086
|
+
throw new Error(`desk ${plan.direction} needs a signer connected to a provider`);
|
|
84087
|
+
const { chainId } = this.resolveDeskAddresses();
|
|
84088
|
+
const mismatch = await describeProviderChainMismatch(provider, chainId);
|
|
84089
|
+
if (mismatch)
|
|
84090
|
+
throw new Error(mismatch);
|
|
84091
|
+
const signerAddress = await signer.getAddress();
|
|
84092
|
+
if ((0, import_ethers13.getAddress)(signerAddress) !== (0, import_ethers13.getAddress)(plan.owner)) {
|
|
84093
|
+
throw new Error(`desk ${plan.direction} plan was built for ${plan.owner}, signer is ${signerAddress}`);
|
|
84094
|
+
}
|
|
84095
|
+
const vctx = { chainId, network: String(chainId), contracts: {} };
|
|
84096
|
+
return executeDeskPlan(plan, signer, vctx);
|
|
84097
|
+
}
|
|
83619
84098
|
/**
|
|
83620
84099
|
* Wait for the subgraph to index up to (and including) the given block number.
|
|
83621
84100
|
* Call after on-chain actions (createLoan, mintUCD, etc.) before querying the subgraph.
|
|
@@ -84781,6 +85260,32 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
|
|
|
84781
85260
|
provider
|
|
84782
85261
|
);
|
|
84783
85262
|
}
|
|
85263
|
+
/**
|
|
85264
|
+
* Gate + estimate-as-simulation for a quantum-signed send, always on the SDK READ
|
|
85265
|
+
* provider — never the wallet's (docs/vigil/plans/2026-11-11-sdk-estimate-sized-gas-limits-plan.md,
|
|
85266
|
+
* Design 1–2). Returns the estimate and the gasLimit to broadcast with, and (in debug)
|
|
85267
|
+
* logs both for every send so the margin stays visible across the mainnet Glamsterdam fork.
|
|
85268
|
+
*
|
|
85269
|
+
* Throws `QuantumRevertError` (decodable revert — callers map it to their own message),
|
|
85270
|
+
* `GasEstimateUnavailableError` (no estimate: retryable, nothing sent) and
|
|
85271
|
+
* `GasLimitCeilingError` (the sized limit exceeds the 5M sign-guard ceiling).
|
|
85272
|
+
*/
|
|
85273
|
+
async prepareQuantumSend(operation, tx2) {
|
|
85274
|
+
const result = await assertSafeQuantumSubmission({
|
|
85275
|
+
provider: this.getProviderOrThrow(),
|
|
85276
|
+
...tx2,
|
|
85277
|
+
laneGuardActive: await this.isLocalLaneGuardActive(),
|
|
85278
|
+
...this.config.debug ? { onDebug: (msg) => log.info(msg, {}) } : {}
|
|
85279
|
+
});
|
|
85280
|
+
if (this.config.debug) {
|
|
85281
|
+
log.info("\u26FD gasLimit sized from eth_estimateGas", {
|
|
85282
|
+
operation,
|
|
85283
|
+
estimate: result.estimate.toString(),
|
|
85284
|
+
gasLimit: result.gasLimit.toString()
|
|
85285
|
+
});
|
|
85286
|
+
}
|
|
85287
|
+
return result;
|
|
85288
|
+
}
|
|
84784
85289
|
/**
|
|
84785
85290
|
* Get Bitcoin network based on chain.
|
|
84786
85291
|
*
|
|
@@ -85419,13 +85924,14 @@ init_deployment_addresses();
|
|
|
85419
85924
|
init_deployment_addresses();
|
|
85420
85925
|
|
|
85421
85926
|
// node_modules/@gvnrdao/dh-sdk/dist/sign-guard.mjs
|
|
85422
|
-
var import_ethers38 = require("ethers");
|
|
85423
|
-
var import_ethers39 = require("ethers");
|
|
85424
85927
|
var import_ethers40 = require("ethers");
|
|
85425
85928
|
var import_ethers41 = require("ethers");
|
|
85426
85929
|
var import_ethers42 = require("ethers");
|
|
85427
85930
|
var import_ethers43 = require("ethers");
|
|
85428
85931
|
var import_ethers44 = require("ethers");
|
|
85932
|
+
var import_ethers45 = require("ethers");
|
|
85933
|
+
var import_ethers46 = require("ethers");
|
|
85934
|
+
var import_ethers47 = require("ethers");
|
|
85429
85935
|
var TxValidationError3 = class extends Error {
|
|
85430
85936
|
/**
|
|
85431
85937
|
* @param subject What is being refused. Defaults to the server-returned transaction the
|
|
@@ -85470,9 +85976,13 @@ var SIGNABLE_FUNCTIONS3 = [
|
|
|
85470
85976
|
"function redeem(address stablecoin, uint256 ucdAmount, uint256 minStablecoinOut) external returns (uint256)",
|
|
85471
85977
|
// BitcoinWithdrawalAddressRegistry — `msg.sender` must be the borrower, so
|
|
85472
85978
|
// this too is client-only and never module-whitelisted.
|
|
85473
|
-
"function addAddress(string btcAddress) external"
|
|
85979
|
+
"function addAddress(string btcAddress) external",
|
|
85980
|
+
// StUSDCVault 1.1.0 — the hold-only UCD desk. Direct EOA calls like the PSM
|
|
85981
|
+
// pair (the vault pulls from `msg.sender`); never routed through AgentModule.
|
|
85982
|
+
"function sellUCD(uint256 amountUCD, uint256 minUSDC) external returns (uint256)",
|
|
85983
|
+
"function buyUCD(uint256 amountUSDC, uint256 minUCD) external returns (uint256)"
|
|
85474
85984
|
];
|
|
85475
|
-
var IFACE3 = new
|
|
85985
|
+
var IFACE3 = new import_ethers40.ethers.Interface(SIGNABLE_FUNCTIONS3);
|
|
85476
85986
|
function encodeSignable3(fn, args) {
|
|
85477
85987
|
return IFACE3.encodeFunctionData(fn, args);
|
|
85478
85988
|
}
|
|
@@ -85502,10 +86012,10 @@ var DEFAULT_FEE_CEILING2 = {
|
|
|
85502
86012
|
maxTxFeeWei: DEFAULT_MAX_TX_FEE_WEI2
|
|
85503
86013
|
};
|
|
85504
86014
|
function fmtEth2(wei) {
|
|
85505
|
-
return `${
|
|
86015
|
+
return `${import_ethers41.ethers.formatEther(wei)} ETH`;
|
|
85506
86016
|
}
|
|
85507
86017
|
function fmtGwei2(wei) {
|
|
85508
|
-
return `${
|
|
86018
|
+
return `${import_ethers41.ethers.formatUnits(wei, "gwei")} gwei`;
|
|
85509
86019
|
}
|
|
85510
86020
|
function worstCaseFeeWei2(gasLimit, maxFeePerGas) {
|
|
85511
86021
|
if (gasLimit == null || maxFeePerGas == null)
|
|
@@ -85555,8 +86065,6 @@ var SEPOLIA_DEPLOYMENT2 = {
|
|
|
85555
86065
|
BitcoinProviderRegistry: "0xbfA0c48B070D0a9A9CD27469AeacFD2d4261cEE2",
|
|
85556
86066
|
ContractVersionRegistry: "0x97E43AA6aFF2C0cf659d3aE501658D2Ef6777522",
|
|
85557
86067
|
usdcToken: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
|
|
85558
|
-
mockUsdcToken: "0x96409A98e0D322d6566b7F44a0fAbD1BD4ce2AEc",
|
|
85559
|
-
mockUsdtToken: "0xF8b7fB38b17a310960E47805Be9adba0b0e0394D",
|
|
85560
86068
|
PositionDelegateRegistry: "0x482369De283622E7b05731875ec137d4E3D208F9",
|
|
85561
86069
|
FeeRecipientRegistry: "0x95795F8403DDb629E8527B2934C4e71f5fC0C374",
|
|
85562
86070
|
BitcoinWithdrawalAddressRegistry: "0x6376D392097F0A81e51BD83960A97EA20eaf1dbe",
|
|
@@ -85741,10 +86249,10 @@ var SEPOLIA_DEPLOYMENT2 = {
|
|
|
85741
86249
|
},
|
|
85742
86250
|
StUSDCVault: {
|
|
85743
86251
|
previousImplementation: "0x3619b14C23c5F7d950EF845481C2299939873004",
|
|
85744
|
-
newImplementation: "
|
|
85745
|
-
upgradedAt: "2026-
|
|
86252
|
+
newImplementation: "0xE94DFBacA21fEFB0BB2e95D33510Ca702d2b6c5f",
|
|
86253
|
+
upgradedAt: "2026-11-08T16:07:36.867Z",
|
|
85746
86254
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
85747
|
-
reason: "
|
|
86255
|
+
reason: "StUSDCVault 1.1.0: Phase 5 desk (linked StUSDCDeskLib 0x0880ce721b0A50C8Fe8d5c911097F0c24e57b6aA)"
|
|
85748
86256
|
},
|
|
85749
86257
|
CarryFeeReceiver: {
|
|
85750
86258
|
previousImplementation: "0x9c43996C6f6BAD82F2A5152AbA61137E929EFA17",
|
|
@@ -85809,6 +86317,9 @@ var SEPOLIA_DEPLOYMENT2 = {
|
|
|
85809
86317
|
setPKPValidationRegistryTx: "0xab6b7e610c1ecf68da9a1e1150e61631e1f2a945bec12608c8357e03be25c4a5",
|
|
85810
86318
|
replacedAddress: "0xC8Ca02238fbCDAEbE6dbF804461D43F46F9406F4"
|
|
85811
86319
|
},
|
|
86320
|
+
libraries: {
|
|
86321
|
+
StUSDCDeskLib: "0x0880ce721b0A50C8Fe8d5c911097F0c24e57b6aA"
|
|
86322
|
+
},
|
|
85812
86323
|
latestEnv: {
|
|
85813
86324
|
UCD_TOKEN: "0xdd817Ff47C9b8f81335Ac579895D8EA321Fa86Df",
|
|
85814
86325
|
UCD_CONTROLLER: "0x360Bde4e489ee94E26601B206932De09EE60FF04",
|
|
@@ -85861,8 +86372,6 @@ var SEPOLIA_DEPLOYMENT2 = {
|
|
|
85861
86372
|
CONTRACT_VERSION_REGISTRY: "0x97E43AA6aFF2C0cf659d3aE501658D2Ef6777522",
|
|
85862
86373
|
CONTRACT_VERSION_REGISTRY_IMPL: "0xF3389De4bCeC735e4F6d35b9f71170D96037D1B7",
|
|
85863
86374
|
USDC_TOKEN: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
|
|
85864
|
-
MOCK_USDC_TOKEN: "0x96409A98e0D322d6566b7F44a0fAbD1BD4ce2AEc",
|
|
85865
|
-
MOCK_USDT_TOKEN: "0xF8b7fB38b17a310960E47805Be9adba0b0e0394D",
|
|
85866
86375
|
POSITION_DELEGATE_REGISTRY: "0x482369De283622E7b05731875ec137d4E3D208F9",
|
|
85867
86376
|
POSITION_DELEGATE_REGISTRY_IMPL: "0xc681c48688cdAA966119E265e4a378ef8Fe0eBcA",
|
|
85868
86377
|
AGENT_MODULE: "0xefb8C29C1e7e92ed7d81a52dbedaed74e37fe380",
|
|
@@ -85877,7 +86386,7 @@ var SEPOLIA_DEPLOYMENT2 = {
|
|
|
85877
86386
|
STUCD_VAULT: "0xc04Dd4d6799FFDE57feAfD5B3B1B038827014fd3",
|
|
85878
86387
|
STUCD_VAULT_IMPL: "0xd596A866ee5273aedaC21BC6e88649E087fC8EcB",
|
|
85879
86388
|
STUSDC_VAULT: "0x7aBac04d4Bf2b3A63AF363B9527970791346463a",
|
|
85880
|
-
STUSDC_VAULT_IMPL: "
|
|
86389
|
+
STUSDC_VAULT_IMPL: "0xE94DFBacA21fEFB0BB2e95D33510Ca702d2b6c5f",
|
|
85881
86390
|
CARRY_FEE_RECEIVER: "0x2C8e54f099Cf479182D7c87D76FeD88b4172cdB4",
|
|
85882
86391
|
CARRY_FEE_RECEIVER_IMPL: "0x3a86A23ff3cd6c26B1Fa2C5aeBAeEEdbF6095D69",
|
|
85883
86392
|
FEE_RECOGNITION_LEDGER: "0xA5EBfb856fe2b847cC6011B0fe2dB6ACE63D6C3c",
|
|
@@ -86148,7 +86657,7 @@ function eqAddr3(a, b) {
|
|
|
86148
86657
|
if (!a || !b)
|
|
86149
86658
|
return false;
|
|
86150
86659
|
try {
|
|
86151
|
-
return
|
|
86660
|
+
return import_ethers42.ethers.getAddress(a) === import_ethers42.ethers.getAddress(b);
|
|
86152
86661
|
} catch {
|
|
86153
86662
|
return false;
|
|
86154
86663
|
}
|
|
@@ -86214,7 +86723,7 @@ function readValue3(tx2) {
|
|
|
86214
86723
|
}
|
|
86215
86724
|
function normalizePositionId3(id) {
|
|
86216
86725
|
const hex = id.startsWith("0x") ? id : `0x${id}`;
|
|
86217
|
-
return
|
|
86726
|
+
return import_ethers42.ethers.zeroPadValue(hex, 32).toLowerCase();
|
|
86218
86727
|
}
|
|
86219
86728
|
function requirePositionId2(actual, expected) {
|
|
86220
86729
|
const txPositionId = String(actual).toLowerCase();
|
|
@@ -86473,6 +86982,53 @@ function validateUnsignedTx3(unsignedTx, expected, vctx) {
|
|
|
86473
86982
|
}
|
|
86474
86983
|
break;
|
|
86475
86984
|
}
|
|
86985
|
+
case "desk-approve": {
|
|
86986
|
+
if (name !== "approve") {
|
|
86987
|
+
throw new TxValidationError3(`expected ERC-20 approve, decoded ${name}`);
|
|
86988
|
+
}
|
|
86989
|
+
if (!eqAddr3(to, expected.tokenAddress)) {
|
|
86990
|
+
throw new TxValidationError3(`approve must target the token (${expected.tokenAddress}), got ${to}`);
|
|
86991
|
+
}
|
|
86992
|
+
if (!eqAddr3(String(args[0]), expected.vaultAddress)) {
|
|
86993
|
+
throw new TxValidationError3(`approve spender must be the StUSDCVault (${expected.vaultAddress}), got ${String(args[0])}`);
|
|
86994
|
+
}
|
|
86995
|
+
if (BigInt(String(args[1])).toString() !== expected.amount) {
|
|
86996
|
+
throw new TxValidationError3(
|
|
86997
|
+
`approve amount must be EXACTLY ${expected.amount} (exact-amount rule), got ${BigInt(String(args[1]))}`
|
|
86998
|
+
);
|
|
86999
|
+
}
|
|
87000
|
+
break;
|
|
87001
|
+
}
|
|
87002
|
+
case "desk-sell": {
|
|
87003
|
+
if (name !== "sellUCD")
|
|
87004
|
+
throw new TxValidationError3(`expected sellUCD, decoded ${name}`);
|
|
87005
|
+
if (!eqAddr3(to, expected.vaultAddress)) {
|
|
87006
|
+
throw new TxValidationError3(`sellUCD must target the StUSDCVault (${expected.vaultAddress}), got ${to}`);
|
|
87007
|
+
}
|
|
87008
|
+
if (BigInt(String(args[0])).toString() !== expected.amountUcdWei)
|
|
87009
|
+
throw new TxValidationError3(`sellUCD amountUCD mismatch`);
|
|
87010
|
+
if (BigInt(String(args[1])).toString() !== expected.minUsdc)
|
|
87011
|
+
throw new TxValidationError3(`sellUCD minUSDC mismatch`);
|
|
87012
|
+
if (BigInt(expected.minUsdc) === 0n) {
|
|
87013
|
+
throw new TxValidationError3(`sellUCD minUSDC is 0 \u2014 a slippage floor is mandatory`);
|
|
87014
|
+
}
|
|
87015
|
+
break;
|
|
87016
|
+
}
|
|
87017
|
+
case "desk-buy": {
|
|
87018
|
+
if (name !== "buyUCD")
|
|
87019
|
+
throw new TxValidationError3(`expected buyUCD, decoded ${name}`);
|
|
87020
|
+
if (!eqAddr3(to, expected.vaultAddress)) {
|
|
87021
|
+
throw new TxValidationError3(`buyUCD must target the StUSDCVault (${expected.vaultAddress}), got ${to}`);
|
|
87022
|
+
}
|
|
87023
|
+
if (BigInt(String(args[0])).toString() !== expected.amountUsdc)
|
|
87024
|
+
throw new TxValidationError3(`buyUCD amountUSDC mismatch`);
|
|
87025
|
+
if (BigInt(String(args[1])).toString() !== expected.minUcdWei)
|
|
87026
|
+
throw new TxValidationError3(`buyUCD minUCD mismatch`);
|
|
87027
|
+
if (BigInt(expected.minUcdWei) === 0n) {
|
|
87028
|
+
throw new TxValidationError3(`buyUCD minUCD is 0 \u2014 a slippage floor is mandatory`);
|
|
87029
|
+
}
|
|
87030
|
+
break;
|
|
87031
|
+
}
|
|
86476
87032
|
default: {
|
|
86477
87033
|
const _exhaustive = expected;
|
|
86478
87034
|
throw new TxValidationError3(`unhandled expected action kind: ${JSON.stringify(_exhaustive)}`);
|
|
@@ -86507,38 +87063,38 @@ function buildPsmRedeemTx3(p) {
|
|
|
86507
87063
|
};
|
|
86508
87064
|
}
|
|
86509
87065
|
var PSM_READS_ABI2 = ["function supportedStablecoins(address) view returns (bool)"];
|
|
86510
|
-
var
|
|
87066
|
+
var ERC20_READS_ABI3 = ["function allowance(address owner, address spender) view returns (uint256)"];
|
|
86511
87067
|
function psmExchangeReadsFromProvider2(provider, psmAddress) {
|
|
86512
|
-
const psm = new
|
|
87068
|
+
const psm = new import_ethers45.ethers.Contract(psmAddress, PSM_READS_ABI2, provider);
|
|
86513
87069
|
return {
|
|
86514
87070
|
isStablecoinSupported: async (stablecoin) => await psm.getFunction("supportedStablecoins")(stablecoin),
|
|
86515
|
-
allowance: async (token, owner, spender) => await new
|
|
87071
|
+
allowance: async (token, owner, spender) => await new import_ethers45.ethers.Contract(token, ERC20_READS_ABI3, provider).getFunction("allowance")(owner, spender)
|
|
86516
87072
|
};
|
|
86517
87073
|
}
|
|
86518
|
-
var
|
|
86519
|
-
function
|
|
86520
|
-
if (!value || !
|
|
86521
|
-
throw
|
|
87074
|
+
var refuse3 = (direction, msg) => new TxValidationError3(msg, `PSM ${direction}`);
|
|
87075
|
+
function requireAddress3(direction, label, value) {
|
|
87076
|
+
if (!value || !import_ethers45.ethers.isAddress(value)) {
|
|
87077
|
+
throw refuse3(direction, `${label} address is missing or invalid (${String(value)})`);
|
|
86522
87078
|
}
|
|
86523
|
-
return
|
|
87079
|
+
return import_ethers45.ethers.getAddress(value);
|
|
86524
87080
|
}
|
|
86525
87081
|
async function planPsmExchange2(params) {
|
|
86526
87082
|
const { direction, amountIn, minOut, vctx, reads } = params;
|
|
86527
87083
|
const chainId = vctx.chainId;
|
|
86528
87084
|
if (amountIn <= 0n) {
|
|
86529
|
-
throw
|
|
87085
|
+
throw refuse3(direction, `amount must be greater than zero (got ${amountIn})`);
|
|
86530
87086
|
}
|
|
86531
87087
|
if (minOut <= 0n) {
|
|
86532
|
-
throw
|
|
87088
|
+
throw refuse3(direction, `minimum-out floor must be greater than zero (got ${minOut}) \u2014 a zero floor is refused on-chain`);
|
|
86533
87089
|
}
|
|
86534
|
-
const owner =
|
|
86535
|
-
const psm =
|
|
86536
|
-
const stablecoin =
|
|
87090
|
+
const owner = requireAddress3(direction, "owner", params.owner);
|
|
87091
|
+
const psm = requireAddress3(direction, "SimplePSMV2", params.addresses.psm);
|
|
87092
|
+
const stablecoin = requireAddress3(direction, "stablecoin", params.addresses.stablecoin);
|
|
86537
87093
|
const isSwap = direction === "swap";
|
|
86538
|
-
const token = isSwap ? stablecoin :
|
|
86539
|
-
const spender = isSwap ? psm :
|
|
87094
|
+
const token = isSwap ? stablecoin : requireAddress3(direction, "UCDToken", params.addresses.ucdToken);
|
|
87095
|
+
const spender = isSwap ? psm : requireAddress3(direction, "UCDController", params.addresses.ucdController);
|
|
86540
87096
|
if (!await reads.isStablecoinSupported(stablecoin)) {
|
|
86541
|
-
throw
|
|
87097
|
+
throw refuse3(direction, `stablecoin ${stablecoin} is not supported by the PSM at ${psm}`);
|
|
86542
87098
|
}
|
|
86543
87099
|
const approveExpected = (amount) => isSwap ? { kind: "stablecoin-approve", tokenAddress: token, spender, amountUnits: amount.toString() } : { kind: "ucd-approve-controller", ucdTokenAddress: token, spender, amountWei: amount.toString() };
|
|
86544
87100
|
const allowanceBefore = await reads.allowance(token, owner, spender);
|
|
@@ -86705,7 +87261,7 @@ function assertSignableTypedData(chainId, domain, types, primaryType, message) {
|
|
|
86705
87261
|
if (structNames.length !== 1) {
|
|
86706
87262
|
throw new TypedDataRefused(`expected exactly one struct type, got ${structNames.join(", ") || "none"}`);
|
|
86707
87263
|
}
|
|
86708
|
-
const derived =
|
|
87264
|
+
const derived = import_ethers47.TypedDataEncoder.getPrimaryType(structs);
|
|
86709
87265
|
if (derived !== primaryType) {
|
|
86710
87266
|
throw new TypedDataRefused(`primaryType "${primaryType}" does not match the types' primary "${derived}"`);
|
|
86711
87267
|
}
|
|
@@ -86797,7 +87353,7 @@ var SUPPORTED_STABLECOINS = `
|
|
|
86797
87353
|
}`;
|
|
86798
87354
|
|
|
86799
87355
|
// src/boundary/upstream/real/psm-calls.ts
|
|
86800
|
-
var
|
|
87356
|
+
var import_ethers48 = require("ethers");
|
|
86801
87357
|
var PSM_VIEW_FRAGMENTS = [
|
|
86802
87358
|
"function VERSION() view returns (string)",
|
|
86803
87359
|
"function supportedStablecoins(address) view returns (bool)",
|
|
@@ -86866,8 +87422,8 @@ var PsmCalls = class {
|
|
|
86866
87422
|
constructor(deps) {
|
|
86867
87423
|
this.deps = deps;
|
|
86868
87424
|
const abi = [...PSM_VIEW_FRAGMENTS, ...PSM_ERROR_FRAGMENTS];
|
|
86869
|
-
this.iface = new
|
|
86870
|
-
this.psm = new
|
|
87425
|
+
this.iface = new import_ethers48.ethers.Interface(abi);
|
|
87426
|
+
this.psm = new import_ethers48.ethers.Contract(deps.psmAddress, abi, deps.provider);
|
|
86871
87427
|
}
|
|
86872
87428
|
psm;
|
|
86873
87429
|
iface;
|
|
@@ -86896,8 +87452,8 @@ var PsmCalls = class {
|
|
|
86896
87452
|
});
|
|
86897
87453
|
}
|
|
86898
87454
|
return this.call(async () => {
|
|
86899
|
-
const ucd = new
|
|
86900
|
-
const stable = new
|
|
87455
|
+
const ucd = new import_ethers48.ethers.Contract(ucdToken, ERC20_FRAGMENTS, this.deps.provider);
|
|
87456
|
+
const stable = new import_ethers48.ethers.Contract(this.deps.stablecoinAddress, ERC20_FRAGMENTS, this.deps.provider);
|
|
86901
87457
|
const [ucdWei, stablecoinUnits] = await Promise.all([ucd["balanceOf"](holder), stable["balanceOf"](holder)]);
|
|
86902
87458
|
return { ucdWei: ucdWei.toString(), stablecoinUnits: stablecoinUnits.toString() };
|
|
86903
87459
|
});
|
|
@@ -87015,7 +87571,7 @@ var PsmCalls = class {
|
|
|
87015
87571
|
};
|
|
87016
87572
|
|
|
87017
87573
|
// src/boundary/upstream/real/session.ts
|
|
87018
|
-
var
|
|
87574
|
+
var import_ethers49 = require("ethers");
|
|
87019
87575
|
var REFRESH_LEEWAY_SEC = 30;
|
|
87020
87576
|
var LOGIN_TYPES_WITH_AUDIENCE3 = {
|
|
87021
87577
|
DiamondHands: [
|
|
@@ -87063,7 +87619,7 @@ var LitOpsSession = class {
|
|
|
87063
87619
|
const message = {
|
|
87064
87620
|
address: this.wallet.address,
|
|
87065
87621
|
issuedAt: Math.floor(Date.now() / 1e3),
|
|
87066
|
-
nonce: "0x" + Buffer.from(
|
|
87622
|
+
nonce: "0x" + Buffer.from(import_ethers49.ethers.randomBytes(32)).toString("hex"),
|
|
87067
87623
|
audience: this.serviceEndpoint
|
|
87068
87624
|
};
|
|
87069
87625
|
const signature = await this.wallet.signTypedData(
|
|
@@ -87105,7 +87661,7 @@ function decodeJwtExp(token) {
|
|
|
87105
87661
|
}
|
|
87106
87662
|
|
|
87107
87663
|
// src/boundary/upstream/real/write-ops.ts
|
|
87108
|
-
var
|
|
87664
|
+
var import_ethers51 = require("ethers");
|
|
87109
87665
|
|
|
87110
87666
|
// src/signer/types.ts
|
|
87111
87667
|
var OperationDeclined = class extends Error {
|
|
@@ -87115,7 +87671,7 @@ var OperationDeclined = class extends Error {
|
|
|
87115
87671
|
init_tx_validator();
|
|
87116
87672
|
|
|
87117
87673
|
// src/boundary/upstream/shared/external-bridge/page-crypto.ts
|
|
87118
|
-
var
|
|
87674
|
+
var import_ethers50 = require("ethers");
|
|
87119
87675
|
var PERSONAL_SIGN_LAYOUTS = {
|
|
87120
87676
|
"dh-op-envelope-v1": {
|
|
87121
87677
|
types: ["bytes32", "uint256", "uint256", "uint256", "bytes32"],
|
|
@@ -87130,9 +87686,9 @@ function hashForLayout(layout, fields) {
|
|
|
87130
87686
|
const values = def.fieldOrder.map((name) => {
|
|
87131
87687
|
const raw = fields[name];
|
|
87132
87688
|
if (raw === void 0) throw new Error(`page-crypto: layout "${layout}" missing field "${name}"`);
|
|
87133
|
-
return hashUtf8.has(name) ?
|
|
87689
|
+
return hashUtf8.has(name) ? import_ethers50.ethers.keccak256(import_ethers50.ethers.toUtf8Bytes(raw)) : raw;
|
|
87134
87690
|
});
|
|
87135
|
-
return
|
|
87691
|
+
return import_ethers50.ethers.solidityPackedKeccak256(def.types, values);
|
|
87136
87692
|
}
|
|
87137
87693
|
var PAGE_CRYPTO_JS = `"use strict";
|
|
87138
87694
|
(function () {
|
|
@@ -87371,7 +87927,7 @@ function mcpExpected(leg) {
|
|
|
87371
87927
|
}
|
|
87372
87928
|
var OP_LAYOUT = "dh-op-envelope-v1";
|
|
87373
87929
|
function randomNonceHex() {
|
|
87374
|
-
return "0x" + Buffer.from(
|
|
87930
|
+
return "0x" + Buffer.from(import_ethers51.ethers.randomBytes(16)).toString("hex");
|
|
87375
87931
|
}
|
|
87376
87932
|
async function postJson(url2, body, headers) {
|
|
87377
87933
|
const res = await fetch(url2, {
|
|
@@ -87439,7 +87995,7 @@ function buildWriteOps(deps) {
|
|
|
87439
87995
|
return {
|
|
87440
87996
|
to: String(tx2["to"] ?? ""),
|
|
87441
87997
|
data: String(tx2["data"] ?? "0x"),
|
|
87442
|
-
value: tx2["value"] != null ?
|
|
87998
|
+
value: tx2["value"] != null ? import_ethers51.ethers.toBeHex(BigInt(String(tx2["value"]))) : "0x0",
|
|
87443
87999
|
chainId: tx2["chainId"] != null ? Number(tx2["chainId"]) : chainId
|
|
87444
88000
|
};
|
|
87445
88001
|
}
|
|
@@ -87605,7 +88161,7 @@ function buildWriteOps(deps) {
|
|
|
87605
88161
|
mintedUcdWei: minted,
|
|
87606
88162
|
feeUcdWei: mintFee,
|
|
87607
88163
|
echoedAmountUcdWei: minted,
|
|
87608
|
-
authorization: auth(action, `mint ${
|
|
88164
|
+
authorization: auth(action, `mint ${import_ethers51.ethers.formatEther(amountWei)} UCD against ${p.positionId}`, r.value.digest)
|
|
87609
88165
|
},
|
|
87610
88166
|
{ id: SOURCE5, kind: "lit-ops", fetchedAt: (/* @__PURE__ */ new Date()).toISOString() }
|
|
87611
88167
|
);
|
|
@@ -87646,7 +88202,7 @@ function buildWriteOps(deps) {
|
|
|
87646
88202
|
txRef: { kind: "eth-tx", id: r.value.txHash },
|
|
87647
88203
|
paidUcdWei: paid,
|
|
87648
88204
|
echoedAmountUcdWei: paid,
|
|
87649
|
-
authorization: auth(action, `repay ${
|
|
88205
|
+
authorization: auth(action, `repay ${import_ethers51.ethers.formatEther(amountWei)} UCD on ${p.positionId}`, r.value.digest)
|
|
87650
88206
|
},
|
|
87651
88207
|
{ id: SOURCE5, kind: "lit-ops", fetchedAt: (/* @__PURE__ */ new Date()).toISOString() }
|
|
87652
88208
|
);
|
|
@@ -87909,7 +88465,7 @@ function buildWriteOps(deps) {
|
|
|
87909
88465
|
}
|
|
87910
88466
|
|
|
87911
88467
|
// src/signer/eoa-dh.ts
|
|
87912
|
-
var
|
|
88468
|
+
var import_ethers52 = require("ethers");
|
|
87913
88469
|
var EoaDHSigner = class {
|
|
87914
88470
|
constructor(wallet, broadcast, clock = Date.now) {
|
|
87915
88471
|
this.wallet = wallet;
|
|
@@ -87926,7 +88482,7 @@ var EoaDHSigner = class {
|
|
|
87926
88482
|
async signAuthorization(spec) {
|
|
87927
88483
|
const quantumTs = nextQuantumTimestamp(this.clock());
|
|
87928
88484
|
const { fields, hashHex } = spec.stamp(quantumTs);
|
|
87929
|
-
const signature = await this.wallet.signMessage(
|
|
88485
|
+
const signature = await this.wallet.signMessage(import_ethers52.ethers.getBytes(hashHex));
|
|
87930
88486
|
return { signature, quantumTs, fields };
|
|
87931
88487
|
}
|
|
87932
88488
|
async wrapInnerTx(innerTx) {
|
|
@@ -87944,13 +88500,13 @@ var EoaDHSigner = class {
|
|
|
87944
88500
|
|
|
87945
88501
|
// src/signer/external-eoa.ts
|
|
87946
88502
|
var import_node_crypto7 = require("crypto");
|
|
87947
|
-
var
|
|
88503
|
+
var import_ethers56 = require("ethers");
|
|
87948
88504
|
|
|
87949
88505
|
// src/boundary/upstream/shared/external-bridge/bridge.ts
|
|
87950
88506
|
var fs4 = __toESM(require("fs"));
|
|
87951
88507
|
var http3 = __toESM(require("http"));
|
|
87952
88508
|
var import_node_crypto6 = require("crypto");
|
|
87953
|
-
var
|
|
88509
|
+
var import_ethers54 = require("ethers");
|
|
87954
88510
|
|
|
87955
88511
|
// src/util/brand-assets.ts
|
|
87956
88512
|
var FAVICON_SVG = `<svg width="512" height="512" viewBox="-6 -11 88 88" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Diamond Hands"><path d="M1.08325 20.7041L37.9038 64.4967L74.2886 20.7041L61.8699 0.877686H13.502L1.08325 20.7041Z" fill="#C9F284" stroke="#34440E" stroke-width="1.75559"/><path d="M13.9385 0.877441L37.9045 64.2785" stroke="#34440E" stroke-width="1.75559"/><path d="M61.6553 0.877441L37.9071 64.4964" stroke="#34440E" stroke-width="1.75559"/><path d="M1.08276 20.7029H74.2882" stroke="#34440E" stroke-width="1.75559"/></svg>`;
|
|
@@ -88560,7 +89116,7 @@ function presenceStatement(origin2, chainId, nonce) {
|
|
|
88560
89116
|
}
|
|
88561
89117
|
function recoverPresenceSigner(statement, signature) {
|
|
88562
89118
|
try {
|
|
88563
|
-
return
|
|
89119
|
+
return import_ethers54.ethers.verifyMessage(statement, signature);
|
|
88564
89120
|
} catch {
|
|
88565
89121
|
return null;
|
|
88566
89122
|
}
|
|
@@ -89807,7 +90363,7 @@ data: ${JSON.stringify(payload)}
|
|
|
89807
90363
|
};
|
|
89808
90364
|
|
|
89809
90365
|
// src/boundary/upstream/shared/external-bridge/verify-landed-tx.ts
|
|
89810
|
-
var
|
|
90366
|
+
var import_ethers55 = require("ethers");
|
|
89811
90367
|
function eq2(a, b) {
|
|
89812
90368
|
return a.toLowerCase() === b.toLowerCase();
|
|
89813
90369
|
}
|
|
@@ -89830,7 +90386,7 @@ function compareLandedTx(landed, approved, borrower) {
|
|
|
89830
90386
|
return { status: "verified", from: landed.from, hash: landed.hash };
|
|
89831
90387
|
}
|
|
89832
90388
|
function verifyRawSignedTx(rawSignedTx, approved, borrower) {
|
|
89833
|
-
const parsed =
|
|
90389
|
+
const parsed = import_ethers55.ethers.Transaction.from(rawSignedTx);
|
|
89834
90390
|
if (!parsed.from || !parsed.to || !parsed.hash) {
|
|
89835
90391
|
return { status: "mismatch", hash: parsed.hash ?? "0x", reason: "the returned raw transaction is unsigned or malformed" };
|
|
89836
90392
|
}
|
|
@@ -89877,7 +90433,7 @@ async function gasHintAcrossBlocks(provider, from, tx2, action) {
|
|
|
89877
90433
|
for (let attempt = 0; attempt < 4; attempt++) {
|
|
89878
90434
|
try {
|
|
89879
90435
|
const est = await provider.estimateGas({ from, to: tx2.to, data: tx2.data, value: BigInt(tx2.value) });
|
|
89880
|
-
return
|
|
90436
|
+
return import_ethers56.ethers.toBeHex(est * 15n / 10n);
|
|
89881
90437
|
} catch (e) {
|
|
89882
90438
|
lastErr = e;
|
|
89883
90439
|
await new Promise((r) => setTimeout(r, 13e3));
|
|
@@ -89927,7 +90483,7 @@ var ExternalEoaDHSigner = class {
|
|
|
89927
90483
|
throw new OperationDeclined(`the ${spec.action} authorization was not signed: ${describeOutcome(outcome)}`);
|
|
89928
90484
|
}
|
|
89929
90485
|
const finalHash = spec.stamp(used.quantumTs).hashHex;
|
|
89930
|
-
const recovered =
|
|
90486
|
+
const recovered = import_ethers56.ethers.verifyMessage(import_ethers56.ethers.getBytes(finalHash), outcome.signature);
|
|
89931
90487
|
if (recovered.toLowerCase() !== this.deps.borrower.toLowerCase()) {
|
|
89932
90488
|
throw new Error(`the ${spec.action} authorization was signed by ${recovered}, not the borrower ${this.deps.borrower}`);
|
|
89933
90489
|
}
|
|
@@ -89938,7 +90494,7 @@ var ExternalEoaDHSigner = class {
|
|
|
89938
90494
|
}
|
|
89939
90495
|
async submitValidatedTx(outerTx, ctx) {
|
|
89940
90496
|
const approved = toApprovedTx(outerTx, this.deps.chainId);
|
|
89941
|
-
const gas = outerTx.gasLimit != null ?
|
|
90497
|
+
const gas = outerTx.gasLimit != null ? import_ethers56.ethers.toBeHex(BigInt(String(outerTx.gasLimit))) : await gasHintAcrossBlocks(this.deps.provider, this.deps.borrower, approved, ctx.action);
|
|
89942
90498
|
const outcome = await this.deps.bridge.requestSignature({
|
|
89943
90499
|
id: (0, import_node_crypto7.randomUUID)(),
|
|
89944
90500
|
kind: "transaction",
|
|
@@ -89972,7 +90528,7 @@ var ExternalEoaDHSigner = class {
|
|
|
89972
90528
|
return new BridgeEthersSigner(this.deps);
|
|
89973
90529
|
}
|
|
89974
90530
|
};
|
|
89975
|
-
var BridgeEthersSigner = class _BridgeEthersSigner extends
|
|
90531
|
+
var BridgeEthersSigner = class _BridgeEthersSigner extends import_ethers56.ethers.AbstractSigner {
|
|
89976
90532
|
constructor(deps) {
|
|
89977
90533
|
super(deps.provider);
|
|
89978
90534
|
this.deps = deps;
|
|
@@ -89983,7 +90539,7 @@ var BridgeEthersSigner = class _BridgeEthersSigner extends import_ethers53.ether
|
|
|
89983
90539
|
return this.deps.borrower;
|
|
89984
90540
|
}
|
|
89985
90541
|
async signMessage(message) {
|
|
89986
|
-
const length = typeof message === "string" ?
|
|
90542
|
+
const length = typeof message === "string" ? import_ethers56.ethers.toUtf8Bytes(message).length : message.length;
|
|
89987
90543
|
throw new Error(
|
|
89988
90544
|
`external-wallet signMessage is disabled (got ${length} bytes): Diamond Hands authorizations are EIP-712 typed data the wallet renders (signTypedData) \u2014 no raw or 32-byte hash is ever signed blind here.`
|
|
89989
90545
|
);
|
|
@@ -90036,7 +90592,7 @@ var BridgeEthersSigner = class _BridgeEthersSigner extends import_ethers53.ether
|
|
|
90036
90592
|
const structs = Object.fromEntries(
|
|
90037
90593
|
Object.entries(types).filter(([name]) => name !== "EIP712Domain").map(([name, fields]) => [name, fields.map((f) => ({ name: f.name, type: f.type }))])
|
|
90038
90594
|
);
|
|
90039
|
-
const primaryType =
|
|
90595
|
+
const primaryType = import_ethers56.ethers.TypedDataEncoder.getPrimaryType(structs);
|
|
90040
90596
|
const { label } = this.deps.guardTypedData(this.deps.chainId, domain, structs, primaryType, message);
|
|
90041
90597
|
const typedData = { domain, types: structs, primaryType, message };
|
|
90042
90598
|
if (BTC_SPEND_PRIMARY_TYPES.has(primaryType)) {
|
|
@@ -90094,17 +90650,17 @@ var BridgeEthersSigner = class _BridgeEthersSigner extends import_ethers53.ether
|
|
|
90094
90650
|
async verifyTypedSigner(typedData, signature) {
|
|
90095
90651
|
const types = typedData.types;
|
|
90096
90652
|
let recovered = null;
|
|
90097
|
-
if (
|
|
90098
|
-
const v = Number(BigInt(
|
|
90653
|
+
if (import_ethers56.ethers.isHexString(signature, 65)) {
|
|
90654
|
+
const v = Number(BigInt(import_ethers56.ethers.dataSlice(signature, 64, 65)));
|
|
90099
90655
|
if (v === 0 || v === 1 || v === 27 || v === 28) {
|
|
90100
|
-
recovered =
|
|
90656
|
+
recovered = import_ethers56.ethers.verifyTypedData(typedData.domain, types, typedData.message, signature);
|
|
90101
90657
|
if (recovered.toLowerCase() === this.deps.borrower.toLowerCase()) return;
|
|
90102
90658
|
}
|
|
90103
90659
|
}
|
|
90104
90660
|
const code = await this.deps.provider.getCode(this.deps.borrower);
|
|
90105
90661
|
if (codeIsContractWallet(code)) {
|
|
90106
|
-
const digest =
|
|
90107
|
-
const wallet = new
|
|
90662
|
+
const digest = import_ethers56.ethers.TypedDataEncoder.hash(typedData.domain, types, typedData.message);
|
|
90663
|
+
const wallet = new import_ethers56.ethers.Contract(
|
|
90108
90664
|
this.deps.borrower,
|
|
90109
90665
|
["function isValidSignature(bytes32,bytes) view returns (bytes4)"],
|
|
90110
90666
|
this.deps.provider
|
|
@@ -90128,11 +90684,11 @@ var BridgeEthersSigner = class _BridgeEthersSigner extends import_ethers53.ether
|
|
|
90128
90684
|
const approved = {
|
|
90129
90685
|
to: tx2.to,
|
|
90130
90686
|
data: tx2.data,
|
|
90131
|
-
value: tx2.value != null ?
|
|
90687
|
+
value: tx2.value != null ? import_ethers56.ethers.toBeHex(BigInt(String(tx2.value))) : "0x0",
|
|
90132
90688
|
chainId: tx2.chainId != null ? Number(tx2.chainId) : this.deps.chainId
|
|
90133
90689
|
};
|
|
90134
90690
|
const card = cardForTx(approved);
|
|
90135
|
-
const gas = tx2.gasLimit != null ?
|
|
90691
|
+
const gas = tx2.gasLimit != null ? import_ethers56.ethers.toBeHex(BigInt(String(tx2.gasLimit))) : await gasHintAcrossBlocks(this.deps.provider, this.deps.borrower, approved, describeFn(approved.data));
|
|
90136
90692
|
const outcome = await this.deps.bridge.requestSignature({
|
|
90137
90693
|
id: (0, import_node_crypto7.randomUUID)(),
|
|
90138
90694
|
kind: "transaction",
|
|
@@ -90174,7 +90730,7 @@ function toApprovedTx(tx2, fallbackChainId) {
|
|
|
90174
90730
|
return {
|
|
90175
90731
|
to: tx2.to,
|
|
90176
90732
|
data: tx2.data,
|
|
90177
|
-
value: tx2.value != null ?
|
|
90733
|
+
value: tx2.value != null ? import_ethers56.ethers.toBeHex(BigInt(String(tx2.value))) : "0x0",
|
|
90178
90734
|
chainId: tx2.chainId != null ? Number(tx2.chainId) : fallbackChainId
|
|
90179
90735
|
};
|
|
90180
90736
|
}
|
|
@@ -90224,9 +90780,9 @@ var MIN_CONFIRMATIONS = { mainnet: 6, sepolia: 1 };
|
|
|
90224
90780
|
var RealUpstreamPlugin = class {
|
|
90225
90781
|
constructor(config, wallet, runtime) {
|
|
90226
90782
|
this.config = config;
|
|
90227
|
-
const rpc = new
|
|
90783
|
+
const rpc = new import_ethers57.ethers.FetchRequest(config.rpcUrl);
|
|
90228
90784
|
if (config.rpcDrpcKey !== void 0) rpc.setHeader("Drpc-Key", config.rpcDrpcKey);
|
|
90229
|
-
this.provider = new
|
|
90785
|
+
this.provider = new import_ethers57.ethers.JsonRpcProvider(rpc, config.chainId);
|
|
90230
90786
|
this.wallet = wallet ?? null;
|
|
90231
90787
|
this.runtime = runtime ?? null;
|
|
90232
90788
|
this.session = wallet ? new LitOpsSession(wallet.connect(this.provider), config.serviceEndpoint, config.chainId) : null;
|
|
@@ -90533,14 +91089,14 @@ var RealUpstreamPlugin = class {
|
|
|
90533
91089
|
if (!pkpValidation) {
|
|
90534
91090
|
throw new Error(`the SDK's ${this.config.network} deployment table has no PKPValidation address \u2014 cannot verify validator version ${version}.`);
|
|
90535
91091
|
}
|
|
90536
|
-
const registry = new
|
|
91092
|
+
const registry = new import_ethers57.ethers.Contract(pkpValidation, ["function validatorForVersion(uint256) view returns (address)"], this.provider);
|
|
90537
91093
|
let validator;
|
|
90538
91094
|
try {
|
|
90539
91095
|
validator = await registry.validatorForVersion(version);
|
|
90540
91096
|
} catch (e) {
|
|
90541
91097
|
throw new Error(`could not verify validator version ${version} on-chain (PKPValidation ${pkpValidation}): ${e.message}`);
|
|
90542
91098
|
}
|
|
90543
|
-
if (validator ===
|
|
91099
|
+
if (validator === import_ethers57.ethers.ZeroAddress) {
|
|
90544
91100
|
throw new Error(
|
|
90545
91101
|
`validator version ${version} is NOT registered on ${this.config.network} (PKPValidation ${pkpValidation} returns the zero address) \u2014 the transaction would revert ValidatorNotConfigured. Set DH_VALIDATOR_VERSION to the network's registered generation.`
|
|
90546
91102
|
);
|
|
@@ -90833,7 +91389,7 @@ var RealUpstreamPlugin = class {
|
|
|
90833
91389
|
);
|
|
90834
91390
|
if (!r.ok) return r;
|
|
90835
91391
|
const raw = r.value.data.supportedStablecoins ?? [];
|
|
90836
|
-
const bad = raw.find((x) => !
|
|
91392
|
+
const bad = raw.find((x) => !import_ethers57.ethers.isAddress(String(x.address)) || !Number.isFinite(Number(x.decimals)));
|
|
90837
91393
|
if (bad) {
|
|
90838
91394
|
return {
|
|
90839
91395
|
ok: false,
|
|
@@ -90916,7 +91472,7 @@ var RealUpstreamPlugin = class {
|
|
|
90916
91472
|
};
|
|
90917
91473
|
}
|
|
90918
91474
|
const symbol = raw.toLowerCase();
|
|
90919
|
-
if (
|
|
91475
|
+
if (import_ethers57.ethers.isAddress(raw)) return this.psmCallsFor(symbol);
|
|
90920
91476
|
const verified = await this.verifiedStablecoins();
|
|
90921
91477
|
if (!verified.ok) return { ok: false, failure: verified.failure };
|
|
90922
91478
|
const hits = verified.rows.filter((r) => r.symbol.toLowerCase() === symbol);
|
|
@@ -90954,7 +91510,7 @@ var RealUpstreamPlugin = class {
|
|
|
90954
91510
|
* chain, then sign.
|
|
90955
91511
|
*/
|
|
90956
91512
|
async psmCallsFor(stablecoinAddress) {
|
|
90957
|
-
if (!
|
|
91513
|
+
if (!import_ethers57.ethers.isAddress(stablecoinAddress)) {
|
|
90958
91514
|
throw new Error(`psmCallsFor requires a resolved 0x address, got '${stablecoinAddress}' \u2014 resolve through psmCallsForChoice`);
|
|
90959
91515
|
}
|
|
90960
91516
|
const key = stablecoinAddress.toLowerCase();
|
|
@@ -90973,7 +91529,7 @@ var RealUpstreamPlugin = class {
|
|
|
90973
91529
|
}
|
|
90974
91530
|
let supported;
|
|
90975
91531
|
try {
|
|
90976
|
-
const psm = new
|
|
91532
|
+
const psm = new import_ethers57.ethers.Contract(psmAddress, ["function supportedStablecoins(address) view returns (bool)"], this.provider);
|
|
90977
91533
|
supported = await psm["supportedStablecoins"](key);
|
|
90978
91534
|
} catch (e) {
|
|
90979
91535
|
return { ok: false, failure: { kind: "unavailable", source: "chain-rpc", message: `PSM stablecoin check failed for ${key}: ${e.message}` } };
|
|
@@ -90990,7 +91546,7 @@ var RealUpstreamPlugin = class {
|
|
|
90990
91546
|
}
|
|
90991
91547
|
let symbol;
|
|
90992
91548
|
try {
|
|
90993
|
-
const erc20 = new
|
|
91549
|
+
const erc20 = new import_ethers57.ethers.Contract(key, ["function symbol() view returns (string)"], this.provider);
|
|
90994
91550
|
symbol = await erc20["symbol"]();
|
|
90995
91551
|
} catch (e) {
|
|
90996
91552
|
return { ok: false, failure: { kind: "unavailable", source: "chain-rpc", message: `PSM stablecoin symbol read failed for ${key}: ${e.message}` } };
|
|
@@ -91205,7 +91761,7 @@ var RealUpstreamPlugin = class {
|
|
|
91205
91761
|
const pm = this.contracts["PositionManager"];
|
|
91206
91762
|
if (!pm) return false;
|
|
91207
91763
|
try {
|
|
91208
|
-
const c = new
|
|
91764
|
+
const c = new import_ethers57.ethers.Contract(pm, PAUSABLE_ABI, this.provider);
|
|
91209
91765
|
return Boolean(await c["paused"]());
|
|
91210
91766
|
} catch {
|
|
91211
91767
|
return false;
|
|
@@ -91214,10 +91770,10 @@ var RealUpstreamPlugin = class {
|
|
|
91214
91770
|
async readPositionDetails(id) {
|
|
91215
91771
|
const core = this.contracts["PositionManagerCoreModule"] ?? this.contracts["PositionManager"];
|
|
91216
91772
|
if (!core) throw new Error(`no PositionManager address for network ${this.config.network}`);
|
|
91217
|
-
const c = new
|
|
91773
|
+
const c = new import_ethers57.ethers.Contract(core, POSITION_DETAILS_ABI, this.provider);
|
|
91218
91774
|
let d;
|
|
91219
91775
|
try {
|
|
91220
|
-
d = await c["getPositionDetails"](
|
|
91776
|
+
d = await c["getPositionDetails"](import_ethers57.ethers.zeroPadValue(id, 32));
|
|
91221
91777
|
} catch (e) {
|
|
91222
91778
|
if (isContractRevert(e)) return null;
|
|
91223
91779
|
const nodeMessage = e.info?.error?.message;
|
|
@@ -91227,7 +91783,7 @@ var RealUpstreamPlugin = class {
|
|
|
91227
91783
|
throw e;
|
|
91228
91784
|
}
|
|
91229
91785
|
const borrower = String(d["borrower"]);
|
|
91230
|
-
if (borrower ===
|
|
91786
|
+
if (borrower === import_ethers57.ethers.ZeroAddress) return null;
|
|
91231
91787
|
return {
|
|
91232
91788
|
positionId: String(d["positionId"]),
|
|
91233
91789
|
pkpId: String(d["pkpId"]),
|
|
@@ -91433,7 +91989,7 @@ async function createRealBoundary(config, wallet, overrides) {
|
|
|
91433
91989
|
const manager = new SignerManager({
|
|
91434
91990
|
persistence: overrides?.signerPersistence?.(config.network) ?? fileSignerPersistence(stateFile),
|
|
91435
91991
|
initialMode,
|
|
91436
|
-
...overrides?.boundBorrower ? { authenticatedBorrower:
|
|
91992
|
+
...overrides?.boundBorrower ? { authenticatedBorrower: import_ethers58.ethers.getAddress(overrides.boundBorrower) } : {},
|
|
91437
91993
|
candidate: () => bridge.walletState()?.account ?? null,
|
|
91438
91994
|
pendingCeremonies: () => bridge.pendingCount(),
|
|
91439
91995
|
keystore
|
|
@@ -91529,8 +92085,8 @@ async function buildBoundary(configResult, overrides) {
|
|
|
91529
92085
|
);
|
|
91530
92086
|
}
|
|
91531
92087
|
try {
|
|
91532
|
-
const decrypted = await
|
|
91533
|
-
if (!(decrypted instanceof
|
|
92088
|
+
const decrypted = await import_ethers59.ethers.Wallet.fromEncryptedJson(keystoreJson, config.keystorePassword);
|
|
92089
|
+
if (!(decrypted instanceof import_ethers59.ethers.Wallet)) {
|
|
91534
92090
|
return bootError("DH_KEYSTORE_PATH did not decrypt to an EOA wallet keystore.", ["DH_KEYSTORE_PATH"]);
|
|
91535
92091
|
}
|
|
91536
92092
|
wallet = decrypted;
|
|
@@ -92676,7 +93232,7 @@ var import_mcp2 = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
|
92676
93232
|
|
|
92677
93233
|
// src/tools/loan.ts
|
|
92678
93234
|
var import_zod = require("zod");
|
|
92679
|
-
var
|
|
93235
|
+
var import_ethers60 = require("ethers");
|
|
92680
93236
|
|
|
92681
93237
|
// src/util/format.ts
|
|
92682
93238
|
function bigintReplacer(_key, value) {
|
|
@@ -92864,7 +93420,7 @@ function registerLoanTools(server, getB, adapter2 = "real") {
|
|
|
92864
93420
|
const b = getB();
|
|
92865
93421
|
if (!b.ok) return renderError(b.error);
|
|
92866
93422
|
return renderEnvelope(
|
|
92867
|
-
await b.boundary.mintUcd({ positionId, amountUcdWei: (0,
|
|
93423
|
+
await b.boundary.mintUcd({ positionId, amountUcdWei: (0, import_ethers60.parseEther)(amountUcd.toString()).toString() })
|
|
92868
93424
|
);
|
|
92869
93425
|
})
|
|
92870
93426
|
);
|
|
@@ -92902,7 +93458,7 @@ function registerLoanTools(server, getB, adapter2 = "real") {
|
|
|
92902
93458
|
if (BigInt(detail.data.debtUcdWei) === 0n) return validationFailed("the position has no outstanding debt");
|
|
92903
93459
|
amountUcdWei = detail.data.debtUcdWei;
|
|
92904
93460
|
} else {
|
|
92905
|
-
amountUcdWei = (0,
|
|
93461
|
+
amountUcdWei = (0, import_ethers60.parseEther)(amountUcd.toString()).toString();
|
|
92906
93462
|
}
|
|
92907
93463
|
return renderEnvelope(await b.boundary.repayUcd({ positionId, amountUcdWei }));
|
|
92908
93464
|
})
|
|
@@ -93505,7 +94061,7 @@ function registerMockControlTool(server, control, chainId = 1337) {
|
|
|
93505
94061
|
|
|
93506
94062
|
// src/tools/signer.ts
|
|
93507
94063
|
var import_zod6 = require("zod");
|
|
93508
|
-
var
|
|
94064
|
+
var import_ethers61 = require("ethers");
|
|
93509
94065
|
var MODES = ["external", "keystore", "safe", "safe-module", "mock-simulated"];
|
|
93510
94066
|
var ACTIONS2 = ["status", "use", "reset-borrower", "unlock-keystore", "connect", "disconnect"];
|
|
93511
94067
|
var EXTERNAL_ONLY_MODES = ["external"];
|
|
@@ -93547,7 +94103,7 @@ function registerSignerTool(server, getRuntime, opts) {
|
|
|
93547
94103
|
if (mode !== void 0 && !offeredModes.includes(mode)) {
|
|
93548
94104
|
return validationFailed(looksSecretShaped(mode) ? SECRET_REFUSAL : `mode '${mode}' is not one of: ${offeredModes.join(" | ")}`);
|
|
93549
94105
|
}
|
|
93550
|
-
if (safeAddress !== void 0 && !
|
|
94106
|
+
if (safeAddress !== void 0 && !import_ethers61.ethers.isAddress(safeAddress)) {
|
|
93551
94107
|
return validationFailed(looksSecretShaped(safeAddress) ? SECRET_REFUSAL : `'${safeAddress}' is not a valid Safe address`);
|
|
93552
94108
|
}
|
|
93553
94109
|
if (action === "status") {
|
|
@@ -93963,7 +94519,7 @@ function registerBoundaryInfoResource(server, getB) {
|
|
|
93963
94519
|
}
|
|
93964
94520
|
|
|
93965
94521
|
// src/version.ts
|
|
93966
|
-
var SERVER_VERSION = "0.5.
|
|
94522
|
+
var SERVER_VERSION = "0.5.29";
|
|
93967
94523
|
|
|
93968
94524
|
// src/server.ts
|
|
93969
94525
|
var SERVER_INSTRUCTIONS = "Diamond Hands MCP \u2014 Bitcoin-collateralized borrowing. Before promising ANY flow, read the boundary://info resource and honor its `capabilities` block: it states which network this server is on, whether money is real (practiceWorld), whether writes are enabled (and the true reason when they are not), and which signer modes this build actually offers \u2014 never describe a flow outside it. State the network and whether funds are real when the user first acts. Authorization is chosen by conversation via the signer_setup tool (when listed); writes always require confirmed:true after showing the human-readable card. For walkthroughs consult the guide tool / guide:// resources instead of inventing steps; when a tool refuses, relay its stated reason and remedy \u2014 do not improvise alternatives. When a network_switch tool is listed, the network can change mid-session \u2014 after ANY switch, re-read boundary://info and state the new network and money reality to the user before doing anything else. When the user asks to disconnect / log out / sign out / forget or remove their wallet, call signer_setup action 'disconnect' (the full flush) \u2014 never treat 'reset-borrower' as a disconnect; it only swaps identity. READING DATA: a payload's fields and notes are authoritative \u2014 state what they say, never speculate past them, and when the data does not carry something, say 'the data does not carry X'. Field meanings live in guide topic 'reading-data'; `reading` notes inside a result are interpretation instructions for that exact payload \u2014 follow them over any prior assumption.";
|
|
@@ -94067,7 +94623,7 @@ mime-types/index.js:
|
|
|
94067
94623
|
*)
|
|
94068
94624
|
|
|
94069
94625
|
axios/dist/node/axios.cjs:
|
|
94070
|
-
(*! Axios v1.21.
|
|
94626
|
+
(*! Axios v1.21.1 Copyright (c) 2026 Matt Zabriskie and contributors *)
|
|
94071
94627
|
|
|
94072
94628
|
safe-buffer/index.js:
|
|
94073
94629
|
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|