@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.
@@ -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(/[[\]\\/()*+?.^$|]/g, "\\$&");
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 import_ethers60 = require("ethers");
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
- ...import_ethers60.ethers,
18588
+ ...import_ethers63.ethers,
18589
18589
  providers: {
18590
- StaticJsonRpcProvider: import_ethers60.ethers.JsonRpcProvider
18590
+ StaticJsonRpcProvider: import_ethers63.ethers.JsonRpcProvider
18591
18591
  },
18592
- Contract: import_ethers60.ethers.Contract,
18593
- utils: import_ethers60.ethers
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 settle2(resolve, reject, response) {
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.0";
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 settle2(resolve, reject, {
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 settle2(resolve, reject, {
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
- settle2(resolve, reject, response);
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
- settle2(resolve, reject, response);
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
- settle2(function _resolve(value) {
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
- settle2(resolve, reject, {
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 elapsedSince2(start) {
24232
- return Math.max(0, Date.now() - start);
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 start = Date.now();
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, import_ethers52, WC_SESSION_METHODS, WC_DAPP_METADATA, EVENTS, WcTransport;
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
- import_ethers52 = require("ethers");
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: [import_ethers52.ethers.hexlify(import_ethers52.ethers.toUtf8Bytes(statement)), candidate.account] }
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 };
@@ -44549,14 +44553,14 @@ function resolveRealConfig(env) {
44549
44553
 
44550
44554
  // src/boot.ts
44551
44555
  var fs6 = __toESM(require("fs"));
44552
- var import_ethers58 = require("ethers");
44556
+ var import_ethers61 = require("ethers");
44553
44557
 
44554
44558
  // src/boundary/index.ts
44555
44559
  var import_node_crypto8 = require("crypto");
44556
44560
  var fs5 = __toESM(require("fs"));
44557
44561
  var os2 = __toESM(require("os"));
44558
44562
  var path4 = __toESM(require("path"));
44559
- var import_ethers57 = require("ethers");
44563
+ var import_ethers60 = require("ethers");
44560
44564
 
44561
44565
  // src/boundary/envelope.ts
44562
44566
  function okEnvelope(data, source, warnings = []) {
@@ -44965,7 +44969,7 @@ var BoundaryCore = class {
44965
44969
  const inToken = toUcd ? s.stablecoinSymbol : "UCD";
44966
44970
  const inUnit = toUcd ? `${s.stablecoinSymbol} smallest units (${s.stablecoinDecimals} decimals)` : "UCD wei (18 decimals)";
44967
44971
  const amountIn = parseDecimalUnits(p.amount, inDecimals);
44968
- const refuse3 = (refusal, message, details) => ({
44972
+ const refuse4 = (refusal, message, details) => ({
44969
44973
  env: errEnvelope(
44970
44974
  boundaryError("UPSTREAM_REJECTED", message, {
44971
44975
  source: statusR.source.id,
@@ -44976,13 +44980,13 @@ var BoundaryCore = class {
44976
44980
  });
44977
44981
  const named = (units) => `${formatDecimalUnits(units, inDecimals)} ${inToken} (${units} ${inUnit})`;
44978
44982
  if (s.paused) {
44979
- return refuse3(
44983
+ return refuse4(
44980
44984
  "psm-paused",
44981
44985
  "the PSM is paused \u2014 BOTH exchange directions are disabled until an operator unpauses it (this is the PSM's own pause switch)."
44982
44986
  );
44983
44987
  }
44984
44988
  if (!toUcd && !s.redeemEnabled) {
44985
- return refuse3(
44989
+ return refuse4(
44986
44990
  "redeem-disabled",
44987
44991
  `redemptions are disabled (redeemEnabled = false) \u2014 UCD -> ${s.stablecoinSymbol} is refused; ${s.stablecoinSymbol} -> UCD swaps are unaffected.`
44988
44992
  );
@@ -44993,20 +44997,20 @@ var BoundaryCore = class {
44993
44997
  const min = BigInt(toUcd ? s.minSwapAmount : s.minRedeemAmount);
44994
44998
  const max = BigInt(toUcd ? s.maxSwapAmount : s.maxRedeemAmount);
44995
44999
  if (amountIn < min) {
44996
- return refuse3(
45000
+ return refuse4(
44997
45001
  "below-min",
44998
45002
  `${named(amountIn)} is below the minimum of ${named(min)} for the ${p.direction} direction.`,
44999
45003
  { amount: amountIn.toString(), minimum: min.toString(), unit: inUnit }
45000
45004
  );
45001
45005
  }
45002
45006
  if (max === 0n) {
45003
- return refuse3(
45007
+ return refuse4(
45004
45008
  "direction-disabled",
45005
45009
  `the ${p.direction} direction is DISABLED by configuration (${toUcd ? "maxSwapAmount" : "maxRedeemAmount"} is 0).`
45006
45010
  );
45007
45011
  }
45008
45012
  if (amountIn > max) {
45009
- return refuse3(
45013
+ return refuse4(
45010
45014
  "above-max",
45011
45015
  `${named(amountIn)} is above the maximum of ${named(max)} per operation for the ${p.direction} direction.`,
45012
45016
  { amount: amountIn.toString(), maximum: max.toString(), unit: inUnit }
@@ -45026,7 +45030,7 @@ var BoundaryCore = class {
45026
45030
  if (!toUcd) {
45027
45031
  const available = BigInt(s.availableReserves);
45028
45032
  if (available < amountOut) {
45029
- return refuse3(
45033
+ return refuse4(
45030
45034
  "insufficient-reserves",
45031
45035
  `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).`,
45032
45036
  { available: available.toString(), required: amountOut.toString(), unit: outUnit }
@@ -49279,7 +49283,7 @@ var SafeModuleCeremony = class {
49279
49283
  };
49280
49284
 
49281
49285
  // src/boundary/upstream/real/plugin.ts
49282
- var import_ethers56 = require("ethers");
49286
+ var import_ethers59 = require("ethers");
49283
49287
 
49284
49288
  // node_modules/@gvnrdao/dh-sdk/dist/index.mjs
49285
49289
  var import_ethers15 = require("ethers");
@@ -49293,6 +49297,7 @@ var import_ethers22 = require("ethers");
49293
49297
  var import_ethers23 = require("ethers");
49294
49298
  var import_ethers24 = require("ethers");
49295
49299
  var import_ethers25 = require("ethers");
49300
+ var import_ethers26 = require("ethers");
49296
49301
 
49297
49302
  // node_modules/@noble/hashes/esm/utils.js
49298
49303
  function isBytes(a) {
@@ -49740,11 +49745,11 @@ var ripemd1602 = ripemd160;
49740
49745
  // node_modules/@gvnrdao/dh-sdk/dist/index.mjs
49741
49746
  var import_bech32 = __toESM(require_dist(), 1);
49742
49747
  var import_bs58check = __toESM(require_bs58check(), 1);
49743
- var import_ethers26 = require("ethers");
49744
49748
  var import_ethers27 = require("ethers");
49745
49749
  var import_ethers28 = require("ethers");
49746
49750
  var import_ethers29 = require("ethers");
49747
49751
  var import_ethers30 = require("ethers");
49752
+ var import_ethers31 = require("ethers");
49748
49753
 
49749
49754
  // node_modules/axios/lib/helpers/bind.js
49750
49755
  function bind(fn, thisArg) {
@@ -51819,7 +51824,7 @@ var import_follow_redirects = __toESM(require_follow_redirects(), 1);
51819
51824
  var import_zlib = __toESM(require("zlib"), 1);
51820
51825
 
51821
51826
  // node_modules/axios/lib/env/data.js
51822
- var VERSION = "1.21.0";
51827
+ var VERSION = "1.21.1";
51823
51828
 
51824
51829
  // node_modules/axios/lib/helpers/parseProtocol.js
51825
51830
  function parseProtocol(url2) {
@@ -55320,8 +55325,11 @@ function throwIfCancellationRequested(config) {
55320
55325
  throw new CanceledError_default(null, config);
55321
55326
  }
55322
55327
  }
55323
- function elapsedSince(start) {
55324
- return Math.max(0, Date.now() - start);
55328
+ function resolveClock() {
55329
+ return typeof performance !== "undefined" && utils_default.isFunction(performance.now) ? () => performance.now() : Date.now;
55330
+ }
55331
+ function elapsedSince(now, start) {
55332
+ return Math.max(0, Math.round(now() - start));
55325
55333
  }
55326
55334
  function dispatchRequest(_config) {
55327
55335
  const config = utils_default.toSafeFlatObject(_config);
@@ -55332,11 +55340,12 @@ function dispatchRequest(_config) {
55332
55340
  config.headers.setContentType("application/x-www-form-urlencoded", false);
55333
55341
  }
55334
55342
  const adapter2 = adapters_default.getAdapter(config.adapter || defaults_default.adapter, config);
55335
- const start = Date.now();
55343
+ const now = resolveClock();
55344
+ const start = now();
55336
55345
  return adapter2(config).then(
55337
55346
  function onAdapterResolution(response) {
55338
55347
  throwIfCancellationRequested(config);
55339
- response.duration = elapsedSince(start);
55348
+ response.duration = elapsedSince(now, start);
55340
55349
  config.response = response;
55341
55350
  try {
55342
55351
  response.data = transformData.call(config, config.transformResponse, response);
@@ -55350,7 +55359,7 @@ function dispatchRequest(_config) {
55350
55359
  if (!isCancel(reason)) {
55351
55360
  throwIfCancellationRequested(config);
55352
55361
  if (reason && reason.response) {
55353
- reason.response.duration = elapsedSince(start);
55362
+ reason.response.duration = elapsedSince(now, start);
55354
55363
  config.response = reason.response;
55355
55364
  try {
55356
55365
  reason.response.data = transformData.call(
@@ -55940,16 +55949,17 @@ var {
55940
55949
  } = axios_default;
55941
55950
 
55942
55951
  // node_modules/@gvnrdao/dh-sdk/dist/index.mjs
55943
- var import_ethers31 = require("ethers");
55944
55952
  var import_ethers32 = require("ethers");
55945
55953
  var import_ethers33 = require("ethers");
55946
55954
  var import_ethers34 = require("ethers");
55947
55955
  var import_ethers35 = require("ethers");
55948
55956
  var import_ethers36 = require("ethers");
55949
55957
  var import_ethers37 = require("ethers");
55950
- var import_dh_lit_ops = __toESM(require_dist3(), 1);
55951
55958
  var import_ethers38 = require("ethers");
55952
55959
  var import_ethers39 = require("ethers");
55960
+ var import_dh_lit_ops = __toESM(require_dist3(), 1);
55961
+ var import_ethers40 = require("ethers");
55962
+ var import_ethers41 = require("ethers");
55953
55963
  var __create2 = Object.create;
55954
55964
  var __defProp2 = Object.defineProperty;
55955
55965
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -56047,8 +56057,6 @@ var init_deployment_addresses = __esm2({
56047
56057
  BitcoinProviderRegistry: "0xbfA0c48B070D0a9A9CD27469AeacFD2d4261cEE2",
56048
56058
  ContractVersionRegistry: "0x97E43AA6aFF2C0cf659d3aE501658D2Ef6777522",
56049
56059
  usdcToken: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
56050
- mockUsdcToken: "0x96409A98e0D322d6566b7F44a0fAbD1BD4ce2AEc",
56051
- mockUsdtToken: "0xF8b7fB38b17a310960E47805Be9adba0b0e0394D",
56052
56060
  PositionDelegateRegistry: "0x482369De283622E7b05731875ec137d4E3D208F9",
56053
56061
  FeeRecipientRegistry: "0x95795F8403DDb629E8527B2934C4e71f5fC0C374",
56054
56062
  BitcoinWithdrawalAddressRegistry: "0x6376D392097F0A81e51BD83960A97EA20eaf1dbe",
@@ -56233,10 +56241,10 @@ var init_deployment_addresses = __esm2({
56233
56241
  },
56234
56242
  StUSDCVault: {
56235
56243
  previousImplementation: "0x3619b14C23c5F7d950EF845481C2299939873004",
56236
- newImplementation: "0x3619b14C23c5F7d950EF845481C2299939873004",
56237
- upgradedAt: "2026-10-30T16:50:49.227Z",
56244
+ newImplementation: "0xE94DFBacA21fEFB0BB2e95D33510Ca702d2b6c5f",
56245
+ upgradedAt: "2026-11-08T16:07:36.867Z",
56238
56246
  upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
56239
- reason: "Initial StUSDCVault deployment"
56247
+ reason: "StUSDCVault 1.1.0: Phase 5 desk (linked StUSDCDeskLib 0x0880ce721b0A50C8Fe8d5c911097F0c24e57b6aA)"
56240
56248
  },
56241
56249
  CarryFeeReceiver: {
56242
56250
  previousImplementation: "0x9c43996C6f6BAD82F2A5152AbA61137E929EFA17",
@@ -56301,6 +56309,9 @@ var init_deployment_addresses = __esm2({
56301
56309
  setPKPValidationRegistryTx: "0xab6b7e610c1ecf68da9a1e1150e61631e1f2a945bec12608c8357e03be25c4a5",
56302
56310
  replacedAddress: "0xC8Ca02238fbCDAEbE6dbF804461D43F46F9406F4"
56303
56311
  },
56312
+ libraries: {
56313
+ StUSDCDeskLib: "0x0880ce721b0A50C8Fe8d5c911097F0c24e57b6aA"
56314
+ },
56304
56315
  latestEnv: {
56305
56316
  UCD_TOKEN: "0xdd817Ff47C9b8f81335Ac579895D8EA321Fa86Df",
56306
56317
  UCD_CONTROLLER: "0x360Bde4e489ee94E26601B206932De09EE60FF04",
@@ -56353,8 +56364,6 @@ var init_deployment_addresses = __esm2({
56353
56364
  CONTRACT_VERSION_REGISTRY: "0x97E43AA6aFF2C0cf659d3aE501658D2Ef6777522",
56354
56365
  CONTRACT_VERSION_REGISTRY_IMPL: "0xF3389De4bCeC735e4F6d35b9f71170D96037D1B7",
56355
56366
  USDC_TOKEN: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
56356
- MOCK_USDC_TOKEN: "0x96409A98e0D322d6566b7F44a0fAbD1BD4ce2AEc",
56357
- MOCK_USDT_TOKEN: "0xF8b7fB38b17a310960E47805Be9adba0b0e0394D",
56358
56367
  POSITION_DELEGATE_REGISTRY: "0x482369De283622E7b05731875ec137d4E3D208F9",
56359
56368
  POSITION_DELEGATE_REGISTRY_IMPL: "0xc681c48688cdAA966119E265e4a378ef8Fe0eBcA",
56360
56369
  AGENT_MODULE: "0xefb8C29C1e7e92ed7d81a52dbedaed74e37fe380",
@@ -56369,7 +56378,7 @@ var init_deployment_addresses = __esm2({
56369
56378
  STUCD_VAULT: "0xc04Dd4d6799FFDE57feAfD5B3B1B038827014fd3",
56370
56379
  STUCD_VAULT_IMPL: "0xd596A866ee5273aedaC21BC6e88649E087fC8EcB",
56371
56380
  STUSDC_VAULT: "0x7aBac04d4Bf2b3A63AF363B9527970791346463a",
56372
- STUSDC_VAULT_IMPL: "0x3619b14C23c5F7d950EF845481C2299939873004",
56381
+ STUSDC_VAULT_IMPL: "0xE94DFBacA21fEFB0BB2e95D33510Ca702d2b6c5f",
56373
56382
  CARRY_FEE_RECEIVER: "0x2C8e54f099Cf479182D7c87D76FeD88b4172cdB4",
56374
56383
  CARRY_FEE_RECEIVER_IMPL: "0x3a86A23ff3cd6c26B1Fa2C5aeBAeEEdbF6095D69",
56375
56384
  FEE_RECOGNITION_LEDGER: "0xA5EBfb856fe2b847cC6011B0fe2dB6ACE63D6C3c",
@@ -56401,8 +56410,6 @@ var init_deployment_addresses = __esm2({
56401
56410
  BitcoinProviderRegistry: "0xbfA0c48B070D0a9A9CD27469AeacFD2d4261cEE2",
56402
56411
  ContractVersionRegistry: "0x97E43AA6aFF2C0cf659d3aE501658D2Ef6777522",
56403
56412
  usdcToken: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
56404
- mockUsdcToken: "0x96409A98e0D322d6566b7F44a0fAbD1BD4ce2AEc",
56405
- mockUsdtToken: "0xF8b7fB38b17a310960E47805Be9adba0b0e0394D",
56406
56413
  PositionDelegateRegistry: "0x482369De283622E7b05731875ec137d4E3D208F9",
56407
56414
  FeeRecipientRegistry: "0x95795F8403DDb629E8527B2934C4e71f5fC0C374",
56408
56415
  BitcoinWithdrawalAddressRegistry: "0x6376D392097F0A81e51BD83960A97EA20eaf1dbe",
@@ -58429,7 +58436,7 @@ ${errorReport}`);
58429
58436
  }
58430
58437
  init_debug_logger();
58431
58438
  init_session_signature_cache();
58432
- var import_ethers262 = __require("ethers");
58439
+ var import_ethers282 = __require("ethers");
58433
58440
  var EXPIRED_LOAN_MIN_LIQUIDATION_THRESHOLD_BPS = 11e3;
58434
58441
  var EXPIRED_LOAN_MAX_ESCALATION_ITERATIONS = 365;
58435
58442
  var BASIS_POINTS_DENOMINATOR = 1e4;
@@ -61560,12 +61567,12 @@ ${auth.clientId}`;
61560
61567
  throw new Error(`executeVaultSnapshot requires a positive integer chainId, got ${String(chainId)}`);
61561
61568
  }
61562
61569
  global.ethers = {
61563
- ...import_ethers262.ethers,
61570
+ ...import_ethers282.ethers,
61564
61571
  providers: {
61565
- StaticJsonRpcProvider: import_ethers262.ethers.JsonRpcProvider
61572
+ StaticJsonRpcProvider: import_ethers282.ethers.JsonRpcProvider
61566
61573
  },
61567
- Contract: import_ethers262.ethers.Contract,
61568
- utils: import_ethers262.ethers
61574
+ Contract: import_ethers282.ethers.Contract,
61575
+ utils: import_ethers282.ethers
61569
61576
  // v6 moved utils to top level
61570
61577
  };
61571
61578
  global.Lit = {
@@ -61892,8 +61899,6 @@ function getSepoliaConfig() {
61892
61899
  positionManagerViews: SEPOLIA_CONTRACTS.PositionManagerViews || "",
61893
61900
  simplePsmV2: SEPOLIA_CONTRACTS.SimplePSMV2 || "",
61894
61901
  usdcToken: SEPOLIA_CONTRACTS.usdcToken || "",
61895
- mockUsdcToken: SEPOLIA_CONTRACTS.mockUsdcToken || "",
61896
- mockUsdtToken: SEPOLIA_CONTRACTS.mockUsdtToken || "",
61897
61902
  loanOperationsManager: SEPOLIA_CONTRACTS.LoanOperationsManagerModule || "",
61898
61903
  termManager: SEPOLIA_CONTRACTS.TermManagerModule || "",
61899
61904
  circuitBreaker: SEPOLIA_CONTRACTS.CircuitBreakerModule || "",
@@ -62463,12 +62468,6 @@ function assertFeeCeiling(gasLimit, maxFeePerGas, raise, ceiling = DEFAULT_FEE_C
62463
62468
  );
62464
62469
  }
62465
62470
  }
62466
- var MINT_UCD_GAS_CEILING = BigInt(13e5);
62467
- var WITHDRAW_BTC_GAS_CEILING = BigInt(3e6);
62468
- var MAKE_PAYMENT_GAS_CEILING = BigInt(1e6);
62469
- var EXTEND_POSITION_GAS_CEILING = BigInt(1e6);
62470
- var LIQUIDATION_COMMIT_GAS_CEILING = BigInt(2e6);
62471
- var LIQUIDATION_REVEAL_GAS_CEILING = BigInt(25e5);
62472
62471
  var FEE_HISTORY_BLOCK_COUNT = 20;
62473
62472
  var FEE_HISTORY_REWARD_PERCENTILE = 75;
62474
62473
  function isJsonRpcSendable(provider) {
@@ -63809,6 +63808,39 @@ var ServerSession = class {
63809
63808
  }
63810
63809
  }
63811
63810
  };
63811
+ var GAS_LIMIT_MULTIPLIER_NUMERATOR = 12n;
63812
+ var GAS_LIMIT_MULTIPLIER_DENOMINATOR = 10n;
63813
+ var GAS_LIMIT_HEADROOM = 262500n;
63814
+ var GasLimitCeilingError = class extends Error {
63815
+ constructor(estimate, gasLimit) {
63816
+ super(
63817
+ `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`
63818
+ );
63819
+ this.estimate = estimate;
63820
+ this.gasLimit = gasLimit;
63821
+ this.name = "GasLimitCeilingError";
63822
+ }
63823
+ };
63824
+ var GAS_ESTIMATE_RETRY_MARKER = "no gasLimit can be sized, so nothing was sent \u2014 retry";
63825
+ var GasEstimateUnavailableError = class extends Error {
63826
+ constructor(message, cause) {
63827
+ super(message);
63828
+ this.cause = cause;
63829
+ this.name = "GasEstimateUnavailableError";
63830
+ }
63831
+ retryable = true;
63832
+ };
63833
+ function sizeGasLimit(estimate) {
63834
+ if (estimate <= 0n) {
63835
+ throw new Error(`sizeGasLimit: estimate must be positive, got ${estimate}`);
63836
+ }
63837
+ const scaled = (estimate * GAS_LIMIT_MULTIPLIER_NUMERATOR + GAS_LIMIT_MULTIPLIER_DENOMINATOR - 1n) / GAS_LIMIT_MULTIPLIER_DENOMINATOR;
63838
+ const gasLimit = scaled + GAS_LIMIT_HEADROOM;
63839
+ if (gasLimit > MAX_GAS_LIMIT) {
63840
+ throw new GasLimitCeilingError(estimate, gasLimit);
63841
+ }
63842
+ return gasLimit;
63843
+ }
63812
63844
  var DEAD_ZONE_VIOLATION_SELECTOR = "0xbe4b82c1";
63813
63845
  var ERROR_STRING_SELECTOR = "0x08c379a0";
63814
63846
  var PANIC_SELECTOR = "0x4e487b71";
@@ -63836,13 +63868,13 @@ function decodeQuantumRevert(e) {
63836
63868
  if (!name && selector && data) {
63837
63869
  try {
63838
63870
  if (selector === ERROR_STRING_SELECTOR) {
63839
- const [message] = import_ethers21.AbiCoder.defaultAbiCoder().decode(
63871
+ const [message] = import_ethers22.AbiCoder.defaultAbiCoder().decode(
63840
63872
  ["string"],
63841
63873
  "0x" + data.slice(10)
63842
63874
  );
63843
63875
  name = `Error("${message}")`;
63844
63876
  } else if (selector === PANIC_SELECTOR) {
63845
- const [code] = import_ethers21.AbiCoder.defaultAbiCoder().decode(
63877
+ const [code] = import_ethers22.AbiCoder.defaultAbiCoder().decode(
63846
63878
  ["uint256"],
63847
63879
  "0x" + data.slice(10)
63848
63880
  );
@@ -63865,7 +63897,8 @@ function isRetryableQuantumFailure(message) {
63865
63897
  if (message.includes("Transaction timeout") || message.includes("Transaction confirmation failed") || message.includes("Transaction receipt not found")) {
63866
63898
  return false;
63867
63899
  }
63868
- return RETRYABLE_QUANTUM_ERROR_NAMES.some((name) => message.includes(name)) || message.includes("Transaction reverted");
63900
+ return RETRYABLE_QUANTUM_ERROR_NAMES.some((name) => message.includes(name)) || message.includes("Transaction reverted") || // No gas estimate → refused before broadcast; a fresh signature is safe.
63901
+ message.includes(GAS_ESTIMATE_RETRY_MARKER);
63869
63902
  }
63870
63903
  var MAX_DEADZONE_RESIMULATIONS = 3;
63871
63904
  var QuantumRevertError = class extends Error {
@@ -63895,54 +63928,105 @@ async function assertSafeQuantumSubmission(opts) {
63895
63928
  ...opts.sleep ? { sleep: opts.sleep } : {},
63896
63929
  ...chainNow ? { chainNow } : {}
63897
63930
  };
63931
+ const tx2 = { to, from, data };
63898
63932
  await awaitSafeSubmissionWindow(quantumTimestamp, gateOpts);
63899
63933
  const SAME_BLOCK_INTERACTION_SELECTOR = "0x3b53d1db";
63900
63934
  const laneGuardActive = opts.laneGuardActive === true;
63935
+ const sigQuantum = Math.floor(quantumTimestamp / QUANTUM_WINDOW_SECONDS2) * QUANTUM_WINDOW_SECONDS2;
63936
+ const sigIsCurrent = () => sigQuantum === Math.floor(now() / QUANTUM_WINDOW_SECONDS2) * QUANTUM_WINDOW_SECONDS2;
63937
+ const resolveStaleHead = async (decoded) => {
63938
+ const deadZoneArtifact = decoded.selector === DEAD_ZONE_VIOLATION_SELECTOR && sigIsCurrent();
63939
+ if (laneGuardActive && (decoded.selector === SAME_BLOCK_INTERACTION_SELECTOR || deadZoneArtifact)) {
63940
+ onDebug(
63941
+ `\u21AA\uFE0F [lane-only] Simulated ${decoded.name ?? decoded.selector} is a stale-latest-block artifact \u2014 mining one block and re-estimating`
63942
+ );
63943
+ await requireSend(provider, "evm_mine on the local lane")("evm_mine", []);
63944
+ return settle2(await estimateOnce(provider, tx2));
63945
+ }
63946
+ if (deadZoneArtifact) {
63947
+ onDebug(
63948
+ "\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"
63949
+ );
63950
+ return settle2(await estimateWithTimeOverride(provider, tx2, now()));
63951
+ }
63952
+ return null;
63953
+ };
63954
+ let estimate;
63901
63955
  for (let sim = 1; ; sim++) {
63902
- try {
63903
- await provider.call({ to, from, data });
63956
+ const outcome = await estimateOnce(provider, tx2);
63957
+ if (outcome.ok) {
63958
+ estimate = outcome.estimate;
63904
63959
  break;
63905
- } catch (simError) {
63906
- const decoded = decodeQuantumRevert(simError);
63907
- if (laneGuardActive && decoded.selector === SAME_BLOCK_INTERACTION_SELECTOR) {
63908
- onDebug(
63909
- "\u21AA\uFE0F [lane-only] Simulated SameBlockInteraction is a stale-latest-block artifact (the simulated block contains this flow's own previous tx) \u2014 proceeding to broadcast; the on-chain guard stays authoritative"
63910
- );
63911
- break;
63912
- }
63913
- if (decoded.selector === DEAD_ZONE_VIOLATION_SELECTOR && sim <= maxResimulations) {
63914
- const sigQuantum = Math.floor(quantumTimestamp / QUANTUM_WINDOW_SECONDS2) * QUANTUM_WINDOW_SECONDS2;
63915
- const realCurrentQuantum = Math.floor(now() / QUANTUM_WINDOW_SECONDS2) * QUANTUM_WINDOW_SECONDS2;
63916
- if (sigQuantum === realCurrentQuantum) {
63917
- onDebug(
63918
- "\u21AA\uFE0F Simulated DeadZoneViolation is a stale-latest-block artifact (signature is the current quantum) \u2014 proceeding to broadcast"
63919
- );
63920
- break;
63921
- }
63922
- const gate = await awaitSafeSubmissionWindow(quantumTimestamp, gateOpts);
63923
- if (gate.waited) {
63924
- onDebug(
63925
- `\u{1F501} Re-simulating after crossing the quantum boundary (attempt ${sim}/${maxResimulations})`
63926
- );
63927
- continue;
63928
- }
63929
- }
63930
- if (!decoded.data) {
63931
- const label = simError instanceof Error ? simError.message : String(simError);
63960
+ }
63961
+ const resolved = await resolveStaleHead(outcome.decoded);
63962
+ if (resolved !== null) {
63963
+ estimate = resolved;
63964
+ break;
63965
+ }
63966
+ if (outcome.decoded.selector === DEAD_ZONE_VIOLATION_SELECTOR && sim <= maxResimulations) {
63967
+ const gate = await awaitSafeSubmissionWindow(quantumTimestamp, gateOpts);
63968
+ if (gate.waited) {
63932
63969
  onDebug(
63933
- `\u26A0\uFE0F Pre-send simulation failed without revert data (${label}) \u2014 proceeding to broadcast`
63970
+ `\u{1F501} Re-estimating after crossing the quantum boundary (attempt ${sim}/${maxResimulations})`
63934
63971
  );
63935
- break;
63972
+ continue;
63936
63973
  }
63937
- throw new QuantumRevertError(
63938
- decoded.name,
63939
- decoded.selector,
63940
- decoded.data,
63941
- simError
63942
- );
63943
63974
  }
63975
+ settle2(outcome);
63944
63976
  }
63945
- await awaitSafeSubmissionWindow(quantumTimestamp, gateOpts);
63977
+ const finalGate = await awaitSafeSubmissionWindow(quantumTimestamp, gateOpts);
63978
+ if (finalGate.waited) {
63979
+ onDebug("\u{1F501} Re-estimating after the final re-gate waited");
63980
+ const outcome = await estimateOnce(provider, tx2);
63981
+ estimate = outcome.ok ? outcome.estimate : await resolveStaleHead(outcome.decoded) ?? settle2(outcome);
63982
+ }
63983
+ return { estimate, gasLimit: sizeGasLimit(estimate) };
63984
+ }
63985
+ async function estimateOnce(provider, tx2) {
63986
+ return provider.estimateGas(tx2).then(
63987
+ (estimate) => ({ ok: true, estimate }),
63988
+ (error) => ({
63989
+ ok: false,
63990
+ decoded: decodeQuantumRevert(error),
63991
+ error,
63992
+ via: "eth_estimateGas"
63993
+ })
63994
+ );
63995
+ }
63996
+ async function estimateWithTimeOverride(provider, tx2, timeSec) {
63997
+ const via = "eth_estimateGas with a blockOverrides time override";
63998
+ const send = requireSend(provider, via);
63999
+ return send("eth_estimateGas", [tx2, "latest", {}, { time: (0, import_ethers21.toQuantity)(timeSec) }]).then(
64000
+ (raw) => ({ ok: true, estimate: BigInt(raw) }),
64001
+ (error) => ({
64002
+ ok: false,
64003
+ decoded: decodeQuantumRevert(error),
64004
+ error,
64005
+ via
64006
+ })
64007
+ );
64008
+ }
64009
+ function requireSend(provider, purpose) {
64010
+ if (typeof provider.send !== "function") {
64011
+ throw new GasEstimateUnavailableError(
64012
+ `Cannot run ${purpose}: the SDK read provider exposes no JSON-RPC send() (use an ethers JsonRpcProvider)`,
64013
+ null
64014
+ );
64015
+ }
64016
+ return provider.send.bind(provider);
64017
+ }
64018
+ function settle2(outcome) {
64019
+ if (outcome.ok)
64020
+ return outcome.estimate;
64021
+ const { decoded, error, via } = outcome;
64022
+ if (!decoded.data) {
64023
+ const label = error instanceof Error ? error.message : String(error);
64024
+ throw new GasEstimateUnavailableError(
64025
+ `${via} failed without revert data (${label}); ${GAS_ESTIMATE_RETRY_MARKER}`,
64026
+ error
64027
+ );
64028
+ }
64029
+ throw new QuantumRevertError(decoded.name, decoded.selector, decoded.data, error);
63946
64030
  }
63947
64031
  var HARDHAT_CHAIN_IDS = /* @__PURE__ */ new Set([1337, 31337]);
63948
64032
  function laneGuardEnvEnabled() {
@@ -64160,7 +64244,7 @@ var GET_AUTHORIZED_SPENDS_ABI = [
64160
64244
  "function getAuthorizedSpends(bytes32 positionId) view returns (tuple(string txid, uint32 vout, uint256 satoshis, string targetAddress, uint256 targetAmount, uint256 authorizedAt)[])"
64161
64245
  ];
64162
64246
  async function readAuthorizedSpend(params) {
64163
- const authorizer = new import_ethers23.Contract(
64247
+ const authorizer = new import_ethers24.Contract(
64164
64248
  btcSpendAuthorizerAddress(params.chainId),
64165
64249
  GET_AUTHORIZED_SPENDS_ABI,
64166
64250
  params.runner
@@ -64332,7 +64416,7 @@ function hashBtcInputSet(utxos) {
64332
64416
  seen.add(key);
64333
64417
  }
64334
64418
  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("|");
64335
- return (0, import_ethers24.keccak256)((0, import_ethers24.toUtf8Bytes)(canonical));
64419
+ return (0, import_ethers25.keccak256)((0, import_ethers25.toUtf8Bytes)(canonical));
64336
64420
  }
64337
64421
  async function buildBtcExecuteEnvelope(params) {
64338
64422
  const { positionId, txid, vout, satoshis, networkFee, chainId, signer } = params;
@@ -64759,7 +64843,7 @@ function rowToStatus(row) {
64759
64843
  return row;
64760
64844
  }
64761
64845
  async function fetchProtocolPauseStatus(provider, positionManagerAddress) {
64762
- const iface = new import_ethers26.Interface(GET_PROTOCOL_PAUSE_STATUS_ABI);
64846
+ const iface = new import_ethers27.Interface(GET_PROTOCOL_PAUSE_STATUS_ABI);
64763
64847
  const data = iface.encodeFunctionData("getProtocolPauseStatus", []);
64764
64848
  const raw = await provider.call({ to: positionManagerAddress, data });
64765
64849
  const decoded = iface.decodeFunctionResult("getProtocolPauseStatus", raw);
@@ -64949,38 +65033,38 @@ var ContractManager = class {
64949
65033
  }
64950
65034
  const contractRunner = runner;
64951
65035
  const contracts = {
64952
- positionManager: new import_ethers27.Contract(
65036
+ positionManager: new import_ethers28.Contract(
64953
65037
  contractAddresses.positionManager,
64954
65038
  POSITION_MANAGER_ABI,
64955
65039
  contractRunner
64956
65040
  ),
64957
- loanOperationsManager: new import_ethers27.Contract(
64958
- contractAddresses.loanOperationsManager || import_ethers27.ZeroAddress,
65041
+ loanOperationsManager: new import_ethers28.Contract(
65042
+ contractAddresses.loanOperationsManager || import_ethers28.ZeroAddress,
64959
65043
  LOAN_OPS_ABI,
64960
65044
  contractRunner
64961
65045
  ),
64962
- ucdController: new import_ethers27.Contract(
65046
+ ucdController: new import_ethers28.Contract(
64963
65047
  contractAddresses.ucdToken,
64964
65048
  UCD_CONTROLLER_ABI,
64965
65049
  contractRunner
64966
65050
  ),
64967
- termManager: new import_ethers27.Contract(
64968
- contractAddresses.termManager || import_ethers27.ZeroAddress,
65051
+ termManager: new import_ethers28.Contract(
65052
+ contractAddresses.termManager || import_ethers28.ZeroAddress,
64969
65053
  TERM_MANAGER_ABI,
64970
65054
  contractRunner
64971
65055
  ),
64972
- circuitBreaker: new import_ethers27.Contract(
64973
- contractAddresses.circuitBreaker || import_ethers27.ZeroAddress,
65056
+ circuitBreaker: new import_ethers28.Contract(
65057
+ contractAddresses.circuitBreaker || import_ethers28.ZeroAddress,
64974
65058
  CIRCUIT_BREAKER_ABI,
64975
65059
  contractRunner
64976
65060
  ),
64977
- liquidationManager: new import_ethers27.Contract(
64978
- contractAddresses.liquidationManager || import_ethers27.ZeroAddress,
65061
+ liquidationManager: new import_ethers28.Contract(
65062
+ contractAddresses.liquidationManager || import_ethers28.ZeroAddress,
64979
65063
  LIQUIDATION_MANAGER_ABI,
64980
65064
  contractRunner
64981
65065
  ),
64982
- bitcoinWithdrawalAddressRegistry: new import_ethers27.Contract(
64983
- contractAddresses.bitcoinWithdrawalAddressRegistry || import_ethers27.ZeroAddress,
65066
+ bitcoinWithdrawalAddressRegistry: new import_ethers28.Contract(
65067
+ contractAddresses.bitcoinWithdrawalAddressRegistry || import_ethers28.ZeroAddress,
64984
65068
  BITCOIN_WITHDRAWAL_ADDRESS_REGISTRY_ABI,
64985
65069
  contractRunner
64986
65070
  )
@@ -65029,13 +65113,13 @@ var ContractManager = class {
65029
65113
  const address = addresses[key];
65030
65114
  if (!address) {
65031
65115
  missing.push(String(key));
65032
- } else if (!(0, import_ethers27.isAddress)(address)) {
65116
+ } else if (!(0, import_ethers28.isAddress)(address)) {
65033
65117
  invalid.push(String(key));
65034
65118
  }
65035
65119
  }
65036
65120
  for (const key of optionalAddresses) {
65037
65121
  const address = addresses[key];
65038
- if (address && !(0, import_ethers27.isAddress)(address)) {
65122
+ if (address && !(0, import_ethers28.isAddress)(address)) {
65039
65123
  invalid.push(String(key));
65040
65124
  }
65041
65125
  }
@@ -66350,11 +66434,11 @@ var LoanCreator = class {
66350
66434
  try {
66351
66435
  const mainnetVaultAddress = bitcoinAddresses.mainnet;
66352
66436
  const regtestVaultAddress = bitcoinAddresses.regtest;
66353
- const pkpIdBytes32 = (0, import_ethers28.zeroPadValue)(
66354
- (0, import_ethers28.toBeHex)(BigInt(pkpData.tokenId)),
66437
+ const pkpIdBytes32 = (0, import_ethers29.zeroPadValue)(
66438
+ (0, import_ethers29.toBeHex)(BigInt(pkpData.tokenId)),
66355
66439
  32
66356
66440
  );
66357
- const pkpPublicKeyUncompressed = import_ethers28.SigningKey.computePublicKey(
66441
+ const pkpPublicKeyUncompressed = import_ethers29.SigningKey.computePublicKey(
66358
66442
  pkpData.publicKey,
66359
66443
  false
66360
66444
  );
@@ -66367,7 +66451,7 @@ var LoanCreator = class {
66367
66451
  );
66368
66452
  log.debug(`BigInt conversion: ${BigInt(pkpData.tokenId).toString()}`);
66369
66453
  log.debug(
66370
- `Hex from BigInt: ${(0, import_ethers28.toBeHex)(BigInt(pkpData.tokenId))}`
66454
+ `Hex from BigInt: ${(0, import_ethers29.toBeHex)(BigInt(pkpData.tokenId))}`
66371
66455
  );
66372
66456
  log.debug(`Final bytes32 (zero-padded): ${pkpIdBytes32}`);
66373
66457
  log.debug(
@@ -66539,8 +66623,8 @@ var LoanCreator = class {
66539
66623
  }
66540
66624
  }
66541
66625
  if (this.config.debug) {
66542
- const pkpIdBytes32Check = (0, import_ethers28.zeroPadValue)(
66543
- (0, import_ethers28.toBeHex)(BigInt(pkpData.tokenId)),
66626
+ const pkpIdBytes32Check = (0, import_ethers29.zeroPadValue)(
66627
+ (0, import_ethers29.toBeHex)(BigInt(pkpData.tokenId)),
66544
66628
  32
66545
66629
  );
66546
66630
  log.error("\u274C Loan creation transaction failed", {
@@ -66701,7 +66785,7 @@ var LoanCreator = class {
66701
66785
  const coreAddress = this.config.contractManager.getContractAddresses().positionManagerCore;
66702
66786
  if (coreAddress) {
66703
66787
  try {
66704
- const core = new import_ethers28.Contract(
66788
+ const core = new import_ethers29.Contract(
66705
66789
  coreAddress,
66706
66790
  [
66707
66791
  "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))"
@@ -66743,8 +66827,8 @@ var LoanCreator = class {
66743
66827
  const newEventAbi = [
66744
66828
  "event PositionCreated(bytes32 indexed positionId, bytes32 indexed pkpId, address indexed borrower, uint256 requestedCollateralRatio, uint256 selectedTerm, uint256 expiryAt)"
66745
66829
  ];
66746
- const oldIface = new import_ethers28.Interface(oldEventAbi);
66747
- const newIface = new import_ethers28.Interface(newEventAbi);
66830
+ const oldIface = new import_ethers29.Interface(oldEventAbi);
66831
+ const newIface = new import_ethers29.Interface(newEventAbi);
66748
66832
  let positionId;
66749
66833
  if (this.config.debug) {
66750
66834
  log.info("\u{1F50D} Parsing transaction receipt logs", {
@@ -67224,7 +67308,7 @@ var LoanQuery = class {
67224
67308
  const isChipotlePkpId2 = typeof rawId === "string" && isNormalizedChipotlePkpId(rawId);
67225
67309
  if (isChipotlePkpId2) {
67226
67310
  if (this.config.positionManagerCoreAddress && this.config.provider) {
67227
- const pmContract = new import_ethers29.Contract(
67311
+ const pmContract = new import_ethers30.Contract(
67228
67312
  this.config.positionManagerCoreAddress,
67229
67313
  POSITION_CORE_ABI,
67230
67314
  this.config.provider
@@ -67327,7 +67411,7 @@ var LoanQuery = class {
67327
67411
  */
67328
67412
  async getBorrowerUcdDebtSummary(borrower) {
67329
67413
  const trimmed = typeof borrower === "string" ? borrower.trim() : "";
67330
- if (!(0, import_ethers29.isAddress)(trimmed)) {
67414
+ if (!(0, import_ethers30.isAddress)(trimmed)) {
67331
67415
  return failure(
67332
67416
  new SDKError({
67333
67417
  message: `Borrower must be an EVM address for a UCD debt summary, got "${trimmed}"`,
@@ -67602,7 +67686,7 @@ var WithdrawalAddressModule = class {
67602
67686
  if (!res.success)
67603
67687
  return res;
67604
67688
  const target = res.value.target;
67605
- if (!target || target === import_ethers30.ZeroAddress) {
67689
+ if (!target || target === import_ethers31.ZeroAddress) {
67606
67690
  return failure(
67607
67691
  new SDKError({
67608
67692
  code: "SDK_WITHDRAWAL_REGISTRY_NOT_CONFIGURED",
@@ -67624,7 +67708,7 @@ var WithdrawalAddressModule = class {
67624
67708
  * @throws on mixed-case bech32, which has no canonical spelling (BIP-173).
67625
67709
  */
67626
67710
  static addressHash(btcAddress2) {
67627
- return (0, import_ethers30.keccak256)((0, import_ethers30.toUtf8Bytes)(normalizeBitcoinAddress(btcAddress2)));
67711
+ return (0, import_ethers31.keccak256)((0, import_ethers31.toUtf8Bytes)(normalizeBitcoinAddress(btcAddress2)));
67628
67712
  }
67629
67713
  /**
67630
67714
  * The canonical spelling the registry keys on, or a VALIDATION failure for mixed-case
@@ -73704,7 +73788,7 @@ var _abi = [
73704
73788
  ];
73705
73789
  var _bytecode = "0x60a080604052346100ea57306080527ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005460ff8160401c166100d9576002600160401b03196001600160401b03821601610073575b6040516149a190816100f08239608051818181612896015261298f0152f35b6001600160401b0319166001600160401b039081177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005581527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a13880610054565b63f92ee8a960e01b60005260046000fd5b600080fdfe6080604052600436101561001257600080fd5b6000803560e01c8062f7fce91461393b57806301ffc9a7146138ca578063021d2893146138715780630871b20614613838578063114249d214610f7b57806311d954f81461380f57806313da3166146137d65780631d44a9041461372d5780631f77bf65146136f4578063248a9ca3146136d55780632b83cccd146132285780632f2ff15d146131f657806334bac370146131bd57806334e181251461318457806336568abe1461313f578063373c86b6146131065780633f4ba83a1461303f5780634373b572146130165780634451e89b14612c425780634ebd25a514612c095780634f1ef286146129145780635273b6f6146128eb57806352d1902d14612883578063568fafca146127f557806359d5d02a146125485780635bc26aea146125135780635c975abb146124e35780635ecc2708146123c55780638456cb59146122ca57806385c15d9a1461229157806389d3ad00146121d95780638bff608e146121a05780639010d07c1461214d57806390ad8b401461213157806391d14854146120d85780639b759bf7146120955780639baf58d2146120785780639f1d0f59146119bd578063a217fddf146119a1578063a3246ad3146118e4578063ad3cb1cc1461189d578063b492fc69146117b2578063b9f637af14611587578063bf7d911914611548578063c55f15ea14611525578063ca15c873146114ee578063ca2ce65d146114b5578063cc1f8ffa14611483578063cf46075e14611379578063d21a74ff1461133c578063d2f8253614611319578063d511b2891461115c578063d547741f14611121578063d5d3f78b14610fb4578063d66bd52414610f7b578063e1f1c4a714610f5e578063e1f3962c14610f32578063ec2f96fe14610f0e578063eda5a26a14610b11578063f1a1eb8414610ace578063f385116d14610a95578063f77c479114610a6e578063f8c8765e1461067b578063f95ec0461461055f578063faaebd2114610526578063facdfb5e14610377578063fe32e7281461033e5763ffa1ad741461030857600080fd5b3461033b578060031936011261033b57610337610323613b97565b604051918291602083526020830190613b0c565b0390f35b80fd5b503461033b57602036600319011261033b576020906040906001600160a01b03610366613a23565b168152601283522054604051908152f35b503461033b57602036600319011261033b57610391613a23565b610399614059565b6010546001600160a01b03163303610517576001600160a01b03168082526002602052604082205460ff161561050557808252600760205260408220546040516370a0823160e01b8152306004820152602081602481865afa9081156104fa5784916104c3575b50818111156104b4576104138282613c9b565b821590811561045f575b5050600080516020614975833981519152916040918486526007602052808387205582519182526020820152a260016000805160206149158339815191525580f35b61271081029080820461271014901517156104a057606484029184830460641417156104a0571161049157388061041d565b63a73af74d60e01b8452600484fd5b634e487b7160e01b86526011600452602486fd5b6104be8183613c9b565b610413565b90506020813d6020116104f2575b816104de60209383613ab8565b810103126104ed575138610400565b600080fd5b3d91506104d1565b6040513d86823e3d90fd5b6374ed46ad60e01b8252600452602490fd5b6349db3bd360e01b8252600482fd5b503461033b57602036600319011261033b576020906040906001600160a01b0361054e613a23565b168152600483522054604051908152f35b503461033b5761056e36613b5d565b601054909392906001600160a01b0316330361066c576001600160a01b03168083526002602052604083205460ff161561065a57811561064b576001600160a01b0384161561063c5780835260076020526040832054936105cf8386613df7565b85811061062d576001600160ff1b03811161061e576000805160206149758339815191526040869785938461061b9952600760205280838b205582519182526020820152a23091614363565b80f35b630700fcb360e11b8552600485fd5b63446c8cc960e01b8552600485fd5b634e46966960e11b8352600483fd5b63162908e360e11b8352600483fd5b6374ed46ad60e01b8352600452602482fd5b6349db3bd360e01b8352600483fd5b503461033b57608036600319011261033b57610695613a23565b61069d613a39565b6044356001600160a01b03811690818103610a6a576064356001600160a01b0381169390849003610a665760008051602061495583398151915254604081901c60ff161595906001600160401b031680159081610a5e575b6001149081610a54575b159081610a4b575b50610a3c5760008051602061495583398151915280546001600160401b031916600117905585610a17575b6001600160a01b0316908115610a08576001600160a01b03169081156109f95783156109ea576107606145d1565b6107686145d1565b6107706145d1565b6107786145d1565b6001600080516020614915833981519152556107926145d1565b61079a6145d1565b86546001600160a01b0319908116919091178755600180549182168317905560405163313ce56760e01b8152909190602081600481855afa8891816109b9575b506107ee57633a24e95b60e11b8852600488fd5b6001600160a81b03199092161760a091821b60ff60a01b16176001819055901c60ff1660111981016109a75750610825818661448f565b8061097f575b1561093a576108488160008051602061493583398151915261448f565b80610949575b1561093a5761086b9060008051602061485583398151915261448f565b9081610903575b50156108f457806108c9575b506108865780f35b60ff60401b19600080516020614955833981519152541660008051602061495583398151915255600080516020614835833981519152602060405160018152a180f35b601080546001600160a01b03191682179055826000805160206148958339815191528180a33861087e565b63cf5a8e3360e01b8352600483fd5b6109339060008051602061485583398151915286526000805160206147f583398151915260205260408620614617565b5038610872565b63cf5a8e3360e01b8552600485fd5b60008051602061493583398151915286526000805160206147f58339815191526020526109798360408820614617565b5061084e565b8580526000805160206147f58339815191526020526109a18360408820614617565b5061082b565b63167738cf60e21b8652600452602485fd5b6109dc91925060203d6020116109e3575b6109d48183613ab8565b810190613cd8565b90386107da565b503d6109ca565b630b5eba9f60e41b8752600487fd5b63c1ab6dc160e01b8752600487fd5b6336abb4df60e11b8752600487fd5b600080516020614955833981519152805460ff60401b1916600160401b179055610732565b63f92ee8a960e01b8752600487fd5b90501538610707565b303b1591506106ff565b8791506106f5565b8580fd5b8480fd5b503461033b578060031936011261033b57546040516001600160a01b039091168152602090f35b503461033b57602036600319011261033b576020906040906001600160a01b03610abd613a23565b168152600a83522054604051908152f35b503461033b57604036600319011261033b576020906040906001600160a01b03610af6613a23565b16815260158352818120602435825283522054604051908152f35b503461033b5761016036600319011261033b57610b2c613a23565b90606435604435602435610b3e613b4d565b9160a4359160c43560e43561010435916101243595610144359760018060a01b03601054163303610eff576001600160a01b038c16808c52600260205260408c2054909a9060ff16610eeb578a15610edc578615610ecd576127108811610eb3576103e88111610e9b5760ff82169c60128e118e8115610e90575b50610e7c57803b15610e68578915610e54578a15610e405782610bdb916143a7565b84151580610e37575b610e205785151580610e17575b610e00578b9c602460208d9e9d604051928380926370a0823160e01b82523060048301525afa9c8d15610df4579c610dc0575b506001600160ff1b038c11610db1578a8d8f9760408f97838f918f8f8f8f90859f988f99879f966000805160206148b58339815191529f978b9f988f8d6000805160206148158339815191529f988e8e610d699b6000805160206147d58339815191529f8f8f8487526002602052878720600160ff198254161790558487526003602052878720558386526004602052868620558285526006602052878686205582855260056020528585209060ff19825416179055818452600c6020528885852055818452600d6020528985852055818452600e6020528a85852055818452600f6020528b8585205581845260076020528484205582526012602052828220558d8152601360205220558a7f991d1ef1b5c0820d213328cba6682059e00a50e49c469a454eb3557e78eaf6668e80518b81528c6020820152a28c5198899889613e04565b0390a28151908b82526020820152a28151908782526020820152a280610d8d578280f35b6040600080516020614975833981519152918151908582526020820152a281808280f35b63556e7a8160e01b8e5260048efd5b909b506020813d602011610dec575b81610ddc60209383613ab8565b810103126104ed57519a38610c24565b3d9150610dcf565b604051903d90823e3d90fd5b60448c858863dd85772b60e01b8352600452602452fd5b50838610610bf1565b60448c8487637449915760e01b8352600452602452fd5b50828510610be4565b636835314760e11b8d52600160045260248dfd5b636835314760e11b8d5260048d905260248dfd5b63377e3f9960e21b8d5260048c905260248dfd5b63ca95039160e01b8d5260048e905260248dfd5b60069150108e610bb9565b631051834f60e11b8c526004526103e860245260448bfd5b63c1e9a14160e01b8c52600488905261271060245260448cfd5b63a2ec3a5560e01b8c5260048cfd5b63df407ac560e01b8c5260048cfd5b6317f4215b60e21b8c5260048b905260248cfd5b6349db3bd360e01b8b5260048bfd5b503461033b578060031936011261033b57602060ff60015460a01c16604051908152f35b503461033b57602036600319011261033b576020610f56610f51613a23565b613f3c565b604051908152f35b503461033b578060031936011261033b5760206040516127108152f35b503461033b57602036600319011261033b576020906040906001600160a01b03610fa3613a23565b168152600783522054604051908152f35b503461033b57602036600319011261033b57610fce613a23565b6010546001600160a01b03163303610517576001600160a01b03168082526002602052604082205460ff161561050557808252600760205260408220548061110b575080825260026020526040822060ff1981541690558082526003602052816040812055808252600460205281604081205580825260056020526040822060ff198154169055808252600c602052816040812055808252600d602052816040812055808252600e602052816040812055808252600f602052816040812055808252600660205281604081205580825260076020526040822054818352600760205282604081205560405190827f3302a1b37f04242bb55603f5449e7ecd690a35eef08ba1353c48c20e2aae9cda8580a2806110e8578380f35b816040916000805160206149758339815191529352846020820152a23880808380f35b604492916376bc059760e11b8352600452602452fd5b503461033b57604036600319011261033b57611158600435611141613a39565b9061115361114e82613ca8565b6141cf565b614261565b5080f35b503461033b5761116b36613b5d565b601054909392906001600160a01b0316330361066c576001600160a01b03168083526002602052604083205490939060ff161561130557811561064b576011546001600160a01b03169384156112f6576001600160a01b0382169485156112e75760206024916040519283809263babcc53960e01b82528a60048301525afa9081156112dc5785916112ad575b501561129e57808452600760205260408420549483861061128757816000805160206149758339815191526040886112348861061b9a9b613c9b565b848b526007602052828b2055838a526007602052818a205482519182526020820152a2817f96d682bdcb144aea9bb235442364e98309db373ac793e4807c1b36f7062fe0136020604051878152a3614193565b6044858786633cb8e07360e01b8352600452602452fd5b63133307bb60e21b8452600484fd5b6112cf915060203d6020116112d5575b6112c78183613ab8565b810190613d8d565b386111f8565b503d6112bd565b6040513d87823e3d90fd5b634e46966960e11b8552600485fd5b630e048e7160e41b8452600484fd5b6374ed46ad60e01b83526004849052602483fd5b503461033b578060031936011261033b57602060ff600854166040519015158152f35b503461033b57602036600319011261033b5760209060ff906040906001600160a01b03611367613a23565b16815260058452205416604051908152f35b503461033b57602036600319011261033b57611393613a23565b61139b614059565b6010546001600160a01b03163303610517576001600160a01b03168082526002602052604082205460ff161561050557808252600760205260408220546040516370a0823160e01b8152306004820152602081602481865afa9081156104fa578491611443575b50600080516020614975833981519152916040918486526007602052808387205582519182526020820152a260016000805160206149158339815191525580f35b90506020813d60201161147b575b8161145e60209383613ab8565b810103126104ed5751600080516020614975833981519152611402565b3d9150611451565b503461033b57604036600319011261033b5760206114ab6114a2613a23565b60243590613e3d565b6040519015158152f35b503461033b57602036600319011261033b576020906040906001600160a01b036114dd613a23565b168152601383522054604051908152f35b503461033b57602036600319011261033b57604060209160043581526000805160206147f583398151915283522054604051908152f35b503461033b578060031936011261033b576020604051670de0b6b3a76400008152f35b503461033b57602036600319011261033b5760209060ff906040906001600160a01b03611573613a23565b168152600284522054166040519015158152f35b503461033b5761012036600319011261033b576115a2613a23565b60643591906044356024356115b5613b4d565b601054610104359660e4359260c4359260a43592906001600160a01b031633036117a3576001600160a01b038816808a52600260205260408a205490989060ff161561178f578615611780576127108811611766576103e8821161174c5760ff831690601282118015611742575b61172e5783611631916143a7565b85151580611725575b61170e578a151580611705575b6116ee57926000805160206147d583398151915297969592828c956116e8979460408e8e80825260036020528c8383205580825260046020528d838320558152600660205220558b8d52600560205260408d209060ff198254161790558a8c52600c6020528260408d20558a8c52600d6020528360408d20558a8c52600e6020528460408d20558a8c52600f6020528560408d205560405198899889613e04565b0390a280f35b60448a868d63dd85772b60e01b8352600452602452fd5b50848b10611647565b60448a8588637449915760e01b8352600452602452fd5b5083861061163a565b63ca95039160e01b8b52600482905260248bfd5b5060068210611623565b631051834f60e11b8a5260048290526103e860245260448afd5b63c1e9a14160e01b8a52600488905261271060245260448afd5b63a2ec3a5560e01b8a5260048afd5b6374ed46ad60e01b8a52600489905260248afd5b6349db3bd360e01b8952600489fd5b503461033b57604036600319011261033b576117cc613a23565b6001600160a01b0316808252600260205260408220546024359060ff161561188957801561064b5761271061184e604085670de0b6b3a764000061183d6118569688859a52600560205260ff858520541690809160128110611863575b505088845260036020528484205490613bba565b049581526004602052205484613bba565b048092613c9b565b9082519182526020820152f35b611882925060ff61187661187c92613c03565b16613c14565b90613bba565b3880611829565b6374ed46ad60e01b83526004829052602483fd5b503461033b578060031936011261033b5761033760408051906118c08183613ab8565b60058252640352e302e360dc1b602083015251918291602083526020830190613b0c565b503461033b57602036600319011261033b5760043581526000805160206147f583398151915260205260408120604051908160208254918281520190819285526020852090855b81811061198b5750505082611941910383613ab8565b604051928392602084019060208552518091526040840192915b818110611969575050500390f35b82516001600160a01b031684528594506020938401939092019160010161195b565b825484526020909301926001928301920161192b565b503461033b578060031936011261033b57602090604051908152f35b503461033b576119cc36613a5e565b9190926119d7614059565b6119df614095565b33815260096020526040812054430361205657338152600a60205260036040822054101561204757338152600a60205260408120611a1d8154613cc9565b90555b6001600160a01b0382168082526002602052604082205490929060ff16611fa6575b828252600260205260ff60408320541615611f93578415611f84578315611f7557828252600c60205260408220548510611f5057828252600e60205260408220548015611f4157808611611f2a575084611a9b916142a5565b6040516370a0823160e01b8152306004820152602081602481865afa908115611f1f578291611eed575b50611ad285303386614363565b6040516370a0823160e01b8152306004820152602081602481875afa908115611e0457908692918491611eb4575b5090611b0b91613c9b565b10611ea55781815260076020526040812054611b278582613df7565b818110611e96576001600160ff1b038111611e875760408492600080516020614975833981519152928486526007602052808387205582519182526020820152a2818152600560205260ff604082205416849060128110611e26575b50611ba4670de0b6b3a7640000918484526003602052604084205490613bba565b04908281526004602052612710611bbf604083205484613bba565b0491611bcb8382613c9b565b94808610611e0f57506001546040516318160ddd60e01b815290602090829060049082906001600160a01b03165afa908115611e04578391611dd2575b5082546001600160a01b0316803b15611db95783809160846040518094819363ae494fa160e01b83523360048401528c60248401528b60448401528d60648401525af180156104fa57908491611dbd575b505083611d49575b6001546040516318160ddd60e01b81529190602090839060049082906001600160a01b03165afa80156104fa578490611d15575b611c9f9250613c9b565b90808203611cff575050507fb3e2773606abfd36b5bd91394b3a54d1398336c65005baf7bf7a05efeffaf75b611ce2602095604051918291339588429285613d0c565b0390a3600160008051602061491583398151915255604051908152f35b632d8562a360e11b835260045260245260449150fd5b506020823d602011611d41575b81611d2f60209383613ab8565b810103126104ed57611c9f9151611c95565b3d9150611d22565b82546001600160a01b0316803b15611db95783809160846040518094819363ae494fa160e01b83523060048401528a60248401528b60448401528160648401525af180156104fa57908491611da0575b5050611c61565b81611daa91613ab8565b611db5578238611d99565b8280fd5b8380fd5b81611dc791613ab8565b611db5578238611c59565b90506020813d602011611dfc575b81611ded60209383613ab8565b810103126104ed575138611c08565b3d9150611de0565b6040513d85823e3d90fd5b6371c4efed60e01b83526004869052602452604482fd5b611e36915061187660ff91613c03565b8015611e735780600019048511611e6457611ba4611e5d670de0b6b3a76400009287613bba565b9150611b83565b63035fc53d60e41b8252600482fd5b634e487b7160e01b82526012600452602482fd5b630700fcb360e11b8352600483fd5b63446c8cc960e01b8352600483fd5b639bfa3c1760e01b8152600490fd5b919250506020813d602011611ee5575b81611ed160209383613ab8565b810103126104ed5751859190611b0b611b00565b3d9150611ec4565b90506020813d602011611f17575b81611f0860209383613ab8565b810103126104ed575138611ac5565b3d9150611efb565b6040513d84823e3d90fd5b631d7f2ac360e01b83526004869052602452604482fd5b633b5db2f360e11b8352600483fd5b50908152600c6020526040812054630d54e9e160e01b82526004849052602452604490fd5b632cd84af360e01b8252600482fd5b63162908e360e11b8252600482fd5b506024916374ed46ad60e01b8252600452fd5b60405163313ce56760e01b815291939291602081600481865afa859181612026575b50611fdc5763105482c760e21b8552600485fd5b93919293838352600560205260ff8060408520541691169081036120005750611a42565b90506044928252600560205260ff604083205416631e43476360e11b8352600452602452fd5b61204091925060203d6020116109e3576109d48183613ab8565b9038611fc8565b63a74c1c5f60e01b8152600490fd5b3381526009602052436040822055338152600a60205260016040822055611a20565b503461033b578060031936011261033b5760206040516103e88152f35b503461033b57604036600319011261033b576020906040906001600160a01b036120bd613a23565b16815260148352818120602435825283522054604051908152f35b503461033b57604036600319011261033b5760406120f4613a39565b9160043581526000805160206148d5833981519152602052209060018060a01b0316600052602052602060ff604060002054166040519015158152f35b503461033b578060031936011261033b57602060405160648152f35b503461033b57604036600319011261033b5761218760209160043581526000805160206147f58339815191528352604060243591206145ff565b905460405160039290921b1c6001600160a01b03168152f35b503461033b57602036600319011261033b576020906040906001600160a01b036121c8613a23565b168152600983522054604051908152f35b503461033b57604036600319011261033b576121f3613a23565b60105460243591906001600160a01b0316330361066c576001600160a01b03169081156122825760406000805160206148b58339815191529183855260136020528185205490848652601360205280838720558486526015602052828620438752602052828620548587526019602052838720558486526017602052438387205582519182526020820152a280f35b63df407ac560e01b8352600483fd5b503461033b57602036600319011261033b576020906040906001600160a01b036122b9613a23565b168152600383522054604051908152f35b503461033b578060031936011261033b5760008051602061485583398151915281526000805160206148d583398151915260209081526040808320336000908152925290205460ff16156123a057612320614095565b600160ff196000805160206148f58339815191525416176000805160206148f5833981519152557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a16040514281527f80170b5fcdd2bf1e0660ef4b8851f86685f64d41b1a19de1471947ece8725aac60203392a280f35b63e2517d3f60e01b815233600452600080516020614855833981519152602452604490fd5b503461033b57602036600319011261033b576123df613a23565b6000805160206149558339815191525460ff8160401c169081156124cb575b506124bc5760008051602061495583398151915280546001600160481b0319166003600160401b011790558180526000805160206148d583398151915260209081526040808420336000908152925290205460ff16156124a45761246190613da5565b60ff60401b19600080516020614955833981519152541660008051602061495583398151915255600080516020614835833981519152602060405160038152a180f35b63e2517d3f60e01b8252336004526024829052604482fd5b63f92ee8a960e01b8252600482fd5b60036001600160401b039190911610159050386123fe565b503461033b578060031936011261033b57602060ff6000805160206148f583398151915254166040519015158152f35b503461033b57602036600319011261033b5761252d613a23565b6010546001600160a01b031633036105175761061b90613da5565b503461033b57606036600319011261033b57612562613a23565b61256a613a39565b60105490926044359290916001600160a01b031633036105175761258c614095565b6011546001600160a01b03169182156127e65760405163babcc53960e01b81526001600160a01b0386166004820181905293602090829060249082905afa908115611f1f5782916127c7575b50156127b85782156127a9576001546001600160a01b03928316921682036126f9576040516370a0823160e01b8152306004820152602081602481865afa908115611f1f5782916126c7575b50935b84156126b85760001981036126b25750835b84156126a35780851161268b5750506126558360209583614193565b7f0bf519e4b3821615dbdd874fa1a5fbb4bb651b4e6beabedd4ac318e770233b2c604080518581524287820152a3604051908152f35b630555ed4f60e31b8252600485905260245260449150fd5b632e11316f60e11b8252600482fd5b93612639565b63f09872eb60e01b8252600482fd5b90506020813d6020116126f1575b816126e260209383613ab8565b810103126104ed575138612624565b3d91506126d5565b8181526002602052604081205460ff1615612797576040516370a0823160e01b8152306004820152602081602481865afa908115611f1f578291612765575b50828252600760205260408220548082111561275d5761275791613c9b565b93612627565b505080612757565b90506020813d60201161278f575b8161278060209383613ab8565b810103126104ed575138612738565b3d9150612773565b60249163eef7849760e01b8252600452fd5b634e46966960e11b8152600490fd5b63133307bb60e21b8152600490fd5b6127e0915060203d6020116112d5576112c78183613ab8565b386125d8565b630e048e7160e41b8152600490fd5b503461033b57602036600319011261033b5761280f613a23565b6010546001600160a01b03163303610517576001600160a01b0316801561287457601180546001600160a01b0319811683179091556001600160a01b03167f1e9c406f2707909cfd9f61e744f73bcab77e5997d063276f67883c5257d51cf08380a380f35b634e46966960e11b8252600482fd5b503461033b578060031936011261033b577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031630036128dc5760206040516000805160206148758339815191528152f35b63703e46dd60e11b8152600490fd5b503461033b578060031936011261033b576010546040516001600160a01b039091168152602090f35b50604036600319011261033b57612929613a23565b602435906001600160401b038211611db55736602383011215611db5578160040135908361295683613af1565b936129646040519586613ab8565b83855260208501933660248284010111611db557806024602093018637850101526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016308114908115612be6575b50612bd7576010546001600160a01b03163303612bc8576001600160a01b038116928315612bb957813b15612baa576000805160206148758339815191525484612a02613b97565b7f6ea8b34d59b2818d3f37a08dddaa06f5886b9c20c907b36f03ca6528e106e86f612a3860405192604084526040840190613b0c565b4260208401526001600160a01b038516929081900390a36040516352d1902d60e01b8152602081600481895afa879181612b72575b50612a8657634c9c8ce360e01b87526004869052602487fd5b908160008051602061487583398151915288979303612b605750833b15612b4c576001600160a01b0319168117600080516020614875833981519152558491907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8380a2805115612b31576111589382915190845af43d15612b29573d91612b0d83613af1565b92612b1b6040519485613ab8565b83523d85602085013e614753565b606091614753565b5050505034612b3d5780f35b63b398979f60e01b8152600490fd5b634c9c8ce360e01b86526004829052602486fd5b632a87526960e21b8752600452602486fd5b9091506020813d602011612ba2575b81612b8e60209383613ab8565b81010312612b9e57519038612a6d565b8780fd5b3d9150612b81565b636f7c43f160e01b8552600485fd5b63e6c4247b60e01b8552600485fd5b6349db3bd360e01b8452600484fd5b63703e46dd60e11b8452600484fd5b600080516020614875833981519152546001600160a01b031614159050386129ba565b503461033b57602036600319011261033b576020906040906001600160a01b03612c31613a23565b168152600e83522054604051908152f35b503461033b57606036600319011261033b57612c5c613a4f565b6024356001600160401b038111611db557612c7b903690600401613a88565b916044356001600160401b038111610a6a57612c9b903690600401613a88565b6000805160206149558339815191529291925460ff8160401c16908115612ffe575b50612fef5760008051602061495583398151915280546001600160481b0319166002600160401b0117905560008051602061493583398151915286526000805160206148d583398151915260209081526040808820336000908152925290205460ff1615612fca57612d2d6145d1565b612d356145d1565b600160008051602061491583398151915255600b549160ff8316612fbb57818603612fac57612d6386613d28565b92612d716040519485613ab8565b868452601f19612d8088613d28565b01366020860137875b878110612eb7575060019060ff191617600b5515159460ff196008541660ff871617600855865b818110612e1457876000805160206147b5833981519152602089604051908152a160ff60401b19600080516020614955833981519152541660008051602061495583398151915255600080516020614835833981519152602060405160028152a180f35b80886000805160206149758339815191526040612e3c612e37600196888d613d3f565b613d65565b612e4785898c613d3f565b357f8f955fa878b4aae8b1ac37b1ab715307470f2822ceff87e23d33ef1e044814a783612e74888d613d79565b5193898060a01b0316968793848252600660205280838320558482526007602052858383205582519182526020820152a28151908d82526020820152a201612db0565b612ec5612e37828a8a613d3f565b612ed0828689613d3f565b6001600160a01b03909116808b52600260205260408b20549091359060ff1615612f98576103e88111612f805750906020602492604051938480926370a0823160e01b82523060048301525afa8015612f75578a90612f3f575b60019250612f388288613d79565b5201612d89565b509060203d8111612f6e575b612f558183613ab8565b6020826000928101031261033b57509060019151612f2a565b503d612f4b565b6040513d8c823e3d90fd5b631051834f60e11b8b526004526103e860245260448afd5b6351104c5960e01b8b52600482905260248bfd5b63512509d360e11b8752600487fd5b6324d0d1fd60e01b8752600487fd5b63e2517d3f60e01b865233600452600080516020614935833981519152602452604486fd5b63f92ee8a960e01b8652600486fd5b60026001600160401b03919091161015905038612cbd565b503461033b578060031936011261033b576011546040516001600160a01b039091168152602090f35b503461033b578060031936011261033b576010546001600160a01b031633036130f7576000805160206148f58339815191525460ff8116156130e85760ff19166000805160206148f5833981519152557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a16040514281527f107553d8191d85b405879cf752997865edd48d94e20bda4dd27223c94b31a7cc60203392a280f35b638dfc202b60e01b8252600482fd5b6349db3bd360e01b8152600490fd5b503461033b57602036600319011261033b576020906040906001600160a01b0361312e613a23565b168152601683522054604051908152f35b503461033b57604036600319011261033b57613159613a39565b336001600160a01b038216036131755761115890600435614261565b63334bd91960e11b8252600482fd5b503461033b57602036600319011261033b576020906040906001600160a01b036131ac613a23565b168152600c83522054604051908152f35b503461033b57602036600319011261033b576020906040906001600160a01b036131e5613a23565b168152601783522054604051908152f35b503461033b57604036600319011261033b57611158600435613216613a39565b9061322361114e82613ca8565b614219565b503461033b5761323736613a5e565b919092613242614059565b61324a614095565b3381526009602052604081205443036136b357338152600a60205260036040822054101561204757338152600a602052604081206132888154613cc9565b90555b6001600160a01b0382168082526002602052604082205490929060ff16613638575b828252600260205260ff60408320541615611f935760ff6008541615613629578415611f84578315611f7557828252600d60205260408220548086106136125750828252600f60205260408220548015613603578086116135ed575084613313916140bf565b670de0b6b3a76400008402848104670de0b6b3a7640000036135d9578282526003602052604082205461334591613be3565b90828152600560205260ff604082205416601281106135b9575b508281526006602052612710613379604083205484613bba565b04916133858382613c9b565b94808610611e0f5750838252600760205280604083205410613596578382526007602052604082205490808210613587576040826133d3600080516020614975833981519152938895613c9b565b8486526007602052808387205582519182526020820152a26001546040516318160ddd60e01b815290602090829060049082906001600160a01b03165afa908115611f1f578291613551575b5081546001600160a01b0316803b15611db557826040518092633a52b90760e11b82528183816134538d3360048401613cf1565b03925af18015611e045761353c575b506001546040516318160ddd60e01b81529190602090839060049082906001600160a01b03165afa908115611e04578391613506575b6134a29250613c9b565b8581036134ee5750507f8caf04742286d017f9ac3924388e188c73e6e5094311c5e59a61a7ef86dda8bf611ce26020956134dd863387614193565b604051918291339588429285613d0c565b635ab6e2db60e01b8252600486905260245260449150fd5b90506020823d602011613534575b8161352160209383613ab8565b810103126104ed576134a2915190613498565b3d9150613514565b9161354a8160049394613ab8565b9190613462565b90506020813d60201161357f575b8161356c60209383613ab8565b8101031261357b57513861341f565b5080fd5b3d915061355f565b6308aed4ef60e31b8352600483fd5b83825260076020526040822054635960d22160e01b835260045260245260449150fd5b916135cc60ff6118766135d29495613c03565b90613be3565b903861335f565b634e487b7160e01b82526011600452602482fd5b625502a360e91b83526004869052602452604482fd5b636c6ff70d60e11b8352600483fd5b6361767b8560e01b83526004869052602452604482fd5b630df65d9f60e01b8252600482fd5b60405163313ce56760e01b815291939291602081600481865afa859181613692575b5061366e5763105482c760e21b8552600485fd5b93919293838352600560205260ff80604085205416911690810361200057506132ad565b6136ac91925060203d6020116109e3576109d48183613ab8565b903861365a565b3381526009602052436040822055338152600a6020526001604082205561328b565b503461033b57602036600319011261033b576020610f56600435613ca8565b503461033b57602036600319011261033b576020906040906001600160a01b0361371c613a23565b168152600f83522054604051908152f35b503461033b57604036600319011261033b57613747613a23565b60105460243591906001600160a01b0316330361066c576001600160a01b03169081156122825760406000805160206148158339815191529183855260126020528185205490848652601260205280838720558486526014602052828620438752602052828620548587526018602052838720558486526016602052438387205582519182526020820152a280f35b503461033b57602036600319011261033b576020906040906001600160a01b036137fe613a23565b168152600683522054604051908152f35b503461033b578060031936011261033b576001546040516001600160a01b039091168152602090f35b503461033b57602036600319011261033b576020906040906001600160a01b03613860613a23565b168152600d83522054604051908152f35b503461033b57602036600319011261033b5761388b613a4f565b6010546001600160a01b031633036105175760206000805160206147b583398151915291151560ff196008541660ff821617600855604051908152a180f35b503461033b57602036600319011261033b5760043563ffffffff60e01b811680910361357b57602090635a05180f60e01b8114908115613910575b506040519015158152f35b637965db0b60e01b81149150811561392a575b5082613905565b6301ffc9a760e01b14905082613923565b503461033b57604036600319011261033b57613955613a23565b6001600160a01b0316808252600260205260408220546024359060ff161561188957670de0b6b3a7640000810290808204670de0b6b3a76400001490151715613a0f57916139b160409383835260036020528483205490613be3565b91808252600560205260ff8483205416601281106139e6575b5061184e84836127109361185695526006602052205484613bba565b8461185693613a0461271094966135cc60ff61187661184e97613c03565b9593509350506139ca565b634e487b7160e01b83526011600452602483fd5b600435906001600160a01b03821682036104ed57565b602435906001600160a01b03821682036104ed57565b6004359081151582036104ed57565b60609060031901126104ed576004356001600160a01b03811681036104ed57906024359060443590565b9181601f840112156104ed578235916001600160401b0383116104ed576020808501948460051b0101116104ed57565b601f909101601f19168101906001600160401b03821190821017613adb57604052565b634e487b7160e01b600052604160045260246000fd5b6001600160401b038111613adb57601f01601f191660200190565b919082519283825260005b848110613b38575050826000602080949584010152601f8019910116010190565b80602080928401015182828601015201613b17565b6084359060ff821682036104ed57565b60609060031901126104ed576004356001600160a01b03811681036104ed5790602435906044356001600160a01b03811681036104ed5790565b60405190613ba6604083613ab8565b6005825264322e342e3160d81b6020830152565b81810292918115918404141715613bcd57565b634e487b7160e01b600052601160045260246000fd5b8115613bed570490565b634e487b7160e01b600052601260045260246000fd5b60ff166012039060ff8211613bcd57565b8015613c955760009060208110600116604e821060011617613c8d57600a916001915b60018111613c64575082600019048211613c5057500290565b634e487b7160e01b81526011600452602490fd5b92806000190481116135d95760018416613c84575b80029260011c613c37565b80920291613c79565b9050600a0a90565b50600190565b91908203918211613bcd57565b6000526000805160206148d583398151915260205260016040600020015490565b6000198114613bcd5760010190565b908160209103126104ed575160ff811681036104ed5790565b6001600160a01b039091168152602081019190915260400190565b9094939260609260808301968352602083015260408201520152565b6001600160401b038111613adb5760051b60200190565b9190811015613d4f5760051b0190565b634e487b7160e01b600052603260045260246000fd5b356001600160a01b03811681036104ed5790565b8051821015613d4f5760209160051b010190565b908160209103126104ed575180151581036104ed5790565b6001600160a01b03168015613de657601080546001600160a01b0319811683179091556001600160a01b0316600080516020614895833981519152600080a3565b63e6c4247b60e01b60005260046000fd5b91908201809211613bcd57565b94919360e0969360ff929a99989561010088019b885260208801526040870152166060850152608084015260a083015260c08201520152565b6001600160a01b03811660008181526002602052604090205490919060ff16158015613f2f575b8015613f27575b613f155781600052600f6020526040600020548015908115613f1d575b50613f1557613ead926040918251948592839262f7fce960e01b845260048401613cf1565b0381305afa918215613f0957600092613ed5575b506000526007602052604060002054101590565b9091506040813d604011613f01575b81613ef160409383613ab8565b810103126104ed57519038613ec1565b3d9150613ee4565b6040513d6000823e3d90fd5b505050600090565b9050831138613e88565b508215613e6b565b5060ff6008541615613e64565b6001546001600160a01b0391821691168103613fb1576020602491604051928380926370a0823160e01b82523060048301525afa908115613f0957600091613f82575090565b90506020813d602011613fa9575b81613f9d60209383613ab8565b810103126104ed575190565b3d9150613f90565b80600052600260205260ff60406000205416613fcd5750600090565b6040516370a0823160e01b815230600482015290602082602481845afa918215613f0957600092614025575b50600052600760205260406000205480821160001461401e5761401b91613c9b565b90565b5050600090565b90916020823d602011614051575b8161404060209383613ab8565b8101031261033b5750519038613ff9565b3d9150614033565b6002600080516020614915833981519152541461408457600260008051602061491583398151915255565b633ee5aeb560e01b60005260046000fd5b60ff6000805160206148f583398151915254166140ae57565b63d93c066560e01b60005260046000fd5b6001600160a01b0316600081815260136020526040902054801561418e578160005260156020526040600020436000526020526141026040600020549384613df7565b92831061417d5780826000526017602052436040600020541461415f575b831161414357506000526015602052604060002043600052602052604060002055565b925063029359d560e41b60005260045260245260445260646000fd5b5081600052601960205261417860406000205482613df7565b614120565b63446c8cc960e01b60005260046000fd5b505050565b6141c86141cd93926141ba60405194859263a9059cbb60e01b602085015260248401613cf1565b03601f198101845283613ab8565b614434565b565b60008181526000805160206148d58339815191526020908152604080832033845290915290205460ff16156142015750565b63e2517d3f60e01b6000523360045260245260446000fd5b614223828261448f565b918261422e57505090565b60009182526000805160206147f5833981519152602052604090912061425d916001600160a01b031690614617565b5090565b61426b8282614531565b918261427657505090565b60009182526000805160206147f5833981519152602052604090912061425d916001600160a01b031690614680565b6001600160a01b0316600081815260126020526040902054801561418e578160005260146020526040600020436000526020526142e86040600020549384613df7565b92831061417d57808260005260166020524360406000205414614345575b831161432957506000526014602052604060002043600052602052604060002055565b92506319a4e2a760e01b60005260045260245260445260646000fd5b5081600052601860205261435e60406000205482613df7565b614306565b6040516323b872dd60e01b60208201526001600160a01b0392831660248201529290911660448301526064808301939093529181526141cd916141c8608483613ab8565b60405163313ce56760e01b81529190602090839060049082906001600160a01b03165afa60009281614413575b506143ea57631eecbb6560e01b60005260046000fd5b60ff91821691168082036143fc575050565b631e43476360e11b60005260045260245260446000fd5b61442d91935060203d6020116109e3576109d48183613ab8565b91386143d4565b906000602091828151910182855af115613f09576000513d61448657506001600160a01b0381163b155b6144655750565b635274afe760e01b60009081526001600160a01b0391909116600452602490fd5b6001141561445e565b60008181526000805160206148d5833981519152602090815260408083206001600160a01b038616845290915290205460ff1661401e5760008181526000805160206148d5833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19166001179055339291907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a4600190565b60008181526000805160206148d5833981519152602090815260408083206001600160a01b038616845290915290205460ff161561401e5760008181526000805160206148d5833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19169055339291907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9080a4600190565b60ff6000805160206149558339815191525460401c16156145ee57565b631afcd79f60e31b60005260046000fd5b8054821015613d4f5760005260206000200190600090565b6001810190826000528160205260406000205415600014613f15578054600160401b811015613adb5761466b6146548260018794018555846145ff565b819391549060031b91821b91600019901b19161790565b90555491600052602052604060002055600190565b906001820191816000528260205260406000205480151560001461474a576000198101818111613bcd578254600019810191908211613bcd57818103614713575b505050805480156146fd5760001901906146db82826145ff565b8154906000199060031b1b191690555560005260205260006040812055600190565b634e487b7160e01b600052603160045260246000fd5b61473361472361465493866145ff565b90549060031b1c928392866145ff565b9055600052836020526040600020553880806146c1565b50505050600090565b90614779575080511561476857602081519101fd5b63d6bda27560e01b60005260046000fd5b815115806147ab575b61478a575090565b639996b31560e01b60009081526001600160a01b0391909116600452602490fd5b50803b1561478256fe2c0a5f5ab0ba371221bb3612c2d2f90d36566279309f526000c5b354efd1b0658c67aaac7f77de07240e5a9b36dfdccb2a89c438635abbb27a73142d2aa0f629c1f6fe24621ce81ec5827caf0253cadb74709b061630e6b55e8237170593200048b07fab687f450848f1df8a96db08fef7840f53415f18fdc2ec8e9f810f0930c7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d275027301df982f5215b4963a854cf9c73219df80cb6acd8f098189c9480c7bbc360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc17dc5b1290f7495d7f8cc68476e6941aaf510598fa925d0d2720edc8805a846c4460507c21097c15f6883572ebd157a9ee4b1d989a312314e93afd9d2ecd494002dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800cd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033009b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00a49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a006d129bd71f2401cbe77f49f546d7d5f58992faecfca6e51ba06b50b261e83331a164736f6c6343000822000a";
73706
73790
  var isSuperArgs = (xs) => xs.length > 1;
73707
- var SimplePSMV2__factory = class extends import_ethers31.ContractFactory {
73791
+ var SimplePSMV2__factory = class extends import_ethers32.ContractFactory {
73708
73792
  constructor(...args) {
73709
73793
  if (isSuperArgs(args)) {
73710
73794
  super(...args);
@@ -73724,10 +73808,10 @@ var SimplePSMV2__factory = class extends import_ethers31.ContractFactory {
73724
73808
  static bytecode = _bytecode;
73725
73809
  static abi = _abi;
73726
73810
  static createInterface() {
73727
- return new import_ethers31.Interface(_abi);
73811
+ return new import_ethers32.Interface(_abi);
73728
73812
  }
73729
73813
  static connect(address, runner) {
73730
- return new import_ethers31.Contract(address, _abi, runner);
73814
+ return new import_ethers32.Contract(address, _abi, runner);
73731
73815
  }
73732
73816
  };
73733
73817
  var _abi2 = [
@@ -75523,7 +75607,7 @@ var _abi2 = [
75523
75607
  ];
75524
75608
  var _bytecode2 = "0x60a080604052346100ea57306080527ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005460ff8160401c166100d9576002600160401b03196001600160401b03821601610073575b60405161394690816100f082396080518181816112d4015261148b0152f35b6001600160401b0319166001600160401b039081177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005581527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a13880610054565b63f92ee8a960e01b60005260046000fd5b600080fdfe608080604052600436101561001357600080fd5b60003560e01c90816301ffc9a7146124f5575080630d33f3c2146124d15780630f3f4a94146124865780631459457a14611d3e57806318c38b8914611c2d5780631d44454114611b5c5780632106764c14611b35578063248a9ca314611b175780632ec22d4c14611a565780632f0647ce146119db5780632f2ff15d146119aa57806332420744146118d657806336568abe14611890578063392f10871461185a5780633f4ba83a146117625780633f5aadc9146116f35780634f1ef2861461143d57806352340363146113545780635273b6f61461132b57806352d1902d146112c1578063554c4f4b146112315780635bc26aea146111a45780635c975abb146111745780636289d18c146110f35780636711cc0b146110d75780636e852a7814610fd65780637e35bf6e14610fa25780638343f67414610f755780638456cb5914610e7f57806384b0196e14610d545780638c02cabd14610d2b5780638f33527f14610cf15780639010d07c14610c9d57806391d1485414610c435780639b9d30c114610c1a578063a19af3f614610b69578063a217fddf14610b4d578063a3246ad314610a8b578063a878086414610a6f578063ac3c0e3014610962578063ad3cb1cc1461091b578063b3fad63814610876578063b48d36de14610842578063c040b8ae14610726578063c34e9c261461070a578063c86deb31146106ee578063ca15c873146106b5578063d547741f1461067d578063dd71d99a1461063b578063e0922fa11461058e578063efa9b4ae1461051f578063f2f4eb26146104f6578063f68e9553146104cd578063f94f67ab146103f6578063fcc1f21a146102c05763ffa1ad741461028757600080fd5b346102bb5760003660031901126102bb576102b76102a3612780565b6040519182916020835260208301906126d1565b0390f35b600080fd5b346102bb576102ce366126f6565b91926102d8612e42565b6001600160a01b03851692338490036103e657836000526001602052604060002080549160ff8360e01c1660038110156103d0576001036103bf577fc5d5c5bbf10444998e0ea6d4725e79027b574e1c14ec929279e8a9a95c6c6e91948460016103a2946103498b6020998c613385565b818060a01b038316828060a01b03198254161781556103688b82612a4c565b0180546001600160401b031916426001600160401b03161790556001600160a01b0381166000818152600288526040902089905599613179565b6040516001600160401b0390951685526001600160a01b031693a4005b632437e77160e11b60005260046000fd5b634e487b7160e01b600052602160045260246000fd5b62fca64560e31b60005260046000fd5b346102bb5760403660031901126102bb576004356104126125c7565b9061041b612e42565b63ffffffff600554169163ffffffff8116928084109081156104c4575b506104b35760207f6b7727cc9c3df4a29acf0afe01594c1b7e845d20f40f4a14e4c292164a9ed8e19161046a84612e8d565b91610482600863ffffffff845460a01c1617836128c8565b81546001600160e01b031660e09190911b6001600160e01b0319161790556040519485526001600160a01b031693a3005b634346c13160e01b60005260046000fd5b90501584610438565b346102bb5760003660031901126102bb5760206040516000805160206138ba8339815191528152f35b346102bb5760003660031901126102bb576003546040516001600160a01b039091168152602090f35b346102bb5760203660031901126102bb5760043561053b612e42565b61055d61054782612e8d565b9190600163ffffffff825460a01c1617906128c8565b6001600160a01b0316907f812690e0a9dff5bf3add998111b8af5c8299608d859025bfe35662060ab4267d600080a3005b346102bb5760203660031901126102bb576004356001600160401b038116908181036102bb576000546001600160a01b038116330361062a57600160a01b600160e01b0319811660a092831b600160a01b600160e01b031617600055604080519190921c6001600160401b0316815260208101929092527f9c195448332abd01f716db873b329752ea02f19d33f7e311fb0daf082c4edd0391a1005b6349db3bd360e01b60005260046000fd5b346102bb5760203660031901126102bb576001600160a01b0361065c612578565b166000526002602052602060018060a01b0360406000205416604051908152f35b346102bb5760403660031901126102bb576106b360043561069c612562565b906106ae6106a9826128a7565b612d6c565b612dfe565b005b346102bb5760203660031901126102bb5760043560005260008051602061373a8339815191526020526020604060002054604051908152f35b346102bb5760003660031901126102bb57602060405160088152f35b346102bb5760003660031901126102bb57602060405160028152f35b346102bb57610734366126f6565b92909161073f612e42565b6001600160a01b03851693338590036103e65784600052600160205260406000209060ff825460e01c1660038110156103d057600114610831577ff223dc085722c94c84dcf67427e225799be616382a2a484d378f8921c69a2033948461081e936107ad866020988b613385565b80546001600160a01b0319166001600160a01b0383161781556107d08682612a4c565b6001810180546001600160801b031916426001600160401b0316179055805460ff60e01b1916600160e01b1790556001600160a01b0381166000818152600288526040902089905598613179565b6040516001600160401b039091168152a3005b639d2c8fdf60e01b60005260046000fd5b346102bb5760403660031901126102bb57602061086e610860612578565b610868612562565b90612984565b604051908152f35b346102bb5760203660031901126102bb57600060606040516108978161261e565b828152826020820152826040820152015260043560005260046020526080604060002063ffffffff604051916108cc8361261e565b548160018060a01b038216938481528160208201818560a01c16815260606040840193838760c01c168552019460e01c8552604051968752511660208601525116604084015251166060820152f35b346102bb5760003660031901126102bb576102b7604080519061093e8183612639565b60058252640352e302e360dc1b6020830152519182916020835260208301906126d1565b346102bb5760203660031901126102bb5761097b612578565b6000608060405161098b81612603565b828152826020820152826040820152826060820152015260018060a01b0316600052600160205260406000206040516109c381612603565b81546001600160a01b038116825260a081901c6001600160401b03166020830190815292604083019160e01c60ff169060038210156103d057908252600101546001600160401b0380821660608501908152604092831c821660808601908152925194516001600160a01b03168552945116602084015290519260038410156103d057604083019390935291516001600160401b0390811660608301529151909116608082015260a090f35b346102bb5760003660031901126102bb57602060405160018152f35b346102bb5760203660031901126102bb5760043560005260008051602061373a83398151915260205260406000206040518060208354918281520190819360005260206000209060005b818110610b375750505081610aeb910382612639565b6040519182916020830190602084525180915260408301919060005b818110610b15575050500390f35b82516001600160a01b0316845285945060209384019390920191600101610b07565b8254845260209093019260019283019201610ad5565b346102bb5760003660031901126102bb57602060405160008152f35b346102bb5760403660031901126102bb57600435610b856125c7565b90610b8e612e42565b63ffffffff600554169163ffffffff811692808410908115610c11575b506104b35760207f1da95b87b4c773f68c1447ffc5644e41a8a8887d55065beb64852014cf7140be91610bfe610be085612e8d565b9290610bf9600463ffffffff835460a01c1617826128c8565b6127f5565b6040519485526001600160a01b031693a3005b90501584610bab565b346102bb5760003660031901126102bb5760206040516000805160206137fa8339815191528152f35b346102bb5760403660031901126102bb57610c5c612562565b60043560005260008051602061389a83398151915260205260406000209060018060a01b0316600052602052602060ff604060002054166040519015158152f35b346102bb5760403660031901126102bb5760043560005260008051602061373a8339815191526020526020610cd86024356040600020613357565b905460405160039290921b1c6001600160a01b03168152f35b346102bb5760203660031901126102bb576001600160a01b03610d12612578565b1660005260026020526020604060002054604051908152f35b346102bb5760003660031901126102bb5760206040516000805160206137da8339815191528152f35b346102bb5760003660031901126102bb576000805160206137ba833981519152541580610e68575b15610e2b57610dcd610d8c6127a3565b610d946127d6565b6020610ddb60405192610da78385612639565b600084526000368137604051958695600f60f81b875260e08588015260e08701906126d1565b9085820360408701526126d1565b466060850152306080850152600060a085015283810360c085015281808451928381520193019160005b828110610e1457505050500390f35b835185528695509381019392810192600101610e05565b60405162461bcd60e51b81526020600482015260156024820152741152540dcc4c8e88155b9a5b9a5d1a585b1a5e9959605a1b6044820152606490fd5b5060008051602061391a8339815191525415610d7c565b346102bb5760003660031901126102bb573360009081527f0ac8cc3d209806126662940717264973110c39045b305f6ba49613325a615e09602052604090205460ff1615610f4e57610ecf612e42565b600160ff196000805160206138da8339815191525416176000805160206138da833981519152557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a16040514281527f80170b5fcdd2bf1e0660ef4b8851f86685f64d41b1a19de1471947ece8725aac60203392a2005b63e2517d3f60e01b600052336004526000805160206137fa83398151915260245260446000fd5b346102bb5760003660031901126102bb5760005460405160a09190911c6001600160401b03168152602090f35b346102bb5760403660031901126102bb57610fc6610fbe612562565b600435612951565b906102b760405192839283612598565b346102bb5760403660031901126102bb57610fef612578565b33600090815260008051602061383a833981519152602052604090205460ff1615806110c4575b6103e6576001600160a01b03166000818152600160205260409020805460e01c60ff1660038110156103d0576001036103bf57805460ff60e01b198116600160e11b1782556001919091018054600160401b600160801b03191642604090811b600160401b600160801b0316919091179091555160243581526001600160a01b0390911691907fc0499cc07ed9d734deec6857802d3f0fa8d5afaf79a7008beb8ba7bef62a271b90602090a3005b50336001600160a01b0382161415611016565b346102bb5760003660031901126102bb57602060405160048152f35b346102bb5760203660031901126102bb5761110c6125b4565b6000546001600160a01b0316330361062a5763ffffffff81169081156111635760008051602061387a8339815191529161115e63ffffffff926005549284198416176005556040519384931683612818565b0390a1005b6338f3377360e21b60005260046000fd5b346102bb5760003660031901126102bb57602060ff6000805160206138da83398151915254166040519015158152f35b346102bb5760203660031901126102bb576111bd612578565b6000546001600160a01b038116903382900361062a576001600160a01b038316928315611220573b1561120f576001600160a01b0319168217600090815560008051602061385a8339815191529080a3005b636f7c43f160e01b60005260046000fd5b63e6c4247b60e01b60005260046000fd5b346102bb5760203660031901126102bb576001600160a01b03611252612578565b166000526001602052604060002060ff6000805160206138da833981519152541615806112a5575b6020918161128e575b506040519015158152f35b5460a01c6001600160401b03164210905082611283565b5060ff815460e01c169060038210156103d0579060011461127a565b346102bb5760003660031901126102bb577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316300361131a57602060405160008051602061381a8339815191528152f35b63703e46dd60e11b60005260046000fd5b346102bb5760003660031901126102bb576000546040516001600160a01b039091168152602090f35b346102bb5760203660031901126102bb57600435604060008281526004602052209081549160018060a01b03831692831590811561142e575b5061141d5733600090815260008051602061383a833981519152602052604090205460ff161580611413575b61140257806113d563fffffffe6113db935460a01c16826128c8565b82612d48565b7fa5ffbdba01b15df97334e34ad816b9986b6057a5ddc97aba93b7e8ccd21759ed600080a3005b630a606ec360e11b60005260046000fd5b50823314156113b9565b6360eb6c2360e01b60005260046000fd5b6001915060a01c16158461138d565b60403660031901126102bb57611451612578565b6024356001600160401b0381116102bb57366023820112156102bb57611481903690602481600401359101612677565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163081149081156116d0575b5061131a576000546001600160a01b0316330361062a576001600160a01b03821691821561122057803b156116bf573083146116b05760008051602061381a8339815191525483611505612780565b7f6ea8b34d59b2818d3f37a08dddaa06f5886b9c20c907b36f03ca6528e106e86f61153b604051926040845260408401906126d1565b4260208401526001600160a01b038516929081900390a36040516352d1902d60e01b8152602081600481885afa6000918161167c575b5061158b5784634c9c8ce360e01b60005260045260246000fd5b908160008051602061381a8339815191528693036116685750823b15611653576001600160a01b031916811760008051602061381a833981519152557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a2815115611639576000808360206106b395519101845af43d15611631573d916116148361265c565b926116226040519485612639565b83523d6000602085013e61364d565b60609161364d565b50503461164257005b63b398979f60e01b60005260046000fd5b50634c9c8ce360e01b60005260045260246000fd5b632a87526960e21b60005260045260246000fd5b9091506020813d6020116116a8575b8161169860209383612639565b810103126102bb57519086611571565b3d915061168b565b614e8d60eb1b60005260046000fd5b632e07c4bd60e11b60005260046000fd5b60008051602061381a833981519152546001600160a01b031614159050836114b6565b346102bb5760203660031901126102bb5760043561170f612e42565b61173161171b82612e8d565b9190600263ffffffff825460a01c1617906128c8565b6001600160a01b0316907fc2713e691344add4705edc62a0ee5aede95ba66ad68f97316efef9cb50644edd600080a3005b346102bb5760003660031901126102bb5733600090815260008051602061383a833981519152602052604090205460ff161580611845575b611834576000805160206138da8339815191525460ff8116156118235760ff19166000805160206138da833981519152557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a16040514281527f107553d8191d85b405879cf752997865edd48d94e20bda4dd27223c94b31a7cc60203392a2005b638dfc202b60e01b60005260046000fd5b63659a07b360e11b60005260046000fd5b506000546001600160a01b031633141561179a565b346102bb5760403660031901126102bb576102b7611881611879612562565b6004356128eb565b604093919351938493846125da565b346102bb5760403660031901126102bb576118a9612562565b336001600160a01b038216036118c5576106b390600435612dfe565b63334bd91960e11b60005260046000fd5b346102bb5760203660031901126102bb57600435604060008281526004602052209081549160018060a01b03831692831590811561199b575b5061141d5733600090815260008051602061383a833981519152602052604090205460ff161580611991575b611402578061195763fffffff761196a935460a01c16826128c8565b80546001600160e01b0316815582612d48565b7f054490ec6650e07db9b97a06ea31d44cebd44b390c9975a380055e1b4d3cac21600080a3005b508233141561193b565b6008915060a01c16158461190f565b346102bb5760403660031901126102bb576106b36004356119c9612562565b906119d66106a9826128a7565b612db6565b346102bb5760203660031901126102bb57600435611a256119fb82612cd6565b9190611a1163fffffffb825460a01c16826128c8565b805463ffffffff60c01b1916815583612d48565b6001600160a01b0316907f09cb4ec44cdef8489412844b9682f87f7900758fa2bd7e039113e9125e538e0f600080a3005b346102bb5760203660031901126102bb57600435604060008281526004602052209081549160018060a01b038316928315908115611b08575b5061141d5733600090815260008051602061383a833981519152602052604090205460ff161580611afe575b61140257806113d563fffffffd611ad7935460a01c16826128c8565b7fb390ab029eab314bd18190ebe73d7e5c1c336beaa5c83ac22578378dc9ccc405600080a3005b5082331415611abb565b6002915060a01c161584611a8f565b346102bb5760203660031901126102bb57602061086e6004356128a7565b346102bb5760403660031901126102bb576102b7611881611b54612562565b60043561282f565b346102bb5760403660031901126102bb57600435611b786125c7565b63ffffffff600554169063ffffffff811691808310908115611c24575b506104b357611ba383612cd6565b909263ffffffff845460c01c16809260018060a01b03163314159182611c19575b5050611c0857611bf4827e8a218591d4362499c38c38eb1c12e7a7cc97a9068818d1fe6046a42ba4a5ba946127f5565b611c0360405192839283612818565b0390a2005b634e80a40760e11b60005260046000fd5b111590508186611bc4565b90501584611b95565b346102bb5760203660031901126102bb57611c466125b4565b6000805160206138fa8339815191525460ff8160401c16908115611d26575b50611d15576000805160206138fa833981519152805460026001600160401b0319821681179092556000546001600160481b031990911690911791906001600160a01b0316330361062a5763ffffffff1680156111635760408160008051602061387a8339815191529263ffffffff196005541617600555815190600082526020820152a16000805160206138fa8339815191525560008051602061377a833981519152602060405160028152a1005b63f92ee8a960e01b60005260046000fd5b60026001600160401b03919091161015905082611c65565b346102bb5760a03660031901126102bb57611d57612578565b611d5f612562565b604435906001600160a01b0382168083036102bb576064356001600160a01b038116918282036102bb576084356001600160a01b03811695908690036102bb576000805160206138fa83398151915254604081901c60ff161597906001600160401b03168015908161247e575b6001149081612474575b15908161246b575b50611d15576000805160206138fa83398151915280546001600160401b031916600117905587612446575b611e116131e0565b611e196131e0565b611e216131e0565b611e296131e0565b6001600160a01b038116908115611220578315611220578515611220576001600160a01b038716968715611220573b1561120f578584146124355762aa36a74614801561242a575b801561241f575b158061240d575b61120f57611e8e90600061320e565b90816123c6575b501561230b57611eb3906000805160206138ba83398151915261320e565b9081612371575b501561230b57611ed8906000805160206137fa83398151915261320e565b908161231c575b501561230b57600080546001600160a01b0319168217815560008051602061385a8339815191528180a3611f116127a3565b91611f1a6127d6565b91611f236131e0565b611f2b6131e0565b83516001600160401b0381116121e05760008051602061375a83398151915254600181811c91168015612301575b60208210146121c057601f8111612282575b50602094601f8211600114612201579481929394956000926121f6575b50508160011b916000199060031b1c19161760008051602061375a833981519152555b82516001600160401b0381116121e05760008051602061379a83398151915254600181811c911680156121d6575b60208210146121c057601f8111612141575b506020601f82116001146120c057819293946000926120b5575b50508160011b916000199060031b1c19161760008051602061379a833981519152555b60006000805160206137ba83398151915255600060008051602061391a83398151915255801561122057803b1561120f57600380546001600160a01b03191691909117905561207357005b60ff60401b196000805160206138fa83398151915254166000805160206138fa8339815191525560008051602061377a833981519152602060405160018152a1005b015190508480612005565b601f1982169060008051602061379a833981519152600052806000209160005b81811061212957509583600195969710612110575b505050811b0160008051602061379a83398151915255612028565b015160001960f88460031b161c191690558480806120f5565b9192602060018192868b0151815501940192016120e0565b81811115611feb5760008051602061379a833981519152600052601f820160051c7f5f9ce34815f8e11431c7bb75a8e6886a91478f7ffc1dbb0a98dc240fddd76b75602084106121b7575b81601f9101920160051c039060005b8281106121a9575050611feb565b60008282015560010161219b565b6000915061218c565b634e487b7160e01b600052602260045260246000fd5b90607f1690611fd9565b634e487b7160e01b600052604160045260246000fd5b015190508580611f88565b601f1982169560008051602061375a833981519152600052806000209160005b88811061226a57508360019596979810612251575b505050811b0160008051602061375a83398151915255611fab565b015160001960f88460031b161c19169055858080612236565b91926020600181928685015181550194019201612221565b81811115611f6b5760008051602061375a833981519152600052601f820160051c7f42ad5d3e1f2e6e70edcf6d991b8a3023d3fca8047a131592f9edb9fd9b89d57d602084106122f8575b81601f9101920160051c039060005b8281106122ea575050611f6b565b6000828201556001016122dc565b600091506122cd565b90607f1690611f59565b63cf5a8e3360e01b60005260046000fd5b6000805160206137fa83398151915260005260008051602061373a83398151915260205261236a907ffff5b43478fa6840382eb63777e0da6941d320b940e3f70f0ea4780feff9582761348a565b5084611edf565b6000805160206138ba83398151915260005260008051602061373a8339815191526020526123bf907f32d31393d541a265984ec379cddd8b1fcbe5f2b0eb8ad81dddfead454f135eaa61348a565b5086611eba565b6000805260008051602061373a833981519152602052612406907f615f0f9e84155bea8cc509fe18befeb1baf65611e38a6ba60964480fb29dfd4461348a565b5088611e95565b50823b1580611e7f5750843b15611e7f565b50617a694614611e78565b506105394614611e71565b638135316560e01b60005260046000fd5b6000805160206138fa833981519152805460ff60401b1916600160401b179055611e09565b90501589611dde565b303b159150611dd6565b899150611dcc565b346102bb5760403660031901126102bb576102b76124ba6124a5612562565b60043560005260046020526040600020612a75565b6124c38161258e565b604051918183921583612598565b346102bb5760003660031901126102bb57602063ffffffff60055416604051908152f35b346102bb5760203660031901126102bb576004359063ffffffff60e01b82168092036102bb57602091635a05180f60e01b8114908115612537575b5015158152f35b637965db0b60e01b811491508115612551575b5083612530565b6301ffc9a760e01b1490508361254a565b602435906001600160a01b03821682036102bb57565b600435906001600160a01b03821682036102bb57565b600811156103d057565b9015158152604081019291906020906125b08361258e565b0152565b6004359063ffffffff821682036102bb57565b6024359063ffffffff821682036102bb57565b91604091949363ffffffff916060850196151585526125f88161258e565b602085015216910152565b60a081019081106001600160401b038211176121e057604052565b608081019081106001600160401b038211176121e057604052565b601f909101601f19168101906001600160401b038211908210176121e057604052565b6001600160401b0381116121e057601f01601f191660200190565b9291926126838261265c565b916126916040519384612639565b8294818452818301116102bb578281602093846000960137010152565b60005b8381106126c15750506000910152565b81810151838201526020016126b1565b906020916126ea815180928185528580860191016126ae565b601f01601f1916010190565b60806003198201126102bb576004356001600160a01b03811681036102bb57916024356001600160a01b03811681036102bb57916044356001600160401b03811681036102bb57916064356001600160401b0381116102bb57826023820112156102bb576004810135926001600160401b0384116102bb57602484830101116102bb576024019190565b6040519061278f604083612639565b60058252640332e302e360dc1b6020830152565b604051906127b2604083612639565b6015825274111a585b5bdb9912185b991ccb941c9bdd1bd8dbdb605a1b6020830152565b604051906127e5604083612639565b60018252603160f81b6020830152565b805463ffffffff60c01b191660c09290921b63ffffffff60c01b16919091179055565b63ffffffff91821681529116602082015260400190565b600052600460205261284660406000209182612b32565b61284f8161258e565b8061289d57505460e01c63ffffffff6005541681158015612895575b6128885780821061288157505b60019160009190565b9050612878565b5050600090600390600090565b50801561286b565b6000929091508290565b60005260008051602061389a83398151915260205260016040600020015490565b805463ffffffff60a01b191660a09290921b63ffffffff60a01b16919091179055565b919091600052600460205261290560406000209283612bbe565b9161290f8361258e565b826129475763ffffffff9192505460c01c1663ffffffff60055416811580156128955761288857808210612881575060019160009190565b5060009190600090565b906129689160005260046020526040600020612c4a565b6129718161258e565b8061297f5750600190600090565b600091565b6042916040519060208201926000805160206137da833981519152845260018060a01b0316604083015260018060a01b03166060820152606081526129ca608082612639565b5190206129d56136ae565b6129dd613706565b6040519060208201927f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f8452604083015260608201524660808201523060a082015260a08152612a2e60c082612639565b519020906040519161190160f01b8352600283015260228201522090565b8054600160a01b600160e01b03191660a09290921b600160a01b600160e01b0316919091179055565b60ff6000805160206138da8339815191525416612b2b57546001600160a01b038116908115612b235760a01c60021615612b1c5760005260016020526040600020549060ff8260e01c1660038110156103d0578015612b1457600214612b0d574260a083901c6001600160401b03161115612b06576001600160a01b03908116911603612b0157600090565b600790565b5050600690565b5050600590565b505050600490565b5050600390565b505050600290565b5050600190565b60ff6000805160206138da8339815191525416612b2b57546001600160a01b038116908115612b235760a01c60081615612b1c5760005260016020526040600020549060ff8260e01c1660038110156103d0578015612b1457600214612b0d574260a083901c6001600160401b03161115612b06576001600160a01b03908116911603612b0157600090565b60ff6000805160206138da8339815191525416612b2b57546001600160a01b038116908115612b235760a01c60041615612b1c5760005260016020526040600020549060ff8260e01c1660038110156103d0578015612b1457600214612b0d574260a083901c6001600160401b03161115612b06576001600160a01b03908116911603612b0157600090565b60ff6000805160206138da8339815191525416612b2b57546001600160a01b038116908115612b235760a01c60011615612b1c5760005260016020526040600020549060ff8260e01c1660038110156103d0578015612b1457600214612b0d574260a083901c6001600160401b03161115612b06576001600160a01b03908116911603612b0157600090565b6000908152600460205260409020805490916001600160a01b038216918215908115612d39575b5061141d5733600090815260008051602061383a833981519152602052604090205460ff161580612d2f575b61140257565b5081331415612d29565b6004915060a01c161538612cfd565b905460a01c63ffffffff1615612d5b5750565b600052600460205260006040812055565b600081815260008051602061389a8339815191526020908152604080832033845290915290205460ff1615612d9e5750565b63e2517d3f60e01b6000523360045260245260446000fd5b612dc0828261320e565b9182612dcb57505090565b600091825260008051602061373a8339815191526020526040909120612dfa916001600160a01b03169061348a565b5090565b612e0882826132b7565b9182612e1357505090565b600091825260008051602061373a8339815191526020526040909120612dfa916001600160a01b0316906134fb565b60ff6000805160206138da8339815191525416612e5b57565b63d93c066560e01b60005260046000fd5b519064ffffffffff821682036102bb57565b519061ffff821682036102bb57565b801561316857600354604051638d34875560e01b8152600481018390529190600090839060249082906001600160a01b03165afa91821561315c57600092612fb1575b5060808201516001600160a01b03169133839003611402576101200151612ef68161258e565b612eff8161258e565b60038114908115612f9c575b8115612f88575b50612f775781600052600160205260ff60406000205460e01c1660038110156103d057600103612f6657600090815260046020526040902080546001600160a01b0319166001600160a01b03831617815591565b632e68d1d360e21b60005260046000fd5b63e9f6db8560e01b60005260046000fd5b60079150612f958161258e565b1438612f12565b9050612fa78161258e565b6005811490612f0b565b90913d8082843e612fc28184612639565b82019160208184031261313c578051906001600160401b0382116131445701906101a08284031261313957604051926101a084016001600160401b038111858210176131485760409081528351855260208085015190860152838101519085015260608301516001600160401b03811161314457830181601f820112156131445780519061304f8261265c565b9261305d6040519485612639565b82845260208383010111613140579061307c91602080850191016126ae565b606084015260808201516001600160a01b038116810361313c5760808401526130a760a08301612e6c565b60a08401526130b860c08301612e6c565b60c08401526130c960e08301612e7e565b60e08401526130db6101008301612e6c565b610100840152610120820151906008821015613139575061312c916101809161012085015261310d6101408201612e6c565b6101408501526131206101608201612e7e565b61016085015201612e6c565b6101808201529038612ed0565b80fd5b5080fd5b8380fd5b8280fd5b634e487b7160e01b83526041600452602483fd5b6040513d6000823e3d90fd5b637bb0b62160e01b60005260046000fd5b61319b9261318d8361319593969496612984565b923691612677565b9061344e565b5060048110156103d05715918215926131c8575b50506131b757565b63cacba36560e01b60005260046000fd5b6001600160a01b0391821691161415905038806131af565b60ff6000805160206138fa8339815191525460401c16156131fd57565b631afcd79f60e31b60005260046000fd5b600081815260008051602061389a833981519152602090815260408083206001600160a01b038616845290915290205460ff166132b057600081815260008051602061389a833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19166001179055339291907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a4600190565b5050600090565b600081815260008051602061389a833981519152602090815260408083206001600160a01b038616845290915290205460ff16156132b057600081815260008051602061389a833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19169055339291907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9080a4600190565b805482101561336f5760005260206000200190600090565b634e487b7160e01b600052603260045260246000fd5b15801561343d575b611220576001600160a01b031660009081526002602052604090205461342c576001600160401b03164281111561341b5760005460a01c6001600160401b031680151591826133f0575b50506133df57565b63e774e7b560e01b60005260046000fd5b909150428103908111613405571138806133d7565b634e487b7160e01b600052601160045260246000fd5b63efa7aefd60e01b60005260046000fd5b633b53f64f60e21b60005260046000fd5b506001600160a01b0381161561338d565b815191906041830361347f5761347892506020820151906060604084015193015160001a906135ce565b9192909190565b505060009160029190565b60018101908260005281602052604060002054156000146134f3578054600160401b8110156121e0576134de6134c7826001879401855584613357565b819391549060031b91821b91600019901b19161790565b90555491600052602052604060002055600190565b505050600090565b90600182019181600052826020526040600020548015156000146135c55760001981018181116134055782546000198101919082116134055781810361358e575b505050805480156135785760001901906135568282613357565b8154906000199060031b1b191690555560005260205260006040812055600190565b634e487b7160e01b600052603160045260246000fd5b6135ae61359e6134c79386613357565b90549060031b1c92839286613357565b90556000528360205260406000205538808061353c565b50505050600090565b91906fa2a8918ca85bafe22016d0b997e4df60600160ff1b038411613641579160209360809260ff60009560405194855216868401526040830152606082015282805260015afa1561315c576000516001600160a01b038116156136355790600090600090565b50600090600190600090565b50505060009160039190565b90613673575080511561366257602081519101fd5b63d6bda27560e01b60005260046000fd5b815115806136a5575b613684575090565b639996b31560e01b60009081526001600160a01b0391909116600452602490fd5b50803b1561367c565b6136b66127a3565b80519081156136c6576020012090565b50506000805160206137ba8339815191525480156136e15790565b507fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47090565b61370e6127d6565b805190811561371e576020012090565b505060008051602061391a8339815191525480156136e1579056fec1f6fe24621ce81ec5827caf0253cadb74709b061630e6b55e82371705932000a16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d102c7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2a16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d103a16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d1002b26bde9d050a2447879fc2826d068ca8d51a693da5ddde56556964c09fea96875027301df982f5215b4963a854cf9c73219df80cb6acd8f098189c9480c7bbc360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc07966f2ab141347034724e9b2a472c2f77f5cd745aeba27cacba797b8fcb708617dc5b1290f7495d7f8cc68476e6941aaf510598fa925d0d2720edc8805a846cd37bc77615afefc793aa17d75d4249a9b517ba91b0e54a49c9c4a44b3d7e228302dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800edcc084d3dcd65a1f7f23c65c46722faca6953d28e43150a467cf43e5c309238cd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00a16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d101a164736f6c6343000822000a";
75525
75609
  var isSuperArgs2 = (xs) => xs.length > 1;
75526
- var AgentDelegationRegistry__factory = class extends import_ethers32.ContractFactory {
75610
+ var AgentDelegationRegistry__factory = class extends import_ethers33.ContractFactory {
75527
75611
  constructor(...args) {
75528
75612
  if (isSuperArgs2(args)) {
75529
75613
  super(...args);
@@ -75543,10 +75627,10 @@ var AgentDelegationRegistry__factory = class extends import_ethers32.ContractFac
75543
75627
  static bytecode = _bytecode2;
75544
75628
  static abi = _abi2;
75545
75629
  static createInterface() {
75546
- return new import_ethers32.Interface(_abi2);
75630
+ return new import_ethers33.Interface(_abi2);
75547
75631
  }
75548
75632
  static connect(address, runner) {
75549
- return new import_ethers32.Contract(
75633
+ return new import_ethers33.Contract(
75550
75634
  address,
75551
75635
  _abi2,
75552
75636
  runner
@@ -77724,7 +77808,7 @@ var _abi3 = [
77724
77808
  ];
77725
77809
  var _bytecode3 = "0x60a080604052346100ea57306080527ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005460ff8160401c166100d9576002600160401b03196001600160401b03821601610073575b604051615a7e90816100f0823960805181818161197e01526125180152f35b6001600160401b0319166001600160401b039081177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005581527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a13880610054565b63f92ee8a960e01b60005260046000fd5b600080fdfe608080604052600436101561001357600080fd5b60003560e01c90816301ffc9a71461358e57508063033b66ba1461334d5780630d8e6e2c146102be5780630e0b21cc146131b25780631317cb371461300857806316efd94114612fdf5780631ef3a04c14612fb65780631f4cceff14612f9a57806320af137a14612ee657806323be345c14612ebd578063248a9ca314612e9757806329b6eca914612d805780632a6bc2dd14612c1b5780632f2ff15d14612bea57806336568abe14612ba4578063393d92cc14612b7b5780633c2ef15a14612b245780633f4ba83a14612a6b5780634a26bd95146127935780634a54e00a1461276a5780634f1ef286146124ca5780634f27e7fa1461244157806350c1d19d146119fe5780635273b6f6146119d557806352d1902d1461196b57806353f366c7146118e45780635760f2e31461185b57806358ca3941146118295780635bc26aea146117f55780635c975abb146117c5578063650e5cb41461140a5780636aa6c53f1461119a57806371b2f19c1461110057806375b238fc146110d757806376dc71be14611054578063791b98bc1461102b5780638456cb5914610f355780638b1702fc14610f1a5780639010d07c14610ec657806391d1485414610e6c57806392efff1614610de85780639b9d30c114610dbf5780639cfee37f14610d40578063a217fddf14610d24578063a3246ad314610c62578063a69a9ef714610936578063ad3cb1cc14610c1b578063b49cc29514610bf2578063bdc7647214610bd5578063ca15c87314610b9c578063cf786fc014610b2e578063d547741f14610af6578063dc5632531461093b578063e1f1c4a714610936578063e34ad47b1461089c578063eb33b7501461084d578063eb8c8d411461081d578063f2f4eb26146107f4578063f5e95acb14610321578063fd847e01146102f75763ffa1ad74146102be57600080fd5b346102f25760003660031901126102f2576102ee6102da613922565b60405191829160208352602083019061361e565b0390f35b600080fd5b346102f25760203660031901126102f2576040610315600435614d3f565b82519182526020820152f35b346102f2576101203660031901126102f25761033b61368d565b6103436136a3565b906044356001600160a01b038116908190036102f2576064356001600160a01b038116908190036102f2576084356001600160a01b03811692908390036102f25760a4356001600160a01b03811692908390036102f25760c4356001600160a01b038116949093908585036102f25760e4356001600160a01b03811693908490036102f257610104356001600160a01b038116999095908a87036102f257600080516020615a5283398151915254604081901c60ff16159a906001600160401b0316801590816107ec575b60011490816107e2575b1590816107d9575b506107c857600080516020615a5283398151915280546001600160401b03191660011790558a6107a3575b610453615746565b61045b615746565b610463615746565b61046b615746565b610473615746565b60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f005561049f615746565b6001600160a01b0316908115610792576001600160a01b0316908115610792578215610792578315610792578415610792578515610792578915610792578615610792578b156107925760018060a01b0319600554161760055560018060a01b0319600054161760005560018060a01b0319600154161760015560018060a01b0319600254161760025560018060a01b0319600354161760035560018060a01b0319600454161760045560018060a01b0319600654161760065561056482600061551b565b8061074c575b1561063e5761058782600080516020615a3283398151915261551b565b806106f8575b1561063e576105aa9060008051602061591283398151915261551b565b806106a4575b1561063e576105cd9060008051602061599283398151915261551b565b908161064f575b501561063e57600780546001600160a01b031916831790556040519160006000805160206159d28339815191528180a361060a57005b600080516020615a52833981519152805460ff60401b191690556001815260008051602061597283398151915290602090a1005b63cf5a8e3360e01b60005260046000fd5b60008051602061599283398151915260005260008051602061593283398151915260205261069d907ffff5b43478fa6840382eb63777e0da6941d320b940e3f70f0ea4780feff95827615774565b50836105d4565b6000805160206159128339815191526000526000805160206159328339815191526020526106f2857fdb30a1288f67da8a7b16afbbe7b3c5ab0a7a441f62fe00f878d5fff64f32a697615774565b506105b0565b600080516020615a32833981519152600052600080516020615932833981519152602052610746847f46448fd7a7b40360a1323cb3199d0aafeb92ce905bb512a6bb7d3d3f685cf1b1615774565b5061058d565b6000805260008051602061593283398151915260205261078c847f615f0f9e84155bea8cc509fe18befeb1baf65611e38a6ba60964480fb29dfd44615774565b5061056a565b63e6c4247b60e01b60005260046000fd5b600080516020615a52833981519152805460ff60401b1916600160401b17905561044b565b63f92ee8a960e01b60005260046000fd5b9050158d610420565b303b159150610418565b8c915061040e565b346102f25760003660031901126102f2576000546040516001600160a01b039091168152602090f35b346102f25760003660031901126102f2576060610838614c7d565b90604051921515835260208301526040820152f35b346102f25760603660031901126102f25761088d61087961086c61368d565b6044359060243590614aca565b6040519384936060855260608501906136b9565b91602084015260408301520390f35b346102f25760006108ac366136ed565b825460405163e34ad47b60e01b815260048101939093526024830191909152909190829060449082906001600160a01b03165afa801561092a576102ee91600091610907575b506040519182916020835260208301906136b9565b61092491503d806000833e61091c8183613756565b810190613b5b565b826108f2565b6040513d6000823e3d90fd5b613905565b346102f25760203660031901126102f257600061018060405161095d8161373a565b8281528260208201528260408201526060808201528260808201528260a08201528260c08201528260e08201528261010082015282610120820152826101408201528261016082015201526024600060018060a01b0381541660405192838092638d34875560e01b825260043560048301525afa90811561092a57600091610ad5575b506080810180519091906001600160a01b031615610ac4576101809164ffffffffff60405193849360208552805160208601526020810151604086015260408101516060860152610a4260608201516101a060808801526101c087019061361e565b9360018060a01b0390511660a08601528260a08201511660c08601528260c08201511660e086015261ffff60e0820151166101008601528261010082015116610120860152610a9b610120820151610140870190613680565b826101408201511661016086015261ffff61016082015116828601520151166101a08301520390f35b636ec9be1160e01b60005260046000fd5b610af0913d8091833e610ae88183613756565b810190613a0a565b816109e0565b346102f25760403660031901126102f257610b2c600435610b156136a3565b90610b27610b2282613bf4565b6150c2565b615154565b005b346102f25760203660031901126102f257610b4a600435614942565b9060405191829160408301901515835260406020840152815180915260206060840192019060005b818110610b80575050500390f35b825160ff16845285945060209384019390920191600101610b72565b346102f25760203660031901126102f2576004356000526000805160206159328339815191526020526020604060002054604051908152f35b346102f25760003660031901126102f25760206040516161a88152f35b346102f25760003660031901126102f25760206040516000805160206159128339815191528152f35b346102f25760003660031901126102f2576102ee6040805190610c3e8183613756565b60058252640352e302e360dc1b60208301525191829160208352602083019061361e565b346102f25760203660031901126102f25760043560005260008051602061593283398151915260205260406000206040518060208354918281520190819360005260206000209060005b818110610d0e5750505081610cc2910382613756565b6040519182916020830190602084525180915260408301919060005b818110610cec575050500390f35b82516001600160a01b0316845285945060209384019390920191600101610cde565b8254845260209093019260019283019201610cac565b346102f25760003660031901126102f257602060405160008152f35b346102f2576101603660031901126102f257610144356001600160401b0381116102f257366023820112156102f2576004810135906001600160401b0382116102f25736602483830101116102f2576102ee9160246102da9201610124356101043560e43560c43560a435608435606435604435602435600435613f04565b346102f25760003660031901126102f25760206040516000805160206159928339815191528152f35b346102f25760203660031901126102f2576024602060018060a01b036004541660405192838092634977ff8b60e11b825260043560048301525afa801561092a57602091600091610e3f575b506040519015158152f35b610e5f9150823d8411610e65575b610e578183613756565b810190613cc4565b82610e34565b503d610e4d565b346102f25760403660031901126102f257610e856136a3565b6004356000526000805160206159f283398151915260205260406000209060018060a01b0316600052602052602060ff604060002054166040519015158152f35b346102f25760403660031901126102f2576004356000526000805160206159328339815191526020526020610f0160243560406000206156ec565b905460405160039290921b1c6001600160a01b03168152f35b346102f25760003660031901126102f2576040610315613e12565b346102f25760003660031901126102f2573360009081527f0ac8cc3d209806126662940717264973110c39045b305f6ba49613325a615e09602052604090205460ff161561100457610f85615198565b600160ff19600080516020615a12833981519152541617600080516020615a12833981519152557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a16040514281527f80170b5fcdd2bf1e0660ef4b8851f86685f64d41b1a19de1471947ece8725aac60203392a2005b63e2517d3f60e01b6000523360045260008051602061599283398151915260245260446000fd5b346102f25760003660031901126102f2576005546040516001600160a01b039091168152602090f35b346102f25760003660031901126102f257600054604051633b6e38df60e11b815290602090829060049082906001600160a01b03165afa801561092a576000906110a4575b602090604051908152f35b506020813d6020116110cf575b816110be60209383613756565b810103126102f25760209051611099565b3d91506110b1565b346102f25760003660031901126102f2576020604051600080516020615a328339815191528152f35b346102f25760203660031901126102f25761111961368d565b6007546001600160a01b0316330361118957611133615198565b6001600160a01b0316801561079257600180546001600160a01b0319811683179091553391906001600160a01b03167fa06737e7750a5964f26df32519f3270980324efe72b046924980308f0c0fa45f600080a4005b6349db3bd360e01b60005260046000fd5b346102f25760603660031901126102f2576004356001600160401b0381116102f2576111ca9036906004016137ec565b60243590604435918215928315036102f2576101208201519260088410156113f4576002600094146112ac575b50600c810361127f575061121f6101009164ffffffffff6301e133809384925b015116613be7565b4281111561127057611232904290613e05565b8160011b918083046002149015171561125c571161124d5780f35b6309116a8160e11b8152600490fd5b634e487b7160e01b83526011600452602483fd5b6309116a8160e11b8352600483fd5b62278d0081029080820462278d00149015171561125c576101009164ffffffffff61121f92938492611217565b61010083019064ffffffffff825116421161139057156111f75761018083015164ffffffffff16806113e8575064ffffffffff8060a0850151165b1661ffff60e085015116600c81146000146113b0575064ffffffffff6301e13380925b511682808211156113a75761131e91613e05565b905b8082111561139f5750905b4282116113905762278d008111156113855762278cff1981019081116113715761135790915b42613e05565b1061136257836111f7565b63088502f160e21b8352600483fd5b634e487b7160e01b85526011600452602485fd5b506113578491611351565b63088502f160e21b8552600485fd5b90509061132b565b50508490611320565b62278d0081029080820462278d0014901517156113d45764ffffffffff909261130a565b634e487b7160e01b86526011600452602486fd5b64ffffffffff906112e7565b634e487b7160e01b600052602160045260246000fd5b346102f25760a03660031901126102f2576004356001600160401b0381116102f25761143a9036906004016137ec565b6024356044359160246064359260843593604060018060a01b03600454168151948580926353f366c760e01b82528660048301525afa92831561092a57600093611792575b5060408401805190936127109161149f916001600160581b031690613bd4565b0480861161177a5760018060a01b0360005416602086516024604051809481936375ca21bb60e01b835260048301525afa90811561092a57600091611748575b508082111561173f576114f191613e05565b808610611727575060018060a01b03600154169280519686880197881061171657604051637a3b9c6360e01b8152602081600481895afa90811561092a576000916116e4575b50670de0b6b3a7640000810290808204670de0b6b3a764000014901517156116ce5788116116bd57660775f05a07400083116116ac57662386f26fc10000811161169b5768327cb2734119d3b7a9601e1b881161168a5761159c6020916004946151c2565b946040519384809263100c48d360e21b82525afa91821561092a57600092611651575b50816115cc915185615664565b611640576115db908684615664565b61162f5761ffff60e06115f1876115fa95615235565b94015116613be7565b9061ffff821161161e57608093604051938452602084015260408301526060820152f35b6319a4c60960e21b60005260046000fd5b631300e8bd60e21b60005260046000fd5b63e5cace4160e01b60005260046000fd5b90916020823d602011611682575b8161166c60209383613756565b8101031261167f575051906115cc6115bf565b80fd5b3d915061165f565b638a94304d60e01b60005260046000fd5b63128df78360e01b60005260046000fd5b63e9ec682160e01b60005260046000fd5b63499e798560e01b60005260046000fd5b634e487b7160e01b600052601160045260246000fd5b906020823d60201161170e575b816116fe60209383613756565b8101031261167f57505189611537565b3d91506116f1565b63a421190b60e01b60005260046000fd5b856378279ed960e11b60005260045260245260446000fd5b505060006114f1565b906020823d602011611772575b8161176260209383613756565b8101031261167f575051886114df565b3d9150611755565b856373ab893560e11b60005260045260245260446000fd5b6117b591935060403d6040116117be575b6117ad8183613756565b810190613cdc565b9050918661147f565b503d6117a3565b346102f25760003660031901126102f257602060ff600080516020615a1283398151915254166040519015158152f35b346102f25760203660031901126102f25761180e61368d565b6007546001600160a01b0316330361118957610b2c90613c15565b346102f25760603660031901126102f257604061184d604435602435600435613d00565b825191825215156020820152f35b346102f25760203660031901126102f25761187461368d565b6007546001600160a01b031633036111895761188e615198565b6001600160a01b0316801561079257600580546001600160a01b0319811683179091553391906001600160a01b03167f95b04cc8ee34c3af50f5a566d34239ba1c449c913d700dfe0521073d3b584f41600080a4005b346102f25760203660031901126102f2576024604060018060a01b03600454168151928380926353f366c760e01b825260043560048301525afa90811561092a5760409160009160009161194c575b5082516001600160581b03928316815291166020820152f35b90506119659150823d84116117be576117ad8183613756565b83611933565b346102f25760003660031901126102f2577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031630036119c45760206040516000805160206159b28339815191528152f35b63703e46dd60e11b60005260046000fd5b346102f25760003660031901126102f2576007546040516001600160a01b039091168152602090f35b346102f25760003660031901126102f25760405161034081016001600160401b0381118282101761242b576040526000815260006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526000610100820152600061012082015260006101408201526000610160820152600061018082015260006101a082015260006101c082015260006101e0820152600061020082015260006102208201526000610300820152600061032082015260018060a01b03600054169081151561024082015260018060a01b03600154169182151561026083015260018060a01b0360025416151561028083015260018060a01b0360035416928315156102a084015260018060a01b036004541615156102c084015260018060a01b0360065416918215156102e0850152806123c8575b50610260830151611f46575b506102e0820151611da1575b6102a0820151611d1d575b610340925060ff600080516020615a12833981519152541615156103008301526102e0820151611cc7575b5061032060405191805183526020810151602084015260408101516040840152606081015160608401526080810151608084015260a081015160a084015260c081015160c084015260e081015160e08401526101008101516101008401526101208101516101208401526101408101516101408401526101608101516101608401526101808101516101808401526101a08101516101a08401526101c08101516101c08401526101e08101516101e08401526102008101516102008401526102208101516102208401526102408101511515610240840152610260810151151561026084015261028081015115156102808401526102a081015115156102a08401526102c081015115156102c08401526102e081015115156102e0840152610300810151151561030084015201511515610320820152f35b60206004916040519283809263f609844d60e01b82525afa60009181611cfc575b5015611b8f57151561032082015282611b8f565b611d1691925060203d602011610e6557610e578183613756565b9084611ce8565b6040805163a0eb92e360e01b815293849060049082905afa600081600092611d64575b6103409550611d51575b5050611b64565b6102008401526102208301528380611d4a565b9150506040843d604011611d99575b81611d8060409383613756565b810103126102f257836020610340955191015191611d40565b3d9150611d73565b60405163074e13b960e01b8152602081600481855afa60009181611f12575b50611f07575b50604051633087c5cf60e01b81526201518042046004820152602081602481855afa60009181611ed3575b50611ec8575b506040516285d89b60e21b8152602081600481855afa60009181611e94575b50611e88575b50604051636e252e0160e11b8152602081600481855afa60009181611e54575b50611e48575b50611b59565b61012083015283611e42565b9091506020813d602011611e80575b81611e7060209383613756565b810103126102f257519085611e3c565b3d9150611e63565b61010083015283611e1c565b9091506020813d602011611ec0575b81611eb060209383613756565b810103126102f257519085611e16565b3d9150611ea3565b60e083015283611df7565b9091506020813d602011611eff575b81611eef60209383613756565b810103126102f257519085611df1565b3d9150611ee2565b60c083015283611dc6565b9091506020813d602011611f3e575b81611f2e60209383613756565b810103126102f257519085611dc0565b3d9150611f21565b60405163100c48d360e21b8152602081600481855afa60009181612394575b50612389575b50604051631c42d7b960e21b8152602081600481855afa60009181612355575b5061234a575b50604051637a3b9c6360e01b8152602081600481855afa60009181612316575b5061230b575b50604051636759a85b60e11b8152602081600481855afa600091816122d4575b50916020916004936122c9575b506040516306d136bd60e21b815292839182905afa60009181612295575b5061228a575b506001600160a01b03612019614fe2565b168015611b4d576040516313cf87bf60e21b8152602081600481855afa60009181612256575b5061224a575b5060405163d5abeb0160e01b8152602081600481855afa60009181612216575b5061220a575b5060405162d5c44360e41b8152602081600481855afa600091816121d6575b506121ca575b50604051630b5570e560e31b8152602081600481855afa60009181612196575b5061218a575b506040516362680e4b60e01b8152602081600481855afa60009181612153575b5091602091600493612147575b5060405163d3303e4160e01b815292839182905afa60009181612113575b5015611b4d576101e083015283611b4d565b9091506020813d60201161213f575b8161212f60209383613756565b810103126102f257519085612101565b3d9150612122565b6101c0860152866120e3565b9150916020823d602011612182575b8161216f60209383613756565b810103126102f2579051909160046120d6565b3d9150612162565b6101a0840152846120b6565b9091506020813d6020116121c2575b816121b260209383613756565b810103126102f2575190866120b0565b3d91506121a5565b61018084015284612090565b9091506020813d602011612202575b816121f260209383613756565b810103126102f25751908661208a565b3d91506121e5565b6101608401528461206b565b9091506020813d602011612242575b8161223260209383613756565b810103126102f257519086612065565b3d9150612225565b61014084015284612045565b9091506020813d602011612282575b8161227260209383613756565b810103126102f25751908661203f565b3d9150612265565b60a083015283612008565b9091506020813d6020116122c1575b816122b160209383613756565b810103126102f257519085612002565b3d91506122a4565b608086015286611fe4565b9150916020823d602011612303575b816122f060209383613756565b810103126102f257905190916004611fd7565b3d91506122e3565b606084015284611fb7565b9091506020813d602011612342575b8161233260209383613756565b810103126102f257519086611fb1565b3d9150612325565b604084015284611f91565b9091506020813d602011612381575b8161237160209383613756565b810103126102f257519086611f8b565b3d9150612364565b602084015284611f6b565b9091506020813d6020116123c0575b816123b060209383613756565b810103126102f257519086611f65565b3d91506123a3565b602060049160405192838092633b6e38df60e11b82525afa600091816123f7575b5015611b4157835284611b41565b9091506020813d602011612423575b8161241360209383613756565b810103126102f2575190866123e9565b3d9150612406565b634e487b7160e01b600052604160045260246000fd5b346102f25760203660031901126102f25761245a61368d565b6007546001600160a01b0316330361118957612474615198565b6001600160a01b0316801561079257600680546001600160a01b0319811683179091553391906001600160a01b03167f8550087a253262ad1d569902c213043016c8e75d5a0dfcf70c0473c8e67eab50600080a4005b60403660031901126102f2576124de61368d565b6024356001600160401b0381116102f257366023820112156102f25761250e903690602481600401359101613794565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016308114908115612747575b506119c4576007546001600160a01b03163303611189576001600160a01b03821691821561079257803b15612736576000805160206159b2833981519152548361258b613922565b7f6ea8b34d59b2818d3f37a08dddaa06f5886b9c20c907b36f03ca6528e106e86f6125c16040519260408452604084019061361e565b4260208401526001600160a01b038516929081900390a36040516352d1902d60e01b8152602081600481885afa60009181612702575b506126115784634c9c8ce360e01b60005260045260246000fd5b90816000805160206159b28339815191528693036126ee5750823b156126d9576001600160a01b03191681176000805160206159b2833981519152557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a28151156126bf57600080836020610b2c95519101845af43d156126b7573d9161269a83613779565b926126a86040519485613756565b83523d6000602085013e6158b0565b6060916158b0565b5050346126c857005b63b398979f60e01b60005260046000fd5b50634c9c8ce360e01b60005260045260246000fd5b632a87526960e21b60005260045260246000fd5b90916020823d60201161272e575b8161271d60209383613756565b8101031261167f57505190866125f7565b3d9150612710565b636f7c43f160e01b60005260046000fd5b6000805160206159b2833981519152546001600160a01b03161415905083612543565b346102f25760003660031901126102f2576004546040516001600160a01b039091168152602090f35b346102f2576127a1366136ed565b808015612a5a57603210612a52575b600054604051633b6e38df60e11b81526001600160a01b03909116929091602083600481875afa92831561092a57600093612a1e575b506040519063e34ad47b60e01b82528260048301526024820152600081604481875afa90811561092a57600091612a03575b5061282581518093613be7565b9361282f83613945565b9261283d6040519485613756565b808452601f1961284c82613945565b0160005b8181106129d057505060009260005b8281106129045750505050815260405191606083016060845282518091526080840190602060808260051b8701019401916000905b8282106128af57505050508293602084015260408301520390f35b90919294602080600192607f198a820301855288519081518152606060ff816128e586860151608088870152608086019061361e565b9460408101516040860152015116910152970192019201909291612894565b61290e8183613c81565b519060405191638d34875560e01b83526004830152600082602481885afa91821561092a576000926129b5575b50604082015180612952575b50600191500161285f565b82519661012060608501519401519360088510156113f4576001946129ae9360ff926040519b6129818d61371f565b8c5260208c015260408b015216606089015261299c81613c95565b976129a7828b613c81565b5288613c81565b5089612947565b6129c991923d8091833e610ae88183613756565b908961293b565b6020906040516129df8161371f565b60008152606083820152600060408201526000606082015282828901015201612850565b612a1891503d806000833e61091c8183613756565b84612818565b9092506020813d602011612a4a575b81612a3a60209383613756565b810103126102f2575191846127e6565b3d9150612a2d565b5060326127b0565b63162908e360e11b60005260046000fd5b346102f25760003660031901126102f2576007546001600160a01b0316330361118957600080516020615a128339815191525460ff811615612b135760ff1916600080516020615a12833981519152557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a16040514281527f107553d8191d85b405879cf752997865edd48d94e20bda4dd27223c94b31a7cc60203392a2005b638dfc202b60e01b60005260046000fd5b346102f25760203660031901126102f257600054604051631e1778ad60e11b8152600480359082015290602090829060249082906001600160a01b03165afa801561092a576000906110a457602090604051908152f35b346102f25760003660031901126102f2576001546040516001600160a01b039091168152602090f35b346102f25760403660031901126102f257612bbd6136a3565b336001600160a01b03821603612bd957610b2c90600435615154565b63334bd91960e11b60005260046000fd5b346102f25760403660031901126102f257610b2c600435612c096136a3565b90612c16610b2282613bf4565b61510c565b346102f25760203660031901126102f257612c3461368d565b60008054604051632a6bc2dd60e01b81526001600160a01b0393841660048201529192168282602481845afa91821561092a57600092612d63575b5081516032811115612d5d57506032905b60005b828110612cad57612ca384866040519283926040845260408401906136b9565b9060208301520390f35b612cb78185613c81565b5160405190638d34875560e01b82526004820152600081602481865afa801561092a5761012091600091612d44575b50015160088110156113f457600281149060008215612d39575b8215612d2a575b5050612d16575b600101612c83565b93612d22600191613c95565b949050612d0e565b9091506113f457158680612d07565b600182149250612d00565b612d57913d8091833e610ae88183613756565b87612ce6565b90612c80565b612d799192503d806000833e61091c8183613756565b9083612c6f565b346102f25760203660031901126102f257612d9961368d565b600080516020615a528339815191525460ff8160401c16908115612e7f575b506107c857600080516020615a5283398151915280546001600160481b0319166002600160401b011790553360009081527fb7db2dd08fcb62d0c9e08c51941cae53c267786a0b75803fb7960902fc8ef97d602052604090205460ff1615612e6557612e2390613c15565b60ff60401b19600080516020615a528339815191525416600080516020615a5283398151915255600080516020615972833981519152602060405160028152a1005b63e2517d3f60e01b60005233600452600060245260446000fd5b60026001600160401b03919091161015905082612db8565b346102f25760203660031901126102f2576020612eb5600435613bf4565b604051908152f35b346102f25760003660031901126102f2576002546040516001600160a01b039091168152602090f35b346102f25760203660031901126102f257612eff61368d565b60008054604051632a6bc2dd60e01b81526001600160a01b0393841660048201529283916024918391165afa90811561092a57600091612f7f575b50516032811115612f795760325b61271081029080820461271014901517156116ce576161a801806161a8116116ce5760409182519182526020820152f35b80612f48565b612f9491503d806000833e61091c8183613756565b81612f3a565b346102f25760003660031901126102f257602060405160328152f35b346102f25760003660031901126102f2576003546040516001600160a01b039091168152602090f35b346102f25760003660031901126102f2576006546040516001600160a01b039091168152602090f35b346102f25760203660031901126102f257600061010060405161302a81613703565b8281528260208201528260408201528260608201528260808201528260a08201528260c08201528260e082015201526024600060018060a01b0381541660405192838092638d34875560e01b825260043560048301525afa90811561092a57600091613199575b508051602082015190604083015160018060a01b036080850151169364ffffffffff60a0820151169064ffffffffff60c0820151169561ffff60e08301511661012064ffffffffff610100850151169301519460088610156113f4576101209864ffffffffff809661ffff9582946131979b6040519061311082613703565b8152602081019d8e5260408101918252606081019283526080810193845260a0810195865260c0810197885260e08101998a5261010081019b8c5260206040519e8f92518352519101525160408d015260018060a01b0390511660608c0152511660808a0152511660a0880152511660c0860152511660e084015251610100830190613680565bf35b6131ac913d8091833e610ae88183613756565b81613091565b346102f25760003660031901126102f25760048054604051630382c87360e21b81529160009183919082906001600160a01b03165afa801561092a57600080928192613262575b5091906040519283926060840160608552825180915260206080860193019060005b818110613249575050508161323b91856102ee9594036020870152613643565b908382036040850152613643565b825185528796506020948501949092019160010161321b565b915091503d8083833e6132758183613756565b8101906060818303126133495780516001600160401b0381116133455781019180601f84011215613345578251926132ac84613945565b936132ba6040519586613756565b80855260208086019160051b8301019183831161334157602001905b8282106133315750505060208201516001600160401b03811161332d57816132ff918401613970565b604083015190926001600160401b038211613329576133219394955001613970565b9091836131f9565b8580fd5b8480fd5b81518152602091820191016132d6565b8680fd5b8380fd5b8280fd5b346102f25760003660031901126102f2576040516101c08101906001600160401b0382118183101761242b576101c0916040526000815260208101906000825260408101600081526060820160008152608083016000815260a084016000815260c085016000815260e08601600081526101008701916000835261012088019360008552610140890195600087526101608a0197600089526101808b019960008b526101a08c019b60008d528d61341a60018060a01b036005541661341181614e42565b15158452614ea4565b15159052600054613433906001600160a01b0316614e42565b1515825260015461344c906001600160a01b0316614e42565b15158352600254613465906001600160a01b0316614e42565b1515845260035461347e906001600160a01b0316614e42565b15158552600654613497906001600160a01b0316614e42565b151586526004546134b0906001600160a01b0316614e42565b15158a526134c46134bf614ede565b614e42565b15158b526134d36134bf614f6c565b15158c526134e26134bf614fa7565b15158d526134f16134bf614fe2565b151587526135006134bf615050565b1515885261350f6134bf615089565b1515895260206040519e8f92511515835251151591015251151560408d015251151560608c015251151560808b015251151560a08a015251151560c089015251151560e08801525115156101008701525115156101208601525115156101408501525115156101608401525115156101808301525115156101a0820152f35b346102f25760203660031901126102f2576004359063ffffffff60e01b82168092036102f257602091635a05180f60e01b81149081156135d0575b5015158152f35b637965db0b60e01b8114915081156135ea575b50836135c9565b6301ffc9a760e01b149050836135e3565b60005b83811061360e5750506000910152565b81810151838201526020016135fe565b90602091613637815180928185528580860191016135fb565b601f01601f1916010190565b906020808351928381520192019060005b8181106136615750505090565b82516001600160581b0316845260209384019390920191600101613654565b9060088210156113f45752565b600435906001600160a01b03821682036102f257565b602435906001600160a01b03821682036102f257565b906020808351928381520192019060005b8181106136d75750505090565b82518452602093840193909201916001016136ca565b60409060031901126102f2576004359060243590565b61012081019081106001600160401b0382111761242b57604052565b608081019081106001600160401b0382111761242b57604052565b6101a081019081106001600160401b0382111761242b57604052565b601f909101601f19168101906001600160401b0382119082101761242b57604052565b6001600160401b03811161242b57601f01601f191660200190565b9291926137a082613779565b916137ae6040519384613756565b8294818452818301116102f2578281602093846000960137010152565b359064ffffffffff821682036102f257565b359061ffff821682036102f257565b9190916101a0818403126102f257604051906138078261373a565b8193813583526020820135602084015260408201356040840152606082013560018060401b0381116102f25782019080601f830112156102f25781602061385093359101613794565b606083015260808101356001600160a01b03811681036102f257608083015261387b60a082016137cb565b60a083015261388c60c082016137cb565b60c083015261389d60e082016137dd565b60e08301526138af61010082016137cb565b6101008301526101208101359060088210156102f2576101806139009181936101208601526138e161014082016137cb565b6101408601526138f461016082016137dd565b610160860152016137cb565b910152565b346102f25760003660031901126102f25760206040516127108152f35b60405190613931604083613756565b6005825264312e312e3360d81b6020830152565b6001600160401b03811161242b5760051b60200190565b51906001600160581b03821682036102f257565b9080601f830112156102f257815161398781613945565b926139956040519485613756565b81845260208085019260051b8201019283116102f257602001905b8282106139bd5750505090565b602080916139ca8461395c565b8152019101906139b0565b51906001600160a01b03821682036102f257565b519064ffffffffff821682036102f257565b519061ffff821682036102f257565b6020818303126102f2578051906001600160401b0382116102f257016101a0818303126102f25760405191613a3e8361373a565b81518352602080830151908401526040808301519084015260608201516001600160401b0381116102f257820181601f820112156102f2578051613a8181613779565b92613a8f6040519485613756565b818452602082840101116102f257613aad91602080850191016135fb565b6060830152613abe608082016139d5565b6080830152613acf60a082016139e9565b60a0830152613ae060c082016139e9565b60c0830152613af160e082016139fb565b60e0830152613b0361010082016139e9565b61010083015261012081015160088110156102f257613b529161018091610120850152613b3361014082016139e9565b610140850152613b4661016082016139fb565b610160850152016139e9565b61018082015290565b6020818303126102f2578051906001600160401b0382116102f257019080601f830112156102f2578151613b8e81613945565b92613b9c6040519485613756565b81845260208085019260051b8201019283116102f257602001905b828210613bc45750505090565b8151815260209182019101613bb7565b818102929181159184041417156116ce57565b919082018092116116ce57565b6000526000805160206159f283398151915260205260016040600020015490565b6001600160a01b038116908115610792573b1561273657600780546001600160a01b0319811683179091556001600160a01b03166000805160206159d2833981519152600080a3565b805115613c6b5760200190565b634e487b7160e01b600052603260045260246000fd5b8051821015613c6b5760209160051b010190565b60001981146116ce5760010190565b8115613cae570490565b634e487b7160e01b600052601260045260246000fd5b908160209103126102f2575180151581036102f25790565b91908260409103126102f257613cfd6020613cf68461395c565b930161395c565b90565b60008054604051638d34875560e01b81526004810193909352929392829060249082906001600160a01b03165afa90811561092a57600091613dea575b5060808101516001600160a01b031615610ac45760400151908115613ddf57613d6e92613d69916151c2565b615235565b60015460405163100c48d360e21b815291929190602090829060049082906001600160a01b03165afa90811561092a57600091613dad575b5082101590565b90506020813d602011613dd7575b81613dc860209383613756565b810103126102f2575138613da6565b3d9150613dbb565b505050600090600190565b613dff91503d806000833e610ae88183613756565b38613d3d565b919082039182116116ce57565b6006546001600160a01b0316908115613ed757604051636e252e0160e11b8152602081600481865afa90811561092a57600091613ea4575b50602060049193604051928380926285d89b60e21b82525afa90811561092a57600091613e75575090565b90506020813d602011613e9c575b81613e9060209383613756565b810103126102f2575190565b3d9150613e83565b90506020813d602011613ecf575b81613ebf60209383613756565b810103126102f257516020613e4a565b3d9150613eb2565b600091508190565b60405190613eee604083613756565b60078252660161023b7ba1d160cd1b6020830152565b9590969198939997929460009a87156148c557881561487a57861561482f5781156147e457841561478e578c156147435764e8d4a5100082106146de57655af3107a400082116146795785156146225761012c86018087116145905742116145a45761012c420180421161459057861161450b57613f806152b5565b80860361442957508b54604051638d34875560e01b8152600481018a905297969594939291908d90899060249082906001600160a01b03165afa97881561441e578d98614401575b50875115614391576040880180516040516020810191825260208152613fef604082613756565b5190209081860361424c575050916101649795939160209a9997959360018060a01b036001541697608060018060a01b0391015116966040519e8f9c8d9b632fd74aa960e11b8d5260048d015260248c015260448b015260648a0152608489015260a488015260c487015260e48601526101048501526101248401526101448301525afa91821561424157839261420d575b5060055460405163fb7c6a0f60e01b815290602090829060049082906001600160a01b03165afa9081156142025784916141c0575b506001600160a01b031691823b15613345579184916084859460405197889586948593636b80155f60e01b8552632c545d9960e21b6004860152602485015260606044850152816064850152848401378181018301879052601f01601f191681010301915afa91826141b0575b509061417b5750604051614138606082613756565b602d81527f56616c69646174696f6e20393a20766572696679417574686f72697a6174696f60208201526c1b8818d85b1b0819985a5b1959609a1b604082015290565b5060405161418a604082613756565b6016815275105b1b081d985b1a59185d1a5bdb9cc81c185cdcd95960521b602082015290565b816141ba91613756565b38614123565b90506020813d6020116141fa575b816141db60209383613756565b8101031261334557516001600160a01b038116810361334557386140b6565b3d91506141ce565b6040513d86823e3d90fd5b9091506020813d602011614239575b8161422960209383613756565b8101031261334957519038614081565b3d915061421c565b6040513d85823e3d90fd5b9b509d505050509897505050505050506040519261426b606085613756565b602c845260208401947f56616c69646174696f6e20383a20446562742068617368206d69736d617463688652604085016b0171022bc3832b1ba32b21d160a51b90526142b690615386565b926142bf613edf565b916142c990615386565b9050604051916142da604084613756565b6010835260208301936f0161021bab93932b73a103232b13a1d160851b85525161430390615457565b9460405197889751908160208a0161431a926135fb565b870181519182602083019160200191614332926135fb565b01602001808251602081940191614348926135fb565b0180825160208194019161435b926135fb565b0191829151809361436b926135fb565b0180825160208194019161437e926135fb565b0103601f1981018252613cfd9082613756565b50505050505050505050505080915050506040516143b0606082613756565b603b81527f56616c69646174696f6e20383a20506f736974696f6e206e6f7420666f756e6460208201527a2028706f736974696f6e4964203d3d20627974657333322830292960281b604082015290565b6144179198508d3d8091833e610ae88183613756565b9638613fc8565b6040513d8f823e3d90fd5b98505050505095505050506144cb94506020915083613cfd9450506144fc8260405194614457606087613756565b603086526144ee826144a7818901967f56616c69646174696f6e20373a20436f6e74726163742068617368206d69736d88526f030ba31b4171022bc3832b1ba32b21d160851b60408b0152615386565b6144b86144b2613edf565b94615386565b966040519b8c9a518092858d01906135fb565b89016144df825180938580850191016135fb565b010191828151948592016135fb565b0191828151948592016135fb565b0103601f198101835282613756565b50505050505050505050508091505050604051614529608082613756565b6060815260008051602061595283398151915260208201527f6f6f2066617220696e2066757475726520287175616e74756d54696d6573746160408201527f6d70203e20626c6f636b2e74696d657374616d70202b204d41585f534b455729606082015290565b634e487b7160e01b8d52601160045260248dfd5b505050505050505050505080915050506040516145c2608082613756565b6056815260008051602061595283398151915260208201527f6f6f206f6c6420287175616e74756d54696d657374616d70202b204d41585f536040820152754b4557203c20626c6f636b2e74696d657374616d702960501b606082015290565b50505050505050505050508091505050604051614640606082613756565b602381527f56616c69646174696f6e20343a207175616e74756d54696d657374616d70203d60208201526203d20360ec1b604082015290565b50505050505050505050508091505050604051614697606082613756565b603181527f56616c69646174696f6e20333a206274635072696365203e20444941474e4f536020820152700a89286be84a886bea0a492868abe9a82b607b1b604082015290565b505050505050505050505080915050506040516146fc606082613756565b603181527f56616c69646174696f6e20333a206274635072696365203c20444941474e4f536020820152702a24a1afa12a21afa82924a1a2afa6a4a760791b604082015290565b50505050505050505050508091505050604051614761604082613756565b601d81527f56616c69646174696f6e20313a207369676e617475726520656d707479000000602082015290565b505050505050505050505080915050506040516147ac606082613756565b602281527f56616c69646174696f6e20313a20636f6e747261637448617368206973207a65602082015261726f60f01b604082015290565b50505050505050505050508091505050604051614802604082613756565b601e81527f56616c69646174696f6e20313a206274635072696365206973207a65726f0000602082015290565b5050505050505050505050809150505060405161484d604082613756565b601d81527f56616c69646174696f6e20313a206e657744656274206973207a65726f000000602082015290565b50505050505050505050508091505050604051614898604082613756565b602081527f56616c69646174696f6e20313a206d696e74416d6f756e74206973207a65726f602082015290565b505050505050505050505080915050506040516148e3604082613756565b602081527f56616c69646174696f6e20313a20706f736974696f6e4964206973207a65726f602082015290565b9061491a82613945565b6149276040519182613756565b8281528092614938601f1991613945565b0190602036910137565b60008054604051638d34875560e01b815260048101849052936001600160a01b0390911692909184602481865afa93841561092a57600094614aad575b5060808401516001600160a01b031615614a7957604051926101606149a48186613756565b600a8552601f19013660208601376020806000960151602460405180948193631e1778ad60e11b835260048301525afa908115614a6e578591614a3c575b5003614a27575b8215926149f581614910565b9260005b828110614a0557505050565b8060ff614a1460019385613c81565b5116614a208288613c81565b52016149f9565b600192506002614a3683613c5e565b526149e9565b90506020813d602011614a66575b81614a5760209383613756565b8101031261332d5751386149e2565b3d9150614a4a565b6040513d87823e3d90fd5b50915050604080519190614a8d8184613756565b60018352601f19013660208401376001614aa683613c5e565b5260009190565b614ac39194503d806000833e610ae88183613756565b923861497f565b60008054604051632a6bc2dd60e01b81526001600160a01b03938416600482015293959194939192168482602481845afa91821561092a57600092614c60575b50815193848710801590614c58575b614c335760328111614c2b575b614b309087613be7565b86858211614c23575b614b4291613e05565b91614b4c83614910565b9660005b848110614b5e575050505050565b614b71614b6b8284613be7565b84613c81565b5180614b7d838c613c81565b5260405190638d34875560e01b82526004820152600081602481885afa801561092a5761012091600091614c0a575b50015160088110156113f457600281149060008215614bff575b8215614bf0575b5050614bdc575b600101614b50565b96614be8600191613c95565b979050614bd4565b9091506113f457153880614bcd565b600182149250614bc6565b614c1d913d8091833e610ae88183613756565b38614bac565b859150614b39565b506032614b26565b50505092509050604051614c48602082613756565b6000815260003681379160009190565b508015614b19565b614c769192503d806000833e61091c8183613756565b9038614b0a565b6006546001600160a01b0316908115614d355760405163f609844d60e01b8152602081600481865afa90811561092a57600491602091600091614d18575b50936040519283809263074e13b960e01b82525afa90811561092a57600091614ce6575b5090600090565b90506020813d602011614d10575b81614d0160209383613756565b810103126102f2575138614cdf565b3d9150614cf4565b614d2f9150823d8411610e6557610e578183613756565b38614cbb565b6000915081908190565b6006546001600160a01b0316916000918315614e385760405190633087c5cf60e01b82526004820152602081602481875afa90811561092a57600091614e06575b50600460208295604051928380926285d89b60e21b82525afa90811561092a57600091614dd4575b5080614db2575050565b9091925061271082029180830461271014901517156116ce57613cfd91613ca4565b906020823d602011614dfe575b81614dee60209383613756565b8101031261167f57505138614da8565b3d9150614de1565b906020823d602011614e30575b81614e2060209383613756565b8101031261167f57505138614d80565b3d9150614e13565b5060009250829150565b6001600160a01b03168015614e9e57602060049160405192838092635c975abb60e01b82525afa60009181614e7d575b50613cfd5750600090565b614e9791925060203d602011610e6557610e578183613756565b9038614e72565b50600090565b6001600160a01b03168015614e9e5760206004916040519283809263d53dc73960e01b82525afa60009181614e7d5750613cfd5750600090565b6005546040516303e1469160e61b815290602090829060049082906001600160a01b03165afa8091600091614f26575b5090614f1a5750600090565b6001600160a01b031690565b6020813d602011614f64575b81614f3f60209383613756565b81010312614f605751906001600160a01b038216820361167f575038614f0e565b5080fd5b3d9150614f32565b60015460405163eb373f3f60e01b815290602090829060049082906001600160a01b03165afa8091600091614f26575090614f1a5750600090565b600054604051638998b7cf60e01b815290602090829060049082906001600160a01b03165afa8091600091614f26575090614f1a5750600090565b60015460405163b1d3354f60e01b815290602090829060049082906001600160a01b03165afa6000918161501b5750613cfd5750600090565b9091506020813d602011615048575b8161503760209383613756565b810103126102f257614e97906139d5565b3d915061502a565b60015460405163023b2a9f60e31b815290602090829060049082906001600160a01b03165afa6000918161501b5750613cfd5750600090565b60055460405163db19e96360e01b815290602090829060049082906001600160a01b03165afa6000918161501b5750613cfd5750600090565b60008181526000805160206159f28339815191526020908152604080832033845290915290205460ff16156150f45750565b63e2517d3f60e01b6000523360045260245260446000fd5b615116828261551b565b918261512157505090565b60009182526000805160206159328339815191526020526040909120615150916001600160a01b031690615774565b5090565b61515e82826155c4565b918261516957505090565b60009182526000805160206159328339815191526020526040909120615150916001600160a01b0316906157dd565b60ff600080516020615a1283398151915254166151b157565b63d93c066560e01b60005260046000fd5b90660775f05a07400082116116ac57662386f26fc10000811161169b5781158015908161521f575b5061520e576151f891613bd4565b6064810290808204606414901517156116ce5790565b63450d49cd60e01b60005260046000fd5b9050613cae5760648260001904048111386151ea565b9080156152a45768327cb2734119d3b7a9601e1b821161168a577e068db8bac710cb295e9e1b089a027525460aa64c2f837b4a2339c0ebedfa4382116152935761271082029180830461271014901517156116ce57613cfd91613ca4565b633da428df60e21b60005260046000fd5b6323d359a360e01b60005260046000fd5b60015460405163b1d3354f60e01b81526001600160a01b0390911690602081600481855afa60009181615339575b506152ef575050600090565b600554600454604080516001600160a01b0393841660208201908152918101959095529082166060850152911660808084019190915282529061533360a082613756565b51902090565b9091506020813d60201161536d575b8161535560209383613756565b810103126102f257615366906139d5565b90386152e3565b3d9150615348565b908151811015613c6b570160200190565b60405190615395608083613756565b60428252602082016060368237825115613c6b5760309053815160011015613c6b576078602183015360005b602081106153ce57505090565b81811a6153e060ff8260041c16615704565b908260011b91838304600214841517156116ce578260020191826002116116ce5761541c92615415600f9360001a9189615375565b5316615704565b600091600301918260031161544357600193929161543c911a9186615375565b53016153c1565b634e487b7160e01b81526011600452602490fd5b80156154fb5780816000925b6154e5575061547182613779565b9161547f6040519384613756565b80835281601f1961548f83613779565b013660208601375b6154a057505090565b60001981019081116116ce578091600a810660300191826030116116ce57600a9260f81b6001600160f81b03191660001a906154dc9086615375565b53049081615497565b90916154f2600a91613c95565b92910480615463565b5060405161550a604082613756565b60018152600360fc1b602082015290565b60008181526000805160206159f2833981519152602090815260408083206001600160a01b038616845290915290205460ff166155bd5760008181526000805160206159f2833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19166001179055339291907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a4600190565b5050600090565b60008181526000805160206159f2833981519152602090815260408083206001600160a01b038616845290915290205460ff16156155bd5760008181526000805160206159f2833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19169055339291907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9080a4600190565b9181156156e45768327cb2734119d3b7a9601e1b831161168a577e068db8bac710cb295e9e1b089a027525460aa64c2f837b4a2339c0ebedfa438311615293576000826000190482116156d55761271084029380850461271014901517156154435750906156d191613bd4565b1190565b633da428df60e21b8152600490fd5b505050600090565b8054821015613c6b5760005260206000200190600090565b60ff16600a81101561572b5760300160ff81116116ce5760f81b6001600160f81b03191690565b60570160ff81116116ce5760f81b6001600160f81b03191690565b60ff600080516020615a528339815191525460401c161561576357565b631afcd79f60e31b60005260046000fd5b60018101908260005281602052604060002054156000146156e4578054600160401b81101561242b576157c86157b18260018794018555846156ec565b819391549060031b91821b91600019901b19161790565b90555491600052602052604060002055600190565b90600182019181600052826020526040600020548015156000146158a75760001981018181116116ce5782546000198101919082116116ce57818103615870575b5050508054801561585a57600019019061583882826156ec565b8154906000199060031b1b191690555560005260205260006040812055600190565b634e487b7160e01b600052603160045260246000fd5b6158906158806157b193866156ec565b90549060031b1c928392866156ec565b90556000528360205260406000205538808061581e565b50505050600090565b906158d657508051156158c557602081519101fd5b63d6bda27560e01b60005260046000fd5b81511580615908575b6158e7575090565b639996b31560e01b60009081526001600160a01b0391909116600452602490fd5b50803b156158df56fe0073bca384c5694c6e96fcd606b93d29d3f9c8294a3638967da39aea012c8e58c1f6fe24621ce81ec5827caf0253cadb74709b061630e6b55e8237170593200056616c69646174696f6e20363a207175616e74756d54696d657374616d702074c7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d275027301df982f5215b4963a854cf9c73219df80cb6acd8f098189c9480c7bbc360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc17dc5b1290f7495d7f8cc68476e6941aaf510598fa925d0d2720edc8805a846c02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800cd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300a49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00a164736f6c6343000822000a";
77726
77810
  var isSuperArgs3 = (xs) => xs.length > 1;
77727
- var PositionManagerViews__factory = class extends import_ethers33.ContractFactory {
77811
+ var PositionManagerViews__factory = class extends import_ethers34.ContractFactory {
77728
77812
  constructor(...args) {
77729
77813
  if (isSuperArgs3(args)) {
77730
77814
  super(...args);
@@ -77744,10 +77828,10 @@ var PositionManagerViews__factory = class extends import_ethers33.ContractFactor
77744
77828
  static bytecode = _bytecode3;
77745
77829
  static abi = _abi3;
77746
77830
  static createInterface() {
77747
- return new import_ethers33.Interface(_abi3);
77831
+ return new import_ethers34.Interface(_abi3);
77748
77832
  }
77749
77833
  static connect(address, runner) {
77750
- return new import_ethers33.Contract(
77834
+ return new import_ethers34.Contract(
77751
77835
  address,
77752
77836
  _abi3,
77753
77837
  runner
@@ -77765,7 +77849,7 @@ var SET_DELEGATE_GATE_ABI = [
77765
77849
  "function delegateBurned(address delegate) view returns (bool)"
77766
77850
  ];
77767
77851
  async function getSetDelegateBlocker(delegate, provider, registryAddress) {
77768
- const registry = new import_ethers34.Contract(
77852
+ const registry = new import_ethers35.Contract(
77769
77853
  registryAddress,
77770
77854
  SET_DELEGATE_GATE_ABI,
77771
77855
  provider
@@ -77782,7 +77866,7 @@ async function getSetDelegateBlocker(delegate, provider, registryAddress) {
77782
77866
  return null;
77783
77867
  }
77784
77868
  async function setPositionDelegate(positionId, delegate, signer, registryAddress) {
77785
- const registry = new import_ethers34.Contract(
77869
+ const registry = new import_ethers35.Contract(
77786
77870
  registryAddress,
77787
77871
  POSITION_DELEGATE_REGISTRY_ABI,
77788
77872
  signer
@@ -77790,7 +77874,7 @@ async function setPositionDelegate(positionId, delegate, signer, registryAddress
77790
77874
  return registry["setPositionDelegate"](positionId, delegate);
77791
77875
  }
77792
77876
  async function getPositionDelegate(positionId, provider, registryAddress) {
77793
- const registry = new import_ethers34.Contract(
77877
+ const registry = new import_ethers35.Contract(
77794
77878
  registryAddress,
77795
77879
  POSITION_DELEGATE_REGISTRY_ABI,
77796
77880
  provider
@@ -77997,9 +78081,13 @@ var SIGNABLE_FUNCTIONS2 = [
77997
78081
  "function redeem(address stablecoin, uint256 ucdAmount, uint256 minStablecoinOut) external returns (uint256)",
77998
78082
  // BitcoinWithdrawalAddressRegistry — `msg.sender` must be the borrower, so
77999
78083
  // this too is client-only and never module-whitelisted.
78000
- "function addAddress(string btcAddress) external"
78084
+ "function addAddress(string btcAddress) external",
78085
+ // StUSDCVault 1.1.0 — the hold-only UCD desk. Direct EOA calls like the PSM
78086
+ // pair (the vault pulls from `msg.sender`); never routed through AgentModule.
78087
+ "function sellUCD(uint256 amountUCD, uint256 minUSDC) external returns (uint256)",
78088
+ "function buyUCD(uint256 amountUSDC, uint256 minUCD) external returns (uint256)"
78001
78089
  ];
78002
- var IFACE2 = new import_ethers36.ethers.Interface(SIGNABLE_FUNCTIONS2);
78090
+ var IFACE2 = new import_ethers37.ethers.Interface(SIGNABLE_FUNCTIONS2);
78003
78091
  function encodeSignable2(fn, args) {
78004
78092
  return IFACE2.encodeFunctionData(fn, args);
78005
78093
  }
@@ -78024,7 +78112,7 @@ function eqAddr2(a, b) {
78024
78112
  if (!a || !b)
78025
78113
  return false;
78026
78114
  try {
78027
- return import_ethers37.ethers.getAddress(a) === import_ethers37.ethers.getAddress(b);
78115
+ return import_ethers38.ethers.getAddress(a) === import_ethers38.ethers.getAddress(b);
78028
78116
  } catch {
78029
78117
  return false;
78030
78118
  }
@@ -78090,7 +78178,7 @@ function readValue2(tx2) {
78090
78178
  }
78091
78179
  function normalizePositionId2(id) {
78092
78180
  const hex = id.startsWith("0x") ? id : `0x${id}`;
78093
- return import_ethers37.ethers.zeroPadValue(hex, 32).toLowerCase();
78181
+ return import_ethers38.ethers.zeroPadValue(hex, 32).toLowerCase();
78094
78182
  }
78095
78183
  function requirePositionId(actual, expected) {
78096
78184
  const txPositionId = String(actual).toLowerCase();
@@ -78349,6 +78437,53 @@ function validateUnsignedTx2(unsignedTx, expected, vctx) {
78349
78437
  }
78350
78438
  break;
78351
78439
  }
78440
+ case "desk-approve": {
78441
+ if (name !== "approve") {
78442
+ throw new TxValidationError2(`expected ERC-20 approve, decoded ${name}`);
78443
+ }
78444
+ if (!eqAddr2(to, expected.tokenAddress)) {
78445
+ throw new TxValidationError2(`approve must target the token (${expected.tokenAddress}), got ${to}`);
78446
+ }
78447
+ if (!eqAddr2(String(args[0]), expected.vaultAddress)) {
78448
+ throw new TxValidationError2(`approve spender must be the StUSDCVault (${expected.vaultAddress}), got ${String(args[0])}`);
78449
+ }
78450
+ if (BigInt(String(args[1])).toString() !== expected.amount) {
78451
+ throw new TxValidationError2(
78452
+ `approve amount must be EXACTLY ${expected.amount} (exact-amount rule), got ${BigInt(String(args[1]))}`
78453
+ );
78454
+ }
78455
+ break;
78456
+ }
78457
+ case "desk-sell": {
78458
+ if (name !== "sellUCD")
78459
+ throw new TxValidationError2(`expected sellUCD, decoded ${name}`);
78460
+ if (!eqAddr2(to, expected.vaultAddress)) {
78461
+ throw new TxValidationError2(`sellUCD must target the StUSDCVault (${expected.vaultAddress}), got ${to}`);
78462
+ }
78463
+ if (BigInt(String(args[0])).toString() !== expected.amountUcdWei)
78464
+ throw new TxValidationError2(`sellUCD amountUCD mismatch`);
78465
+ if (BigInt(String(args[1])).toString() !== expected.minUsdc)
78466
+ throw new TxValidationError2(`sellUCD minUSDC mismatch`);
78467
+ if (BigInt(expected.minUsdc) === 0n) {
78468
+ throw new TxValidationError2(`sellUCD minUSDC is 0 \u2014 a slippage floor is mandatory`);
78469
+ }
78470
+ break;
78471
+ }
78472
+ case "desk-buy": {
78473
+ if (name !== "buyUCD")
78474
+ throw new TxValidationError2(`expected buyUCD, decoded ${name}`);
78475
+ if (!eqAddr2(to, expected.vaultAddress)) {
78476
+ throw new TxValidationError2(`buyUCD must target the StUSDCVault (${expected.vaultAddress}), got ${to}`);
78477
+ }
78478
+ if (BigInt(String(args[0])).toString() !== expected.amountUsdc)
78479
+ throw new TxValidationError2(`buyUCD amountUSDC mismatch`);
78480
+ if (BigInt(String(args[1])).toString() !== expected.minUcdWei)
78481
+ throw new TxValidationError2(`buyUCD minUCD mismatch`);
78482
+ if (BigInt(expected.minUcdWei) === 0n) {
78483
+ throw new TxValidationError2(`buyUCD minUCD is 0 \u2014 a slippage floor is mandatory`);
78484
+ }
78485
+ break;
78486
+ }
78352
78487
  default: {
78353
78488
  const _exhaustive = expected;
78354
78489
  throw new TxValidationError2(`unhandled expected action kind: ${JSON.stringify(_exhaustive)}`);
@@ -78382,18 +78517,18 @@ function buildPsmRedeemTx2(p) {
78382
78517
  var PSM_READS_ABI = ["function supportedStablecoins(address) view returns (bool)"];
78383
78518
  var ERC20_READS_ABI = ["function allowance(address owner, address spender) view returns (uint256)"];
78384
78519
  function psmExchangeReadsFromProvider(provider, psmAddress) {
78385
- const psm = new import_ethers35.ethers.Contract(psmAddress, PSM_READS_ABI, provider);
78520
+ const psm = new import_ethers36.ethers.Contract(psmAddress, PSM_READS_ABI, provider);
78386
78521
  return {
78387
78522
  isStablecoinSupported: async (stablecoin) => await psm.getFunction("supportedStablecoins")(stablecoin),
78388
- allowance: async (token, owner, spender) => await new import_ethers35.ethers.Contract(token, ERC20_READS_ABI, provider).getFunction("allowance")(owner, spender)
78523
+ allowance: async (token, owner, spender) => await new import_ethers36.ethers.Contract(token, ERC20_READS_ABI, provider).getFunction("allowance")(owner, spender)
78389
78524
  };
78390
78525
  }
78391
78526
  var refuse = (direction, msg) => new TxValidationError2(msg, `PSM ${direction}`);
78392
78527
  function requireAddress(direction, label, value) {
78393
- if (!value || !import_ethers35.ethers.isAddress(value)) {
78528
+ if (!value || !import_ethers36.ethers.isAddress(value)) {
78394
78529
  throw refuse(direction, `${label} address is missing or invalid (${String(value)})`);
78395
78530
  }
78396
- return import_ethers35.ethers.getAddress(value);
78531
+ return import_ethers36.ethers.getAddress(value);
78397
78532
  }
78398
78533
  async function planPsmExchange(params) {
78399
78534
  const { direction, amountIn, minOut, vctx, reads } = params;
@@ -78475,6 +78610,203 @@ async function executePsmPlan(plan, signer, vctx) {
78475
78610
  });
78476
78611
  return { ...exec, approvalHashes };
78477
78612
  }
78613
+ var DESK_ABI = [
78614
+ "function quoteSellUCD(uint256 amountUCD) view returns (uint256 usdcOut, uint256 feeE18)",
78615
+ "function sellUCD(uint256 amountUCD, uint256 minUSDC) returns (uint256 usdcOut)",
78616
+ "function buyUCD(uint256 amountUSDC, uint256 minUCD) returns (uint256 ucdOut)",
78617
+ "function halted() view returns (bool)",
78618
+ "function haltReasons() view returns (bool psmPaused, bool redeemOff, bool reservesShort, bool oracleUnhealthy, bool unconfigured)",
78619
+ "function markE18() view returns (uint256)",
78620
+ "function freeUsdc() view returns (uint256)",
78621
+ "function deskParams() view returns ((uint256 iMax, uint256 sMax, uint256 rMin, uint32 haircutBps, uint32 feeSlopeBps, uint32 feeCapBps, uint32 reserveCoverageBps))",
78622
+ "function deskState() view returns (uint256 inventoryUCD, uint256 stUCDShares, uint256 claimableReserve, uint64 currentEpoch, uint64 oldestOpenEpoch, address backingOracle, address stUcd, address ucd)",
78623
+ "function exitsFrozen() view returns (bool)",
78624
+ "function paused() view returns (bool)",
78625
+ // IStUSDCDesk errors on the trade path.
78626
+ "error DeskHalted()",
78627
+ "error ZeroDeskAmount()",
78628
+ "error InventoryCapExceeded(uint256 inventoryAfter, uint256 iMax)",
78629
+ "error InsufficientLiquidity(uint256 free, uint256 needed)",
78630
+ "error InsufficientInventory(uint256 available, uint256 needed)",
78631
+ "error SlippageExceeded(uint256 out, uint256 min)",
78632
+ // StUSDCVault / OpenZeppelin gates the desk shares.
78633
+ "error ExitsAreFrozen(uint40 until)",
78634
+ "error EnforcedPause()"
78635
+ ];
78636
+ function buildDeskApproveTx(p) {
78637
+ return {
78638
+ to: p.token,
78639
+ data: encodeSignable2("approve", [p.vault, p.amount]),
78640
+ value: "0x0",
78641
+ chainId: p.chainId
78642
+ };
78643
+ }
78644
+ function buildDeskSellTx(p) {
78645
+ return {
78646
+ to: p.vault,
78647
+ data: encodeSignable2("sellUCD", [p.amountUCD, p.minUSDC]),
78648
+ value: "0x0",
78649
+ chainId: p.chainId
78650
+ };
78651
+ }
78652
+ function buildDeskBuyTx(p) {
78653
+ return {
78654
+ to: p.vault,
78655
+ data: encodeSignable2("buyUCD", [p.amountUSDC, p.minUCD]),
78656
+ value: "0x0",
78657
+ chainId: p.chainId
78658
+ };
78659
+ }
78660
+ var ERC20_READS_ABI2 = ["function allowance(address owner, address spender) view returns (uint256)"];
78661
+ function deskReadsFromProvider(provider, vaultAddress) {
78662
+ const vault = new import_ethers39.ethers.Contract(vaultAddress, DESK_ABI, provider);
78663
+ return {
78664
+ quoteSellUCD: async (amountUCD) => {
78665
+ const r = await vault.getFunction("quoteSellUCD").staticCall(amountUCD);
78666
+ return { usdcOut: r[0], feeE18: r[1] };
78667
+ },
78668
+ status: async () => {
78669
+ const [halted, reasons, paused, exitsFrozen, markE18, freeUsdc, params, state] = await Promise.all([
78670
+ vault.getFunction("halted")(),
78671
+ vault.getFunction("haltReasons")(),
78672
+ vault.getFunction("paused")(),
78673
+ vault.getFunction("exitsFrozen")(),
78674
+ vault.getFunction("markE18")(),
78675
+ vault.getFunction("freeUsdc")(),
78676
+ vault.getFunction("deskParams")(),
78677
+ vault.getFunction("deskState")()
78678
+ ]);
78679
+ return {
78680
+ halted,
78681
+ reasons: {
78682
+ psmPaused: reasons[0],
78683
+ redeemOff: reasons[1],
78684
+ reservesShort: reasons[2],
78685
+ oracleUnhealthy: reasons[3],
78686
+ unconfigured: reasons[4]
78687
+ },
78688
+ paused,
78689
+ exitsFrozen,
78690
+ markE18,
78691
+ freeUsdc,
78692
+ params: {
78693
+ iMax: params[0],
78694
+ sMax: params[1],
78695
+ rMin: params[2],
78696
+ haircutBps: Number(params[3]),
78697
+ feeSlopeBps: Number(params[4]),
78698
+ feeCapBps: Number(params[5]),
78699
+ reserveCoverageBps: Number(params[6])
78700
+ },
78701
+ state: {
78702
+ inventoryUCD: state[0],
78703
+ stUCDShares: state[1],
78704
+ claimableReserve: state[2],
78705
+ currentEpoch: state[3],
78706
+ oldestOpenEpoch: state[4],
78707
+ backingOracle: state[5],
78708
+ stUcd: state[6],
78709
+ ucd: state[7]
78710
+ }
78711
+ };
78712
+ },
78713
+ allowance: async (token, owner, spender) => await new import_ethers39.ethers.Contract(token, ERC20_READS_ABI2, provider).getFunction("allowance")(owner, spender)
78714
+ };
78715
+ }
78716
+ var refuse2 = (direction, msg) => new TxValidationError2(msg, `desk ${direction}`);
78717
+ function requireAddress2(direction, label, value) {
78718
+ if (!value || !import_ethers39.ethers.isAddress(value)) {
78719
+ throw refuse2(direction, `${label} address is missing or invalid (${String(value)})`);
78720
+ }
78721
+ return import_ethers39.ethers.getAddress(value);
78722
+ }
78723
+ async function planDesk(params) {
78724
+ const { direction, amountIn, minOut, vctx, reads } = params;
78725
+ const chainId = vctx.chainId;
78726
+ if (amountIn <= 0n) {
78727
+ throw refuse2(direction, `amount must be greater than zero (got ${amountIn})`);
78728
+ }
78729
+ if (minOut <= 0n) {
78730
+ throw refuse2(direction, `minimum-out floor must be greater than zero (got ${minOut}) \u2014 a zero floor is refused`);
78731
+ }
78732
+ const owner = requireAddress2(direction, "owner", params.owner);
78733
+ const vault = requireAddress2(direction, "StUSDCVault", params.vault);
78734
+ const token = requireAddress2(direction, params.tokenLabel, params.token);
78735
+ const approveExpected = (amount) => ({
78736
+ kind: "desk-approve",
78737
+ tokenAddress: token,
78738
+ vaultAddress: vault,
78739
+ amount: amount.toString()
78740
+ });
78741
+ const allowanceBefore = await reads.allowance(token, owner, vault);
78742
+ const approvals = [];
78743
+ if (allowanceBefore < amountIn) {
78744
+ if (allowanceBefore > 0n) {
78745
+ approvals.push({
78746
+ step: "reset-approve",
78747
+ tx: buildDeskApproveTx({ token, vault, amount: 0n, chainId }),
78748
+ expected: approveExpected(0n)
78749
+ });
78750
+ }
78751
+ approvals.push({
78752
+ step: "approve",
78753
+ tx: buildDeskApproveTx({ token, vault, amount: amountIn, chainId }),
78754
+ expected: approveExpected(amountIn)
78755
+ });
78756
+ }
78757
+ const exec = direction === "sell" ? {
78758
+ step: "sell",
78759
+ tx: buildDeskSellTx({ vault, amountUCD: amountIn, minUSDC: minOut, chainId }),
78760
+ expected: { kind: "desk-sell", vaultAddress: vault, amountUcdWei: amountIn.toString(), minUsdc: minOut.toString() }
78761
+ } : {
78762
+ step: "buy",
78763
+ tx: buildDeskBuyTx({ vault, amountUSDC: amountIn, minUCD: minOut, chainId }),
78764
+ expected: { kind: "desk-buy", vaultAddress: vault, amountUsdc: amountIn.toString(), minUcdWei: minOut.toString() }
78765
+ };
78766
+ for (const leg of [...approvals, exec]) {
78767
+ validateUnsignedTx2({ ...leg.tx }, leg.expected, vctx);
78768
+ }
78769
+ return { direction, owner, vault, token, amountIn, minOut, allowanceBefore, approvals, exec };
78770
+ }
78771
+ function planDeskSell(params) {
78772
+ return planDesk({
78773
+ direction: "sell",
78774
+ owner: params.owner,
78775
+ vault: params.addresses.vault,
78776
+ token: params.addresses.ucdToken,
78777
+ tokenLabel: "UCDToken",
78778
+ amountIn: params.amountUCD,
78779
+ minOut: params.minUSDC,
78780
+ vctx: params.vctx,
78781
+ reads: params.reads
78782
+ });
78783
+ }
78784
+ async function executeDeskPlan(plan, signer, vctx) {
78785
+ const approvalHashes = [];
78786
+ 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.`;
78787
+ const sendLeg = async (leg) => {
78788
+ const request = { to: leg.tx.to, data: leg.tx.data, value: 0n, chainId: leg.tx.chainId };
78789
+ validateUnsignedTx2({ ...request }, leg.expected, vctx);
78790
+ const sent = await signer.sendTransaction(request);
78791
+ const receipt = await sent.wait();
78792
+ if (!receipt)
78793
+ throw new Error(`desk ${leg.step} tx ${sent.hash} returned no receipt`);
78794
+ if (receipt.status !== 1)
78795
+ throw new Error(`desk ${leg.step} tx ${sent.hash} reverted`);
78796
+ return { hash: sent.hash, blockNumber: receipt.blockNumber };
78797
+ };
78798
+ for (const leg of plan.approvals) {
78799
+ const landed = await sendLeg(leg).catch((e) => {
78800
+ throw new Error(`desk ${leg.step} failed: ${e instanceof Error ? e.message : String(e)}.${residual()}`);
78801
+ });
78802
+ approvalHashes.push(landed.hash);
78803
+ }
78804
+ const exec = await sendLeg(plan.exec).catch((e) => {
78805
+ throw new Error(`desk ${plan.exec.step} failed: ${e instanceof Error ? e.message : String(e)}.${residual()}`);
78806
+ });
78807
+ return { ...exec, approvalHashes };
78808
+ }
78809
+ init_deployment_addresses();
78478
78810
  var LIT_ACTION_CHAIN_NAMES = Object.freeze({
78479
78811
  1: "ethereum",
78480
78812
  11155111: "sepolia",
@@ -78713,14 +79045,18 @@ function formatLiquidationFailureMessage(loanId, errorMessage, btcVault, btcVaul
78713
79045
  var CONTRACT_ERROR_FRAGMENTS = [
78714
79046
  { fragment: "error AboveMaxRedeem(uint256 amount, uint256 maximum)", contracts: ["SimplePSMV2"] },
78715
79047
  { fragment: "error AboveMaxSwap(uint256 amount, uint256 maximum)", contracts: ["SimplePSMV2"] },
78716
- { fragment: "error AccessControlBadConfirmation()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
78717
- { fragment: "error AccessControlUnauthorizedAccount(address account, bytes32 neededRole)", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
78718
- { fragment: "error AddressEmptyCode(address target)", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
79048
+ { fragment: "error AccessControlBadConfirmation()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
79049
+ { fragment: "error AccessControlUnauthorizedAccount(address account, bytes32 neededRole)", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
79050
+ { fragment: "error AddressEmptyCode(address target)", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
78719
79051
  { fragment: "error AlreadyActive()", contracts: ["PositionManagerErrors"] },
79052
+ { fragment: "error AlreadyClaimed()", contracts: ["StUSDCVault"] },
79053
+ { fragment: "error AlreadySeeded()", contracts: ["StUSDCVault"] },
78720
79054
  { fragment: "error AlreadySigned()", contracts: ["PositionManagerErrors", "OperationAuthorizationRegistry"] },
78721
79055
  { fragment: "error AmountMustBePositive()", contracts: ["LoanOperationsManagerModule", "SimplePSMV2"] },
78722
79056
  { fragment: "error ArrayLengthMismatch()", contracts: ["BTCSpendAuthorizer", "SimplePSMV2"] },
79057
+ { fragment: "error AssetMismatch()", contracts: ["StUSDCVault"] },
78723
79058
  { fragment: "error BTCSpendAuthorizerNotSet()", contracts: ["LoanOperationsManagerModule"] },
79059
+ { fragment: "error BadRecoveryDestination(address to)", contracts: ["StUSDCVault"] },
78724
79060
  { fragment: "error BalanceMismatch()", contracts: ["UCDController"] },
78725
79061
  { fragment: "error BatchSizeTooLarge()", contracts: ["BTCSpendAuthorizer"] },
78726
79062
  { fragment: "error BelowMinRedeem(uint256 amount, uint256 minimum)", contracts: ["SimplePSMV2"] },
@@ -78735,7 +79071,7 @@ var CONTRACT_ERROR_FRAGMENTS = [
78735
79071
  { fragment: "error BurnGuardFailed(uint8 code)", contracts: ["UCDController"] },
78736
79072
  { fragment: "error BurnVerificationFailed()", contracts: ["PositionManager", "PositionManagerErrors"] },
78737
79073
  { fragment: "error CannotRemoveLastTerm()", contracts: ["PositionManagerErrors"] },
78738
- { fragment: "error CannotUpgradeToSelf()", contracts: ["PositionManagerErrors", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer"] },
79074
+ { fragment: "error CannotUpgradeToSelf()", contracts: ["PositionManagerErrors", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "StUSDCVault"] },
78739
79075
  { fragment: "error CircuitBreakerNotActive()", contracts: ["PositionManagerErrors"] },
78740
79076
  { fragment: "error CircuitBreakerTriggered()", contracts: ["PositionManagerErrors"] },
78741
79077
  { fragment: "error CollateralOverflow()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule"] },
@@ -78751,39 +79087,62 @@ var CONTRACT_ERROR_FRAGMENTS = [
78751
79087
  { fragment: "error DebtUpdateVerificationFailedDetailed(bytes32 positionId, uint256 currentDebt, uint256 newDebt, uint256 quantumTimestamp, uint256 supplyAfterMint, uint256 expectedIncrease)", contracts: ["LoanOperationsManagerModule"] },
78752
79088
  { fragment: "error DecimalsMismatch(uint8 provided, uint8 actual)", contracts: ["SimplePSMV2"] },
78753
79089
  { fragment: "error DecimalsQueryFailed()", contracts: ["SimplePSMV2"] },
79090
+ { fragment: "error DeskHalted()", contracts: ["StUSDCVault"] },
79091
+ { fragment: "error DeskParamOutOfRange()", contracts: ["StUSDCVault"] },
78754
79092
  { fragment: "error DivisionByZero()", contracts: ["PositionManager", "CollateralManagerModule"] },
78755
79093
  { fragment: "error ECDSAInvalidSignature()", contracts: ["BTCSpendAuthorizer"] },
78756
79094
  { fragment: "error ECDSAInvalidSignatureLength(uint256 length)", contracts: ["BTCSpendAuthorizer"] },
78757
79095
  { fragment: "error ECDSAInvalidSignatureS(bytes32 s)", contracts: ["BTCSpendAuthorizer"] },
78758
- { fragment: "error ERC1967InvalidImplementation(address implementation)", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
78759
- { fragment: "error ERC1967NonPayable()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
78760
- { fragment: "error EnforcedPause()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
79096
+ { fragment: "error ERC1967InvalidImplementation(address implementation)", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
79097
+ { fragment: "error ERC1967NonPayable()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
79098
+ { fragment: "error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed)", contracts: ["StUSDCVault"] },
79099
+ { fragment: "error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed)", contracts: ["StUSDCVault"] },
79100
+ { fragment: "error ERC20InvalidApprover(address approver)", contracts: ["StUSDCVault"] },
79101
+ { fragment: "error ERC20InvalidReceiver(address receiver)", contracts: ["StUSDCVault"] },
79102
+ { fragment: "error ERC20InvalidSender(address sender)", contracts: ["StUSDCVault"] },
79103
+ { fragment: "error ERC20InvalidSpender(address spender)", contracts: ["StUSDCVault"] },
79104
+ { fragment: "error ERC4626ExceededMaxDeposit(address receiver, uint256 assets, uint256 max)", contracts: ["StUSDCVault"] },
79105
+ { fragment: "error ERC4626ExceededMaxMint(address receiver, uint256 shares, uint256 max)", contracts: ["StUSDCVault"] },
79106
+ { fragment: "error ERC4626ExceededMaxRedeem(address owner, uint256 shares, uint256 max)", contracts: ["StUSDCVault"] },
79107
+ { fragment: "error ERC4626ExceededMaxWithdraw(address owner, uint256 assets, uint256 max)", contracts: ["StUSDCVault"] },
79108
+ { fragment: "error EnforcedPause()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
78761
79109
  { fragment: "error EntryFeeTooHigh(uint256 fee, uint256 max)", contracts: ["SimplePSMV2"] },
79110
+ { fragment: "error EpochAlreadyPriced()", contracts: ["StUSDCVault"] },
79111
+ { fragment: "error EpochNotComplete()", contracts: ["StUSDCVault"] },
79112
+ { fragment: "error EpochNotOpen()", contracts: ["StUSDCVault"] },
78762
79113
  { fragment: "error ExceedsFeeBalance(uint256 requested, uint256 max)", contracts: ["SimplePSMV2"] },
78763
79114
  { fragment: "error ExceedsMaxLoan()", contracts: ["PositionManagerErrors"] },
79115
+ { fragment: "error ExceedsUntracked(uint256 untracked, uint256 amount)", contracts: ["StUSDCVault"] },
78764
79116
  { fragment: "error ExitFeeTooHigh(uint256 fee, uint256 max)", contracts: ["SimplePSMV2"] },
78765
- { fragment: "error ExpectedPause()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
79117
+ { fragment: "error ExitsAreFrozen(uint40 until)", contracts: ["StUSDCVault"] },
79118
+ { fragment: "error ExpectedPause()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
78766
79119
  { fragment: "error ExtensionFeeMintingFailed()", contracts: ["PositionManager", "PositionManagerErrors"] },
78767
79120
  { fragment: "error ExtensionNotAllowed()", contracts: ["PositionManagerErrors"] },
78768
- { fragment: "error FailedCall()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
79121
+ { fragment: "error FailedCall()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
78769
79122
  { fragment: "error FailedToGetStablecoinDecimals()", contracts: ["SimplePSMV2"] },
78770
79123
  { fragment: "error FailedToGetUCDDecimals()", contracts: ["SimplePSMV2"] },
78771
79124
  { fragment: "error FeeOnTransferNotSupported()", contracts: ["SimplePSMV2"] },
78772
79125
  { fragment: "error FeeTooHigh(uint256 fee, uint256 max)", contracts: ["PositionManagerErrors"] },
78773
79126
  { fragment: "error FeeTooLow(uint256 fee, uint256 min)", contracts: ["PositionManagerErrors"] },
79127
+ { fragment: "error FreezeBoundOutOfRange(uint40 value, uint40 min, uint40 max)", contracts: ["StUSDCVault"] },
79128
+ { fragment: "error FreezeCooldown(uint40 availableAt)", contracts: ["StUSDCVault"] },
79129
+ { fragment: "error FreezeInPast(uint40 until)", contracts: ["StUSDCVault"] },
79130
+ { fragment: "error FreezeTooLong(uint40 until, uint40 latestAllowed)", contracts: ["StUSDCVault"] },
78774
79131
  { fragment: "error GlobalReentrancyGuardReentrantCall()", contracts: ["PositionManager", "CollateralManagerModule"] },
78775
79132
  { fragment: "error ImplNotDeployed()", contracts: ["LoanOperationsManagerModule", "BTCSpendAuthorizer"] },
78776
- { fragment: "error ImplementationNotDeployed()", contracts: ["UCDController"] },
79133
+ { fragment: "error ImplementationNotDeployed()", contracts: ["UCDController", "StUSDCVault"] },
78777
79134
  { fragment: "error InitialBalanceTooLarge()", contracts: ["SimplePSMV2"] },
78778
79135
  { fragment: "error InsufficientBalance()", contracts: ["PositionManagerErrors"] },
78779
79136
  { fragment: "error InsufficientCollateralForAmount()", contracts: ["PositionManagerErrors"] },
78780
79137
  { fragment: "error InsufficientCollateralRatio()", contracts: ["CollateralManagerModule"] },
78781
79138
  { fragment: "error InsufficientFeeBal()", contracts: ["LoanOperationsManagerModule"] },
79139
+ { fragment: "error InsufficientInventory(uint256 available, uint256 needed)", contracts: ["StUSDCVault"] },
79140
+ { fragment: "error InsufficientLiquidity(uint256 free, uint256 needed)", contracts: ["StUSDCVault"] },
78782
79141
  { fragment: "error InsufficientReserves(uint256 available, uint256 required)", contracts: ["SimplePSMV2"] },
78783
79142
  { fragment: "error InsufficientSignatures()", contracts: ["OperationAuthorizationRegistry"] },
78784
79143
  { fragment: "error IntegrityCheckFailed()", contracts: ["PositionManagerErrors"] },
78785
79144
  { fragment: "error InvalidActionHash()", contracts: ["CollateralManagerModule"] },
78786
- { fragment: "error InvalidAddress()", contracts: ["PositionManager", "PositionManagerErrors", "OperationAuthorizationRegistry", "CollateralManagerModule", "SimplePSMV2"] },
79145
+ { fragment: "error InvalidAddress()", contracts: ["PositionManager", "PositionManagerErrors", "OperationAuthorizationRegistry", "CollateralManagerModule", "SimplePSMV2", "StUSDCVault"] },
78787
79146
  { fragment: "error InvalidAdmin()", contracts: ["LoanOperationsManagerModule", "BTCSpendAuthorizer", "SimplePSMV2"] },
78788
79147
  { fragment: "error InvalidAmount()", contracts: ["PositionManagerErrors", "SimplePSMV2"] },
78789
79148
  { fragment: "error InvalidBTCPrice()", contracts: ["PositionManager", "PositionManagerErrors"] },
@@ -78794,7 +79153,7 @@ var CONTRACT_ERROR_FRAGMENTS = [
78794
79153
  { fragment: "error InvalidExchangeRate()", contracts: ["SimplePSMV2"] },
78795
79154
  { fragment: "error InvalidImpl()", contracts: ["LoanOperationsManagerModule", "BTCSpendAuthorizer"] },
78796
79155
  { fragment: "error InvalidImplementation()", contracts: ["UCDController"] },
78797
- { fragment: "error InvalidInitialization()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
79156
+ { fragment: "error InvalidInitialization()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
78798
79157
  { fragment: "error InvalidLitSignature()", contracts: ["BTCSpendAuthorizer"] },
78799
79158
  { fragment: "error InvalidLoanOps()", contracts: ["BTCSpendAuthorizer"] },
78800
79159
  { fragment: "error InvalidModuleAddress()", contracts: ["UCDController"] },
@@ -78830,6 +79189,7 @@ var CONTRACT_ERROR_FRAGMENTS = [
78830
79189
  { fragment: "error InvalidVolumeCap(bool isRedeem)", contracts: ["SimplePSMV2"] },
78831
79190
  { fragment: "error InvalidWithdrawalAddress()", contracts: ["CollateralManagerModule"] },
78832
79191
  { fragment: "error InvalidWithdrawalLoanStatusType()", contracts: ["CollateralManagerModule"] },
79192
+ { fragment: "error InventoryCapExceeded(uint256 totalUcdAfter, uint256 iMax)", contracts: ["StUSDCVault"] },
78833
79193
  { fragment: "error LiquidationsPaused()", contracts: ["PositionManager", "PositionManagerErrors"] },
78834
79194
  { fragment: "error LoanAmountTooHigh()", contracts: ["PositionManagerErrors"] },
78835
79195
  { fragment: "error LoanAmountTooLow()", contracts: ["PositionManagerErrors"] },
@@ -78855,23 +79215,31 @@ var CONTRACT_ERROR_FRAGMENTS = [
78855
79215
  { fragment: "error NoVersion()", contracts: ["LoanOperationsManagerModule", "BTCSpendAuthorizer", "UCDController"] },
78856
79216
  { fragment: "error NonZeroReserves(address stablecoin, uint256 reserves)", contracts: ["SimplePSMV2"] },
78857
79217
  { fragment: "error NormalizationOverflow()", contracts: ["SimplePSMV2"] },
78858
- { fragment: "error NotAdminModule()", contracts: ["PositionManager", "PositionManagerErrors", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
79218
+ { fragment: "error NotATransferFee(bytes4 selector)", contracts: ["StUSDCVault"] },
79219
+ { fragment: "error NotAdminModule()", contracts: ["PositionManager", "PositionManagerErrors", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
79220
+ { fragment: "error NotArrived(uint256 available, uint256 amount)", contracts: ["StUSDCVault"] },
78859
79221
  { fragment: "error NotAuthorized()", contracts: ["PositionManager", "PositionManagerErrors"] },
78860
79222
  { fragment: "error NotAuthorizedConsumer()", contracts: ["OperationAuthorizationRegistry"] },
78861
79223
  { fragment: "error NotAuthorizedSigner()", contracts: ["OperationAuthorizationRegistry"] },
78862
79224
  { fragment: "error NotBorrower()", contracts: ["PositionManager", "PositionManagerErrors", "LoanOperationsManagerModule"] },
79225
+ { fragment: "error NotCarryReceiver(address caller)", contracts: ["StUSDCVault"] },
78863
79226
  { fragment: "error NotContract()", contracts: ["PositionManagerErrors", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "SimplePSMV2"] },
78864
- { fragment: "error NotInitializing()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
79227
+ { fragment: "error NotController()", contracts: ["StUSDCVault"] },
79228
+ { fragment: "error NotInitializing()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
78865
79229
  { fragment: "error NotLiquidationPkpOwner()", contracts: ["PositionManager", "PositionManagerErrors"] },
78866
79230
  { fragment: "error NotLiquidator()", contracts: ["PositionManager", "PositionManagerErrors"] },
78867
79231
  { fragment: "error NotOwner()", contracts: ["OperationAuthorizationRegistry"] },
78868
79232
  { fragment: "error NotPendingOwner()", contracts: ["OperationAuthorizationRegistry"] },
78869
79233
  { fragment: "error NotProductionAuthorizer()", contracts: ["PositionManagerErrors", "LoanOperationsManagerModule"] },
78870
79234
  { fragment: "error NotProductionRegistry()", contracts: ["PositionManager", "PositionManagerErrors", "LoanOperationsManagerModule"] },
79235
+ { fragment: "error NotSeeded()", contracts: ["StUSDCVault"] },
79236
+ { fragment: "error NotSeeder(address caller)", contracts: ["StUSDCVault"] },
79237
+ { fragment: "error NothingToFulfil()", contracts: ["StUSDCVault"] },
78871
79238
  { fragment: "error OnlyCore()", contracts: ["CollateralManagerModule"] },
78872
79239
  { fragment: "error OnlyLoanOps()", contracts: ["BTCSpendAuthorizer"] },
78873
79240
  { fragment: "error OnlyPosMgr()", contracts: ["LoanOperationsManagerModule"] },
78874
79241
  { fragment: "error OnlyPositionManager()", contracts: ["LoanOperationsManagerModule"] },
79242
+ { fragment: "error OpNotExecuted(bytes32 sweepId)", contracts: ["StUSDCVault"] },
78875
79243
  { fragment: "error OperationInProgress()", contracts: ["PositionManager", "PositionManagerErrors"] },
78876
79244
  { fragment: "error OracleDecimalMismatch()", contracts: ["LoanOperationsManagerModule"] },
78877
79245
  { fragment: "error PKPAlreadyUsed()", contracts: ["PositionManagerErrors"] },
@@ -78879,6 +79247,7 @@ var CONTRACT_ERROR_FRAGMENTS = [
78879
79247
  { fragment: "error PaymentAmountZero()", contracts: ["PositionManager", "PositionManagerErrors"] },
78880
79248
  { fragment: "error PaymentMustBeLessThanDebt()", contracts: ["LoanOperationsManagerModule"] },
78881
79249
  { fragment: "error PaymentMustBePositive()", contracts: ["LoanOperationsManagerModule"] },
79250
+ { fragment: "error PeriodOutOfBounds(uint40 period, uint40 min, uint40 max)", contracts: ["StUSDCVault"] },
78882
79251
  { fragment: "error PositionAlreadyExists()", contracts: ["PositionManager", "PositionManagerErrors"] },
78883
79252
  { fragment: "error PositionDoesNotExist()", contracts: ["CollateralManagerModule"] },
78884
79253
  { fragment: "error PositionLiquidatable()", contracts: ["PositionManagerErrors"] },
@@ -78909,22 +79278,29 @@ var CONTRACT_ERROR_FRAGMENTS = [
78909
79278
  { fragment: "error ReserveOverflow()", contracts: ["SimplePSMV2"] },
78910
79279
  { fragment: "error ReserveTooLarge()", contracts: ["SimplePSMV2"] },
78911
79280
  { fragment: "error ReserveUnderflow()", contracts: ["SimplePSMV2"] },
78912
- { fragment: "error SafeERC20FailedOperation(address token)", contracts: ["PositionManager", "LoanOperationsManagerModule", "SimplePSMV2"] },
79281
+ { fragment: "error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value)", contracts: ["StUSDCVault"] },
79282
+ { fragment: "error SafeERC20FailedOperation(address token)", contracts: ["PositionManager", "LoanOperationsManagerModule", "SimplePSMV2", "StUSDCVault"] },
78913
79283
  { fragment: "error SameBlockInteraction()", contracts: ["PositionManager", "PositionManagerErrors"] },
78914
79284
  { fragment: "error SameImpl()", contracts: ["LoanOperationsManagerModule", "BTCSpendAuthorizer"] },
78915
79285
  { fragment: "error SameImplementation()", contracts: ["PositionManagerErrors", "CollateralManagerModule"] },
79286
+ { fragment: "error SeedTooSmall(uint256 amount, uint256 min)", contracts: ["StUSDCVault"] },
78916
79287
  { fragment: "error SignatureVerificationFailed(bytes4 selector, address recovered, address expected, bytes32 messageHash, uint8 errorCode)", contracts: ["OperationAuthorizationRegistry"] },
78917
79288
  { fragment: "error SlippageExceeded(uint256 got, uint256 minimum)", contracts: ["SimplePSMV2"] },
79289
+ { fragment: "error SlippageExceeded(uint256 out, uint256 min)", contracts: ["StUSDCVault"] },
78918
79290
  { fragment: "error SlippageProtectionRequired()", contracts: ["SimplePSMV2"] },
79291
+ { fragment: "error StUcdHeld()", contracts: ["StUSDCVault"] },
78919
79292
  { fragment: "error StablecoinAlreadySupported(address stablecoin)", contracts: ["SimplePSMV2"] },
78920
79293
  { fragment: "error StablecoinNotContract(address stablecoin)", contracts: ["SimplePSMV2"] },
78921
79294
  { fragment: "error StablecoinNotSupported(address stablecoin)", contracts: ["SimplePSMV2"] },
78922
79295
  { fragment: "error StablecoinNotSupportedInV1(address stablecoin)", contracts: ["SimplePSMV2"] },
79296
+ { fragment: "error StakeCapExceeded(uint256 value, uint256 sMax)", contracts: ["StUSDCVault"] },
78923
79297
  { fragment: "error StaleAttestationMismatch()", contracts: ["BTCSpendAuthorizer"] },
78924
79298
  { fragment: "error StaleAttestationTooOld()", contracts: ["BTCSpendAuthorizer"] },
78925
79299
  { fragment: "error StaleSpendValidatorNotSet()", contracts: ["BTCSpendAuthorizer"] },
78926
79300
  { fragment: "error StateHashMismatch()", contracts: ["LoanOperationsValidation", "LoanOperationsManagerModule", "CollateralManagerModule"] },
78927
79301
  { fragment: "error SwapVolumeExceededThisBlock(address stablecoin, uint256 attempted, uint256 cap)", contracts: ["SimplePSMV2"] },
79302
+ { fragment: "error SweepAlreadyCredited(bytes32 sweepId)", contracts: ["StUSDCVault"] },
79303
+ { fragment: "error SweepMismatch()", contracts: ["StUSDCVault"] },
78928
79304
  { fragment: "error SyncDriftTooLarge()", contracts: ["SimplePSMV2"] },
78929
79305
  { fragment: "error TargetAddrRequired()", contracts: ["BTCSpendAuthorizer"] },
78930
79306
  { fragment: "error TargetExceedsInputValue()", contracts: ["BTCSpendAuthorizer"] },
@@ -78939,11 +79315,12 @@ var CONTRACT_ERROR_FRAGMENTS = [
78939
79315
  { fragment: "error TooManySigners()", contracts: ["OperationAuthorizationRegistry"] },
78940
79316
  { fragment: "error UTXOAlreadyAuthorized()", contracts: ["BTCSpendAuthorizer"] },
78941
79317
  { fragment: "error UTXONotAuthorized()", contracts: ["BTCSpendAuthorizer"] },
78942
- { fragment: "error UUPSUnauthorizedCallContext()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
78943
- { fragment: "error UUPSUnsupportedProxiableUUID(bytes32 slot)", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
79318
+ { fragment: "error UUPSUnauthorizedCallContext()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
79319
+ { fragment: "error UUPSUnsupportedProxiableUUID(bytes32 slot)", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
78944
79320
  { fragment: "error UcdAmountTooLarge()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule"] },
78945
79321
  { fragment: "error Unauthorized()", contracts: ["UCDController"] },
78946
- { fragment: "error UnexpectedRoleGrantFailure()", contracts: ["PositionManager", "PositionManagerErrors", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
79322
+ { fragment: "error UnexpectedRoleGrantFailure()", contracts: ["PositionManager", "PositionManagerErrors", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
79323
+ { fragment: "error UnknownSource(address target)", contracts: ["StUSDCVault"] },
78947
79324
  { fragment: "error UnsupportedFeeToken(address token)", contracts: ["SimplePSMV2"] },
78948
79325
  { fragment: "error UserDailyMintLimitExceeded()", contracts: ["LoanOperationsManagerModule"] },
78949
79326
  { fragment: "error V2AlreadyInitialized()", contracts: ["SimplePSMV2"] },
@@ -78952,32 +79329,29 @@ var CONTRACT_ERROR_FRAGMENTS = [
78952
79329
  { fragment: "error WithdrawalAddressNotApproved()", contracts: ["CollateralManagerModule"] },
78953
79330
  { fragment: "error WithdrawalExceedsReserves(uint256 amount, uint256 reserves)", contracts: ["SimplePSMV2"] },
78954
79331
  { fragment: "error ZeroAddress()", contracts: ["PositionManager", "UCDController"] },
78955
- { fragment: "error ZeroAmount()", contracts: ["UCDController"] }
79332
+ { fragment: "error ZeroAmount()", contracts: ["UCDController", "StUSDCVault"] },
79333
+ { fragment: "error ZeroDeskAmount()", contracts: ["StUSDCVault"] }
78956
79334
  ];
78957
79335
  var TABLE = null;
78958
79336
  function contractErrorTable() {
78959
79337
  if (TABLE)
78960
79338
  return TABLE;
78961
79339
  const table = /* @__PURE__ */ new Map();
78962
- const iface = new import_ethers38.Interface(CONTRACT_ERROR_FRAGMENTS.map((e) => e.fragment));
78963
- const contractsByName = new Map(
78964
- CONTRACT_ERROR_FRAGMENTS.map((e) => [e.fragment.slice("error ".length, e.fragment.indexOf("(")), e.contracts])
78965
- );
78966
- iface.forEachError((fragment) => {
79340
+ for (const generated of CONTRACT_ERROR_FRAGMENTS) {
79341
+ const fragment = import_ethers40.ErrorFragment.from(generated.fragment);
78967
79342
  const existing = table.get(fragment.selector);
78968
- const contracts = contractsByName.get(fragment.name) ?? [];
78969
79343
  if (existing) {
78970
- for (const c of contracts)
79344
+ for (const c of generated.contracts)
78971
79345
  if (!existing.contracts.includes(c))
78972
79346
  existing.contracts.push(c);
78973
- return;
79347
+ continue;
78974
79348
  }
78975
79349
  table.set(fragment.selector, {
78976
79350
  signature: fragment.format("sighash"),
78977
79351
  fragment,
78978
- contracts: [...contracts]
79352
+ contracts: [...generated.contracts]
78979
79353
  });
78980
- });
79354
+ }
78981
79355
  TABLE = table;
78982
79356
  return table;
78983
79357
  }
@@ -79068,7 +79442,7 @@ function decodeContractError(error) {
79068
79442
  const contract = entry.contracts.join(" | ");
79069
79443
  let args = [];
79070
79444
  try {
79071
- const decoded = new import_ethers38.Interface([entry.fragment]).decodeErrorResult(entry.fragment, errorData);
79445
+ const decoded = new import_ethers40.Interface([entry.fragment]).decodeErrorResult(entry.fragment, errorData);
79072
79446
  args = Array.from(decoded);
79073
79447
  } catch {
79074
79448
  args = [];
@@ -79910,7 +80284,7 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
79910
80284
  addEndpoint("config.provider", enrichedConfig.provider);
79911
80285
  addEndpoint("the contractSigner's provider", enrichedConfig.contractSigner?.provider);
79912
80286
  addEndpoint("the litOpsSigner's provider", enrichedConfig.litOpsSigner?.provider);
79913
- if (enrichedConfig.ethRpcUrl?.trim()) {
80287
+ if (!enrichedConfig.provider && enrichedConfig.ethRpcUrl?.trim()) {
79914
80288
  addEndpoint("ethRpcUrl", new import_ethers15.JsonRpcProvider(enrichedConfig.ethRpcUrl.trim()));
79915
80289
  }
79916
80290
  const refusal = await describeStandaloneMainnetRefusal(config.chainId, endpoints);
@@ -81249,15 +81623,13 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
81249
81623
  signatureHexMint
81250
81624
  ]);
81251
81625
  const fromAddress = await signer.getAddress();
81626
+ let mintSubmission;
81252
81627
  try {
81253
- await assertSafeQuantumSubmission({
81254
- provider: signerProvider,
81628
+ mintSubmission = await this.prepareQuantumSend("mintUCD", {
81255
81629
  to: positionManagerAddress,
81256
81630
  from: fromAddress,
81257
81631
  data: mintCalldata,
81258
- quantumTimestamp: Number(validationResponse.timestamp),
81259
- laneGuardActive: await this.isLocalLaneGuardActive(),
81260
- onDebug: this.config.debug ? (msg) => log.info(msg, {}) : void 0
81632
+ quantumTimestamp: Number(validationResponse.timestamp)
81261
81633
  });
81262
81634
  } catch (simError) {
81263
81635
  if (!(simError instanceof QuantumRevertError)) {
@@ -81275,7 +81647,7 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
81275
81647
  [
81276
81648
  "function diagnoseMintUCD(bytes32,uint256,uint256,uint256,uint256,uint256,bytes32,bytes32,bytes32,uint256,bytes) view returns (string)"
81277
81649
  ],
81278
- signerProvider
81650
+ this.getProviderOrThrow()
81279
81651
  );
81280
81652
  diagnosis = await views["diagnoseMintUCD"](
81281
81653
  request.positionId,
@@ -81382,7 +81754,7 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
81382
81754
  feeProvider: this.getProviderOrThrow(),
81383
81755
  to: positionManagerAddress,
81384
81756
  data: mintCalldata,
81385
- gasLimit: MINT_UCD_GAS_CEILING
81757
+ gasLimit: mintSubmission.gasLimit
81386
81758
  });
81387
81759
  const receipt = await signerProvider.waitForTransaction(
81388
81760
  tx2.hash,
@@ -82043,16 +82415,26 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
82043
82415
  if (this.config.debug) {
82044
82416
  log.info(`\u{1F512} Executing commit phase...`);
82045
82417
  }
82046
- const commitTx = await positionManager["commitLiquidation"](
82418
+ const commitArgs = [
82047
82419
  positionIdBytes32,
82048
82420
  BigInt(quantumTimestamp.toString()),
82049
82421
  BigInt(btcPrice.toString()),
82050
82422
  BigInt(
82051
82423
  (litActionResult.btcAmountSats || "0").toString()
82052
82424
  ),
82053
- litActionResult.signature || "0x",
82054
- { gasLimit: LIQUIDATION_COMMIT_GAS_CEILING }
82055
- // see definition: measured on Sepolia 2026-10-20
82425
+ litActionResult.signature || "0x"
82426
+ ];
82427
+ const liquidationTarget = await positionManager.getAddress();
82428
+ const liquidationFrom = await this.getSignerOrThrow().getAddress();
82429
+ const commitSubmission = await this.prepareQuantumSend("commitLiquidation", {
82430
+ to: liquidationTarget,
82431
+ from: liquidationFrom,
82432
+ data: positionManager.interface.encodeFunctionData("commitLiquidation", [...commitArgs]),
82433
+ quantumTimestamp: Number(quantumTimestamp)
82434
+ });
82435
+ const commitTx = await positionManager["commitLiquidation"](
82436
+ ...commitArgs,
82437
+ { gasLimit: commitSubmission.gasLimit }
82056
82438
  );
82057
82439
  const commitReceipt = await commitTx.wait();
82058
82440
  if (this.config.debug) {
@@ -82175,15 +82557,23 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
82175
82557
  hasSignature: !!revealResult.signature
82176
82558
  });
82177
82559
  }
82178
- const revealTx = await positionManager["revealAndLiquidate"](
82560
+ const revealArgs = [
82179
82561
  positionIdBytes32,
82180
82562
  revealQuantumTimestamp,
82181
82563
  revealBtcPrice,
82182
82564
  revealBtcAmountSats,
82183
82565
  revealResult.signature || "0x",
82184
- BigInt(revealDeadline.toString()),
82185
- { gasLimit: LIQUIDATION_REVEAL_GAS_CEILING }
82186
- // see definition: measured on Sepolia 2026-10-20
82566
+ BigInt(revealDeadline.toString())
82567
+ ];
82568
+ const revealSubmission = await this.prepareQuantumSend("revealAndLiquidate", {
82569
+ to: liquidationTarget,
82570
+ from: liquidationFrom,
82571
+ data: positionManager.interface.encodeFunctionData("revealAndLiquidate", [...revealArgs]),
82572
+ quantumTimestamp: Number(revealQuantumTimestamp)
82573
+ });
82574
+ const revealTx = await positionManager["revealAndLiquidate"](
82575
+ ...revealArgs,
82576
+ { gasLimit: revealSubmission.gasLimit }
82187
82577
  );
82188
82578
  if (this.config.debug) {
82189
82579
  log.info(` \u{1F4E4} Reveal TX submitted`, { txHash: revealTx.hash });
@@ -82585,15 +82975,13 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
82585
82975
  ]);
82586
82976
  const extendTo = this.getContractAddressesOrThrow().positionManager;
82587
82977
  const extendSigner = this.getSignerOrThrow();
82978
+ let extendSubmission;
82588
82979
  try {
82589
- await assertSafeQuantumSubmission({
82590
- provider: this.getProviderOrThrow(),
82980
+ extendSubmission = await this.prepareQuantumSend("extendPosition", {
82591
82981
  to: extendTo,
82592
82982
  from: await extendSigner.getAddress(),
82593
82983
  data: extendCalldata,
82594
- quantumTimestamp: Number(quantumTimestamp),
82595
- laneGuardActive: await this.isLocalLaneGuardActive(),
82596
- onDebug: this.config.debug ? (msg) => log.info(msg, {}) : void 0
82984
+ quantumTimestamp: Number(quantumTimestamp)
82597
82985
  });
82598
82986
  } catch (simError) {
82599
82987
  if (!(simError instanceof QuantumRevertError)) {
@@ -82608,7 +82996,7 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
82608
82996
  feeProvider: this.getProviderOrThrow(),
82609
82997
  to: extendTo,
82610
82998
  data: extendCalldata,
82611
- gasLimit: EXTEND_POSITION_GAS_CEILING
82999
+ gasLimit: extendSubmission.gasLimit
82612
83000
  });
82613
83001
  const txWithProvider = tx2;
82614
83002
  if (!txWithProvider.provider) {
@@ -83501,7 +83889,6 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
83501
83889
  const paymentContractAddress = this.getContractAddressesOrThrow().positionManager;
83502
83890
  const paymentSigner = this.getSignerOrThrow();
83503
83891
  const paymentFrom = await paymentSigner.getAddress();
83504
- const paymentProvider = contractManager.getProvider();
83505
83892
  const paymentIface = new import_ethers15.Interface([
83506
83893
  "function makePayment(bytes32 positionId, uint256 paymentAmount, uint256 quantumTimestamp, uint256 btcPrice, bytes calldata paymentValidatorSignature) external returns (bool)"
83507
83894
  ]);
@@ -83512,15 +83899,13 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
83512
83899
  btcPriceStr,
83513
83900
  signature
83514
83901
  ]);
83902
+ let paymentSubmission;
83515
83903
  try {
83516
- await assertSafeQuantumSubmission({
83517
- provider: paymentProvider,
83904
+ paymentSubmission = await this.prepareQuantumSend("makePayment", {
83518
83905
  to: paymentContractAddress,
83519
83906
  from: paymentFrom,
83520
83907
  data: paymentCalldata,
83521
- quantumTimestamp: Number(quantumTimestamp),
83522
- laneGuardActive: await this.isLocalLaneGuardActive(),
83523
- onDebug: this.config.debug ? (msg) => log.info(msg, {}) : void 0
83908
+ quantumTimestamp: Number(quantumTimestamp)
83524
83909
  });
83525
83910
  } catch (simError) {
83526
83911
  if (!(simError instanceof QuantumRevertError)) {
@@ -83543,7 +83928,7 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
83543
83928
  feeProvider: this.getProviderOrThrow(),
83544
83929
  to: paymentContractAddress,
83545
83930
  data: paymentCalldata,
83546
- gasLimit: MAKE_PAYMENT_GAS_CEILING
83931
+ gasLimit: paymentSubmission.gasLimit
83547
83932
  });
83548
83933
  if (this.config.debug) {
83549
83934
  log.info("\u2705 makePayment broadcast", { txHash: tx2.hash });
@@ -84300,21 +84685,18 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
84300
84685
  const withdrawSigner = this.getSignerOrThrow();
84301
84686
  let tx2;
84302
84687
  try {
84303
- await assertSafeQuantumSubmission({
84304
- provider: this.getProviderOrThrow(),
84688
+ const withdrawSubmission = await this.prepareQuantumSend("withdrawBTC", {
84305
84689
  to: positionManagerAddress,
84306
84690
  from: await withdrawSigner.getAddress(),
84307
84691
  data: withdrawCalldata,
84308
- quantumTimestamp: Number(withdrawalParams.quantumTimestamp),
84309
- laneGuardActive: await this.isLocalLaneGuardActive(),
84310
- onDebug: this.config.debug ? (msg) => log.info(msg, {}) : void 0
84692
+ quantumTimestamp: Number(withdrawalParams.quantumTimestamp)
84311
84693
  });
84312
84694
  tx2 = await sendEip1559Transaction({
84313
84695
  signer: withdrawSigner,
84314
84696
  feeProvider: this.getProviderOrThrow(),
84315
84697
  to: positionManagerAddress,
84316
84698
  data: withdrawCalldata,
84317
- gasLimit: WITHDRAW_BTC_GAS_CEILING
84699
+ gasLimit: withdrawSubmission.gasLimit
84318
84700
  });
84319
84701
  } catch (txError) {
84320
84702
  const txErrorMsg = txError instanceof QuantumRevertError ? `Withdrawal would revert (pre-send simulation): ${txError.errorName ?? txError.selector ?? "unknown"}` : txError instanceof Error ? txError.message : String(txError);
@@ -84325,6 +84707,12 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
84325
84707
  signatureBytesLength: signatureBytes.length
84326
84708
  });
84327
84709
  }
84710
+ if (txError instanceof GasEstimateUnavailableError) {
84711
+ return {
84712
+ success: false,
84713
+ error: `Transaction submission failed: ${txErrorMsg}`
84714
+ };
84715
+ }
84328
84716
  try {
84329
84717
  const position = await this.getPosition(positionId);
84330
84718
  const btcAmount = (Number(withdrawalAmount) / 1e8).toFixed(8);
@@ -86007,6 +86395,97 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
86007
86395
  const { hash, blockNumber } = await executePsmPlan(plan, params.signer, vctx);
86008
86396
  return { hash, blockNumber };
86009
86397
  }
86398
+ // ============================================================================
86399
+ // HIGH-LEVEL API - stUSDC desk (StUSDCVault 1.1.0, hold-only UCD desk)
86400
+ // ============================================================================
86401
+ /**
86402
+ * The desk's addresses and the chain they belong to. The vault comes from the deployment
86403
+ * manifest (`getContractsByNetwork(network).StUSDCVault`); UCD and USDC from the SDK config,
86404
+ * the way `psmRedeem` resolves its tokens. Every address is required — nothing is guessed.
86405
+ */
86406
+ resolveDeskAddresses() {
86407
+ const chainId = this.config.chainId ?? this.config.networkOverride?.chainId;
86408
+ if (typeof chainId !== "number") {
86409
+ throw new Error("desk needs the SDK's chainId \u2014 configure chainId");
86410
+ }
86411
+ const manifestKey = chainId === 1 ? "mainnet" : chainId === 11155111 ? "sepolia" : "localhost";
86412
+ const manifest = getContractsByNetwork(manifestKey);
86413
+ const vault = manifest?.StUSDCVault;
86414
+ if (!vault) {
86415
+ throw new Error(`StUSDCVault is not deployed on ${manifestKey} (chainId ${chainId}) \u2014 no manifest address`);
86416
+ }
86417
+ const ucdToken = this.config.contractAddresses?.ucdToken;
86418
+ const usdcToken = this.config.contractAddresses?.usdcToken;
86419
+ if (!ucdToken)
86420
+ throw new Error("UCDToken address not configured \u2014 provide contractAddresses.ucdToken");
86421
+ if (!usdcToken)
86422
+ throw new Error("USDC address not configured \u2014 provide contractAddresses.usdcToken");
86423
+ return { chainId, vault, ucdToken, usdcToken };
86424
+ }
86425
+ /**
86426
+ * Live desk status: halt matrix, pause, exit freeze, mark, free USDC, params and state —
86427
+ * one `Promise.all` over the vault's views.
86428
+ */
86429
+ async getDeskStatus() {
86430
+ const { vault } = this.resolveDeskAddresses();
86431
+ return deskReadsFromProvider(this.getProviderOrThrow(), vault).status();
86432
+ }
86433
+ /**
86434
+ * What `sellUCD(amountUCDWei, ·)` would pay now. A static call: it reverts exactly as the sell
86435
+ * would (`ZeroDeskAmount`, `InventoryCapExceeded`, `InsufficientLiquidity`, `DeskHalted`,
86436
+ * `EnforcedPause`, `ExitsAreFrozen`), decoded by ethers against `DESK_ABI`.
86437
+ *
86438
+ * @param amountUCDWei - UCD to sell (18 decimals)
86439
+ */
86440
+ async quoteDeskSell(amountUCDWei) {
86441
+ const { vault } = this.resolveDeskAddresses();
86442
+ return deskReadsFromProvider(this.getProviderOrThrow(), vault).quoteSellUCD(amountUCDWei);
86443
+ }
86444
+ /**
86445
+ * Build and validate the legs of a UCD → USDC desk sale for `owner`: an EXACT approve of UCD
86446
+ * to the vault when the allowance is short (reset to zero first when partial), then
86447
+ * `sellUCD(amountUCDWei, minUSDCWei)`. Nothing is sent — hand the plan to `executeDeskPlan`,
86448
+ * or take the validated legs into your own signing pipeline.
86449
+ *
86450
+ * @param amountUCDWei - UCD to sell (18 decimals)
86451
+ * @param minUSDCWei - Minimum USDC to receive (6 decimals); must be > 0 — see `deskSellMinOut`
86452
+ * @param owner - The seller; defaults to the configured contract signer
86453
+ */
86454
+ async planDeskSell(amountUCDWei, minUSDCWei, owner) {
86455
+ const { chainId, vault, ucdToken } = this.resolveDeskAddresses();
86456
+ const seller = owner ?? await this.config.contractSigner?.getAddress();
86457
+ if (!seller)
86458
+ throw new Error("desk sell needs an owner \u2014 pass one or configure contractSigner");
86459
+ const provider = this.getProviderOrThrow();
86460
+ const vctx = { chainId, network: String(chainId), contracts: {} };
86461
+ return planDeskSell({
86462
+ addresses: { vault, ucdToken },
86463
+ owner: seller,
86464
+ amountUCD: amountUCDWei,
86465
+ minUSDC: minUSDCWei,
86466
+ vctx,
86467
+ reads: deskReadsFromProvider(provider, vault)
86468
+ });
86469
+ }
86470
+ /**
86471
+ * Send a desk plan through `signer`, approvals first, each leg re-validated against the chain
86472
+ * the SIGNER is on — which must be the SDK's configured chain, where the addresses came from.
86473
+ */
86474
+ async executeDeskPlan(plan, signer) {
86475
+ const provider = signer.provider;
86476
+ if (!provider)
86477
+ throw new Error(`desk ${plan.direction} needs a signer connected to a provider`);
86478
+ const { chainId } = this.resolveDeskAddresses();
86479
+ const mismatch = await describeProviderChainMismatch(provider, chainId);
86480
+ if (mismatch)
86481
+ throw new Error(mismatch);
86482
+ const signerAddress = await signer.getAddress();
86483
+ if ((0, import_ethers15.getAddress)(signerAddress) !== (0, import_ethers15.getAddress)(plan.owner)) {
86484
+ throw new Error(`desk ${plan.direction} plan was built for ${plan.owner}, signer is ${signerAddress}`);
86485
+ }
86486
+ const vctx = { chainId, network: String(chainId), contracts: {} };
86487
+ return executeDeskPlan(plan, signer, vctx);
86488
+ }
86010
86489
  /**
86011
86490
  * Wait for the subgraph to index up to (and including) the given block number.
86012
86491
  * Call after on-chain actions (createLoan, mintUCD, etc.) before querying the subgraph.
@@ -87172,6 +87651,32 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
87172
87651
  provider
87173
87652
  );
87174
87653
  }
87654
+ /**
87655
+ * Gate + estimate-as-simulation for a quantum-signed send, always on the SDK READ
87656
+ * provider — never the wallet's (docs/vigil/plans/2026-11-11-sdk-estimate-sized-gas-limits-plan.md,
87657
+ * Design 1–2). Returns the estimate and the gasLimit to broadcast with, and (in debug)
87658
+ * logs both for every send so the margin stays visible across the mainnet Glamsterdam fork.
87659
+ *
87660
+ * Throws `QuantumRevertError` (decodable revert — callers map it to their own message),
87661
+ * `GasEstimateUnavailableError` (no estimate: retryable, nothing sent) and
87662
+ * `GasLimitCeilingError` (the sized limit exceeds the 5M sign-guard ceiling).
87663
+ */
87664
+ async prepareQuantumSend(operation, tx2) {
87665
+ const result = await assertSafeQuantumSubmission({
87666
+ provider: this.getProviderOrThrow(),
87667
+ ...tx2,
87668
+ laneGuardActive: await this.isLocalLaneGuardActive(),
87669
+ ...this.config.debug ? { onDebug: (msg) => log.info(msg, {}) } : {}
87670
+ });
87671
+ if (this.config.debug) {
87672
+ log.info("\u26FD gasLimit sized from eth_estimateGas", {
87673
+ operation,
87674
+ estimate: result.estimate.toString(),
87675
+ gasLimit: result.gasLimit.toString()
87676
+ });
87677
+ }
87678
+ return result;
87679
+ }
87175
87680
  /**
87176
87681
  * Get Bitcoin network based on chain.
87177
87682
  *
@@ -87810,13 +88315,14 @@ init_deployment_addresses();
87810
88315
  init_deployment_addresses();
87811
88316
 
87812
88317
  // node_modules/@gvnrdao/dh-sdk/dist/sign-guard.mjs
87813
- var import_ethers40 = require("ethers");
87814
- var import_ethers41 = require("ethers");
87815
88318
  var import_ethers42 = require("ethers");
87816
88319
  var import_ethers43 = require("ethers");
87817
88320
  var import_ethers44 = require("ethers");
87818
88321
  var import_ethers45 = require("ethers");
87819
88322
  var import_ethers46 = require("ethers");
88323
+ var import_ethers47 = require("ethers");
88324
+ var import_ethers48 = require("ethers");
88325
+ var import_ethers49 = require("ethers");
87820
88326
  var TxValidationError3 = class extends Error {
87821
88327
  /**
87822
88328
  * @param subject What is being refused. Defaults to the server-returned transaction the
@@ -87861,9 +88367,13 @@ var SIGNABLE_FUNCTIONS3 = [
87861
88367
  "function redeem(address stablecoin, uint256 ucdAmount, uint256 minStablecoinOut) external returns (uint256)",
87862
88368
  // BitcoinWithdrawalAddressRegistry — `msg.sender` must be the borrower, so
87863
88369
  // this too is client-only and never module-whitelisted.
87864
- "function addAddress(string btcAddress) external"
88370
+ "function addAddress(string btcAddress) external",
88371
+ // StUSDCVault 1.1.0 — the hold-only UCD desk. Direct EOA calls like the PSM
88372
+ // pair (the vault pulls from `msg.sender`); never routed through AgentModule.
88373
+ "function sellUCD(uint256 amountUCD, uint256 minUSDC) external returns (uint256)",
88374
+ "function buyUCD(uint256 amountUSDC, uint256 minUCD) external returns (uint256)"
87865
88375
  ];
87866
- var IFACE3 = new import_ethers40.ethers.Interface(SIGNABLE_FUNCTIONS3);
88376
+ var IFACE3 = new import_ethers42.ethers.Interface(SIGNABLE_FUNCTIONS3);
87867
88377
  function encodeSignable3(fn, args) {
87868
88378
  return IFACE3.encodeFunctionData(fn, args);
87869
88379
  }
@@ -87893,10 +88403,10 @@ var DEFAULT_FEE_CEILING2 = {
87893
88403
  maxTxFeeWei: DEFAULT_MAX_TX_FEE_WEI2
87894
88404
  };
87895
88405
  function fmtEth2(wei) {
87896
- return `${import_ethers41.ethers.formatEther(wei)} ETH`;
88406
+ return `${import_ethers43.ethers.formatEther(wei)} ETH`;
87897
88407
  }
87898
88408
  function fmtGwei2(wei) {
87899
- return `${import_ethers41.ethers.formatUnits(wei, "gwei")} gwei`;
88409
+ return `${import_ethers43.ethers.formatUnits(wei, "gwei")} gwei`;
87900
88410
  }
87901
88411
  function worstCaseFeeWei2(gasLimit, maxFeePerGas) {
87902
88412
  if (gasLimit == null || maxFeePerGas == null)
@@ -87946,8 +88456,6 @@ var SEPOLIA_DEPLOYMENT2 = {
87946
88456
  BitcoinProviderRegistry: "0xbfA0c48B070D0a9A9CD27469AeacFD2d4261cEE2",
87947
88457
  ContractVersionRegistry: "0x97E43AA6aFF2C0cf659d3aE501658D2Ef6777522",
87948
88458
  usdcToken: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
87949
- mockUsdcToken: "0x96409A98e0D322d6566b7F44a0fAbD1BD4ce2AEc",
87950
- mockUsdtToken: "0xF8b7fB38b17a310960E47805Be9adba0b0e0394D",
87951
88459
  PositionDelegateRegistry: "0x482369De283622E7b05731875ec137d4E3D208F9",
87952
88460
  FeeRecipientRegistry: "0x95795F8403DDb629E8527B2934C4e71f5fC0C374",
87953
88461
  BitcoinWithdrawalAddressRegistry: "0x6376D392097F0A81e51BD83960A97EA20eaf1dbe",
@@ -88132,10 +88640,10 @@ var SEPOLIA_DEPLOYMENT2 = {
88132
88640
  },
88133
88641
  StUSDCVault: {
88134
88642
  previousImplementation: "0x3619b14C23c5F7d950EF845481C2299939873004",
88135
- newImplementation: "0x3619b14C23c5F7d950EF845481C2299939873004",
88136
- upgradedAt: "2026-10-30T16:50:49.227Z",
88643
+ newImplementation: "0xE94DFBacA21fEFB0BB2e95D33510Ca702d2b6c5f",
88644
+ upgradedAt: "2026-11-08T16:07:36.867Z",
88137
88645
  upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
88138
- reason: "Initial StUSDCVault deployment"
88646
+ reason: "StUSDCVault 1.1.0: Phase 5 desk (linked StUSDCDeskLib 0x0880ce721b0A50C8Fe8d5c911097F0c24e57b6aA)"
88139
88647
  },
88140
88648
  CarryFeeReceiver: {
88141
88649
  previousImplementation: "0x9c43996C6f6BAD82F2A5152AbA61137E929EFA17",
@@ -88200,6 +88708,9 @@ var SEPOLIA_DEPLOYMENT2 = {
88200
88708
  setPKPValidationRegistryTx: "0xab6b7e610c1ecf68da9a1e1150e61631e1f2a945bec12608c8357e03be25c4a5",
88201
88709
  replacedAddress: "0xC8Ca02238fbCDAEbE6dbF804461D43F46F9406F4"
88202
88710
  },
88711
+ libraries: {
88712
+ StUSDCDeskLib: "0x0880ce721b0A50C8Fe8d5c911097F0c24e57b6aA"
88713
+ },
88203
88714
  latestEnv: {
88204
88715
  UCD_TOKEN: "0xdd817Ff47C9b8f81335Ac579895D8EA321Fa86Df",
88205
88716
  UCD_CONTROLLER: "0x360Bde4e489ee94E26601B206932De09EE60FF04",
@@ -88252,8 +88763,6 @@ var SEPOLIA_DEPLOYMENT2 = {
88252
88763
  CONTRACT_VERSION_REGISTRY: "0x97E43AA6aFF2C0cf659d3aE501658D2Ef6777522",
88253
88764
  CONTRACT_VERSION_REGISTRY_IMPL: "0xF3389De4bCeC735e4F6d35b9f71170D96037D1B7",
88254
88765
  USDC_TOKEN: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
88255
- MOCK_USDC_TOKEN: "0x96409A98e0D322d6566b7F44a0fAbD1BD4ce2AEc",
88256
- MOCK_USDT_TOKEN: "0xF8b7fB38b17a310960E47805Be9adba0b0e0394D",
88257
88766
  POSITION_DELEGATE_REGISTRY: "0x482369De283622E7b05731875ec137d4E3D208F9",
88258
88767
  POSITION_DELEGATE_REGISTRY_IMPL: "0xc681c48688cdAA966119E265e4a378ef8Fe0eBcA",
88259
88768
  AGENT_MODULE: "0xefb8C29C1e7e92ed7d81a52dbedaed74e37fe380",
@@ -88268,7 +88777,7 @@ var SEPOLIA_DEPLOYMENT2 = {
88268
88777
  STUCD_VAULT: "0xc04Dd4d6799FFDE57feAfD5B3B1B038827014fd3",
88269
88778
  STUCD_VAULT_IMPL: "0xd596A866ee5273aedaC21BC6e88649E087fC8EcB",
88270
88779
  STUSDC_VAULT: "0x7aBac04d4Bf2b3A63AF363B9527970791346463a",
88271
- STUSDC_VAULT_IMPL: "0x3619b14C23c5F7d950EF845481C2299939873004",
88780
+ STUSDC_VAULT_IMPL: "0xE94DFBacA21fEFB0BB2e95D33510Ca702d2b6c5f",
88272
88781
  CARRY_FEE_RECEIVER: "0x2C8e54f099Cf479182D7c87D76FeD88b4172cdB4",
88273
88782
  CARRY_FEE_RECEIVER_IMPL: "0x3a86A23ff3cd6c26B1Fa2C5aeBAeEEdbF6095D69",
88274
88783
  FEE_RECOGNITION_LEDGER: "0xA5EBfb856fe2b847cC6011B0fe2dB6ACE63D6C3c",
@@ -88539,7 +89048,7 @@ function eqAddr3(a, b) {
88539
89048
  if (!a || !b)
88540
89049
  return false;
88541
89050
  try {
88542
- return import_ethers42.ethers.getAddress(a) === import_ethers42.ethers.getAddress(b);
89051
+ return import_ethers44.ethers.getAddress(a) === import_ethers44.ethers.getAddress(b);
88543
89052
  } catch {
88544
89053
  return false;
88545
89054
  }
@@ -88605,7 +89114,7 @@ function readValue3(tx2) {
88605
89114
  }
88606
89115
  function normalizePositionId3(id) {
88607
89116
  const hex = id.startsWith("0x") ? id : `0x${id}`;
88608
- return import_ethers42.ethers.zeroPadValue(hex, 32).toLowerCase();
89117
+ return import_ethers44.ethers.zeroPadValue(hex, 32).toLowerCase();
88609
89118
  }
88610
89119
  function requirePositionId2(actual, expected) {
88611
89120
  const txPositionId = String(actual).toLowerCase();
@@ -88864,6 +89373,53 @@ function validateUnsignedTx3(unsignedTx, expected, vctx) {
88864
89373
  }
88865
89374
  break;
88866
89375
  }
89376
+ case "desk-approve": {
89377
+ if (name !== "approve") {
89378
+ throw new TxValidationError3(`expected ERC-20 approve, decoded ${name}`);
89379
+ }
89380
+ if (!eqAddr3(to, expected.tokenAddress)) {
89381
+ throw new TxValidationError3(`approve must target the token (${expected.tokenAddress}), got ${to}`);
89382
+ }
89383
+ if (!eqAddr3(String(args[0]), expected.vaultAddress)) {
89384
+ throw new TxValidationError3(`approve spender must be the StUSDCVault (${expected.vaultAddress}), got ${String(args[0])}`);
89385
+ }
89386
+ if (BigInt(String(args[1])).toString() !== expected.amount) {
89387
+ throw new TxValidationError3(
89388
+ `approve amount must be EXACTLY ${expected.amount} (exact-amount rule), got ${BigInt(String(args[1]))}`
89389
+ );
89390
+ }
89391
+ break;
89392
+ }
89393
+ case "desk-sell": {
89394
+ if (name !== "sellUCD")
89395
+ throw new TxValidationError3(`expected sellUCD, decoded ${name}`);
89396
+ if (!eqAddr3(to, expected.vaultAddress)) {
89397
+ throw new TxValidationError3(`sellUCD must target the StUSDCVault (${expected.vaultAddress}), got ${to}`);
89398
+ }
89399
+ if (BigInt(String(args[0])).toString() !== expected.amountUcdWei)
89400
+ throw new TxValidationError3(`sellUCD amountUCD mismatch`);
89401
+ if (BigInt(String(args[1])).toString() !== expected.minUsdc)
89402
+ throw new TxValidationError3(`sellUCD minUSDC mismatch`);
89403
+ if (BigInt(expected.minUsdc) === 0n) {
89404
+ throw new TxValidationError3(`sellUCD minUSDC is 0 \u2014 a slippage floor is mandatory`);
89405
+ }
89406
+ break;
89407
+ }
89408
+ case "desk-buy": {
89409
+ if (name !== "buyUCD")
89410
+ throw new TxValidationError3(`expected buyUCD, decoded ${name}`);
89411
+ if (!eqAddr3(to, expected.vaultAddress)) {
89412
+ throw new TxValidationError3(`buyUCD must target the StUSDCVault (${expected.vaultAddress}), got ${to}`);
89413
+ }
89414
+ if (BigInt(String(args[0])).toString() !== expected.amountUsdc)
89415
+ throw new TxValidationError3(`buyUCD amountUSDC mismatch`);
89416
+ if (BigInt(String(args[1])).toString() !== expected.minUcdWei)
89417
+ throw new TxValidationError3(`buyUCD minUCD mismatch`);
89418
+ if (BigInt(expected.minUcdWei) === 0n) {
89419
+ throw new TxValidationError3(`buyUCD minUCD is 0 \u2014 a slippage floor is mandatory`);
89420
+ }
89421
+ break;
89422
+ }
88867
89423
  default: {
88868
89424
  const _exhaustive = expected;
88869
89425
  throw new TxValidationError3(`unhandled expected action kind: ${JSON.stringify(_exhaustive)}`);
@@ -88898,38 +89454,38 @@ function buildPsmRedeemTx3(p) {
88898
89454
  };
88899
89455
  }
88900
89456
  var PSM_READS_ABI2 = ["function supportedStablecoins(address) view returns (bool)"];
88901
- var ERC20_READS_ABI2 = ["function allowance(address owner, address spender) view returns (uint256)"];
89457
+ var ERC20_READS_ABI3 = ["function allowance(address owner, address spender) view returns (uint256)"];
88902
89458
  function psmExchangeReadsFromProvider2(provider, psmAddress) {
88903
- const psm = new import_ethers45.ethers.Contract(psmAddress, PSM_READS_ABI2, provider);
89459
+ const psm = new import_ethers47.ethers.Contract(psmAddress, PSM_READS_ABI2, provider);
88904
89460
  return {
88905
89461
  isStablecoinSupported: async (stablecoin) => await psm.getFunction("supportedStablecoins")(stablecoin),
88906
- allowance: async (token, owner, spender) => await new import_ethers45.ethers.Contract(token, ERC20_READS_ABI2, provider).getFunction("allowance")(owner, spender)
89462
+ allowance: async (token, owner, spender) => await new import_ethers47.ethers.Contract(token, ERC20_READS_ABI3, provider).getFunction("allowance")(owner, spender)
88907
89463
  };
88908
89464
  }
88909
- var refuse2 = (direction, msg) => new TxValidationError3(msg, `PSM ${direction}`);
88910
- function requireAddress2(direction, label, value) {
88911
- if (!value || !import_ethers45.ethers.isAddress(value)) {
88912
- throw refuse2(direction, `${label} address is missing or invalid (${String(value)})`);
89465
+ var refuse3 = (direction, msg) => new TxValidationError3(msg, `PSM ${direction}`);
89466
+ function requireAddress3(direction, label, value) {
89467
+ if (!value || !import_ethers47.ethers.isAddress(value)) {
89468
+ throw refuse3(direction, `${label} address is missing or invalid (${String(value)})`);
88913
89469
  }
88914
- return import_ethers45.ethers.getAddress(value);
89470
+ return import_ethers47.ethers.getAddress(value);
88915
89471
  }
88916
89472
  async function planPsmExchange2(params) {
88917
89473
  const { direction, amountIn, minOut, vctx, reads } = params;
88918
89474
  const chainId = vctx.chainId;
88919
89475
  if (amountIn <= 0n) {
88920
- throw refuse2(direction, `amount must be greater than zero (got ${amountIn})`);
89476
+ throw refuse3(direction, `amount must be greater than zero (got ${amountIn})`);
88921
89477
  }
88922
89478
  if (minOut <= 0n) {
88923
- throw refuse2(direction, `minimum-out floor must be greater than zero (got ${minOut}) \u2014 a zero floor is refused on-chain`);
89479
+ throw refuse3(direction, `minimum-out floor must be greater than zero (got ${minOut}) \u2014 a zero floor is refused on-chain`);
88924
89480
  }
88925
- const owner = requireAddress2(direction, "owner", params.owner);
88926
- const psm = requireAddress2(direction, "SimplePSMV2", params.addresses.psm);
88927
- const stablecoin = requireAddress2(direction, "stablecoin", params.addresses.stablecoin);
89481
+ const owner = requireAddress3(direction, "owner", params.owner);
89482
+ const psm = requireAddress3(direction, "SimplePSMV2", params.addresses.psm);
89483
+ const stablecoin = requireAddress3(direction, "stablecoin", params.addresses.stablecoin);
88928
89484
  const isSwap = direction === "swap";
88929
- const token = isSwap ? stablecoin : requireAddress2(direction, "UCDToken", params.addresses.ucdToken);
88930
- const spender = isSwap ? psm : requireAddress2(direction, "UCDController", params.addresses.ucdController);
89485
+ const token = isSwap ? stablecoin : requireAddress3(direction, "UCDToken", params.addresses.ucdToken);
89486
+ const spender = isSwap ? psm : requireAddress3(direction, "UCDController", params.addresses.ucdController);
88931
89487
  if (!await reads.isStablecoinSupported(stablecoin)) {
88932
- throw refuse2(direction, `stablecoin ${stablecoin} is not supported by the PSM at ${psm}`);
89488
+ throw refuse3(direction, `stablecoin ${stablecoin} is not supported by the PSM at ${psm}`);
88933
89489
  }
88934
89490
  const approveExpected = (amount) => isSwap ? { kind: "stablecoin-approve", tokenAddress: token, spender, amountUnits: amount.toString() } : { kind: "ucd-approve-controller", ucdTokenAddress: token, spender, amountWei: amount.toString() };
88935
89491
  const allowanceBefore = await reads.allowance(token, owner, spender);
@@ -89096,7 +89652,7 @@ function assertSignableTypedData(chainId, domain, types, primaryType, message) {
89096
89652
  if (structNames.length !== 1) {
89097
89653
  throw new TypedDataRefused(`expected exactly one struct type, got ${structNames.join(", ") || "none"}`);
89098
89654
  }
89099
- const derived = import_ethers46.TypedDataEncoder.getPrimaryType(structs);
89655
+ const derived = import_ethers49.TypedDataEncoder.getPrimaryType(structs);
89100
89656
  if (derived !== primaryType) {
89101
89657
  throw new TypedDataRefused(`primaryType "${primaryType}" does not match the types' primary "${derived}"`);
89102
89658
  }
@@ -89188,7 +89744,7 @@ var SUPPORTED_STABLECOINS = `
89188
89744
  }`;
89189
89745
 
89190
89746
  // src/boundary/upstream/real/psm-calls.ts
89191
- var import_ethers47 = require("ethers");
89747
+ var import_ethers50 = require("ethers");
89192
89748
  var PSM_VIEW_FRAGMENTS = [
89193
89749
  "function VERSION() view returns (string)",
89194
89750
  "function supportedStablecoins(address) view returns (bool)",
@@ -89257,8 +89813,8 @@ var PsmCalls = class {
89257
89813
  constructor(deps) {
89258
89814
  this.deps = deps;
89259
89815
  const abi = [...PSM_VIEW_FRAGMENTS, ...PSM_ERROR_FRAGMENTS];
89260
- this.iface = new import_ethers47.ethers.Interface(abi);
89261
- this.psm = new import_ethers47.ethers.Contract(deps.psmAddress, abi, deps.provider);
89816
+ this.iface = new import_ethers50.ethers.Interface(abi);
89817
+ this.psm = new import_ethers50.ethers.Contract(deps.psmAddress, abi, deps.provider);
89262
89818
  }
89263
89819
  psm;
89264
89820
  iface;
@@ -89287,8 +89843,8 @@ var PsmCalls = class {
89287
89843
  });
89288
89844
  }
89289
89845
  return this.call(async () => {
89290
- const ucd = new import_ethers47.ethers.Contract(ucdToken, ERC20_FRAGMENTS, this.deps.provider);
89291
- const stable = new import_ethers47.ethers.Contract(this.deps.stablecoinAddress, ERC20_FRAGMENTS, this.deps.provider);
89846
+ const ucd = new import_ethers50.ethers.Contract(ucdToken, ERC20_FRAGMENTS, this.deps.provider);
89847
+ const stable = new import_ethers50.ethers.Contract(this.deps.stablecoinAddress, ERC20_FRAGMENTS, this.deps.provider);
89292
89848
  const [ucdWei, stablecoinUnits] = await Promise.all([ucd["balanceOf"](holder), stable["balanceOf"](holder)]);
89293
89849
  return { ucdWei: ucdWei.toString(), stablecoinUnits: stablecoinUnits.toString() };
89294
89850
  });
@@ -89406,7 +89962,7 @@ var PsmCalls = class {
89406
89962
  };
89407
89963
 
89408
89964
  // src/boundary/upstream/real/session.ts
89409
- var import_ethers48 = require("ethers");
89965
+ var import_ethers51 = require("ethers");
89410
89966
  var REFRESH_LEEWAY_SEC = 30;
89411
89967
  var LOGIN_TYPES_WITH_AUDIENCE3 = {
89412
89968
  DiamondHands: [
@@ -89454,7 +90010,7 @@ var LitOpsSession = class {
89454
90010
  const message = {
89455
90011
  address: this.wallet.address,
89456
90012
  issuedAt: Math.floor(Date.now() / 1e3),
89457
- nonce: "0x" + Buffer.from(import_ethers48.ethers.randomBytes(32)).toString("hex"),
90013
+ nonce: "0x" + Buffer.from(import_ethers51.ethers.randomBytes(32)).toString("hex"),
89458
90014
  audience: this.serviceEndpoint
89459
90015
  };
89460
90016
  const signature = await this.wallet.signTypedData(
@@ -89496,7 +90052,7 @@ function decodeJwtExp(token) {
89496
90052
  }
89497
90053
 
89498
90054
  // src/boundary/upstream/real/write-ops.ts
89499
- var import_ethers50 = require("ethers");
90055
+ var import_ethers53 = require("ethers");
89500
90056
 
89501
90057
  // src/signer/types.ts
89502
90058
  var OperationDeclined = class extends Error {
@@ -89506,7 +90062,7 @@ var OperationDeclined = class extends Error {
89506
90062
  init_tx_validator();
89507
90063
 
89508
90064
  // src/boundary/upstream/shared/external-bridge/page-crypto.ts
89509
- var import_ethers49 = require("ethers");
90065
+ var import_ethers52 = require("ethers");
89510
90066
  var PERSONAL_SIGN_LAYOUTS = {
89511
90067
  "dh-op-envelope-v1": {
89512
90068
  types: ["bytes32", "uint256", "uint256", "uint256", "bytes32"],
@@ -89521,9 +90077,9 @@ function hashForLayout(layout, fields) {
89521
90077
  const values = def.fieldOrder.map((name) => {
89522
90078
  const raw = fields[name];
89523
90079
  if (raw === void 0) throw new Error(`page-crypto: layout "${layout}" missing field "${name}"`);
89524
- return hashUtf8.has(name) ? import_ethers49.ethers.keccak256(import_ethers49.ethers.toUtf8Bytes(raw)) : raw;
90080
+ return hashUtf8.has(name) ? import_ethers52.ethers.keccak256(import_ethers52.ethers.toUtf8Bytes(raw)) : raw;
89525
90081
  });
89526
- return import_ethers49.ethers.solidityPackedKeccak256(def.types, values);
90082
+ return import_ethers52.ethers.solidityPackedKeccak256(def.types, values);
89527
90083
  }
89528
90084
  var PAGE_CRYPTO_JS = `"use strict";
89529
90085
  (function () {
@@ -89762,7 +90318,7 @@ function mcpExpected(leg) {
89762
90318
  }
89763
90319
  var OP_LAYOUT = "dh-op-envelope-v1";
89764
90320
  function randomNonceHex() {
89765
- return "0x" + Buffer.from(import_ethers50.ethers.randomBytes(16)).toString("hex");
90321
+ return "0x" + Buffer.from(import_ethers53.ethers.randomBytes(16)).toString("hex");
89766
90322
  }
89767
90323
  async function postJson(url2, body, headers) {
89768
90324
  const res = await fetch(url2, {
@@ -89830,7 +90386,7 @@ function buildWriteOps(deps) {
89830
90386
  return {
89831
90387
  to: String(tx2["to"] ?? ""),
89832
90388
  data: String(tx2["data"] ?? "0x"),
89833
- value: tx2["value"] != null ? import_ethers50.ethers.toBeHex(BigInt(String(tx2["value"]))) : "0x0",
90389
+ value: tx2["value"] != null ? import_ethers53.ethers.toBeHex(BigInt(String(tx2["value"]))) : "0x0",
89834
90390
  chainId: tx2["chainId"] != null ? Number(tx2["chainId"]) : chainId
89835
90391
  };
89836
90392
  }
@@ -89996,7 +90552,7 @@ function buildWriteOps(deps) {
89996
90552
  mintedUcdWei: minted,
89997
90553
  feeUcdWei: mintFee,
89998
90554
  echoedAmountUcdWei: minted,
89999
- authorization: auth(action, `mint ${import_ethers50.ethers.formatEther(amountWei)} UCD against ${p.positionId}`, r.value.digest)
90555
+ authorization: auth(action, `mint ${import_ethers53.ethers.formatEther(amountWei)} UCD against ${p.positionId}`, r.value.digest)
90000
90556
  },
90001
90557
  { id: SOURCE5, kind: "lit-ops", fetchedAt: (/* @__PURE__ */ new Date()).toISOString() }
90002
90558
  );
@@ -90037,7 +90593,7 @@ function buildWriteOps(deps) {
90037
90593
  txRef: { kind: "eth-tx", id: r.value.txHash },
90038
90594
  paidUcdWei: paid,
90039
90595
  echoedAmountUcdWei: paid,
90040
- authorization: auth(action, `repay ${import_ethers50.ethers.formatEther(amountWei)} UCD on ${p.positionId}`, r.value.digest)
90596
+ authorization: auth(action, `repay ${import_ethers53.ethers.formatEther(amountWei)} UCD on ${p.positionId}`, r.value.digest)
90041
90597
  },
90042
90598
  { id: SOURCE5, kind: "lit-ops", fetchedAt: (/* @__PURE__ */ new Date()).toISOString() }
90043
90599
  );
@@ -90300,7 +90856,7 @@ function buildWriteOps(deps) {
90300
90856
  }
90301
90857
 
90302
90858
  // src/signer/eoa-dh.ts
90303
- var import_ethers51 = require("ethers");
90859
+ var import_ethers54 = require("ethers");
90304
90860
  var EoaDHSigner = class {
90305
90861
  constructor(wallet, broadcast, clock = Date.now) {
90306
90862
  this.wallet = wallet;
@@ -90317,7 +90873,7 @@ var EoaDHSigner = class {
90317
90873
  async signAuthorization(spec) {
90318
90874
  const quantumTs = nextQuantumTimestamp(this.clock());
90319
90875
  const { fields, hashHex } = spec.stamp(quantumTs);
90320
- const signature = await this.wallet.signMessage(import_ethers51.ethers.getBytes(hashHex));
90876
+ const signature = await this.wallet.signMessage(import_ethers54.ethers.getBytes(hashHex));
90321
90877
  return { signature, quantumTs, fields };
90322
90878
  }
90323
90879
  async wrapInnerTx(innerTx) {
@@ -90335,13 +90891,13 @@ var EoaDHSigner = class {
90335
90891
 
90336
90892
  // src/signer/external-eoa.ts
90337
90893
  var import_node_crypto7 = require("crypto");
90338
- var import_ethers55 = require("ethers");
90894
+ var import_ethers58 = require("ethers");
90339
90895
 
90340
90896
  // src/boundary/upstream/shared/external-bridge/bridge.ts
90341
90897
  var fs4 = __toESM(require("fs"));
90342
90898
  var http3 = __toESM(require("http"));
90343
90899
  var import_node_crypto6 = require("crypto");
90344
- var import_ethers53 = require("ethers");
90900
+ var import_ethers56 = require("ethers");
90345
90901
 
90346
90902
  // src/util/brand-assets.ts
90347
90903
  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>`;
@@ -90952,7 +91508,7 @@ function presenceStatement(origin2, chainId, nonce) {
90952
91508
  }
90953
91509
  function recoverPresenceSigner(statement, signature) {
90954
91510
  try {
90955
- return import_ethers53.ethers.verifyMessage(statement, signature);
91511
+ return import_ethers56.ethers.verifyMessage(statement, signature);
90956
91512
  } catch {
90957
91513
  return null;
90958
91514
  }
@@ -92199,7 +92755,7 @@ data: ${JSON.stringify(payload)}
92199
92755
  };
92200
92756
 
92201
92757
  // src/boundary/upstream/shared/external-bridge/verify-landed-tx.ts
92202
- var import_ethers54 = require("ethers");
92758
+ var import_ethers57 = require("ethers");
92203
92759
  function eq2(a, b) {
92204
92760
  return a.toLowerCase() === b.toLowerCase();
92205
92761
  }
@@ -92222,7 +92778,7 @@ function compareLandedTx(landed, approved, borrower) {
92222
92778
  return { status: "verified", from: landed.from, hash: landed.hash };
92223
92779
  }
92224
92780
  function verifyRawSignedTx(rawSignedTx, approved, borrower) {
92225
- const parsed = import_ethers54.ethers.Transaction.from(rawSignedTx);
92781
+ const parsed = import_ethers57.ethers.Transaction.from(rawSignedTx);
92226
92782
  if (!parsed.from || !parsed.to || !parsed.hash) {
92227
92783
  return { status: "mismatch", hash: parsed.hash ?? "0x", reason: "the returned raw transaction is unsigned or malformed" };
92228
92784
  }
@@ -92269,7 +92825,7 @@ async function gasHintAcrossBlocks(provider, from, tx2, action) {
92269
92825
  for (let attempt = 0; attempt < 4; attempt++) {
92270
92826
  try {
92271
92827
  const est = await provider.estimateGas({ from, to: tx2.to, data: tx2.data, value: BigInt(tx2.value) });
92272
- return import_ethers55.ethers.toBeHex(est * 15n / 10n);
92828
+ return import_ethers58.ethers.toBeHex(est * 15n / 10n);
92273
92829
  } catch (e) {
92274
92830
  lastErr = e;
92275
92831
  await new Promise((r) => setTimeout(r, 13e3));
@@ -92319,7 +92875,7 @@ var ExternalEoaDHSigner = class {
92319
92875
  throw new OperationDeclined(`the ${spec.action} authorization was not signed: ${describeOutcome(outcome)}`);
92320
92876
  }
92321
92877
  const finalHash = spec.stamp(used.quantumTs).hashHex;
92322
- const recovered = import_ethers55.ethers.verifyMessage(import_ethers55.ethers.getBytes(finalHash), outcome.signature);
92878
+ const recovered = import_ethers58.ethers.verifyMessage(import_ethers58.ethers.getBytes(finalHash), outcome.signature);
92323
92879
  if (recovered.toLowerCase() !== this.deps.borrower.toLowerCase()) {
92324
92880
  throw new Error(`the ${spec.action} authorization was signed by ${recovered}, not the borrower ${this.deps.borrower}`);
92325
92881
  }
@@ -92330,7 +92886,7 @@ var ExternalEoaDHSigner = class {
92330
92886
  }
92331
92887
  async submitValidatedTx(outerTx, ctx) {
92332
92888
  const approved = toApprovedTx(outerTx, this.deps.chainId);
92333
- const gas = outerTx.gasLimit != null ? import_ethers55.ethers.toBeHex(BigInt(String(outerTx.gasLimit))) : await gasHintAcrossBlocks(this.deps.provider, this.deps.borrower, approved, ctx.action);
92889
+ const gas = outerTx.gasLimit != null ? import_ethers58.ethers.toBeHex(BigInt(String(outerTx.gasLimit))) : await gasHintAcrossBlocks(this.deps.provider, this.deps.borrower, approved, ctx.action);
92334
92890
  const outcome = await this.deps.bridge.requestSignature({
92335
92891
  id: (0, import_node_crypto7.randomUUID)(),
92336
92892
  kind: "transaction",
@@ -92364,7 +92920,7 @@ var ExternalEoaDHSigner = class {
92364
92920
  return new BridgeEthersSigner(this.deps);
92365
92921
  }
92366
92922
  };
92367
- var BridgeEthersSigner = class _BridgeEthersSigner extends import_ethers55.ethers.AbstractSigner {
92923
+ var BridgeEthersSigner = class _BridgeEthersSigner extends import_ethers58.ethers.AbstractSigner {
92368
92924
  constructor(deps) {
92369
92925
  super(deps.provider);
92370
92926
  this.deps = deps;
@@ -92375,7 +92931,7 @@ var BridgeEthersSigner = class _BridgeEthersSigner extends import_ethers55.ether
92375
92931
  return this.deps.borrower;
92376
92932
  }
92377
92933
  async signMessage(message) {
92378
- const length = typeof message === "string" ? import_ethers55.ethers.toUtf8Bytes(message).length : message.length;
92934
+ const length = typeof message === "string" ? import_ethers58.ethers.toUtf8Bytes(message).length : message.length;
92379
92935
  throw new Error(
92380
92936
  `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.`
92381
92937
  );
@@ -92428,7 +92984,7 @@ var BridgeEthersSigner = class _BridgeEthersSigner extends import_ethers55.ether
92428
92984
  const structs = Object.fromEntries(
92429
92985
  Object.entries(types).filter(([name]) => name !== "EIP712Domain").map(([name, fields]) => [name, fields.map((f) => ({ name: f.name, type: f.type }))])
92430
92986
  );
92431
- const primaryType = import_ethers55.ethers.TypedDataEncoder.getPrimaryType(structs);
92987
+ const primaryType = import_ethers58.ethers.TypedDataEncoder.getPrimaryType(structs);
92432
92988
  const { label } = this.deps.guardTypedData(this.deps.chainId, domain, structs, primaryType, message);
92433
92989
  const typedData = { domain, types: structs, primaryType, message };
92434
92990
  if (BTC_SPEND_PRIMARY_TYPES.has(primaryType)) {
@@ -92486,17 +93042,17 @@ var BridgeEthersSigner = class _BridgeEthersSigner extends import_ethers55.ether
92486
93042
  async verifyTypedSigner(typedData, signature) {
92487
93043
  const types = typedData.types;
92488
93044
  let recovered = null;
92489
- if (import_ethers55.ethers.isHexString(signature, 65)) {
92490
- const v = Number(BigInt(import_ethers55.ethers.dataSlice(signature, 64, 65)));
93045
+ if (import_ethers58.ethers.isHexString(signature, 65)) {
93046
+ const v = Number(BigInt(import_ethers58.ethers.dataSlice(signature, 64, 65)));
92491
93047
  if (v === 0 || v === 1 || v === 27 || v === 28) {
92492
- recovered = import_ethers55.ethers.verifyTypedData(typedData.domain, types, typedData.message, signature);
93048
+ recovered = import_ethers58.ethers.verifyTypedData(typedData.domain, types, typedData.message, signature);
92493
93049
  if (recovered.toLowerCase() === this.deps.borrower.toLowerCase()) return;
92494
93050
  }
92495
93051
  }
92496
93052
  const code = await this.deps.provider.getCode(this.deps.borrower);
92497
93053
  if (codeIsContractWallet(code)) {
92498
- const digest = import_ethers55.ethers.TypedDataEncoder.hash(typedData.domain, types, typedData.message);
92499
- const wallet = new import_ethers55.ethers.Contract(
93054
+ const digest = import_ethers58.ethers.TypedDataEncoder.hash(typedData.domain, types, typedData.message);
93055
+ const wallet = new import_ethers58.ethers.Contract(
92500
93056
  this.deps.borrower,
92501
93057
  ["function isValidSignature(bytes32,bytes) view returns (bytes4)"],
92502
93058
  this.deps.provider
@@ -92520,11 +93076,11 @@ var BridgeEthersSigner = class _BridgeEthersSigner extends import_ethers55.ether
92520
93076
  const approved = {
92521
93077
  to: tx2.to,
92522
93078
  data: tx2.data,
92523
- value: tx2.value != null ? import_ethers55.ethers.toBeHex(BigInt(String(tx2.value))) : "0x0",
93079
+ value: tx2.value != null ? import_ethers58.ethers.toBeHex(BigInt(String(tx2.value))) : "0x0",
92524
93080
  chainId: tx2.chainId != null ? Number(tx2.chainId) : this.deps.chainId
92525
93081
  };
92526
93082
  const card = cardForTx(approved);
92527
- const gas = tx2.gasLimit != null ? import_ethers55.ethers.toBeHex(BigInt(String(tx2.gasLimit))) : await gasHintAcrossBlocks(this.deps.provider, this.deps.borrower, approved, describeFn(approved.data));
93083
+ 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));
92528
93084
  const outcome = await this.deps.bridge.requestSignature({
92529
93085
  id: (0, import_node_crypto7.randomUUID)(),
92530
93086
  kind: "transaction",
@@ -92566,7 +93122,7 @@ function toApprovedTx(tx2, fallbackChainId) {
92566
93122
  return {
92567
93123
  to: tx2.to,
92568
93124
  data: tx2.data,
92569
- value: tx2.value != null ? import_ethers55.ethers.toBeHex(BigInt(String(tx2.value))) : "0x0",
93125
+ value: tx2.value != null ? import_ethers58.ethers.toBeHex(BigInt(String(tx2.value))) : "0x0",
92570
93126
  chainId: tx2.chainId != null ? Number(tx2.chainId) : fallbackChainId
92571
93127
  };
92572
93128
  }
@@ -92616,9 +93172,9 @@ var MIN_CONFIRMATIONS = { mainnet: 6, sepolia: 1 };
92616
93172
  var RealUpstreamPlugin = class {
92617
93173
  constructor(config, wallet, runtime) {
92618
93174
  this.config = config;
92619
- const rpc = new import_ethers56.ethers.FetchRequest(config.rpcUrl);
93175
+ const rpc = new import_ethers59.ethers.FetchRequest(config.rpcUrl);
92620
93176
  if (config.rpcDrpcKey !== void 0) rpc.setHeader("Drpc-Key", config.rpcDrpcKey);
92621
- this.provider = new import_ethers56.ethers.JsonRpcProvider(rpc, config.chainId);
93177
+ this.provider = new import_ethers59.ethers.JsonRpcProvider(rpc, config.chainId);
92622
93178
  this.wallet = wallet ?? null;
92623
93179
  this.runtime = runtime ?? null;
92624
93180
  this.session = wallet ? new LitOpsSession(wallet.connect(this.provider), config.serviceEndpoint, config.chainId) : null;
@@ -92925,14 +93481,14 @@ var RealUpstreamPlugin = class {
92925
93481
  if (!pkpValidation) {
92926
93482
  throw new Error(`the SDK's ${this.config.network} deployment table has no PKPValidation address \u2014 cannot verify validator version ${version}.`);
92927
93483
  }
92928
- const registry = new import_ethers56.ethers.Contract(pkpValidation, ["function validatorForVersion(uint256) view returns (address)"], this.provider);
93484
+ const registry = new import_ethers59.ethers.Contract(pkpValidation, ["function validatorForVersion(uint256) view returns (address)"], this.provider);
92929
93485
  let validator;
92930
93486
  try {
92931
93487
  validator = await registry.validatorForVersion(version);
92932
93488
  } catch (e) {
92933
93489
  throw new Error(`could not verify validator version ${version} on-chain (PKPValidation ${pkpValidation}): ${e.message}`);
92934
93490
  }
92935
- if (validator === import_ethers56.ethers.ZeroAddress) {
93491
+ if (validator === import_ethers59.ethers.ZeroAddress) {
92936
93492
  throw new Error(
92937
93493
  `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.`
92938
93494
  );
@@ -93225,7 +93781,7 @@ var RealUpstreamPlugin = class {
93225
93781
  );
93226
93782
  if (!r.ok) return r;
93227
93783
  const raw = r.value.data.supportedStablecoins ?? [];
93228
- const bad = raw.find((x) => !import_ethers56.ethers.isAddress(String(x.address)) || !Number.isFinite(Number(x.decimals)));
93784
+ const bad = raw.find((x) => !import_ethers59.ethers.isAddress(String(x.address)) || !Number.isFinite(Number(x.decimals)));
93229
93785
  if (bad) {
93230
93786
  return {
93231
93787
  ok: false,
@@ -93308,7 +93864,7 @@ var RealUpstreamPlugin = class {
93308
93864
  };
93309
93865
  }
93310
93866
  const symbol = raw.toLowerCase();
93311
- if (import_ethers56.ethers.isAddress(raw)) return this.psmCallsFor(symbol);
93867
+ if (import_ethers59.ethers.isAddress(raw)) return this.psmCallsFor(symbol);
93312
93868
  const verified = await this.verifiedStablecoins();
93313
93869
  if (!verified.ok) return { ok: false, failure: verified.failure };
93314
93870
  const hits = verified.rows.filter((r) => r.symbol.toLowerCase() === symbol);
@@ -93346,7 +93902,7 @@ var RealUpstreamPlugin = class {
93346
93902
  * chain, then sign.
93347
93903
  */
93348
93904
  async psmCallsFor(stablecoinAddress) {
93349
- if (!import_ethers56.ethers.isAddress(stablecoinAddress)) {
93905
+ if (!import_ethers59.ethers.isAddress(stablecoinAddress)) {
93350
93906
  throw new Error(`psmCallsFor requires a resolved 0x address, got '${stablecoinAddress}' \u2014 resolve through psmCallsForChoice`);
93351
93907
  }
93352
93908
  const key = stablecoinAddress.toLowerCase();
@@ -93365,7 +93921,7 @@ var RealUpstreamPlugin = class {
93365
93921
  }
93366
93922
  let supported;
93367
93923
  try {
93368
- const psm = new import_ethers56.ethers.Contract(psmAddress, ["function supportedStablecoins(address) view returns (bool)"], this.provider);
93924
+ const psm = new import_ethers59.ethers.Contract(psmAddress, ["function supportedStablecoins(address) view returns (bool)"], this.provider);
93369
93925
  supported = await psm["supportedStablecoins"](key);
93370
93926
  } catch (e) {
93371
93927
  return { ok: false, failure: { kind: "unavailable", source: "chain-rpc", message: `PSM stablecoin check failed for ${key}: ${e.message}` } };
@@ -93382,7 +93938,7 @@ var RealUpstreamPlugin = class {
93382
93938
  }
93383
93939
  let symbol;
93384
93940
  try {
93385
- const erc20 = new import_ethers56.ethers.Contract(key, ["function symbol() view returns (string)"], this.provider);
93941
+ const erc20 = new import_ethers59.ethers.Contract(key, ["function symbol() view returns (string)"], this.provider);
93386
93942
  symbol = await erc20["symbol"]();
93387
93943
  } catch (e) {
93388
93944
  return { ok: false, failure: { kind: "unavailable", source: "chain-rpc", message: `PSM stablecoin symbol read failed for ${key}: ${e.message}` } };
@@ -93597,7 +94153,7 @@ var RealUpstreamPlugin = class {
93597
94153
  const pm = this.contracts["PositionManager"];
93598
94154
  if (!pm) return false;
93599
94155
  try {
93600
- const c = new import_ethers56.ethers.Contract(pm, PAUSABLE_ABI, this.provider);
94156
+ const c = new import_ethers59.ethers.Contract(pm, PAUSABLE_ABI, this.provider);
93601
94157
  return Boolean(await c["paused"]());
93602
94158
  } catch {
93603
94159
  return false;
@@ -93606,10 +94162,10 @@ var RealUpstreamPlugin = class {
93606
94162
  async readPositionDetails(id) {
93607
94163
  const core = this.contracts["PositionManagerCoreModule"] ?? this.contracts["PositionManager"];
93608
94164
  if (!core) throw new Error(`no PositionManager address for network ${this.config.network}`);
93609
- const c = new import_ethers56.ethers.Contract(core, POSITION_DETAILS_ABI, this.provider);
94165
+ const c = new import_ethers59.ethers.Contract(core, POSITION_DETAILS_ABI, this.provider);
93610
94166
  let d;
93611
94167
  try {
93612
- d = await c["getPositionDetails"](import_ethers56.ethers.zeroPadValue(id, 32));
94168
+ d = await c["getPositionDetails"](import_ethers59.ethers.zeroPadValue(id, 32));
93613
94169
  } catch (e) {
93614
94170
  if (isContractRevert(e)) return null;
93615
94171
  const nodeMessage = e.info?.error?.message;
@@ -93619,7 +94175,7 @@ var RealUpstreamPlugin = class {
93619
94175
  throw e;
93620
94176
  }
93621
94177
  const borrower = String(d["borrower"]);
93622
- if (borrower === import_ethers56.ethers.ZeroAddress) return null;
94178
+ if (borrower === import_ethers59.ethers.ZeroAddress) return null;
93623
94179
  return {
93624
94180
  positionId: String(d["positionId"]),
93625
94181
  pkpId: String(d["pkpId"]),
@@ -93825,7 +94381,7 @@ async function createRealBoundary(config, wallet, overrides) {
93825
94381
  const manager = new SignerManager({
93826
94382
  persistence: overrides?.signerPersistence?.(config.network) ?? fileSignerPersistence(stateFile),
93827
94383
  initialMode,
93828
- ...overrides?.boundBorrower ? { authenticatedBorrower: import_ethers57.ethers.getAddress(overrides.boundBorrower) } : {},
94384
+ ...overrides?.boundBorrower ? { authenticatedBorrower: import_ethers60.ethers.getAddress(overrides.boundBorrower) } : {},
93829
94385
  candidate: () => bridge.walletState()?.account ?? null,
93830
94386
  pendingCeremonies: () => bridge.pendingCount(),
93831
94387
  keystore
@@ -93921,8 +94477,8 @@ async function buildBoundary(configResult, overrides) {
93921
94477
  );
93922
94478
  }
93923
94479
  try {
93924
- const decrypted = await import_ethers58.ethers.Wallet.fromEncryptedJson(keystoreJson, config.keystorePassword);
93925
- if (!(decrypted instanceof import_ethers58.ethers.Wallet)) {
94480
+ const decrypted = await import_ethers61.ethers.Wallet.fromEncryptedJson(keystoreJson, config.keystorePassword);
94481
+ if (!(decrypted instanceof import_ethers61.ethers.Wallet)) {
93926
94482
  return bootError("DH_KEYSTORE_PATH did not decrypt to an EOA wallet keystore.", ["DH_KEYSTORE_PATH"]);
93927
94483
  }
93928
94484
  wallet = decrypted;
@@ -94211,7 +94767,7 @@ function registerBoundaryInfoResource(server, getB) {
94211
94767
  }
94212
94768
 
94213
94769
  // src/version.ts
94214
- var SERVER_VERSION = "0.5.28";
94770
+ var SERVER_VERSION = "0.5.29";
94215
94771
 
94216
94772
  // src/server.ts
94217
94773
  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.";
@@ -94347,7 +94903,7 @@ function renderLandingPage(input) {
94347
94903
 
94348
94904
  // src/connector/siwe-oauth.ts
94349
94905
  var import_node_crypto10 = require("crypto");
94350
- var import_ethers59 = require("ethers");
94906
+ var import_ethers62 = require("ethers");
94351
94907
  var import_errors10 = require("@modelcontextprotocol/sdk/server/auth/errors.js");
94352
94908
 
94353
94909
  // src/connector/siwe-page.ts
@@ -94672,8 +95228,8 @@ var SiweOAuthProvider = class {
94672
95228
  siweMessage(flowId, address) {
94673
95229
  const flow = this.liveFlow(flowId);
94674
95230
  if (!flow) return { ok: false, status: 404, reason: "unknown or expired sign-in flow \u2014 restart the connection from claude.ai" };
94675
- if (!import_ethers59.ethers.isAddress(address)) return { ok: false, status: 400, reason: "not a valid wallet address" };
94676
- const checksummed = import_ethers59.ethers.getAddress(address);
95231
+ if (!import_ethers62.ethers.isAddress(address)) return { ok: false, status: 400, reason: "not a valid wallet address" };
95232
+ const checksummed = import_ethers62.ethers.getAddress(address);
94677
95233
  flow.siwe = { address: checksummed, message: this.mintSiweMessage(checksummed, flow) };
94678
95234
  return { ok: true, message: flow.siwe.message };
94679
95235
  }
@@ -94795,17 +95351,17 @@ Issued At: ${new Date(this.clock()).toISOString()}`;
94795
95351
  true
94796
95352
  );
94797
95353
  };
94798
- if (!import_ethers59.ethers.isAddress(account)) {
95354
+ if (!import_ethers62.ethers.isAddress(account)) {
94799
95355
  fail(400, "the connected wallet reported an invalid address");
94800
95356
  return;
94801
95357
  }
94802
- const checksummed = import_ethers59.ethers.getAddress(account);
95358
+ const checksummed = import_ethers62.ethers.getAddress(account);
94803
95359
  const message = this.mintSiweMessage(checksummed, flow);
94804
95360
  flow.siwe = { address: checksummed, message };
94805
95361
  flow.wc.state = "awaiting-signature";
94806
95362
  let signature;
94807
95363
  try {
94808
- signature = await transport.request("personal_sign", [import_ethers59.ethers.hexlify(import_ethers59.ethers.toUtf8Bytes(message)), checksummed]);
95364
+ signature = await transport.request("personal_sign", [import_ethers62.ethers.hexlify(import_ethers62.ethers.toUtf8Bytes(message)), checksummed]);
94809
95365
  } catch (e) {
94810
95366
  const msg = e instanceof Error ? e.message : String(e);
94811
95367
  const declined = e.code === 4001 || /reject|declin|denied|cancel/i.test(msg);
@@ -94814,7 +95370,7 @@ Issued At: ${new Date(this.clock()).toISOString()}`;
94814
95370
  }
94815
95371
  let recovered;
94816
95372
  try {
94817
- recovered = import_ethers59.ethers.verifyMessage(message, signature);
95373
+ recovered = import_ethers62.ethers.verifyMessage(message, signature);
94818
95374
  } catch {
94819
95375
  fail(400, "the signature is not a valid Ethereum signature");
94820
95376
  return;
@@ -94888,7 +95444,7 @@ Issued At: ${new Date(this.clock()).toISOString()}`;
94888
95444
  if (!flow.siwe) return { ok: false, status: 400, reason: "no wallet address was reported for this flow yet" };
94889
95445
  let recovered;
94890
95446
  try {
94891
- recovered = import_ethers59.ethers.verifyMessage(flow.siwe.message, signature);
95447
+ recovered = import_ethers62.ethers.verifyMessage(flow.siwe.message, signature);
94892
95448
  } catch {
94893
95449
  return { ok: false, status: 400, reason: "the signature is not a valid Ethereum signature" };
94894
95450
  }
@@ -95856,7 +96412,7 @@ mime-types/index.js:
95856
96412
  *)
95857
96413
 
95858
96414
  axios/dist/node/axios.cjs:
95859
- (*! Axios v1.21.0 Copyright (c) 2026 Matt Zabriskie and contributors *)
96415
+ (*! Axios v1.21.1 Copyright (c) 2026 Matt Zabriskie and contributors *)
95860
96416
 
95861
96417
  safe-buffer/index.js:
95862
96418
  (*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)