@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/connector.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_ethers63 = 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_ethers63.ethers,
|
|
18589
18589
|
providers: {
|
|
18590
|
-
StaticJsonRpcProvider:
|
|
18590
|
+
StaticJsonRpcProvider: import_ethers63.ethers.JsonRpcProvider
|
|
18591
18591
|
},
|
|
18592
|
-
Contract:
|
|
18593
|
-
utils:
|
|
18592
|
+
Contract: import_ethers63.ethers.Contract,
|
|
18593
|
+
utils: import_ethers63.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_ethers55, 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_ethers55 = 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_ethers55.ethers.hexlify(import_ethers55.ethers.toUtf8Bytes(statement)), candidate.account] }
|
|
41850
41854
|
});
|
|
41851
41855
|
};
|
|
41852
41856
|
const state = { deleted: false };
|
|
@@ -44543,14 +44547,14 @@ function resolveRealConfig(env) {
|
|
|
44543
44547
|
|
|
44544
44548
|
// src/boot.ts
|
|
44545
44549
|
var fs6 = __toESM(require("fs"));
|
|
44546
|
-
var
|
|
44550
|
+
var import_ethers61 = require("ethers");
|
|
44547
44551
|
|
|
44548
44552
|
// src/boundary/index.ts
|
|
44549
44553
|
var import_node_crypto8 = require("crypto");
|
|
44550
44554
|
var fs5 = __toESM(require("fs"));
|
|
44551
44555
|
var os2 = __toESM(require("os"));
|
|
44552
44556
|
var path4 = __toESM(require("path"));
|
|
44553
|
-
var
|
|
44557
|
+
var import_ethers60 = require("ethers");
|
|
44554
44558
|
|
|
44555
44559
|
// src/boundary/envelope.ts
|
|
44556
44560
|
function okEnvelope(data, source, warnings = []) {
|
|
@@ -44959,7 +44963,7 @@ var BoundaryCore = class {
|
|
|
44959
44963
|
const inToken = toUcd ? s.stablecoinSymbol : "UCD";
|
|
44960
44964
|
const inUnit = toUcd ? `${s.stablecoinSymbol} smallest units (${s.stablecoinDecimals} decimals)` : "UCD wei (18 decimals)";
|
|
44961
44965
|
const amountIn = parseDecimalUnits(p.amount, inDecimals);
|
|
44962
|
-
const
|
|
44966
|
+
const refuse4 = (refusal, message2, details) => ({
|
|
44963
44967
|
env: errEnvelope(
|
|
44964
44968
|
boundaryError("UPSTREAM_REJECTED", message2, {
|
|
44965
44969
|
source: statusR.source.id,
|
|
@@ -44970,13 +44974,13 @@ var BoundaryCore = class {
|
|
|
44970
44974
|
});
|
|
44971
44975
|
const named = (units) => `${formatDecimalUnits(units, inDecimals)} ${inToken} (${units} ${inUnit})`;
|
|
44972
44976
|
if (s.paused) {
|
|
44973
|
-
return
|
|
44977
|
+
return refuse4(
|
|
44974
44978
|
"psm-paused",
|
|
44975
44979
|
"the PSM is paused \u2014 BOTH exchange directions are disabled until an operator unpauses it (this is the PSM's own pause switch)."
|
|
44976
44980
|
);
|
|
44977
44981
|
}
|
|
44978
44982
|
if (!toUcd && !s.redeemEnabled) {
|
|
44979
|
-
return
|
|
44983
|
+
return refuse4(
|
|
44980
44984
|
"redeem-disabled",
|
|
44981
44985
|
`redemptions are disabled (redeemEnabled = false) \u2014 UCD -> ${s.stablecoinSymbol} is refused; ${s.stablecoinSymbol} -> UCD swaps are unaffected.`
|
|
44982
44986
|
);
|
|
@@ -44987,20 +44991,20 @@ var BoundaryCore = class {
|
|
|
44987
44991
|
const min = BigInt(toUcd ? s.minSwapAmount : s.minRedeemAmount);
|
|
44988
44992
|
const max = BigInt(toUcd ? s.maxSwapAmount : s.maxRedeemAmount);
|
|
44989
44993
|
if (amountIn < min) {
|
|
44990
|
-
return
|
|
44994
|
+
return refuse4(
|
|
44991
44995
|
"below-min",
|
|
44992
44996
|
`${named(amountIn)} is below the minimum of ${named(min)} for the ${p.direction} direction.`,
|
|
44993
44997
|
{ amount: amountIn.toString(), minimum: min.toString(), unit: inUnit }
|
|
44994
44998
|
);
|
|
44995
44999
|
}
|
|
44996
45000
|
if (max === 0n) {
|
|
44997
|
-
return
|
|
45001
|
+
return refuse4(
|
|
44998
45002
|
"direction-disabled",
|
|
44999
45003
|
`the ${p.direction} direction is DISABLED by configuration (${toUcd ? "maxSwapAmount" : "maxRedeemAmount"} is 0).`
|
|
45000
45004
|
);
|
|
45001
45005
|
}
|
|
45002
45006
|
if (amountIn > max) {
|
|
45003
|
-
return
|
|
45007
|
+
return refuse4(
|
|
45004
45008
|
"above-max",
|
|
45005
45009
|
`${named(amountIn)} is above the maximum of ${named(max)} per operation for the ${p.direction} direction.`,
|
|
45006
45010
|
{ amount: amountIn.toString(), maximum: max.toString(), unit: inUnit }
|
|
@@ -45020,7 +45024,7 @@ var BoundaryCore = class {
|
|
|
45020
45024
|
if (!toUcd) {
|
|
45021
45025
|
const available = BigInt(s.availableReserves);
|
|
45022
45026
|
if (available < amountOut) {
|
|
45023
|
-
return
|
|
45027
|
+
return refuse4(
|
|
45024
45028
|
"insufficient-reserves",
|
|
45025
45029
|
`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).`,
|
|
45026
45030
|
{ available: available.toString(), required: amountOut.toString(), unit: outUnit }
|
|
@@ -49273,7 +49277,7 @@ var SafeModuleCeremony = class {
|
|
|
49273
49277
|
};
|
|
49274
49278
|
|
|
49275
49279
|
// src/boundary/upstream/real/plugin.ts
|
|
49276
|
-
var
|
|
49280
|
+
var import_ethers59 = require("ethers");
|
|
49277
49281
|
|
|
49278
49282
|
// node_modules/@gvnrdao/dh-sdk/dist/index.mjs
|
|
49279
49283
|
var import_ethers15 = require("ethers");
|
|
@@ -49287,6 +49291,7 @@ var import_ethers22 = require("ethers");
|
|
|
49287
49291
|
var import_ethers23 = require("ethers");
|
|
49288
49292
|
var import_ethers24 = require("ethers");
|
|
49289
49293
|
var import_ethers25 = require("ethers");
|
|
49294
|
+
var import_ethers26 = require("ethers");
|
|
49290
49295
|
|
|
49291
49296
|
// node_modules/@noble/hashes/esm/utils.js
|
|
49292
49297
|
function isBytes(a) {
|
|
@@ -49734,11 +49739,11 @@ var ripemd1602 = ripemd160;
|
|
|
49734
49739
|
// node_modules/@gvnrdao/dh-sdk/dist/index.mjs
|
|
49735
49740
|
var import_bech32 = __toESM(require_dist(), 1);
|
|
49736
49741
|
var import_bs58check = __toESM(require_bs58check(), 1);
|
|
49737
|
-
var import_ethers26 = require("ethers");
|
|
49738
49742
|
var import_ethers27 = require("ethers");
|
|
49739
49743
|
var import_ethers28 = require("ethers");
|
|
49740
49744
|
var import_ethers29 = require("ethers");
|
|
49741
49745
|
var import_ethers30 = require("ethers");
|
|
49746
|
+
var import_ethers31 = require("ethers");
|
|
49742
49747
|
|
|
49743
49748
|
// node_modules/axios/lib/helpers/bind.js
|
|
49744
49749
|
function bind(fn, thisArg) {
|
|
@@ -51813,7 +51818,7 @@ var import_follow_redirects = __toESM(require_follow_redirects(), 1);
|
|
|
51813
51818
|
var import_zlib = __toESM(require("zlib"), 1);
|
|
51814
51819
|
|
|
51815
51820
|
// node_modules/axios/lib/env/data.js
|
|
51816
|
-
var VERSION = "1.21.
|
|
51821
|
+
var VERSION = "1.21.1";
|
|
51817
51822
|
|
|
51818
51823
|
// node_modules/axios/lib/helpers/parseProtocol.js
|
|
51819
51824
|
function parseProtocol(url2) {
|
|
@@ -55314,8 +55319,11 @@ function throwIfCancellationRequested(config) {
|
|
|
55314
55319
|
throw new CanceledError_default(null, config);
|
|
55315
55320
|
}
|
|
55316
55321
|
}
|
|
55317
|
-
function
|
|
55318
|
-
return
|
|
55322
|
+
function resolveClock() {
|
|
55323
|
+
return typeof performance !== "undefined" && utils_default.isFunction(performance.now) ? () => performance.now() : Date.now;
|
|
55324
|
+
}
|
|
55325
|
+
function elapsedSince(now, start) {
|
|
55326
|
+
return Math.max(0, Math.round(now() - start));
|
|
55319
55327
|
}
|
|
55320
55328
|
function dispatchRequest(_config) {
|
|
55321
55329
|
const config = utils_default.toSafeFlatObject(_config);
|
|
@@ -55326,11 +55334,12 @@ function dispatchRequest(_config) {
|
|
|
55326
55334
|
config.headers.setContentType("application/x-www-form-urlencoded", false);
|
|
55327
55335
|
}
|
|
55328
55336
|
const adapter2 = adapters_default.getAdapter(config.adapter || defaults_default.adapter, config);
|
|
55329
|
-
const
|
|
55337
|
+
const now = resolveClock();
|
|
55338
|
+
const start = now();
|
|
55330
55339
|
return adapter2(config).then(
|
|
55331
55340
|
function onAdapterResolution(response) {
|
|
55332
55341
|
throwIfCancellationRequested(config);
|
|
55333
|
-
response.duration = elapsedSince(start);
|
|
55342
|
+
response.duration = elapsedSince(now, start);
|
|
55334
55343
|
config.response = response;
|
|
55335
55344
|
try {
|
|
55336
55345
|
response.data = transformData.call(config, config.transformResponse, response);
|
|
@@ -55344,7 +55353,7 @@ function dispatchRequest(_config) {
|
|
|
55344
55353
|
if (!isCancel(reason)) {
|
|
55345
55354
|
throwIfCancellationRequested(config);
|
|
55346
55355
|
if (reason && reason.response) {
|
|
55347
|
-
reason.response.duration = elapsedSince(start);
|
|
55356
|
+
reason.response.duration = elapsedSince(now, start);
|
|
55348
55357
|
config.response = reason.response;
|
|
55349
55358
|
try {
|
|
55350
55359
|
reason.response.data = transformData.call(
|
|
@@ -55934,16 +55943,17 @@ var {
|
|
|
55934
55943
|
} = axios_default;
|
|
55935
55944
|
|
|
55936
55945
|
// node_modules/@gvnrdao/dh-sdk/dist/index.mjs
|
|
55937
|
-
var import_ethers31 = require("ethers");
|
|
55938
55946
|
var import_ethers32 = require("ethers");
|
|
55939
55947
|
var import_ethers33 = require("ethers");
|
|
55940
55948
|
var import_ethers34 = require("ethers");
|
|
55941
55949
|
var import_ethers35 = require("ethers");
|
|
55942
55950
|
var import_ethers36 = require("ethers");
|
|
55943
55951
|
var import_ethers37 = require("ethers");
|
|
55944
|
-
var import_dh_lit_ops = __toESM(require_dist3(), 1);
|
|
55945
55952
|
var import_ethers38 = require("ethers");
|
|
55946
55953
|
var import_ethers39 = require("ethers");
|
|
55954
|
+
var import_dh_lit_ops = __toESM(require_dist3(), 1);
|
|
55955
|
+
var import_ethers40 = require("ethers");
|
|
55956
|
+
var import_ethers41 = require("ethers");
|
|
55947
55957
|
var __create2 = Object.create;
|
|
55948
55958
|
var __defProp2 = Object.defineProperty;
|
|
55949
55959
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -56041,8 +56051,6 @@ var init_deployment_addresses = __esm2({
|
|
|
56041
56051
|
BitcoinProviderRegistry: "0xbfA0c48B070D0a9A9CD27469AeacFD2d4261cEE2",
|
|
56042
56052
|
ContractVersionRegistry: "0x97E43AA6aFF2C0cf659d3aE501658D2Ef6777522",
|
|
56043
56053
|
usdcToken: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
|
|
56044
|
-
mockUsdcToken: "0x96409A98e0D322d6566b7F44a0fAbD1BD4ce2AEc",
|
|
56045
|
-
mockUsdtToken: "0xF8b7fB38b17a310960E47805Be9adba0b0e0394D",
|
|
56046
56054
|
PositionDelegateRegistry: "0x482369De283622E7b05731875ec137d4E3D208F9",
|
|
56047
56055
|
FeeRecipientRegistry: "0x95795F8403DDb629E8527B2934C4e71f5fC0C374",
|
|
56048
56056
|
BitcoinWithdrawalAddressRegistry: "0x6376D392097F0A81e51BD83960A97EA20eaf1dbe",
|
|
@@ -56227,10 +56235,10 @@ var init_deployment_addresses = __esm2({
|
|
|
56227
56235
|
},
|
|
56228
56236
|
StUSDCVault: {
|
|
56229
56237
|
previousImplementation: "0x3619b14C23c5F7d950EF845481C2299939873004",
|
|
56230
|
-
newImplementation: "
|
|
56231
|
-
upgradedAt: "2026-
|
|
56238
|
+
newImplementation: "0xE94DFBacA21fEFB0BB2e95D33510Ca702d2b6c5f",
|
|
56239
|
+
upgradedAt: "2026-11-08T16:07:36.867Z",
|
|
56232
56240
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
56233
|
-
reason: "
|
|
56241
|
+
reason: "StUSDCVault 1.1.0: Phase 5 desk (linked StUSDCDeskLib 0x0880ce721b0A50C8Fe8d5c911097F0c24e57b6aA)"
|
|
56234
56242
|
},
|
|
56235
56243
|
CarryFeeReceiver: {
|
|
56236
56244
|
previousImplementation: "0x9c43996C6f6BAD82F2A5152AbA61137E929EFA17",
|
|
@@ -56295,6 +56303,9 @@ var init_deployment_addresses = __esm2({
|
|
|
56295
56303
|
setPKPValidationRegistryTx: "0xab6b7e610c1ecf68da9a1e1150e61631e1f2a945bec12608c8357e03be25c4a5",
|
|
56296
56304
|
replacedAddress: "0xC8Ca02238fbCDAEbE6dbF804461D43F46F9406F4"
|
|
56297
56305
|
},
|
|
56306
|
+
libraries: {
|
|
56307
|
+
StUSDCDeskLib: "0x0880ce721b0A50C8Fe8d5c911097F0c24e57b6aA"
|
|
56308
|
+
},
|
|
56298
56309
|
latestEnv: {
|
|
56299
56310
|
UCD_TOKEN: "0xdd817Ff47C9b8f81335Ac579895D8EA321Fa86Df",
|
|
56300
56311
|
UCD_CONTROLLER: "0x360Bde4e489ee94E26601B206932De09EE60FF04",
|
|
@@ -56347,8 +56358,6 @@ var init_deployment_addresses = __esm2({
|
|
|
56347
56358
|
CONTRACT_VERSION_REGISTRY: "0x97E43AA6aFF2C0cf659d3aE501658D2Ef6777522",
|
|
56348
56359
|
CONTRACT_VERSION_REGISTRY_IMPL: "0xF3389De4bCeC735e4F6d35b9f71170D96037D1B7",
|
|
56349
56360
|
USDC_TOKEN: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
|
|
56350
|
-
MOCK_USDC_TOKEN: "0x96409A98e0D322d6566b7F44a0fAbD1BD4ce2AEc",
|
|
56351
|
-
MOCK_USDT_TOKEN: "0xF8b7fB38b17a310960E47805Be9adba0b0e0394D",
|
|
56352
56361
|
POSITION_DELEGATE_REGISTRY: "0x482369De283622E7b05731875ec137d4E3D208F9",
|
|
56353
56362
|
POSITION_DELEGATE_REGISTRY_IMPL: "0xc681c48688cdAA966119E265e4a378ef8Fe0eBcA",
|
|
56354
56363
|
AGENT_MODULE: "0xefb8C29C1e7e92ed7d81a52dbedaed74e37fe380",
|
|
@@ -56363,7 +56372,7 @@ var init_deployment_addresses = __esm2({
|
|
|
56363
56372
|
STUCD_VAULT: "0xc04Dd4d6799FFDE57feAfD5B3B1B038827014fd3",
|
|
56364
56373
|
STUCD_VAULT_IMPL: "0xd596A866ee5273aedaC21BC6e88649E087fC8EcB",
|
|
56365
56374
|
STUSDC_VAULT: "0x7aBac04d4Bf2b3A63AF363B9527970791346463a",
|
|
56366
|
-
STUSDC_VAULT_IMPL: "
|
|
56375
|
+
STUSDC_VAULT_IMPL: "0xE94DFBacA21fEFB0BB2e95D33510Ca702d2b6c5f",
|
|
56367
56376
|
CARRY_FEE_RECEIVER: "0x2C8e54f099Cf479182D7c87D76FeD88b4172cdB4",
|
|
56368
56377
|
CARRY_FEE_RECEIVER_IMPL: "0x3a86A23ff3cd6c26B1Fa2C5aeBAeEEdbF6095D69",
|
|
56369
56378
|
FEE_RECOGNITION_LEDGER: "0xA5EBfb856fe2b847cC6011B0fe2dB6ACE63D6C3c",
|
|
@@ -56395,8 +56404,6 @@ var init_deployment_addresses = __esm2({
|
|
|
56395
56404
|
BitcoinProviderRegistry: "0xbfA0c48B070D0a9A9CD27469AeacFD2d4261cEE2",
|
|
56396
56405
|
ContractVersionRegistry: "0x97E43AA6aFF2C0cf659d3aE501658D2Ef6777522",
|
|
56397
56406
|
usdcToken: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
|
|
56398
|
-
mockUsdcToken: "0x96409A98e0D322d6566b7F44a0fAbD1BD4ce2AEc",
|
|
56399
|
-
mockUsdtToken: "0xF8b7fB38b17a310960E47805Be9adba0b0e0394D",
|
|
56400
56407
|
PositionDelegateRegistry: "0x482369De283622E7b05731875ec137d4E3D208F9",
|
|
56401
56408
|
FeeRecipientRegistry: "0x95795F8403DDb629E8527B2934C4e71f5fC0C374",
|
|
56402
56409
|
BitcoinWithdrawalAddressRegistry: "0x6376D392097F0A81e51BD83960A97EA20eaf1dbe",
|
|
@@ -58423,7 +58430,7 @@ ${errorReport}`);
|
|
|
58423
58430
|
}
|
|
58424
58431
|
init_debug_logger();
|
|
58425
58432
|
init_session_signature_cache();
|
|
58426
|
-
var
|
|
58433
|
+
var import_ethers282 = __require("ethers");
|
|
58427
58434
|
var EXPIRED_LOAN_MIN_LIQUIDATION_THRESHOLD_BPS = 11e3;
|
|
58428
58435
|
var EXPIRED_LOAN_MAX_ESCALATION_ITERATIONS = 365;
|
|
58429
58436
|
var BASIS_POINTS_DENOMINATOR = 1e4;
|
|
@@ -61554,12 +61561,12 @@ ${auth.clientId}`;
|
|
|
61554
61561
|
throw new Error(`executeVaultSnapshot requires a positive integer chainId, got ${String(chainId)}`);
|
|
61555
61562
|
}
|
|
61556
61563
|
global.ethers = {
|
|
61557
|
-
...
|
|
61564
|
+
...import_ethers282.ethers,
|
|
61558
61565
|
providers: {
|
|
61559
|
-
StaticJsonRpcProvider:
|
|
61566
|
+
StaticJsonRpcProvider: import_ethers282.ethers.JsonRpcProvider
|
|
61560
61567
|
},
|
|
61561
|
-
Contract:
|
|
61562
|
-
utils:
|
|
61568
|
+
Contract: import_ethers282.ethers.Contract,
|
|
61569
|
+
utils: import_ethers282.ethers
|
|
61563
61570
|
// v6 moved utils to top level
|
|
61564
61571
|
};
|
|
61565
61572
|
global.Lit = {
|
|
@@ -61886,8 +61893,6 @@ function getSepoliaConfig() {
|
|
|
61886
61893
|
positionManagerViews: SEPOLIA_CONTRACTS.PositionManagerViews || "",
|
|
61887
61894
|
simplePsmV2: SEPOLIA_CONTRACTS.SimplePSMV2 || "",
|
|
61888
61895
|
usdcToken: SEPOLIA_CONTRACTS.usdcToken || "",
|
|
61889
|
-
mockUsdcToken: SEPOLIA_CONTRACTS.mockUsdcToken || "",
|
|
61890
|
-
mockUsdtToken: SEPOLIA_CONTRACTS.mockUsdtToken || "",
|
|
61891
61896
|
loanOperationsManager: SEPOLIA_CONTRACTS.LoanOperationsManagerModule || "",
|
|
61892
61897
|
termManager: SEPOLIA_CONTRACTS.TermManagerModule || "",
|
|
61893
61898
|
circuitBreaker: SEPOLIA_CONTRACTS.CircuitBreakerModule || "",
|
|
@@ -62457,12 +62462,6 @@ function assertFeeCeiling(gasLimit, maxFeePerGas, raise, ceiling = DEFAULT_FEE_C
|
|
|
62457
62462
|
);
|
|
62458
62463
|
}
|
|
62459
62464
|
}
|
|
62460
|
-
var MINT_UCD_GAS_CEILING = BigInt(13e5);
|
|
62461
|
-
var WITHDRAW_BTC_GAS_CEILING = BigInt(3e6);
|
|
62462
|
-
var MAKE_PAYMENT_GAS_CEILING = BigInt(1e6);
|
|
62463
|
-
var EXTEND_POSITION_GAS_CEILING = BigInt(1e6);
|
|
62464
|
-
var LIQUIDATION_COMMIT_GAS_CEILING = BigInt(2e6);
|
|
62465
|
-
var LIQUIDATION_REVEAL_GAS_CEILING = BigInt(25e5);
|
|
62466
62465
|
var FEE_HISTORY_BLOCK_COUNT = 20;
|
|
62467
62466
|
var FEE_HISTORY_REWARD_PERCENTILE = 75;
|
|
62468
62467
|
function isJsonRpcSendable(provider) {
|
|
@@ -63803,6 +63802,39 @@ var ServerSession = class {
|
|
|
63803
63802
|
}
|
|
63804
63803
|
}
|
|
63805
63804
|
};
|
|
63805
|
+
var GAS_LIMIT_MULTIPLIER_NUMERATOR = 12n;
|
|
63806
|
+
var GAS_LIMIT_MULTIPLIER_DENOMINATOR = 10n;
|
|
63807
|
+
var GAS_LIMIT_HEADROOM = 262500n;
|
|
63808
|
+
var GasLimitCeilingError = class extends Error {
|
|
63809
|
+
constructor(estimate, gasLimit) {
|
|
63810
|
+
super(
|
|
63811
|
+
`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`
|
|
63812
|
+
);
|
|
63813
|
+
this.estimate = estimate;
|
|
63814
|
+
this.gasLimit = gasLimit;
|
|
63815
|
+
this.name = "GasLimitCeilingError";
|
|
63816
|
+
}
|
|
63817
|
+
};
|
|
63818
|
+
var GAS_ESTIMATE_RETRY_MARKER = "no gasLimit can be sized, so nothing was sent \u2014 retry";
|
|
63819
|
+
var GasEstimateUnavailableError = class extends Error {
|
|
63820
|
+
constructor(message2, cause) {
|
|
63821
|
+
super(message2);
|
|
63822
|
+
this.cause = cause;
|
|
63823
|
+
this.name = "GasEstimateUnavailableError";
|
|
63824
|
+
}
|
|
63825
|
+
retryable = true;
|
|
63826
|
+
};
|
|
63827
|
+
function sizeGasLimit(estimate) {
|
|
63828
|
+
if (estimate <= 0n) {
|
|
63829
|
+
throw new Error(`sizeGasLimit: estimate must be positive, got ${estimate}`);
|
|
63830
|
+
}
|
|
63831
|
+
const scaled = (estimate * GAS_LIMIT_MULTIPLIER_NUMERATOR + GAS_LIMIT_MULTIPLIER_DENOMINATOR - 1n) / GAS_LIMIT_MULTIPLIER_DENOMINATOR;
|
|
63832
|
+
const gasLimit = scaled + GAS_LIMIT_HEADROOM;
|
|
63833
|
+
if (gasLimit > MAX_GAS_LIMIT) {
|
|
63834
|
+
throw new GasLimitCeilingError(estimate, gasLimit);
|
|
63835
|
+
}
|
|
63836
|
+
return gasLimit;
|
|
63837
|
+
}
|
|
63806
63838
|
var DEAD_ZONE_VIOLATION_SELECTOR = "0xbe4b82c1";
|
|
63807
63839
|
var ERROR_STRING_SELECTOR = "0x08c379a0";
|
|
63808
63840
|
var PANIC_SELECTOR = "0x4e487b71";
|
|
@@ -63830,13 +63862,13 @@ function decodeQuantumRevert(e) {
|
|
|
63830
63862
|
if (!name && selector && data) {
|
|
63831
63863
|
try {
|
|
63832
63864
|
if (selector === ERROR_STRING_SELECTOR) {
|
|
63833
|
-
const [message2] =
|
|
63865
|
+
const [message2] = import_ethers22.AbiCoder.defaultAbiCoder().decode(
|
|
63834
63866
|
["string"],
|
|
63835
63867
|
"0x" + data.slice(10)
|
|
63836
63868
|
);
|
|
63837
63869
|
name = `Error("${message2}")`;
|
|
63838
63870
|
} else if (selector === PANIC_SELECTOR) {
|
|
63839
|
-
const [code] =
|
|
63871
|
+
const [code] = import_ethers22.AbiCoder.defaultAbiCoder().decode(
|
|
63840
63872
|
["uint256"],
|
|
63841
63873
|
"0x" + data.slice(10)
|
|
63842
63874
|
);
|
|
@@ -63859,7 +63891,8 @@ function isRetryableQuantumFailure(message2) {
|
|
|
63859
63891
|
if (message2.includes("Transaction timeout") || message2.includes("Transaction confirmation failed") || message2.includes("Transaction receipt not found")) {
|
|
63860
63892
|
return false;
|
|
63861
63893
|
}
|
|
63862
|
-
return RETRYABLE_QUANTUM_ERROR_NAMES.some((name) => message2.includes(name)) || message2.includes("Transaction reverted");
|
|
63894
|
+
return RETRYABLE_QUANTUM_ERROR_NAMES.some((name) => message2.includes(name)) || message2.includes("Transaction reverted") || // No gas estimate → refused before broadcast; a fresh signature is safe.
|
|
63895
|
+
message2.includes(GAS_ESTIMATE_RETRY_MARKER);
|
|
63863
63896
|
}
|
|
63864
63897
|
var MAX_DEADZONE_RESIMULATIONS = 3;
|
|
63865
63898
|
var QuantumRevertError = class extends Error {
|
|
@@ -63889,54 +63922,105 @@ async function assertSafeQuantumSubmission(opts) {
|
|
|
63889
63922
|
...opts.sleep ? { sleep: opts.sleep } : {},
|
|
63890
63923
|
...chainNow ? { chainNow } : {}
|
|
63891
63924
|
};
|
|
63925
|
+
const tx2 = { to, from, data };
|
|
63892
63926
|
await awaitSafeSubmissionWindow(quantumTimestamp, gateOpts);
|
|
63893
63927
|
const SAME_BLOCK_INTERACTION_SELECTOR = "0x3b53d1db";
|
|
63894
63928
|
const laneGuardActive = opts.laneGuardActive === true;
|
|
63929
|
+
const sigQuantum = Math.floor(quantumTimestamp / QUANTUM_WINDOW_SECONDS2) * QUANTUM_WINDOW_SECONDS2;
|
|
63930
|
+
const sigIsCurrent = () => sigQuantum === Math.floor(now() / QUANTUM_WINDOW_SECONDS2) * QUANTUM_WINDOW_SECONDS2;
|
|
63931
|
+
const resolveStaleHead = async (decoded) => {
|
|
63932
|
+
const deadZoneArtifact = decoded.selector === DEAD_ZONE_VIOLATION_SELECTOR && sigIsCurrent();
|
|
63933
|
+
if (laneGuardActive && (decoded.selector === SAME_BLOCK_INTERACTION_SELECTOR || deadZoneArtifact)) {
|
|
63934
|
+
onDebug(
|
|
63935
|
+
`\u21AA\uFE0F [lane-only] Simulated ${decoded.name ?? decoded.selector} is a stale-latest-block artifact \u2014 mining one block and re-estimating`
|
|
63936
|
+
);
|
|
63937
|
+
await requireSend(provider, "evm_mine on the local lane")("evm_mine", []);
|
|
63938
|
+
return settle2(await estimateOnce(provider, tx2));
|
|
63939
|
+
}
|
|
63940
|
+
if (deadZoneArtifact) {
|
|
63941
|
+
onDebug(
|
|
63942
|
+
"\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"
|
|
63943
|
+
);
|
|
63944
|
+
return settle2(await estimateWithTimeOverride(provider, tx2, now()));
|
|
63945
|
+
}
|
|
63946
|
+
return null;
|
|
63947
|
+
};
|
|
63948
|
+
let estimate;
|
|
63895
63949
|
for (let sim = 1; ; sim++) {
|
|
63896
|
-
|
|
63897
|
-
|
|
63950
|
+
const outcome = await estimateOnce(provider, tx2);
|
|
63951
|
+
if (outcome.ok) {
|
|
63952
|
+
estimate = outcome.estimate;
|
|
63898
63953
|
break;
|
|
63899
|
-
}
|
|
63900
|
-
|
|
63901
|
-
|
|
63902
|
-
|
|
63903
|
-
|
|
63904
|
-
|
|
63905
|
-
|
|
63906
|
-
|
|
63907
|
-
if (
|
|
63908
|
-
const sigQuantum = Math.floor(quantumTimestamp / QUANTUM_WINDOW_SECONDS2) * QUANTUM_WINDOW_SECONDS2;
|
|
63909
|
-
const realCurrentQuantum = Math.floor(now() / QUANTUM_WINDOW_SECONDS2) * QUANTUM_WINDOW_SECONDS2;
|
|
63910
|
-
if (sigQuantum === realCurrentQuantum) {
|
|
63911
|
-
onDebug(
|
|
63912
|
-
"\u21AA\uFE0F Simulated DeadZoneViolation is a stale-latest-block artifact (signature is the current quantum) \u2014 proceeding to broadcast"
|
|
63913
|
-
);
|
|
63914
|
-
break;
|
|
63915
|
-
}
|
|
63916
|
-
const gate = await awaitSafeSubmissionWindow(quantumTimestamp, gateOpts);
|
|
63917
|
-
if (gate.waited) {
|
|
63918
|
-
onDebug(
|
|
63919
|
-
`\u{1F501} Re-simulating after crossing the quantum boundary (attempt ${sim}/${maxResimulations})`
|
|
63920
|
-
);
|
|
63921
|
-
continue;
|
|
63922
|
-
}
|
|
63923
|
-
}
|
|
63924
|
-
if (!decoded.data) {
|
|
63925
|
-
const label = simError instanceof Error ? simError.message : String(simError);
|
|
63954
|
+
}
|
|
63955
|
+
const resolved = await resolveStaleHead(outcome.decoded);
|
|
63956
|
+
if (resolved !== null) {
|
|
63957
|
+
estimate = resolved;
|
|
63958
|
+
break;
|
|
63959
|
+
}
|
|
63960
|
+
if (outcome.decoded.selector === DEAD_ZONE_VIOLATION_SELECTOR && sim <= maxResimulations) {
|
|
63961
|
+
const gate = await awaitSafeSubmissionWindow(quantumTimestamp, gateOpts);
|
|
63962
|
+
if (gate.waited) {
|
|
63926
63963
|
onDebug(
|
|
63927
|
-
`\
|
|
63964
|
+
`\u{1F501} Re-estimating after crossing the quantum boundary (attempt ${sim}/${maxResimulations})`
|
|
63928
63965
|
);
|
|
63929
|
-
|
|
63966
|
+
continue;
|
|
63930
63967
|
}
|
|
63931
|
-
throw new QuantumRevertError(
|
|
63932
|
-
decoded.name,
|
|
63933
|
-
decoded.selector,
|
|
63934
|
-
decoded.data,
|
|
63935
|
-
simError
|
|
63936
|
-
);
|
|
63937
63968
|
}
|
|
63969
|
+
settle2(outcome);
|
|
63938
63970
|
}
|
|
63939
|
-
await awaitSafeSubmissionWindow(quantumTimestamp, gateOpts);
|
|
63971
|
+
const finalGate = await awaitSafeSubmissionWindow(quantumTimestamp, gateOpts);
|
|
63972
|
+
if (finalGate.waited) {
|
|
63973
|
+
onDebug("\u{1F501} Re-estimating after the final re-gate waited");
|
|
63974
|
+
const outcome = await estimateOnce(provider, tx2);
|
|
63975
|
+
estimate = outcome.ok ? outcome.estimate : await resolveStaleHead(outcome.decoded) ?? settle2(outcome);
|
|
63976
|
+
}
|
|
63977
|
+
return { estimate, gasLimit: sizeGasLimit(estimate) };
|
|
63978
|
+
}
|
|
63979
|
+
async function estimateOnce(provider, tx2) {
|
|
63980
|
+
return provider.estimateGas(tx2).then(
|
|
63981
|
+
(estimate) => ({ ok: true, estimate }),
|
|
63982
|
+
(error) => ({
|
|
63983
|
+
ok: false,
|
|
63984
|
+
decoded: decodeQuantumRevert(error),
|
|
63985
|
+
error,
|
|
63986
|
+
via: "eth_estimateGas"
|
|
63987
|
+
})
|
|
63988
|
+
);
|
|
63989
|
+
}
|
|
63990
|
+
async function estimateWithTimeOverride(provider, tx2, timeSec) {
|
|
63991
|
+
const via = "eth_estimateGas with a blockOverrides time override";
|
|
63992
|
+
const send = requireSend(provider, via);
|
|
63993
|
+
return send("eth_estimateGas", [tx2, "latest", {}, { time: (0, import_ethers21.toQuantity)(timeSec) }]).then(
|
|
63994
|
+
(raw) => ({ ok: true, estimate: BigInt(raw) }),
|
|
63995
|
+
(error) => ({
|
|
63996
|
+
ok: false,
|
|
63997
|
+
decoded: decodeQuantumRevert(error),
|
|
63998
|
+
error,
|
|
63999
|
+
via
|
|
64000
|
+
})
|
|
64001
|
+
);
|
|
64002
|
+
}
|
|
64003
|
+
function requireSend(provider, purpose) {
|
|
64004
|
+
if (typeof provider.send !== "function") {
|
|
64005
|
+
throw new GasEstimateUnavailableError(
|
|
64006
|
+
`Cannot run ${purpose}: the SDK read provider exposes no JSON-RPC send() (use an ethers JsonRpcProvider)`,
|
|
64007
|
+
null
|
|
64008
|
+
);
|
|
64009
|
+
}
|
|
64010
|
+
return provider.send.bind(provider);
|
|
64011
|
+
}
|
|
64012
|
+
function settle2(outcome) {
|
|
64013
|
+
if (outcome.ok)
|
|
64014
|
+
return outcome.estimate;
|
|
64015
|
+
const { decoded, error, via } = outcome;
|
|
64016
|
+
if (!decoded.data) {
|
|
64017
|
+
const label = error instanceof Error ? error.message : String(error);
|
|
64018
|
+
throw new GasEstimateUnavailableError(
|
|
64019
|
+
`${via} failed without revert data (${label}); ${GAS_ESTIMATE_RETRY_MARKER}`,
|
|
64020
|
+
error
|
|
64021
|
+
);
|
|
64022
|
+
}
|
|
64023
|
+
throw new QuantumRevertError(decoded.name, decoded.selector, decoded.data, error);
|
|
63940
64024
|
}
|
|
63941
64025
|
var HARDHAT_CHAIN_IDS = /* @__PURE__ */ new Set([1337, 31337]);
|
|
63942
64026
|
function laneGuardEnvEnabled() {
|
|
@@ -64154,7 +64238,7 @@ var GET_AUTHORIZED_SPENDS_ABI = [
|
|
|
64154
64238
|
"function getAuthorizedSpends(bytes32 positionId) view returns (tuple(string txid, uint32 vout, uint256 satoshis, string targetAddress, uint256 targetAmount, uint256 authorizedAt)[])"
|
|
64155
64239
|
];
|
|
64156
64240
|
async function readAuthorizedSpend(params) {
|
|
64157
|
-
const authorizer = new
|
|
64241
|
+
const authorizer = new import_ethers24.Contract(
|
|
64158
64242
|
btcSpendAuthorizerAddress(params.chainId),
|
|
64159
64243
|
GET_AUTHORIZED_SPENDS_ABI,
|
|
64160
64244
|
params.runner
|
|
@@ -64326,7 +64410,7 @@ function hashBtcInputSet(utxos) {
|
|
|
64326
64410
|
seen.add(key);
|
|
64327
64411
|
}
|
|
64328
64412
|
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("|");
|
|
64329
|
-
return (0,
|
|
64413
|
+
return (0, import_ethers25.keccak256)((0, import_ethers25.toUtf8Bytes)(canonical));
|
|
64330
64414
|
}
|
|
64331
64415
|
async function buildBtcExecuteEnvelope(params) {
|
|
64332
64416
|
const { positionId, txid, vout, satoshis, networkFee, chainId, signer } = params;
|
|
@@ -64753,7 +64837,7 @@ function rowToStatus(row) {
|
|
|
64753
64837
|
return row;
|
|
64754
64838
|
}
|
|
64755
64839
|
async function fetchProtocolPauseStatus(provider, positionManagerAddress) {
|
|
64756
|
-
const iface = new
|
|
64840
|
+
const iface = new import_ethers27.Interface(GET_PROTOCOL_PAUSE_STATUS_ABI);
|
|
64757
64841
|
const data = iface.encodeFunctionData("getProtocolPauseStatus", []);
|
|
64758
64842
|
const raw = await provider.call({ to: positionManagerAddress, data });
|
|
64759
64843
|
const decoded = iface.decodeFunctionResult("getProtocolPauseStatus", raw);
|
|
@@ -64943,38 +65027,38 @@ var ContractManager = class {
|
|
|
64943
65027
|
}
|
|
64944
65028
|
const contractRunner = runner;
|
|
64945
65029
|
const contracts = {
|
|
64946
|
-
positionManager: new
|
|
65030
|
+
positionManager: new import_ethers28.Contract(
|
|
64947
65031
|
contractAddresses.positionManager,
|
|
64948
65032
|
POSITION_MANAGER_ABI,
|
|
64949
65033
|
contractRunner
|
|
64950
65034
|
),
|
|
64951
|
-
loanOperationsManager: new
|
|
64952
|
-
contractAddresses.loanOperationsManager ||
|
|
65035
|
+
loanOperationsManager: new import_ethers28.Contract(
|
|
65036
|
+
contractAddresses.loanOperationsManager || import_ethers28.ZeroAddress,
|
|
64953
65037
|
LOAN_OPS_ABI,
|
|
64954
65038
|
contractRunner
|
|
64955
65039
|
),
|
|
64956
|
-
ucdController: new
|
|
65040
|
+
ucdController: new import_ethers28.Contract(
|
|
64957
65041
|
contractAddresses.ucdToken,
|
|
64958
65042
|
UCD_CONTROLLER_ABI,
|
|
64959
65043
|
contractRunner
|
|
64960
65044
|
),
|
|
64961
|
-
termManager: new
|
|
64962
|
-
contractAddresses.termManager ||
|
|
65045
|
+
termManager: new import_ethers28.Contract(
|
|
65046
|
+
contractAddresses.termManager || import_ethers28.ZeroAddress,
|
|
64963
65047
|
TERM_MANAGER_ABI,
|
|
64964
65048
|
contractRunner
|
|
64965
65049
|
),
|
|
64966
|
-
circuitBreaker: new
|
|
64967
|
-
contractAddresses.circuitBreaker ||
|
|
65050
|
+
circuitBreaker: new import_ethers28.Contract(
|
|
65051
|
+
contractAddresses.circuitBreaker || import_ethers28.ZeroAddress,
|
|
64968
65052
|
CIRCUIT_BREAKER_ABI,
|
|
64969
65053
|
contractRunner
|
|
64970
65054
|
),
|
|
64971
|
-
liquidationManager: new
|
|
64972
|
-
contractAddresses.liquidationManager ||
|
|
65055
|
+
liquidationManager: new import_ethers28.Contract(
|
|
65056
|
+
contractAddresses.liquidationManager || import_ethers28.ZeroAddress,
|
|
64973
65057
|
LIQUIDATION_MANAGER_ABI,
|
|
64974
65058
|
contractRunner
|
|
64975
65059
|
),
|
|
64976
|
-
bitcoinWithdrawalAddressRegistry: new
|
|
64977
|
-
contractAddresses.bitcoinWithdrawalAddressRegistry ||
|
|
65060
|
+
bitcoinWithdrawalAddressRegistry: new import_ethers28.Contract(
|
|
65061
|
+
contractAddresses.bitcoinWithdrawalAddressRegistry || import_ethers28.ZeroAddress,
|
|
64978
65062
|
BITCOIN_WITHDRAWAL_ADDRESS_REGISTRY_ABI,
|
|
64979
65063
|
contractRunner
|
|
64980
65064
|
)
|
|
@@ -65023,13 +65107,13 @@ var ContractManager = class {
|
|
|
65023
65107
|
const address = addresses[key];
|
|
65024
65108
|
if (!address) {
|
|
65025
65109
|
missing.push(String(key));
|
|
65026
|
-
} else if (!(0,
|
|
65110
|
+
} else if (!(0, import_ethers28.isAddress)(address)) {
|
|
65027
65111
|
invalid2.push(String(key));
|
|
65028
65112
|
}
|
|
65029
65113
|
}
|
|
65030
65114
|
for (const key of optionalAddresses) {
|
|
65031
65115
|
const address = addresses[key];
|
|
65032
|
-
if (address && !(0,
|
|
65116
|
+
if (address && !(0, import_ethers28.isAddress)(address)) {
|
|
65033
65117
|
invalid2.push(String(key));
|
|
65034
65118
|
}
|
|
65035
65119
|
}
|
|
@@ -66344,11 +66428,11 @@ var LoanCreator = class {
|
|
|
66344
66428
|
try {
|
|
66345
66429
|
const mainnetVaultAddress = bitcoinAddresses.mainnet;
|
|
66346
66430
|
const regtestVaultAddress = bitcoinAddresses.regtest;
|
|
66347
|
-
const pkpIdBytes32 = (0,
|
|
66348
|
-
(0,
|
|
66431
|
+
const pkpIdBytes32 = (0, import_ethers29.zeroPadValue)(
|
|
66432
|
+
(0, import_ethers29.toBeHex)(BigInt(pkpData.tokenId)),
|
|
66349
66433
|
32
|
|
66350
66434
|
);
|
|
66351
|
-
const pkpPublicKeyUncompressed =
|
|
66435
|
+
const pkpPublicKeyUncompressed = import_ethers29.SigningKey.computePublicKey(
|
|
66352
66436
|
pkpData.publicKey,
|
|
66353
66437
|
false
|
|
66354
66438
|
);
|
|
@@ -66361,7 +66445,7 @@ var LoanCreator = class {
|
|
|
66361
66445
|
);
|
|
66362
66446
|
log.debug(`BigInt conversion: ${BigInt(pkpData.tokenId).toString()}`);
|
|
66363
66447
|
log.debug(
|
|
66364
|
-
`Hex from BigInt: ${(0,
|
|
66448
|
+
`Hex from BigInt: ${(0, import_ethers29.toBeHex)(BigInt(pkpData.tokenId))}`
|
|
66365
66449
|
);
|
|
66366
66450
|
log.debug(`Final bytes32 (zero-padded): ${pkpIdBytes32}`);
|
|
66367
66451
|
log.debug(
|
|
@@ -66533,8 +66617,8 @@ var LoanCreator = class {
|
|
|
66533
66617
|
}
|
|
66534
66618
|
}
|
|
66535
66619
|
if (this.config.debug) {
|
|
66536
|
-
const pkpIdBytes32Check = (0,
|
|
66537
|
-
(0,
|
|
66620
|
+
const pkpIdBytes32Check = (0, import_ethers29.zeroPadValue)(
|
|
66621
|
+
(0, import_ethers29.toBeHex)(BigInt(pkpData.tokenId)),
|
|
66538
66622
|
32
|
|
66539
66623
|
);
|
|
66540
66624
|
log.error("\u274C Loan creation transaction failed", {
|
|
@@ -66695,7 +66779,7 @@ var LoanCreator = class {
|
|
|
66695
66779
|
const coreAddress = this.config.contractManager.getContractAddresses().positionManagerCore;
|
|
66696
66780
|
if (coreAddress) {
|
|
66697
66781
|
try {
|
|
66698
|
-
const core = new
|
|
66782
|
+
const core = new import_ethers29.Contract(
|
|
66699
66783
|
coreAddress,
|
|
66700
66784
|
[
|
|
66701
66785
|
"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))"
|
|
@@ -66737,8 +66821,8 @@ var LoanCreator = class {
|
|
|
66737
66821
|
const newEventAbi = [
|
|
66738
66822
|
"event PositionCreated(bytes32 indexed positionId, bytes32 indexed pkpId, address indexed borrower, uint256 requestedCollateralRatio, uint256 selectedTerm, uint256 expiryAt)"
|
|
66739
66823
|
];
|
|
66740
|
-
const oldIface = new
|
|
66741
|
-
const newIface = new
|
|
66824
|
+
const oldIface = new import_ethers29.Interface(oldEventAbi);
|
|
66825
|
+
const newIface = new import_ethers29.Interface(newEventAbi);
|
|
66742
66826
|
let positionId;
|
|
66743
66827
|
if (this.config.debug) {
|
|
66744
66828
|
log.info("\u{1F50D} Parsing transaction receipt logs", {
|
|
@@ -67218,7 +67302,7 @@ var LoanQuery = class {
|
|
|
67218
67302
|
const isChipotlePkpId2 = typeof rawId === "string" && isNormalizedChipotlePkpId(rawId);
|
|
67219
67303
|
if (isChipotlePkpId2) {
|
|
67220
67304
|
if (this.config.positionManagerCoreAddress && this.config.provider) {
|
|
67221
|
-
const pmContract = new
|
|
67305
|
+
const pmContract = new import_ethers30.Contract(
|
|
67222
67306
|
this.config.positionManagerCoreAddress,
|
|
67223
67307
|
POSITION_CORE_ABI,
|
|
67224
67308
|
this.config.provider
|
|
@@ -67321,7 +67405,7 @@ var LoanQuery = class {
|
|
|
67321
67405
|
*/
|
|
67322
67406
|
async getBorrowerUcdDebtSummary(borrower) {
|
|
67323
67407
|
const trimmed = typeof borrower === "string" ? borrower.trim() : "";
|
|
67324
|
-
if (!(0,
|
|
67408
|
+
if (!(0, import_ethers30.isAddress)(trimmed)) {
|
|
67325
67409
|
return failure(
|
|
67326
67410
|
new SDKError({
|
|
67327
67411
|
message: `Borrower must be an EVM address for a UCD debt summary, got "${trimmed}"`,
|
|
@@ -67596,7 +67680,7 @@ var WithdrawalAddressModule = class {
|
|
|
67596
67680
|
if (!res.success)
|
|
67597
67681
|
return res;
|
|
67598
67682
|
const target = res.value.target;
|
|
67599
|
-
if (!target || target ===
|
|
67683
|
+
if (!target || target === import_ethers31.ZeroAddress) {
|
|
67600
67684
|
return failure(
|
|
67601
67685
|
new SDKError({
|
|
67602
67686
|
code: "SDK_WITHDRAWAL_REGISTRY_NOT_CONFIGURED",
|
|
@@ -67618,7 +67702,7 @@ var WithdrawalAddressModule = class {
|
|
|
67618
67702
|
* @throws on mixed-case bech32, which has no canonical spelling (BIP-173).
|
|
67619
67703
|
*/
|
|
67620
67704
|
static addressHash(btcAddress2) {
|
|
67621
|
-
return (0,
|
|
67705
|
+
return (0, import_ethers31.keccak256)((0, import_ethers31.toUtf8Bytes)(normalizeBitcoinAddress(btcAddress2)));
|
|
67622
67706
|
}
|
|
67623
67707
|
/**
|
|
67624
67708
|
* The canonical spelling the registry keys on, or a VALIDATION failure for mixed-case
|
|
@@ -73698,7 +73782,7 @@ var _abi = [
|
|
|
73698
73782
|
];
|
|
73699
73783
|
var _bytecode = "0x60a080604052346100ea57306080527ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005460ff8160401c166100d9576002600160401b03196001600160401b03821601610073575b6040516149a190816100f08239608051818181612896015261298f0152f35b6001600160401b0319166001600160401b039081177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005581527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a13880610054565b63f92ee8a960e01b60005260046000fd5b600080fdfe6080604052600436101561001257600080fd5b6000803560e01c8062f7fce91461393b57806301ffc9a7146138ca578063021d2893146138715780630871b20614613838578063114249d214610f7b57806311d954f81461380f57806313da3166146137d65780631d44a9041461372d5780631f77bf65146136f4578063248a9ca3146136d55780632b83cccd146132285780632f2ff15d146131f657806334bac370146131bd57806334e181251461318457806336568abe1461313f578063373c86b6146131065780633f4ba83a1461303f5780634373b572146130165780634451e89b14612c425780634ebd25a514612c095780634f1ef286146129145780635273b6f6146128eb57806352d1902d14612883578063568fafca146127f557806359d5d02a146125485780635bc26aea146125135780635c975abb146124e35780635ecc2708146123c55780638456cb59146122ca57806385c15d9a1461229157806389d3ad00146121d95780638bff608e146121a05780639010d07c1461214d57806390ad8b401461213157806391d14854146120d85780639b759bf7146120955780639baf58d2146120785780639f1d0f59146119bd578063a217fddf146119a1578063a3246ad3146118e4578063ad3cb1cc1461189d578063b492fc69146117b2578063b9f637af14611587578063bf7d911914611548578063c55f15ea14611525578063ca15c873146114ee578063ca2ce65d146114b5578063cc1f8ffa14611483578063cf46075e14611379578063d21a74ff1461133c578063d2f8253614611319578063d511b2891461115c578063d547741f14611121578063d5d3f78b14610fb4578063d66bd52414610f7b578063e1f1c4a714610f5e578063e1f3962c14610f32578063ec2f96fe14610f0e578063eda5a26a14610b11578063f1a1eb8414610ace578063f385116d14610a95578063f77c479114610a6e578063f8c8765e1461067b578063f95ec0461461055f578063faaebd2114610526578063facdfb5e14610377578063fe32e7281461033e5763ffa1ad741461030857600080fd5b3461033b578060031936011261033b57610337610323613b97565b604051918291602083526020830190613b0c565b0390f35b80fd5b503461033b57602036600319011261033b576020906040906001600160a01b03610366613a23565b168152601283522054604051908152f35b503461033b57602036600319011261033b57610391613a23565b610399614059565b6010546001600160a01b03163303610517576001600160a01b03168082526002602052604082205460ff161561050557808252600760205260408220546040516370a0823160e01b8152306004820152602081602481865afa9081156104fa5784916104c3575b50818111156104b4576104138282613c9b565b821590811561045f575b5050600080516020614975833981519152916040918486526007602052808387205582519182526020820152a260016000805160206149158339815191525580f35b61271081029080820461271014901517156104a057606484029184830460641417156104a0571161049157388061041d565b63a73af74d60e01b8452600484fd5b634e487b7160e01b86526011600452602486fd5b6104be8183613c9b565b610413565b90506020813d6020116104f2575b816104de60209383613ab8565b810103126104ed575138610400565b600080fd5b3d91506104d1565b6040513d86823e3d90fd5b6374ed46ad60e01b8252600452602490fd5b6349db3bd360e01b8252600482fd5b503461033b57602036600319011261033b576020906040906001600160a01b0361054e613a23565b168152600483522054604051908152f35b503461033b5761056e36613b5d565b601054909392906001600160a01b0316330361066c576001600160a01b03168083526002602052604083205460ff161561065a57811561064b576001600160a01b0384161561063c5780835260076020526040832054936105cf8386613df7565b85811061062d576001600160ff1b03811161061e576000805160206149758339815191526040869785938461061b9952600760205280838b205582519182526020820152a23091614363565b80f35b630700fcb360e11b8552600485fd5b63446c8cc960e01b8552600485fd5b634e46966960e11b8352600483fd5b63162908e360e11b8352600483fd5b6374ed46ad60e01b8352600452602482fd5b6349db3bd360e01b8352600483fd5b503461033b57608036600319011261033b57610695613a23565b61069d613a39565b6044356001600160a01b03811690818103610a6a576064356001600160a01b0381169390849003610a665760008051602061495583398151915254604081901c60ff161595906001600160401b031680159081610a5e575b6001149081610a54575b159081610a4b575b50610a3c5760008051602061495583398151915280546001600160401b031916600117905585610a17575b6001600160a01b0316908115610a08576001600160a01b03169081156109f95783156109ea576107606145d1565b6107686145d1565b6107706145d1565b6107786145d1565b6001600080516020614915833981519152556107926145d1565b61079a6145d1565b86546001600160a01b0319908116919091178755600180549182168317905560405163313ce56760e01b8152909190602081600481855afa8891816109b9575b506107ee57633a24e95b60e11b8852600488fd5b6001600160a81b03199092161760a091821b60ff60a01b16176001819055901c60ff1660111981016109a75750610825818661448f565b8061097f575b1561093a576108488160008051602061493583398151915261448f565b80610949575b1561093a5761086b9060008051602061485583398151915261448f565b9081610903575b50156108f457806108c9575b506108865780f35b60ff60401b19600080516020614955833981519152541660008051602061495583398151915255600080516020614835833981519152602060405160018152a180f35b601080546001600160a01b03191682179055826000805160206148958339815191528180a33861087e565b63cf5a8e3360e01b8352600483fd5b6109339060008051602061485583398151915286526000805160206147f583398151915260205260408620614617565b5038610872565b63cf5a8e3360e01b8552600485fd5b60008051602061493583398151915286526000805160206147f58339815191526020526109798360408820614617565b5061084e565b8580526000805160206147f58339815191526020526109a18360408820614617565b5061082b565b63167738cf60e21b8652600452602485fd5b6109dc91925060203d6020116109e3575b6109d48183613ab8565b810190613cd8565b90386107da565b503d6109ca565b630b5eba9f60e41b8752600487fd5b63c1ab6dc160e01b8752600487fd5b6336abb4df60e11b8752600487fd5b600080516020614955833981519152805460ff60401b1916600160401b179055610732565b63f92ee8a960e01b8752600487fd5b90501538610707565b303b1591506106ff565b8791506106f5565b8580fd5b8480fd5b503461033b578060031936011261033b57546040516001600160a01b039091168152602090f35b503461033b57602036600319011261033b576020906040906001600160a01b03610abd613a23565b168152600a83522054604051908152f35b503461033b57604036600319011261033b576020906040906001600160a01b03610af6613a23565b16815260158352818120602435825283522054604051908152f35b503461033b5761016036600319011261033b57610b2c613a23565b90606435604435602435610b3e613b4d565b9160a4359160c43560e43561010435916101243595610144359760018060a01b03601054163303610eff576001600160a01b038c16808c52600260205260408c2054909a9060ff16610eeb578a15610edc578615610ecd576127108811610eb3576103e88111610e9b5760ff82169c60128e118e8115610e90575b50610e7c57803b15610e68578915610e54578a15610e405782610bdb916143a7565b84151580610e37575b610e205785151580610e17575b610e00578b9c602460208d9e9d604051928380926370a0823160e01b82523060048301525afa9c8d15610df4579c610dc0575b506001600160ff1b038c11610db1578a8d8f9760408f97838f918f8f8f8f90859f988f99879f966000805160206148b58339815191529f978b9f988f8d6000805160206148158339815191529f988e8e610d699b6000805160206147d58339815191529f8f8f8487526002602052878720600160ff198254161790558487526003602052878720558386526004602052868620558285526006602052878686205582855260056020528585209060ff19825416179055818452600c6020528885852055818452600d6020528985852055818452600e6020528a85852055818452600f6020528b8585205581845260076020528484205582526012602052828220558d8152601360205220558a7f991d1ef1b5c0820d213328cba6682059e00a50e49c469a454eb3557e78eaf6668e80518b81528c6020820152a28c5198899889613e04565b0390a28151908b82526020820152a28151908782526020820152a280610d8d578280f35b6040600080516020614975833981519152918151908582526020820152a281808280f35b63556e7a8160e01b8e5260048efd5b909b506020813d602011610dec575b81610ddc60209383613ab8565b810103126104ed57519a38610c24565b3d9150610dcf565b604051903d90823e3d90fd5b60448c858863dd85772b60e01b8352600452602452fd5b50838610610bf1565b60448c8487637449915760e01b8352600452602452fd5b50828510610be4565b636835314760e11b8d52600160045260248dfd5b636835314760e11b8d5260048d905260248dfd5b63377e3f9960e21b8d5260048c905260248dfd5b63ca95039160e01b8d5260048e905260248dfd5b60069150108e610bb9565b631051834f60e11b8c526004526103e860245260448bfd5b63c1e9a14160e01b8c52600488905261271060245260448cfd5b63a2ec3a5560e01b8c5260048cfd5b63df407ac560e01b8c5260048cfd5b6317f4215b60e21b8c5260048b905260248cfd5b6349db3bd360e01b8b5260048bfd5b503461033b578060031936011261033b57602060ff60015460a01c16604051908152f35b503461033b57602036600319011261033b576020610f56610f51613a23565b613f3c565b604051908152f35b503461033b578060031936011261033b5760206040516127108152f35b503461033b57602036600319011261033b576020906040906001600160a01b03610fa3613a23565b168152600783522054604051908152f35b503461033b57602036600319011261033b57610fce613a23565b6010546001600160a01b03163303610517576001600160a01b03168082526002602052604082205460ff161561050557808252600760205260408220548061110b575080825260026020526040822060ff1981541690558082526003602052816040812055808252600460205281604081205580825260056020526040822060ff198154169055808252600c602052816040812055808252600d602052816040812055808252600e602052816040812055808252600f602052816040812055808252600660205281604081205580825260076020526040822054818352600760205282604081205560405190827f3302a1b37f04242bb55603f5449e7ecd690a35eef08ba1353c48c20e2aae9cda8580a2806110e8578380f35b816040916000805160206149758339815191529352846020820152a23880808380f35b604492916376bc059760e11b8352600452602452fd5b503461033b57604036600319011261033b57611158600435611141613a39565b9061115361114e82613ca8565b6141cf565b614261565b5080f35b503461033b5761116b36613b5d565b601054909392906001600160a01b0316330361066c576001600160a01b03168083526002602052604083205490939060ff161561130557811561064b576011546001600160a01b03169384156112f6576001600160a01b0382169485156112e75760206024916040519283809263babcc53960e01b82528a60048301525afa9081156112dc5785916112ad575b501561129e57808452600760205260408420549483861061128757816000805160206149758339815191526040886112348861061b9a9b613c9b565b848b526007602052828b2055838a526007602052818a205482519182526020820152a2817f96d682bdcb144aea9bb235442364e98309db373ac793e4807c1b36f7062fe0136020604051878152a3614193565b6044858786633cb8e07360e01b8352600452602452fd5b63133307bb60e21b8452600484fd5b6112cf915060203d6020116112d5575b6112c78183613ab8565b810190613d8d565b386111f8565b503d6112bd565b6040513d87823e3d90fd5b634e46966960e11b8552600485fd5b630e048e7160e41b8452600484fd5b6374ed46ad60e01b83526004849052602483fd5b503461033b578060031936011261033b57602060ff600854166040519015158152f35b503461033b57602036600319011261033b5760209060ff906040906001600160a01b03611367613a23565b16815260058452205416604051908152f35b503461033b57602036600319011261033b57611393613a23565b61139b614059565b6010546001600160a01b03163303610517576001600160a01b03168082526002602052604082205460ff161561050557808252600760205260408220546040516370a0823160e01b8152306004820152602081602481865afa9081156104fa578491611443575b50600080516020614975833981519152916040918486526007602052808387205582519182526020820152a260016000805160206149158339815191525580f35b90506020813d60201161147b575b8161145e60209383613ab8565b810103126104ed5751600080516020614975833981519152611402565b3d9150611451565b503461033b57604036600319011261033b5760206114ab6114a2613a23565b60243590613e3d565b6040519015158152f35b503461033b57602036600319011261033b576020906040906001600160a01b036114dd613a23565b168152601383522054604051908152f35b503461033b57602036600319011261033b57604060209160043581526000805160206147f583398151915283522054604051908152f35b503461033b578060031936011261033b576020604051670de0b6b3a76400008152f35b503461033b57602036600319011261033b5760209060ff906040906001600160a01b03611573613a23565b168152600284522054166040519015158152f35b503461033b5761012036600319011261033b576115a2613a23565b60643591906044356024356115b5613b4d565b601054610104359660e4359260c4359260a43592906001600160a01b031633036117a3576001600160a01b038816808a52600260205260408a205490989060ff161561178f578615611780576127108811611766576103e8821161174c5760ff831690601282118015611742575b61172e5783611631916143a7565b85151580611725575b61170e578a151580611705575b6116ee57926000805160206147d583398151915297969592828c956116e8979460408e8e80825260036020528c8383205580825260046020528d838320558152600660205220558b8d52600560205260408d209060ff198254161790558a8c52600c6020528260408d20558a8c52600d6020528360408d20558a8c52600e6020528460408d20558a8c52600f6020528560408d205560405198899889613e04565b0390a280f35b60448a868d63dd85772b60e01b8352600452602452fd5b50848b10611647565b60448a8588637449915760e01b8352600452602452fd5b5083861061163a565b63ca95039160e01b8b52600482905260248bfd5b5060068210611623565b631051834f60e11b8a5260048290526103e860245260448afd5b63c1e9a14160e01b8a52600488905261271060245260448afd5b63a2ec3a5560e01b8a5260048afd5b6374ed46ad60e01b8a52600489905260248afd5b6349db3bd360e01b8952600489fd5b503461033b57604036600319011261033b576117cc613a23565b6001600160a01b0316808252600260205260408220546024359060ff161561188957801561064b5761271061184e604085670de0b6b3a764000061183d6118569688859a52600560205260ff858520541690809160128110611863575b505088845260036020528484205490613bba565b049581526004602052205484613bba565b048092613c9b565b9082519182526020820152f35b611882925060ff61187661187c92613c03565b16613c14565b90613bba565b3880611829565b6374ed46ad60e01b83526004829052602483fd5b503461033b578060031936011261033b5761033760408051906118c08183613ab8565b60058252640352e302e360dc1b602083015251918291602083526020830190613b0c565b503461033b57602036600319011261033b5760043581526000805160206147f583398151915260205260408120604051908160208254918281520190819285526020852090855b81811061198b5750505082611941910383613ab8565b604051928392602084019060208552518091526040840192915b818110611969575050500390f35b82516001600160a01b031684528594506020938401939092019160010161195b565b825484526020909301926001928301920161192b565b503461033b578060031936011261033b57602090604051908152f35b503461033b576119cc36613a5e565b9190926119d7614059565b6119df614095565b33815260096020526040812054430361205657338152600a60205260036040822054101561204757338152600a60205260408120611a1d8154613cc9565b90555b6001600160a01b0382168082526002602052604082205490929060ff16611fa6575b828252600260205260ff60408320541615611f93578415611f84578315611f7557828252600c60205260408220548510611f5057828252600e60205260408220548015611f4157808611611f2a575084611a9b916142a5565b6040516370a0823160e01b8152306004820152602081602481865afa908115611f1f578291611eed575b50611ad285303386614363565b6040516370a0823160e01b8152306004820152602081602481875afa908115611e0457908692918491611eb4575b5090611b0b91613c9b565b10611ea55781815260076020526040812054611b278582613df7565b818110611e96576001600160ff1b038111611e875760408492600080516020614975833981519152928486526007602052808387205582519182526020820152a2818152600560205260ff604082205416849060128110611e26575b50611ba4670de0b6b3a7640000918484526003602052604084205490613bba565b04908281526004602052612710611bbf604083205484613bba565b0491611bcb8382613c9b565b94808610611e0f57506001546040516318160ddd60e01b815290602090829060049082906001600160a01b03165afa908115611e04578391611dd2575b5082546001600160a01b0316803b15611db95783809160846040518094819363ae494fa160e01b83523360048401528c60248401528b60448401528d60648401525af180156104fa57908491611dbd575b505083611d49575b6001546040516318160ddd60e01b81529190602090839060049082906001600160a01b03165afa80156104fa578490611d15575b611c9f9250613c9b565b90808203611cff575050507fb3e2773606abfd36b5bd91394b3a54d1398336c65005baf7bf7a05efeffaf75b611ce2602095604051918291339588429285613d0c565b0390a3600160008051602061491583398151915255604051908152f35b632d8562a360e11b835260045260245260449150fd5b506020823d602011611d41575b81611d2f60209383613ab8565b810103126104ed57611c9f9151611c95565b3d9150611d22565b82546001600160a01b0316803b15611db95783809160846040518094819363ae494fa160e01b83523060048401528a60248401528b60448401528160648401525af180156104fa57908491611da0575b5050611c61565b81611daa91613ab8565b611db5578238611d99565b8280fd5b8380fd5b81611dc791613ab8565b611db5578238611c59565b90506020813d602011611dfc575b81611ded60209383613ab8565b810103126104ed575138611c08565b3d9150611de0565b6040513d85823e3d90fd5b6371c4efed60e01b83526004869052602452604482fd5b611e36915061187660ff91613c03565b8015611e735780600019048511611e6457611ba4611e5d670de0b6b3a76400009287613bba565b9150611b83565b63035fc53d60e41b8252600482fd5b634e487b7160e01b82526012600452602482fd5b630700fcb360e11b8352600483fd5b63446c8cc960e01b8352600483fd5b639bfa3c1760e01b8152600490fd5b919250506020813d602011611ee5575b81611ed160209383613ab8565b810103126104ed5751859190611b0b611b00565b3d9150611ec4565b90506020813d602011611f17575b81611f0860209383613ab8565b810103126104ed575138611ac5565b3d9150611efb565b6040513d84823e3d90fd5b631d7f2ac360e01b83526004869052602452604482fd5b633b5db2f360e11b8352600483fd5b50908152600c6020526040812054630d54e9e160e01b82526004849052602452604490fd5b632cd84af360e01b8252600482fd5b63162908e360e11b8252600482fd5b506024916374ed46ad60e01b8252600452fd5b60405163313ce56760e01b815291939291602081600481865afa859181612026575b50611fdc5763105482c760e21b8552600485fd5b93919293838352600560205260ff8060408520541691169081036120005750611a42565b90506044928252600560205260ff604083205416631e43476360e11b8352600452602452fd5b61204091925060203d6020116109e3576109d48183613ab8565b9038611fc8565b63a74c1c5f60e01b8152600490fd5b3381526009602052436040822055338152600a60205260016040822055611a20565b503461033b578060031936011261033b5760206040516103e88152f35b503461033b57604036600319011261033b576020906040906001600160a01b036120bd613a23565b16815260148352818120602435825283522054604051908152f35b503461033b57604036600319011261033b5760406120f4613a39565b9160043581526000805160206148d5833981519152602052209060018060a01b0316600052602052602060ff604060002054166040519015158152f35b503461033b578060031936011261033b57602060405160648152f35b503461033b57604036600319011261033b5761218760209160043581526000805160206147f58339815191528352604060243591206145ff565b905460405160039290921b1c6001600160a01b03168152f35b503461033b57602036600319011261033b576020906040906001600160a01b036121c8613a23565b168152600983522054604051908152f35b503461033b57604036600319011261033b576121f3613a23565b60105460243591906001600160a01b0316330361066c576001600160a01b03169081156122825760406000805160206148b58339815191529183855260136020528185205490848652601360205280838720558486526015602052828620438752602052828620548587526019602052838720558486526017602052438387205582519182526020820152a280f35b63df407ac560e01b8352600483fd5b503461033b57602036600319011261033b576020906040906001600160a01b036122b9613a23565b168152600383522054604051908152f35b503461033b578060031936011261033b5760008051602061485583398151915281526000805160206148d583398151915260209081526040808320336000908152925290205460ff16156123a057612320614095565b600160ff196000805160206148f58339815191525416176000805160206148f5833981519152557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a16040514281527f80170b5fcdd2bf1e0660ef4b8851f86685f64d41b1a19de1471947ece8725aac60203392a280f35b63e2517d3f60e01b815233600452600080516020614855833981519152602452604490fd5b503461033b57602036600319011261033b576123df613a23565b6000805160206149558339815191525460ff8160401c169081156124cb575b506124bc5760008051602061495583398151915280546001600160481b0319166003600160401b011790558180526000805160206148d583398151915260209081526040808420336000908152925290205460ff16156124a45761246190613da5565b60ff60401b19600080516020614955833981519152541660008051602061495583398151915255600080516020614835833981519152602060405160038152a180f35b63e2517d3f60e01b8252336004526024829052604482fd5b63f92ee8a960e01b8252600482fd5b60036001600160401b039190911610159050386123fe565b503461033b578060031936011261033b57602060ff6000805160206148f583398151915254166040519015158152f35b503461033b57602036600319011261033b5761252d613a23565b6010546001600160a01b031633036105175761061b90613da5565b503461033b57606036600319011261033b57612562613a23565b61256a613a39565b60105490926044359290916001600160a01b031633036105175761258c614095565b6011546001600160a01b03169182156127e65760405163babcc53960e01b81526001600160a01b0386166004820181905293602090829060249082905afa908115611f1f5782916127c7575b50156127b85782156127a9576001546001600160a01b03928316921682036126f9576040516370a0823160e01b8152306004820152602081602481865afa908115611f1f5782916126c7575b50935b84156126b85760001981036126b25750835b84156126a35780851161268b5750506126558360209583614193565b7f0bf519e4b3821615dbdd874fa1a5fbb4bb651b4e6beabedd4ac318e770233b2c604080518581524287820152a3604051908152f35b630555ed4f60e31b8252600485905260245260449150fd5b632e11316f60e11b8252600482fd5b93612639565b63f09872eb60e01b8252600482fd5b90506020813d6020116126f1575b816126e260209383613ab8565b810103126104ed575138612624565b3d91506126d5565b8181526002602052604081205460ff1615612797576040516370a0823160e01b8152306004820152602081602481865afa908115611f1f578291612765575b50828252600760205260408220548082111561275d5761275791613c9b565b93612627565b505080612757565b90506020813d60201161278f575b8161278060209383613ab8565b810103126104ed575138612738565b3d9150612773565b60249163eef7849760e01b8252600452fd5b634e46966960e11b8152600490fd5b63133307bb60e21b8152600490fd5b6127e0915060203d6020116112d5576112c78183613ab8565b386125d8565b630e048e7160e41b8152600490fd5b503461033b57602036600319011261033b5761280f613a23565b6010546001600160a01b03163303610517576001600160a01b0316801561287457601180546001600160a01b0319811683179091556001600160a01b03167f1e9c406f2707909cfd9f61e744f73bcab77e5997d063276f67883c5257d51cf08380a380f35b634e46966960e11b8252600482fd5b503461033b578060031936011261033b577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031630036128dc5760206040516000805160206148758339815191528152f35b63703e46dd60e11b8152600490fd5b503461033b578060031936011261033b576010546040516001600160a01b039091168152602090f35b50604036600319011261033b57612929613a23565b602435906001600160401b038211611db55736602383011215611db5578160040135908361295683613af1565b936129646040519586613ab8565b83855260208501933660248284010111611db557806024602093018637850101526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016308114908115612be6575b50612bd7576010546001600160a01b03163303612bc8576001600160a01b038116928315612bb957813b15612baa576000805160206148758339815191525484612a02613b97565b7f6ea8b34d59b2818d3f37a08dddaa06f5886b9c20c907b36f03ca6528e106e86f612a3860405192604084526040840190613b0c565b4260208401526001600160a01b038516929081900390a36040516352d1902d60e01b8152602081600481895afa879181612b72575b50612a8657634c9c8ce360e01b87526004869052602487fd5b908160008051602061487583398151915288979303612b605750833b15612b4c576001600160a01b0319168117600080516020614875833981519152558491907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8380a2805115612b31576111589382915190845af43d15612b29573d91612b0d83613af1565b92612b1b6040519485613ab8565b83523d85602085013e614753565b606091614753565b5050505034612b3d5780f35b63b398979f60e01b8152600490fd5b634c9c8ce360e01b86526004829052602486fd5b632a87526960e21b8752600452602486fd5b9091506020813d602011612ba2575b81612b8e60209383613ab8565b81010312612b9e57519038612a6d565b8780fd5b3d9150612b81565b636f7c43f160e01b8552600485fd5b63e6c4247b60e01b8552600485fd5b6349db3bd360e01b8452600484fd5b63703e46dd60e11b8452600484fd5b600080516020614875833981519152546001600160a01b031614159050386129ba565b503461033b57602036600319011261033b576020906040906001600160a01b03612c31613a23565b168152600e83522054604051908152f35b503461033b57606036600319011261033b57612c5c613a4f565b6024356001600160401b038111611db557612c7b903690600401613a88565b916044356001600160401b038111610a6a57612c9b903690600401613a88565b6000805160206149558339815191529291925460ff8160401c16908115612ffe575b50612fef5760008051602061495583398151915280546001600160481b0319166002600160401b0117905560008051602061493583398151915286526000805160206148d583398151915260209081526040808820336000908152925290205460ff1615612fca57612d2d6145d1565b612d356145d1565b600160008051602061491583398151915255600b549160ff8316612fbb57818603612fac57612d6386613d28565b92612d716040519485613ab8565b868452601f19612d8088613d28565b01366020860137875b878110612eb7575060019060ff191617600b5515159460ff196008541660ff871617600855865b818110612e1457876000805160206147b5833981519152602089604051908152a160ff60401b19600080516020614955833981519152541660008051602061495583398151915255600080516020614835833981519152602060405160028152a180f35b80886000805160206149758339815191526040612e3c612e37600196888d613d3f565b613d65565b612e4785898c613d3f565b357f8f955fa878b4aae8b1ac37b1ab715307470f2822ceff87e23d33ef1e044814a783612e74888d613d79565b5193898060a01b0316968793848252600660205280838320558482526007602052858383205582519182526020820152a28151908d82526020820152a201612db0565b612ec5612e37828a8a613d3f565b612ed0828689613d3f565b6001600160a01b03909116808b52600260205260408b20549091359060ff1615612f98576103e88111612f805750906020602492604051938480926370a0823160e01b82523060048301525afa8015612f75578a90612f3f575b60019250612f388288613d79565b5201612d89565b509060203d8111612f6e575b612f558183613ab8565b6020826000928101031261033b57509060019151612f2a565b503d612f4b565b6040513d8c823e3d90fd5b631051834f60e11b8b526004526103e860245260448afd5b6351104c5960e01b8b52600482905260248bfd5b63512509d360e11b8752600487fd5b6324d0d1fd60e01b8752600487fd5b63e2517d3f60e01b865233600452600080516020614935833981519152602452604486fd5b63f92ee8a960e01b8652600486fd5b60026001600160401b03919091161015905038612cbd565b503461033b578060031936011261033b576011546040516001600160a01b039091168152602090f35b503461033b578060031936011261033b576010546001600160a01b031633036130f7576000805160206148f58339815191525460ff8116156130e85760ff19166000805160206148f5833981519152557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a16040514281527f107553d8191d85b405879cf752997865edd48d94e20bda4dd27223c94b31a7cc60203392a280f35b638dfc202b60e01b8252600482fd5b6349db3bd360e01b8152600490fd5b503461033b57602036600319011261033b576020906040906001600160a01b0361312e613a23565b168152601683522054604051908152f35b503461033b57604036600319011261033b57613159613a39565b336001600160a01b038216036131755761115890600435614261565b63334bd91960e11b8252600482fd5b503461033b57602036600319011261033b576020906040906001600160a01b036131ac613a23565b168152600c83522054604051908152f35b503461033b57602036600319011261033b576020906040906001600160a01b036131e5613a23565b168152601783522054604051908152f35b503461033b57604036600319011261033b57611158600435613216613a39565b9061322361114e82613ca8565b614219565b503461033b5761323736613a5e565b919092613242614059565b61324a614095565b3381526009602052604081205443036136b357338152600a60205260036040822054101561204757338152600a602052604081206132888154613cc9565b90555b6001600160a01b0382168082526002602052604082205490929060ff16613638575b828252600260205260ff60408320541615611f935760ff6008541615613629578415611f84578315611f7557828252600d60205260408220548086106136125750828252600f60205260408220548015613603578086116135ed575084613313916140bf565b670de0b6b3a76400008402848104670de0b6b3a7640000036135d9578282526003602052604082205461334591613be3565b90828152600560205260ff604082205416601281106135b9575b508281526006602052612710613379604083205484613bba565b04916133858382613c9b565b94808610611e0f5750838252600760205280604083205410613596578382526007602052604082205490808210613587576040826133d3600080516020614975833981519152938895613c9b565b8486526007602052808387205582519182526020820152a26001546040516318160ddd60e01b815290602090829060049082906001600160a01b03165afa908115611f1f578291613551575b5081546001600160a01b0316803b15611db557826040518092633a52b90760e11b82528183816134538d3360048401613cf1565b03925af18015611e045761353c575b506001546040516318160ddd60e01b81529190602090839060049082906001600160a01b03165afa908115611e04578391613506575b6134a29250613c9b565b8581036134ee5750507f8caf04742286d017f9ac3924388e188c73e6e5094311c5e59a61a7ef86dda8bf611ce26020956134dd863387614193565b604051918291339588429285613d0c565b635ab6e2db60e01b8252600486905260245260449150fd5b90506020823d602011613534575b8161352160209383613ab8565b810103126104ed576134a2915190613498565b3d9150613514565b9161354a8160049394613ab8565b9190613462565b90506020813d60201161357f575b8161356c60209383613ab8565b8101031261357b57513861341f565b5080fd5b3d915061355f565b6308aed4ef60e31b8352600483fd5b83825260076020526040822054635960d22160e01b835260045260245260449150fd5b916135cc60ff6118766135d29495613c03565b90613be3565b903861335f565b634e487b7160e01b82526011600452602482fd5b625502a360e91b83526004869052602452604482fd5b636c6ff70d60e11b8352600483fd5b6361767b8560e01b83526004869052602452604482fd5b630df65d9f60e01b8252600482fd5b60405163313ce56760e01b815291939291602081600481865afa859181613692575b5061366e5763105482c760e21b8552600485fd5b93919293838352600560205260ff80604085205416911690810361200057506132ad565b6136ac91925060203d6020116109e3576109d48183613ab8565b903861365a565b3381526009602052436040822055338152600a6020526001604082205561328b565b503461033b57602036600319011261033b576020610f56600435613ca8565b503461033b57602036600319011261033b576020906040906001600160a01b0361371c613a23565b168152600f83522054604051908152f35b503461033b57604036600319011261033b57613747613a23565b60105460243591906001600160a01b0316330361066c576001600160a01b03169081156122825760406000805160206148158339815191529183855260126020528185205490848652601260205280838720558486526014602052828620438752602052828620548587526018602052838720558486526016602052438387205582519182526020820152a280f35b503461033b57602036600319011261033b576020906040906001600160a01b036137fe613a23565b168152600683522054604051908152f35b503461033b578060031936011261033b576001546040516001600160a01b039091168152602090f35b503461033b57602036600319011261033b576020906040906001600160a01b03613860613a23565b168152600d83522054604051908152f35b503461033b57602036600319011261033b5761388b613a4f565b6010546001600160a01b031633036105175760206000805160206147b583398151915291151560ff196008541660ff821617600855604051908152a180f35b503461033b57602036600319011261033b5760043563ffffffff60e01b811680910361357b57602090635a05180f60e01b8114908115613910575b506040519015158152f35b637965db0b60e01b81149150811561392a575b5082613905565b6301ffc9a760e01b14905082613923565b503461033b57604036600319011261033b57613955613a23565b6001600160a01b0316808252600260205260408220546024359060ff161561188957670de0b6b3a7640000810290808204670de0b6b3a76400001490151715613a0f57916139b160409383835260036020528483205490613be3565b91808252600560205260ff8483205416601281106139e6575b5061184e84836127109361185695526006602052205484613bba565b8461185693613a0461271094966135cc60ff61187661184e97613c03565b9593509350506139ca565b634e487b7160e01b83526011600452602483fd5b600435906001600160a01b03821682036104ed57565b602435906001600160a01b03821682036104ed57565b6004359081151582036104ed57565b60609060031901126104ed576004356001600160a01b03811681036104ed57906024359060443590565b9181601f840112156104ed578235916001600160401b0383116104ed576020808501948460051b0101116104ed57565b601f909101601f19168101906001600160401b03821190821017613adb57604052565b634e487b7160e01b600052604160045260246000fd5b6001600160401b038111613adb57601f01601f191660200190565b919082519283825260005b848110613b38575050826000602080949584010152601f8019910116010190565b80602080928401015182828601015201613b17565b6084359060ff821682036104ed57565b60609060031901126104ed576004356001600160a01b03811681036104ed5790602435906044356001600160a01b03811681036104ed5790565b60405190613ba6604083613ab8565b6005825264322e342e3160d81b6020830152565b81810292918115918404141715613bcd57565b634e487b7160e01b600052601160045260246000fd5b8115613bed570490565b634e487b7160e01b600052601260045260246000fd5b60ff166012039060ff8211613bcd57565b8015613c955760009060208110600116604e821060011617613c8d57600a916001915b60018111613c64575082600019048211613c5057500290565b634e487b7160e01b81526011600452602490fd5b92806000190481116135d95760018416613c84575b80029260011c613c37565b80920291613c79565b9050600a0a90565b50600190565b91908203918211613bcd57565b6000526000805160206148d583398151915260205260016040600020015490565b6000198114613bcd5760010190565b908160209103126104ed575160ff811681036104ed5790565b6001600160a01b039091168152602081019190915260400190565b9094939260609260808301968352602083015260408201520152565b6001600160401b038111613adb5760051b60200190565b9190811015613d4f5760051b0190565b634e487b7160e01b600052603260045260246000fd5b356001600160a01b03811681036104ed5790565b8051821015613d4f5760209160051b010190565b908160209103126104ed575180151581036104ed5790565b6001600160a01b03168015613de657601080546001600160a01b0319811683179091556001600160a01b0316600080516020614895833981519152600080a3565b63e6c4247b60e01b60005260046000fd5b91908201809211613bcd57565b94919360e0969360ff929a99989561010088019b885260208801526040870152166060850152608084015260a083015260c08201520152565b6001600160a01b03811660008181526002602052604090205490919060ff16158015613f2f575b8015613f27575b613f155781600052600f6020526040600020548015908115613f1d575b50613f1557613ead926040918251948592839262f7fce960e01b845260048401613cf1565b0381305afa918215613f0957600092613ed5575b506000526007602052604060002054101590565b9091506040813d604011613f01575b81613ef160409383613ab8565b810103126104ed57519038613ec1565b3d9150613ee4565b6040513d6000823e3d90fd5b505050600090565b9050831138613e88565b508215613e6b565b5060ff6008541615613e64565b6001546001600160a01b0391821691168103613fb1576020602491604051928380926370a0823160e01b82523060048301525afa908115613f0957600091613f82575090565b90506020813d602011613fa9575b81613f9d60209383613ab8565b810103126104ed575190565b3d9150613f90565b80600052600260205260ff60406000205416613fcd5750600090565b6040516370a0823160e01b815230600482015290602082602481845afa918215613f0957600092614025575b50600052600760205260406000205480821160001461401e5761401b91613c9b565b90565b5050600090565b90916020823d602011614051575b8161404060209383613ab8565b8101031261033b5750519038613ff9565b3d9150614033565b6002600080516020614915833981519152541461408457600260008051602061491583398151915255565b633ee5aeb560e01b60005260046000fd5b60ff6000805160206148f583398151915254166140ae57565b63d93c066560e01b60005260046000fd5b6001600160a01b0316600081815260136020526040902054801561418e578160005260156020526040600020436000526020526141026040600020549384613df7565b92831061417d5780826000526017602052436040600020541461415f575b831161414357506000526015602052604060002043600052602052604060002055565b925063029359d560e41b60005260045260245260445260646000fd5b5081600052601960205261417860406000205482613df7565b614120565b63446c8cc960e01b60005260046000fd5b505050565b6141c86141cd93926141ba60405194859263a9059cbb60e01b602085015260248401613cf1565b03601f198101845283613ab8565b614434565b565b60008181526000805160206148d58339815191526020908152604080832033845290915290205460ff16156142015750565b63e2517d3f60e01b6000523360045260245260446000fd5b614223828261448f565b918261422e57505090565b60009182526000805160206147f5833981519152602052604090912061425d916001600160a01b031690614617565b5090565b61426b8282614531565b918261427657505090565b60009182526000805160206147f5833981519152602052604090912061425d916001600160a01b031690614680565b6001600160a01b0316600081815260126020526040902054801561418e578160005260146020526040600020436000526020526142e86040600020549384613df7565b92831061417d57808260005260166020524360406000205414614345575b831161432957506000526014602052604060002043600052602052604060002055565b92506319a4e2a760e01b60005260045260245260445260646000fd5b5081600052601860205261435e60406000205482613df7565b614306565b6040516323b872dd60e01b60208201526001600160a01b0392831660248201529290911660448301526064808301939093529181526141cd916141c8608483613ab8565b60405163313ce56760e01b81529190602090839060049082906001600160a01b03165afa60009281614413575b506143ea57631eecbb6560e01b60005260046000fd5b60ff91821691168082036143fc575050565b631e43476360e11b60005260045260245260446000fd5b61442d91935060203d6020116109e3576109d48183613ab8565b91386143d4565b906000602091828151910182855af115613f09576000513d61448657506001600160a01b0381163b155b6144655750565b635274afe760e01b60009081526001600160a01b0391909116600452602490fd5b6001141561445e565b60008181526000805160206148d5833981519152602090815260408083206001600160a01b038616845290915290205460ff1661401e5760008181526000805160206148d5833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19166001179055339291907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a4600190565b60008181526000805160206148d5833981519152602090815260408083206001600160a01b038616845290915290205460ff161561401e5760008181526000805160206148d5833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19169055339291907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9080a4600190565b60ff6000805160206149558339815191525460401c16156145ee57565b631afcd79f60e31b60005260046000fd5b8054821015613d4f5760005260206000200190600090565b6001810190826000528160205260406000205415600014613f15578054600160401b811015613adb5761466b6146548260018794018555846145ff565b819391549060031b91821b91600019901b19161790565b90555491600052602052604060002055600190565b906001820191816000528260205260406000205480151560001461474a576000198101818111613bcd578254600019810191908211613bcd57818103614713575b505050805480156146fd5760001901906146db82826145ff565b8154906000199060031b1b191690555560005260205260006040812055600190565b634e487b7160e01b600052603160045260246000fd5b61473361472361465493866145ff565b90549060031b1c928392866145ff565b9055600052836020526040600020553880806146c1565b50505050600090565b90614779575080511561476857602081519101fd5b63d6bda27560e01b60005260046000fd5b815115806147ab575b61478a575090565b639996b31560e01b60009081526001600160a01b0391909116600452602490fd5b50803b1561478256fe2c0a5f5ab0ba371221bb3612c2d2f90d36566279309f526000c5b354efd1b0658c67aaac7f77de07240e5a9b36dfdccb2a89c438635abbb27a73142d2aa0f629c1f6fe24621ce81ec5827caf0253cadb74709b061630e6b55e8237170593200048b07fab687f450848f1df8a96db08fef7840f53415f18fdc2ec8e9f810f0930c7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d275027301df982f5215b4963a854cf9c73219df80cb6acd8f098189c9480c7bbc360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc17dc5b1290f7495d7f8cc68476e6941aaf510598fa925d0d2720edc8805a846c4460507c21097c15f6883572ebd157a9ee4b1d989a312314e93afd9d2ecd494002dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800cd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033009b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00a49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a006d129bd71f2401cbe77f49f546d7d5f58992faecfca6e51ba06b50b261e83331a164736f6c6343000822000a";
|
|
73700
73784
|
var isSuperArgs = (xs) => xs.length > 1;
|
|
73701
|
-
var SimplePSMV2__factory = class extends
|
|
73785
|
+
var SimplePSMV2__factory = class extends import_ethers32.ContractFactory {
|
|
73702
73786
|
constructor(...args) {
|
|
73703
73787
|
if (isSuperArgs(args)) {
|
|
73704
73788
|
super(...args);
|
|
@@ -73718,10 +73802,10 @@ var SimplePSMV2__factory = class extends import_ethers31.ContractFactory {
|
|
|
73718
73802
|
static bytecode = _bytecode;
|
|
73719
73803
|
static abi = _abi;
|
|
73720
73804
|
static createInterface() {
|
|
73721
|
-
return new
|
|
73805
|
+
return new import_ethers32.Interface(_abi);
|
|
73722
73806
|
}
|
|
73723
73807
|
static connect(address, runner) {
|
|
73724
|
-
return new
|
|
73808
|
+
return new import_ethers32.Contract(address, _abi, runner);
|
|
73725
73809
|
}
|
|
73726
73810
|
};
|
|
73727
73811
|
var _abi2 = [
|
|
@@ -75517,7 +75601,7 @@ var _abi2 = [
|
|
|
75517
75601
|
];
|
|
75518
75602
|
var _bytecode2 = "0x60a080604052346100ea57306080527ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005460ff8160401c166100d9576002600160401b03196001600160401b03821601610073575b60405161394690816100f082396080518181816112d4015261148b0152f35b6001600160401b0319166001600160401b039081177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005581527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a13880610054565b63f92ee8a960e01b60005260046000fd5b600080fdfe608080604052600436101561001357600080fd5b60003560e01c90816301ffc9a7146124f5575080630d33f3c2146124d15780630f3f4a94146124865780631459457a14611d3e57806318c38b8914611c2d5780631d44454114611b5c5780632106764c14611b35578063248a9ca314611b175780632ec22d4c14611a565780632f0647ce146119db5780632f2ff15d146119aa57806332420744146118d657806336568abe14611890578063392f10871461185a5780633f4ba83a146117625780633f5aadc9146116f35780634f1ef2861461143d57806352340363146113545780635273b6f61461132b57806352d1902d146112c1578063554c4f4b146112315780635bc26aea146111a45780635c975abb146111745780636289d18c146110f35780636711cc0b146110d75780636e852a7814610fd65780637e35bf6e14610fa25780638343f67414610f755780638456cb5914610e7f57806384b0196e14610d545780638c02cabd14610d2b5780638f33527f14610cf15780639010d07c14610c9d57806391d1485414610c435780639b9d30c114610c1a578063a19af3f614610b69578063a217fddf14610b4d578063a3246ad314610a8b578063a878086414610a6f578063ac3c0e3014610962578063ad3cb1cc1461091b578063b3fad63814610876578063b48d36de14610842578063c040b8ae14610726578063c34e9c261461070a578063c86deb31146106ee578063ca15c873146106b5578063d547741f1461067d578063dd71d99a1461063b578063e0922fa11461058e578063efa9b4ae1461051f578063f2f4eb26146104f6578063f68e9553146104cd578063f94f67ab146103f6578063fcc1f21a146102c05763ffa1ad741461028757600080fd5b346102bb5760003660031901126102bb576102b76102a3612780565b6040519182916020835260208301906126d1565b0390f35b600080fd5b346102bb576102ce366126f6565b91926102d8612e42565b6001600160a01b03851692338490036103e657836000526001602052604060002080549160ff8360e01c1660038110156103d0576001036103bf577fc5d5c5bbf10444998e0ea6d4725e79027b574e1c14ec929279e8a9a95c6c6e91948460016103a2946103498b6020998c613385565b818060a01b038316828060a01b03198254161781556103688b82612a4c565b0180546001600160401b031916426001600160401b03161790556001600160a01b0381166000818152600288526040902089905599613179565b6040516001600160401b0390951685526001600160a01b031693a4005b632437e77160e11b60005260046000fd5b634e487b7160e01b600052602160045260246000fd5b62fca64560e31b60005260046000fd5b346102bb5760403660031901126102bb576004356104126125c7565b9061041b612e42565b63ffffffff600554169163ffffffff8116928084109081156104c4575b506104b35760207f6b7727cc9c3df4a29acf0afe01594c1b7e845d20f40f4a14e4c292164a9ed8e19161046a84612e8d565b91610482600863ffffffff845460a01c1617836128c8565b81546001600160e01b031660e09190911b6001600160e01b0319161790556040519485526001600160a01b031693a3005b634346c13160e01b60005260046000fd5b90501584610438565b346102bb5760003660031901126102bb5760206040516000805160206138ba8339815191528152f35b346102bb5760003660031901126102bb576003546040516001600160a01b039091168152602090f35b346102bb5760203660031901126102bb5760043561053b612e42565b61055d61054782612e8d565b9190600163ffffffff825460a01c1617906128c8565b6001600160a01b0316907f812690e0a9dff5bf3add998111b8af5c8299608d859025bfe35662060ab4267d600080a3005b346102bb5760203660031901126102bb576004356001600160401b038116908181036102bb576000546001600160a01b038116330361062a57600160a01b600160e01b0319811660a092831b600160a01b600160e01b031617600055604080519190921c6001600160401b0316815260208101929092527f9c195448332abd01f716db873b329752ea02f19d33f7e311fb0daf082c4edd0391a1005b6349db3bd360e01b60005260046000fd5b346102bb5760203660031901126102bb576001600160a01b0361065c612578565b166000526002602052602060018060a01b0360406000205416604051908152f35b346102bb5760403660031901126102bb576106b360043561069c612562565b906106ae6106a9826128a7565b612d6c565b612dfe565b005b346102bb5760203660031901126102bb5760043560005260008051602061373a8339815191526020526020604060002054604051908152f35b346102bb5760003660031901126102bb57602060405160088152f35b346102bb5760003660031901126102bb57602060405160028152f35b346102bb57610734366126f6565b92909161073f612e42565b6001600160a01b03851693338590036103e65784600052600160205260406000209060ff825460e01c1660038110156103d057600114610831577ff223dc085722c94c84dcf67427e225799be616382a2a484d378f8921c69a2033948461081e936107ad866020988b613385565b80546001600160a01b0319166001600160a01b0383161781556107d08682612a4c565b6001810180546001600160801b031916426001600160401b0316179055805460ff60e01b1916600160e01b1790556001600160a01b0381166000818152600288526040902089905598613179565b6040516001600160401b039091168152a3005b639d2c8fdf60e01b60005260046000fd5b346102bb5760403660031901126102bb57602061086e610860612578565b610868612562565b90612984565b604051908152f35b346102bb5760203660031901126102bb57600060606040516108978161261e565b828152826020820152826040820152015260043560005260046020526080604060002063ffffffff604051916108cc8361261e565b548160018060a01b038216938481528160208201818560a01c16815260606040840193838760c01c168552019460e01c8552604051968752511660208601525116604084015251166060820152f35b346102bb5760003660031901126102bb576102b7604080519061093e8183612639565b60058252640352e302e360dc1b6020830152519182916020835260208301906126d1565b346102bb5760203660031901126102bb5761097b612578565b6000608060405161098b81612603565b828152826020820152826040820152826060820152015260018060a01b0316600052600160205260406000206040516109c381612603565b81546001600160a01b038116825260a081901c6001600160401b03166020830190815292604083019160e01c60ff169060038210156103d057908252600101546001600160401b0380821660608501908152604092831c821660808601908152925194516001600160a01b03168552945116602084015290519260038410156103d057604083019390935291516001600160401b0390811660608301529151909116608082015260a090f35b346102bb5760003660031901126102bb57602060405160018152f35b346102bb5760203660031901126102bb5760043560005260008051602061373a83398151915260205260406000206040518060208354918281520190819360005260206000209060005b818110610b375750505081610aeb910382612639565b6040519182916020830190602084525180915260408301919060005b818110610b15575050500390f35b82516001600160a01b0316845285945060209384019390920191600101610b07565b8254845260209093019260019283019201610ad5565b346102bb5760003660031901126102bb57602060405160008152f35b346102bb5760403660031901126102bb57600435610b856125c7565b90610b8e612e42565b63ffffffff600554169163ffffffff811692808410908115610c11575b506104b35760207f1da95b87b4c773f68c1447ffc5644e41a8a8887d55065beb64852014cf7140be91610bfe610be085612e8d565b9290610bf9600463ffffffff835460a01c1617826128c8565b6127f5565b6040519485526001600160a01b031693a3005b90501584610bab565b346102bb5760003660031901126102bb5760206040516000805160206137fa8339815191528152f35b346102bb5760403660031901126102bb57610c5c612562565b60043560005260008051602061389a83398151915260205260406000209060018060a01b0316600052602052602060ff604060002054166040519015158152f35b346102bb5760403660031901126102bb5760043560005260008051602061373a8339815191526020526020610cd86024356040600020613357565b905460405160039290921b1c6001600160a01b03168152f35b346102bb5760203660031901126102bb576001600160a01b03610d12612578565b1660005260026020526020604060002054604051908152f35b346102bb5760003660031901126102bb5760206040516000805160206137da8339815191528152f35b346102bb5760003660031901126102bb576000805160206137ba833981519152541580610e68575b15610e2b57610dcd610d8c6127a3565b610d946127d6565b6020610ddb60405192610da78385612639565b600084526000368137604051958695600f60f81b875260e08588015260e08701906126d1565b9085820360408701526126d1565b466060850152306080850152600060a085015283810360c085015281808451928381520193019160005b828110610e1457505050500390f35b835185528695509381019392810192600101610e05565b60405162461bcd60e51b81526020600482015260156024820152741152540dcc4c8e88155b9a5b9a5d1a585b1a5e9959605a1b6044820152606490fd5b5060008051602061391a8339815191525415610d7c565b346102bb5760003660031901126102bb573360009081527f0ac8cc3d209806126662940717264973110c39045b305f6ba49613325a615e09602052604090205460ff1615610f4e57610ecf612e42565b600160ff196000805160206138da8339815191525416176000805160206138da833981519152557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a16040514281527f80170b5fcdd2bf1e0660ef4b8851f86685f64d41b1a19de1471947ece8725aac60203392a2005b63e2517d3f60e01b600052336004526000805160206137fa83398151915260245260446000fd5b346102bb5760003660031901126102bb5760005460405160a09190911c6001600160401b03168152602090f35b346102bb5760403660031901126102bb57610fc6610fbe612562565b600435612951565b906102b760405192839283612598565b346102bb5760403660031901126102bb57610fef612578565b33600090815260008051602061383a833981519152602052604090205460ff1615806110c4575b6103e6576001600160a01b03166000818152600160205260409020805460e01c60ff1660038110156103d0576001036103bf57805460ff60e01b198116600160e11b1782556001919091018054600160401b600160801b03191642604090811b600160401b600160801b0316919091179091555160243581526001600160a01b0390911691907fc0499cc07ed9d734deec6857802d3f0fa8d5afaf79a7008beb8ba7bef62a271b90602090a3005b50336001600160a01b0382161415611016565b346102bb5760003660031901126102bb57602060405160048152f35b346102bb5760203660031901126102bb5761110c6125b4565b6000546001600160a01b0316330361062a5763ffffffff81169081156111635760008051602061387a8339815191529161115e63ffffffff926005549284198416176005556040519384931683612818565b0390a1005b6338f3377360e21b60005260046000fd5b346102bb5760003660031901126102bb57602060ff6000805160206138da83398151915254166040519015158152f35b346102bb5760203660031901126102bb576111bd612578565b6000546001600160a01b038116903382900361062a576001600160a01b038316928315611220573b1561120f576001600160a01b0319168217600090815560008051602061385a8339815191529080a3005b636f7c43f160e01b60005260046000fd5b63e6c4247b60e01b60005260046000fd5b346102bb5760203660031901126102bb576001600160a01b03611252612578565b166000526001602052604060002060ff6000805160206138da833981519152541615806112a5575b6020918161128e575b506040519015158152f35b5460a01c6001600160401b03164210905082611283565b5060ff815460e01c169060038210156103d0579060011461127a565b346102bb5760003660031901126102bb577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316300361131a57602060405160008051602061381a8339815191528152f35b63703e46dd60e11b60005260046000fd5b346102bb5760003660031901126102bb576000546040516001600160a01b039091168152602090f35b346102bb5760203660031901126102bb57600435604060008281526004602052209081549160018060a01b03831692831590811561142e575b5061141d5733600090815260008051602061383a833981519152602052604090205460ff161580611413575b61140257806113d563fffffffe6113db935460a01c16826128c8565b82612d48565b7fa5ffbdba01b15df97334e34ad816b9986b6057a5ddc97aba93b7e8ccd21759ed600080a3005b630a606ec360e11b60005260046000fd5b50823314156113b9565b6360eb6c2360e01b60005260046000fd5b6001915060a01c16158461138d565b60403660031901126102bb57611451612578565b6024356001600160401b0381116102bb57366023820112156102bb57611481903690602481600401359101612677565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163081149081156116d0575b5061131a576000546001600160a01b0316330361062a576001600160a01b03821691821561122057803b156116bf573083146116b05760008051602061381a8339815191525483611505612780565b7f6ea8b34d59b2818d3f37a08dddaa06f5886b9c20c907b36f03ca6528e106e86f61153b604051926040845260408401906126d1565b4260208401526001600160a01b038516929081900390a36040516352d1902d60e01b8152602081600481885afa6000918161167c575b5061158b5784634c9c8ce360e01b60005260045260246000fd5b908160008051602061381a8339815191528693036116685750823b15611653576001600160a01b031916811760008051602061381a833981519152557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a2815115611639576000808360206106b395519101845af43d15611631573d916116148361265c565b926116226040519485612639565b83523d6000602085013e61364d565b60609161364d565b50503461164257005b63b398979f60e01b60005260046000fd5b50634c9c8ce360e01b60005260045260246000fd5b632a87526960e21b60005260045260246000fd5b9091506020813d6020116116a8575b8161169860209383612639565b810103126102bb57519086611571565b3d915061168b565b614e8d60eb1b60005260046000fd5b632e07c4bd60e11b60005260046000fd5b60008051602061381a833981519152546001600160a01b031614159050836114b6565b346102bb5760203660031901126102bb5760043561170f612e42565b61173161171b82612e8d565b9190600263ffffffff825460a01c1617906128c8565b6001600160a01b0316907fc2713e691344add4705edc62a0ee5aede95ba66ad68f97316efef9cb50644edd600080a3005b346102bb5760003660031901126102bb5733600090815260008051602061383a833981519152602052604090205460ff161580611845575b611834576000805160206138da8339815191525460ff8116156118235760ff19166000805160206138da833981519152557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a16040514281527f107553d8191d85b405879cf752997865edd48d94e20bda4dd27223c94b31a7cc60203392a2005b638dfc202b60e01b60005260046000fd5b63659a07b360e11b60005260046000fd5b506000546001600160a01b031633141561179a565b346102bb5760403660031901126102bb576102b7611881611879612562565b6004356128eb565b604093919351938493846125da565b346102bb5760403660031901126102bb576118a9612562565b336001600160a01b038216036118c5576106b390600435612dfe565b63334bd91960e11b60005260046000fd5b346102bb5760203660031901126102bb57600435604060008281526004602052209081549160018060a01b03831692831590811561199b575b5061141d5733600090815260008051602061383a833981519152602052604090205460ff161580611991575b611402578061195763fffffff761196a935460a01c16826128c8565b80546001600160e01b0316815582612d48565b7f054490ec6650e07db9b97a06ea31d44cebd44b390c9975a380055e1b4d3cac21600080a3005b508233141561193b565b6008915060a01c16158461190f565b346102bb5760403660031901126102bb576106b36004356119c9612562565b906119d66106a9826128a7565b612db6565b346102bb5760203660031901126102bb57600435611a256119fb82612cd6565b9190611a1163fffffffb825460a01c16826128c8565b805463ffffffff60c01b1916815583612d48565b6001600160a01b0316907f09cb4ec44cdef8489412844b9682f87f7900758fa2bd7e039113e9125e538e0f600080a3005b346102bb5760203660031901126102bb57600435604060008281526004602052209081549160018060a01b038316928315908115611b08575b5061141d5733600090815260008051602061383a833981519152602052604090205460ff161580611afe575b61140257806113d563fffffffd611ad7935460a01c16826128c8565b7fb390ab029eab314bd18190ebe73d7e5c1c336beaa5c83ac22578378dc9ccc405600080a3005b5082331415611abb565b6002915060a01c161584611a8f565b346102bb5760203660031901126102bb57602061086e6004356128a7565b346102bb5760403660031901126102bb576102b7611881611b54612562565b60043561282f565b346102bb5760403660031901126102bb57600435611b786125c7565b63ffffffff600554169063ffffffff811691808310908115611c24575b506104b357611ba383612cd6565b909263ffffffff845460c01c16809260018060a01b03163314159182611c19575b5050611c0857611bf4827e8a218591d4362499c38c38eb1c12e7a7cc97a9068818d1fe6046a42ba4a5ba946127f5565b611c0360405192839283612818565b0390a2005b634e80a40760e11b60005260046000fd5b111590508186611bc4565b90501584611b95565b346102bb5760203660031901126102bb57611c466125b4565b6000805160206138fa8339815191525460ff8160401c16908115611d26575b50611d15576000805160206138fa833981519152805460026001600160401b0319821681179092556000546001600160481b031990911690911791906001600160a01b0316330361062a5763ffffffff1680156111635760408160008051602061387a8339815191529263ffffffff196005541617600555815190600082526020820152a16000805160206138fa8339815191525560008051602061377a833981519152602060405160028152a1005b63f92ee8a960e01b60005260046000fd5b60026001600160401b03919091161015905082611c65565b346102bb5760a03660031901126102bb57611d57612578565b611d5f612562565b604435906001600160a01b0382168083036102bb576064356001600160a01b038116918282036102bb576084356001600160a01b03811695908690036102bb576000805160206138fa83398151915254604081901c60ff161597906001600160401b03168015908161247e575b6001149081612474575b15908161246b575b50611d15576000805160206138fa83398151915280546001600160401b031916600117905587612446575b611e116131e0565b611e196131e0565b611e216131e0565b611e296131e0565b6001600160a01b038116908115611220578315611220578515611220576001600160a01b038716968715611220573b1561120f578584146124355762aa36a74614801561242a575b801561241f575b158061240d575b61120f57611e8e90600061320e565b90816123c6575b501561230b57611eb3906000805160206138ba83398151915261320e565b9081612371575b501561230b57611ed8906000805160206137fa83398151915261320e565b908161231c575b501561230b57600080546001600160a01b0319168217815560008051602061385a8339815191528180a3611f116127a3565b91611f1a6127d6565b91611f236131e0565b611f2b6131e0565b83516001600160401b0381116121e05760008051602061375a83398151915254600181811c91168015612301575b60208210146121c057601f8111612282575b50602094601f8211600114612201579481929394956000926121f6575b50508160011b916000199060031b1c19161760008051602061375a833981519152555b82516001600160401b0381116121e05760008051602061379a83398151915254600181811c911680156121d6575b60208210146121c057601f8111612141575b506020601f82116001146120c057819293946000926120b5575b50508160011b916000199060031b1c19161760008051602061379a833981519152555b60006000805160206137ba83398151915255600060008051602061391a83398151915255801561122057803b1561120f57600380546001600160a01b03191691909117905561207357005b60ff60401b196000805160206138fa83398151915254166000805160206138fa8339815191525560008051602061377a833981519152602060405160018152a1005b015190508480612005565b601f1982169060008051602061379a833981519152600052806000209160005b81811061212957509583600195969710612110575b505050811b0160008051602061379a83398151915255612028565b015160001960f88460031b161c191690558480806120f5565b9192602060018192868b0151815501940192016120e0565b81811115611feb5760008051602061379a833981519152600052601f820160051c7f5f9ce34815f8e11431c7bb75a8e6886a91478f7ffc1dbb0a98dc240fddd76b75602084106121b7575b81601f9101920160051c039060005b8281106121a9575050611feb565b60008282015560010161219b565b6000915061218c565b634e487b7160e01b600052602260045260246000fd5b90607f1690611fd9565b634e487b7160e01b600052604160045260246000fd5b015190508580611f88565b601f1982169560008051602061375a833981519152600052806000209160005b88811061226a57508360019596979810612251575b505050811b0160008051602061375a83398151915255611fab565b015160001960f88460031b161c19169055858080612236565b91926020600181928685015181550194019201612221565b81811115611f6b5760008051602061375a833981519152600052601f820160051c7f42ad5d3e1f2e6e70edcf6d991b8a3023d3fca8047a131592f9edb9fd9b89d57d602084106122f8575b81601f9101920160051c039060005b8281106122ea575050611f6b565b6000828201556001016122dc565b600091506122cd565b90607f1690611f59565b63cf5a8e3360e01b60005260046000fd5b6000805160206137fa83398151915260005260008051602061373a83398151915260205261236a907ffff5b43478fa6840382eb63777e0da6941d320b940e3f70f0ea4780feff9582761348a565b5084611edf565b6000805160206138ba83398151915260005260008051602061373a8339815191526020526123bf907f32d31393d541a265984ec379cddd8b1fcbe5f2b0eb8ad81dddfead454f135eaa61348a565b5086611eba565b6000805260008051602061373a833981519152602052612406907f615f0f9e84155bea8cc509fe18befeb1baf65611e38a6ba60964480fb29dfd4461348a565b5088611e95565b50823b1580611e7f5750843b15611e7f565b50617a694614611e78565b506105394614611e71565b638135316560e01b60005260046000fd5b6000805160206138fa833981519152805460ff60401b1916600160401b179055611e09565b90501589611dde565b303b159150611dd6565b899150611dcc565b346102bb5760403660031901126102bb576102b76124ba6124a5612562565b60043560005260046020526040600020612a75565b6124c38161258e565b604051918183921583612598565b346102bb5760003660031901126102bb57602063ffffffff60055416604051908152f35b346102bb5760203660031901126102bb576004359063ffffffff60e01b82168092036102bb57602091635a05180f60e01b8114908115612537575b5015158152f35b637965db0b60e01b811491508115612551575b5083612530565b6301ffc9a760e01b1490508361254a565b602435906001600160a01b03821682036102bb57565b600435906001600160a01b03821682036102bb57565b600811156103d057565b9015158152604081019291906020906125b08361258e565b0152565b6004359063ffffffff821682036102bb57565b6024359063ffffffff821682036102bb57565b91604091949363ffffffff916060850196151585526125f88161258e565b602085015216910152565b60a081019081106001600160401b038211176121e057604052565b608081019081106001600160401b038211176121e057604052565b601f909101601f19168101906001600160401b038211908210176121e057604052565b6001600160401b0381116121e057601f01601f191660200190565b9291926126838261265c565b916126916040519384612639565b8294818452818301116102bb578281602093846000960137010152565b60005b8381106126c15750506000910152565b81810151838201526020016126b1565b906020916126ea815180928185528580860191016126ae565b601f01601f1916010190565b60806003198201126102bb576004356001600160a01b03811681036102bb57916024356001600160a01b03811681036102bb57916044356001600160401b03811681036102bb57916064356001600160401b0381116102bb57826023820112156102bb576004810135926001600160401b0384116102bb57602484830101116102bb576024019190565b6040519061278f604083612639565b60058252640332e302e360dc1b6020830152565b604051906127b2604083612639565b6015825274111a585b5bdb9912185b991ccb941c9bdd1bd8dbdb605a1b6020830152565b604051906127e5604083612639565b60018252603160f81b6020830152565b805463ffffffff60c01b191660c09290921b63ffffffff60c01b16919091179055565b63ffffffff91821681529116602082015260400190565b600052600460205261284660406000209182612b32565b61284f8161258e565b8061289d57505460e01c63ffffffff6005541681158015612895575b6128885780821061288157505b60019160009190565b9050612878565b5050600090600390600090565b50801561286b565b6000929091508290565b60005260008051602061389a83398151915260205260016040600020015490565b805463ffffffff60a01b191660a09290921b63ffffffff60a01b16919091179055565b919091600052600460205261290560406000209283612bbe565b9161290f8361258e565b826129475763ffffffff9192505460c01c1663ffffffff60055416811580156128955761288857808210612881575060019160009190565b5060009190600090565b906129689160005260046020526040600020612c4a565b6129718161258e565b8061297f5750600190600090565b600091565b6042916040519060208201926000805160206137da833981519152845260018060a01b0316604083015260018060a01b03166060820152606081526129ca608082612639565b5190206129d56136ae565b6129dd613706565b6040519060208201927f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f8452604083015260608201524660808201523060a082015260a08152612a2e60c082612639565b519020906040519161190160f01b8352600283015260228201522090565b8054600160a01b600160e01b03191660a09290921b600160a01b600160e01b0316919091179055565b60ff6000805160206138da8339815191525416612b2b57546001600160a01b038116908115612b235760a01c60021615612b1c5760005260016020526040600020549060ff8260e01c1660038110156103d0578015612b1457600214612b0d574260a083901c6001600160401b03161115612b06576001600160a01b03908116911603612b0157600090565b600790565b5050600690565b5050600590565b505050600490565b5050600390565b505050600290565b5050600190565b60ff6000805160206138da8339815191525416612b2b57546001600160a01b038116908115612b235760a01c60081615612b1c5760005260016020526040600020549060ff8260e01c1660038110156103d0578015612b1457600214612b0d574260a083901c6001600160401b03161115612b06576001600160a01b03908116911603612b0157600090565b60ff6000805160206138da8339815191525416612b2b57546001600160a01b038116908115612b235760a01c60041615612b1c5760005260016020526040600020549060ff8260e01c1660038110156103d0578015612b1457600214612b0d574260a083901c6001600160401b03161115612b06576001600160a01b03908116911603612b0157600090565b60ff6000805160206138da8339815191525416612b2b57546001600160a01b038116908115612b235760a01c60011615612b1c5760005260016020526040600020549060ff8260e01c1660038110156103d0578015612b1457600214612b0d574260a083901c6001600160401b03161115612b06576001600160a01b03908116911603612b0157600090565b6000908152600460205260409020805490916001600160a01b038216918215908115612d39575b5061141d5733600090815260008051602061383a833981519152602052604090205460ff161580612d2f575b61140257565b5081331415612d29565b6004915060a01c161538612cfd565b905460a01c63ffffffff1615612d5b5750565b600052600460205260006040812055565b600081815260008051602061389a8339815191526020908152604080832033845290915290205460ff1615612d9e5750565b63e2517d3f60e01b6000523360045260245260446000fd5b612dc0828261320e565b9182612dcb57505090565b600091825260008051602061373a8339815191526020526040909120612dfa916001600160a01b03169061348a565b5090565b612e0882826132b7565b9182612e1357505090565b600091825260008051602061373a8339815191526020526040909120612dfa916001600160a01b0316906134fb565b60ff6000805160206138da8339815191525416612e5b57565b63d93c066560e01b60005260046000fd5b519064ffffffffff821682036102bb57565b519061ffff821682036102bb57565b801561316857600354604051638d34875560e01b8152600481018390529190600090839060249082906001600160a01b03165afa91821561315c57600092612fb1575b5060808201516001600160a01b03169133839003611402576101200151612ef68161258e565b612eff8161258e565b60038114908115612f9c575b8115612f88575b50612f775781600052600160205260ff60406000205460e01c1660038110156103d057600103612f6657600090815260046020526040902080546001600160a01b0319166001600160a01b03831617815591565b632e68d1d360e21b60005260046000fd5b63e9f6db8560e01b60005260046000fd5b60079150612f958161258e565b1438612f12565b9050612fa78161258e565b6005811490612f0b565b90913d8082843e612fc28184612639565b82019160208184031261313c578051906001600160401b0382116131445701906101a08284031261313957604051926101a084016001600160401b038111858210176131485760409081528351855260208085015190860152838101519085015260608301516001600160401b03811161314457830181601f820112156131445780519061304f8261265c565b9261305d6040519485612639565b82845260208383010111613140579061307c91602080850191016126ae565b606084015260808201516001600160a01b038116810361313c5760808401526130a760a08301612e6c565b60a08401526130b860c08301612e6c565b60c08401526130c960e08301612e7e565b60e08401526130db6101008301612e6c565b610100840152610120820151906008821015613139575061312c916101809161012085015261310d6101408201612e6c565b6101408501526131206101608201612e7e565b61016085015201612e6c565b6101808201529038612ed0565b80fd5b5080fd5b8380fd5b8280fd5b634e487b7160e01b83526041600452602483fd5b6040513d6000823e3d90fd5b637bb0b62160e01b60005260046000fd5b61319b9261318d8361319593969496612984565b923691612677565b9061344e565b5060048110156103d05715918215926131c8575b50506131b757565b63cacba36560e01b60005260046000fd5b6001600160a01b0391821691161415905038806131af565b60ff6000805160206138fa8339815191525460401c16156131fd57565b631afcd79f60e31b60005260046000fd5b600081815260008051602061389a833981519152602090815260408083206001600160a01b038616845290915290205460ff166132b057600081815260008051602061389a833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19166001179055339291907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a4600190565b5050600090565b600081815260008051602061389a833981519152602090815260408083206001600160a01b038616845290915290205460ff16156132b057600081815260008051602061389a833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19169055339291907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9080a4600190565b805482101561336f5760005260206000200190600090565b634e487b7160e01b600052603260045260246000fd5b15801561343d575b611220576001600160a01b031660009081526002602052604090205461342c576001600160401b03164281111561341b5760005460a01c6001600160401b031680151591826133f0575b50506133df57565b63e774e7b560e01b60005260046000fd5b909150428103908111613405571138806133d7565b634e487b7160e01b600052601160045260246000fd5b63efa7aefd60e01b60005260046000fd5b633b53f64f60e21b60005260046000fd5b506001600160a01b0381161561338d565b815191906041830361347f5761347892506020820151906060604084015193015160001a906135ce565b9192909190565b505060009160029190565b60018101908260005281602052604060002054156000146134f3578054600160401b8110156121e0576134de6134c7826001879401855584613357565b819391549060031b91821b91600019901b19161790565b90555491600052602052604060002055600190565b505050600090565b90600182019181600052826020526040600020548015156000146135c55760001981018181116134055782546000198101919082116134055781810361358e575b505050805480156135785760001901906135568282613357565b8154906000199060031b1b191690555560005260205260006040812055600190565b634e487b7160e01b600052603160045260246000fd5b6135ae61359e6134c79386613357565b90549060031b1c92839286613357565b90556000528360205260406000205538808061353c565b50505050600090565b91906fa2a8918ca85bafe22016d0b997e4df60600160ff1b038411613641579160209360809260ff60009560405194855216868401526040830152606082015282805260015afa1561315c576000516001600160a01b038116156136355790600090600090565b50600090600190600090565b50505060009160039190565b90613673575080511561366257602081519101fd5b63d6bda27560e01b60005260046000fd5b815115806136a5575b613684575090565b639996b31560e01b60009081526001600160a01b0391909116600452602490fd5b50803b1561367c565b6136b66127a3565b80519081156136c6576020012090565b50506000805160206137ba8339815191525480156136e15790565b507fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47090565b61370e6127d6565b805190811561371e576020012090565b505060008051602061391a8339815191525480156136e1579056fec1f6fe24621ce81ec5827caf0253cadb74709b061630e6b55e82371705932000a16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d102c7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2a16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d103a16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d1002b26bde9d050a2447879fc2826d068ca8d51a693da5ddde56556964c09fea96875027301df982f5215b4963a854cf9c73219df80cb6acd8f098189c9480c7bbc360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc07966f2ab141347034724e9b2a472c2f77f5cd745aeba27cacba797b8fcb708617dc5b1290f7495d7f8cc68476e6941aaf510598fa925d0d2720edc8805a846cd37bc77615afefc793aa17d75d4249a9b517ba91b0e54a49c9c4a44b3d7e228302dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800edcc084d3dcd65a1f7f23c65c46722faca6953d28e43150a467cf43e5c309238cd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00a16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d101a164736f6c6343000822000a";
|
|
75519
75603
|
var isSuperArgs2 = (xs) => xs.length > 1;
|
|
75520
|
-
var AgentDelegationRegistry__factory = class extends
|
|
75604
|
+
var AgentDelegationRegistry__factory = class extends import_ethers33.ContractFactory {
|
|
75521
75605
|
constructor(...args) {
|
|
75522
75606
|
if (isSuperArgs2(args)) {
|
|
75523
75607
|
super(...args);
|
|
@@ -75537,10 +75621,10 @@ var AgentDelegationRegistry__factory = class extends import_ethers32.ContractFac
|
|
|
75537
75621
|
static bytecode = _bytecode2;
|
|
75538
75622
|
static abi = _abi2;
|
|
75539
75623
|
static createInterface() {
|
|
75540
|
-
return new
|
|
75624
|
+
return new import_ethers33.Interface(_abi2);
|
|
75541
75625
|
}
|
|
75542
75626
|
static connect(address, runner) {
|
|
75543
|
-
return new
|
|
75627
|
+
return new import_ethers33.Contract(
|
|
75544
75628
|
address,
|
|
75545
75629
|
_abi2,
|
|
75546
75630
|
runner
|
|
@@ -77718,7 +77802,7 @@ var _abi3 = [
|
|
|
77718
77802
|
];
|
|
77719
77803
|
var _bytecode3 = "0x60a080604052346100ea57306080527ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005460ff8160401c166100d9576002600160401b03196001600160401b03821601610073575b604051615a7e90816100f0823960805181818161197e01526125180152f35b6001600160401b0319166001600160401b039081177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005581527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a13880610054565b63f92ee8a960e01b60005260046000fd5b600080fdfe608080604052600436101561001357600080fd5b60003560e01c90816301ffc9a71461358e57508063033b66ba1461334d5780630d8e6e2c146102be5780630e0b21cc146131b25780631317cb371461300857806316efd94114612fdf5780631ef3a04c14612fb65780631f4cceff14612f9a57806320af137a14612ee657806323be345c14612ebd578063248a9ca314612e9757806329b6eca914612d805780632a6bc2dd14612c1b5780632f2ff15d14612bea57806336568abe14612ba4578063393d92cc14612b7b5780633c2ef15a14612b245780633f4ba83a14612a6b5780634a26bd95146127935780634a54e00a1461276a5780634f1ef286146124ca5780634f27e7fa1461244157806350c1d19d146119fe5780635273b6f6146119d557806352d1902d1461196b57806353f366c7146118e45780635760f2e31461185b57806358ca3941146118295780635bc26aea146117f55780635c975abb146117c5578063650e5cb41461140a5780636aa6c53f1461119a57806371b2f19c1461110057806375b238fc146110d757806376dc71be14611054578063791b98bc1461102b5780638456cb5914610f355780638b1702fc14610f1a5780639010d07c14610ec657806391d1485414610e6c57806392efff1614610de85780639b9d30c114610dbf5780639cfee37f14610d40578063a217fddf14610d24578063a3246ad314610c62578063a69a9ef714610936578063ad3cb1cc14610c1b578063b49cc29514610bf2578063bdc7647214610bd5578063ca15c87314610b9c578063cf786fc014610b2e578063d547741f14610af6578063dc5632531461093b578063e1f1c4a714610936578063e34ad47b1461089c578063eb33b7501461084d578063eb8c8d411461081d578063f2f4eb26146107f4578063f5e95acb14610321578063fd847e01146102f75763ffa1ad74146102be57600080fd5b346102f25760003660031901126102f2576102ee6102da613922565b60405191829160208352602083019061361e565b0390f35b600080fd5b346102f25760203660031901126102f2576040610315600435614d3f565b82519182526020820152f35b346102f2576101203660031901126102f25761033b61368d565b6103436136a3565b906044356001600160a01b038116908190036102f2576064356001600160a01b038116908190036102f2576084356001600160a01b03811692908390036102f25760a4356001600160a01b03811692908390036102f25760c4356001600160a01b038116949093908585036102f25760e4356001600160a01b03811693908490036102f257610104356001600160a01b038116999095908a87036102f257600080516020615a5283398151915254604081901c60ff16159a906001600160401b0316801590816107ec575b60011490816107e2575b1590816107d9575b506107c857600080516020615a5283398151915280546001600160401b03191660011790558a6107a3575b610453615746565b61045b615746565b610463615746565b61046b615746565b610473615746565b60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f005561049f615746565b6001600160a01b0316908115610792576001600160a01b0316908115610792578215610792578315610792578415610792578515610792578915610792578615610792578b156107925760018060a01b0319600554161760055560018060a01b0319600054161760005560018060a01b0319600154161760015560018060a01b0319600254161760025560018060a01b0319600354161760035560018060a01b0319600454161760045560018060a01b0319600654161760065561056482600061551b565b8061074c575b1561063e5761058782600080516020615a3283398151915261551b565b806106f8575b1561063e576105aa9060008051602061591283398151915261551b565b806106a4575b1561063e576105cd9060008051602061599283398151915261551b565b908161064f575b501561063e57600780546001600160a01b031916831790556040519160006000805160206159d28339815191528180a361060a57005b600080516020615a52833981519152805460ff60401b191690556001815260008051602061597283398151915290602090a1005b63cf5a8e3360e01b60005260046000fd5b60008051602061599283398151915260005260008051602061593283398151915260205261069d907ffff5b43478fa6840382eb63777e0da6941d320b940e3f70f0ea4780feff95827615774565b50836105d4565b6000805160206159128339815191526000526000805160206159328339815191526020526106f2857fdb30a1288f67da8a7b16afbbe7b3c5ab0a7a441f62fe00f878d5fff64f32a697615774565b506105b0565b600080516020615a32833981519152600052600080516020615932833981519152602052610746847f46448fd7a7b40360a1323cb3199d0aafeb92ce905bb512a6bb7d3d3f685cf1b1615774565b5061058d565b6000805260008051602061593283398151915260205261078c847f615f0f9e84155bea8cc509fe18befeb1baf65611e38a6ba60964480fb29dfd44615774565b5061056a565b63e6c4247b60e01b60005260046000fd5b600080516020615a52833981519152805460ff60401b1916600160401b17905561044b565b63f92ee8a960e01b60005260046000fd5b9050158d610420565b303b159150610418565b8c915061040e565b346102f25760003660031901126102f2576000546040516001600160a01b039091168152602090f35b346102f25760003660031901126102f2576060610838614c7d565b90604051921515835260208301526040820152f35b346102f25760603660031901126102f25761088d61087961086c61368d565b6044359060243590614aca565b6040519384936060855260608501906136b9565b91602084015260408301520390f35b346102f25760006108ac366136ed565b825460405163e34ad47b60e01b815260048101939093526024830191909152909190829060449082906001600160a01b03165afa801561092a576102ee91600091610907575b506040519182916020835260208301906136b9565b61092491503d806000833e61091c8183613756565b810190613b5b565b826108f2565b6040513d6000823e3d90fd5b613905565b346102f25760203660031901126102f257600061018060405161095d8161373a565b8281528260208201528260408201526060808201528260808201528260a08201528260c08201528260e08201528261010082015282610120820152826101408201528261016082015201526024600060018060a01b0381541660405192838092638d34875560e01b825260043560048301525afa90811561092a57600091610ad5575b506080810180519091906001600160a01b031615610ac4576101809164ffffffffff60405193849360208552805160208601526020810151604086015260408101516060860152610a4260608201516101a060808801526101c087019061361e565b9360018060a01b0390511660a08601528260a08201511660c08601528260c08201511660e086015261ffff60e0820151166101008601528261010082015116610120860152610a9b610120820151610140870190613680565b826101408201511661016086015261ffff61016082015116828601520151166101a08301520390f35b636ec9be1160e01b60005260046000fd5b610af0913d8091833e610ae88183613756565b810190613a0a565b816109e0565b346102f25760403660031901126102f257610b2c600435610b156136a3565b90610b27610b2282613bf4565b6150c2565b615154565b005b346102f25760203660031901126102f257610b4a600435614942565b9060405191829160408301901515835260406020840152815180915260206060840192019060005b818110610b80575050500390f35b825160ff16845285945060209384019390920191600101610b72565b346102f25760203660031901126102f2576004356000526000805160206159328339815191526020526020604060002054604051908152f35b346102f25760003660031901126102f25760206040516161a88152f35b346102f25760003660031901126102f25760206040516000805160206159128339815191528152f35b346102f25760003660031901126102f2576102ee6040805190610c3e8183613756565b60058252640352e302e360dc1b60208301525191829160208352602083019061361e565b346102f25760203660031901126102f25760043560005260008051602061593283398151915260205260406000206040518060208354918281520190819360005260206000209060005b818110610d0e5750505081610cc2910382613756565b6040519182916020830190602084525180915260408301919060005b818110610cec575050500390f35b82516001600160a01b0316845285945060209384019390920191600101610cde565b8254845260209093019260019283019201610cac565b346102f25760003660031901126102f257602060405160008152f35b346102f2576101603660031901126102f257610144356001600160401b0381116102f257366023820112156102f2576004810135906001600160401b0382116102f25736602483830101116102f2576102ee9160246102da9201610124356101043560e43560c43560a435608435606435604435602435600435613f04565b346102f25760003660031901126102f25760206040516000805160206159928339815191528152f35b346102f25760203660031901126102f2576024602060018060a01b036004541660405192838092634977ff8b60e11b825260043560048301525afa801561092a57602091600091610e3f575b506040519015158152f35b610e5f9150823d8411610e65575b610e578183613756565b810190613cc4565b82610e34565b503d610e4d565b346102f25760403660031901126102f257610e856136a3565b6004356000526000805160206159f283398151915260205260406000209060018060a01b0316600052602052602060ff604060002054166040519015158152f35b346102f25760403660031901126102f2576004356000526000805160206159328339815191526020526020610f0160243560406000206156ec565b905460405160039290921b1c6001600160a01b03168152f35b346102f25760003660031901126102f2576040610315613e12565b346102f25760003660031901126102f2573360009081527f0ac8cc3d209806126662940717264973110c39045b305f6ba49613325a615e09602052604090205460ff161561100457610f85615198565b600160ff19600080516020615a12833981519152541617600080516020615a12833981519152557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a16040514281527f80170b5fcdd2bf1e0660ef4b8851f86685f64d41b1a19de1471947ece8725aac60203392a2005b63e2517d3f60e01b6000523360045260008051602061599283398151915260245260446000fd5b346102f25760003660031901126102f2576005546040516001600160a01b039091168152602090f35b346102f25760003660031901126102f257600054604051633b6e38df60e11b815290602090829060049082906001600160a01b03165afa801561092a576000906110a4575b602090604051908152f35b506020813d6020116110cf575b816110be60209383613756565b810103126102f25760209051611099565b3d91506110b1565b346102f25760003660031901126102f2576020604051600080516020615a328339815191528152f35b346102f25760203660031901126102f25761111961368d565b6007546001600160a01b0316330361118957611133615198565b6001600160a01b0316801561079257600180546001600160a01b0319811683179091553391906001600160a01b03167fa06737e7750a5964f26df32519f3270980324efe72b046924980308f0c0fa45f600080a4005b6349db3bd360e01b60005260046000fd5b346102f25760603660031901126102f2576004356001600160401b0381116102f2576111ca9036906004016137ec565b60243590604435918215928315036102f2576101208201519260088410156113f4576002600094146112ac575b50600c810361127f575061121f6101009164ffffffffff6301e133809384925b015116613be7565b4281111561127057611232904290613e05565b8160011b918083046002149015171561125c571161124d5780f35b6309116a8160e11b8152600490fd5b634e487b7160e01b83526011600452602483fd5b6309116a8160e11b8352600483fd5b62278d0081029080820462278d00149015171561125c576101009164ffffffffff61121f92938492611217565b61010083019064ffffffffff825116421161139057156111f75761018083015164ffffffffff16806113e8575064ffffffffff8060a0850151165b1661ffff60e085015116600c81146000146113b0575064ffffffffff6301e13380925b511682808211156113a75761131e91613e05565b905b8082111561139f5750905b4282116113905762278d008111156113855762278cff1981019081116113715761135790915b42613e05565b1061136257836111f7565b63088502f160e21b8352600483fd5b634e487b7160e01b85526011600452602485fd5b506113578491611351565b63088502f160e21b8552600485fd5b90509061132b565b50508490611320565b62278d0081029080820462278d0014901517156113d45764ffffffffff909261130a565b634e487b7160e01b86526011600452602486fd5b64ffffffffff906112e7565b634e487b7160e01b600052602160045260246000fd5b346102f25760a03660031901126102f2576004356001600160401b0381116102f25761143a9036906004016137ec565b6024356044359160246064359260843593604060018060a01b03600454168151948580926353f366c760e01b82528660048301525afa92831561092a57600093611792575b5060408401805190936127109161149f916001600160581b031690613bd4565b0480861161177a5760018060a01b0360005416602086516024604051809481936375ca21bb60e01b835260048301525afa90811561092a57600091611748575b508082111561173f576114f191613e05565b808610611727575060018060a01b03600154169280519686880197881061171657604051637a3b9c6360e01b8152602081600481895afa90811561092a576000916116e4575b50670de0b6b3a7640000810290808204670de0b6b3a764000014901517156116ce5788116116bd57660775f05a07400083116116ac57662386f26fc10000811161169b5768327cb2734119d3b7a9601e1b881161168a5761159c6020916004946151c2565b946040519384809263100c48d360e21b82525afa91821561092a57600092611651575b50816115cc915185615664565b611640576115db908684615664565b61162f5761ffff60e06115f1876115fa95615235565b94015116613be7565b9061ffff821161161e57608093604051938452602084015260408301526060820152f35b6319a4c60960e21b60005260046000fd5b631300e8bd60e21b60005260046000fd5b63e5cace4160e01b60005260046000fd5b90916020823d602011611682575b8161166c60209383613756565b8101031261167f575051906115cc6115bf565b80fd5b3d915061165f565b638a94304d60e01b60005260046000fd5b63128df78360e01b60005260046000fd5b63e9ec682160e01b60005260046000fd5b63499e798560e01b60005260046000fd5b634e487b7160e01b600052601160045260246000fd5b906020823d60201161170e575b816116fe60209383613756565b8101031261167f57505189611537565b3d91506116f1565b63a421190b60e01b60005260046000fd5b856378279ed960e11b60005260045260245260446000fd5b505060006114f1565b906020823d602011611772575b8161176260209383613756565b8101031261167f575051886114df565b3d9150611755565b856373ab893560e11b60005260045260245260446000fd5b6117b591935060403d6040116117be575b6117ad8183613756565b810190613cdc565b9050918661147f565b503d6117a3565b346102f25760003660031901126102f257602060ff600080516020615a1283398151915254166040519015158152f35b346102f25760203660031901126102f25761180e61368d565b6007546001600160a01b0316330361118957610b2c90613c15565b346102f25760603660031901126102f257604061184d604435602435600435613d00565b825191825215156020820152f35b346102f25760203660031901126102f25761187461368d565b6007546001600160a01b031633036111895761188e615198565b6001600160a01b0316801561079257600580546001600160a01b0319811683179091553391906001600160a01b03167f95b04cc8ee34c3af50f5a566d34239ba1c449c913d700dfe0521073d3b584f41600080a4005b346102f25760203660031901126102f2576024604060018060a01b03600454168151928380926353f366c760e01b825260043560048301525afa90811561092a5760409160009160009161194c575b5082516001600160581b03928316815291166020820152f35b90506119659150823d84116117be576117ad8183613756565b83611933565b346102f25760003660031901126102f2577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031630036119c45760206040516000805160206159b28339815191528152f35b63703e46dd60e11b60005260046000fd5b346102f25760003660031901126102f2576007546040516001600160a01b039091168152602090f35b346102f25760003660031901126102f25760405161034081016001600160401b0381118282101761242b576040526000815260006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526000610100820152600061012082015260006101408201526000610160820152600061018082015260006101a082015260006101c082015260006101e0820152600061020082015260006102208201526000610300820152600061032082015260018060a01b03600054169081151561024082015260018060a01b03600154169182151561026083015260018060a01b0360025416151561028083015260018060a01b0360035416928315156102a084015260018060a01b036004541615156102c084015260018060a01b0360065416918215156102e0850152806123c8575b50610260830151611f46575b506102e0820151611da1575b6102a0820151611d1d575b610340925060ff600080516020615a12833981519152541615156103008301526102e0820151611cc7575b5061032060405191805183526020810151602084015260408101516040840152606081015160608401526080810151608084015260a081015160a084015260c081015160c084015260e081015160e08401526101008101516101008401526101208101516101208401526101408101516101408401526101608101516101608401526101808101516101808401526101a08101516101a08401526101c08101516101c08401526101e08101516101e08401526102008101516102008401526102208101516102208401526102408101511515610240840152610260810151151561026084015261028081015115156102808401526102a081015115156102a08401526102c081015115156102c08401526102e081015115156102e0840152610300810151151561030084015201511515610320820152f35b60206004916040519283809263f609844d60e01b82525afa60009181611cfc575b5015611b8f57151561032082015282611b8f565b611d1691925060203d602011610e6557610e578183613756565b9084611ce8565b6040805163a0eb92e360e01b815293849060049082905afa600081600092611d64575b6103409550611d51575b5050611b64565b6102008401526102208301528380611d4a565b9150506040843d604011611d99575b81611d8060409383613756565b810103126102f257836020610340955191015191611d40565b3d9150611d73565b60405163074e13b960e01b8152602081600481855afa60009181611f12575b50611f07575b50604051633087c5cf60e01b81526201518042046004820152602081602481855afa60009181611ed3575b50611ec8575b506040516285d89b60e21b8152602081600481855afa60009181611e94575b50611e88575b50604051636e252e0160e11b8152602081600481855afa60009181611e54575b50611e48575b50611b59565b61012083015283611e42565b9091506020813d602011611e80575b81611e7060209383613756565b810103126102f257519085611e3c565b3d9150611e63565b61010083015283611e1c565b9091506020813d602011611ec0575b81611eb060209383613756565b810103126102f257519085611e16565b3d9150611ea3565b60e083015283611df7565b9091506020813d602011611eff575b81611eef60209383613756565b810103126102f257519085611df1565b3d9150611ee2565b60c083015283611dc6565b9091506020813d602011611f3e575b81611f2e60209383613756565b810103126102f257519085611dc0565b3d9150611f21565b60405163100c48d360e21b8152602081600481855afa60009181612394575b50612389575b50604051631c42d7b960e21b8152602081600481855afa60009181612355575b5061234a575b50604051637a3b9c6360e01b8152602081600481855afa60009181612316575b5061230b575b50604051636759a85b60e11b8152602081600481855afa600091816122d4575b50916020916004936122c9575b506040516306d136bd60e21b815292839182905afa60009181612295575b5061228a575b506001600160a01b03612019614fe2565b168015611b4d576040516313cf87bf60e21b8152602081600481855afa60009181612256575b5061224a575b5060405163d5abeb0160e01b8152602081600481855afa60009181612216575b5061220a575b5060405162d5c44360e41b8152602081600481855afa600091816121d6575b506121ca575b50604051630b5570e560e31b8152602081600481855afa60009181612196575b5061218a575b506040516362680e4b60e01b8152602081600481855afa60009181612153575b5091602091600493612147575b5060405163d3303e4160e01b815292839182905afa60009181612113575b5015611b4d576101e083015283611b4d565b9091506020813d60201161213f575b8161212f60209383613756565b810103126102f257519085612101565b3d9150612122565b6101c0860152866120e3565b9150916020823d602011612182575b8161216f60209383613756565b810103126102f2579051909160046120d6565b3d9150612162565b6101a0840152846120b6565b9091506020813d6020116121c2575b816121b260209383613756565b810103126102f2575190866120b0565b3d91506121a5565b61018084015284612090565b9091506020813d602011612202575b816121f260209383613756565b810103126102f25751908661208a565b3d91506121e5565b6101608401528461206b565b9091506020813d602011612242575b8161223260209383613756565b810103126102f257519086612065565b3d9150612225565b61014084015284612045565b9091506020813d602011612282575b8161227260209383613756565b810103126102f25751908661203f565b3d9150612265565b60a083015283612008565b9091506020813d6020116122c1575b816122b160209383613756565b810103126102f257519085612002565b3d91506122a4565b608086015286611fe4565b9150916020823d602011612303575b816122f060209383613756565b810103126102f257905190916004611fd7565b3d91506122e3565b606084015284611fb7565b9091506020813d602011612342575b8161233260209383613756565b810103126102f257519086611fb1565b3d9150612325565b604084015284611f91565b9091506020813d602011612381575b8161237160209383613756565b810103126102f257519086611f8b565b3d9150612364565b602084015284611f6b565b9091506020813d6020116123c0575b816123b060209383613756565b810103126102f257519086611f65565b3d91506123a3565b602060049160405192838092633b6e38df60e11b82525afa600091816123f7575b5015611b4157835284611b41565b9091506020813d602011612423575b8161241360209383613756565b810103126102f2575190866123e9565b3d9150612406565b634e487b7160e01b600052604160045260246000fd5b346102f25760203660031901126102f25761245a61368d565b6007546001600160a01b0316330361118957612474615198565b6001600160a01b0316801561079257600680546001600160a01b0319811683179091553391906001600160a01b03167f8550087a253262ad1d569902c213043016c8e75d5a0dfcf70c0473c8e67eab50600080a4005b60403660031901126102f2576124de61368d565b6024356001600160401b0381116102f257366023820112156102f25761250e903690602481600401359101613794565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016308114908115612747575b506119c4576007546001600160a01b03163303611189576001600160a01b03821691821561079257803b15612736576000805160206159b2833981519152548361258b613922565b7f6ea8b34d59b2818d3f37a08dddaa06f5886b9c20c907b36f03ca6528e106e86f6125c16040519260408452604084019061361e565b4260208401526001600160a01b038516929081900390a36040516352d1902d60e01b8152602081600481885afa60009181612702575b506126115784634c9c8ce360e01b60005260045260246000fd5b90816000805160206159b28339815191528693036126ee5750823b156126d9576001600160a01b03191681176000805160206159b2833981519152557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a28151156126bf57600080836020610b2c95519101845af43d156126b7573d9161269a83613779565b926126a86040519485613756565b83523d6000602085013e6158b0565b6060916158b0565b5050346126c857005b63b398979f60e01b60005260046000fd5b50634c9c8ce360e01b60005260045260246000fd5b632a87526960e21b60005260045260246000fd5b90916020823d60201161272e575b8161271d60209383613756565b8101031261167f57505190866125f7565b3d9150612710565b636f7c43f160e01b60005260046000fd5b6000805160206159b2833981519152546001600160a01b03161415905083612543565b346102f25760003660031901126102f2576004546040516001600160a01b039091168152602090f35b346102f2576127a1366136ed565b808015612a5a57603210612a52575b600054604051633b6e38df60e11b81526001600160a01b03909116929091602083600481875afa92831561092a57600093612a1e575b506040519063e34ad47b60e01b82528260048301526024820152600081604481875afa90811561092a57600091612a03575b5061282581518093613be7565b9361282f83613945565b9261283d6040519485613756565b808452601f1961284c82613945565b0160005b8181106129d057505060009260005b8281106129045750505050815260405191606083016060845282518091526080840190602060808260051b8701019401916000905b8282106128af57505050508293602084015260408301520390f35b90919294602080600192607f198a820301855288519081518152606060ff816128e586860151608088870152608086019061361e565b9460408101516040860152015116910152970192019201909291612894565b61290e8183613c81565b519060405191638d34875560e01b83526004830152600082602481885afa91821561092a576000926129b5575b50604082015180612952575b50600191500161285f565b82519661012060608501519401519360088510156113f4576001946129ae9360ff926040519b6129818d61371f565b8c5260208c015260408b015216606089015261299c81613c95565b976129a7828b613c81565b5288613c81565b5089612947565b6129c991923d8091833e610ae88183613756565b908961293b565b6020906040516129df8161371f565b60008152606083820152600060408201526000606082015282828901015201612850565b612a1891503d806000833e61091c8183613756565b84612818565b9092506020813d602011612a4a575b81612a3a60209383613756565b810103126102f2575191846127e6565b3d9150612a2d565b5060326127b0565b63162908e360e11b60005260046000fd5b346102f25760003660031901126102f2576007546001600160a01b0316330361118957600080516020615a128339815191525460ff811615612b135760ff1916600080516020615a12833981519152557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a16040514281527f107553d8191d85b405879cf752997865edd48d94e20bda4dd27223c94b31a7cc60203392a2005b638dfc202b60e01b60005260046000fd5b346102f25760203660031901126102f257600054604051631e1778ad60e11b8152600480359082015290602090829060249082906001600160a01b03165afa801561092a576000906110a457602090604051908152f35b346102f25760003660031901126102f2576001546040516001600160a01b039091168152602090f35b346102f25760403660031901126102f257612bbd6136a3565b336001600160a01b03821603612bd957610b2c90600435615154565b63334bd91960e11b60005260046000fd5b346102f25760403660031901126102f257610b2c600435612c096136a3565b90612c16610b2282613bf4565b61510c565b346102f25760203660031901126102f257612c3461368d565b60008054604051632a6bc2dd60e01b81526001600160a01b0393841660048201529192168282602481845afa91821561092a57600092612d63575b5081516032811115612d5d57506032905b60005b828110612cad57612ca384866040519283926040845260408401906136b9565b9060208301520390f35b612cb78185613c81565b5160405190638d34875560e01b82526004820152600081602481865afa801561092a5761012091600091612d44575b50015160088110156113f457600281149060008215612d39575b8215612d2a575b5050612d16575b600101612c83565b93612d22600191613c95565b949050612d0e565b9091506113f457158680612d07565b600182149250612d00565b612d57913d8091833e610ae88183613756565b87612ce6565b90612c80565b612d799192503d806000833e61091c8183613756565b9083612c6f565b346102f25760203660031901126102f257612d9961368d565b600080516020615a528339815191525460ff8160401c16908115612e7f575b506107c857600080516020615a5283398151915280546001600160481b0319166002600160401b011790553360009081527fb7db2dd08fcb62d0c9e08c51941cae53c267786a0b75803fb7960902fc8ef97d602052604090205460ff1615612e6557612e2390613c15565b60ff60401b19600080516020615a528339815191525416600080516020615a5283398151915255600080516020615972833981519152602060405160028152a1005b63e2517d3f60e01b60005233600452600060245260446000fd5b60026001600160401b03919091161015905082612db8565b346102f25760203660031901126102f2576020612eb5600435613bf4565b604051908152f35b346102f25760003660031901126102f2576002546040516001600160a01b039091168152602090f35b346102f25760203660031901126102f257612eff61368d565b60008054604051632a6bc2dd60e01b81526001600160a01b0393841660048201529283916024918391165afa90811561092a57600091612f7f575b50516032811115612f795760325b61271081029080820461271014901517156116ce576161a801806161a8116116ce5760409182519182526020820152f35b80612f48565b612f9491503d806000833e61091c8183613756565b81612f3a565b346102f25760003660031901126102f257602060405160328152f35b346102f25760003660031901126102f2576003546040516001600160a01b039091168152602090f35b346102f25760003660031901126102f2576006546040516001600160a01b039091168152602090f35b346102f25760203660031901126102f257600061010060405161302a81613703565b8281528260208201528260408201528260608201528260808201528260a08201528260c08201528260e082015201526024600060018060a01b0381541660405192838092638d34875560e01b825260043560048301525afa90811561092a57600091613199575b508051602082015190604083015160018060a01b036080850151169364ffffffffff60a0820151169064ffffffffff60c0820151169561ffff60e08301511661012064ffffffffff610100850151169301519460088610156113f4576101209864ffffffffff809661ffff9582946131979b6040519061311082613703565b8152602081019d8e5260408101918252606081019283526080810193845260a0810195865260c0810197885260e08101998a5261010081019b8c5260206040519e8f92518352519101525160408d015260018060a01b0390511660608c0152511660808a0152511660a0880152511660c0860152511660e084015251610100830190613680565bf35b6131ac913d8091833e610ae88183613756565b81613091565b346102f25760003660031901126102f25760048054604051630382c87360e21b81529160009183919082906001600160a01b03165afa801561092a57600080928192613262575b5091906040519283926060840160608552825180915260206080860193019060005b818110613249575050508161323b91856102ee9594036020870152613643565b908382036040850152613643565b825185528796506020948501949092019160010161321b565b915091503d8083833e6132758183613756565b8101906060818303126133495780516001600160401b0381116133455781019180601f84011215613345578251926132ac84613945565b936132ba6040519586613756565b80855260208086019160051b8301019183831161334157602001905b8282106133315750505060208201516001600160401b03811161332d57816132ff918401613970565b604083015190926001600160401b038211613329576133219394955001613970565b9091836131f9565b8580fd5b8480fd5b81518152602091820191016132d6565b8680fd5b8380fd5b8280fd5b346102f25760003660031901126102f2576040516101c08101906001600160401b0382118183101761242b576101c0916040526000815260208101906000825260408101600081526060820160008152608083016000815260a084016000815260c085016000815260e08601600081526101008701916000835261012088019360008552610140890195600087526101608a0197600089526101808b019960008b526101a08c019b60008d528d61341a60018060a01b036005541661341181614e42565b15158452614ea4565b15159052600054613433906001600160a01b0316614e42565b1515825260015461344c906001600160a01b0316614e42565b15158352600254613465906001600160a01b0316614e42565b1515845260035461347e906001600160a01b0316614e42565b15158552600654613497906001600160a01b0316614e42565b151586526004546134b0906001600160a01b0316614e42565b15158a526134c46134bf614ede565b614e42565b15158b526134d36134bf614f6c565b15158c526134e26134bf614fa7565b15158d526134f16134bf614fe2565b151587526135006134bf615050565b1515885261350f6134bf615089565b1515895260206040519e8f92511515835251151591015251151560408d015251151560608c015251151560808b015251151560a08a015251151560c089015251151560e08801525115156101008701525115156101208601525115156101408501525115156101608401525115156101808301525115156101a0820152f35b346102f25760203660031901126102f2576004359063ffffffff60e01b82168092036102f257602091635a05180f60e01b81149081156135d0575b5015158152f35b637965db0b60e01b8114915081156135ea575b50836135c9565b6301ffc9a760e01b149050836135e3565b60005b83811061360e5750506000910152565b81810151838201526020016135fe565b90602091613637815180928185528580860191016135fb565b601f01601f1916010190565b906020808351928381520192019060005b8181106136615750505090565b82516001600160581b0316845260209384019390920191600101613654565b9060088210156113f45752565b600435906001600160a01b03821682036102f257565b602435906001600160a01b03821682036102f257565b906020808351928381520192019060005b8181106136d75750505090565b82518452602093840193909201916001016136ca565b60409060031901126102f2576004359060243590565b61012081019081106001600160401b0382111761242b57604052565b608081019081106001600160401b0382111761242b57604052565b6101a081019081106001600160401b0382111761242b57604052565b601f909101601f19168101906001600160401b0382119082101761242b57604052565b6001600160401b03811161242b57601f01601f191660200190565b9291926137a082613779565b916137ae6040519384613756565b8294818452818301116102f2578281602093846000960137010152565b359064ffffffffff821682036102f257565b359061ffff821682036102f257565b9190916101a0818403126102f257604051906138078261373a565b8193813583526020820135602084015260408201356040840152606082013560018060401b0381116102f25782019080601f830112156102f25781602061385093359101613794565b606083015260808101356001600160a01b03811681036102f257608083015261387b60a082016137cb565b60a083015261388c60c082016137cb565b60c083015261389d60e082016137dd565b60e08301526138af61010082016137cb565b6101008301526101208101359060088210156102f2576101806139009181936101208601526138e161014082016137cb565b6101408601526138f461016082016137dd565b610160860152016137cb565b910152565b346102f25760003660031901126102f25760206040516127108152f35b60405190613931604083613756565b6005825264312e312e3360d81b6020830152565b6001600160401b03811161242b5760051b60200190565b51906001600160581b03821682036102f257565b9080601f830112156102f257815161398781613945565b926139956040519485613756565b81845260208085019260051b8201019283116102f257602001905b8282106139bd5750505090565b602080916139ca8461395c565b8152019101906139b0565b51906001600160a01b03821682036102f257565b519064ffffffffff821682036102f257565b519061ffff821682036102f257565b6020818303126102f2578051906001600160401b0382116102f257016101a0818303126102f25760405191613a3e8361373a565b81518352602080830151908401526040808301519084015260608201516001600160401b0381116102f257820181601f820112156102f2578051613a8181613779565b92613a8f6040519485613756565b818452602082840101116102f257613aad91602080850191016135fb565b6060830152613abe608082016139d5565b6080830152613acf60a082016139e9565b60a0830152613ae060c082016139e9565b60c0830152613af160e082016139fb565b60e0830152613b0361010082016139e9565b61010083015261012081015160088110156102f257613b529161018091610120850152613b3361014082016139e9565b610140850152613b4661016082016139fb565b610160850152016139e9565b61018082015290565b6020818303126102f2578051906001600160401b0382116102f257019080601f830112156102f2578151613b8e81613945565b92613b9c6040519485613756565b81845260208085019260051b8201019283116102f257602001905b828210613bc45750505090565b8151815260209182019101613bb7565b818102929181159184041417156116ce57565b919082018092116116ce57565b6000526000805160206159f283398151915260205260016040600020015490565b6001600160a01b038116908115610792573b1561273657600780546001600160a01b0319811683179091556001600160a01b03166000805160206159d2833981519152600080a3565b805115613c6b5760200190565b634e487b7160e01b600052603260045260246000fd5b8051821015613c6b5760209160051b010190565b60001981146116ce5760010190565b8115613cae570490565b634e487b7160e01b600052601260045260246000fd5b908160209103126102f2575180151581036102f25790565b91908260409103126102f257613cfd6020613cf68461395c565b930161395c565b90565b60008054604051638d34875560e01b81526004810193909352929392829060249082906001600160a01b03165afa90811561092a57600091613dea575b5060808101516001600160a01b031615610ac45760400151908115613ddf57613d6e92613d69916151c2565b615235565b60015460405163100c48d360e21b815291929190602090829060049082906001600160a01b03165afa90811561092a57600091613dad575b5082101590565b90506020813d602011613dd7575b81613dc860209383613756565b810103126102f2575138613da6565b3d9150613dbb565b505050600090600190565b613dff91503d806000833e610ae88183613756565b38613d3d565b919082039182116116ce57565b6006546001600160a01b0316908115613ed757604051636e252e0160e11b8152602081600481865afa90811561092a57600091613ea4575b50602060049193604051928380926285d89b60e21b82525afa90811561092a57600091613e75575090565b90506020813d602011613e9c575b81613e9060209383613756565b810103126102f2575190565b3d9150613e83565b90506020813d602011613ecf575b81613ebf60209383613756565b810103126102f257516020613e4a565b3d9150613eb2565b600091508190565b60405190613eee604083613756565b60078252660161023b7ba1d160cd1b6020830152565b9590969198939997929460009a87156148c557881561487a57861561482f5781156147e457841561478e578c156147435764e8d4a5100082106146de57655af3107a400082116146795785156146225761012c86018087116145905742116145a45761012c420180421161459057861161450b57613f806152b5565b80860361442957508b54604051638d34875560e01b8152600481018a905297969594939291908d90899060249082906001600160a01b03165afa97881561441e578d98614401575b50875115614391576040880180516040516020810191825260208152613fef604082613756565b5190209081860361424c575050916101649795939160209a9997959360018060a01b036001541697608060018060a01b0391015116966040519e8f9c8d9b632fd74aa960e11b8d5260048d015260248c015260448b015260648a0152608489015260a488015260c487015260e48601526101048501526101248401526101448301525afa91821561424157839261420d575b5060055460405163fb7c6a0f60e01b815290602090829060049082906001600160a01b03165afa9081156142025784916141c0575b506001600160a01b031691823b15613345579184916084859460405197889586948593636b80155f60e01b8552632c545d9960e21b6004860152602485015260606044850152816064850152848401378181018301879052601f01601f191681010301915afa91826141b0575b509061417b5750604051614138606082613756565b602d81527f56616c69646174696f6e20393a20766572696679417574686f72697a6174696f60208201526c1b8818d85b1b0819985a5b1959609a1b604082015290565b5060405161418a604082613756565b6016815275105b1b081d985b1a59185d1a5bdb9cc81c185cdcd95960521b602082015290565b816141ba91613756565b38614123565b90506020813d6020116141fa575b816141db60209383613756565b8101031261334557516001600160a01b038116810361334557386140b6565b3d91506141ce565b6040513d86823e3d90fd5b9091506020813d602011614239575b8161422960209383613756565b8101031261334957519038614081565b3d915061421c565b6040513d85823e3d90fd5b9b509d505050509897505050505050506040519261426b606085613756565b602c845260208401947f56616c69646174696f6e20383a20446562742068617368206d69736d617463688652604085016b0171022bc3832b1ba32b21d160a51b90526142b690615386565b926142bf613edf565b916142c990615386565b9050604051916142da604084613756565b6010835260208301936f0161021bab93932b73a103232b13a1d160851b85525161430390615457565b9460405197889751908160208a0161431a926135fb565b870181519182602083019160200191614332926135fb565b01602001808251602081940191614348926135fb565b0180825160208194019161435b926135fb565b0191829151809361436b926135fb565b0180825160208194019161437e926135fb565b0103601f1981018252613cfd9082613756565b50505050505050505050505080915050506040516143b0606082613756565b603b81527f56616c69646174696f6e20383a20506f736974696f6e206e6f7420666f756e6460208201527a2028706f736974696f6e4964203d3d20627974657333322830292960281b604082015290565b6144179198508d3d8091833e610ae88183613756565b9638613fc8565b6040513d8f823e3d90fd5b98505050505095505050506144cb94506020915083613cfd9450506144fc8260405194614457606087613756565b603086526144ee826144a7818901967f56616c69646174696f6e20373a20436f6e74726163742068617368206d69736d88526f030ba31b4171022bc3832b1ba32b21d160851b60408b0152615386565b6144b86144b2613edf565b94615386565b966040519b8c9a518092858d01906135fb565b89016144df825180938580850191016135fb565b010191828151948592016135fb565b0191828151948592016135fb565b0103601f198101835282613756565b50505050505050505050508091505050604051614529608082613756565b6060815260008051602061595283398151915260208201527f6f6f2066617220696e2066757475726520287175616e74756d54696d6573746160408201527f6d70203e20626c6f636b2e74696d657374616d70202b204d41585f534b455729606082015290565b634e487b7160e01b8d52601160045260248dfd5b505050505050505050505080915050506040516145c2608082613756565b6056815260008051602061595283398151915260208201527f6f6f206f6c6420287175616e74756d54696d657374616d70202b204d41585f536040820152754b4557203c20626c6f636b2e74696d657374616d702960501b606082015290565b50505050505050505050508091505050604051614640606082613756565b602381527f56616c69646174696f6e20343a207175616e74756d54696d657374616d70203d60208201526203d20360ec1b604082015290565b50505050505050505050508091505050604051614697606082613756565b603181527f56616c69646174696f6e20333a206274635072696365203e20444941474e4f536020820152700a89286be84a886bea0a492868abe9a82b607b1b604082015290565b505050505050505050505080915050506040516146fc606082613756565b603181527f56616c69646174696f6e20333a206274635072696365203c20444941474e4f536020820152702a24a1afa12a21afa82924a1a2afa6a4a760791b604082015290565b50505050505050505050508091505050604051614761604082613756565b601d81527f56616c69646174696f6e20313a207369676e617475726520656d707479000000602082015290565b505050505050505050505080915050506040516147ac606082613756565b602281527f56616c69646174696f6e20313a20636f6e747261637448617368206973207a65602082015261726f60f01b604082015290565b50505050505050505050508091505050604051614802604082613756565b601e81527f56616c69646174696f6e20313a206274635072696365206973207a65726f0000602082015290565b5050505050505050505050809150505060405161484d604082613756565b601d81527f56616c69646174696f6e20313a206e657744656274206973207a65726f000000602082015290565b50505050505050505050508091505050604051614898604082613756565b602081527f56616c69646174696f6e20313a206d696e74416d6f756e74206973207a65726f602082015290565b505050505050505050505080915050506040516148e3604082613756565b602081527f56616c69646174696f6e20313a20706f736974696f6e4964206973207a65726f602082015290565b9061491a82613945565b6149276040519182613756565b8281528092614938601f1991613945565b0190602036910137565b60008054604051638d34875560e01b815260048101849052936001600160a01b0390911692909184602481865afa93841561092a57600094614aad575b5060808401516001600160a01b031615614a7957604051926101606149a48186613756565b600a8552601f19013660208601376020806000960151602460405180948193631e1778ad60e11b835260048301525afa908115614a6e578591614a3c575b5003614a27575b8215926149f581614910565b9260005b828110614a0557505050565b8060ff614a1460019385613c81565b5116614a208288613c81565b52016149f9565b600192506002614a3683613c5e565b526149e9565b90506020813d602011614a66575b81614a5760209383613756565b8101031261332d5751386149e2565b3d9150614a4a565b6040513d87823e3d90fd5b50915050604080519190614a8d8184613756565b60018352601f19013660208401376001614aa683613c5e565b5260009190565b614ac39194503d806000833e610ae88183613756565b923861497f565b60008054604051632a6bc2dd60e01b81526001600160a01b03938416600482015293959194939192168482602481845afa91821561092a57600092614c60575b50815193848710801590614c58575b614c335760328111614c2b575b614b309087613be7565b86858211614c23575b614b4291613e05565b91614b4c83614910565b9660005b848110614b5e575050505050565b614b71614b6b8284613be7565b84613c81565b5180614b7d838c613c81565b5260405190638d34875560e01b82526004820152600081602481885afa801561092a5761012091600091614c0a575b50015160088110156113f457600281149060008215614bff575b8215614bf0575b5050614bdc575b600101614b50565b96614be8600191613c95565b979050614bd4565b9091506113f457153880614bcd565b600182149250614bc6565b614c1d913d8091833e610ae88183613756565b38614bac565b859150614b39565b506032614b26565b50505092509050604051614c48602082613756565b6000815260003681379160009190565b508015614b19565b614c769192503d806000833e61091c8183613756565b9038614b0a565b6006546001600160a01b0316908115614d355760405163f609844d60e01b8152602081600481865afa90811561092a57600491602091600091614d18575b50936040519283809263074e13b960e01b82525afa90811561092a57600091614ce6575b5090600090565b90506020813d602011614d10575b81614d0160209383613756565b810103126102f2575138614cdf565b3d9150614cf4565b614d2f9150823d8411610e6557610e578183613756565b38614cbb565b6000915081908190565b6006546001600160a01b0316916000918315614e385760405190633087c5cf60e01b82526004820152602081602481875afa90811561092a57600091614e06575b50600460208295604051928380926285d89b60e21b82525afa90811561092a57600091614dd4575b5080614db2575050565b9091925061271082029180830461271014901517156116ce57613cfd91613ca4565b906020823d602011614dfe575b81614dee60209383613756565b8101031261167f57505138614da8565b3d9150614de1565b906020823d602011614e30575b81614e2060209383613756565b8101031261167f57505138614d80565b3d9150614e13565b5060009250829150565b6001600160a01b03168015614e9e57602060049160405192838092635c975abb60e01b82525afa60009181614e7d575b50613cfd5750600090565b614e9791925060203d602011610e6557610e578183613756565b9038614e72565b50600090565b6001600160a01b03168015614e9e5760206004916040519283809263d53dc73960e01b82525afa60009181614e7d5750613cfd5750600090565b6005546040516303e1469160e61b815290602090829060049082906001600160a01b03165afa8091600091614f26575b5090614f1a5750600090565b6001600160a01b031690565b6020813d602011614f64575b81614f3f60209383613756565b81010312614f605751906001600160a01b038216820361167f575038614f0e565b5080fd5b3d9150614f32565b60015460405163eb373f3f60e01b815290602090829060049082906001600160a01b03165afa8091600091614f26575090614f1a5750600090565b600054604051638998b7cf60e01b815290602090829060049082906001600160a01b03165afa8091600091614f26575090614f1a5750600090565b60015460405163b1d3354f60e01b815290602090829060049082906001600160a01b03165afa6000918161501b5750613cfd5750600090565b9091506020813d602011615048575b8161503760209383613756565b810103126102f257614e97906139d5565b3d915061502a565b60015460405163023b2a9f60e31b815290602090829060049082906001600160a01b03165afa6000918161501b5750613cfd5750600090565b60055460405163db19e96360e01b815290602090829060049082906001600160a01b03165afa6000918161501b5750613cfd5750600090565b60008181526000805160206159f28339815191526020908152604080832033845290915290205460ff16156150f45750565b63e2517d3f60e01b6000523360045260245260446000fd5b615116828261551b565b918261512157505090565b60009182526000805160206159328339815191526020526040909120615150916001600160a01b031690615774565b5090565b61515e82826155c4565b918261516957505090565b60009182526000805160206159328339815191526020526040909120615150916001600160a01b0316906157dd565b60ff600080516020615a1283398151915254166151b157565b63d93c066560e01b60005260046000fd5b90660775f05a07400082116116ac57662386f26fc10000811161169b5781158015908161521f575b5061520e576151f891613bd4565b6064810290808204606414901517156116ce5790565b63450d49cd60e01b60005260046000fd5b9050613cae5760648260001904048111386151ea565b9080156152a45768327cb2734119d3b7a9601e1b821161168a577e068db8bac710cb295e9e1b089a027525460aa64c2f837b4a2339c0ebedfa4382116152935761271082029180830461271014901517156116ce57613cfd91613ca4565b633da428df60e21b60005260046000fd5b6323d359a360e01b60005260046000fd5b60015460405163b1d3354f60e01b81526001600160a01b0390911690602081600481855afa60009181615339575b506152ef575050600090565b600554600454604080516001600160a01b0393841660208201908152918101959095529082166060850152911660808084019190915282529061533360a082613756565b51902090565b9091506020813d60201161536d575b8161535560209383613756565b810103126102f257615366906139d5565b90386152e3565b3d9150615348565b908151811015613c6b570160200190565b60405190615395608083613756565b60428252602082016060368237825115613c6b5760309053815160011015613c6b576078602183015360005b602081106153ce57505090565b81811a6153e060ff8260041c16615704565b908260011b91838304600214841517156116ce578260020191826002116116ce5761541c92615415600f9360001a9189615375565b5316615704565b600091600301918260031161544357600193929161543c911a9186615375565b53016153c1565b634e487b7160e01b81526011600452602490fd5b80156154fb5780816000925b6154e5575061547182613779565b9161547f6040519384613756565b80835281601f1961548f83613779565b013660208601375b6154a057505090565b60001981019081116116ce578091600a810660300191826030116116ce57600a9260f81b6001600160f81b03191660001a906154dc9086615375565b53049081615497565b90916154f2600a91613c95565b92910480615463565b5060405161550a604082613756565b60018152600360fc1b602082015290565b60008181526000805160206159f2833981519152602090815260408083206001600160a01b038616845290915290205460ff166155bd5760008181526000805160206159f2833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19166001179055339291907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a4600190565b5050600090565b60008181526000805160206159f2833981519152602090815260408083206001600160a01b038616845290915290205460ff16156155bd5760008181526000805160206159f2833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19169055339291907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9080a4600190565b9181156156e45768327cb2734119d3b7a9601e1b831161168a577e068db8bac710cb295e9e1b089a027525460aa64c2f837b4a2339c0ebedfa438311615293576000826000190482116156d55761271084029380850461271014901517156154435750906156d191613bd4565b1190565b633da428df60e21b8152600490fd5b505050600090565b8054821015613c6b5760005260206000200190600090565b60ff16600a81101561572b5760300160ff81116116ce5760f81b6001600160f81b03191690565b60570160ff81116116ce5760f81b6001600160f81b03191690565b60ff600080516020615a528339815191525460401c161561576357565b631afcd79f60e31b60005260046000fd5b60018101908260005281602052604060002054156000146156e4578054600160401b81101561242b576157c86157b18260018794018555846156ec565b819391549060031b91821b91600019901b19161790565b90555491600052602052604060002055600190565b90600182019181600052826020526040600020548015156000146158a75760001981018181116116ce5782546000198101919082116116ce57818103615870575b5050508054801561585a57600019019061583882826156ec565b8154906000199060031b1b191690555560005260205260006040812055600190565b634e487b7160e01b600052603160045260246000fd5b6158906158806157b193866156ec565b90549060031b1c928392866156ec565b90556000528360205260406000205538808061581e565b50505050600090565b906158d657508051156158c557602081519101fd5b63d6bda27560e01b60005260046000fd5b81511580615908575b6158e7575090565b639996b31560e01b60009081526001600160a01b0391909116600452602490fd5b50803b156158df56fe0073bca384c5694c6e96fcd606b93d29d3f9c8294a3638967da39aea012c8e58c1f6fe24621ce81ec5827caf0253cadb74709b061630e6b55e8237170593200056616c69646174696f6e20363a207175616e74756d54696d657374616d702074c7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d275027301df982f5215b4963a854cf9c73219df80cb6acd8f098189c9480c7bbc360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc17dc5b1290f7495d7f8cc68476e6941aaf510598fa925d0d2720edc8805a846c02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800cd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300a49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00a164736f6c6343000822000a";
|
|
77720
77804
|
var isSuperArgs3 = (xs) => xs.length > 1;
|
|
77721
|
-
var PositionManagerViews__factory = class extends
|
|
77805
|
+
var PositionManagerViews__factory = class extends import_ethers34.ContractFactory {
|
|
77722
77806
|
constructor(...args) {
|
|
77723
77807
|
if (isSuperArgs3(args)) {
|
|
77724
77808
|
super(...args);
|
|
@@ -77738,10 +77822,10 @@ var PositionManagerViews__factory = class extends import_ethers33.ContractFactor
|
|
|
77738
77822
|
static bytecode = _bytecode3;
|
|
77739
77823
|
static abi = _abi3;
|
|
77740
77824
|
static createInterface() {
|
|
77741
|
-
return new
|
|
77825
|
+
return new import_ethers34.Interface(_abi3);
|
|
77742
77826
|
}
|
|
77743
77827
|
static connect(address, runner) {
|
|
77744
|
-
return new
|
|
77828
|
+
return new import_ethers34.Contract(
|
|
77745
77829
|
address,
|
|
77746
77830
|
_abi3,
|
|
77747
77831
|
runner
|
|
@@ -77759,7 +77843,7 @@ var SET_DELEGATE_GATE_ABI = [
|
|
|
77759
77843
|
"function delegateBurned(address delegate) view returns (bool)"
|
|
77760
77844
|
];
|
|
77761
77845
|
async function getSetDelegateBlocker(delegate, provider, registryAddress) {
|
|
77762
|
-
const registry = new
|
|
77846
|
+
const registry = new import_ethers35.Contract(
|
|
77763
77847
|
registryAddress,
|
|
77764
77848
|
SET_DELEGATE_GATE_ABI,
|
|
77765
77849
|
provider
|
|
@@ -77776,7 +77860,7 @@ async function getSetDelegateBlocker(delegate, provider, registryAddress) {
|
|
|
77776
77860
|
return null;
|
|
77777
77861
|
}
|
|
77778
77862
|
async function setPositionDelegate(positionId, delegate, signer, registryAddress) {
|
|
77779
|
-
const registry = new
|
|
77863
|
+
const registry = new import_ethers35.Contract(
|
|
77780
77864
|
registryAddress,
|
|
77781
77865
|
POSITION_DELEGATE_REGISTRY_ABI,
|
|
77782
77866
|
signer
|
|
@@ -77784,7 +77868,7 @@ async function setPositionDelegate(positionId, delegate, signer, registryAddress
|
|
|
77784
77868
|
return registry["setPositionDelegate"](positionId, delegate);
|
|
77785
77869
|
}
|
|
77786
77870
|
async function getPositionDelegate(positionId, provider, registryAddress) {
|
|
77787
|
-
const registry = new
|
|
77871
|
+
const registry = new import_ethers35.Contract(
|
|
77788
77872
|
registryAddress,
|
|
77789
77873
|
POSITION_DELEGATE_REGISTRY_ABI,
|
|
77790
77874
|
provider
|
|
@@ -77991,9 +78075,13 @@ var SIGNABLE_FUNCTIONS2 = [
|
|
|
77991
78075
|
"function redeem(address stablecoin, uint256 ucdAmount, uint256 minStablecoinOut) external returns (uint256)",
|
|
77992
78076
|
// BitcoinWithdrawalAddressRegistry — `msg.sender` must be the borrower, so
|
|
77993
78077
|
// this too is client-only and never module-whitelisted.
|
|
77994
|
-
"function addAddress(string btcAddress) external"
|
|
78078
|
+
"function addAddress(string btcAddress) external",
|
|
78079
|
+
// StUSDCVault 1.1.0 — the hold-only UCD desk. Direct EOA calls like the PSM
|
|
78080
|
+
// pair (the vault pulls from `msg.sender`); never routed through AgentModule.
|
|
78081
|
+
"function sellUCD(uint256 amountUCD, uint256 minUSDC) external returns (uint256)",
|
|
78082
|
+
"function buyUCD(uint256 amountUSDC, uint256 minUCD) external returns (uint256)"
|
|
77995
78083
|
];
|
|
77996
|
-
var IFACE2 = new
|
|
78084
|
+
var IFACE2 = new import_ethers37.ethers.Interface(SIGNABLE_FUNCTIONS2);
|
|
77997
78085
|
function encodeSignable2(fn, args) {
|
|
77998
78086
|
return IFACE2.encodeFunctionData(fn, args);
|
|
77999
78087
|
}
|
|
@@ -78018,7 +78106,7 @@ function eqAddr2(a, b) {
|
|
|
78018
78106
|
if (!a || !b)
|
|
78019
78107
|
return false;
|
|
78020
78108
|
try {
|
|
78021
|
-
return
|
|
78109
|
+
return import_ethers38.ethers.getAddress(a) === import_ethers38.ethers.getAddress(b);
|
|
78022
78110
|
} catch {
|
|
78023
78111
|
return false;
|
|
78024
78112
|
}
|
|
@@ -78084,7 +78172,7 @@ function readValue2(tx2) {
|
|
|
78084
78172
|
}
|
|
78085
78173
|
function normalizePositionId2(id) {
|
|
78086
78174
|
const hex = id.startsWith("0x") ? id : `0x${id}`;
|
|
78087
|
-
return
|
|
78175
|
+
return import_ethers38.ethers.zeroPadValue(hex, 32).toLowerCase();
|
|
78088
78176
|
}
|
|
78089
78177
|
function requirePositionId(actual, expected) {
|
|
78090
78178
|
const txPositionId = String(actual).toLowerCase();
|
|
@@ -78343,6 +78431,53 @@ function validateUnsignedTx2(unsignedTx, expected, vctx) {
|
|
|
78343
78431
|
}
|
|
78344
78432
|
break;
|
|
78345
78433
|
}
|
|
78434
|
+
case "desk-approve": {
|
|
78435
|
+
if (name !== "approve") {
|
|
78436
|
+
throw new TxValidationError2(`expected ERC-20 approve, decoded ${name}`);
|
|
78437
|
+
}
|
|
78438
|
+
if (!eqAddr2(to, expected.tokenAddress)) {
|
|
78439
|
+
throw new TxValidationError2(`approve must target the token (${expected.tokenAddress}), got ${to}`);
|
|
78440
|
+
}
|
|
78441
|
+
if (!eqAddr2(String(args[0]), expected.vaultAddress)) {
|
|
78442
|
+
throw new TxValidationError2(`approve spender must be the StUSDCVault (${expected.vaultAddress}), got ${String(args[0])}`);
|
|
78443
|
+
}
|
|
78444
|
+
if (BigInt(String(args[1])).toString() !== expected.amount) {
|
|
78445
|
+
throw new TxValidationError2(
|
|
78446
|
+
`approve amount must be EXACTLY ${expected.amount} (exact-amount rule), got ${BigInt(String(args[1]))}`
|
|
78447
|
+
);
|
|
78448
|
+
}
|
|
78449
|
+
break;
|
|
78450
|
+
}
|
|
78451
|
+
case "desk-sell": {
|
|
78452
|
+
if (name !== "sellUCD")
|
|
78453
|
+
throw new TxValidationError2(`expected sellUCD, decoded ${name}`);
|
|
78454
|
+
if (!eqAddr2(to, expected.vaultAddress)) {
|
|
78455
|
+
throw new TxValidationError2(`sellUCD must target the StUSDCVault (${expected.vaultAddress}), got ${to}`);
|
|
78456
|
+
}
|
|
78457
|
+
if (BigInt(String(args[0])).toString() !== expected.amountUcdWei)
|
|
78458
|
+
throw new TxValidationError2(`sellUCD amountUCD mismatch`);
|
|
78459
|
+
if (BigInt(String(args[1])).toString() !== expected.minUsdc)
|
|
78460
|
+
throw new TxValidationError2(`sellUCD minUSDC mismatch`);
|
|
78461
|
+
if (BigInt(expected.minUsdc) === 0n) {
|
|
78462
|
+
throw new TxValidationError2(`sellUCD minUSDC is 0 \u2014 a slippage floor is mandatory`);
|
|
78463
|
+
}
|
|
78464
|
+
break;
|
|
78465
|
+
}
|
|
78466
|
+
case "desk-buy": {
|
|
78467
|
+
if (name !== "buyUCD")
|
|
78468
|
+
throw new TxValidationError2(`expected buyUCD, decoded ${name}`);
|
|
78469
|
+
if (!eqAddr2(to, expected.vaultAddress)) {
|
|
78470
|
+
throw new TxValidationError2(`buyUCD must target the StUSDCVault (${expected.vaultAddress}), got ${to}`);
|
|
78471
|
+
}
|
|
78472
|
+
if (BigInt(String(args[0])).toString() !== expected.amountUsdc)
|
|
78473
|
+
throw new TxValidationError2(`buyUCD amountUSDC mismatch`);
|
|
78474
|
+
if (BigInt(String(args[1])).toString() !== expected.minUcdWei)
|
|
78475
|
+
throw new TxValidationError2(`buyUCD minUCD mismatch`);
|
|
78476
|
+
if (BigInt(expected.minUcdWei) === 0n) {
|
|
78477
|
+
throw new TxValidationError2(`buyUCD minUCD is 0 \u2014 a slippage floor is mandatory`);
|
|
78478
|
+
}
|
|
78479
|
+
break;
|
|
78480
|
+
}
|
|
78346
78481
|
default: {
|
|
78347
78482
|
const _exhaustive = expected;
|
|
78348
78483
|
throw new TxValidationError2(`unhandled expected action kind: ${JSON.stringify(_exhaustive)}`);
|
|
@@ -78376,18 +78511,18 @@ function buildPsmRedeemTx2(p) {
|
|
|
78376
78511
|
var PSM_READS_ABI = ["function supportedStablecoins(address) view returns (bool)"];
|
|
78377
78512
|
var ERC20_READS_ABI = ["function allowance(address owner, address spender) view returns (uint256)"];
|
|
78378
78513
|
function psmExchangeReadsFromProvider(provider, psmAddress) {
|
|
78379
|
-
const psm = new
|
|
78514
|
+
const psm = new import_ethers36.ethers.Contract(psmAddress, PSM_READS_ABI, provider);
|
|
78380
78515
|
return {
|
|
78381
78516
|
isStablecoinSupported: async (stablecoin) => await psm.getFunction("supportedStablecoins")(stablecoin),
|
|
78382
|
-
allowance: async (token, owner, spender) => await new
|
|
78517
|
+
allowance: async (token, owner, spender) => await new import_ethers36.ethers.Contract(token, ERC20_READS_ABI, provider).getFunction("allowance")(owner, spender)
|
|
78383
78518
|
};
|
|
78384
78519
|
}
|
|
78385
78520
|
var refuse = (direction, msg) => new TxValidationError2(msg, `PSM ${direction}`);
|
|
78386
78521
|
function requireAddress(direction, label, value) {
|
|
78387
|
-
if (!value || !
|
|
78522
|
+
if (!value || !import_ethers36.ethers.isAddress(value)) {
|
|
78388
78523
|
throw refuse(direction, `${label} address is missing or invalid (${String(value)})`);
|
|
78389
78524
|
}
|
|
78390
|
-
return
|
|
78525
|
+
return import_ethers36.ethers.getAddress(value);
|
|
78391
78526
|
}
|
|
78392
78527
|
async function planPsmExchange(params) {
|
|
78393
78528
|
const { direction, amountIn, minOut, vctx, reads } = params;
|
|
@@ -78469,6 +78604,203 @@ async function executePsmPlan(plan, signer, vctx) {
|
|
|
78469
78604
|
});
|
|
78470
78605
|
return { ...exec, approvalHashes };
|
|
78471
78606
|
}
|
|
78607
|
+
var DESK_ABI = [
|
|
78608
|
+
"function quoteSellUCD(uint256 amountUCD) view returns (uint256 usdcOut, uint256 feeE18)",
|
|
78609
|
+
"function sellUCD(uint256 amountUCD, uint256 minUSDC) returns (uint256 usdcOut)",
|
|
78610
|
+
"function buyUCD(uint256 amountUSDC, uint256 minUCD) returns (uint256 ucdOut)",
|
|
78611
|
+
"function halted() view returns (bool)",
|
|
78612
|
+
"function haltReasons() view returns (bool psmPaused, bool redeemOff, bool reservesShort, bool oracleUnhealthy, bool unconfigured)",
|
|
78613
|
+
"function markE18() view returns (uint256)",
|
|
78614
|
+
"function freeUsdc() view returns (uint256)",
|
|
78615
|
+
"function deskParams() view returns ((uint256 iMax, uint256 sMax, uint256 rMin, uint32 haircutBps, uint32 feeSlopeBps, uint32 feeCapBps, uint32 reserveCoverageBps))",
|
|
78616
|
+
"function deskState() view returns (uint256 inventoryUCD, uint256 stUCDShares, uint256 claimableReserve, uint64 currentEpoch, uint64 oldestOpenEpoch, address backingOracle, address stUcd, address ucd)",
|
|
78617
|
+
"function exitsFrozen() view returns (bool)",
|
|
78618
|
+
"function paused() view returns (bool)",
|
|
78619
|
+
// IStUSDCDesk errors on the trade path.
|
|
78620
|
+
"error DeskHalted()",
|
|
78621
|
+
"error ZeroDeskAmount()",
|
|
78622
|
+
"error InventoryCapExceeded(uint256 inventoryAfter, uint256 iMax)",
|
|
78623
|
+
"error InsufficientLiquidity(uint256 free, uint256 needed)",
|
|
78624
|
+
"error InsufficientInventory(uint256 available, uint256 needed)",
|
|
78625
|
+
"error SlippageExceeded(uint256 out, uint256 min)",
|
|
78626
|
+
// StUSDCVault / OpenZeppelin gates the desk shares.
|
|
78627
|
+
"error ExitsAreFrozen(uint40 until)",
|
|
78628
|
+
"error EnforcedPause()"
|
|
78629
|
+
];
|
|
78630
|
+
function buildDeskApproveTx(p) {
|
|
78631
|
+
return {
|
|
78632
|
+
to: p.token,
|
|
78633
|
+
data: encodeSignable2("approve", [p.vault, p.amount]),
|
|
78634
|
+
value: "0x0",
|
|
78635
|
+
chainId: p.chainId
|
|
78636
|
+
};
|
|
78637
|
+
}
|
|
78638
|
+
function buildDeskSellTx(p) {
|
|
78639
|
+
return {
|
|
78640
|
+
to: p.vault,
|
|
78641
|
+
data: encodeSignable2("sellUCD", [p.amountUCD, p.minUSDC]),
|
|
78642
|
+
value: "0x0",
|
|
78643
|
+
chainId: p.chainId
|
|
78644
|
+
};
|
|
78645
|
+
}
|
|
78646
|
+
function buildDeskBuyTx(p) {
|
|
78647
|
+
return {
|
|
78648
|
+
to: p.vault,
|
|
78649
|
+
data: encodeSignable2("buyUCD", [p.amountUSDC, p.minUCD]),
|
|
78650
|
+
value: "0x0",
|
|
78651
|
+
chainId: p.chainId
|
|
78652
|
+
};
|
|
78653
|
+
}
|
|
78654
|
+
var ERC20_READS_ABI2 = ["function allowance(address owner, address spender) view returns (uint256)"];
|
|
78655
|
+
function deskReadsFromProvider(provider, vaultAddress) {
|
|
78656
|
+
const vault = new import_ethers39.ethers.Contract(vaultAddress, DESK_ABI, provider);
|
|
78657
|
+
return {
|
|
78658
|
+
quoteSellUCD: async (amountUCD) => {
|
|
78659
|
+
const r = await vault.getFunction("quoteSellUCD").staticCall(amountUCD);
|
|
78660
|
+
return { usdcOut: r[0], feeE18: r[1] };
|
|
78661
|
+
},
|
|
78662
|
+
status: async () => {
|
|
78663
|
+
const [halted, reasons, paused, exitsFrozen, markE18, freeUsdc, params, state] = await Promise.all([
|
|
78664
|
+
vault.getFunction("halted")(),
|
|
78665
|
+
vault.getFunction("haltReasons")(),
|
|
78666
|
+
vault.getFunction("paused")(),
|
|
78667
|
+
vault.getFunction("exitsFrozen")(),
|
|
78668
|
+
vault.getFunction("markE18")(),
|
|
78669
|
+
vault.getFunction("freeUsdc")(),
|
|
78670
|
+
vault.getFunction("deskParams")(),
|
|
78671
|
+
vault.getFunction("deskState")()
|
|
78672
|
+
]);
|
|
78673
|
+
return {
|
|
78674
|
+
halted,
|
|
78675
|
+
reasons: {
|
|
78676
|
+
psmPaused: reasons[0],
|
|
78677
|
+
redeemOff: reasons[1],
|
|
78678
|
+
reservesShort: reasons[2],
|
|
78679
|
+
oracleUnhealthy: reasons[3],
|
|
78680
|
+
unconfigured: reasons[4]
|
|
78681
|
+
},
|
|
78682
|
+
paused,
|
|
78683
|
+
exitsFrozen,
|
|
78684
|
+
markE18,
|
|
78685
|
+
freeUsdc,
|
|
78686
|
+
params: {
|
|
78687
|
+
iMax: params[0],
|
|
78688
|
+
sMax: params[1],
|
|
78689
|
+
rMin: params[2],
|
|
78690
|
+
haircutBps: Number(params[3]),
|
|
78691
|
+
feeSlopeBps: Number(params[4]),
|
|
78692
|
+
feeCapBps: Number(params[5]),
|
|
78693
|
+
reserveCoverageBps: Number(params[6])
|
|
78694
|
+
},
|
|
78695
|
+
state: {
|
|
78696
|
+
inventoryUCD: state[0],
|
|
78697
|
+
stUCDShares: state[1],
|
|
78698
|
+
claimableReserve: state[2],
|
|
78699
|
+
currentEpoch: state[3],
|
|
78700
|
+
oldestOpenEpoch: state[4],
|
|
78701
|
+
backingOracle: state[5],
|
|
78702
|
+
stUcd: state[6],
|
|
78703
|
+
ucd: state[7]
|
|
78704
|
+
}
|
|
78705
|
+
};
|
|
78706
|
+
},
|
|
78707
|
+
allowance: async (token, owner, spender) => await new import_ethers39.ethers.Contract(token, ERC20_READS_ABI2, provider).getFunction("allowance")(owner, spender)
|
|
78708
|
+
};
|
|
78709
|
+
}
|
|
78710
|
+
var refuse2 = (direction, msg) => new TxValidationError2(msg, `desk ${direction}`);
|
|
78711
|
+
function requireAddress2(direction, label, value) {
|
|
78712
|
+
if (!value || !import_ethers39.ethers.isAddress(value)) {
|
|
78713
|
+
throw refuse2(direction, `${label} address is missing or invalid (${String(value)})`);
|
|
78714
|
+
}
|
|
78715
|
+
return import_ethers39.ethers.getAddress(value);
|
|
78716
|
+
}
|
|
78717
|
+
async function planDesk(params) {
|
|
78718
|
+
const { direction, amountIn, minOut, vctx, reads } = params;
|
|
78719
|
+
const chainId = vctx.chainId;
|
|
78720
|
+
if (amountIn <= 0n) {
|
|
78721
|
+
throw refuse2(direction, `amount must be greater than zero (got ${amountIn})`);
|
|
78722
|
+
}
|
|
78723
|
+
if (minOut <= 0n) {
|
|
78724
|
+
throw refuse2(direction, `minimum-out floor must be greater than zero (got ${minOut}) \u2014 a zero floor is refused`);
|
|
78725
|
+
}
|
|
78726
|
+
const owner = requireAddress2(direction, "owner", params.owner);
|
|
78727
|
+
const vault = requireAddress2(direction, "StUSDCVault", params.vault);
|
|
78728
|
+
const token = requireAddress2(direction, params.tokenLabel, params.token);
|
|
78729
|
+
const approveExpected = (amount) => ({
|
|
78730
|
+
kind: "desk-approve",
|
|
78731
|
+
tokenAddress: token,
|
|
78732
|
+
vaultAddress: vault,
|
|
78733
|
+
amount: amount.toString()
|
|
78734
|
+
});
|
|
78735
|
+
const allowanceBefore = await reads.allowance(token, owner, vault);
|
|
78736
|
+
const approvals = [];
|
|
78737
|
+
if (allowanceBefore < amountIn) {
|
|
78738
|
+
if (allowanceBefore > 0n) {
|
|
78739
|
+
approvals.push({
|
|
78740
|
+
step: "reset-approve",
|
|
78741
|
+
tx: buildDeskApproveTx({ token, vault, amount: 0n, chainId }),
|
|
78742
|
+
expected: approveExpected(0n)
|
|
78743
|
+
});
|
|
78744
|
+
}
|
|
78745
|
+
approvals.push({
|
|
78746
|
+
step: "approve",
|
|
78747
|
+
tx: buildDeskApproveTx({ token, vault, amount: amountIn, chainId }),
|
|
78748
|
+
expected: approveExpected(amountIn)
|
|
78749
|
+
});
|
|
78750
|
+
}
|
|
78751
|
+
const exec = direction === "sell" ? {
|
|
78752
|
+
step: "sell",
|
|
78753
|
+
tx: buildDeskSellTx({ vault, amountUCD: amountIn, minUSDC: minOut, chainId }),
|
|
78754
|
+
expected: { kind: "desk-sell", vaultAddress: vault, amountUcdWei: amountIn.toString(), minUsdc: minOut.toString() }
|
|
78755
|
+
} : {
|
|
78756
|
+
step: "buy",
|
|
78757
|
+
tx: buildDeskBuyTx({ vault, amountUSDC: amountIn, minUCD: minOut, chainId }),
|
|
78758
|
+
expected: { kind: "desk-buy", vaultAddress: vault, amountUsdc: amountIn.toString(), minUcdWei: minOut.toString() }
|
|
78759
|
+
};
|
|
78760
|
+
for (const leg of [...approvals, exec]) {
|
|
78761
|
+
validateUnsignedTx2({ ...leg.tx }, leg.expected, vctx);
|
|
78762
|
+
}
|
|
78763
|
+
return { direction, owner, vault, token, amountIn, minOut, allowanceBefore, approvals, exec };
|
|
78764
|
+
}
|
|
78765
|
+
function planDeskSell(params) {
|
|
78766
|
+
return planDesk({
|
|
78767
|
+
direction: "sell",
|
|
78768
|
+
owner: params.owner,
|
|
78769
|
+
vault: params.addresses.vault,
|
|
78770
|
+
token: params.addresses.ucdToken,
|
|
78771
|
+
tokenLabel: "UCDToken",
|
|
78772
|
+
amountIn: params.amountUCD,
|
|
78773
|
+
minOut: params.minUSDC,
|
|
78774
|
+
vctx: params.vctx,
|
|
78775
|
+
reads: params.reads
|
|
78776
|
+
});
|
|
78777
|
+
}
|
|
78778
|
+
async function executeDeskPlan(plan, signer, vctx) {
|
|
78779
|
+
const approvalHashes = [];
|
|
78780
|
+
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.`;
|
|
78781
|
+
const sendLeg = async (leg) => {
|
|
78782
|
+
const request = { to: leg.tx.to, data: leg.tx.data, value: 0n, chainId: leg.tx.chainId };
|
|
78783
|
+
validateUnsignedTx2({ ...request }, leg.expected, vctx);
|
|
78784
|
+
const sent = await signer.sendTransaction(request);
|
|
78785
|
+
const receipt = await sent.wait();
|
|
78786
|
+
if (!receipt)
|
|
78787
|
+
throw new Error(`desk ${leg.step} tx ${sent.hash} returned no receipt`);
|
|
78788
|
+
if (receipt.status !== 1)
|
|
78789
|
+
throw new Error(`desk ${leg.step} tx ${sent.hash} reverted`);
|
|
78790
|
+
return { hash: sent.hash, blockNumber: receipt.blockNumber };
|
|
78791
|
+
};
|
|
78792
|
+
for (const leg of plan.approvals) {
|
|
78793
|
+
const landed = await sendLeg(leg).catch((e) => {
|
|
78794
|
+
throw new Error(`desk ${leg.step} failed: ${e instanceof Error ? e.message : String(e)}.${residual()}`);
|
|
78795
|
+
});
|
|
78796
|
+
approvalHashes.push(landed.hash);
|
|
78797
|
+
}
|
|
78798
|
+
const exec = await sendLeg(plan.exec).catch((e) => {
|
|
78799
|
+
throw new Error(`desk ${plan.exec.step} failed: ${e instanceof Error ? e.message : String(e)}.${residual()}`);
|
|
78800
|
+
});
|
|
78801
|
+
return { ...exec, approvalHashes };
|
|
78802
|
+
}
|
|
78803
|
+
init_deployment_addresses();
|
|
78472
78804
|
var LIT_ACTION_CHAIN_NAMES = Object.freeze({
|
|
78473
78805
|
1: "ethereum",
|
|
78474
78806
|
11155111: "sepolia",
|
|
@@ -78707,14 +79039,18 @@ function formatLiquidationFailureMessage(loanId, errorMessage, btcVault, btcVaul
|
|
|
78707
79039
|
var CONTRACT_ERROR_FRAGMENTS = [
|
|
78708
79040
|
{ fragment: "error AboveMaxRedeem(uint256 amount, uint256 maximum)", contracts: ["SimplePSMV2"] },
|
|
78709
79041
|
{ fragment: "error AboveMaxSwap(uint256 amount, uint256 maximum)", contracts: ["SimplePSMV2"] },
|
|
78710
|
-
{ fragment: "error AccessControlBadConfirmation()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
78711
|
-
{ fragment: "error AccessControlUnauthorizedAccount(address account, bytes32 neededRole)", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
78712
|
-
{ fragment: "error AddressEmptyCode(address target)", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
79042
|
+
{ fragment: "error AccessControlBadConfirmation()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
|
|
79043
|
+
{ fragment: "error AccessControlUnauthorizedAccount(address account, bytes32 neededRole)", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
|
|
79044
|
+
{ fragment: "error AddressEmptyCode(address target)", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
|
|
78713
79045
|
{ fragment: "error AlreadyActive()", contracts: ["PositionManagerErrors"] },
|
|
79046
|
+
{ fragment: "error AlreadyClaimed()", contracts: ["StUSDCVault"] },
|
|
79047
|
+
{ fragment: "error AlreadySeeded()", contracts: ["StUSDCVault"] },
|
|
78714
79048
|
{ fragment: "error AlreadySigned()", contracts: ["PositionManagerErrors", "OperationAuthorizationRegistry"] },
|
|
78715
79049
|
{ fragment: "error AmountMustBePositive()", contracts: ["LoanOperationsManagerModule", "SimplePSMV2"] },
|
|
78716
79050
|
{ fragment: "error ArrayLengthMismatch()", contracts: ["BTCSpendAuthorizer", "SimplePSMV2"] },
|
|
79051
|
+
{ fragment: "error AssetMismatch()", contracts: ["StUSDCVault"] },
|
|
78717
79052
|
{ fragment: "error BTCSpendAuthorizerNotSet()", contracts: ["LoanOperationsManagerModule"] },
|
|
79053
|
+
{ fragment: "error BadRecoveryDestination(address to)", contracts: ["StUSDCVault"] },
|
|
78718
79054
|
{ fragment: "error BalanceMismatch()", contracts: ["UCDController"] },
|
|
78719
79055
|
{ fragment: "error BatchSizeTooLarge()", contracts: ["BTCSpendAuthorizer"] },
|
|
78720
79056
|
{ fragment: "error BelowMinRedeem(uint256 amount, uint256 minimum)", contracts: ["SimplePSMV2"] },
|
|
@@ -78729,7 +79065,7 @@ var CONTRACT_ERROR_FRAGMENTS = [
|
|
|
78729
79065
|
{ fragment: "error BurnGuardFailed(uint8 code)", contracts: ["UCDController"] },
|
|
78730
79066
|
{ fragment: "error BurnVerificationFailed()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
78731
79067
|
{ fragment: "error CannotRemoveLastTerm()", contracts: ["PositionManagerErrors"] },
|
|
78732
|
-
{ fragment: "error CannotUpgradeToSelf()", contracts: ["PositionManagerErrors", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer"] },
|
|
79068
|
+
{ fragment: "error CannotUpgradeToSelf()", contracts: ["PositionManagerErrors", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "StUSDCVault"] },
|
|
78733
79069
|
{ fragment: "error CircuitBreakerNotActive()", contracts: ["PositionManagerErrors"] },
|
|
78734
79070
|
{ fragment: "error CircuitBreakerTriggered()", contracts: ["PositionManagerErrors"] },
|
|
78735
79071
|
{ fragment: "error CollateralOverflow()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule"] },
|
|
@@ -78745,39 +79081,62 @@ var CONTRACT_ERROR_FRAGMENTS = [
|
|
|
78745
79081
|
{ fragment: "error DebtUpdateVerificationFailedDetailed(bytes32 positionId, uint256 currentDebt, uint256 newDebt, uint256 quantumTimestamp, uint256 supplyAfterMint, uint256 expectedIncrease)", contracts: ["LoanOperationsManagerModule"] },
|
|
78746
79082
|
{ fragment: "error DecimalsMismatch(uint8 provided, uint8 actual)", contracts: ["SimplePSMV2"] },
|
|
78747
79083
|
{ fragment: "error DecimalsQueryFailed()", contracts: ["SimplePSMV2"] },
|
|
79084
|
+
{ fragment: "error DeskHalted()", contracts: ["StUSDCVault"] },
|
|
79085
|
+
{ fragment: "error DeskParamOutOfRange()", contracts: ["StUSDCVault"] },
|
|
78748
79086
|
{ fragment: "error DivisionByZero()", contracts: ["PositionManager", "CollateralManagerModule"] },
|
|
78749
79087
|
{ fragment: "error ECDSAInvalidSignature()", contracts: ["BTCSpendAuthorizer"] },
|
|
78750
79088
|
{ fragment: "error ECDSAInvalidSignatureLength(uint256 length)", contracts: ["BTCSpendAuthorizer"] },
|
|
78751
79089
|
{ fragment: "error ECDSAInvalidSignatureS(bytes32 s)", contracts: ["BTCSpendAuthorizer"] },
|
|
78752
|
-
{ fragment: "error ERC1967InvalidImplementation(address implementation)", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
78753
|
-
{ fragment: "error ERC1967NonPayable()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
78754
|
-
{ fragment: "error
|
|
79090
|
+
{ fragment: "error ERC1967InvalidImplementation(address implementation)", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
|
|
79091
|
+
{ fragment: "error ERC1967NonPayable()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
|
|
79092
|
+
{ fragment: "error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed)", contracts: ["StUSDCVault"] },
|
|
79093
|
+
{ fragment: "error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed)", contracts: ["StUSDCVault"] },
|
|
79094
|
+
{ fragment: "error ERC20InvalidApprover(address approver)", contracts: ["StUSDCVault"] },
|
|
79095
|
+
{ fragment: "error ERC20InvalidReceiver(address receiver)", contracts: ["StUSDCVault"] },
|
|
79096
|
+
{ fragment: "error ERC20InvalidSender(address sender)", contracts: ["StUSDCVault"] },
|
|
79097
|
+
{ fragment: "error ERC20InvalidSpender(address spender)", contracts: ["StUSDCVault"] },
|
|
79098
|
+
{ fragment: "error ERC4626ExceededMaxDeposit(address receiver, uint256 assets, uint256 max)", contracts: ["StUSDCVault"] },
|
|
79099
|
+
{ fragment: "error ERC4626ExceededMaxMint(address receiver, uint256 shares, uint256 max)", contracts: ["StUSDCVault"] },
|
|
79100
|
+
{ fragment: "error ERC4626ExceededMaxRedeem(address owner, uint256 shares, uint256 max)", contracts: ["StUSDCVault"] },
|
|
79101
|
+
{ fragment: "error ERC4626ExceededMaxWithdraw(address owner, uint256 assets, uint256 max)", contracts: ["StUSDCVault"] },
|
|
79102
|
+
{ fragment: "error EnforcedPause()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
|
|
78755
79103
|
{ fragment: "error EntryFeeTooHigh(uint256 fee, uint256 max)", contracts: ["SimplePSMV2"] },
|
|
79104
|
+
{ fragment: "error EpochAlreadyPriced()", contracts: ["StUSDCVault"] },
|
|
79105
|
+
{ fragment: "error EpochNotComplete()", contracts: ["StUSDCVault"] },
|
|
79106
|
+
{ fragment: "error EpochNotOpen()", contracts: ["StUSDCVault"] },
|
|
78756
79107
|
{ fragment: "error ExceedsFeeBalance(uint256 requested, uint256 max)", contracts: ["SimplePSMV2"] },
|
|
78757
79108
|
{ fragment: "error ExceedsMaxLoan()", contracts: ["PositionManagerErrors"] },
|
|
79109
|
+
{ fragment: "error ExceedsUntracked(uint256 untracked, uint256 amount)", contracts: ["StUSDCVault"] },
|
|
78758
79110
|
{ fragment: "error ExitFeeTooHigh(uint256 fee, uint256 max)", contracts: ["SimplePSMV2"] },
|
|
78759
|
-
{ fragment: "error
|
|
79111
|
+
{ fragment: "error ExitsAreFrozen(uint40 until)", contracts: ["StUSDCVault"] },
|
|
79112
|
+
{ fragment: "error ExpectedPause()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
|
|
78760
79113
|
{ fragment: "error ExtensionFeeMintingFailed()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
78761
79114
|
{ fragment: "error ExtensionNotAllowed()", contracts: ["PositionManagerErrors"] },
|
|
78762
|
-
{ fragment: "error FailedCall()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
79115
|
+
{ fragment: "error FailedCall()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
|
|
78763
79116
|
{ fragment: "error FailedToGetStablecoinDecimals()", contracts: ["SimplePSMV2"] },
|
|
78764
79117
|
{ fragment: "error FailedToGetUCDDecimals()", contracts: ["SimplePSMV2"] },
|
|
78765
79118
|
{ fragment: "error FeeOnTransferNotSupported()", contracts: ["SimplePSMV2"] },
|
|
78766
79119
|
{ fragment: "error FeeTooHigh(uint256 fee, uint256 max)", contracts: ["PositionManagerErrors"] },
|
|
78767
79120
|
{ fragment: "error FeeTooLow(uint256 fee, uint256 min)", contracts: ["PositionManagerErrors"] },
|
|
79121
|
+
{ fragment: "error FreezeBoundOutOfRange(uint40 value, uint40 min, uint40 max)", contracts: ["StUSDCVault"] },
|
|
79122
|
+
{ fragment: "error FreezeCooldown(uint40 availableAt)", contracts: ["StUSDCVault"] },
|
|
79123
|
+
{ fragment: "error FreezeInPast(uint40 until)", contracts: ["StUSDCVault"] },
|
|
79124
|
+
{ fragment: "error FreezeTooLong(uint40 until, uint40 latestAllowed)", contracts: ["StUSDCVault"] },
|
|
78768
79125
|
{ fragment: "error GlobalReentrancyGuardReentrantCall()", contracts: ["PositionManager", "CollateralManagerModule"] },
|
|
78769
79126
|
{ fragment: "error ImplNotDeployed()", contracts: ["LoanOperationsManagerModule", "BTCSpendAuthorizer"] },
|
|
78770
|
-
{ fragment: "error ImplementationNotDeployed()", contracts: ["UCDController"] },
|
|
79127
|
+
{ fragment: "error ImplementationNotDeployed()", contracts: ["UCDController", "StUSDCVault"] },
|
|
78771
79128
|
{ fragment: "error InitialBalanceTooLarge()", contracts: ["SimplePSMV2"] },
|
|
78772
79129
|
{ fragment: "error InsufficientBalance()", contracts: ["PositionManagerErrors"] },
|
|
78773
79130
|
{ fragment: "error InsufficientCollateralForAmount()", contracts: ["PositionManagerErrors"] },
|
|
78774
79131
|
{ fragment: "error InsufficientCollateralRatio()", contracts: ["CollateralManagerModule"] },
|
|
78775
79132
|
{ fragment: "error InsufficientFeeBal()", contracts: ["LoanOperationsManagerModule"] },
|
|
79133
|
+
{ fragment: "error InsufficientInventory(uint256 available, uint256 needed)", contracts: ["StUSDCVault"] },
|
|
79134
|
+
{ fragment: "error InsufficientLiquidity(uint256 free, uint256 needed)", contracts: ["StUSDCVault"] },
|
|
78776
79135
|
{ fragment: "error InsufficientReserves(uint256 available, uint256 required)", contracts: ["SimplePSMV2"] },
|
|
78777
79136
|
{ fragment: "error InsufficientSignatures()", contracts: ["OperationAuthorizationRegistry"] },
|
|
78778
79137
|
{ fragment: "error IntegrityCheckFailed()", contracts: ["PositionManagerErrors"] },
|
|
78779
79138
|
{ fragment: "error InvalidActionHash()", contracts: ["CollateralManagerModule"] },
|
|
78780
|
-
{ fragment: "error InvalidAddress()", contracts: ["PositionManager", "PositionManagerErrors", "OperationAuthorizationRegistry", "CollateralManagerModule", "SimplePSMV2"] },
|
|
79139
|
+
{ fragment: "error InvalidAddress()", contracts: ["PositionManager", "PositionManagerErrors", "OperationAuthorizationRegistry", "CollateralManagerModule", "SimplePSMV2", "StUSDCVault"] },
|
|
78781
79140
|
{ fragment: "error InvalidAdmin()", contracts: ["LoanOperationsManagerModule", "BTCSpendAuthorizer", "SimplePSMV2"] },
|
|
78782
79141
|
{ fragment: "error InvalidAmount()", contracts: ["PositionManagerErrors", "SimplePSMV2"] },
|
|
78783
79142
|
{ fragment: "error InvalidBTCPrice()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
@@ -78788,7 +79147,7 @@ var CONTRACT_ERROR_FRAGMENTS = [
|
|
|
78788
79147
|
{ fragment: "error InvalidExchangeRate()", contracts: ["SimplePSMV2"] },
|
|
78789
79148
|
{ fragment: "error InvalidImpl()", contracts: ["LoanOperationsManagerModule", "BTCSpendAuthorizer"] },
|
|
78790
79149
|
{ fragment: "error InvalidImplementation()", contracts: ["UCDController"] },
|
|
78791
|
-
{ fragment: "error InvalidInitialization()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
79150
|
+
{ fragment: "error InvalidInitialization()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
|
|
78792
79151
|
{ fragment: "error InvalidLitSignature()", contracts: ["BTCSpendAuthorizer"] },
|
|
78793
79152
|
{ fragment: "error InvalidLoanOps()", contracts: ["BTCSpendAuthorizer"] },
|
|
78794
79153
|
{ fragment: "error InvalidModuleAddress()", contracts: ["UCDController"] },
|
|
@@ -78824,6 +79183,7 @@ var CONTRACT_ERROR_FRAGMENTS = [
|
|
|
78824
79183
|
{ fragment: "error InvalidVolumeCap(bool isRedeem)", contracts: ["SimplePSMV2"] },
|
|
78825
79184
|
{ fragment: "error InvalidWithdrawalAddress()", contracts: ["CollateralManagerModule"] },
|
|
78826
79185
|
{ fragment: "error InvalidWithdrawalLoanStatusType()", contracts: ["CollateralManagerModule"] },
|
|
79186
|
+
{ fragment: "error InventoryCapExceeded(uint256 totalUcdAfter, uint256 iMax)", contracts: ["StUSDCVault"] },
|
|
78827
79187
|
{ fragment: "error LiquidationsPaused()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
78828
79188
|
{ fragment: "error LoanAmountTooHigh()", contracts: ["PositionManagerErrors"] },
|
|
78829
79189
|
{ fragment: "error LoanAmountTooLow()", contracts: ["PositionManagerErrors"] },
|
|
@@ -78849,23 +79209,31 @@ var CONTRACT_ERROR_FRAGMENTS = [
|
|
|
78849
79209
|
{ fragment: "error NoVersion()", contracts: ["LoanOperationsManagerModule", "BTCSpendAuthorizer", "UCDController"] },
|
|
78850
79210
|
{ fragment: "error NonZeroReserves(address stablecoin, uint256 reserves)", contracts: ["SimplePSMV2"] },
|
|
78851
79211
|
{ fragment: "error NormalizationOverflow()", contracts: ["SimplePSMV2"] },
|
|
78852
|
-
{ fragment: "error
|
|
79212
|
+
{ fragment: "error NotATransferFee(bytes4 selector)", contracts: ["StUSDCVault"] },
|
|
79213
|
+
{ fragment: "error NotAdminModule()", contracts: ["PositionManager", "PositionManagerErrors", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
|
|
79214
|
+
{ fragment: "error NotArrived(uint256 available, uint256 amount)", contracts: ["StUSDCVault"] },
|
|
78853
79215
|
{ fragment: "error NotAuthorized()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
78854
79216
|
{ fragment: "error NotAuthorizedConsumer()", contracts: ["OperationAuthorizationRegistry"] },
|
|
78855
79217
|
{ fragment: "error NotAuthorizedSigner()", contracts: ["OperationAuthorizationRegistry"] },
|
|
78856
79218
|
{ fragment: "error NotBorrower()", contracts: ["PositionManager", "PositionManagerErrors", "LoanOperationsManagerModule"] },
|
|
79219
|
+
{ fragment: "error NotCarryReceiver(address caller)", contracts: ["StUSDCVault"] },
|
|
78857
79220
|
{ fragment: "error NotContract()", contracts: ["PositionManagerErrors", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "SimplePSMV2"] },
|
|
78858
|
-
{ fragment: "error
|
|
79221
|
+
{ fragment: "error NotController()", contracts: ["StUSDCVault"] },
|
|
79222
|
+
{ fragment: "error NotInitializing()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
|
|
78859
79223
|
{ fragment: "error NotLiquidationPkpOwner()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
78860
79224
|
{ fragment: "error NotLiquidator()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
78861
79225
|
{ fragment: "error NotOwner()", contracts: ["OperationAuthorizationRegistry"] },
|
|
78862
79226
|
{ fragment: "error NotPendingOwner()", contracts: ["OperationAuthorizationRegistry"] },
|
|
78863
79227
|
{ fragment: "error NotProductionAuthorizer()", contracts: ["PositionManagerErrors", "LoanOperationsManagerModule"] },
|
|
78864
79228
|
{ fragment: "error NotProductionRegistry()", contracts: ["PositionManager", "PositionManagerErrors", "LoanOperationsManagerModule"] },
|
|
79229
|
+
{ fragment: "error NotSeeded()", contracts: ["StUSDCVault"] },
|
|
79230
|
+
{ fragment: "error NotSeeder(address caller)", contracts: ["StUSDCVault"] },
|
|
79231
|
+
{ fragment: "error NothingToFulfil()", contracts: ["StUSDCVault"] },
|
|
78865
79232
|
{ fragment: "error OnlyCore()", contracts: ["CollateralManagerModule"] },
|
|
78866
79233
|
{ fragment: "error OnlyLoanOps()", contracts: ["BTCSpendAuthorizer"] },
|
|
78867
79234
|
{ fragment: "error OnlyPosMgr()", contracts: ["LoanOperationsManagerModule"] },
|
|
78868
79235
|
{ fragment: "error OnlyPositionManager()", contracts: ["LoanOperationsManagerModule"] },
|
|
79236
|
+
{ fragment: "error OpNotExecuted(bytes32 sweepId)", contracts: ["StUSDCVault"] },
|
|
78869
79237
|
{ fragment: "error OperationInProgress()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
78870
79238
|
{ fragment: "error OracleDecimalMismatch()", contracts: ["LoanOperationsManagerModule"] },
|
|
78871
79239
|
{ fragment: "error PKPAlreadyUsed()", contracts: ["PositionManagerErrors"] },
|
|
@@ -78873,6 +79241,7 @@ var CONTRACT_ERROR_FRAGMENTS = [
|
|
|
78873
79241
|
{ fragment: "error PaymentAmountZero()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
78874
79242
|
{ fragment: "error PaymentMustBeLessThanDebt()", contracts: ["LoanOperationsManagerModule"] },
|
|
78875
79243
|
{ fragment: "error PaymentMustBePositive()", contracts: ["LoanOperationsManagerModule"] },
|
|
79244
|
+
{ fragment: "error PeriodOutOfBounds(uint40 period, uint40 min, uint40 max)", contracts: ["StUSDCVault"] },
|
|
78876
79245
|
{ fragment: "error PositionAlreadyExists()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
78877
79246
|
{ fragment: "error PositionDoesNotExist()", contracts: ["CollateralManagerModule"] },
|
|
78878
79247
|
{ fragment: "error PositionLiquidatable()", contracts: ["PositionManagerErrors"] },
|
|
@@ -78903,22 +79272,29 @@ var CONTRACT_ERROR_FRAGMENTS = [
|
|
|
78903
79272
|
{ fragment: "error ReserveOverflow()", contracts: ["SimplePSMV2"] },
|
|
78904
79273
|
{ fragment: "error ReserveTooLarge()", contracts: ["SimplePSMV2"] },
|
|
78905
79274
|
{ fragment: "error ReserveUnderflow()", contracts: ["SimplePSMV2"] },
|
|
78906
|
-
{ fragment: "error
|
|
79275
|
+
{ fragment: "error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value)", contracts: ["StUSDCVault"] },
|
|
79276
|
+
{ fragment: "error SafeERC20FailedOperation(address token)", contracts: ["PositionManager", "LoanOperationsManagerModule", "SimplePSMV2", "StUSDCVault"] },
|
|
78907
79277
|
{ fragment: "error SameBlockInteraction()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
78908
79278
|
{ fragment: "error SameImpl()", contracts: ["LoanOperationsManagerModule", "BTCSpendAuthorizer"] },
|
|
78909
79279
|
{ fragment: "error SameImplementation()", contracts: ["PositionManagerErrors", "CollateralManagerModule"] },
|
|
79280
|
+
{ fragment: "error SeedTooSmall(uint256 amount, uint256 min)", contracts: ["StUSDCVault"] },
|
|
78910
79281
|
{ fragment: "error SignatureVerificationFailed(bytes4 selector, address recovered, address expected, bytes32 messageHash, uint8 errorCode)", contracts: ["OperationAuthorizationRegistry"] },
|
|
78911
79282
|
{ fragment: "error SlippageExceeded(uint256 got, uint256 minimum)", contracts: ["SimplePSMV2"] },
|
|
79283
|
+
{ fragment: "error SlippageExceeded(uint256 out, uint256 min)", contracts: ["StUSDCVault"] },
|
|
78912
79284
|
{ fragment: "error SlippageProtectionRequired()", contracts: ["SimplePSMV2"] },
|
|
79285
|
+
{ fragment: "error StUcdHeld()", contracts: ["StUSDCVault"] },
|
|
78913
79286
|
{ fragment: "error StablecoinAlreadySupported(address stablecoin)", contracts: ["SimplePSMV2"] },
|
|
78914
79287
|
{ fragment: "error StablecoinNotContract(address stablecoin)", contracts: ["SimplePSMV2"] },
|
|
78915
79288
|
{ fragment: "error StablecoinNotSupported(address stablecoin)", contracts: ["SimplePSMV2"] },
|
|
78916
79289
|
{ fragment: "error StablecoinNotSupportedInV1(address stablecoin)", contracts: ["SimplePSMV2"] },
|
|
79290
|
+
{ fragment: "error StakeCapExceeded(uint256 value, uint256 sMax)", contracts: ["StUSDCVault"] },
|
|
78917
79291
|
{ fragment: "error StaleAttestationMismatch()", contracts: ["BTCSpendAuthorizer"] },
|
|
78918
79292
|
{ fragment: "error StaleAttestationTooOld()", contracts: ["BTCSpendAuthorizer"] },
|
|
78919
79293
|
{ fragment: "error StaleSpendValidatorNotSet()", contracts: ["BTCSpendAuthorizer"] },
|
|
78920
79294
|
{ fragment: "error StateHashMismatch()", contracts: ["LoanOperationsValidation", "LoanOperationsManagerModule", "CollateralManagerModule"] },
|
|
78921
79295
|
{ fragment: "error SwapVolumeExceededThisBlock(address stablecoin, uint256 attempted, uint256 cap)", contracts: ["SimplePSMV2"] },
|
|
79296
|
+
{ fragment: "error SweepAlreadyCredited(bytes32 sweepId)", contracts: ["StUSDCVault"] },
|
|
79297
|
+
{ fragment: "error SweepMismatch()", contracts: ["StUSDCVault"] },
|
|
78922
79298
|
{ fragment: "error SyncDriftTooLarge()", contracts: ["SimplePSMV2"] },
|
|
78923
79299
|
{ fragment: "error TargetAddrRequired()", contracts: ["BTCSpendAuthorizer"] },
|
|
78924
79300
|
{ fragment: "error TargetExceedsInputValue()", contracts: ["BTCSpendAuthorizer"] },
|
|
@@ -78933,11 +79309,12 @@ var CONTRACT_ERROR_FRAGMENTS = [
|
|
|
78933
79309
|
{ fragment: "error TooManySigners()", contracts: ["OperationAuthorizationRegistry"] },
|
|
78934
79310
|
{ fragment: "error UTXOAlreadyAuthorized()", contracts: ["BTCSpendAuthorizer"] },
|
|
78935
79311
|
{ fragment: "error UTXONotAuthorized()", contracts: ["BTCSpendAuthorizer"] },
|
|
78936
|
-
{ fragment: "error UUPSUnauthorizedCallContext()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
78937
|
-
{ fragment: "error UUPSUnsupportedProxiableUUID(bytes32 slot)", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
79312
|
+
{ fragment: "error UUPSUnauthorizedCallContext()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
|
|
79313
|
+
{ fragment: "error UUPSUnsupportedProxiableUUID(bytes32 slot)", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
|
|
78938
79314
|
{ fragment: "error UcdAmountTooLarge()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule"] },
|
|
78939
79315
|
{ fragment: "error Unauthorized()", contracts: ["UCDController"] },
|
|
78940
|
-
{ fragment: "error UnexpectedRoleGrantFailure()", contracts: ["PositionManager", "PositionManagerErrors", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
79316
|
+
{ fragment: "error UnexpectedRoleGrantFailure()", contracts: ["PositionManager", "PositionManagerErrors", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
|
|
79317
|
+
{ fragment: "error UnknownSource(address target)", contracts: ["StUSDCVault"] },
|
|
78941
79318
|
{ fragment: "error UnsupportedFeeToken(address token)", contracts: ["SimplePSMV2"] },
|
|
78942
79319
|
{ fragment: "error UserDailyMintLimitExceeded()", contracts: ["LoanOperationsManagerModule"] },
|
|
78943
79320
|
{ fragment: "error V2AlreadyInitialized()", contracts: ["SimplePSMV2"] },
|
|
@@ -78946,32 +79323,29 @@ var CONTRACT_ERROR_FRAGMENTS = [
|
|
|
78946
79323
|
{ fragment: "error WithdrawalAddressNotApproved()", contracts: ["CollateralManagerModule"] },
|
|
78947
79324
|
{ fragment: "error WithdrawalExceedsReserves(uint256 amount, uint256 reserves)", contracts: ["SimplePSMV2"] },
|
|
78948
79325
|
{ fragment: "error ZeroAddress()", contracts: ["PositionManager", "UCDController"] },
|
|
78949
|
-
{ fragment: "error ZeroAmount()", contracts: ["UCDController"] }
|
|
79326
|
+
{ fragment: "error ZeroAmount()", contracts: ["UCDController", "StUSDCVault"] },
|
|
79327
|
+
{ fragment: "error ZeroDeskAmount()", contracts: ["StUSDCVault"] }
|
|
78950
79328
|
];
|
|
78951
79329
|
var TABLE = null;
|
|
78952
79330
|
function contractErrorTable() {
|
|
78953
79331
|
if (TABLE)
|
|
78954
79332
|
return TABLE;
|
|
78955
79333
|
const table2 = /* @__PURE__ */ new Map();
|
|
78956
|
-
const
|
|
78957
|
-
|
|
78958
|
-
CONTRACT_ERROR_FRAGMENTS.map((e) => [e.fragment.slice("error ".length, e.fragment.indexOf("(")), e.contracts])
|
|
78959
|
-
);
|
|
78960
|
-
iface.forEachError((fragment) => {
|
|
79334
|
+
for (const generated of CONTRACT_ERROR_FRAGMENTS) {
|
|
79335
|
+
const fragment = import_ethers40.ErrorFragment.from(generated.fragment);
|
|
78961
79336
|
const existing = table2.get(fragment.selector);
|
|
78962
|
-
const contracts = contractsByName.get(fragment.name) ?? [];
|
|
78963
79337
|
if (existing) {
|
|
78964
|
-
for (const c of contracts)
|
|
79338
|
+
for (const c of generated.contracts)
|
|
78965
79339
|
if (!existing.contracts.includes(c))
|
|
78966
79340
|
existing.contracts.push(c);
|
|
78967
|
-
|
|
79341
|
+
continue;
|
|
78968
79342
|
}
|
|
78969
79343
|
table2.set(fragment.selector, {
|
|
78970
79344
|
signature: fragment.format("sighash"),
|
|
78971
79345
|
fragment,
|
|
78972
|
-
contracts: [...contracts]
|
|
79346
|
+
contracts: [...generated.contracts]
|
|
78973
79347
|
});
|
|
78974
|
-
}
|
|
79348
|
+
}
|
|
78975
79349
|
TABLE = table2;
|
|
78976
79350
|
return table2;
|
|
78977
79351
|
}
|
|
@@ -79062,7 +79436,7 @@ function decodeContractError(error) {
|
|
|
79062
79436
|
const contract = entry.contracts.join(" | ");
|
|
79063
79437
|
let args = [];
|
|
79064
79438
|
try {
|
|
79065
|
-
const decoded = new
|
|
79439
|
+
const decoded = new import_ethers40.Interface([entry.fragment]).decodeErrorResult(entry.fragment, errorData);
|
|
79066
79440
|
args = Array.from(decoded);
|
|
79067
79441
|
} catch {
|
|
79068
79442
|
args = [];
|
|
@@ -79904,7 +80278,7 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
|
|
|
79904
80278
|
addEndpoint("config.provider", enrichedConfig.provider);
|
|
79905
80279
|
addEndpoint("the contractSigner's provider", enrichedConfig.contractSigner?.provider);
|
|
79906
80280
|
addEndpoint("the litOpsSigner's provider", enrichedConfig.litOpsSigner?.provider);
|
|
79907
|
-
if (enrichedConfig.ethRpcUrl?.trim()) {
|
|
80281
|
+
if (!enrichedConfig.provider && enrichedConfig.ethRpcUrl?.trim()) {
|
|
79908
80282
|
addEndpoint("ethRpcUrl", new import_ethers15.JsonRpcProvider(enrichedConfig.ethRpcUrl.trim()));
|
|
79909
80283
|
}
|
|
79910
80284
|
const refusal = await describeStandaloneMainnetRefusal(config.chainId, endpoints);
|
|
@@ -81243,15 +81617,13 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
|
|
|
81243
81617
|
signatureHexMint
|
|
81244
81618
|
]);
|
|
81245
81619
|
const fromAddress = await signer.getAddress();
|
|
81620
|
+
let mintSubmission;
|
|
81246
81621
|
try {
|
|
81247
|
-
await
|
|
81248
|
-
provider: signerProvider,
|
|
81622
|
+
mintSubmission = await this.prepareQuantumSend("mintUCD", {
|
|
81249
81623
|
to: positionManagerAddress,
|
|
81250
81624
|
from: fromAddress,
|
|
81251
81625
|
data: mintCalldata,
|
|
81252
|
-
quantumTimestamp: Number(validationResponse.timestamp)
|
|
81253
|
-
laneGuardActive: await this.isLocalLaneGuardActive(),
|
|
81254
|
-
onDebug: this.config.debug ? (msg) => log.info(msg, {}) : void 0
|
|
81626
|
+
quantumTimestamp: Number(validationResponse.timestamp)
|
|
81255
81627
|
});
|
|
81256
81628
|
} catch (simError) {
|
|
81257
81629
|
if (!(simError instanceof QuantumRevertError)) {
|
|
@@ -81269,7 +81641,7 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
|
|
|
81269
81641
|
[
|
|
81270
81642
|
"function diagnoseMintUCD(bytes32,uint256,uint256,uint256,uint256,uint256,bytes32,bytes32,bytes32,uint256,bytes) view returns (string)"
|
|
81271
81643
|
],
|
|
81272
|
-
|
|
81644
|
+
this.getProviderOrThrow()
|
|
81273
81645
|
);
|
|
81274
81646
|
diagnosis = await views["diagnoseMintUCD"](
|
|
81275
81647
|
request.positionId,
|
|
@@ -81376,7 +81748,7 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
|
|
|
81376
81748
|
feeProvider: this.getProviderOrThrow(),
|
|
81377
81749
|
to: positionManagerAddress,
|
|
81378
81750
|
data: mintCalldata,
|
|
81379
|
-
gasLimit:
|
|
81751
|
+
gasLimit: mintSubmission.gasLimit
|
|
81380
81752
|
});
|
|
81381
81753
|
const receipt = await signerProvider.waitForTransaction(
|
|
81382
81754
|
tx2.hash,
|
|
@@ -82037,16 +82409,26 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
|
|
|
82037
82409
|
if (this.config.debug) {
|
|
82038
82410
|
log.info(`\u{1F512} Executing commit phase...`);
|
|
82039
82411
|
}
|
|
82040
|
-
const
|
|
82412
|
+
const commitArgs = [
|
|
82041
82413
|
positionIdBytes32,
|
|
82042
82414
|
BigInt(quantumTimestamp.toString()),
|
|
82043
82415
|
BigInt(btcPrice.toString()),
|
|
82044
82416
|
BigInt(
|
|
82045
82417
|
(litActionResult.btcAmountSats || "0").toString()
|
|
82046
82418
|
),
|
|
82047
|
-
litActionResult.signature || "0x"
|
|
82048
|
-
|
|
82049
|
-
|
|
82419
|
+
litActionResult.signature || "0x"
|
|
82420
|
+
];
|
|
82421
|
+
const liquidationTarget = await positionManager.getAddress();
|
|
82422
|
+
const liquidationFrom = await this.getSignerOrThrow().getAddress();
|
|
82423
|
+
const commitSubmission = await this.prepareQuantumSend("commitLiquidation", {
|
|
82424
|
+
to: liquidationTarget,
|
|
82425
|
+
from: liquidationFrom,
|
|
82426
|
+
data: positionManager.interface.encodeFunctionData("commitLiquidation", [...commitArgs]),
|
|
82427
|
+
quantumTimestamp: Number(quantumTimestamp)
|
|
82428
|
+
});
|
|
82429
|
+
const commitTx = await positionManager["commitLiquidation"](
|
|
82430
|
+
...commitArgs,
|
|
82431
|
+
{ gasLimit: commitSubmission.gasLimit }
|
|
82050
82432
|
);
|
|
82051
82433
|
const commitReceipt = await commitTx.wait();
|
|
82052
82434
|
if (this.config.debug) {
|
|
@@ -82169,15 +82551,23 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
|
|
|
82169
82551
|
hasSignature: !!revealResult.signature
|
|
82170
82552
|
});
|
|
82171
82553
|
}
|
|
82172
|
-
const
|
|
82554
|
+
const revealArgs = [
|
|
82173
82555
|
positionIdBytes32,
|
|
82174
82556
|
revealQuantumTimestamp,
|
|
82175
82557
|
revealBtcPrice,
|
|
82176
82558
|
revealBtcAmountSats,
|
|
82177
82559
|
revealResult.signature || "0x",
|
|
82178
|
-
BigInt(revealDeadline.toString())
|
|
82179
|
-
|
|
82180
|
-
|
|
82560
|
+
BigInt(revealDeadline.toString())
|
|
82561
|
+
];
|
|
82562
|
+
const revealSubmission = await this.prepareQuantumSend("revealAndLiquidate", {
|
|
82563
|
+
to: liquidationTarget,
|
|
82564
|
+
from: liquidationFrom,
|
|
82565
|
+
data: positionManager.interface.encodeFunctionData("revealAndLiquidate", [...revealArgs]),
|
|
82566
|
+
quantumTimestamp: Number(revealQuantumTimestamp)
|
|
82567
|
+
});
|
|
82568
|
+
const revealTx = await positionManager["revealAndLiquidate"](
|
|
82569
|
+
...revealArgs,
|
|
82570
|
+
{ gasLimit: revealSubmission.gasLimit }
|
|
82181
82571
|
);
|
|
82182
82572
|
if (this.config.debug) {
|
|
82183
82573
|
log.info(` \u{1F4E4} Reveal TX submitted`, { txHash: revealTx.hash });
|
|
@@ -82579,15 +82969,13 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
|
|
|
82579
82969
|
]);
|
|
82580
82970
|
const extendTo = this.getContractAddressesOrThrow().positionManager;
|
|
82581
82971
|
const extendSigner = this.getSignerOrThrow();
|
|
82972
|
+
let extendSubmission;
|
|
82582
82973
|
try {
|
|
82583
|
-
await
|
|
82584
|
-
provider: this.getProviderOrThrow(),
|
|
82974
|
+
extendSubmission = await this.prepareQuantumSend("extendPosition", {
|
|
82585
82975
|
to: extendTo,
|
|
82586
82976
|
from: await extendSigner.getAddress(),
|
|
82587
82977
|
data: extendCalldata,
|
|
82588
|
-
quantumTimestamp: Number(quantumTimestamp)
|
|
82589
|
-
laneGuardActive: await this.isLocalLaneGuardActive(),
|
|
82590
|
-
onDebug: this.config.debug ? (msg) => log.info(msg, {}) : void 0
|
|
82978
|
+
quantumTimestamp: Number(quantumTimestamp)
|
|
82591
82979
|
});
|
|
82592
82980
|
} catch (simError) {
|
|
82593
82981
|
if (!(simError instanceof QuantumRevertError)) {
|
|
@@ -82602,7 +82990,7 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
|
|
|
82602
82990
|
feeProvider: this.getProviderOrThrow(),
|
|
82603
82991
|
to: extendTo,
|
|
82604
82992
|
data: extendCalldata,
|
|
82605
|
-
gasLimit:
|
|
82993
|
+
gasLimit: extendSubmission.gasLimit
|
|
82606
82994
|
});
|
|
82607
82995
|
const txWithProvider = tx2;
|
|
82608
82996
|
if (!txWithProvider.provider) {
|
|
@@ -83495,7 +83883,6 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
|
|
|
83495
83883
|
const paymentContractAddress = this.getContractAddressesOrThrow().positionManager;
|
|
83496
83884
|
const paymentSigner = this.getSignerOrThrow();
|
|
83497
83885
|
const paymentFrom = await paymentSigner.getAddress();
|
|
83498
|
-
const paymentProvider = contractManager.getProvider();
|
|
83499
83886
|
const paymentIface = new import_ethers15.Interface([
|
|
83500
83887
|
"function makePayment(bytes32 positionId, uint256 paymentAmount, uint256 quantumTimestamp, uint256 btcPrice, bytes calldata paymentValidatorSignature) external returns (bool)"
|
|
83501
83888
|
]);
|
|
@@ -83506,15 +83893,13 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
|
|
|
83506
83893
|
btcPriceStr,
|
|
83507
83894
|
signature
|
|
83508
83895
|
]);
|
|
83896
|
+
let paymentSubmission;
|
|
83509
83897
|
try {
|
|
83510
|
-
await
|
|
83511
|
-
provider: paymentProvider,
|
|
83898
|
+
paymentSubmission = await this.prepareQuantumSend("makePayment", {
|
|
83512
83899
|
to: paymentContractAddress,
|
|
83513
83900
|
from: paymentFrom,
|
|
83514
83901
|
data: paymentCalldata,
|
|
83515
|
-
quantumTimestamp: Number(quantumTimestamp)
|
|
83516
|
-
laneGuardActive: await this.isLocalLaneGuardActive(),
|
|
83517
|
-
onDebug: this.config.debug ? (msg) => log.info(msg, {}) : void 0
|
|
83902
|
+
quantumTimestamp: Number(quantumTimestamp)
|
|
83518
83903
|
});
|
|
83519
83904
|
} catch (simError) {
|
|
83520
83905
|
if (!(simError instanceof QuantumRevertError)) {
|
|
@@ -83537,7 +83922,7 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
|
|
|
83537
83922
|
feeProvider: this.getProviderOrThrow(),
|
|
83538
83923
|
to: paymentContractAddress,
|
|
83539
83924
|
data: paymentCalldata,
|
|
83540
|
-
gasLimit:
|
|
83925
|
+
gasLimit: paymentSubmission.gasLimit
|
|
83541
83926
|
});
|
|
83542
83927
|
if (this.config.debug) {
|
|
83543
83928
|
log.info("\u2705 makePayment broadcast", { txHash: tx2.hash });
|
|
@@ -84294,21 +84679,18 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
|
|
|
84294
84679
|
const withdrawSigner = this.getSignerOrThrow();
|
|
84295
84680
|
let tx2;
|
|
84296
84681
|
try {
|
|
84297
|
-
await
|
|
84298
|
-
provider: this.getProviderOrThrow(),
|
|
84682
|
+
const withdrawSubmission = await this.prepareQuantumSend("withdrawBTC", {
|
|
84299
84683
|
to: positionManagerAddress,
|
|
84300
84684
|
from: await withdrawSigner.getAddress(),
|
|
84301
84685
|
data: withdrawCalldata,
|
|
84302
|
-
quantumTimestamp: Number(withdrawalParams.quantumTimestamp)
|
|
84303
|
-
laneGuardActive: await this.isLocalLaneGuardActive(),
|
|
84304
|
-
onDebug: this.config.debug ? (msg) => log.info(msg, {}) : void 0
|
|
84686
|
+
quantumTimestamp: Number(withdrawalParams.quantumTimestamp)
|
|
84305
84687
|
});
|
|
84306
84688
|
tx2 = await sendEip1559Transaction({
|
|
84307
84689
|
signer: withdrawSigner,
|
|
84308
84690
|
feeProvider: this.getProviderOrThrow(),
|
|
84309
84691
|
to: positionManagerAddress,
|
|
84310
84692
|
data: withdrawCalldata,
|
|
84311
|
-
gasLimit:
|
|
84693
|
+
gasLimit: withdrawSubmission.gasLimit
|
|
84312
84694
|
});
|
|
84313
84695
|
} catch (txError) {
|
|
84314
84696
|
const txErrorMsg = txError instanceof QuantumRevertError ? `Withdrawal would revert (pre-send simulation): ${txError.errorName ?? txError.selector ?? "unknown"}` : txError instanceof Error ? txError.message : String(txError);
|
|
@@ -84319,6 +84701,12 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
|
|
|
84319
84701
|
signatureBytesLength: signatureBytes.length
|
|
84320
84702
|
});
|
|
84321
84703
|
}
|
|
84704
|
+
if (txError instanceof GasEstimateUnavailableError) {
|
|
84705
|
+
return {
|
|
84706
|
+
success: false,
|
|
84707
|
+
error: `Transaction submission failed: ${txErrorMsg}`
|
|
84708
|
+
};
|
|
84709
|
+
}
|
|
84322
84710
|
try {
|
|
84323
84711
|
const position = await this.getPosition(positionId);
|
|
84324
84712
|
const btcAmount = (Number(withdrawalAmount) / 1e8).toFixed(8);
|
|
@@ -86001,6 +86389,97 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
|
|
|
86001
86389
|
const { hash, blockNumber } = await executePsmPlan(plan, params.signer, vctx);
|
|
86002
86390
|
return { hash, blockNumber };
|
|
86003
86391
|
}
|
|
86392
|
+
// ============================================================================
|
|
86393
|
+
// HIGH-LEVEL API - stUSDC desk (StUSDCVault 1.1.0, hold-only UCD desk)
|
|
86394
|
+
// ============================================================================
|
|
86395
|
+
/**
|
|
86396
|
+
* The desk's addresses and the chain they belong to. The vault comes from the deployment
|
|
86397
|
+
* manifest (`getContractsByNetwork(network).StUSDCVault`); UCD and USDC from the SDK config,
|
|
86398
|
+
* the way `psmRedeem` resolves its tokens. Every address is required — nothing is guessed.
|
|
86399
|
+
*/
|
|
86400
|
+
resolveDeskAddresses() {
|
|
86401
|
+
const chainId = this.config.chainId ?? this.config.networkOverride?.chainId;
|
|
86402
|
+
if (typeof chainId !== "number") {
|
|
86403
|
+
throw new Error("desk needs the SDK's chainId \u2014 configure chainId");
|
|
86404
|
+
}
|
|
86405
|
+
const manifestKey = chainId === 1 ? "mainnet" : chainId === 11155111 ? "sepolia" : "localhost";
|
|
86406
|
+
const manifest = getContractsByNetwork(manifestKey);
|
|
86407
|
+
const vault = manifest?.StUSDCVault;
|
|
86408
|
+
if (!vault) {
|
|
86409
|
+
throw new Error(`StUSDCVault is not deployed on ${manifestKey} (chainId ${chainId}) \u2014 no manifest address`);
|
|
86410
|
+
}
|
|
86411
|
+
const ucdToken = this.config.contractAddresses?.ucdToken;
|
|
86412
|
+
const usdcToken = this.config.contractAddresses?.usdcToken;
|
|
86413
|
+
if (!ucdToken)
|
|
86414
|
+
throw new Error("UCDToken address not configured \u2014 provide contractAddresses.ucdToken");
|
|
86415
|
+
if (!usdcToken)
|
|
86416
|
+
throw new Error("USDC address not configured \u2014 provide contractAddresses.usdcToken");
|
|
86417
|
+
return { chainId, vault, ucdToken, usdcToken };
|
|
86418
|
+
}
|
|
86419
|
+
/**
|
|
86420
|
+
* Live desk status: halt matrix, pause, exit freeze, mark, free USDC, params and state —
|
|
86421
|
+
* one `Promise.all` over the vault's views.
|
|
86422
|
+
*/
|
|
86423
|
+
async getDeskStatus() {
|
|
86424
|
+
const { vault } = this.resolveDeskAddresses();
|
|
86425
|
+
return deskReadsFromProvider(this.getProviderOrThrow(), vault).status();
|
|
86426
|
+
}
|
|
86427
|
+
/**
|
|
86428
|
+
* What `sellUCD(amountUCDWei, ·)` would pay now. A static call: it reverts exactly as the sell
|
|
86429
|
+
* would (`ZeroDeskAmount`, `InventoryCapExceeded`, `InsufficientLiquidity`, `DeskHalted`,
|
|
86430
|
+
* `EnforcedPause`, `ExitsAreFrozen`), decoded by ethers against `DESK_ABI`.
|
|
86431
|
+
*
|
|
86432
|
+
* @param amountUCDWei - UCD to sell (18 decimals)
|
|
86433
|
+
*/
|
|
86434
|
+
async quoteDeskSell(amountUCDWei) {
|
|
86435
|
+
const { vault } = this.resolveDeskAddresses();
|
|
86436
|
+
return deskReadsFromProvider(this.getProviderOrThrow(), vault).quoteSellUCD(amountUCDWei);
|
|
86437
|
+
}
|
|
86438
|
+
/**
|
|
86439
|
+
* Build and validate the legs of a UCD → USDC desk sale for `owner`: an EXACT approve of UCD
|
|
86440
|
+
* to the vault when the allowance is short (reset to zero first when partial), then
|
|
86441
|
+
* `sellUCD(amountUCDWei, minUSDCWei)`. Nothing is sent — hand the plan to `executeDeskPlan`,
|
|
86442
|
+
* or take the validated legs into your own signing pipeline.
|
|
86443
|
+
*
|
|
86444
|
+
* @param amountUCDWei - UCD to sell (18 decimals)
|
|
86445
|
+
* @param minUSDCWei - Minimum USDC to receive (6 decimals); must be > 0 — see `deskSellMinOut`
|
|
86446
|
+
* @param owner - The seller; defaults to the configured contract signer
|
|
86447
|
+
*/
|
|
86448
|
+
async planDeskSell(amountUCDWei, minUSDCWei, owner) {
|
|
86449
|
+
const { chainId, vault, ucdToken } = this.resolveDeskAddresses();
|
|
86450
|
+
const seller = owner ?? await this.config.contractSigner?.getAddress();
|
|
86451
|
+
if (!seller)
|
|
86452
|
+
throw new Error("desk sell needs an owner \u2014 pass one or configure contractSigner");
|
|
86453
|
+
const provider = this.getProviderOrThrow();
|
|
86454
|
+
const vctx = { chainId, network: String(chainId), contracts: {} };
|
|
86455
|
+
return planDeskSell({
|
|
86456
|
+
addresses: { vault, ucdToken },
|
|
86457
|
+
owner: seller,
|
|
86458
|
+
amountUCD: amountUCDWei,
|
|
86459
|
+
minUSDC: minUSDCWei,
|
|
86460
|
+
vctx,
|
|
86461
|
+
reads: deskReadsFromProvider(provider, vault)
|
|
86462
|
+
});
|
|
86463
|
+
}
|
|
86464
|
+
/**
|
|
86465
|
+
* Send a desk plan through `signer`, approvals first, each leg re-validated against the chain
|
|
86466
|
+
* the SIGNER is on — which must be the SDK's configured chain, where the addresses came from.
|
|
86467
|
+
*/
|
|
86468
|
+
async executeDeskPlan(plan, signer) {
|
|
86469
|
+
const provider = signer.provider;
|
|
86470
|
+
if (!provider)
|
|
86471
|
+
throw new Error(`desk ${plan.direction} needs a signer connected to a provider`);
|
|
86472
|
+
const { chainId } = this.resolveDeskAddresses();
|
|
86473
|
+
const mismatch = await describeProviderChainMismatch(provider, chainId);
|
|
86474
|
+
if (mismatch)
|
|
86475
|
+
throw new Error(mismatch);
|
|
86476
|
+
const signerAddress = await signer.getAddress();
|
|
86477
|
+
if ((0, import_ethers15.getAddress)(signerAddress) !== (0, import_ethers15.getAddress)(plan.owner)) {
|
|
86478
|
+
throw new Error(`desk ${plan.direction} plan was built for ${plan.owner}, signer is ${signerAddress}`);
|
|
86479
|
+
}
|
|
86480
|
+
const vctx = { chainId, network: String(chainId), contracts: {} };
|
|
86481
|
+
return executeDeskPlan(plan, signer, vctx);
|
|
86482
|
+
}
|
|
86004
86483
|
/**
|
|
86005
86484
|
* Wait for the subgraph to index up to (and including) the given block number.
|
|
86006
86485
|
* Call after on-chain actions (createLoan, mintUCD, etc.) before querying the subgraph.
|
|
@@ -87166,6 +87645,32 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
|
|
|
87166
87645
|
provider
|
|
87167
87646
|
);
|
|
87168
87647
|
}
|
|
87648
|
+
/**
|
|
87649
|
+
* Gate + estimate-as-simulation for a quantum-signed send, always on the SDK READ
|
|
87650
|
+
* provider — never the wallet's (docs/vigil/plans/2026-11-11-sdk-estimate-sized-gas-limits-plan.md,
|
|
87651
|
+
* Design 1–2). Returns the estimate and the gasLimit to broadcast with, and (in debug)
|
|
87652
|
+
* logs both for every send so the margin stays visible across the mainnet Glamsterdam fork.
|
|
87653
|
+
*
|
|
87654
|
+
* Throws `QuantumRevertError` (decodable revert — callers map it to their own message),
|
|
87655
|
+
* `GasEstimateUnavailableError` (no estimate: retryable, nothing sent) and
|
|
87656
|
+
* `GasLimitCeilingError` (the sized limit exceeds the 5M sign-guard ceiling).
|
|
87657
|
+
*/
|
|
87658
|
+
async prepareQuantumSend(operation, tx2) {
|
|
87659
|
+
const result = await assertSafeQuantumSubmission({
|
|
87660
|
+
provider: this.getProviderOrThrow(),
|
|
87661
|
+
...tx2,
|
|
87662
|
+
laneGuardActive: await this.isLocalLaneGuardActive(),
|
|
87663
|
+
...this.config.debug ? { onDebug: (msg) => log.info(msg, {}) } : {}
|
|
87664
|
+
});
|
|
87665
|
+
if (this.config.debug) {
|
|
87666
|
+
log.info("\u26FD gasLimit sized from eth_estimateGas", {
|
|
87667
|
+
operation,
|
|
87668
|
+
estimate: result.estimate.toString(),
|
|
87669
|
+
gasLimit: result.gasLimit.toString()
|
|
87670
|
+
});
|
|
87671
|
+
}
|
|
87672
|
+
return result;
|
|
87673
|
+
}
|
|
87169
87674
|
/**
|
|
87170
87675
|
* Get Bitcoin network based on chain.
|
|
87171
87676
|
*
|
|
@@ -87804,13 +88309,14 @@ init_deployment_addresses();
|
|
|
87804
88309
|
init_deployment_addresses();
|
|
87805
88310
|
|
|
87806
88311
|
// node_modules/@gvnrdao/dh-sdk/dist/sign-guard.mjs
|
|
87807
|
-
var import_ethers40 = require("ethers");
|
|
87808
|
-
var import_ethers41 = require("ethers");
|
|
87809
88312
|
var import_ethers42 = require("ethers");
|
|
87810
88313
|
var import_ethers43 = require("ethers");
|
|
87811
88314
|
var import_ethers44 = require("ethers");
|
|
87812
88315
|
var import_ethers45 = require("ethers");
|
|
87813
88316
|
var import_ethers46 = require("ethers");
|
|
88317
|
+
var import_ethers47 = require("ethers");
|
|
88318
|
+
var import_ethers48 = require("ethers");
|
|
88319
|
+
var import_ethers49 = require("ethers");
|
|
87814
88320
|
var TxValidationError3 = class extends Error {
|
|
87815
88321
|
/**
|
|
87816
88322
|
* @param subject What is being refused. Defaults to the server-returned transaction the
|
|
@@ -87855,9 +88361,13 @@ var SIGNABLE_FUNCTIONS3 = [
|
|
|
87855
88361
|
"function redeem(address stablecoin, uint256 ucdAmount, uint256 minStablecoinOut) external returns (uint256)",
|
|
87856
88362
|
// BitcoinWithdrawalAddressRegistry — `msg.sender` must be the borrower, so
|
|
87857
88363
|
// this too is client-only and never module-whitelisted.
|
|
87858
|
-
"function addAddress(string btcAddress) external"
|
|
88364
|
+
"function addAddress(string btcAddress) external",
|
|
88365
|
+
// StUSDCVault 1.1.0 — the hold-only UCD desk. Direct EOA calls like the PSM
|
|
88366
|
+
// pair (the vault pulls from `msg.sender`); never routed through AgentModule.
|
|
88367
|
+
"function sellUCD(uint256 amountUCD, uint256 minUSDC) external returns (uint256)",
|
|
88368
|
+
"function buyUCD(uint256 amountUSDC, uint256 minUCD) external returns (uint256)"
|
|
87859
88369
|
];
|
|
87860
|
-
var IFACE3 = new
|
|
88370
|
+
var IFACE3 = new import_ethers42.ethers.Interface(SIGNABLE_FUNCTIONS3);
|
|
87861
88371
|
function encodeSignable3(fn, args) {
|
|
87862
88372
|
return IFACE3.encodeFunctionData(fn, args);
|
|
87863
88373
|
}
|
|
@@ -87887,10 +88397,10 @@ var DEFAULT_FEE_CEILING2 = {
|
|
|
87887
88397
|
maxTxFeeWei: DEFAULT_MAX_TX_FEE_WEI2
|
|
87888
88398
|
};
|
|
87889
88399
|
function fmtEth2(wei) {
|
|
87890
|
-
return `${
|
|
88400
|
+
return `${import_ethers43.ethers.formatEther(wei)} ETH`;
|
|
87891
88401
|
}
|
|
87892
88402
|
function fmtGwei2(wei) {
|
|
87893
|
-
return `${
|
|
88403
|
+
return `${import_ethers43.ethers.formatUnits(wei, "gwei")} gwei`;
|
|
87894
88404
|
}
|
|
87895
88405
|
function worstCaseFeeWei2(gasLimit, maxFeePerGas) {
|
|
87896
88406
|
if (gasLimit == null || maxFeePerGas == null)
|
|
@@ -87940,8 +88450,6 @@ var SEPOLIA_DEPLOYMENT2 = {
|
|
|
87940
88450
|
BitcoinProviderRegistry: "0xbfA0c48B070D0a9A9CD27469AeacFD2d4261cEE2",
|
|
87941
88451
|
ContractVersionRegistry: "0x97E43AA6aFF2C0cf659d3aE501658D2Ef6777522",
|
|
87942
88452
|
usdcToken: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
|
|
87943
|
-
mockUsdcToken: "0x96409A98e0D322d6566b7F44a0fAbD1BD4ce2AEc",
|
|
87944
|
-
mockUsdtToken: "0xF8b7fB38b17a310960E47805Be9adba0b0e0394D",
|
|
87945
88453
|
PositionDelegateRegistry: "0x482369De283622E7b05731875ec137d4E3D208F9",
|
|
87946
88454
|
FeeRecipientRegistry: "0x95795F8403DDb629E8527B2934C4e71f5fC0C374",
|
|
87947
88455
|
BitcoinWithdrawalAddressRegistry: "0x6376D392097F0A81e51BD83960A97EA20eaf1dbe",
|
|
@@ -88126,10 +88634,10 @@ var SEPOLIA_DEPLOYMENT2 = {
|
|
|
88126
88634
|
},
|
|
88127
88635
|
StUSDCVault: {
|
|
88128
88636
|
previousImplementation: "0x3619b14C23c5F7d950EF845481C2299939873004",
|
|
88129
|
-
newImplementation: "
|
|
88130
|
-
upgradedAt: "2026-
|
|
88637
|
+
newImplementation: "0xE94DFBacA21fEFB0BB2e95D33510Ca702d2b6c5f",
|
|
88638
|
+
upgradedAt: "2026-11-08T16:07:36.867Z",
|
|
88131
88639
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
88132
|
-
reason: "
|
|
88640
|
+
reason: "StUSDCVault 1.1.0: Phase 5 desk (linked StUSDCDeskLib 0x0880ce721b0A50C8Fe8d5c911097F0c24e57b6aA)"
|
|
88133
88641
|
},
|
|
88134
88642
|
CarryFeeReceiver: {
|
|
88135
88643
|
previousImplementation: "0x9c43996C6f6BAD82F2A5152AbA61137E929EFA17",
|
|
@@ -88194,6 +88702,9 @@ var SEPOLIA_DEPLOYMENT2 = {
|
|
|
88194
88702
|
setPKPValidationRegistryTx: "0xab6b7e610c1ecf68da9a1e1150e61631e1f2a945bec12608c8357e03be25c4a5",
|
|
88195
88703
|
replacedAddress: "0xC8Ca02238fbCDAEbE6dbF804461D43F46F9406F4"
|
|
88196
88704
|
},
|
|
88705
|
+
libraries: {
|
|
88706
|
+
StUSDCDeskLib: "0x0880ce721b0A50C8Fe8d5c911097F0c24e57b6aA"
|
|
88707
|
+
},
|
|
88197
88708
|
latestEnv: {
|
|
88198
88709
|
UCD_TOKEN: "0xdd817Ff47C9b8f81335Ac579895D8EA321Fa86Df",
|
|
88199
88710
|
UCD_CONTROLLER: "0x360Bde4e489ee94E26601B206932De09EE60FF04",
|
|
@@ -88246,8 +88757,6 @@ var SEPOLIA_DEPLOYMENT2 = {
|
|
|
88246
88757
|
CONTRACT_VERSION_REGISTRY: "0x97E43AA6aFF2C0cf659d3aE501658D2Ef6777522",
|
|
88247
88758
|
CONTRACT_VERSION_REGISTRY_IMPL: "0xF3389De4bCeC735e4F6d35b9f71170D96037D1B7",
|
|
88248
88759
|
USDC_TOKEN: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
|
|
88249
|
-
MOCK_USDC_TOKEN: "0x96409A98e0D322d6566b7F44a0fAbD1BD4ce2AEc",
|
|
88250
|
-
MOCK_USDT_TOKEN: "0xF8b7fB38b17a310960E47805Be9adba0b0e0394D",
|
|
88251
88760
|
POSITION_DELEGATE_REGISTRY: "0x482369De283622E7b05731875ec137d4E3D208F9",
|
|
88252
88761
|
POSITION_DELEGATE_REGISTRY_IMPL: "0xc681c48688cdAA966119E265e4a378ef8Fe0eBcA",
|
|
88253
88762
|
AGENT_MODULE: "0xefb8C29C1e7e92ed7d81a52dbedaed74e37fe380",
|
|
@@ -88262,7 +88771,7 @@ var SEPOLIA_DEPLOYMENT2 = {
|
|
|
88262
88771
|
STUCD_VAULT: "0xc04Dd4d6799FFDE57feAfD5B3B1B038827014fd3",
|
|
88263
88772
|
STUCD_VAULT_IMPL: "0xd596A866ee5273aedaC21BC6e88649E087fC8EcB",
|
|
88264
88773
|
STUSDC_VAULT: "0x7aBac04d4Bf2b3A63AF363B9527970791346463a",
|
|
88265
|
-
STUSDC_VAULT_IMPL: "
|
|
88774
|
+
STUSDC_VAULT_IMPL: "0xE94DFBacA21fEFB0BB2e95D33510Ca702d2b6c5f",
|
|
88266
88775
|
CARRY_FEE_RECEIVER: "0x2C8e54f099Cf479182D7c87D76FeD88b4172cdB4",
|
|
88267
88776
|
CARRY_FEE_RECEIVER_IMPL: "0x3a86A23ff3cd6c26B1Fa2C5aeBAeEEdbF6095D69",
|
|
88268
88777
|
FEE_RECOGNITION_LEDGER: "0xA5EBfb856fe2b847cC6011B0fe2dB6ACE63D6C3c",
|
|
@@ -88533,7 +89042,7 @@ function eqAddr3(a, b) {
|
|
|
88533
89042
|
if (!a || !b)
|
|
88534
89043
|
return false;
|
|
88535
89044
|
try {
|
|
88536
|
-
return
|
|
89045
|
+
return import_ethers44.ethers.getAddress(a) === import_ethers44.ethers.getAddress(b);
|
|
88537
89046
|
} catch {
|
|
88538
89047
|
return false;
|
|
88539
89048
|
}
|
|
@@ -88599,7 +89108,7 @@ function readValue3(tx2) {
|
|
|
88599
89108
|
}
|
|
88600
89109
|
function normalizePositionId3(id) {
|
|
88601
89110
|
const hex = id.startsWith("0x") ? id : `0x${id}`;
|
|
88602
|
-
return
|
|
89111
|
+
return import_ethers44.ethers.zeroPadValue(hex, 32).toLowerCase();
|
|
88603
89112
|
}
|
|
88604
89113
|
function requirePositionId2(actual, expected) {
|
|
88605
89114
|
const txPositionId = String(actual).toLowerCase();
|
|
@@ -88858,6 +89367,53 @@ function validateUnsignedTx3(unsignedTx, expected, vctx) {
|
|
|
88858
89367
|
}
|
|
88859
89368
|
break;
|
|
88860
89369
|
}
|
|
89370
|
+
case "desk-approve": {
|
|
89371
|
+
if (name !== "approve") {
|
|
89372
|
+
throw new TxValidationError3(`expected ERC-20 approve, decoded ${name}`);
|
|
89373
|
+
}
|
|
89374
|
+
if (!eqAddr3(to, expected.tokenAddress)) {
|
|
89375
|
+
throw new TxValidationError3(`approve must target the token (${expected.tokenAddress}), got ${to}`);
|
|
89376
|
+
}
|
|
89377
|
+
if (!eqAddr3(String(args[0]), expected.vaultAddress)) {
|
|
89378
|
+
throw new TxValidationError3(`approve spender must be the StUSDCVault (${expected.vaultAddress}), got ${String(args[0])}`);
|
|
89379
|
+
}
|
|
89380
|
+
if (BigInt(String(args[1])).toString() !== expected.amount) {
|
|
89381
|
+
throw new TxValidationError3(
|
|
89382
|
+
`approve amount must be EXACTLY ${expected.amount} (exact-amount rule), got ${BigInt(String(args[1]))}`
|
|
89383
|
+
);
|
|
89384
|
+
}
|
|
89385
|
+
break;
|
|
89386
|
+
}
|
|
89387
|
+
case "desk-sell": {
|
|
89388
|
+
if (name !== "sellUCD")
|
|
89389
|
+
throw new TxValidationError3(`expected sellUCD, decoded ${name}`);
|
|
89390
|
+
if (!eqAddr3(to, expected.vaultAddress)) {
|
|
89391
|
+
throw new TxValidationError3(`sellUCD must target the StUSDCVault (${expected.vaultAddress}), got ${to}`);
|
|
89392
|
+
}
|
|
89393
|
+
if (BigInt(String(args[0])).toString() !== expected.amountUcdWei)
|
|
89394
|
+
throw new TxValidationError3(`sellUCD amountUCD mismatch`);
|
|
89395
|
+
if (BigInt(String(args[1])).toString() !== expected.minUsdc)
|
|
89396
|
+
throw new TxValidationError3(`sellUCD minUSDC mismatch`);
|
|
89397
|
+
if (BigInt(expected.minUsdc) === 0n) {
|
|
89398
|
+
throw new TxValidationError3(`sellUCD minUSDC is 0 \u2014 a slippage floor is mandatory`);
|
|
89399
|
+
}
|
|
89400
|
+
break;
|
|
89401
|
+
}
|
|
89402
|
+
case "desk-buy": {
|
|
89403
|
+
if (name !== "buyUCD")
|
|
89404
|
+
throw new TxValidationError3(`expected buyUCD, decoded ${name}`);
|
|
89405
|
+
if (!eqAddr3(to, expected.vaultAddress)) {
|
|
89406
|
+
throw new TxValidationError3(`buyUCD must target the StUSDCVault (${expected.vaultAddress}), got ${to}`);
|
|
89407
|
+
}
|
|
89408
|
+
if (BigInt(String(args[0])).toString() !== expected.amountUsdc)
|
|
89409
|
+
throw new TxValidationError3(`buyUCD amountUSDC mismatch`);
|
|
89410
|
+
if (BigInt(String(args[1])).toString() !== expected.minUcdWei)
|
|
89411
|
+
throw new TxValidationError3(`buyUCD minUCD mismatch`);
|
|
89412
|
+
if (BigInt(expected.minUcdWei) === 0n) {
|
|
89413
|
+
throw new TxValidationError3(`buyUCD minUCD is 0 \u2014 a slippage floor is mandatory`);
|
|
89414
|
+
}
|
|
89415
|
+
break;
|
|
89416
|
+
}
|
|
88861
89417
|
default: {
|
|
88862
89418
|
const _exhaustive = expected;
|
|
88863
89419
|
throw new TxValidationError3(`unhandled expected action kind: ${JSON.stringify(_exhaustive)}`);
|
|
@@ -88892,38 +89448,38 @@ function buildPsmRedeemTx3(p) {
|
|
|
88892
89448
|
};
|
|
88893
89449
|
}
|
|
88894
89450
|
var PSM_READS_ABI2 = ["function supportedStablecoins(address) view returns (bool)"];
|
|
88895
|
-
var
|
|
89451
|
+
var ERC20_READS_ABI3 = ["function allowance(address owner, address spender) view returns (uint256)"];
|
|
88896
89452
|
function psmExchangeReadsFromProvider2(provider, psmAddress) {
|
|
88897
|
-
const psm = new
|
|
89453
|
+
const psm = new import_ethers47.ethers.Contract(psmAddress, PSM_READS_ABI2, provider);
|
|
88898
89454
|
return {
|
|
88899
89455
|
isStablecoinSupported: async (stablecoin) => await psm.getFunction("supportedStablecoins")(stablecoin),
|
|
88900
|
-
allowance: async (token, owner, spender) => await new
|
|
89456
|
+
allowance: async (token, owner, spender) => await new import_ethers47.ethers.Contract(token, ERC20_READS_ABI3, provider).getFunction("allowance")(owner, spender)
|
|
88901
89457
|
};
|
|
88902
89458
|
}
|
|
88903
|
-
var
|
|
88904
|
-
function
|
|
88905
|
-
if (!value || !
|
|
88906
|
-
throw
|
|
89459
|
+
var refuse3 = (direction, msg) => new TxValidationError3(msg, `PSM ${direction}`);
|
|
89460
|
+
function requireAddress3(direction, label, value) {
|
|
89461
|
+
if (!value || !import_ethers47.ethers.isAddress(value)) {
|
|
89462
|
+
throw refuse3(direction, `${label} address is missing or invalid (${String(value)})`);
|
|
88907
89463
|
}
|
|
88908
|
-
return
|
|
89464
|
+
return import_ethers47.ethers.getAddress(value);
|
|
88909
89465
|
}
|
|
88910
89466
|
async function planPsmExchange2(params) {
|
|
88911
89467
|
const { direction, amountIn, minOut, vctx, reads } = params;
|
|
88912
89468
|
const chainId = vctx.chainId;
|
|
88913
89469
|
if (amountIn <= 0n) {
|
|
88914
|
-
throw
|
|
89470
|
+
throw refuse3(direction, `amount must be greater than zero (got ${amountIn})`);
|
|
88915
89471
|
}
|
|
88916
89472
|
if (minOut <= 0n) {
|
|
88917
|
-
throw
|
|
89473
|
+
throw refuse3(direction, `minimum-out floor must be greater than zero (got ${minOut}) \u2014 a zero floor is refused on-chain`);
|
|
88918
89474
|
}
|
|
88919
|
-
const owner =
|
|
88920
|
-
const psm =
|
|
88921
|
-
const stablecoin =
|
|
89475
|
+
const owner = requireAddress3(direction, "owner", params.owner);
|
|
89476
|
+
const psm = requireAddress3(direction, "SimplePSMV2", params.addresses.psm);
|
|
89477
|
+
const stablecoin = requireAddress3(direction, "stablecoin", params.addresses.stablecoin);
|
|
88922
89478
|
const isSwap = direction === "swap";
|
|
88923
|
-
const token = isSwap ? stablecoin :
|
|
88924
|
-
const spender = isSwap ? psm :
|
|
89479
|
+
const token = isSwap ? stablecoin : requireAddress3(direction, "UCDToken", params.addresses.ucdToken);
|
|
89480
|
+
const spender = isSwap ? psm : requireAddress3(direction, "UCDController", params.addresses.ucdController);
|
|
88925
89481
|
if (!await reads.isStablecoinSupported(stablecoin)) {
|
|
88926
|
-
throw
|
|
89482
|
+
throw refuse3(direction, `stablecoin ${stablecoin} is not supported by the PSM at ${psm}`);
|
|
88927
89483
|
}
|
|
88928
89484
|
const approveExpected = (amount) => isSwap ? { kind: "stablecoin-approve", tokenAddress: token, spender, amountUnits: amount.toString() } : { kind: "ucd-approve-controller", ucdTokenAddress: token, spender, amountWei: amount.toString() };
|
|
88929
89485
|
const allowanceBefore = await reads.allowance(token, owner, spender);
|
|
@@ -89090,7 +89646,7 @@ function assertSignableTypedData(chainId, domain, types, primaryType, message2)
|
|
|
89090
89646
|
if (structNames.length !== 1) {
|
|
89091
89647
|
throw new TypedDataRefused(`expected exactly one struct type, got ${structNames.join(", ") || "none"}`);
|
|
89092
89648
|
}
|
|
89093
|
-
const derived =
|
|
89649
|
+
const derived = import_ethers49.TypedDataEncoder.getPrimaryType(structs);
|
|
89094
89650
|
if (derived !== primaryType) {
|
|
89095
89651
|
throw new TypedDataRefused(`primaryType "${primaryType}" does not match the types' primary "${derived}"`);
|
|
89096
89652
|
}
|
|
@@ -89182,7 +89738,7 @@ var SUPPORTED_STABLECOINS = `
|
|
|
89182
89738
|
}`;
|
|
89183
89739
|
|
|
89184
89740
|
// src/boundary/upstream/real/psm-calls.ts
|
|
89185
|
-
var
|
|
89741
|
+
var import_ethers50 = require("ethers");
|
|
89186
89742
|
var PSM_VIEW_FRAGMENTS = [
|
|
89187
89743
|
"function VERSION() view returns (string)",
|
|
89188
89744
|
"function supportedStablecoins(address) view returns (bool)",
|
|
@@ -89251,8 +89807,8 @@ var PsmCalls = class {
|
|
|
89251
89807
|
constructor(deps) {
|
|
89252
89808
|
this.deps = deps;
|
|
89253
89809
|
const abi = [...PSM_VIEW_FRAGMENTS, ...PSM_ERROR_FRAGMENTS];
|
|
89254
|
-
this.iface = new
|
|
89255
|
-
this.psm = new
|
|
89810
|
+
this.iface = new import_ethers50.ethers.Interface(abi);
|
|
89811
|
+
this.psm = new import_ethers50.ethers.Contract(deps.psmAddress, abi, deps.provider);
|
|
89256
89812
|
}
|
|
89257
89813
|
psm;
|
|
89258
89814
|
iface;
|
|
@@ -89281,8 +89837,8 @@ var PsmCalls = class {
|
|
|
89281
89837
|
});
|
|
89282
89838
|
}
|
|
89283
89839
|
return this.call(async () => {
|
|
89284
|
-
const ucd = new
|
|
89285
|
-
const stable = new
|
|
89840
|
+
const ucd = new import_ethers50.ethers.Contract(ucdToken, ERC20_FRAGMENTS, this.deps.provider);
|
|
89841
|
+
const stable = new import_ethers50.ethers.Contract(this.deps.stablecoinAddress, ERC20_FRAGMENTS, this.deps.provider);
|
|
89286
89842
|
const [ucdWei, stablecoinUnits] = await Promise.all([ucd["balanceOf"](holder), stable["balanceOf"](holder)]);
|
|
89287
89843
|
return { ucdWei: ucdWei.toString(), stablecoinUnits: stablecoinUnits.toString() };
|
|
89288
89844
|
});
|
|
@@ -89400,7 +89956,7 @@ var PsmCalls = class {
|
|
|
89400
89956
|
};
|
|
89401
89957
|
|
|
89402
89958
|
// src/boundary/upstream/real/session.ts
|
|
89403
|
-
var
|
|
89959
|
+
var import_ethers51 = require("ethers");
|
|
89404
89960
|
var REFRESH_LEEWAY_SEC = 30;
|
|
89405
89961
|
var LOGIN_TYPES_WITH_AUDIENCE3 = {
|
|
89406
89962
|
DiamondHands: [
|
|
@@ -89448,7 +90004,7 @@ var LitOpsSession = class {
|
|
|
89448
90004
|
const message2 = {
|
|
89449
90005
|
address: this.wallet.address,
|
|
89450
90006
|
issuedAt: Math.floor(Date.now() / 1e3),
|
|
89451
|
-
nonce: "0x" + Buffer.from(
|
|
90007
|
+
nonce: "0x" + Buffer.from(import_ethers51.ethers.randomBytes(32)).toString("hex"),
|
|
89452
90008
|
audience: this.serviceEndpoint
|
|
89453
90009
|
};
|
|
89454
90010
|
const signature = await this.wallet.signTypedData(
|
|
@@ -89490,7 +90046,7 @@ function decodeJwtExp(token) {
|
|
|
89490
90046
|
}
|
|
89491
90047
|
|
|
89492
90048
|
// src/boundary/upstream/real/write-ops.ts
|
|
89493
|
-
var
|
|
90049
|
+
var import_ethers53 = require("ethers");
|
|
89494
90050
|
|
|
89495
90051
|
// src/signer/types.ts
|
|
89496
90052
|
var OperationDeclined = class extends Error {
|
|
@@ -89500,7 +90056,7 @@ var OperationDeclined = class extends Error {
|
|
|
89500
90056
|
init_tx_validator();
|
|
89501
90057
|
|
|
89502
90058
|
// src/boundary/upstream/shared/external-bridge/page-crypto.ts
|
|
89503
|
-
var
|
|
90059
|
+
var import_ethers52 = require("ethers");
|
|
89504
90060
|
var PERSONAL_SIGN_LAYOUTS = {
|
|
89505
90061
|
"dh-op-envelope-v1": {
|
|
89506
90062
|
types: ["bytes32", "uint256", "uint256", "uint256", "bytes32"],
|
|
@@ -89515,9 +90071,9 @@ function hashForLayout(layout, fields) {
|
|
|
89515
90071
|
const values = def.fieldOrder.map((name) => {
|
|
89516
90072
|
const raw = fields[name];
|
|
89517
90073
|
if (raw === void 0) throw new Error(`page-crypto: layout "${layout}" missing field "${name}"`);
|
|
89518
|
-
return hashUtf8.has(name) ?
|
|
90074
|
+
return hashUtf8.has(name) ? import_ethers52.ethers.keccak256(import_ethers52.ethers.toUtf8Bytes(raw)) : raw;
|
|
89519
90075
|
});
|
|
89520
|
-
return
|
|
90076
|
+
return import_ethers52.ethers.solidityPackedKeccak256(def.types, values);
|
|
89521
90077
|
}
|
|
89522
90078
|
var PAGE_CRYPTO_JS = `"use strict";
|
|
89523
90079
|
(function () {
|
|
@@ -89756,7 +90312,7 @@ function mcpExpected(leg) {
|
|
|
89756
90312
|
}
|
|
89757
90313
|
var OP_LAYOUT = "dh-op-envelope-v1";
|
|
89758
90314
|
function randomNonceHex() {
|
|
89759
|
-
return "0x" + Buffer.from(
|
|
90315
|
+
return "0x" + Buffer.from(import_ethers53.ethers.randomBytes(16)).toString("hex");
|
|
89760
90316
|
}
|
|
89761
90317
|
async function postJson(url2, body, headers) {
|
|
89762
90318
|
const res = await fetch(url2, {
|
|
@@ -89824,7 +90380,7 @@ function buildWriteOps(deps) {
|
|
|
89824
90380
|
return {
|
|
89825
90381
|
to: String(tx2["to"] ?? ""),
|
|
89826
90382
|
data: String(tx2["data"] ?? "0x"),
|
|
89827
|
-
value: tx2["value"] != null ?
|
|
90383
|
+
value: tx2["value"] != null ? import_ethers53.ethers.toBeHex(BigInt(String(tx2["value"]))) : "0x0",
|
|
89828
90384
|
chainId: tx2["chainId"] != null ? Number(tx2["chainId"]) : chainId
|
|
89829
90385
|
};
|
|
89830
90386
|
}
|
|
@@ -89990,7 +90546,7 @@ function buildWriteOps(deps) {
|
|
|
89990
90546
|
mintedUcdWei: minted,
|
|
89991
90547
|
feeUcdWei: mintFee,
|
|
89992
90548
|
echoedAmountUcdWei: minted,
|
|
89993
|
-
authorization: auth(action, `mint ${
|
|
90549
|
+
authorization: auth(action, `mint ${import_ethers53.ethers.formatEther(amountWei)} UCD against ${p.positionId}`, r.value.digest)
|
|
89994
90550
|
},
|
|
89995
90551
|
{ id: SOURCE5, kind: "lit-ops", fetchedAt: (/* @__PURE__ */ new Date()).toISOString() }
|
|
89996
90552
|
);
|
|
@@ -90031,7 +90587,7 @@ function buildWriteOps(deps) {
|
|
|
90031
90587
|
txRef: { kind: "eth-tx", id: r.value.txHash },
|
|
90032
90588
|
paidUcdWei: paid,
|
|
90033
90589
|
echoedAmountUcdWei: paid,
|
|
90034
|
-
authorization: auth(action, `repay ${
|
|
90590
|
+
authorization: auth(action, `repay ${import_ethers53.ethers.formatEther(amountWei)} UCD on ${p.positionId}`, r.value.digest)
|
|
90035
90591
|
},
|
|
90036
90592
|
{ id: SOURCE5, kind: "lit-ops", fetchedAt: (/* @__PURE__ */ new Date()).toISOString() }
|
|
90037
90593
|
);
|
|
@@ -90294,7 +90850,7 @@ function buildWriteOps(deps) {
|
|
|
90294
90850
|
}
|
|
90295
90851
|
|
|
90296
90852
|
// src/signer/eoa-dh.ts
|
|
90297
|
-
var
|
|
90853
|
+
var import_ethers54 = require("ethers");
|
|
90298
90854
|
var EoaDHSigner = class {
|
|
90299
90855
|
constructor(wallet, broadcast, clock = Date.now) {
|
|
90300
90856
|
this.wallet = wallet;
|
|
@@ -90311,7 +90867,7 @@ var EoaDHSigner = class {
|
|
|
90311
90867
|
async signAuthorization(spec) {
|
|
90312
90868
|
const quantumTs = nextQuantumTimestamp(this.clock());
|
|
90313
90869
|
const { fields, hashHex } = spec.stamp(quantumTs);
|
|
90314
|
-
const signature = await this.wallet.signMessage(
|
|
90870
|
+
const signature = await this.wallet.signMessage(import_ethers54.ethers.getBytes(hashHex));
|
|
90315
90871
|
return { signature, quantumTs, fields };
|
|
90316
90872
|
}
|
|
90317
90873
|
async wrapInnerTx(innerTx) {
|
|
@@ -90329,13 +90885,13 @@ var EoaDHSigner = class {
|
|
|
90329
90885
|
|
|
90330
90886
|
// src/signer/external-eoa.ts
|
|
90331
90887
|
var import_node_crypto7 = require("crypto");
|
|
90332
|
-
var
|
|
90888
|
+
var import_ethers58 = require("ethers");
|
|
90333
90889
|
|
|
90334
90890
|
// src/boundary/upstream/shared/external-bridge/bridge.ts
|
|
90335
90891
|
var fs4 = __toESM(require("fs"));
|
|
90336
90892
|
var http3 = __toESM(require("http"));
|
|
90337
90893
|
var import_node_crypto6 = require("crypto");
|
|
90338
|
-
var
|
|
90894
|
+
var import_ethers56 = require("ethers");
|
|
90339
90895
|
|
|
90340
90896
|
// src/util/brand-assets.ts
|
|
90341
90897
|
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>`;
|
|
@@ -90946,7 +91502,7 @@ function presenceStatement(origin2, chainId, nonce) {
|
|
|
90946
91502
|
}
|
|
90947
91503
|
function recoverPresenceSigner(statement, signature) {
|
|
90948
91504
|
try {
|
|
90949
|
-
return
|
|
91505
|
+
return import_ethers56.ethers.verifyMessage(statement, signature);
|
|
90950
91506
|
} catch {
|
|
90951
91507
|
return null;
|
|
90952
91508
|
}
|
|
@@ -92193,7 +92749,7 @@ data: ${JSON.stringify(payload)}
|
|
|
92193
92749
|
};
|
|
92194
92750
|
|
|
92195
92751
|
// src/boundary/upstream/shared/external-bridge/verify-landed-tx.ts
|
|
92196
|
-
var
|
|
92752
|
+
var import_ethers57 = require("ethers");
|
|
92197
92753
|
function eq2(a, b) {
|
|
92198
92754
|
return a.toLowerCase() === b.toLowerCase();
|
|
92199
92755
|
}
|
|
@@ -92216,7 +92772,7 @@ function compareLandedTx(landed, approved, borrower) {
|
|
|
92216
92772
|
return { status: "verified", from: landed.from, hash: landed.hash };
|
|
92217
92773
|
}
|
|
92218
92774
|
function verifyRawSignedTx(rawSignedTx, approved, borrower) {
|
|
92219
|
-
const parsed =
|
|
92775
|
+
const parsed = import_ethers57.ethers.Transaction.from(rawSignedTx);
|
|
92220
92776
|
if (!parsed.from || !parsed.to || !parsed.hash) {
|
|
92221
92777
|
return { status: "mismatch", hash: parsed.hash ?? "0x", reason: "the returned raw transaction is unsigned or malformed" };
|
|
92222
92778
|
}
|
|
@@ -92263,7 +92819,7 @@ async function gasHintAcrossBlocks(provider, from, tx2, action) {
|
|
|
92263
92819
|
for (let attempt = 0; attempt < 4; attempt++) {
|
|
92264
92820
|
try {
|
|
92265
92821
|
const est = await provider.estimateGas({ from, to: tx2.to, data: tx2.data, value: BigInt(tx2.value) });
|
|
92266
|
-
return
|
|
92822
|
+
return import_ethers58.ethers.toBeHex(est * 15n / 10n);
|
|
92267
92823
|
} catch (e) {
|
|
92268
92824
|
lastErr = e;
|
|
92269
92825
|
await new Promise((r) => setTimeout(r, 13e3));
|
|
@@ -92313,7 +92869,7 @@ var ExternalEoaDHSigner = class {
|
|
|
92313
92869
|
throw new OperationDeclined(`the ${spec.action} authorization was not signed: ${describeOutcome(outcome)}`);
|
|
92314
92870
|
}
|
|
92315
92871
|
const finalHash = spec.stamp(used.quantumTs).hashHex;
|
|
92316
|
-
const recovered =
|
|
92872
|
+
const recovered = import_ethers58.ethers.verifyMessage(import_ethers58.ethers.getBytes(finalHash), outcome.signature);
|
|
92317
92873
|
if (recovered.toLowerCase() !== this.deps.borrower.toLowerCase()) {
|
|
92318
92874
|
throw new Error(`the ${spec.action} authorization was signed by ${recovered}, not the borrower ${this.deps.borrower}`);
|
|
92319
92875
|
}
|
|
@@ -92324,7 +92880,7 @@ var ExternalEoaDHSigner = class {
|
|
|
92324
92880
|
}
|
|
92325
92881
|
async submitValidatedTx(outerTx, ctx) {
|
|
92326
92882
|
const approved = toApprovedTx(outerTx, this.deps.chainId);
|
|
92327
|
-
const gas = outerTx.gasLimit != null ?
|
|
92883
|
+
const gas = outerTx.gasLimit != null ? import_ethers58.ethers.toBeHex(BigInt(String(outerTx.gasLimit))) : await gasHintAcrossBlocks(this.deps.provider, this.deps.borrower, approved, ctx.action);
|
|
92328
92884
|
const outcome = await this.deps.bridge.requestSignature({
|
|
92329
92885
|
id: (0, import_node_crypto7.randomUUID)(),
|
|
92330
92886
|
kind: "transaction",
|
|
@@ -92358,7 +92914,7 @@ var ExternalEoaDHSigner = class {
|
|
|
92358
92914
|
return new BridgeEthersSigner(this.deps);
|
|
92359
92915
|
}
|
|
92360
92916
|
};
|
|
92361
|
-
var BridgeEthersSigner = class _BridgeEthersSigner extends
|
|
92917
|
+
var BridgeEthersSigner = class _BridgeEthersSigner extends import_ethers58.ethers.AbstractSigner {
|
|
92362
92918
|
constructor(deps) {
|
|
92363
92919
|
super(deps.provider);
|
|
92364
92920
|
this.deps = deps;
|
|
@@ -92369,7 +92925,7 @@ var BridgeEthersSigner = class _BridgeEthersSigner extends import_ethers55.ether
|
|
|
92369
92925
|
return this.deps.borrower;
|
|
92370
92926
|
}
|
|
92371
92927
|
async signMessage(message2) {
|
|
92372
|
-
const length = typeof message2 === "string" ?
|
|
92928
|
+
const length = typeof message2 === "string" ? import_ethers58.ethers.toUtf8Bytes(message2).length : message2.length;
|
|
92373
92929
|
throw new Error(
|
|
92374
92930
|
`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.`
|
|
92375
92931
|
);
|
|
@@ -92422,7 +92978,7 @@ var BridgeEthersSigner = class _BridgeEthersSigner extends import_ethers55.ether
|
|
|
92422
92978
|
const structs = Object.fromEntries(
|
|
92423
92979
|
Object.entries(types).filter(([name]) => name !== "EIP712Domain").map(([name, fields]) => [name, fields.map((f) => ({ name: f.name, type: f.type }))])
|
|
92424
92980
|
);
|
|
92425
|
-
const primaryType =
|
|
92981
|
+
const primaryType = import_ethers58.ethers.TypedDataEncoder.getPrimaryType(structs);
|
|
92426
92982
|
const { label } = this.deps.guardTypedData(this.deps.chainId, domain, structs, primaryType, message2);
|
|
92427
92983
|
const typedData = { domain, types: structs, primaryType, message: message2 };
|
|
92428
92984
|
if (BTC_SPEND_PRIMARY_TYPES.has(primaryType)) {
|
|
@@ -92480,17 +93036,17 @@ var BridgeEthersSigner = class _BridgeEthersSigner extends import_ethers55.ether
|
|
|
92480
93036
|
async verifyTypedSigner(typedData, signature) {
|
|
92481
93037
|
const types = typedData.types;
|
|
92482
93038
|
let recovered = null;
|
|
92483
|
-
if (
|
|
92484
|
-
const v = Number(BigInt(
|
|
93039
|
+
if (import_ethers58.ethers.isHexString(signature, 65)) {
|
|
93040
|
+
const v = Number(BigInt(import_ethers58.ethers.dataSlice(signature, 64, 65)));
|
|
92485
93041
|
if (v === 0 || v === 1 || v === 27 || v === 28) {
|
|
92486
|
-
recovered =
|
|
93042
|
+
recovered = import_ethers58.ethers.verifyTypedData(typedData.domain, types, typedData.message, signature);
|
|
92487
93043
|
if (recovered.toLowerCase() === this.deps.borrower.toLowerCase()) return;
|
|
92488
93044
|
}
|
|
92489
93045
|
}
|
|
92490
93046
|
const code = await this.deps.provider.getCode(this.deps.borrower);
|
|
92491
93047
|
if (codeIsContractWallet(code)) {
|
|
92492
|
-
const digest =
|
|
92493
|
-
const wallet = new
|
|
93048
|
+
const digest = import_ethers58.ethers.TypedDataEncoder.hash(typedData.domain, types, typedData.message);
|
|
93049
|
+
const wallet = new import_ethers58.ethers.Contract(
|
|
92494
93050
|
this.deps.borrower,
|
|
92495
93051
|
["function isValidSignature(bytes32,bytes) view returns (bytes4)"],
|
|
92496
93052
|
this.deps.provider
|
|
@@ -92514,11 +93070,11 @@ var BridgeEthersSigner = class _BridgeEthersSigner extends import_ethers55.ether
|
|
|
92514
93070
|
const approved = {
|
|
92515
93071
|
to: tx2.to,
|
|
92516
93072
|
data: tx2.data,
|
|
92517
|
-
value: tx2.value != null ?
|
|
93073
|
+
value: tx2.value != null ? import_ethers58.ethers.toBeHex(BigInt(String(tx2.value))) : "0x0",
|
|
92518
93074
|
chainId: tx2.chainId != null ? Number(tx2.chainId) : this.deps.chainId
|
|
92519
93075
|
};
|
|
92520
93076
|
const card = cardForTx(approved);
|
|
92521
|
-
const gas = tx2.gasLimit != null ?
|
|
93077
|
+
const gas = tx2.gasLimit != null ? import_ethers58.ethers.toBeHex(BigInt(String(tx2.gasLimit))) : await gasHintAcrossBlocks(this.deps.provider, this.deps.borrower, approved, describeFn(approved.data));
|
|
92522
93078
|
const outcome = await this.deps.bridge.requestSignature({
|
|
92523
93079
|
id: (0, import_node_crypto7.randomUUID)(),
|
|
92524
93080
|
kind: "transaction",
|
|
@@ -92560,7 +93116,7 @@ function toApprovedTx(tx2, fallbackChainId) {
|
|
|
92560
93116
|
return {
|
|
92561
93117
|
to: tx2.to,
|
|
92562
93118
|
data: tx2.data,
|
|
92563
|
-
value: tx2.value != null ?
|
|
93119
|
+
value: tx2.value != null ? import_ethers58.ethers.toBeHex(BigInt(String(tx2.value))) : "0x0",
|
|
92564
93120
|
chainId: tx2.chainId != null ? Number(tx2.chainId) : fallbackChainId
|
|
92565
93121
|
};
|
|
92566
93122
|
}
|
|
@@ -92610,9 +93166,9 @@ var MIN_CONFIRMATIONS = { mainnet: 6, sepolia: 1 };
|
|
|
92610
93166
|
var RealUpstreamPlugin = class {
|
|
92611
93167
|
constructor(config, wallet, runtime) {
|
|
92612
93168
|
this.config = config;
|
|
92613
|
-
const rpc = new
|
|
93169
|
+
const rpc = new import_ethers59.ethers.FetchRequest(config.rpcUrl);
|
|
92614
93170
|
if (config.rpcDrpcKey !== void 0) rpc.setHeader("Drpc-Key", config.rpcDrpcKey);
|
|
92615
|
-
this.provider = new
|
|
93171
|
+
this.provider = new import_ethers59.ethers.JsonRpcProvider(rpc, config.chainId);
|
|
92616
93172
|
this.wallet = wallet ?? null;
|
|
92617
93173
|
this.runtime = runtime ?? null;
|
|
92618
93174
|
this.session = wallet ? new LitOpsSession(wallet.connect(this.provider), config.serviceEndpoint, config.chainId) : null;
|
|
@@ -92919,14 +93475,14 @@ var RealUpstreamPlugin = class {
|
|
|
92919
93475
|
if (!pkpValidation) {
|
|
92920
93476
|
throw new Error(`the SDK's ${this.config.network} deployment table has no PKPValidation address \u2014 cannot verify validator version ${version}.`);
|
|
92921
93477
|
}
|
|
92922
|
-
const registry = new
|
|
93478
|
+
const registry = new import_ethers59.ethers.Contract(pkpValidation, ["function validatorForVersion(uint256) view returns (address)"], this.provider);
|
|
92923
93479
|
let validator;
|
|
92924
93480
|
try {
|
|
92925
93481
|
validator = await registry.validatorForVersion(version);
|
|
92926
93482
|
} catch (e) {
|
|
92927
93483
|
throw new Error(`could not verify validator version ${version} on-chain (PKPValidation ${pkpValidation}): ${e.message}`);
|
|
92928
93484
|
}
|
|
92929
|
-
if (validator ===
|
|
93485
|
+
if (validator === import_ethers59.ethers.ZeroAddress) {
|
|
92930
93486
|
throw new Error(
|
|
92931
93487
|
`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.`
|
|
92932
93488
|
);
|
|
@@ -93219,7 +93775,7 @@ var RealUpstreamPlugin = class {
|
|
|
93219
93775
|
);
|
|
93220
93776
|
if (!r.ok) return r;
|
|
93221
93777
|
const raw = r.value.data.supportedStablecoins ?? [];
|
|
93222
|
-
const bad = raw.find((x) => !
|
|
93778
|
+
const bad = raw.find((x) => !import_ethers59.ethers.isAddress(String(x.address)) || !Number.isFinite(Number(x.decimals)));
|
|
93223
93779
|
if (bad) {
|
|
93224
93780
|
return {
|
|
93225
93781
|
ok: false,
|
|
@@ -93302,7 +93858,7 @@ var RealUpstreamPlugin = class {
|
|
|
93302
93858
|
};
|
|
93303
93859
|
}
|
|
93304
93860
|
const symbol = raw.toLowerCase();
|
|
93305
|
-
if (
|
|
93861
|
+
if (import_ethers59.ethers.isAddress(raw)) return this.psmCallsFor(symbol);
|
|
93306
93862
|
const verified = await this.verifiedStablecoins();
|
|
93307
93863
|
if (!verified.ok) return { ok: false, failure: verified.failure };
|
|
93308
93864
|
const hits = verified.rows.filter((r) => r.symbol.toLowerCase() === symbol);
|
|
@@ -93340,7 +93896,7 @@ var RealUpstreamPlugin = class {
|
|
|
93340
93896
|
* chain, then sign.
|
|
93341
93897
|
*/
|
|
93342
93898
|
async psmCallsFor(stablecoinAddress) {
|
|
93343
|
-
if (!
|
|
93899
|
+
if (!import_ethers59.ethers.isAddress(stablecoinAddress)) {
|
|
93344
93900
|
throw new Error(`psmCallsFor requires a resolved 0x address, got '${stablecoinAddress}' \u2014 resolve through psmCallsForChoice`);
|
|
93345
93901
|
}
|
|
93346
93902
|
const key = stablecoinAddress.toLowerCase();
|
|
@@ -93359,7 +93915,7 @@ var RealUpstreamPlugin = class {
|
|
|
93359
93915
|
}
|
|
93360
93916
|
let supported;
|
|
93361
93917
|
try {
|
|
93362
|
-
const psm = new
|
|
93918
|
+
const psm = new import_ethers59.ethers.Contract(psmAddress, ["function supportedStablecoins(address) view returns (bool)"], this.provider);
|
|
93363
93919
|
supported = await psm["supportedStablecoins"](key);
|
|
93364
93920
|
} catch (e) {
|
|
93365
93921
|
return { ok: false, failure: { kind: "unavailable", source: "chain-rpc", message: `PSM stablecoin check failed for ${key}: ${e.message}` } };
|
|
@@ -93376,7 +93932,7 @@ var RealUpstreamPlugin = class {
|
|
|
93376
93932
|
}
|
|
93377
93933
|
let symbol;
|
|
93378
93934
|
try {
|
|
93379
|
-
const erc20 = new
|
|
93935
|
+
const erc20 = new import_ethers59.ethers.Contract(key, ["function symbol() view returns (string)"], this.provider);
|
|
93380
93936
|
symbol = await erc20["symbol"]();
|
|
93381
93937
|
} catch (e) {
|
|
93382
93938
|
return { ok: false, failure: { kind: "unavailable", source: "chain-rpc", message: `PSM stablecoin symbol read failed for ${key}: ${e.message}` } };
|
|
@@ -93591,7 +94147,7 @@ var RealUpstreamPlugin = class {
|
|
|
93591
94147
|
const pm = this.contracts["PositionManager"];
|
|
93592
94148
|
if (!pm) return false;
|
|
93593
94149
|
try {
|
|
93594
|
-
const c = new
|
|
94150
|
+
const c = new import_ethers59.ethers.Contract(pm, PAUSABLE_ABI, this.provider);
|
|
93595
94151
|
return Boolean(await c["paused"]());
|
|
93596
94152
|
} catch {
|
|
93597
94153
|
return false;
|
|
@@ -93600,10 +94156,10 @@ var RealUpstreamPlugin = class {
|
|
|
93600
94156
|
async readPositionDetails(id) {
|
|
93601
94157
|
const core = this.contracts["PositionManagerCoreModule"] ?? this.contracts["PositionManager"];
|
|
93602
94158
|
if (!core) throw new Error(`no PositionManager address for network ${this.config.network}`);
|
|
93603
|
-
const c = new
|
|
94159
|
+
const c = new import_ethers59.ethers.Contract(core, POSITION_DETAILS_ABI, this.provider);
|
|
93604
94160
|
let d;
|
|
93605
94161
|
try {
|
|
93606
|
-
d = await c["getPositionDetails"](
|
|
94162
|
+
d = await c["getPositionDetails"](import_ethers59.ethers.zeroPadValue(id, 32));
|
|
93607
94163
|
} catch (e) {
|
|
93608
94164
|
if (isContractRevert(e)) return null;
|
|
93609
94165
|
const nodeMessage = e.info?.error?.message;
|
|
@@ -93613,7 +94169,7 @@ var RealUpstreamPlugin = class {
|
|
|
93613
94169
|
throw e;
|
|
93614
94170
|
}
|
|
93615
94171
|
const borrower = String(d["borrower"]);
|
|
93616
|
-
if (borrower ===
|
|
94172
|
+
if (borrower === import_ethers59.ethers.ZeroAddress) return null;
|
|
93617
94173
|
return {
|
|
93618
94174
|
positionId: String(d["positionId"]),
|
|
93619
94175
|
pkpId: String(d["pkpId"]),
|
|
@@ -93819,7 +94375,7 @@ async function createRealBoundary(config, wallet, overrides) {
|
|
|
93819
94375
|
const manager = new SignerManager({
|
|
93820
94376
|
persistence: overrides?.signerPersistence?.(config.network) ?? fileSignerPersistence(stateFile),
|
|
93821
94377
|
initialMode,
|
|
93822
|
-
...overrides?.boundBorrower ? { authenticatedBorrower:
|
|
94378
|
+
...overrides?.boundBorrower ? { authenticatedBorrower: import_ethers60.ethers.getAddress(overrides.boundBorrower) } : {},
|
|
93823
94379
|
candidate: () => bridge.walletState()?.account ?? null,
|
|
93824
94380
|
pendingCeremonies: () => bridge.pendingCount(),
|
|
93825
94381
|
keystore
|
|
@@ -93915,8 +94471,8 @@ async function buildBoundary(configResult, overrides) {
|
|
|
93915
94471
|
);
|
|
93916
94472
|
}
|
|
93917
94473
|
try {
|
|
93918
|
-
const decrypted = await
|
|
93919
|
-
if (!(decrypted instanceof
|
|
94474
|
+
const decrypted = await import_ethers61.ethers.Wallet.fromEncryptedJson(keystoreJson, config.keystorePassword);
|
|
94475
|
+
if (!(decrypted instanceof import_ethers61.ethers.Wallet)) {
|
|
93920
94476
|
return bootError("DH_KEYSTORE_PATH did not decrypt to an EOA wallet keystore.", ["DH_KEYSTORE_PATH"]);
|
|
93921
94477
|
}
|
|
93922
94478
|
wallet = decrypted;
|
|
@@ -94205,7 +94761,7 @@ function registerBoundaryInfoResource(server, getB) {
|
|
|
94205
94761
|
}
|
|
94206
94762
|
|
|
94207
94763
|
// src/version.ts
|
|
94208
|
-
var SERVER_VERSION = "0.5.
|
|
94764
|
+
var SERVER_VERSION = "0.5.29";
|
|
94209
94765
|
|
|
94210
94766
|
// src/server.ts
|
|
94211
94767
|
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.";
|
|
@@ -94341,7 +94897,7 @@ function renderLandingPage(input) {
|
|
|
94341
94897
|
|
|
94342
94898
|
// src/connector/siwe-oauth.ts
|
|
94343
94899
|
var import_node_crypto10 = require("crypto");
|
|
94344
|
-
var
|
|
94900
|
+
var import_ethers62 = require("ethers");
|
|
94345
94901
|
var import_errors10 = require("@modelcontextprotocol/sdk/server/auth/errors.js");
|
|
94346
94902
|
|
|
94347
94903
|
// src/connector/siwe-page.ts
|
|
@@ -94666,8 +95222,8 @@ var SiweOAuthProvider = class {
|
|
|
94666
95222
|
siweMessage(flowId, address) {
|
|
94667
95223
|
const flow = this.liveFlow(flowId);
|
|
94668
95224
|
if (!flow) return { ok: false, status: 404, reason: "unknown or expired sign-in flow \u2014 restart the connection from claude.ai" };
|
|
94669
|
-
if (!
|
|
94670
|
-
const checksummed =
|
|
95225
|
+
if (!import_ethers62.ethers.isAddress(address)) return { ok: false, status: 400, reason: "not a valid wallet address" };
|
|
95226
|
+
const checksummed = import_ethers62.ethers.getAddress(address);
|
|
94671
95227
|
flow.siwe = { address: checksummed, message: this.mintSiweMessage(checksummed, flow) };
|
|
94672
95228
|
return { ok: true, message: flow.siwe.message };
|
|
94673
95229
|
}
|
|
@@ -94789,17 +95345,17 @@ Issued At: ${new Date(this.clock()).toISOString()}`;
|
|
|
94789
95345
|
true
|
|
94790
95346
|
);
|
|
94791
95347
|
};
|
|
94792
|
-
if (!
|
|
95348
|
+
if (!import_ethers62.ethers.isAddress(account)) {
|
|
94793
95349
|
fail(400, "the connected wallet reported an invalid address");
|
|
94794
95350
|
return;
|
|
94795
95351
|
}
|
|
94796
|
-
const checksummed =
|
|
95352
|
+
const checksummed = import_ethers62.ethers.getAddress(account);
|
|
94797
95353
|
const message2 = this.mintSiweMessage(checksummed, flow);
|
|
94798
95354
|
flow.siwe = { address: checksummed, message: message2 };
|
|
94799
95355
|
flow.wc.state = "awaiting-signature";
|
|
94800
95356
|
let signature;
|
|
94801
95357
|
try {
|
|
94802
|
-
signature = await transport.request("personal_sign", [
|
|
95358
|
+
signature = await transport.request("personal_sign", [import_ethers62.ethers.hexlify(import_ethers62.ethers.toUtf8Bytes(message2)), checksummed]);
|
|
94803
95359
|
} catch (e) {
|
|
94804
95360
|
const msg = e instanceof Error ? e.message : String(e);
|
|
94805
95361
|
const declined = e.code === 4001 || /reject|declin|denied|cancel/i.test(msg);
|
|
@@ -94808,7 +95364,7 @@ Issued At: ${new Date(this.clock()).toISOString()}`;
|
|
|
94808
95364
|
}
|
|
94809
95365
|
let recovered;
|
|
94810
95366
|
try {
|
|
94811
|
-
recovered =
|
|
95367
|
+
recovered = import_ethers62.ethers.verifyMessage(message2, signature);
|
|
94812
95368
|
} catch {
|
|
94813
95369
|
fail(400, "the signature is not a valid Ethereum signature");
|
|
94814
95370
|
return;
|
|
@@ -94882,7 +95438,7 @@ Issued At: ${new Date(this.clock()).toISOString()}`;
|
|
|
94882
95438
|
if (!flow.siwe) return { ok: false, status: 400, reason: "no wallet address was reported for this flow yet" };
|
|
94883
95439
|
let recovered;
|
|
94884
95440
|
try {
|
|
94885
|
-
recovered =
|
|
95441
|
+
recovered = import_ethers62.ethers.verifyMessage(flow.siwe.message, signature);
|
|
94886
95442
|
} catch {
|
|
94887
95443
|
return { ok: false, status: 400, reason: "the signature is not a valid Ethereum signature" };
|
|
94888
95444
|
}
|
|
@@ -96802,7 +97358,7 @@ mime-types/index.js:
|
|
|
96802
97358
|
*)
|
|
96803
97359
|
|
|
96804
97360
|
axios/dist/node/axios.cjs:
|
|
96805
|
-
(*! Axios v1.21.
|
|
97361
|
+
(*! Axios v1.21.1 Copyright (c) 2026 Matt Zabriskie and contributors *)
|
|
96806
97362
|
|
|
96807
97363
|
safe-buffer/index.js:
|
|
96808
97364
|
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|