@gvnrdao/dh-mcp 0.5.28 → 0.5.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/boundary.js CHANGED
@@ -13699,7 +13699,7 @@ var require_follow_redirects = __commonJS({
13699
13699
  return URL2 && value instanceof URL2;
13700
13700
  }
13701
13701
  function escapeRegex(regex) {
13702
- return regex.replace(/[[\]\\/()*+?.^$|]/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_ethers56 = require("ethers");
15469
+ var import_ethers59 = 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_ethers56.ethers,
18588
+ ...import_ethers59.ethers,
18589
18589
  providers: {
18590
- StaticJsonRpcProvider: import_ethers56.ethers.JsonRpcProvider
18590
+ StaticJsonRpcProvider: import_ethers59.ethers.JsonRpcProvider
18591
18591
  },
18592
- Contract: import_ethers56.ethers.Contract,
18593
- utils: import_ethers56.ethers
18592
+ Contract: import_ethers59.ethers.Contract,
18593
+ utils: import_ethers59.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_ethers50, WC_SESSION_METHODS, WC_DAPP_METADATA, EVENTS, WcTransport;
41760
+ var import_core, import_sign_client, os, path3, import_node_fs, import_ethers53, WC_SESSION_METHODS, WC_DAPP_METADATA, EVENTS, WcTransport;
41757
41761
  var init_wc_transport = __esm({
41758
41762
  "src/boundary/upstream/shared/external-bridge/wc-transport.ts"() {
41759
41763
  "use strict";
@@ -41762,7 +41766,7 @@ var init_wc_transport = __esm({
41762
41766
  os = __toESM(require("os"));
41763
41767
  path3 = __toESM(require("path"));
41764
41768
  import_node_fs = require("fs");
41765
- import_ethers50 = require("ethers");
41769
+ import_ethers53 = require("ethers");
41766
41770
  WC_SESSION_METHODS = ["personal_sign", "eth_signTypedData_v4", "eth_sendTransaction"];
41767
41771
  WC_DAPP_METADATA = {
41768
41772
  name: "Diamond Hands MCP",
@@ -41846,7 +41850,7 @@ var init_wc_transport = __esm({
41846
41850
  return await this.client.request({
41847
41851
  topic: candidate.topic,
41848
41852
  chainId: `eip155:${candidate.chainId}`,
41849
- request: { method: "personal_sign", params: [import_ethers50.ethers.hexlify(import_ethers50.ethers.toUtf8Bytes(statement)), candidate.account] }
41853
+ request: { method: "personal_sign", params: [import_ethers53.ethers.hexlify(import_ethers53.ethers.toUtf8Bytes(statement)), candidate.account] }
41850
41854
  });
41851
41855
  };
41852
41856
  const state = { deleted: false };
@@ -41910,7 +41914,7 @@ var import_node_crypto8 = require("crypto");
41910
41914
  var fs5 = __toESM(require("fs"));
41911
41915
  var os2 = __toESM(require("os"));
41912
41916
  var path4 = __toESM(require("path"));
41913
- var import_ethers55 = require("ethers");
41917
+ var import_ethers58 = require("ethers");
41914
41918
 
41915
41919
  // src/boundary/errors.ts
41916
41920
  function boundaryError(code, message, extra) {
@@ -42570,7 +42574,7 @@ var BoundaryCore = class {
42570
42574
  const inToken = toUcd ? s.stablecoinSymbol : "UCD";
42571
42575
  const inUnit = toUcd ? `${s.stablecoinSymbol} smallest units (${s.stablecoinDecimals} decimals)` : "UCD wei (18 decimals)";
42572
42576
  const amountIn = parseDecimalUnits(p.amount, inDecimals);
42573
- const refuse3 = (refusal, message, details) => ({
42577
+ const refuse4 = (refusal, message, details) => ({
42574
42578
  env: errEnvelope(
42575
42579
  boundaryError("UPSTREAM_REJECTED", message, {
42576
42580
  source: statusR.source.id,
@@ -42581,13 +42585,13 @@ var BoundaryCore = class {
42581
42585
  });
42582
42586
  const named = (units) => `${formatDecimalUnits(units, inDecimals)} ${inToken} (${units} ${inUnit})`;
42583
42587
  if (s.paused) {
42584
- return refuse3(
42588
+ return refuse4(
42585
42589
  "psm-paused",
42586
42590
  "the PSM is paused \u2014 BOTH exchange directions are disabled until an operator unpauses it (this is the PSM's own pause switch)."
42587
42591
  );
42588
42592
  }
42589
42593
  if (!toUcd && !s.redeemEnabled) {
42590
- return refuse3(
42594
+ return refuse4(
42591
42595
  "redeem-disabled",
42592
42596
  `redemptions are disabled (redeemEnabled = false) \u2014 UCD -> ${s.stablecoinSymbol} is refused; ${s.stablecoinSymbol} -> UCD swaps are unaffected.`
42593
42597
  );
@@ -42598,20 +42602,20 @@ var BoundaryCore = class {
42598
42602
  const min = BigInt(toUcd ? s.minSwapAmount : s.minRedeemAmount);
42599
42603
  const max = BigInt(toUcd ? s.maxSwapAmount : s.maxRedeemAmount);
42600
42604
  if (amountIn < min) {
42601
- return refuse3(
42605
+ return refuse4(
42602
42606
  "below-min",
42603
42607
  `${named(amountIn)} is below the minimum of ${named(min)} for the ${p.direction} direction.`,
42604
42608
  { amount: amountIn.toString(), minimum: min.toString(), unit: inUnit }
42605
42609
  );
42606
42610
  }
42607
42611
  if (max === 0n) {
42608
- return refuse3(
42612
+ return refuse4(
42609
42613
  "direction-disabled",
42610
42614
  `the ${p.direction} direction is DISABLED by configuration (${toUcd ? "maxSwapAmount" : "maxRedeemAmount"} is 0).`
42611
42615
  );
42612
42616
  }
42613
42617
  if (amountIn > max) {
42614
- return refuse3(
42618
+ return refuse4(
42615
42619
  "above-max",
42616
42620
  `${named(amountIn)} is above the maximum of ${named(max)} per operation for the ${p.direction} direction.`,
42617
42621
  { amount: amountIn.toString(), maximum: max.toString(), unit: inUnit }
@@ -42631,7 +42635,7 @@ var BoundaryCore = class {
42631
42635
  if (!toUcd) {
42632
42636
  const available = BigInt(s.availableReserves);
42633
42637
  if (available < amountOut) {
42634
- return refuse3(
42638
+ return refuse4(
42635
42639
  "insufficient-reserves",
42636
42640
  `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).`,
42637
42641
  { available: available.toString(), required: amountOut.toString(), unit: outUnit }
@@ -46875,7 +46879,7 @@ var SafeModuleCeremony = class {
46875
46879
  };
46876
46880
 
46877
46881
  // src/boundary/upstream/real/plugin.ts
46878
- var import_ethers54 = require("ethers");
46882
+ var import_ethers57 = require("ethers");
46879
46883
 
46880
46884
  // node_modules/@gvnrdao/dh-sdk/dist/index.mjs
46881
46885
  var import_ethers13 = require("ethers");
@@ -46889,6 +46893,7 @@ var import_ethers20 = require("ethers");
46889
46893
  var import_ethers21 = require("ethers");
46890
46894
  var import_ethers22 = require("ethers");
46891
46895
  var import_ethers23 = require("ethers");
46896
+ var import_ethers24 = require("ethers");
46892
46897
 
46893
46898
  // node_modules/@noble/hashes/esm/utils.js
46894
46899
  function isBytes(a) {
@@ -47336,11 +47341,11 @@ var ripemd1602 = ripemd160;
47336
47341
  // node_modules/@gvnrdao/dh-sdk/dist/index.mjs
47337
47342
  var import_bech32 = __toESM(require_dist(), 1);
47338
47343
  var import_bs58check = __toESM(require_bs58check(), 1);
47339
- var import_ethers24 = require("ethers");
47340
47344
  var import_ethers25 = require("ethers");
47341
47345
  var import_ethers26 = require("ethers");
47342
47346
  var import_ethers27 = require("ethers");
47343
47347
  var import_ethers28 = require("ethers");
47348
+ var import_ethers29 = require("ethers");
47344
47349
 
47345
47350
  // node_modules/axios/lib/helpers/bind.js
47346
47351
  function bind(fn, thisArg) {
@@ -49415,7 +49420,7 @@ var import_follow_redirects = __toESM(require_follow_redirects(), 1);
49415
49420
  var import_zlib = __toESM(require("zlib"), 1);
49416
49421
 
49417
49422
  // node_modules/axios/lib/env/data.js
49418
- var VERSION = "1.21.0";
49423
+ var VERSION = "1.21.1";
49419
49424
 
49420
49425
  // node_modules/axios/lib/helpers/parseProtocol.js
49421
49426
  function parseProtocol(url2) {
@@ -52916,8 +52921,11 @@ function throwIfCancellationRequested(config) {
52916
52921
  throw new CanceledError_default(null, config);
52917
52922
  }
52918
52923
  }
52919
- function elapsedSince(start) {
52920
- return Math.max(0, Date.now() - start);
52924
+ function resolveClock() {
52925
+ return typeof performance !== "undefined" && utils_default.isFunction(performance.now) ? () => performance.now() : Date.now;
52926
+ }
52927
+ function elapsedSince(now, start) {
52928
+ return Math.max(0, Math.round(now() - start));
52921
52929
  }
52922
52930
  function dispatchRequest(_config) {
52923
52931
  const config = utils_default.toSafeFlatObject(_config);
@@ -52928,11 +52936,12 @@ function dispatchRequest(_config) {
52928
52936
  config.headers.setContentType("application/x-www-form-urlencoded", false);
52929
52937
  }
52930
52938
  const adapter2 = adapters_default.getAdapter(config.adapter || defaults_default.adapter, config);
52931
- const start = Date.now();
52939
+ const now = resolveClock();
52940
+ const start = now();
52932
52941
  return adapter2(config).then(
52933
52942
  function onAdapterResolution(response) {
52934
52943
  throwIfCancellationRequested(config);
52935
- response.duration = elapsedSince(start);
52944
+ response.duration = elapsedSince(now, start);
52936
52945
  config.response = response;
52937
52946
  try {
52938
52947
  response.data = transformData.call(config, config.transformResponse, response);
@@ -52946,7 +52955,7 @@ function dispatchRequest(_config) {
52946
52955
  if (!isCancel(reason)) {
52947
52956
  throwIfCancellationRequested(config);
52948
52957
  if (reason && reason.response) {
52949
- reason.response.duration = elapsedSince(start);
52958
+ reason.response.duration = elapsedSince(now, start);
52950
52959
  config.response = reason.response;
52951
52960
  try {
52952
52961
  reason.response.data = transformData.call(
@@ -53536,16 +53545,17 @@ var {
53536
53545
  } = axios_default;
53537
53546
 
53538
53547
  // node_modules/@gvnrdao/dh-sdk/dist/index.mjs
53539
- var import_ethers29 = require("ethers");
53540
53548
  var import_ethers30 = require("ethers");
53541
53549
  var import_ethers31 = require("ethers");
53542
53550
  var import_ethers32 = require("ethers");
53543
53551
  var import_ethers33 = require("ethers");
53544
53552
  var import_ethers34 = require("ethers");
53545
53553
  var import_ethers35 = require("ethers");
53546
- var import_dh_lit_ops = __toESM(require_dist3(), 1);
53547
53554
  var import_ethers36 = require("ethers");
53548
53555
  var import_ethers37 = require("ethers");
53556
+ var import_dh_lit_ops = __toESM(require_dist3(), 1);
53557
+ var import_ethers38 = require("ethers");
53558
+ var import_ethers39 = require("ethers");
53549
53559
  var __create2 = Object.create;
53550
53560
  var __defProp2 = Object.defineProperty;
53551
53561
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -53643,8 +53653,6 @@ var init_deployment_addresses = __esm2({
53643
53653
  BitcoinProviderRegistry: "0xbfA0c48B070D0a9A9CD27469AeacFD2d4261cEE2",
53644
53654
  ContractVersionRegistry: "0x97E43AA6aFF2C0cf659d3aE501658D2Ef6777522",
53645
53655
  usdcToken: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
53646
- mockUsdcToken: "0x96409A98e0D322d6566b7F44a0fAbD1BD4ce2AEc",
53647
- mockUsdtToken: "0xF8b7fB38b17a310960E47805Be9adba0b0e0394D",
53648
53656
  PositionDelegateRegistry: "0x482369De283622E7b05731875ec137d4E3D208F9",
53649
53657
  FeeRecipientRegistry: "0x95795F8403DDb629E8527B2934C4e71f5fC0C374",
53650
53658
  BitcoinWithdrawalAddressRegistry: "0x6376D392097F0A81e51BD83960A97EA20eaf1dbe",
@@ -53829,10 +53837,10 @@ var init_deployment_addresses = __esm2({
53829
53837
  },
53830
53838
  StUSDCVault: {
53831
53839
  previousImplementation: "0x3619b14C23c5F7d950EF845481C2299939873004",
53832
- newImplementation: "0x3619b14C23c5F7d950EF845481C2299939873004",
53833
- upgradedAt: "2026-10-30T16:50:49.227Z",
53840
+ newImplementation: "0xE94DFBacA21fEFB0BB2e95D33510Ca702d2b6c5f",
53841
+ upgradedAt: "2026-11-08T16:07:36.867Z",
53834
53842
  upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
53835
- reason: "Initial StUSDCVault deployment"
53843
+ reason: "StUSDCVault 1.1.0: Phase 5 desk (linked StUSDCDeskLib 0x0880ce721b0A50C8Fe8d5c911097F0c24e57b6aA)"
53836
53844
  },
53837
53845
  CarryFeeReceiver: {
53838
53846
  previousImplementation: "0x9c43996C6f6BAD82F2A5152AbA61137E929EFA17",
@@ -53897,6 +53905,9 @@ var init_deployment_addresses = __esm2({
53897
53905
  setPKPValidationRegistryTx: "0xab6b7e610c1ecf68da9a1e1150e61631e1f2a945bec12608c8357e03be25c4a5",
53898
53906
  replacedAddress: "0xC8Ca02238fbCDAEbE6dbF804461D43F46F9406F4"
53899
53907
  },
53908
+ libraries: {
53909
+ StUSDCDeskLib: "0x0880ce721b0A50C8Fe8d5c911097F0c24e57b6aA"
53910
+ },
53900
53911
  latestEnv: {
53901
53912
  UCD_TOKEN: "0xdd817Ff47C9b8f81335Ac579895D8EA321Fa86Df",
53902
53913
  UCD_CONTROLLER: "0x360Bde4e489ee94E26601B206932De09EE60FF04",
@@ -53949,8 +53960,6 @@ var init_deployment_addresses = __esm2({
53949
53960
  CONTRACT_VERSION_REGISTRY: "0x97E43AA6aFF2C0cf659d3aE501658D2Ef6777522",
53950
53961
  CONTRACT_VERSION_REGISTRY_IMPL: "0xF3389De4bCeC735e4F6d35b9f71170D96037D1B7",
53951
53962
  USDC_TOKEN: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
53952
- MOCK_USDC_TOKEN: "0x96409A98e0D322d6566b7F44a0fAbD1BD4ce2AEc",
53953
- MOCK_USDT_TOKEN: "0xF8b7fB38b17a310960E47805Be9adba0b0e0394D",
53954
53963
  POSITION_DELEGATE_REGISTRY: "0x482369De283622E7b05731875ec137d4E3D208F9",
53955
53964
  POSITION_DELEGATE_REGISTRY_IMPL: "0xc681c48688cdAA966119E265e4a378ef8Fe0eBcA",
53956
53965
  AGENT_MODULE: "0xefb8C29C1e7e92ed7d81a52dbedaed74e37fe380",
@@ -53965,7 +53974,7 @@ var init_deployment_addresses = __esm2({
53965
53974
  STUCD_VAULT: "0xc04Dd4d6799FFDE57feAfD5B3B1B038827014fd3",
53966
53975
  STUCD_VAULT_IMPL: "0xd596A866ee5273aedaC21BC6e88649E087fC8EcB",
53967
53976
  STUSDC_VAULT: "0x7aBac04d4Bf2b3A63AF363B9527970791346463a",
53968
- STUSDC_VAULT_IMPL: "0x3619b14C23c5F7d950EF845481C2299939873004",
53977
+ STUSDC_VAULT_IMPL: "0xE94DFBacA21fEFB0BB2e95D33510Ca702d2b6c5f",
53969
53978
  CARRY_FEE_RECEIVER: "0x2C8e54f099Cf479182D7c87D76FeD88b4172cdB4",
53970
53979
  CARRY_FEE_RECEIVER_IMPL: "0x3a86A23ff3cd6c26B1Fa2C5aeBAeEEdbF6095D69",
53971
53980
  FEE_RECOGNITION_LEDGER: "0xA5EBfb856fe2b847cC6011B0fe2dB6ACE63D6C3c",
@@ -53997,8 +54006,6 @@ var init_deployment_addresses = __esm2({
53997
54006
  BitcoinProviderRegistry: "0xbfA0c48B070D0a9A9CD27469AeacFD2d4261cEE2",
53998
54007
  ContractVersionRegistry: "0x97E43AA6aFF2C0cf659d3aE501658D2Ef6777522",
53999
54008
  usdcToken: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
54000
- mockUsdcToken: "0x96409A98e0D322d6566b7F44a0fAbD1BD4ce2AEc",
54001
- mockUsdtToken: "0xF8b7fB38b17a310960E47805Be9adba0b0e0394D",
54002
54009
  PositionDelegateRegistry: "0x482369De283622E7b05731875ec137d4E3D208F9",
54003
54010
  FeeRecipientRegistry: "0x95795F8403DDb629E8527B2934C4e71f5fC0C374",
54004
54011
  BitcoinWithdrawalAddressRegistry: "0x6376D392097F0A81e51BD83960A97EA20eaf1dbe",
@@ -56025,7 +56032,7 @@ ${errorReport}`);
56025
56032
  }
56026
56033
  init_debug_logger();
56027
56034
  init_session_signature_cache();
56028
- var import_ethers262 = __require("ethers");
56035
+ var import_ethers282 = __require("ethers");
56029
56036
  var EXPIRED_LOAN_MIN_LIQUIDATION_THRESHOLD_BPS = 11e3;
56030
56037
  var EXPIRED_LOAN_MAX_ESCALATION_ITERATIONS = 365;
56031
56038
  var BASIS_POINTS_DENOMINATOR = 1e4;
@@ -59156,12 +59163,12 @@ ${auth.clientId}`;
59156
59163
  throw new Error(`executeVaultSnapshot requires a positive integer chainId, got ${String(chainId)}`);
59157
59164
  }
59158
59165
  global.ethers = {
59159
- ...import_ethers262.ethers,
59166
+ ...import_ethers282.ethers,
59160
59167
  providers: {
59161
- StaticJsonRpcProvider: import_ethers262.ethers.JsonRpcProvider
59168
+ StaticJsonRpcProvider: import_ethers282.ethers.JsonRpcProvider
59162
59169
  },
59163
- Contract: import_ethers262.ethers.Contract,
59164
- utils: import_ethers262.ethers
59170
+ Contract: import_ethers282.ethers.Contract,
59171
+ utils: import_ethers282.ethers
59165
59172
  // v6 moved utils to top level
59166
59173
  };
59167
59174
  global.Lit = {
@@ -59488,8 +59495,6 @@ function getSepoliaConfig() {
59488
59495
  positionManagerViews: SEPOLIA_CONTRACTS.PositionManagerViews || "",
59489
59496
  simplePsmV2: SEPOLIA_CONTRACTS.SimplePSMV2 || "",
59490
59497
  usdcToken: SEPOLIA_CONTRACTS.usdcToken || "",
59491
- mockUsdcToken: SEPOLIA_CONTRACTS.mockUsdcToken || "",
59492
- mockUsdtToken: SEPOLIA_CONTRACTS.mockUsdtToken || "",
59493
59498
  loanOperationsManager: SEPOLIA_CONTRACTS.LoanOperationsManagerModule || "",
59494
59499
  termManager: SEPOLIA_CONTRACTS.TermManagerModule || "",
59495
59500
  circuitBreaker: SEPOLIA_CONTRACTS.CircuitBreakerModule || "",
@@ -60059,12 +60064,6 @@ function assertFeeCeiling(gasLimit, maxFeePerGas, raise, ceiling = DEFAULT_FEE_C
60059
60064
  );
60060
60065
  }
60061
60066
  }
60062
- var MINT_UCD_GAS_CEILING = BigInt(13e5);
60063
- var WITHDRAW_BTC_GAS_CEILING = BigInt(3e6);
60064
- var MAKE_PAYMENT_GAS_CEILING = BigInt(1e6);
60065
- var EXTEND_POSITION_GAS_CEILING = BigInt(1e6);
60066
- var LIQUIDATION_COMMIT_GAS_CEILING = BigInt(2e6);
60067
- var LIQUIDATION_REVEAL_GAS_CEILING = BigInt(25e5);
60068
60067
  var FEE_HISTORY_BLOCK_COUNT = 20;
60069
60068
  var FEE_HISTORY_REWARD_PERCENTILE = 75;
60070
60069
  function isJsonRpcSendable(provider) {
@@ -61405,6 +61404,39 @@ var ServerSession = class {
61405
61404
  }
61406
61405
  }
61407
61406
  };
61407
+ var GAS_LIMIT_MULTIPLIER_NUMERATOR = 12n;
61408
+ var GAS_LIMIT_MULTIPLIER_DENOMINATOR = 10n;
61409
+ var GAS_LIMIT_HEADROOM = 262500n;
61410
+ var GasLimitCeilingError = class extends Error {
61411
+ constructor(estimate, gasLimit) {
61412
+ super(
61413
+ `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`
61414
+ );
61415
+ this.estimate = estimate;
61416
+ this.gasLimit = gasLimit;
61417
+ this.name = "GasLimitCeilingError";
61418
+ }
61419
+ };
61420
+ var GAS_ESTIMATE_RETRY_MARKER = "no gasLimit can be sized, so nothing was sent \u2014 retry";
61421
+ var GasEstimateUnavailableError = class extends Error {
61422
+ constructor(message, cause) {
61423
+ super(message);
61424
+ this.cause = cause;
61425
+ this.name = "GasEstimateUnavailableError";
61426
+ }
61427
+ retryable = true;
61428
+ };
61429
+ function sizeGasLimit(estimate) {
61430
+ if (estimate <= 0n) {
61431
+ throw new Error(`sizeGasLimit: estimate must be positive, got ${estimate}`);
61432
+ }
61433
+ const scaled = (estimate * GAS_LIMIT_MULTIPLIER_NUMERATOR + GAS_LIMIT_MULTIPLIER_DENOMINATOR - 1n) / GAS_LIMIT_MULTIPLIER_DENOMINATOR;
61434
+ const gasLimit = scaled + GAS_LIMIT_HEADROOM;
61435
+ if (gasLimit > MAX_GAS_LIMIT) {
61436
+ throw new GasLimitCeilingError(estimate, gasLimit);
61437
+ }
61438
+ return gasLimit;
61439
+ }
61408
61440
  var DEAD_ZONE_VIOLATION_SELECTOR = "0xbe4b82c1";
61409
61441
  var ERROR_STRING_SELECTOR = "0x08c379a0";
61410
61442
  var PANIC_SELECTOR = "0x4e487b71";
@@ -61432,13 +61464,13 @@ function decodeQuantumRevert(e) {
61432
61464
  if (!name && selector && data) {
61433
61465
  try {
61434
61466
  if (selector === ERROR_STRING_SELECTOR) {
61435
- const [message] = import_ethers19.AbiCoder.defaultAbiCoder().decode(
61467
+ const [message] = import_ethers20.AbiCoder.defaultAbiCoder().decode(
61436
61468
  ["string"],
61437
61469
  "0x" + data.slice(10)
61438
61470
  );
61439
61471
  name = `Error("${message}")`;
61440
61472
  } else if (selector === PANIC_SELECTOR) {
61441
- const [code] = import_ethers19.AbiCoder.defaultAbiCoder().decode(
61473
+ const [code] = import_ethers20.AbiCoder.defaultAbiCoder().decode(
61442
61474
  ["uint256"],
61443
61475
  "0x" + data.slice(10)
61444
61476
  );
@@ -61461,7 +61493,8 @@ function isRetryableQuantumFailure(message) {
61461
61493
  if (message.includes("Transaction timeout") || message.includes("Transaction confirmation failed") || message.includes("Transaction receipt not found")) {
61462
61494
  return false;
61463
61495
  }
61464
- return RETRYABLE_QUANTUM_ERROR_NAMES.some((name) => message.includes(name)) || message.includes("Transaction reverted");
61496
+ 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.
61497
+ message.includes(GAS_ESTIMATE_RETRY_MARKER);
61465
61498
  }
61466
61499
  var MAX_DEADZONE_RESIMULATIONS = 3;
61467
61500
  var QuantumRevertError = class extends Error {
@@ -61491,54 +61524,105 @@ async function assertSafeQuantumSubmission(opts) {
61491
61524
  ...opts.sleep ? { sleep: opts.sleep } : {},
61492
61525
  ...chainNow ? { chainNow } : {}
61493
61526
  };
61527
+ const tx2 = { to, from, data };
61494
61528
  await awaitSafeSubmissionWindow(quantumTimestamp, gateOpts);
61495
61529
  const SAME_BLOCK_INTERACTION_SELECTOR = "0x3b53d1db";
61496
61530
  const laneGuardActive = opts.laneGuardActive === true;
61531
+ const sigQuantum = Math.floor(quantumTimestamp / QUANTUM_WINDOW_SECONDS2) * QUANTUM_WINDOW_SECONDS2;
61532
+ const sigIsCurrent = () => sigQuantum === Math.floor(now() / QUANTUM_WINDOW_SECONDS2) * QUANTUM_WINDOW_SECONDS2;
61533
+ const resolveStaleHead = async (decoded) => {
61534
+ const deadZoneArtifact = decoded.selector === DEAD_ZONE_VIOLATION_SELECTOR && sigIsCurrent();
61535
+ if (laneGuardActive && (decoded.selector === SAME_BLOCK_INTERACTION_SELECTOR || deadZoneArtifact)) {
61536
+ onDebug(
61537
+ `\u21AA\uFE0F [lane-only] Simulated ${decoded.name ?? decoded.selector} is a stale-latest-block artifact \u2014 mining one block and re-estimating`
61538
+ );
61539
+ await requireSend(provider, "evm_mine on the local lane")("evm_mine", []);
61540
+ return settle2(await estimateOnce(provider, tx2));
61541
+ }
61542
+ if (deadZoneArtifact) {
61543
+ onDebug(
61544
+ "\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"
61545
+ );
61546
+ return settle2(await estimateWithTimeOverride(provider, tx2, now()));
61547
+ }
61548
+ return null;
61549
+ };
61550
+ let estimate;
61497
61551
  for (let sim = 1; ; sim++) {
61498
- try {
61499
- await provider.call({ to, from, data });
61552
+ const outcome = await estimateOnce(provider, tx2);
61553
+ if (outcome.ok) {
61554
+ estimate = outcome.estimate;
61500
61555
  break;
61501
- } catch (simError) {
61502
- const decoded = decodeQuantumRevert(simError);
61503
- if (laneGuardActive && decoded.selector === SAME_BLOCK_INTERACTION_SELECTOR) {
61504
- onDebug(
61505
- "\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"
61506
- );
61507
- break;
61508
- }
61509
- if (decoded.selector === DEAD_ZONE_VIOLATION_SELECTOR && sim <= maxResimulations) {
61510
- const sigQuantum = Math.floor(quantumTimestamp / QUANTUM_WINDOW_SECONDS2) * QUANTUM_WINDOW_SECONDS2;
61511
- const realCurrentQuantum = Math.floor(now() / QUANTUM_WINDOW_SECONDS2) * QUANTUM_WINDOW_SECONDS2;
61512
- if (sigQuantum === realCurrentQuantum) {
61513
- onDebug(
61514
- "\u21AA\uFE0F Simulated DeadZoneViolation is a stale-latest-block artifact (signature is the current quantum) \u2014 proceeding to broadcast"
61515
- );
61516
- break;
61517
- }
61518
- const gate = await awaitSafeSubmissionWindow(quantumTimestamp, gateOpts);
61519
- if (gate.waited) {
61520
- onDebug(
61521
- `\u{1F501} Re-simulating after crossing the quantum boundary (attempt ${sim}/${maxResimulations})`
61522
- );
61523
- continue;
61524
- }
61525
- }
61526
- if (!decoded.data) {
61527
- const label = simError instanceof Error ? simError.message : String(simError);
61556
+ }
61557
+ const resolved = await resolveStaleHead(outcome.decoded);
61558
+ if (resolved !== null) {
61559
+ estimate = resolved;
61560
+ break;
61561
+ }
61562
+ if (outcome.decoded.selector === DEAD_ZONE_VIOLATION_SELECTOR && sim <= maxResimulations) {
61563
+ const gate = await awaitSafeSubmissionWindow(quantumTimestamp, gateOpts);
61564
+ if (gate.waited) {
61528
61565
  onDebug(
61529
- `\u26A0\uFE0F Pre-send simulation failed without revert data (${label}) \u2014 proceeding to broadcast`
61566
+ `\u{1F501} Re-estimating after crossing the quantum boundary (attempt ${sim}/${maxResimulations})`
61530
61567
  );
61531
- break;
61568
+ continue;
61532
61569
  }
61533
- throw new QuantumRevertError(
61534
- decoded.name,
61535
- decoded.selector,
61536
- decoded.data,
61537
- simError
61538
- );
61539
61570
  }
61571
+ settle2(outcome);
61540
61572
  }
61541
- await awaitSafeSubmissionWindow(quantumTimestamp, gateOpts);
61573
+ const finalGate = await awaitSafeSubmissionWindow(quantumTimestamp, gateOpts);
61574
+ if (finalGate.waited) {
61575
+ onDebug("\u{1F501} Re-estimating after the final re-gate waited");
61576
+ const outcome = await estimateOnce(provider, tx2);
61577
+ estimate = outcome.ok ? outcome.estimate : await resolveStaleHead(outcome.decoded) ?? settle2(outcome);
61578
+ }
61579
+ return { estimate, gasLimit: sizeGasLimit(estimate) };
61580
+ }
61581
+ async function estimateOnce(provider, tx2) {
61582
+ return provider.estimateGas(tx2).then(
61583
+ (estimate) => ({ ok: true, estimate }),
61584
+ (error) => ({
61585
+ ok: false,
61586
+ decoded: decodeQuantumRevert(error),
61587
+ error,
61588
+ via: "eth_estimateGas"
61589
+ })
61590
+ );
61591
+ }
61592
+ async function estimateWithTimeOverride(provider, tx2, timeSec) {
61593
+ const via = "eth_estimateGas with a blockOverrides time override";
61594
+ const send = requireSend(provider, via);
61595
+ return send("eth_estimateGas", [tx2, "latest", {}, { time: (0, import_ethers19.toQuantity)(timeSec) }]).then(
61596
+ (raw) => ({ ok: true, estimate: BigInt(raw) }),
61597
+ (error) => ({
61598
+ ok: false,
61599
+ decoded: decodeQuantumRevert(error),
61600
+ error,
61601
+ via
61602
+ })
61603
+ );
61604
+ }
61605
+ function requireSend(provider, purpose) {
61606
+ if (typeof provider.send !== "function") {
61607
+ throw new GasEstimateUnavailableError(
61608
+ `Cannot run ${purpose}: the SDK read provider exposes no JSON-RPC send() (use an ethers JsonRpcProvider)`,
61609
+ null
61610
+ );
61611
+ }
61612
+ return provider.send.bind(provider);
61613
+ }
61614
+ function settle2(outcome) {
61615
+ if (outcome.ok)
61616
+ return outcome.estimate;
61617
+ const { decoded, error, via } = outcome;
61618
+ if (!decoded.data) {
61619
+ const label = error instanceof Error ? error.message : String(error);
61620
+ throw new GasEstimateUnavailableError(
61621
+ `${via} failed without revert data (${label}); ${GAS_ESTIMATE_RETRY_MARKER}`,
61622
+ error
61623
+ );
61624
+ }
61625
+ throw new QuantumRevertError(decoded.name, decoded.selector, decoded.data, error);
61542
61626
  }
61543
61627
  var HARDHAT_CHAIN_IDS = /* @__PURE__ */ new Set([1337, 31337]);
61544
61628
  function laneGuardEnvEnabled() {
@@ -61756,7 +61840,7 @@ var GET_AUTHORIZED_SPENDS_ABI = [
61756
61840
  "function getAuthorizedSpends(bytes32 positionId) view returns (tuple(string txid, uint32 vout, uint256 satoshis, string targetAddress, uint256 targetAmount, uint256 authorizedAt)[])"
61757
61841
  ];
61758
61842
  async function readAuthorizedSpend(params) {
61759
- const authorizer = new import_ethers21.Contract(
61843
+ const authorizer = new import_ethers22.Contract(
61760
61844
  btcSpendAuthorizerAddress(params.chainId),
61761
61845
  GET_AUTHORIZED_SPENDS_ABI,
61762
61846
  params.runner
@@ -61928,7 +62012,7 @@ function hashBtcInputSet(utxos) {
61928
62012
  seen.add(key);
61929
62013
  }
61930
62014
  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("|");
61931
- return (0, import_ethers22.keccak256)((0, import_ethers22.toUtf8Bytes)(canonical));
62015
+ return (0, import_ethers23.keccak256)((0, import_ethers23.toUtf8Bytes)(canonical));
61932
62016
  }
61933
62017
  async function buildBtcExecuteEnvelope(params) {
61934
62018
  const { positionId, txid, vout, satoshis, networkFee, chainId, signer } = params;
@@ -62355,7 +62439,7 @@ function rowToStatus(row) {
62355
62439
  return row;
62356
62440
  }
62357
62441
  async function fetchProtocolPauseStatus(provider, positionManagerAddress) {
62358
- const iface = new import_ethers24.Interface(GET_PROTOCOL_PAUSE_STATUS_ABI);
62442
+ const iface = new import_ethers25.Interface(GET_PROTOCOL_PAUSE_STATUS_ABI);
62359
62443
  const data = iface.encodeFunctionData("getProtocolPauseStatus", []);
62360
62444
  const raw = await provider.call({ to: positionManagerAddress, data });
62361
62445
  const decoded = iface.decodeFunctionResult("getProtocolPauseStatus", raw);
@@ -62545,38 +62629,38 @@ var ContractManager = class {
62545
62629
  }
62546
62630
  const contractRunner = runner;
62547
62631
  const contracts = {
62548
- positionManager: new import_ethers25.Contract(
62632
+ positionManager: new import_ethers26.Contract(
62549
62633
  contractAddresses.positionManager,
62550
62634
  POSITION_MANAGER_ABI,
62551
62635
  contractRunner
62552
62636
  ),
62553
- loanOperationsManager: new import_ethers25.Contract(
62554
- contractAddresses.loanOperationsManager || import_ethers25.ZeroAddress,
62637
+ loanOperationsManager: new import_ethers26.Contract(
62638
+ contractAddresses.loanOperationsManager || import_ethers26.ZeroAddress,
62555
62639
  LOAN_OPS_ABI,
62556
62640
  contractRunner
62557
62641
  ),
62558
- ucdController: new import_ethers25.Contract(
62642
+ ucdController: new import_ethers26.Contract(
62559
62643
  contractAddresses.ucdToken,
62560
62644
  UCD_CONTROLLER_ABI,
62561
62645
  contractRunner
62562
62646
  ),
62563
- termManager: new import_ethers25.Contract(
62564
- contractAddresses.termManager || import_ethers25.ZeroAddress,
62647
+ termManager: new import_ethers26.Contract(
62648
+ contractAddresses.termManager || import_ethers26.ZeroAddress,
62565
62649
  TERM_MANAGER_ABI,
62566
62650
  contractRunner
62567
62651
  ),
62568
- circuitBreaker: new import_ethers25.Contract(
62569
- contractAddresses.circuitBreaker || import_ethers25.ZeroAddress,
62652
+ circuitBreaker: new import_ethers26.Contract(
62653
+ contractAddresses.circuitBreaker || import_ethers26.ZeroAddress,
62570
62654
  CIRCUIT_BREAKER_ABI,
62571
62655
  contractRunner
62572
62656
  ),
62573
- liquidationManager: new import_ethers25.Contract(
62574
- contractAddresses.liquidationManager || import_ethers25.ZeroAddress,
62657
+ liquidationManager: new import_ethers26.Contract(
62658
+ contractAddresses.liquidationManager || import_ethers26.ZeroAddress,
62575
62659
  LIQUIDATION_MANAGER_ABI,
62576
62660
  contractRunner
62577
62661
  ),
62578
- bitcoinWithdrawalAddressRegistry: new import_ethers25.Contract(
62579
- contractAddresses.bitcoinWithdrawalAddressRegistry || import_ethers25.ZeroAddress,
62662
+ bitcoinWithdrawalAddressRegistry: new import_ethers26.Contract(
62663
+ contractAddresses.bitcoinWithdrawalAddressRegistry || import_ethers26.ZeroAddress,
62580
62664
  BITCOIN_WITHDRAWAL_ADDRESS_REGISTRY_ABI,
62581
62665
  contractRunner
62582
62666
  )
@@ -62625,13 +62709,13 @@ var ContractManager = class {
62625
62709
  const address = addresses[key];
62626
62710
  if (!address) {
62627
62711
  missing.push(String(key));
62628
- } else if (!(0, import_ethers25.isAddress)(address)) {
62712
+ } else if (!(0, import_ethers26.isAddress)(address)) {
62629
62713
  invalid.push(String(key));
62630
62714
  }
62631
62715
  }
62632
62716
  for (const key of optionalAddresses) {
62633
62717
  const address = addresses[key];
62634
- if (address && !(0, import_ethers25.isAddress)(address)) {
62718
+ if (address && !(0, import_ethers26.isAddress)(address)) {
62635
62719
  invalid.push(String(key));
62636
62720
  }
62637
62721
  }
@@ -63946,11 +64030,11 @@ var LoanCreator = class {
63946
64030
  try {
63947
64031
  const mainnetVaultAddress = bitcoinAddresses.mainnet;
63948
64032
  const regtestVaultAddress = bitcoinAddresses.regtest;
63949
- const pkpIdBytes32 = (0, import_ethers26.zeroPadValue)(
63950
- (0, import_ethers26.toBeHex)(BigInt(pkpData.tokenId)),
64033
+ const pkpIdBytes32 = (0, import_ethers27.zeroPadValue)(
64034
+ (0, import_ethers27.toBeHex)(BigInt(pkpData.tokenId)),
63951
64035
  32
63952
64036
  );
63953
- const pkpPublicKeyUncompressed = import_ethers26.SigningKey.computePublicKey(
64037
+ const pkpPublicKeyUncompressed = import_ethers27.SigningKey.computePublicKey(
63954
64038
  pkpData.publicKey,
63955
64039
  false
63956
64040
  );
@@ -63963,7 +64047,7 @@ var LoanCreator = class {
63963
64047
  );
63964
64048
  log.debug(`BigInt conversion: ${BigInt(pkpData.tokenId).toString()}`);
63965
64049
  log.debug(
63966
- `Hex from BigInt: ${(0, import_ethers26.toBeHex)(BigInt(pkpData.tokenId))}`
64050
+ `Hex from BigInt: ${(0, import_ethers27.toBeHex)(BigInt(pkpData.tokenId))}`
63967
64051
  );
63968
64052
  log.debug(`Final bytes32 (zero-padded): ${pkpIdBytes32}`);
63969
64053
  log.debug(
@@ -64135,8 +64219,8 @@ var LoanCreator = class {
64135
64219
  }
64136
64220
  }
64137
64221
  if (this.config.debug) {
64138
- const pkpIdBytes32Check = (0, import_ethers26.zeroPadValue)(
64139
- (0, import_ethers26.toBeHex)(BigInt(pkpData.tokenId)),
64222
+ const pkpIdBytes32Check = (0, import_ethers27.zeroPadValue)(
64223
+ (0, import_ethers27.toBeHex)(BigInt(pkpData.tokenId)),
64140
64224
  32
64141
64225
  );
64142
64226
  log.error("\u274C Loan creation transaction failed", {
@@ -64297,7 +64381,7 @@ var LoanCreator = class {
64297
64381
  const coreAddress = this.config.contractManager.getContractAddresses().positionManagerCore;
64298
64382
  if (coreAddress) {
64299
64383
  try {
64300
- const core = new import_ethers26.Contract(
64384
+ const core = new import_ethers27.Contract(
64301
64385
  coreAddress,
64302
64386
  [
64303
64387
  "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))"
@@ -64339,8 +64423,8 @@ var LoanCreator = class {
64339
64423
  const newEventAbi = [
64340
64424
  "event PositionCreated(bytes32 indexed positionId, bytes32 indexed pkpId, address indexed borrower, uint256 requestedCollateralRatio, uint256 selectedTerm, uint256 expiryAt)"
64341
64425
  ];
64342
- const oldIface = new import_ethers26.Interface(oldEventAbi);
64343
- const newIface = new import_ethers26.Interface(newEventAbi);
64426
+ const oldIface = new import_ethers27.Interface(oldEventAbi);
64427
+ const newIface = new import_ethers27.Interface(newEventAbi);
64344
64428
  let positionId;
64345
64429
  if (this.config.debug) {
64346
64430
  log.info("\u{1F50D} Parsing transaction receipt logs", {
@@ -64820,7 +64904,7 @@ var LoanQuery = class {
64820
64904
  const isChipotlePkpId2 = typeof rawId === "string" && isNormalizedChipotlePkpId(rawId);
64821
64905
  if (isChipotlePkpId2) {
64822
64906
  if (this.config.positionManagerCoreAddress && this.config.provider) {
64823
- const pmContract = new import_ethers27.Contract(
64907
+ const pmContract = new import_ethers28.Contract(
64824
64908
  this.config.positionManagerCoreAddress,
64825
64909
  POSITION_CORE_ABI,
64826
64910
  this.config.provider
@@ -64923,7 +65007,7 @@ var LoanQuery = class {
64923
65007
  */
64924
65008
  async getBorrowerUcdDebtSummary(borrower) {
64925
65009
  const trimmed = typeof borrower === "string" ? borrower.trim() : "";
64926
- if (!(0, import_ethers27.isAddress)(trimmed)) {
65010
+ if (!(0, import_ethers28.isAddress)(trimmed)) {
64927
65011
  return failure(
64928
65012
  new SDKError({
64929
65013
  message: `Borrower must be an EVM address for a UCD debt summary, got "${trimmed}"`,
@@ -65198,7 +65282,7 @@ var WithdrawalAddressModule = class {
65198
65282
  if (!res.success)
65199
65283
  return res;
65200
65284
  const target = res.value.target;
65201
- if (!target || target === import_ethers28.ZeroAddress) {
65285
+ if (!target || target === import_ethers29.ZeroAddress) {
65202
65286
  return failure(
65203
65287
  new SDKError({
65204
65288
  code: "SDK_WITHDRAWAL_REGISTRY_NOT_CONFIGURED",
@@ -65220,7 +65304,7 @@ var WithdrawalAddressModule = class {
65220
65304
  * @throws on mixed-case bech32, which has no canonical spelling (BIP-173).
65221
65305
  */
65222
65306
  static addressHash(btcAddress2) {
65223
- return (0, import_ethers28.keccak256)((0, import_ethers28.toUtf8Bytes)(normalizeBitcoinAddress(btcAddress2)));
65307
+ return (0, import_ethers29.keccak256)((0, import_ethers29.toUtf8Bytes)(normalizeBitcoinAddress(btcAddress2)));
65224
65308
  }
65225
65309
  /**
65226
65310
  * The canonical spelling the registry keys on, or a VALIDATION failure for mixed-case
@@ -71300,7 +71384,7 @@ var _abi = [
71300
71384
  ];
71301
71385
  var _bytecode = "0x60a080604052346100ea57306080527ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005460ff8160401c166100d9576002600160401b03196001600160401b03821601610073575b6040516149a190816100f08239608051818181612896015261298f0152f35b6001600160401b0319166001600160401b039081177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005581527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a13880610054565b63f92ee8a960e01b60005260046000fd5b600080fdfe6080604052600436101561001257600080fd5b6000803560e01c8062f7fce91461393b57806301ffc9a7146138ca578063021d2893146138715780630871b20614613838578063114249d214610f7b57806311d954f81461380f57806313da3166146137d65780631d44a9041461372d5780631f77bf65146136f4578063248a9ca3146136d55780632b83cccd146132285780632f2ff15d146131f657806334bac370146131bd57806334e181251461318457806336568abe1461313f578063373c86b6146131065780633f4ba83a1461303f5780634373b572146130165780634451e89b14612c425780634ebd25a514612c095780634f1ef286146129145780635273b6f6146128eb57806352d1902d14612883578063568fafca146127f557806359d5d02a146125485780635bc26aea146125135780635c975abb146124e35780635ecc2708146123c55780638456cb59146122ca57806385c15d9a1461229157806389d3ad00146121d95780638bff608e146121a05780639010d07c1461214d57806390ad8b401461213157806391d14854146120d85780639b759bf7146120955780639baf58d2146120785780639f1d0f59146119bd578063a217fddf146119a1578063a3246ad3146118e4578063ad3cb1cc1461189d578063b492fc69146117b2578063b9f637af14611587578063bf7d911914611548578063c55f15ea14611525578063ca15c873146114ee578063ca2ce65d146114b5578063cc1f8ffa14611483578063cf46075e14611379578063d21a74ff1461133c578063d2f8253614611319578063d511b2891461115c578063d547741f14611121578063d5d3f78b14610fb4578063d66bd52414610f7b578063e1f1c4a714610f5e578063e1f3962c14610f32578063ec2f96fe14610f0e578063eda5a26a14610b11578063f1a1eb8414610ace578063f385116d14610a95578063f77c479114610a6e578063f8c8765e1461067b578063f95ec0461461055f578063faaebd2114610526578063facdfb5e14610377578063fe32e7281461033e5763ffa1ad741461030857600080fd5b3461033b578060031936011261033b57610337610323613b97565b604051918291602083526020830190613b0c565b0390f35b80fd5b503461033b57602036600319011261033b576020906040906001600160a01b03610366613a23565b168152601283522054604051908152f35b503461033b57602036600319011261033b57610391613a23565b610399614059565b6010546001600160a01b03163303610517576001600160a01b03168082526002602052604082205460ff161561050557808252600760205260408220546040516370a0823160e01b8152306004820152602081602481865afa9081156104fa5784916104c3575b50818111156104b4576104138282613c9b565b821590811561045f575b5050600080516020614975833981519152916040918486526007602052808387205582519182526020820152a260016000805160206149158339815191525580f35b61271081029080820461271014901517156104a057606484029184830460641417156104a0571161049157388061041d565b63a73af74d60e01b8452600484fd5b634e487b7160e01b86526011600452602486fd5b6104be8183613c9b565b610413565b90506020813d6020116104f2575b816104de60209383613ab8565b810103126104ed575138610400565b600080fd5b3d91506104d1565b6040513d86823e3d90fd5b6374ed46ad60e01b8252600452602490fd5b6349db3bd360e01b8252600482fd5b503461033b57602036600319011261033b576020906040906001600160a01b0361054e613a23565b168152600483522054604051908152f35b503461033b5761056e36613b5d565b601054909392906001600160a01b0316330361066c576001600160a01b03168083526002602052604083205460ff161561065a57811561064b576001600160a01b0384161561063c5780835260076020526040832054936105cf8386613df7565b85811061062d576001600160ff1b03811161061e576000805160206149758339815191526040869785938461061b9952600760205280838b205582519182526020820152a23091614363565b80f35b630700fcb360e11b8552600485fd5b63446c8cc960e01b8552600485fd5b634e46966960e11b8352600483fd5b63162908e360e11b8352600483fd5b6374ed46ad60e01b8352600452602482fd5b6349db3bd360e01b8352600483fd5b503461033b57608036600319011261033b57610695613a23565b61069d613a39565b6044356001600160a01b03811690818103610a6a576064356001600160a01b0381169390849003610a665760008051602061495583398151915254604081901c60ff161595906001600160401b031680159081610a5e575b6001149081610a54575b159081610a4b575b50610a3c5760008051602061495583398151915280546001600160401b031916600117905585610a17575b6001600160a01b0316908115610a08576001600160a01b03169081156109f95783156109ea576107606145d1565b6107686145d1565b6107706145d1565b6107786145d1565b6001600080516020614915833981519152556107926145d1565b61079a6145d1565b86546001600160a01b0319908116919091178755600180549182168317905560405163313ce56760e01b8152909190602081600481855afa8891816109b9575b506107ee57633a24e95b60e11b8852600488fd5b6001600160a81b03199092161760a091821b60ff60a01b16176001819055901c60ff1660111981016109a75750610825818661448f565b8061097f575b1561093a576108488160008051602061493583398151915261448f565b80610949575b1561093a5761086b9060008051602061485583398151915261448f565b9081610903575b50156108f457806108c9575b506108865780f35b60ff60401b19600080516020614955833981519152541660008051602061495583398151915255600080516020614835833981519152602060405160018152a180f35b601080546001600160a01b03191682179055826000805160206148958339815191528180a33861087e565b63cf5a8e3360e01b8352600483fd5b6109339060008051602061485583398151915286526000805160206147f583398151915260205260408620614617565b5038610872565b63cf5a8e3360e01b8552600485fd5b60008051602061493583398151915286526000805160206147f58339815191526020526109798360408820614617565b5061084e565b8580526000805160206147f58339815191526020526109a18360408820614617565b5061082b565b63167738cf60e21b8652600452602485fd5b6109dc91925060203d6020116109e3575b6109d48183613ab8565b810190613cd8565b90386107da565b503d6109ca565b630b5eba9f60e41b8752600487fd5b63c1ab6dc160e01b8752600487fd5b6336abb4df60e11b8752600487fd5b600080516020614955833981519152805460ff60401b1916600160401b179055610732565b63f92ee8a960e01b8752600487fd5b90501538610707565b303b1591506106ff565b8791506106f5565b8580fd5b8480fd5b503461033b578060031936011261033b57546040516001600160a01b039091168152602090f35b503461033b57602036600319011261033b576020906040906001600160a01b03610abd613a23565b168152600a83522054604051908152f35b503461033b57604036600319011261033b576020906040906001600160a01b03610af6613a23565b16815260158352818120602435825283522054604051908152f35b503461033b5761016036600319011261033b57610b2c613a23565b90606435604435602435610b3e613b4d565b9160a4359160c43560e43561010435916101243595610144359760018060a01b03601054163303610eff576001600160a01b038c16808c52600260205260408c2054909a9060ff16610eeb578a15610edc578615610ecd576127108811610eb3576103e88111610e9b5760ff82169c60128e118e8115610e90575b50610e7c57803b15610e68578915610e54578a15610e405782610bdb916143a7565b84151580610e37575b610e205785151580610e17575b610e00578b9c602460208d9e9d604051928380926370a0823160e01b82523060048301525afa9c8d15610df4579c610dc0575b506001600160ff1b038c11610db1578a8d8f9760408f97838f918f8f8f8f90859f988f99879f966000805160206148b58339815191529f978b9f988f8d6000805160206148158339815191529f988e8e610d699b6000805160206147d58339815191529f8f8f8487526002602052878720600160ff198254161790558487526003602052878720558386526004602052868620558285526006602052878686205582855260056020528585209060ff19825416179055818452600c6020528885852055818452600d6020528985852055818452600e6020528a85852055818452600f6020528b8585205581845260076020528484205582526012602052828220558d8152601360205220558a7f991d1ef1b5c0820d213328cba6682059e00a50e49c469a454eb3557e78eaf6668e80518b81528c6020820152a28c5198899889613e04565b0390a28151908b82526020820152a28151908782526020820152a280610d8d578280f35b6040600080516020614975833981519152918151908582526020820152a281808280f35b63556e7a8160e01b8e5260048efd5b909b506020813d602011610dec575b81610ddc60209383613ab8565b810103126104ed57519a38610c24565b3d9150610dcf565b604051903d90823e3d90fd5b60448c858863dd85772b60e01b8352600452602452fd5b50838610610bf1565b60448c8487637449915760e01b8352600452602452fd5b50828510610be4565b636835314760e11b8d52600160045260248dfd5b636835314760e11b8d5260048d905260248dfd5b63377e3f9960e21b8d5260048c905260248dfd5b63ca95039160e01b8d5260048e905260248dfd5b60069150108e610bb9565b631051834f60e11b8c526004526103e860245260448bfd5b63c1e9a14160e01b8c52600488905261271060245260448cfd5b63a2ec3a5560e01b8c5260048cfd5b63df407ac560e01b8c5260048cfd5b6317f4215b60e21b8c5260048b905260248cfd5b6349db3bd360e01b8b5260048bfd5b503461033b578060031936011261033b57602060ff60015460a01c16604051908152f35b503461033b57602036600319011261033b576020610f56610f51613a23565b613f3c565b604051908152f35b503461033b578060031936011261033b5760206040516127108152f35b503461033b57602036600319011261033b576020906040906001600160a01b03610fa3613a23565b168152600783522054604051908152f35b503461033b57602036600319011261033b57610fce613a23565b6010546001600160a01b03163303610517576001600160a01b03168082526002602052604082205460ff161561050557808252600760205260408220548061110b575080825260026020526040822060ff1981541690558082526003602052816040812055808252600460205281604081205580825260056020526040822060ff198154169055808252600c602052816040812055808252600d602052816040812055808252600e602052816040812055808252600f602052816040812055808252600660205281604081205580825260076020526040822054818352600760205282604081205560405190827f3302a1b37f04242bb55603f5449e7ecd690a35eef08ba1353c48c20e2aae9cda8580a2806110e8578380f35b816040916000805160206149758339815191529352846020820152a23880808380f35b604492916376bc059760e11b8352600452602452fd5b503461033b57604036600319011261033b57611158600435611141613a39565b9061115361114e82613ca8565b6141cf565b614261565b5080f35b503461033b5761116b36613b5d565b601054909392906001600160a01b0316330361066c576001600160a01b03168083526002602052604083205490939060ff161561130557811561064b576011546001600160a01b03169384156112f6576001600160a01b0382169485156112e75760206024916040519283809263babcc53960e01b82528a60048301525afa9081156112dc5785916112ad575b501561129e57808452600760205260408420549483861061128757816000805160206149758339815191526040886112348861061b9a9b613c9b565b848b526007602052828b2055838a526007602052818a205482519182526020820152a2817f96d682bdcb144aea9bb235442364e98309db373ac793e4807c1b36f7062fe0136020604051878152a3614193565b6044858786633cb8e07360e01b8352600452602452fd5b63133307bb60e21b8452600484fd5b6112cf915060203d6020116112d5575b6112c78183613ab8565b810190613d8d565b386111f8565b503d6112bd565b6040513d87823e3d90fd5b634e46966960e11b8552600485fd5b630e048e7160e41b8452600484fd5b6374ed46ad60e01b83526004849052602483fd5b503461033b578060031936011261033b57602060ff600854166040519015158152f35b503461033b57602036600319011261033b5760209060ff906040906001600160a01b03611367613a23565b16815260058452205416604051908152f35b503461033b57602036600319011261033b57611393613a23565b61139b614059565b6010546001600160a01b03163303610517576001600160a01b03168082526002602052604082205460ff161561050557808252600760205260408220546040516370a0823160e01b8152306004820152602081602481865afa9081156104fa578491611443575b50600080516020614975833981519152916040918486526007602052808387205582519182526020820152a260016000805160206149158339815191525580f35b90506020813d60201161147b575b8161145e60209383613ab8565b810103126104ed5751600080516020614975833981519152611402565b3d9150611451565b503461033b57604036600319011261033b5760206114ab6114a2613a23565b60243590613e3d565b6040519015158152f35b503461033b57602036600319011261033b576020906040906001600160a01b036114dd613a23565b168152601383522054604051908152f35b503461033b57602036600319011261033b57604060209160043581526000805160206147f583398151915283522054604051908152f35b503461033b578060031936011261033b576020604051670de0b6b3a76400008152f35b503461033b57602036600319011261033b5760209060ff906040906001600160a01b03611573613a23565b168152600284522054166040519015158152f35b503461033b5761012036600319011261033b576115a2613a23565b60643591906044356024356115b5613b4d565b601054610104359660e4359260c4359260a43592906001600160a01b031633036117a3576001600160a01b038816808a52600260205260408a205490989060ff161561178f578615611780576127108811611766576103e8821161174c5760ff831690601282118015611742575b61172e5783611631916143a7565b85151580611725575b61170e578a151580611705575b6116ee57926000805160206147d583398151915297969592828c956116e8979460408e8e80825260036020528c8383205580825260046020528d838320558152600660205220558b8d52600560205260408d209060ff198254161790558a8c52600c6020528260408d20558a8c52600d6020528360408d20558a8c52600e6020528460408d20558a8c52600f6020528560408d205560405198899889613e04565b0390a280f35b60448a868d63dd85772b60e01b8352600452602452fd5b50848b10611647565b60448a8588637449915760e01b8352600452602452fd5b5083861061163a565b63ca95039160e01b8b52600482905260248bfd5b5060068210611623565b631051834f60e11b8a5260048290526103e860245260448afd5b63c1e9a14160e01b8a52600488905261271060245260448afd5b63a2ec3a5560e01b8a5260048afd5b6374ed46ad60e01b8a52600489905260248afd5b6349db3bd360e01b8952600489fd5b503461033b57604036600319011261033b576117cc613a23565b6001600160a01b0316808252600260205260408220546024359060ff161561188957801561064b5761271061184e604085670de0b6b3a764000061183d6118569688859a52600560205260ff858520541690809160128110611863575b505088845260036020528484205490613bba565b049581526004602052205484613bba565b048092613c9b565b9082519182526020820152f35b611882925060ff61187661187c92613c03565b16613c14565b90613bba565b3880611829565b6374ed46ad60e01b83526004829052602483fd5b503461033b578060031936011261033b5761033760408051906118c08183613ab8565b60058252640352e302e360dc1b602083015251918291602083526020830190613b0c565b503461033b57602036600319011261033b5760043581526000805160206147f583398151915260205260408120604051908160208254918281520190819285526020852090855b81811061198b5750505082611941910383613ab8565b604051928392602084019060208552518091526040840192915b818110611969575050500390f35b82516001600160a01b031684528594506020938401939092019160010161195b565b825484526020909301926001928301920161192b565b503461033b578060031936011261033b57602090604051908152f35b503461033b576119cc36613a5e565b9190926119d7614059565b6119df614095565b33815260096020526040812054430361205657338152600a60205260036040822054101561204757338152600a60205260408120611a1d8154613cc9565b90555b6001600160a01b0382168082526002602052604082205490929060ff16611fa6575b828252600260205260ff60408320541615611f93578415611f84578315611f7557828252600c60205260408220548510611f5057828252600e60205260408220548015611f4157808611611f2a575084611a9b916142a5565b6040516370a0823160e01b8152306004820152602081602481865afa908115611f1f578291611eed575b50611ad285303386614363565b6040516370a0823160e01b8152306004820152602081602481875afa908115611e0457908692918491611eb4575b5090611b0b91613c9b565b10611ea55781815260076020526040812054611b278582613df7565b818110611e96576001600160ff1b038111611e875760408492600080516020614975833981519152928486526007602052808387205582519182526020820152a2818152600560205260ff604082205416849060128110611e26575b50611ba4670de0b6b3a7640000918484526003602052604084205490613bba565b04908281526004602052612710611bbf604083205484613bba565b0491611bcb8382613c9b565b94808610611e0f57506001546040516318160ddd60e01b815290602090829060049082906001600160a01b03165afa908115611e04578391611dd2575b5082546001600160a01b0316803b15611db95783809160846040518094819363ae494fa160e01b83523360048401528c60248401528b60448401528d60648401525af180156104fa57908491611dbd575b505083611d49575b6001546040516318160ddd60e01b81529190602090839060049082906001600160a01b03165afa80156104fa578490611d15575b611c9f9250613c9b565b90808203611cff575050507fb3e2773606abfd36b5bd91394b3a54d1398336c65005baf7bf7a05efeffaf75b611ce2602095604051918291339588429285613d0c565b0390a3600160008051602061491583398151915255604051908152f35b632d8562a360e11b835260045260245260449150fd5b506020823d602011611d41575b81611d2f60209383613ab8565b810103126104ed57611c9f9151611c95565b3d9150611d22565b82546001600160a01b0316803b15611db95783809160846040518094819363ae494fa160e01b83523060048401528a60248401528b60448401528160648401525af180156104fa57908491611da0575b5050611c61565b81611daa91613ab8565b611db5578238611d99565b8280fd5b8380fd5b81611dc791613ab8565b611db5578238611c59565b90506020813d602011611dfc575b81611ded60209383613ab8565b810103126104ed575138611c08565b3d9150611de0565b6040513d85823e3d90fd5b6371c4efed60e01b83526004869052602452604482fd5b611e36915061187660ff91613c03565b8015611e735780600019048511611e6457611ba4611e5d670de0b6b3a76400009287613bba565b9150611b83565b63035fc53d60e41b8252600482fd5b634e487b7160e01b82526012600452602482fd5b630700fcb360e11b8352600483fd5b63446c8cc960e01b8352600483fd5b639bfa3c1760e01b8152600490fd5b919250506020813d602011611ee5575b81611ed160209383613ab8565b810103126104ed5751859190611b0b611b00565b3d9150611ec4565b90506020813d602011611f17575b81611f0860209383613ab8565b810103126104ed575138611ac5565b3d9150611efb565b6040513d84823e3d90fd5b631d7f2ac360e01b83526004869052602452604482fd5b633b5db2f360e11b8352600483fd5b50908152600c6020526040812054630d54e9e160e01b82526004849052602452604490fd5b632cd84af360e01b8252600482fd5b63162908e360e11b8252600482fd5b506024916374ed46ad60e01b8252600452fd5b60405163313ce56760e01b815291939291602081600481865afa859181612026575b50611fdc5763105482c760e21b8552600485fd5b93919293838352600560205260ff8060408520541691169081036120005750611a42565b90506044928252600560205260ff604083205416631e43476360e11b8352600452602452fd5b61204091925060203d6020116109e3576109d48183613ab8565b9038611fc8565b63a74c1c5f60e01b8152600490fd5b3381526009602052436040822055338152600a60205260016040822055611a20565b503461033b578060031936011261033b5760206040516103e88152f35b503461033b57604036600319011261033b576020906040906001600160a01b036120bd613a23565b16815260148352818120602435825283522054604051908152f35b503461033b57604036600319011261033b5760406120f4613a39565b9160043581526000805160206148d5833981519152602052209060018060a01b0316600052602052602060ff604060002054166040519015158152f35b503461033b578060031936011261033b57602060405160648152f35b503461033b57604036600319011261033b5761218760209160043581526000805160206147f58339815191528352604060243591206145ff565b905460405160039290921b1c6001600160a01b03168152f35b503461033b57602036600319011261033b576020906040906001600160a01b036121c8613a23565b168152600983522054604051908152f35b503461033b57604036600319011261033b576121f3613a23565b60105460243591906001600160a01b0316330361066c576001600160a01b03169081156122825760406000805160206148b58339815191529183855260136020528185205490848652601360205280838720558486526015602052828620438752602052828620548587526019602052838720558486526017602052438387205582519182526020820152a280f35b63df407ac560e01b8352600483fd5b503461033b57602036600319011261033b576020906040906001600160a01b036122b9613a23565b168152600383522054604051908152f35b503461033b578060031936011261033b5760008051602061485583398151915281526000805160206148d583398151915260209081526040808320336000908152925290205460ff16156123a057612320614095565b600160ff196000805160206148f58339815191525416176000805160206148f5833981519152557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a16040514281527f80170b5fcdd2bf1e0660ef4b8851f86685f64d41b1a19de1471947ece8725aac60203392a280f35b63e2517d3f60e01b815233600452600080516020614855833981519152602452604490fd5b503461033b57602036600319011261033b576123df613a23565b6000805160206149558339815191525460ff8160401c169081156124cb575b506124bc5760008051602061495583398151915280546001600160481b0319166003600160401b011790558180526000805160206148d583398151915260209081526040808420336000908152925290205460ff16156124a45761246190613da5565b60ff60401b19600080516020614955833981519152541660008051602061495583398151915255600080516020614835833981519152602060405160038152a180f35b63e2517d3f60e01b8252336004526024829052604482fd5b63f92ee8a960e01b8252600482fd5b60036001600160401b039190911610159050386123fe565b503461033b578060031936011261033b57602060ff6000805160206148f583398151915254166040519015158152f35b503461033b57602036600319011261033b5761252d613a23565b6010546001600160a01b031633036105175761061b90613da5565b503461033b57606036600319011261033b57612562613a23565b61256a613a39565b60105490926044359290916001600160a01b031633036105175761258c614095565b6011546001600160a01b03169182156127e65760405163babcc53960e01b81526001600160a01b0386166004820181905293602090829060249082905afa908115611f1f5782916127c7575b50156127b85782156127a9576001546001600160a01b03928316921682036126f9576040516370a0823160e01b8152306004820152602081602481865afa908115611f1f5782916126c7575b50935b84156126b85760001981036126b25750835b84156126a35780851161268b5750506126558360209583614193565b7f0bf519e4b3821615dbdd874fa1a5fbb4bb651b4e6beabedd4ac318e770233b2c604080518581524287820152a3604051908152f35b630555ed4f60e31b8252600485905260245260449150fd5b632e11316f60e11b8252600482fd5b93612639565b63f09872eb60e01b8252600482fd5b90506020813d6020116126f1575b816126e260209383613ab8565b810103126104ed575138612624565b3d91506126d5565b8181526002602052604081205460ff1615612797576040516370a0823160e01b8152306004820152602081602481865afa908115611f1f578291612765575b50828252600760205260408220548082111561275d5761275791613c9b565b93612627565b505080612757565b90506020813d60201161278f575b8161278060209383613ab8565b810103126104ed575138612738565b3d9150612773565b60249163eef7849760e01b8252600452fd5b634e46966960e11b8152600490fd5b63133307bb60e21b8152600490fd5b6127e0915060203d6020116112d5576112c78183613ab8565b386125d8565b630e048e7160e41b8152600490fd5b503461033b57602036600319011261033b5761280f613a23565b6010546001600160a01b03163303610517576001600160a01b0316801561287457601180546001600160a01b0319811683179091556001600160a01b03167f1e9c406f2707909cfd9f61e744f73bcab77e5997d063276f67883c5257d51cf08380a380f35b634e46966960e11b8252600482fd5b503461033b578060031936011261033b577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031630036128dc5760206040516000805160206148758339815191528152f35b63703e46dd60e11b8152600490fd5b503461033b578060031936011261033b576010546040516001600160a01b039091168152602090f35b50604036600319011261033b57612929613a23565b602435906001600160401b038211611db55736602383011215611db5578160040135908361295683613af1565b936129646040519586613ab8565b83855260208501933660248284010111611db557806024602093018637850101526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016308114908115612be6575b50612bd7576010546001600160a01b03163303612bc8576001600160a01b038116928315612bb957813b15612baa576000805160206148758339815191525484612a02613b97565b7f6ea8b34d59b2818d3f37a08dddaa06f5886b9c20c907b36f03ca6528e106e86f612a3860405192604084526040840190613b0c565b4260208401526001600160a01b038516929081900390a36040516352d1902d60e01b8152602081600481895afa879181612b72575b50612a8657634c9c8ce360e01b87526004869052602487fd5b908160008051602061487583398151915288979303612b605750833b15612b4c576001600160a01b0319168117600080516020614875833981519152558491907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8380a2805115612b31576111589382915190845af43d15612b29573d91612b0d83613af1565b92612b1b6040519485613ab8565b83523d85602085013e614753565b606091614753565b5050505034612b3d5780f35b63b398979f60e01b8152600490fd5b634c9c8ce360e01b86526004829052602486fd5b632a87526960e21b8752600452602486fd5b9091506020813d602011612ba2575b81612b8e60209383613ab8565b81010312612b9e57519038612a6d565b8780fd5b3d9150612b81565b636f7c43f160e01b8552600485fd5b63e6c4247b60e01b8552600485fd5b6349db3bd360e01b8452600484fd5b63703e46dd60e11b8452600484fd5b600080516020614875833981519152546001600160a01b031614159050386129ba565b503461033b57602036600319011261033b576020906040906001600160a01b03612c31613a23565b168152600e83522054604051908152f35b503461033b57606036600319011261033b57612c5c613a4f565b6024356001600160401b038111611db557612c7b903690600401613a88565b916044356001600160401b038111610a6a57612c9b903690600401613a88565b6000805160206149558339815191529291925460ff8160401c16908115612ffe575b50612fef5760008051602061495583398151915280546001600160481b0319166002600160401b0117905560008051602061493583398151915286526000805160206148d583398151915260209081526040808820336000908152925290205460ff1615612fca57612d2d6145d1565b612d356145d1565b600160008051602061491583398151915255600b549160ff8316612fbb57818603612fac57612d6386613d28565b92612d716040519485613ab8565b868452601f19612d8088613d28565b01366020860137875b878110612eb7575060019060ff191617600b5515159460ff196008541660ff871617600855865b818110612e1457876000805160206147b5833981519152602089604051908152a160ff60401b19600080516020614955833981519152541660008051602061495583398151915255600080516020614835833981519152602060405160028152a180f35b80886000805160206149758339815191526040612e3c612e37600196888d613d3f565b613d65565b612e4785898c613d3f565b357f8f955fa878b4aae8b1ac37b1ab715307470f2822ceff87e23d33ef1e044814a783612e74888d613d79565b5193898060a01b0316968793848252600660205280838320558482526007602052858383205582519182526020820152a28151908d82526020820152a201612db0565b612ec5612e37828a8a613d3f565b612ed0828689613d3f565b6001600160a01b03909116808b52600260205260408b20549091359060ff1615612f98576103e88111612f805750906020602492604051938480926370a0823160e01b82523060048301525afa8015612f75578a90612f3f575b60019250612f388288613d79565b5201612d89565b509060203d8111612f6e575b612f558183613ab8565b6020826000928101031261033b57509060019151612f2a565b503d612f4b565b6040513d8c823e3d90fd5b631051834f60e11b8b526004526103e860245260448afd5b6351104c5960e01b8b52600482905260248bfd5b63512509d360e11b8752600487fd5b6324d0d1fd60e01b8752600487fd5b63e2517d3f60e01b865233600452600080516020614935833981519152602452604486fd5b63f92ee8a960e01b8652600486fd5b60026001600160401b03919091161015905038612cbd565b503461033b578060031936011261033b576011546040516001600160a01b039091168152602090f35b503461033b578060031936011261033b576010546001600160a01b031633036130f7576000805160206148f58339815191525460ff8116156130e85760ff19166000805160206148f5833981519152557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a16040514281527f107553d8191d85b405879cf752997865edd48d94e20bda4dd27223c94b31a7cc60203392a280f35b638dfc202b60e01b8252600482fd5b6349db3bd360e01b8152600490fd5b503461033b57602036600319011261033b576020906040906001600160a01b0361312e613a23565b168152601683522054604051908152f35b503461033b57604036600319011261033b57613159613a39565b336001600160a01b038216036131755761115890600435614261565b63334bd91960e11b8252600482fd5b503461033b57602036600319011261033b576020906040906001600160a01b036131ac613a23565b168152600c83522054604051908152f35b503461033b57602036600319011261033b576020906040906001600160a01b036131e5613a23565b168152601783522054604051908152f35b503461033b57604036600319011261033b57611158600435613216613a39565b9061322361114e82613ca8565b614219565b503461033b5761323736613a5e565b919092613242614059565b61324a614095565b3381526009602052604081205443036136b357338152600a60205260036040822054101561204757338152600a602052604081206132888154613cc9565b90555b6001600160a01b0382168082526002602052604082205490929060ff16613638575b828252600260205260ff60408320541615611f935760ff6008541615613629578415611f84578315611f7557828252600d60205260408220548086106136125750828252600f60205260408220548015613603578086116135ed575084613313916140bf565b670de0b6b3a76400008402848104670de0b6b3a7640000036135d9578282526003602052604082205461334591613be3565b90828152600560205260ff604082205416601281106135b9575b508281526006602052612710613379604083205484613bba565b04916133858382613c9b565b94808610611e0f5750838252600760205280604083205410613596578382526007602052604082205490808210613587576040826133d3600080516020614975833981519152938895613c9b565b8486526007602052808387205582519182526020820152a26001546040516318160ddd60e01b815290602090829060049082906001600160a01b03165afa908115611f1f578291613551575b5081546001600160a01b0316803b15611db557826040518092633a52b90760e11b82528183816134538d3360048401613cf1565b03925af18015611e045761353c575b506001546040516318160ddd60e01b81529190602090839060049082906001600160a01b03165afa908115611e04578391613506575b6134a29250613c9b565b8581036134ee5750507f8caf04742286d017f9ac3924388e188c73e6e5094311c5e59a61a7ef86dda8bf611ce26020956134dd863387614193565b604051918291339588429285613d0c565b635ab6e2db60e01b8252600486905260245260449150fd5b90506020823d602011613534575b8161352160209383613ab8565b810103126104ed576134a2915190613498565b3d9150613514565b9161354a8160049394613ab8565b9190613462565b90506020813d60201161357f575b8161356c60209383613ab8565b8101031261357b57513861341f565b5080fd5b3d915061355f565b6308aed4ef60e31b8352600483fd5b83825260076020526040822054635960d22160e01b835260045260245260449150fd5b916135cc60ff6118766135d29495613c03565b90613be3565b903861335f565b634e487b7160e01b82526011600452602482fd5b625502a360e91b83526004869052602452604482fd5b636c6ff70d60e11b8352600483fd5b6361767b8560e01b83526004869052602452604482fd5b630df65d9f60e01b8252600482fd5b60405163313ce56760e01b815291939291602081600481865afa859181613692575b5061366e5763105482c760e21b8552600485fd5b93919293838352600560205260ff80604085205416911690810361200057506132ad565b6136ac91925060203d6020116109e3576109d48183613ab8565b903861365a565b3381526009602052436040822055338152600a6020526001604082205561328b565b503461033b57602036600319011261033b576020610f56600435613ca8565b503461033b57602036600319011261033b576020906040906001600160a01b0361371c613a23565b168152600f83522054604051908152f35b503461033b57604036600319011261033b57613747613a23565b60105460243591906001600160a01b0316330361066c576001600160a01b03169081156122825760406000805160206148158339815191529183855260126020528185205490848652601260205280838720558486526014602052828620438752602052828620548587526018602052838720558486526016602052438387205582519182526020820152a280f35b503461033b57602036600319011261033b576020906040906001600160a01b036137fe613a23565b168152600683522054604051908152f35b503461033b578060031936011261033b576001546040516001600160a01b039091168152602090f35b503461033b57602036600319011261033b576020906040906001600160a01b03613860613a23565b168152600d83522054604051908152f35b503461033b57602036600319011261033b5761388b613a4f565b6010546001600160a01b031633036105175760206000805160206147b583398151915291151560ff196008541660ff821617600855604051908152a180f35b503461033b57602036600319011261033b5760043563ffffffff60e01b811680910361357b57602090635a05180f60e01b8114908115613910575b506040519015158152f35b637965db0b60e01b81149150811561392a575b5082613905565b6301ffc9a760e01b14905082613923565b503461033b57604036600319011261033b57613955613a23565b6001600160a01b0316808252600260205260408220546024359060ff161561188957670de0b6b3a7640000810290808204670de0b6b3a76400001490151715613a0f57916139b160409383835260036020528483205490613be3565b91808252600560205260ff8483205416601281106139e6575b5061184e84836127109361185695526006602052205484613bba565b8461185693613a0461271094966135cc60ff61187661184e97613c03565b9593509350506139ca565b634e487b7160e01b83526011600452602483fd5b600435906001600160a01b03821682036104ed57565b602435906001600160a01b03821682036104ed57565b6004359081151582036104ed57565b60609060031901126104ed576004356001600160a01b03811681036104ed57906024359060443590565b9181601f840112156104ed578235916001600160401b0383116104ed576020808501948460051b0101116104ed57565b601f909101601f19168101906001600160401b03821190821017613adb57604052565b634e487b7160e01b600052604160045260246000fd5b6001600160401b038111613adb57601f01601f191660200190565b919082519283825260005b848110613b38575050826000602080949584010152601f8019910116010190565b80602080928401015182828601015201613b17565b6084359060ff821682036104ed57565b60609060031901126104ed576004356001600160a01b03811681036104ed5790602435906044356001600160a01b03811681036104ed5790565b60405190613ba6604083613ab8565b6005825264322e342e3160d81b6020830152565b81810292918115918404141715613bcd57565b634e487b7160e01b600052601160045260246000fd5b8115613bed570490565b634e487b7160e01b600052601260045260246000fd5b60ff166012039060ff8211613bcd57565b8015613c955760009060208110600116604e821060011617613c8d57600a916001915b60018111613c64575082600019048211613c5057500290565b634e487b7160e01b81526011600452602490fd5b92806000190481116135d95760018416613c84575b80029260011c613c37565b80920291613c79565b9050600a0a90565b50600190565b91908203918211613bcd57565b6000526000805160206148d583398151915260205260016040600020015490565b6000198114613bcd5760010190565b908160209103126104ed575160ff811681036104ed5790565b6001600160a01b039091168152602081019190915260400190565b9094939260609260808301968352602083015260408201520152565b6001600160401b038111613adb5760051b60200190565b9190811015613d4f5760051b0190565b634e487b7160e01b600052603260045260246000fd5b356001600160a01b03811681036104ed5790565b8051821015613d4f5760209160051b010190565b908160209103126104ed575180151581036104ed5790565b6001600160a01b03168015613de657601080546001600160a01b0319811683179091556001600160a01b0316600080516020614895833981519152600080a3565b63e6c4247b60e01b60005260046000fd5b91908201809211613bcd57565b94919360e0969360ff929a99989561010088019b885260208801526040870152166060850152608084015260a083015260c08201520152565b6001600160a01b03811660008181526002602052604090205490919060ff16158015613f2f575b8015613f27575b613f155781600052600f6020526040600020548015908115613f1d575b50613f1557613ead926040918251948592839262f7fce960e01b845260048401613cf1565b0381305afa918215613f0957600092613ed5575b506000526007602052604060002054101590565b9091506040813d604011613f01575b81613ef160409383613ab8565b810103126104ed57519038613ec1565b3d9150613ee4565b6040513d6000823e3d90fd5b505050600090565b9050831138613e88565b508215613e6b565b5060ff6008541615613e64565b6001546001600160a01b0391821691168103613fb1576020602491604051928380926370a0823160e01b82523060048301525afa908115613f0957600091613f82575090565b90506020813d602011613fa9575b81613f9d60209383613ab8565b810103126104ed575190565b3d9150613f90565b80600052600260205260ff60406000205416613fcd5750600090565b6040516370a0823160e01b815230600482015290602082602481845afa918215613f0957600092614025575b50600052600760205260406000205480821160001461401e5761401b91613c9b565b90565b5050600090565b90916020823d602011614051575b8161404060209383613ab8565b8101031261033b5750519038613ff9565b3d9150614033565b6002600080516020614915833981519152541461408457600260008051602061491583398151915255565b633ee5aeb560e01b60005260046000fd5b60ff6000805160206148f583398151915254166140ae57565b63d93c066560e01b60005260046000fd5b6001600160a01b0316600081815260136020526040902054801561418e578160005260156020526040600020436000526020526141026040600020549384613df7565b92831061417d5780826000526017602052436040600020541461415f575b831161414357506000526015602052604060002043600052602052604060002055565b925063029359d560e41b60005260045260245260445260646000fd5b5081600052601960205261417860406000205482613df7565b614120565b63446c8cc960e01b60005260046000fd5b505050565b6141c86141cd93926141ba60405194859263a9059cbb60e01b602085015260248401613cf1565b03601f198101845283613ab8565b614434565b565b60008181526000805160206148d58339815191526020908152604080832033845290915290205460ff16156142015750565b63e2517d3f60e01b6000523360045260245260446000fd5b614223828261448f565b918261422e57505090565b60009182526000805160206147f5833981519152602052604090912061425d916001600160a01b031690614617565b5090565b61426b8282614531565b918261427657505090565b60009182526000805160206147f5833981519152602052604090912061425d916001600160a01b031690614680565b6001600160a01b0316600081815260126020526040902054801561418e578160005260146020526040600020436000526020526142e86040600020549384613df7565b92831061417d57808260005260166020524360406000205414614345575b831161432957506000526014602052604060002043600052602052604060002055565b92506319a4e2a760e01b60005260045260245260445260646000fd5b5081600052601860205261435e60406000205482613df7565b614306565b6040516323b872dd60e01b60208201526001600160a01b0392831660248201529290911660448301526064808301939093529181526141cd916141c8608483613ab8565b60405163313ce56760e01b81529190602090839060049082906001600160a01b03165afa60009281614413575b506143ea57631eecbb6560e01b60005260046000fd5b60ff91821691168082036143fc575050565b631e43476360e11b60005260045260245260446000fd5b61442d91935060203d6020116109e3576109d48183613ab8565b91386143d4565b906000602091828151910182855af115613f09576000513d61448657506001600160a01b0381163b155b6144655750565b635274afe760e01b60009081526001600160a01b0391909116600452602490fd5b6001141561445e565b60008181526000805160206148d5833981519152602090815260408083206001600160a01b038616845290915290205460ff1661401e5760008181526000805160206148d5833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19166001179055339291907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a4600190565b60008181526000805160206148d5833981519152602090815260408083206001600160a01b038616845290915290205460ff161561401e5760008181526000805160206148d5833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19169055339291907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9080a4600190565b60ff6000805160206149558339815191525460401c16156145ee57565b631afcd79f60e31b60005260046000fd5b8054821015613d4f5760005260206000200190600090565b6001810190826000528160205260406000205415600014613f15578054600160401b811015613adb5761466b6146548260018794018555846145ff565b819391549060031b91821b91600019901b19161790565b90555491600052602052604060002055600190565b906001820191816000528260205260406000205480151560001461474a576000198101818111613bcd578254600019810191908211613bcd57818103614713575b505050805480156146fd5760001901906146db82826145ff565b8154906000199060031b1b191690555560005260205260006040812055600190565b634e487b7160e01b600052603160045260246000fd5b61473361472361465493866145ff565b90549060031b1c928392866145ff565b9055600052836020526040600020553880806146c1565b50505050600090565b90614779575080511561476857602081519101fd5b63d6bda27560e01b60005260046000fd5b815115806147ab575b61478a575090565b639996b31560e01b60009081526001600160a01b0391909116600452602490fd5b50803b1561478256fe2c0a5f5ab0ba371221bb3612c2d2f90d36566279309f526000c5b354efd1b0658c67aaac7f77de07240e5a9b36dfdccb2a89c438635abbb27a73142d2aa0f629c1f6fe24621ce81ec5827caf0253cadb74709b061630e6b55e8237170593200048b07fab687f450848f1df8a96db08fef7840f53415f18fdc2ec8e9f810f0930c7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d275027301df982f5215b4963a854cf9c73219df80cb6acd8f098189c9480c7bbc360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc17dc5b1290f7495d7f8cc68476e6941aaf510598fa925d0d2720edc8805a846c4460507c21097c15f6883572ebd157a9ee4b1d989a312314e93afd9d2ecd494002dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800cd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033009b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00a49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a006d129bd71f2401cbe77f49f546d7d5f58992faecfca6e51ba06b50b261e83331a164736f6c6343000822000a";
71302
71386
  var isSuperArgs = (xs) => xs.length > 1;
71303
- var SimplePSMV2__factory = class extends import_ethers29.ContractFactory {
71387
+ var SimplePSMV2__factory = class extends import_ethers30.ContractFactory {
71304
71388
  constructor(...args) {
71305
71389
  if (isSuperArgs(args)) {
71306
71390
  super(...args);
@@ -71320,10 +71404,10 @@ var SimplePSMV2__factory = class extends import_ethers29.ContractFactory {
71320
71404
  static bytecode = _bytecode;
71321
71405
  static abi = _abi;
71322
71406
  static createInterface() {
71323
- return new import_ethers29.Interface(_abi);
71407
+ return new import_ethers30.Interface(_abi);
71324
71408
  }
71325
71409
  static connect(address, runner) {
71326
- return new import_ethers29.Contract(address, _abi, runner);
71410
+ return new import_ethers30.Contract(address, _abi, runner);
71327
71411
  }
71328
71412
  };
71329
71413
  var _abi2 = [
@@ -73119,7 +73203,7 @@ var _abi2 = [
73119
73203
  ];
73120
73204
  var _bytecode2 = "0x60a080604052346100ea57306080527ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005460ff8160401c166100d9576002600160401b03196001600160401b03821601610073575b60405161394690816100f082396080518181816112d4015261148b0152f35b6001600160401b0319166001600160401b039081177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005581527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a13880610054565b63f92ee8a960e01b60005260046000fd5b600080fdfe608080604052600436101561001357600080fd5b60003560e01c90816301ffc9a7146124f5575080630d33f3c2146124d15780630f3f4a94146124865780631459457a14611d3e57806318c38b8914611c2d5780631d44454114611b5c5780632106764c14611b35578063248a9ca314611b175780632ec22d4c14611a565780632f0647ce146119db5780632f2ff15d146119aa57806332420744146118d657806336568abe14611890578063392f10871461185a5780633f4ba83a146117625780633f5aadc9146116f35780634f1ef2861461143d57806352340363146113545780635273b6f61461132b57806352d1902d146112c1578063554c4f4b146112315780635bc26aea146111a45780635c975abb146111745780636289d18c146110f35780636711cc0b146110d75780636e852a7814610fd65780637e35bf6e14610fa25780638343f67414610f755780638456cb5914610e7f57806384b0196e14610d545780638c02cabd14610d2b5780638f33527f14610cf15780639010d07c14610c9d57806391d1485414610c435780639b9d30c114610c1a578063a19af3f614610b69578063a217fddf14610b4d578063a3246ad314610a8b578063a878086414610a6f578063ac3c0e3014610962578063ad3cb1cc1461091b578063b3fad63814610876578063b48d36de14610842578063c040b8ae14610726578063c34e9c261461070a578063c86deb31146106ee578063ca15c873146106b5578063d547741f1461067d578063dd71d99a1461063b578063e0922fa11461058e578063efa9b4ae1461051f578063f2f4eb26146104f6578063f68e9553146104cd578063f94f67ab146103f6578063fcc1f21a146102c05763ffa1ad741461028757600080fd5b346102bb5760003660031901126102bb576102b76102a3612780565b6040519182916020835260208301906126d1565b0390f35b600080fd5b346102bb576102ce366126f6565b91926102d8612e42565b6001600160a01b03851692338490036103e657836000526001602052604060002080549160ff8360e01c1660038110156103d0576001036103bf577fc5d5c5bbf10444998e0ea6d4725e79027b574e1c14ec929279e8a9a95c6c6e91948460016103a2946103498b6020998c613385565b818060a01b038316828060a01b03198254161781556103688b82612a4c565b0180546001600160401b031916426001600160401b03161790556001600160a01b0381166000818152600288526040902089905599613179565b6040516001600160401b0390951685526001600160a01b031693a4005b632437e77160e11b60005260046000fd5b634e487b7160e01b600052602160045260246000fd5b62fca64560e31b60005260046000fd5b346102bb5760403660031901126102bb576004356104126125c7565b9061041b612e42565b63ffffffff600554169163ffffffff8116928084109081156104c4575b506104b35760207f6b7727cc9c3df4a29acf0afe01594c1b7e845d20f40f4a14e4c292164a9ed8e19161046a84612e8d565b91610482600863ffffffff845460a01c1617836128c8565b81546001600160e01b031660e09190911b6001600160e01b0319161790556040519485526001600160a01b031693a3005b634346c13160e01b60005260046000fd5b90501584610438565b346102bb5760003660031901126102bb5760206040516000805160206138ba8339815191528152f35b346102bb5760003660031901126102bb576003546040516001600160a01b039091168152602090f35b346102bb5760203660031901126102bb5760043561053b612e42565b61055d61054782612e8d565b9190600163ffffffff825460a01c1617906128c8565b6001600160a01b0316907f812690e0a9dff5bf3add998111b8af5c8299608d859025bfe35662060ab4267d600080a3005b346102bb5760203660031901126102bb576004356001600160401b038116908181036102bb576000546001600160a01b038116330361062a57600160a01b600160e01b0319811660a092831b600160a01b600160e01b031617600055604080519190921c6001600160401b0316815260208101929092527f9c195448332abd01f716db873b329752ea02f19d33f7e311fb0daf082c4edd0391a1005b6349db3bd360e01b60005260046000fd5b346102bb5760203660031901126102bb576001600160a01b0361065c612578565b166000526002602052602060018060a01b0360406000205416604051908152f35b346102bb5760403660031901126102bb576106b360043561069c612562565b906106ae6106a9826128a7565b612d6c565b612dfe565b005b346102bb5760203660031901126102bb5760043560005260008051602061373a8339815191526020526020604060002054604051908152f35b346102bb5760003660031901126102bb57602060405160088152f35b346102bb5760003660031901126102bb57602060405160028152f35b346102bb57610734366126f6565b92909161073f612e42565b6001600160a01b03851693338590036103e65784600052600160205260406000209060ff825460e01c1660038110156103d057600114610831577ff223dc085722c94c84dcf67427e225799be616382a2a484d378f8921c69a2033948461081e936107ad866020988b613385565b80546001600160a01b0319166001600160a01b0383161781556107d08682612a4c565b6001810180546001600160801b031916426001600160401b0316179055805460ff60e01b1916600160e01b1790556001600160a01b0381166000818152600288526040902089905598613179565b6040516001600160401b039091168152a3005b639d2c8fdf60e01b60005260046000fd5b346102bb5760403660031901126102bb57602061086e610860612578565b610868612562565b90612984565b604051908152f35b346102bb5760203660031901126102bb57600060606040516108978161261e565b828152826020820152826040820152015260043560005260046020526080604060002063ffffffff604051916108cc8361261e565b548160018060a01b038216938481528160208201818560a01c16815260606040840193838760c01c168552019460e01c8552604051968752511660208601525116604084015251166060820152f35b346102bb5760003660031901126102bb576102b7604080519061093e8183612639565b60058252640352e302e360dc1b6020830152519182916020835260208301906126d1565b346102bb5760203660031901126102bb5761097b612578565b6000608060405161098b81612603565b828152826020820152826040820152826060820152015260018060a01b0316600052600160205260406000206040516109c381612603565b81546001600160a01b038116825260a081901c6001600160401b03166020830190815292604083019160e01c60ff169060038210156103d057908252600101546001600160401b0380821660608501908152604092831c821660808601908152925194516001600160a01b03168552945116602084015290519260038410156103d057604083019390935291516001600160401b0390811660608301529151909116608082015260a090f35b346102bb5760003660031901126102bb57602060405160018152f35b346102bb5760203660031901126102bb5760043560005260008051602061373a83398151915260205260406000206040518060208354918281520190819360005260206000209060005b818110610b375750505081610aeb910382612639565b6040519182916020830190602084525180915260408301919060005b818110610b15575050500390f35b82516001600160a01b0316845285945060209384019390920191600101610b07565b8254845260209093019260019283019201610ad5565b346102bb5760003660031901126102bb57602060405160008152f35b346102bb5760403660031901126102bb57600435610b856125c7565b90610b8e612e42565b63ffffffff600554169163ffffffff811692808410908115610c11575b506104b35760207f1da95b87b4c773f68c1447ffc5644e41a8a8887d55065beb64852014cf7140be91610bfe610be085612e8d565b9290610bf9600463ffffffff835460a01c1617826128c8565b6127f5565b6040519485526001600160a01b031693a3005b90501584610bab565b346102bb5760003660031901126102bb5760206040516000805160206137fa8339815191528152f35b346102bb5760403660031901126102bb57610c5c612562565b60043560005260008051602061389a83398151915260205260406000209060018060a01b0316600052602052602060ff604060002054166040519015158152f35b346102bb5760403660031901126102bb5760043560005260008051602061373a8339815191526020526020610cd86024356040600020613357565b905460405160039290921b1c6001600160a01b03168152f35b346102bb5760203660031901126102bb576001600160a01b03610d12612578565b1660005260026020526020604060002054604051908152f35b346102bb5760003660031901126102bb5760206040516000805160206137da8339815191528152f35b346102bb5760003660031901126102bb576000805160206137ba833981519152541580610e68575b15610e2b57610dcd610d8c6127a3565b610d946127d6565b6020610ddb60405192610da78385612639565b600084526000368137604051958695600f60f81b875260e08588015260e08701906126d1565b9085820360408701526126d1565b466060850152306080850152600060a085015283810360c085015281808451928381520193019160005b828110610e1457505050500390f35b835185528695509381019392810192600101610e05565b60405162461bcd60e51b81526020600482015260156024820152741152540dcc4c8e88155b9a5b9a5d1a585b1a5e9959605a1b6044820152606490fd5b5060008051602061391a8339815191525415610d7c565b346102bb5760003660031901126102bb573360009081527f0ac8cc3d209806126662940717264973110c39045b305f6ba49613325a615e09602052604090205460ff1615610f4e57610ecf612e42565b600160ff196000805160206138da8339815191525416176000805160206138da833981519152557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a16040514281527f80170b5fcdd2bf1e0660ef4b8851f86685f64d41b1a19de1471947ece8725aac60203392a2005b63e2517d3f60e01b600052336004526000805160206137fa83398151915260245260446000fd5b346102bb5760003660031901126102bb5760005460405160a09190911c6001600160401b03168152602090f35b346102bb5760403660031901126102bb57610fc6610fbe612562565b600435612951565b906102b760405192839283612598565b346102bb5760403660031901126102bb57610fef612578565b33600090815260008051602061383a833981519152602052604090205460ff1615806110c4575b6103e6576001600160a01b03166000818152600160205260409020805460e01c60ff1660038110156103d0576001036103bf57805460ff60e01b198116600160e11b1782556001919091018054600160401b600160801b03191642604090811b600160401b600160801b0316919091179091555160243581526001600160a01b0390911691907fc0499cc07ed9d734deec6857802d3f0fa8d5afaf79a7008beb8ba7bef62a271b90602090a3005b50336001600160a01b0382161415611016565b346102bb5760003660031901126102bb57602060405160048152f35b346102bb5760203660031901126102bb5761110c6125b4565b6000546001600160a01b0316330361062a5763ffffffff81169081156111635760008051602061387a8339815191529161115e63ffffffff926005549284198416176005556040519384931683612818565b0390a1005b6338f3377360e21b60005260046000fd5b346102bb5760003660031901126102bb57602060ff6000805160206138da83398151915254166040519015158152f35b346102bb5760203660031901126102bb576111bd612578565b6000546001600160a01b038116903382900361062a576001600160a01b038316928315611220573b1561120f576001600160a01b0319168217600090815560008051602061385a8339815191529080a3005b636f7c43f160e01b60005260046000fd5b63e6c4247b60e01b60005260046000fd5b346102bb5760203660031901126102bb576001600160a01b03611252612578565b166000526001602052604060002060ff6000805160206138da833981519152541615806112a5575b6020918161128e575b506040519015158152f35b5460a01c6001600160401b03164210905082611283565b5060ff815460e01c169060038210156103d0579060011461127a565b346102bb5760003660031901126102bb577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316300361131a57602060405160008051602061381a8339815191528152f35b63703e46dd60e11b60005260046000fd5b346102bb5760003660031901126102bb576000546040516001600160a01b039091168152602090f35b346102bb5760203660031901126102bb57600435604060008281526004602052209081549160018060a01b03831692831590811561142e575b5061141d5733600090815260008051602061383a833981519152602052604090205460ff161580611413575b61140257806113d563fffffffe6113db935460a01c16826128c8565b82612d48565b7fa5ffbdba01b15df97334e34ad816b9986b6057a5ddc97aba93b7e8ccd21759ed600080a3005b630a606ec360e11b60005260046000fd5b50823314156113b9565b6360eb6c2360e01b60005260046000fd5b6001915060a01c16158461138d565b60403660031901126102bb57611451612578565b6024356001600160401b0381116102bb57366023820112156102bb57611481903690602481600401359101612677565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163081149081156116d0575b5061131a576000546001600160a01b0316330361062a576001600160a01b03821691821561122057803b156116bf573083146116b05760008051602061381a8339815191525483611505612780565b7f6ea8b34d59b2818d3f37a08dddaa06f5886b9c20c907b36f03ca6528e106e86f61153b604051926040845260408401906126d1565b4260208401526001600160a01b038516929081900390a36040516352d1902d60e01b8152602081600481885afa6000918161167c575b5061158b5784634c9c8ce360e01b60005260045260246000fd5b908160008051602061381a8339815191528693036116685750823b15611653576001600160a01b031916811760008051602061381a833981519152557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a2815115611639576000808360206106b395519101845af43d15611631573d916116148361265c565b926116226040519485612639565b83523d6000602085013e61364d565b60609161364d565b50503461164257005b63b398979f60e01b60005260046000fd5b50634c9c8ce360e01b60005260045260246000fd5b632a87526960e21b60005260045260246000fd5b9091506020813d6020116116a8575b8161169860209383612639565b810103126102bb57519086611571565b3d915061168b565b614e8d60eb1b60005260046000fd5b632e07c4bd60e11b60005260046000fd5b60008051602061381a833981519152546001600160a01b031614159050836114b6565b346102bb5760203660031901126102bb5760043561170f612e42565b61173161171b82612e8d565b9190600263ffffffff825460a01c1617906128c8565b6001600160a01b0316907fc2713e691344add4705edc62a0ee5aede95ba66ad68f97316efef9cb50644edd600080a3005b346102bb5760003660031901126102bb5733600090815260008051602061383a833981519152602052604090205460ff161580611845575b611834576000805160206138da8339815191525460ff8116156118235760ff19166000805160206138da833981519152557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a16040514281527f107553d8191d85b405879cf752997865edd48d94e20bda4dd27223c94b31a7cc60203392a2005b638dfc202b60e01b60005260046000fd5b63659a07b360e11b60005260046000fd5b506000546001600160a01b031633141561179a565b346102bb5760403660031901126102bb576102b7611881611879612562565b6004356128eb565b604093919351938493846125da565b346102bb5760403660031901126102bb576118a9612562565b336001600160a01b038216036118c5576106b390600435612dfe565b63334bd91960e11b60005260046000fd5b346102bb5760203660031901126102bb57600435604060008281526004602052209081549160018060a01b03831692831590811561199b575b5061141d5733600090815260008051602061383a833981519152602052604090205460ff161580611991575b611402578061195763fffffff761196a935460a01c16826128c8565b80546001600160e01b0316815582612d48565b7f054490ec6650e07db9b97a06ea31d44cebd44b390c9975a380055e1b4d3cac21600080a3005b508233141561193b565b6008915060a01c16158461190f565b346102bb5760403660031901126102bb576106b36004356119c9612562565b906119d66106a9826128a7565b612db6565b346102bb5760203660031901126102bb57600435611a256119fb82612cd6565b9190611a1163fffffffb825460a01c16826128c8565b805463ffffffff60c01b1916815583612d48565b6001600160a01b0316907f09cb4ec44cdef8489412844b9682f87f7900758fa2bd7e039113e9125e538e0f600080a3005b346102bb5760203660031901126102bb57600435604060008281526004602052209081549160018060a01b038316928315908115611b08575b5061141d5733600090815260008051602061383a833981519152602052604090205460ff161580611afe575b61140257806113d563fffffffd611ad7935460a01c16826128c8565b7fb390ab029eab314bd18190ebe73d7e5c1c336beaa5c83ac22578378dc9ccc405600080a3005b5082331415611abb565b6002915060a01c161584611a8f565b346102bb5760203660031901126102bb57602061086e6004356128a7565b346102bb5760403660031901126102bb576102b7611881611b54612562565b60043561282f565b346102bb5760403660031901126102bb57600435611b786125c7565b63ffffffff600554169063ffffffff811691808310908115611c24575b506104b357611ba383612cd6565b909263ffffffff845460c01c16809260018060a01b03163314159182611c19575b5050611c0857611bf4827e8a218591d4362499c38c38eb1c12e7a7cc97a9068818d1fe6046a42ba4a5ba946127f5565b611c0360405192839283612818565b0390a2005b634e80a40760e11b60005260046000fd5b111590508186611bc4565b90501584611b95565b346102bb5760203660031901126102bb57611c466125b4565b6000805160206138fa8339815191525460ff8160401c16908115611d26575b50611d15576000805160206138fa833981519152805460026001600160401b0319821681179092556000546001600160481b031990911690911791906001600160a01b0316330361062a5763ffffffff1680156111635760408160008051602061387a8339815191529263ffffffff196005541617600555815190600082526020820152a16000805160206138fa8339815191525560008051602061377a833981519152602060405160028152a1005b63f92ee8a960e01b60005260046000fd5b60026001600160401b03919091161015905082611c65565b346102bb5760a03660031901126102bb57611d57612578565b611d5f612562565b604435906001600160a01b0382168083036102bb576064356001600160a01b038116918282036102bb576084356001600160a01b03811695908690036102bb576000805160206138fa83398151915254604081901c60ff161597906001600160401b03168015908161247e575b6001149081612474575b15908161246b575b50611d15576000805160206138fa83398151915280546001600160401b031916600117905587612446575b611e116131e0565b611e196131e0565b611e216131e0565b611e296131e0565b6001600160a01b038116908115611220578315611220578515611220576001600160a01b038716968715611220573b1561120f578584146124355762aa36a74614801561242a575b801561241f575b158061240d575b61120f57611e8e90600061320e565b90816123c6575b501561230b57611eb3906000805160206138ba83398151915261320e565b9081612371575b501561230b57611ed8906000805160206137fa83398151915261320e565b908161231c575b501561230b57600080546001600160a01b0319168217815560008051602061385a8339815191528180a3611f116127a3565b91611f1a6127d6565b91611f236131e0565b611f2b6131e0565b83516001600160401b0381116121e05760008051602061375a83398151915254600181811c91168015612301575b60208210146121c057601f8111612282575b50602094601f8211600114612201579481929394956000926121f6575b50508160011b916000199060031b1c19161760008051602061375a833981519152555b82516001600160401b0381116121e05760008051602061379a83398151915254600181811c911680156121d6575b60208210146121c057601f8111612141575b506020601f82116001146120c057819293946000926120b5575b50508160011b916000199060031b1c19161760008051602061379a833981519152555b60006000805160206137ba83398151915255600060008051602061391a83398151915255801561122057803b1561120f57600380546001600160a01b03191691909117905561207357005b60ff60401b196000805160206138fa83398151915254166000805160206138fa8339815191525560008051602061377a833981519152602060405160018152a1005b015190508480612005565b601f1982169060008051602061379a833981519152600052806000209160005b81811061212957509583600195969710612110575b505050811b0160008051602061379a83398151915255612028565b015160001960f88460031b161c191690558480806120f5565b9192602060018192868b0151815501940192016120e0565b81811115611feb5760008051602061379a833981519152600052601f820160051c7f5f9ce34815f8e11431c7bb75a8e6886a91478f7ffc1dbb0a98dc240fddd76b75602084106121b7575b81601f9101920160051c039060005b8281106121a9575050611feb565b60008282015560010161219b565b6000915061218c565b634e487b7160e01b600052602260045260246000fd5b90607f1690611fd9565b634e487b7160e01b600052604160045260246000fd5b015190508580611f88565b601f1982169560008051602061375a833981519152600052806000209160005b88811061226a57508360019596979810612251575b505050811b0160008051602061375a83398151915255611fab565b015160001960f88460031b161c19169055858080612236565b91926020600181928685015181550194019201612221565b81811115611f6b5760008051602061375a833981519152600052601f820160051c7f42ad5d3e1f2e6e70edcf6d991b8a3023d3fca8047a131592f9edb9fd9b89d57d602084106122f8575b81601f9101920160051c039060005b8281106122ea575050611f6b565b6000828201556001016122dc565b600091506122cd565b90607f1690611f59565b63cf5a8e3360e01b60005260046000fd5b6000805160206137fa83398151915260005260008051602061373a83398151915260205261236a907ffff5b43478fa6840382eb63777e0da6941d320b940e3f70f0ea4780feff9582761348a565b5084611edf565b6000805160206138ba83398151915260005260008051602061373a8339815191526020526123bf907f32d31393d541a265984ec379cddd8b1fcbe5f2b0eb8ad81dddfead454f135eaa61348a565b5086611eba565b6000805260008051602061373a833981519152602052612406907f615f0f9e84155bea8cc509fe18befeb1baf65611e38a6ba60964480fb29dfd4461348a565b5088611e95565b50823b1580611e7f5750843b15611e7f565b50617a694614611e78565b506105394614611e71565b638135316560e01b60005260046000fd5b6000805160206138fa833981519152805460ff60401b1916600160401b179055611e09565b90501589611dde565b303b159150611dd6565b899150611dcc565b346102bb5760403660031901126102bb576102b76124ba6124a5612562565b60043560005260046020526040600020612a75565b6124c38161258e565b604051918183921583612598565b346102bb5760003660031901126102bb57602063ffffffff60055416604051908152f35b346102bb5760203660031901126102bb576004359063ffffffff60e01b82168092036102bb57602091635a05180f60e01b8114908115612537575b5015158152f35b637965db0b60e01b811491508115612551575b5083612530565b6301ffc9a760e01b1490508361254a565b602435906001600160a01b03821682036102bb57565b600435906001600160a01b03821682036102bb57565b600811156103d057565b9015158152604081019291906020906125b08361258e565b0152565b6004359063ffffffff821682036102bb57565b6024359063ffffffff821682036102bb57565b91604091949363ffffffff916060850196151585526125f88161258e565b602085015216910152565b60a081019081106001600160401b038211176121e057604052565b608081019081106001600160401b038211176121e057604052565b601f909101601f19168101906001600160401b038211908210176121e057604052565b6001600160401b0381116121e057601f01601f191660200190565b9291926126838261265c565b916126916040519384612639565b8294818452818301116102bb578281602093846000960137010152565b60005b8381106126c15750506000910152565b81810151838201526020016126b1565b906020916126ea815180928185528580860191016126ae565b601f01601f1916010190565b60806003198201126102bb576004356001600160a01b03811681036102bb57916024356001600160a01b03811681036102bb57916044356001600160401b03811681036102bb57916064356001600160401b0381116102bb57826023820112156102bb576004810135926001600160401b0384116102bb57602484830101116102bb576024019190565b6040519061278f604083612639565b60058252640332e302e360dc1b6020830152565b604051906127b2604083612639565b6015825274111a585b5bdb9912185b991ccb941c9bdd1bd8dbdb605a1b6020830152565b604051906127e5604083612639565b60018252603160f81b6020830152565b805463ffffffff60c01b191660c09290921b63ffffffff60c01b16919091179055565b63ffffffff91821681529116602082015260400190565b600052600460205261284660406000209182612b32565b61284f8161258e565b8061289d57505460e01c63ffffffff6005541681158015612895575b6128885780821061288157505b60019160009190565b9050612878565b5050600090600390600090565b50801561286b565b6000929091508290565b60005260008051602061389a83398151915260205260016040600020015490565b805463ffffffff60a01b191660a09290921b63ffffffff60a01b16919091179055565b919091600052600460205261290560406000209283612bbe565b9161290f8361258e565b826129475763ffffffff9192505460c01c1663ffffffff60055416811580156128955761288857808210612881575060019160009190565b5060009190600090565b906129689160005260046020526040600020612c4a565b6129718161258e565b8061297f5750600190600090565b600091565b6042916040519060208201926000805160206137da833981519152845260018060a01b0316604083015260018060a01b03166060820152606081526129ca608082612639565b5190206129d56136ae565b6129dd613706565b6040519060208201927f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f8452604083015260608201524660808201523060a082015260a08152612a2e60c082612639565b519020906040519161190160f01b8352600283015260228201522090565b8054600160a01b600160e01b03191660a09290921b600160a01b600160e01b0316919091179055565b60ff6000805160206138da8339815191525416612b2b57546001600160a01b038116908115612b235760a01c60021615612b1c5760005260016020526040600020549060ff8260e01c1660038110156103d0578015612b1457600214612b0d574260a083901c6001600160401b03161115612b06576001600160a01b03908116911603612b0157600090565b600790565b5050600690565b5050600590565b505050600490565b5050600390565b505050600290565b5050600190565b60ff6000805160206138da8339815191525416612b2b57546001600160a01b038116908115612b235760a01c60081615612b1c5760005260016020526040600020549060ff8260e01c1660038110156103d0578015612b1457600214612b0d574260a083901c6001600160401b03161115612b06576001600160a01b03908116911603612b0157600090565b60ff6000805160206138da8339815191525416612b2b57546001600160a01b038116908115612b235760a01c60041615612b1c5760005260016020526040600020549060ff8260e01c1660038110156103d0578015612b1457600214612b0d574260a083901c6001600160401b03161115612b06576001600160a01b03908116911603612b0157600090565b60ff6000805160206138da8339815191525416612b2b57546001600160a01b038116908115612b235760a01c60011615612b1c5760005260016020526040600020549060ff8260e01c1660038110156103d0578015612b1457600214612b0d574260a083901c6001600160401b03161115612b06576001600160a01b03908116911603612b0157600090565b6000908152600460205260409020805490916001600160a01b038216918215908115612d39575b5061141d5733600090815260008051602061383a833981519152602052604090205460ff161580612d2f575b61140257565b5081331415612d29565b6004915060a01c161538612cfd565b905460a01c63ffffffff1615612d5b5750565b600052600460205260006040812055565b600081815260008051602061389a8339815191526020908152604080832033845290915290205460ff1615612d9e5750565b63e2517d3f60e01b6000523360045260245260446000fd5b612dc0828261320e565b9182612dcb57505090565b600091825260008051602061373a8339815191526020526040909120612dfa916001600160a01b03169061348a565b5090565b612e0882826132b7565b9182612e1357505090565b600091825260008051602061373a8339815191526020526040909120612dfa916001600160a01b0316906134fb565b60ff6000805160206138da8339815191525416612e5b57565b63d93c066560e01b60005260046000fd5b519064ffffffffff821682036102bb57565b519061ffff821682036102bb57565b801561316857600354604051638d34875560e01b8152600481018390529190600090839060249082906001600160a01b03165afa91821561315c57600092612fb1575b5060808201516001600160a01b03169133839003611402576101200151612ef68161258e565b612eff8161258e565b60038114908115612f9c575b8115612f88575b50612f775781600052600160205260ff60406000205460e01c1660038110156103d057600103612f6657600090815260046020526040902080546001600160a01b0319166001600160a01b03831617815591565b632e68d1d360e21b60005260046000fd5b63e9f6db8560e01b60005260046000fd5b60079150612f958161258e565b1438612f12565b9050612fa78161258e565b6005811490612f0b565b90913d8082843e612fc28184612639565b82019160208184031261313c578051906001600160401b0382116131445701906101a08284031261313957604051926101a084016001600160401b038111858210176131485760409081528351855260208085015190860152838101519085015260608301516001600160401b03811161314457830181601f820112156131445780519061304f8261265c565b9261305d6040519485612639565b82845260208383010111613140579061307c91602080850191016126ae565b606084015260808201516001600160a01b038116810361313c5760808401526130a760a08301612e6c565b60a08401526130b860c08301612e6c565b60c08401526130c960e08301612e7e565b60e08401526130db6101008301612e6c565b610100840152610120820151906008821015613139575061312c916101809161012085015261310d6101408201612e6c565b6101408501526131206101608201612e7e565b61016085015201612e6c565b6101808201529038612ed0565b80fd5b5080fd5b8380fd5b8280fd5b634e487b7160e01b83526041600452602483fd5b6040513d6000823e3d90fd5b637bb0b62160e01b60005260046000fd5b61319b9261318d8361319593969496612984565b923691612677565b9061344e565b5060048110156103d05715918215926131c8575b50506131b757565b63cacba36560e01b60005260046000fd5b6001600160a01b0391821691161415905038806131af565b60ff6000805160206138fa8339815191525460401c16156131fd57565b631afcd79f60e31b60005260046000fd5b600081815260008051602061389a833981519152602090815260408083206001600160a01b038616845290915290205460ff166132b057600081815260008051602061389a833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19166001179055339291907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a4600190565b5050600090565b600081815260008051602061389a833981519152602090815260408083206001600160a01b038616845290915290205460ff16156132b057600081815260008051602061389a833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19169055339291907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9080a4600190565b805482101561336f5760005260206000200190600090565b634e487b7160e01b600052603260045260246000fd5b15801561343d575b611220576001600160a01b031660009081526002602052604090205461342c576001600160401b03164281111561341b5760005460a01c6001600160401b031680151591826133f0575b50506133df57565b63e774e7b560e01b60005260046000fd5b909150428103908111613405571138806133d7565b634e487b7160e01b600052601160045260246000fd5b63efa7aefd60e01b60005260046000fd5b633b53f64f60e21b60005260046000fd5b506001600160a01b0381161561338d565b815191906041830361347f5761347892506020820151906060604084015193015160001a906135ce565b9192909190565b505060009160029190565b60018101908260005281602052604060002054156000146134f3578054600160401b8110156121e0576134de6134c7826001879401855584613357565b819391549060031b91821b91600019901b19161790565b90555491600052602052604060002055600190565b505050600090565b90600182019181600052826020526040600020548015156000146135c55760001981018181116134055782546000198101919082116134055781810361358e575b505050805480156135785760001901906135568282613357565b8154906000199060031b1b191690555560005260205260006040812055600190565b634e487b7160e01b600052603160045260246000fd5b6135ae61359e6134c79386613357565b90549060031b1c92839286613357565b90556000528360205260406000205538808061353c565b50505050600090565b91906fa2a8918ca85bafe22016d0b997e4df60600160ff1b038411613641579160209360809260ff60009560405194855216868401526040830152606082015282805260015afa1561315c576000516001600160a01b038116156136355790600090600090565b50600090600190600090565b50505060009160039190565b90613673575080511561366257602081519101fd5b63d6bda27560e01b60005260046000fd5b815115806136a5575b613684575090565b639996b31560e01b60009081526001600160a01b0391909116600452602490fd5b50803b1561367c565b6136b66127a3565b80519081156136c6576020012090565b50506000805160206137ba8339815191525480156136e15790565b507fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47090565b61370e6127d6565b805190811561371e576020012090565b505060008051602061391a8339815191525480156136e1579056fec1f6fe24621ce81ec5827caf0253cadb74709b061630e6b55e82371705932000a16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d102c7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2a16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d103a16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d1002b26bde9d050a2447879fc2826d068ca8d51a693da5ddde56556964c09fea96875027301df982f5215b4963a854cf9c73219df80cb6acd8f098189c9480c7bbc360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc07966f2ab141347034724e9b2a472c2f77f5cd745aeba27cacba797b8fcb708617dc5b1290f7495d7f8cc68476e6941aaf510598fa925d0d2720edc8805a846cd37bc77615afefc793aa17d75d4249a9b517ba91b0e54a49c9c4a44b3d7e228302dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800edcc084d3dcd65a1f7f23c65c46722faca6953d28e43150a467cf43e5c309238cd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00a16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d101a164736f6c6343000822000a";
73121
73205
  var isSuperArgs2 = (xs) => xs.length > 1;
73122
- var AgentDelegationRegistry__factory = class extends import_ethers30.ContractFactory {
73206
+ var AgentDelegationRegistry__factory = class extends import_ethers31.ContractFactory {
73123
73207
  constructor(...args) {
73124
73208
  if (isSuperArgs2(args)) {
73125
73209
  super(...args);
@@ -73139,10 +73223,10 @@ var AgentDelegationRegistry__factory = class extends import_ethers30.ContractFac
73139
73223
  static bytecode = _bytecode2;
73140
73224
  static abi = _abi2;
73141
73225
  static createInterface() {
73142
- return new import_ethers30.Interface(_abi2);
73226
+ return new import_ethers31.Interface(_abi2);
73143
73227
  }
73144
73228
  static connect(address, runner) {
73145
- return new import_ethers30.Contract(
73229
+ return new import_ethers31.Contract(
73146
73230
  address,
73147
73231
  _abi2,
73148
73232
  runner
@@ -75320,7 +75404,7 @@ var _abi3 = [
75320
75404
  ];
75321
75405
  var _bytecode3 = "0x60a080604052346100ea57306080527ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005460ff8160401c166100d9576002600160401b03196001600160401b03821601610073575b604051615a7e90816100f0823960805181818161197e01526125180152f35b6001600160401b0319166001600160401b039081177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005581527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a13880610054565b63f92ee8a960e01b60005260046000fd5b600080fdfe608080604052600436101561001357600080fd5b60003560e01c90816301ffc9a71461358e57508063033b66ba1461334d5780630d8e6e2c146102be5780630e0b21cc146131b25780631317cb371461300857806316efd94114612fdf5780631ef3a04c14612fb65780631f4cceff14612f9a57806320af137a14612ee657806323be345c14612ebd578063248a9ca314612e9757806329b6eca914612d805780632a6bc2dd14612c1b5780632f2ff15d14612bea57806336568abe14612ba4578063393d92cc14612b7b5780633c2ef15a14612b245780633f4ba83a14612a6b5780634a26bd95146127935780634a54e00a1461276a5780634f1ef286146124ca5780634f27e7fa1461244157806350c1d19d146119fe5780635273b6f6146119d557806352d1902d1461196b57806353f366c7146118e45780635760f2e31461185b57806358ca3941146118295780635bc26aea146117f55780635c975abb146117c5578063650e5cb41461140a5780636aa6c53f1461119a57806371b2f19c1461110057806375b238fc146110d757806376dc71be14611054578063791b98bc1461102b5780638456cb5914610f355780638b1702fc14610f1a5780639010d07c14610ec657806391d1485414610e6c57806392efff1614610de85780639b9d30c114610dbf5780639cfee37f14610d40578063a217fddf14610d24578063a3246ad314610c62578063a69a9ef714610936578063ad3cb1cc14610c1b578063b49cc29514610bf2578063bdc7647214610bd5578063ca15c87314610b9c578063cf786fc014610b2e578063d547741f14610af6578063dc5632531461093b578063e1f1c4a714610936578063e34ad47b1461089c578063eb33b7501461084d578063eb8c8d411461081d578063f2f4eb26146107f4578063f5e95acb14610321578063fd847e01146102f75763ffa1ad74146102be57600080fd5b346102f25760003660031901126102f2576102ee6102da613922565b60405191829160208352602083019061361e565b0390f35b600080fd5b346102f25760203660031901126102f2576040610315600435614d3f565b82519182526020820152f35b346102f2576101203660031901126102f25761033b61368d565b6103436136a3565b906044356001600160a01b038116908190036102f2576064356001600160a01b038116908190036102f2576084356001600160a01b03811692908390036102f25760a4356001600160a01b03811692908390036102f25760c4356001600160a01b038116949093908585036102f25760e4356001600160a01b03811693908490036102f257610104356001600160a01b038116999095908a87036102f257600080516020615a5283398151915254604081901c60ff16159a906001600160401b0316801590816107ec575b60011490816107e2575b1590816107d9575b506107c857600080516020615a5283398151915280546001600160401b03191660011790558a6107a3575b610453615746565b61045b615746565b610463615746565b61046b615746565b610473615746565b60017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f005561049f615746565b6001600160a01b0316908115610792576001600160a01b0316908115610792578215610792578315610792578415610792578515610792578915610792578615610792578b156107925760018060a01b0319600554161760055560018060a01b0319600054161760005560018060a01b0319600154161760015560018060a01b0319600254161760025560018060a01b0319600354161760035560018060a01b0319600454161760045560018060a01b0319600654161760065561056482600061551b565b8061074c575b1561063e5761058782600080516020615a3283398151915261551b565b806106f8575b1561063e576105aa9060008051602061591283398151915261551b565b806106a4575b1561063e576105cd9060008051602061599283398151915261551b565b908161064f575b501561063e57600780546001600160a01b031916831790556040519160006000805160206159d28339815191528180a361060a57005b600080516020615a52833981519152805460ff60401b191690556001815260008051602061597283398151915290602090a1005b63cf5a8e3360e01b60005260046000fd5b60008051602061599283398151915260005260008051602061593283398151915260205261069d907ffff5b43478fa6840382eb63777e0da6941d320b940e3f70f0ea4780feff95827615774565b50836105d4565b6000805160206159128339815191526000526000805160206159328339815191526020526106f2857fdb30a1288f67da8a7b16afbbe7b3c5ab0a7a441f62fe00f878d5fff64f32a697615774565b506105b0565b600080516020615a32833981519152600052600080516020615932833981519152602052610746847f46448fd7a7b40360a1323cb3199d0aafeb92ce905bb512a6bb7d3d3f685cf1b1615774565b5061058d565b6000805260008051602061593283398151915260205261078c847f615f0f9e84155bea8cc509fe18befeb1baf65611e38a6ba60964480fb29dfd44615774565b5061056a565b63e6c4247b60e01b60005260046000fd5b600080516020615a52833981519152805460ff60401b1916600160401b17905561044b565b63f92ee8a960e01b60005260046000fd5b9050158d610420565b303b159150610418565b8c915061040e565b346102f25760003660031901126102f2576000546040516001600160a01b039091168152602090f35b346102f25760003660031901126102f2576060610838614c7d565b90604051921515835260208301526040820152f35b346102f25760603660031901126102f25761088d61087961086c61368d565b6044359060243590614aca565b6040519384936060855260608501906136b9565b91602084015260408301520390f35b346102f25760006108ac366136ed565b825460405163e34ad47b60e01b815260048101939093526024830191909152909190829060449082906001600160a01b03165afa801561092a576102ee91600091610907575b506040519182916020835260208301906136b9565b61092491503d806000833e61091c8183613756565b810190613b5b565b826108f2565b6040513d6000823e3d90fd5b613905565b346102f25760203660031901126102f257600061018060405161095d8161373a565b8281528260208201528260408201526060808201528260808201528260a08201528260c08201528260e08201528261010082015282610120820152826101408201528261016082015201526024600060018060a01b0381541660405192838092638d34875560e01b825260043560048301525afa90811561092a57600091610ad5575b506080810180519091906001600160a01b031615610ac4576101809164ffffffffff60405193849360208552805160208601526020810151604086015260408101516060860152610a4260608201516101a060808801526101c087019061361e565b9360018060a01b0390511660a08601528260a08201511660c08601528260c08201511660e086015261ffff60e0820151166101008601528261010082015116610120860152610a9b610120820151610140870190613680565b826101408201511661016086015261ffff61016082015116828601520151166101a08301520390f35b636ec9be1160e01b60005260046000fd5b610af0913d8091833e610ae88183613756565b810190613a0a565b816109e0565b346102f25760403660031901126102f257610b2c600435610b156136a3565b90610b27610b2282613bf4565b6150c2565b615154565b005b346102f25760203660031901126102f257610b4a600435614942565b9060405191829160408301901515835260406020840152815180915260206060840192019060005b818110610b80575050500390f35b825160ff16845285945060209384019390920191600101610b72565b346102f25760203660031901126102f2576004356000526000805160206159328339815191526020526020604060002054604051908152f35b346102f25760003660031901126102f25760206040516161a88152f35b346102f25760003660031901126102f25760206040516000805160206159128339815191528152f35b346102f25760003660031901126102f2576102ee6040805190610c3e8183613756565b60058252640352e302e360dc1b60208301525191829160208352602083019061361e565b346102f25760203660031901126102f25760043560005260008051602061593283398151915260205260406000206040518060208354918281520190819360005260206000209060005b818110610d0e5750505081610cc2910382613756565b6040519182916020830190602084525180915260408301919060005b818110610cec575050500390f35b82516001600160a01b0316845285945060209384019390920191600101610cde565b8254845260209093019260019283019201610cac565b346102f25760003660031901126102f257602060405160008152f35b346102f2576101603660031901126102f257610144356001600160401b0381116102f257366023820112156102f2576004810135906001600160401b0382116102f25736602483830101116102f2576102ee9160246102da9201610124356101043560e43560c43560a435608435606435604435602435600435613f04565b346102f25760003660031901126102f25760206040516000805160206159928339815191528152f35b346102f25760203660031901126102f2576024602060018060a01b036004541660405192838092634977ff8b60e11b825260043560048301525afa801561092a57602091600091610e3f575b506040519015158152f35b610e5f9150823d8411610e65575b610e578183613756565b810190613cc4565b82610e34565b503d610e4d565b346102f25760403660031901126102f257610e856136a3565b6004356000526000805160206159f283398151915260205260406000209060018060a01b0316600052602052602060ff604060002054166040519015158152f35b346102f25760403660031901126102f2576004356000526000805160206159328339815191526020526020610f0160243560406000206156ec565b905460405160039290921b1c6001600160a01b03168152f35b346102f25760003660031901126102f2576040610315613e12565b346102f25760003660031901126102f2573360009081527f0ac8cc3d209806126662940717264973110c39045b305f6ba49613325a615e09602052604090205460ff161561100457610f85615198565b600160ff19600080516020615a12833981519152541617600080516020615a12833981519152557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a16040514281527f80170b5fcdd2bf1e0660ef4b8851f86685f64d41b1a19de1471947ece8725aac60203392a2005b63e2517d3f60e01b6000523360045260008051602061599283398151915260245260446000fd5b346102f25760003660031901126102f2576005546040516001600160a01b039091168152602090f35b346102f25760003660031901126102f257600054604051633b6e38df60e11b815290602090829060049082906001600160a01b03165afa801561092a576000906110a4575b602090604051908152f35b506020813d6020116110cf575b816110be60209383613756565b810103126102f25760209051611099565b3d91506110b1565b346102f25760003660031901126102f2576020604051600080516020615a328339815191528152f35b346102f25760203660031901126102f25761111961368d565b6007546001600160a01b0316330361118957611133615198565b6001600160a01b0316801561079257600180546001600160a01b0319811683179091553391906001600160a01b03167fa06737e7750a5964f26df32519f3270980324efe72b046924980308f0c0fa45f600080a4005b6349db3bd360e01b60005260046000fd5b346102f25760603660031901126102f2576004356001600160401b0381116102f2576111ca9036906004016137ec565b60243590604435918215928315036102f2576101208201519260088410156113f4576002600094146112ac575b50600c810361127f575061121f6101009164ffffffffff6301e133809384925b015116613be7565b4281111561127057611232904290613e05565b8160011b918083046002149015171561125c571161124d5780f35b6309116a8160e11b8152600490fd5b634e487b7160e01b83526011600452602483fd5b6309116a8160e11b8352600483fd5b62278d0081029080820462278d00149015171561125c576101009164ffffffffff61121f92938492611217565b61010083019064ffffffffff825116421161139057156111f75761018083015164ffffffffff16806113e8575064ffffffffff8060a0850151165b1661ffff60e085015116600c81146000146113b0575064ffffffffff6301e13380925b511682808211156113a75761131e91613e05565b905b8082111561139f5750905b4282116113905762278d008111156113855762278cff1981019081116113715761135790915b42613e05565b1061136257836111f7565b63088502f160e21b8352600483fd5b634e487b7160e01b85526011600452602485fd5b506113578491611351565b63088502f160e21b8552600485fd5b90509061132b565b50508490611320565b62278d0081029080820462278d0014901517156113d45764ffffffffff909261130a565b634e487b7160e01b86526011600452602486fd5b64ffffffffff906112e7565b634e487b7160e01b600052602160045260246000fd5b346102f25760a03660031901126102f2576004356001600160401b0381116102f25761143a9036906004016137ec565b6024356044359160246064359260843593604060018060a01b03600454168151948580926353f366c760e01b82528660048301525afa92831561092a57600093611792575b5060408401805190936127109161149f916001600160581b031690613bd4565b0480861161177a5760018060a01b0360005416602086516024604051809481936375ca21bb60e01b835260048301525afa90811561092a57600091611748575b508082111561173f576114f191613e05565b808610611727575060018060a01b03600154169280519686880197881061171657604051637a3b9c6360e01b8152602081600481895afa90811561092a576000916116e4575b50670de0b6b3a7640000810290808204670de0b6b3a764000014901517156116ce5788116116bd57660775f05a07400083116116ac57662386f26fc10000811161169b5768327cb2734119d3b7a9601e1b881161168a5761159c6020916004946151c2565b946040519384809263100c48d360e21b82525afa91821561092a57600092611651575b50816115cc915185615664565b611640576115db908684615664565b61162f5761ffff60e06115f1876115fa95615235565b94015116613be7565b9061ffff821161161e57608093604051938452602084015260408301526060820152f35b6319a4c60960e21b60005260046000fd5b631300e8bd60e21b60005260046000fd5b63e5cace4160e01b60005260046000fd5b90916020823d602011611682575b8161166c60209383613756565b8101031261167f575051906115cc6115bf565b80fd5b3d915061165f565b638a94304d60e01b60005260046000fd5b63128df78360e01b60005260046000fd5b63e9ec682160e01b60005260046000fd5b63499e798560e01b60005260046000fd5b634e487b7160e01b600052601160045260246000fd5b906020823d60201161170e575b816116fe60209383613756565b8101031261167f57505189611537565b3d91506116f1565b63a421190b60e01b60005260046000fd5b856378279ed960e11b60005260045260245260446000fd5b505060006114f1565b906020823d602011611772575b8161176260209383613756565b8101031261167f575051886114df565b3d9150611755565b856373ab893560e11b60005260045260245260446000fd5b6117b591935060403d6040116117be575b6117ad8183613756565b810190613cdc565b9050918661147f565b503d6117a3565b346102f25760003660031901126102f257602060ff600080516020615a1283398151915254166040519015158152f35b346102f25760203660031901126102f25761180e61368d565b6007546001600160a01b0316330361118957610b2c90613c15565b346102f25760603660031901126102f257604061184d604435602435600435613d00565b825191825215156020820152f35b346102f25760203660031901126102f25761187461368d565b6007546001600160a01b031633036111895761188e615198565b6001600160a01b0316801561079257600580546001600160a01b0319811683179091553391906001600160a01b03167f95b04cc8ee34c3af50f5a566d34239ba1c449c913d700dfe0521073d3b584f41600080a4005b346102f25760203660031901126102f2576024604060018060a01b03600454168151928380926353f366c760e01b825260043560048301525afa90811561092a5760409160009160009161194c575b5082516001600160581b03928316815291166020820152f35b90506119659150823d84116117be576117ad8183613756565b83611933565b346102f25760003660031901126102f2577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031630036119c45760206040516000805160206159b28339815191528152f35b63703e46dd60e11b60005260046000fd5b346102f25760003660031901126102f2576007546040516001600160a01b039091168152602090f35b346102f25760003660031901126102f25760405161034081016001600160401b0381118282101761242b576040526000815260006020820152600060408201526000606082015260006080820152600060a0820152600060c0820152600060e08201526000610100820152600061012082015260006101408201526000610160820152600061018082015260006101a082015260006101c082015260006101e0820152600061020082015260006102208201526000610300820152600061032082015260018060a01b03600054169081151561024082015260018060a01b03600154169182151561026083015260018060a01b0360025416151561028083015260018060a01b0360035416928315156102a084015260018060a01b036004541615156102c084015260018060a01b0360065416918215156102e0850152806123c8575b50610260830151611f46575b506102e0820151611da1575b6102a0820151611d1d575b610340925060ff600080516020615a12833981519152541615156103008301526102e0820151611cc7575b5061032060405191805183526020810151602084015260408101516040840152606081015160608401526080810151608084015260a081015160a084015260c081015160c084015260e081015160e08401526101008101516101008401526101208101516101208401526101408101516101408401526101608101516101608401526101808101516101808401526101a08101516101a08401526101c08101516101c08401526101e08101516101e08401526102008101516102008401526102208101516102208401526102408101511515610240840152610260810151151561026084015261028081015115156102808401526102a081015115156102a08401526102c081015115156102c08401526102e081015115156102e0840152610300810151151561030084015201511515610320820152f35b60206004916040519283809263f609844d60e01b82525afa60009181611cfc575b5015611b8f57151561032082015282611b8f565b611d1691925060203d602011610e6557610e578183613756565b9084611ce8565b6040805163a0eb92e360e01b815293849060049082905afa600081600092611d64575b6103409550611d51575b5050611b64565b6102008401526102208301528380611d4a565b9150506040843d604011611d99575b81611d8060409383613756565b810103126102f257836020610340955191015191611d40565b3d9150611d73565b60405163074e13b960e01b8152602081600481855afa60009181611f12575b50611f07575b50604051633087c5cf60e01b81526201518042046004820152602081602481855afa60009181611ed3575b50611ec8575b506040516285d89b60e21b8152602081600481855afa60009181611e94575b50611e88575b50604051636e252e0160e11b8152602081600481855afa60009181611e54575b50611e48575b50611b59565b61012083015283611e42565b9091506020813d602011611e80575b81611e7060209383613756565b810103126102f257519085611e3c565b3d9150611e63565b61010083015283611e1c565b9091506020813d602011611ec0575b81611eb060209383613756565b810103126102f257519085611e16565b3d9150611ea3565b60e083015283611df7565b9091506020813d602011611eff575b81611eef60209383613756565b810103126102f257519085611df1565b3d9150611ee2565b60c083015283611dc6565b9091506020813d602011611f3e575b81611f2e60209383613756565b810103126102f257519085611dc0565b3d9150611f21565b60405163100c48d360e21b8152602081600481855afa60009181612394575b50612389575b50604051631c42d7b960e21b8152602081600481855afa60009181612355575b5061234a575b50604051637a3b9c6360e01b8152602081600481855afa60009181612316575b5061230b575b50604051636759a85b60e11b8152602081600481855afa600091816122d4575b50916020916004936122c9575b506040516306d136bd60e21b815292839182905afa60009181612295575b5061228a575b506001600160a01b03612019614fe2565b168015611b4d576040516313cf87bf60e21b8152602081600481855afa60009181612256575b5061224a575b5060405163d5abeb0160e01b8152602081600481855afa60009181612216575b5061220a575b5060405162d5c44360e41b8152602081600481855afa600091816121d6575b506121ca575b50604051630b5570e560e31b8152602081600481855afa60009181612196575b5061218a575b506040516362680e4b60e01b8152602081600481855afa60009181612153575b5091602091600493612147575b5060405163d3303e4160e01b815292839182905afa60009181612113575b5015611b4d576101e083015283611b4d565b9091506020813d60201161213f575b8161212f60209383613756565b810103126102f257519085612101565b3d9150612122565b6101c0860152866120e3565b9150916020823d602011612182575b8161216f60209383613756565b810103126102f2579051909160046120d6565b3d9150612162565b6101a0840152846120b6565b9091506020813d6020116121c2575b816121b260209383613756565b810103126102f2575190866120b0565b3d91506121a5565b61018084015284612090565b9091506020813d602011612202575b816121f260209383613756565b810103126102f25751908661208a565b3d91506121e5565b6101608401528461206b565b9091506020813d602011612242575b8161223260209383613756565b810103126102f257519086612065565b3d9150612225565b61014084015284612045565b9091506020813d602011612282575b8161227260209383613756565b810103126102f25751908661203f565b3d9150612265565b60a083015283612008565b9091506020813d6020116122c1575b816122b160209383613756565b810103126102f257519085612002565b3d91506122a4565b608086015286611fe4565b9150916020823d602011612303575b816122f060209383613756565b810103126102f257905190916004611fd7565b3d91506122e3565b606084015284611fb7565b9091506020813d602011612342575b8161233260209383613756565b810103126102f257519086611fb1565b3d9150612325565b604084015284611f91565b9091506020813d602011612381575b8161237160209383613756565b810103126102f257519086611f8b565b3d9150612364565b602084015284611f6b565b9091506020813d6020116123c0575b816123b060209383613756565b810103126102f257519086611f65565b3d91506123a3565b602060049160405192838092633b6e38df60e11b82525afa600091816123f7575b5015611b4157835284611b41565b9091506020813d602011612423575b8161241360209383613756565b810103126102f2575190866123e9565b3d9150612406565b634e487b7160e01b600052604160045260246000fd5b346102f25760203660031901126102f25761245a61368d565b6007546001600160a01b0316330361118957612474615198565b6001600160a01b0316801561079257600680546001600160a01b0319811683179091553391906001600160a01b03167f8550087a253262ad1d569902c213043016c8e75d5a0dfcf70c0473c8e67eab50600080a4005b60403660031901126102f2576124de61368d565b6024356001600160401b0381116102f257366023820112156102f25761250e903690602481600401359101613794565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016308114908115612747575b506119c4576007546001600160a01b03163303611189576001600160a01b03821691821561079257803b15612736576000805160206159b2833981519152548361258b613922565b7f6ea8b34d59b2818d3f37a08dddaa06f5886b9c20c907b36f03ca6528e106e86f6125c16040519260408452604084019061361e565b4260208401526001600160a01b038516929081900390a36040516352d1902d60e01b8152602081600481885afa60009181612702575b506126115784634c9c8ce360e01b60005260045260246000fd5b90816000805160206159b28339815191528693036126ee5750823b156126d9576001600160a01b03191681176000805160206159b2833981519152557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a28151156126bf57600080836020610b2c95519101845af43d156126b7573d9161269a83613779565b926126a86040519485613756565b83523d6000602085013e6158b0565b6060916158b0565b5050346126c857005b63b398979f60e01b60005260046000fd5b50634c9c8ce360e01b60005260045260246000fd5b632a87526960e21b60005260045260246000fd5b90916020823d60201161272e575b8161271d60209383613756565b8101031261167f57505190866125f7565b3d9150612710565b636f7c43f160e01b60005260046000fd5b6000805160206159b2833981519152546001600160a01b03161415905083612543565b346102f25760003660031901126102f2576004546040516001600160a01b039091168152602090f35b346102f2576127a1366136ed565b808015612a5a57603210612a52575b600054604051633b6e38df60e11b81526001600160a01b03909116929091602083600481875afa92831561092a57600093612a1e575b506040519063e34ad47b60e01b82528260048301526024820152600081604481875afa90811561092a57600091612a03575b5061282581518093613be7565b9361282f83613945565b9261283d6040519485613756565b808452601f1961284c82613945565b0160005b8181106129d057505060009260005b8281106129045750505050815260405191606083016060845282518091526080840190602060808260051b8701019401916000905b8282106128af57505050508293602084015260408301520390f35b90919294602080600192607f198a820301855288519081518152606060ff816128e586860151608088870152608086019061361e565b9460408101516040860152015116910152970192019201909291612894565b61290e8183613c81565b519060405191638d34875560e01b83526004830152600082602481885afa91821561092a576000926129b5575b50604082015180612952575b50600191500161285f565b82519661012060608501519401519360088510156113f4576001946129ae9360ff926040519b6129818d61371f565b8c5260208c015260408b015216606089015261299c81613c95565b976129a7828b613c81565b5288613c81565b5089612947565b6129c991923d8091833e610ae88183613756565b908961293b565b6020906040516129df8161371f565b60008152606083820152600060408201526000606082015282828901015201612850565b612a1891503d806000833e61091c8183613756565b84612818565b9092506020813d602011612a4a575b81612a3a60209383613756565b810103126102f2575191846127e6565b3d9150612a2d565b5060326127b0565b63162908e360e11b60005260046000fd5b346102f25760003660031901126102f2576007546001600160a01b0316330361118957600080516020615a128339815191525460ff811615612b135760ff1916600080516020615a12833981519152557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a16040514281527f107553d8191d85b405879cf752997865edd48d94e20bda4dd27223c94b31a7cc60203392a2005b638dfc202b60e01b60005260046000fd5b346102f25760203660031901126102f257600054604051631e1778ad60e11b8152600480359082015290602090829060249082906001600160a01b03165afa801561092a576000906110a457602090604051908152f35b346102f25760003660031901126102f2576001546040516001600160a01b039091168152602090f35b346102f25760403660031901126102f257612bbd6136a3565b336001600160a01b03821603612bd957610b2c90600435615154565b63334bd91960e11b60005260046000fd5b346102f25760403660031901126102f257610b2c600435612c096136a3565b90612c16610b2282613bf4565b61510c565b346102f25760203660031901126102f257612c3461368d565b60008054604051632a6bc2dd60e01b81526001600160a01b0393841660048201529192168282602481845afa91821561092a57600092612d63575b5081516032811115612d5d57506032905b60005b828110612cad57612ca384866040519283926040845260408401906136b9565b9060208301520390f35b612cb78185613c81565b5160405190638d34875560e01b82526004820152600081602481865afa801561092a5761012091600091612d44575b50015160088110156113f457600281149060008215612d39575b8215612d2a575b5050612d16575b600101612c83565b93612d22600191613c95565b949050612d0e565b9091506113f457158680612d07565b600182149250612d00565b612d57913d8091833e610ae88183613756565b87612ce6565b90612c80565b612d799192503d806000833e61091c8183613756565b9083612c6f565b346102f25760203660031901126102f257612d9961368d565b600080516020615a528339815191525460ff8160401c16908115612e7f575b506107c857600080516020615a5283398151915280546001600160481b0319166002600160401b011790553360009081527fb7db2dd08fcb62d0c9e08c51941cae53c267786a0b75803fb7960902fc8ef97d602052604090205460ff1615612e6557612e2390613c15565b60ff60401b19600080516020615a528339815191525416600080516020615a5283398151915255600080516020615972833981519152602060405160028152a1005b63e2517d3f60e01b60005233600452600060245260446000fd5b60026001600160401b03919091161015905082612db8565b346102f25760203660031901126102f2576020612eb5600435613bf4565b604051908152f35b346102f25760003660031901126102f2576002546040516001600160a01b039091168152602090f35b346102f25760203660031901126102f257612eff61368d565b60008054604051632a6bc2dd60e01b81526001600160a01b0393841660048201529283916024918391165afa90811561092a57600091612f7f575b50516032811115612f795760325b61271081029080820461271014901517156116ce576161a801806161a8116116ce5760409182519182526020820152f35b80612f48565b612f9491503d806000833e61091c8183613756565b81612f3a565b346102f25760003660031901126102f257602060405160328152f35b346102f25760003660031901126102f2576003546040516001600160a01b039091168152602090f35b346102f25760003660031901126102f2576006546040516001600160a01b039091168152602090f35b346102f25760203660031901126102f257600061010060405161302a81613703565b8281528260208201528260408201528260608201528260808201528260a08201528260c08201528260e082015201526024600060018060a01b0381541660405192838092638d34875560e01b825260043560048301525afa90811561092a57600091613199575b508051602082015190604083015160018060a01b036080850151169364ffffffffff60a0820151169064ffffffffff60c0820151169561ffff60e08301511661012064ffffffffff610100850151169301519460088610156113f4576101209864ffffffffff809661ffff9582946131979b6040519061311082613703565b8152602081019d8e5260408101918252606081019283526080810193845260a0810195865260c0810197885260e08101998a5261010081019b8c5260206040519e8f92518352519101525160408d015260018060a01b0390511660608c0152511660808a0152511660a0880152511660c0860152511660e084015251610100830190613680565bf35b6131ac913d8091833e610ae88183613756565b81613091565b346102f25760003660031901126102f25760048054604051630382c87360e21b81529160009183919082906001600160a01b03165afa801561092a57600080928192613262575b5091906040519283926060840160608552825180915260206080860193019060005b818110613249575050508161323b91856102ee9594036020870152613643565b908382036040850152613643565b825185528796506020948501949092019160010161321b565b915091503d8083833e6132758183613756565b8101906060818303126133495780516001600160401b0381116133455781019180601f84011215613345578251926132ac84613945565b936132ba6040519586613756565b80855260208086019160051b8301019183831161334157602001905b8282106133315750505060208201516001600160401b03811161332d57816132ff918401613970565b604083015190926001600160401b038211613329576133219394955001613970565b9091836131f9565b8580fd5b8480fd5b81518152602091820191016132d6565b8680fd5b8380fd5b8280fd5b346102f25760003660031901126102f2576040516101c08101906001600160401b0382118183101761242b576101c0916040526000815260208101906000825260408101600081526060820160008152608083016000815260a084016000815260c085016000815260e08601600081526101008701916000835261012088019360008552610140890195600087526101608a0197600089526101808b019960008b526101a08c019b60008d528d61341a60018060a01b036005541661341181614e42565b15158452614ea4565b15159052600054613433906001600160a01b0316614e42565b1515825260015461344c906001600160a01b0316614e42565b15158352600254613465906001600160a01b0316614e42565b1515845260035461347e906001600160a01b0316614e42565b15158552600654613497906001600160a01b0316614e42565b151586526004546134b0906001600160a01b0316614e42565b15158a526134c46134bf614ede565b614e42565b15158b526134d36134bf614f6c565b15158c526134e26134bf614fa7565b15158d526134f16134bf614fe2565b151587526135006134bf615050565b1515885261350f6134bf615089565b1515895260206040519e8f92511515835251151591015251151560408d015251151560608c015251151560808b015251151560a08a015251151560c089015251151560e08801525115156101008701525115156101208601525115156101408501525115156101608401525115156101808301525115156101a0820152f35b346102f25760203660031901126102f2576004359063ffffffff60e01b82168092036102f257602091635a05180f60e01b81149081156135d0575b5015158152f35b637965db0b60e01b8114915081156135ea575b50836135c9565b6301ffc9a760e01b149050836135e3565b60005b83811061360e5750506000910152565b81810151838201526020016135fe565b90602091613637815180928185528580860191016135fb565b601f01601f1916010190565b906020808351928381520192019060005b8181106136615750505090565b82516001600160581b0316845260209384019390920191600101613654565b9060088210156113f45752565b600435906001600160a01b03821682036102f257565b602435906001600160a01b03821682036102f257565b906020808351928381520192019060005b8181106136d75750505090565b82518452602093840193909201916001016136ca565b60409060031901126102f2576004359060243590565b61012081019081106001600160401b0382111761242b57604052565b608081019081106001600160401b0382111761242b57604052565b6101a081019081106001600160401b0382111761242b57604052565b601f909101601f19168101906001600160401b0382119082101761242b57604052565b6001600160401b03811161242b57601f01601f191660200190565b9291926137a082613779565b916137ae6040519384613756565b8294818452818301116102f2578281602093846000960137010152565b359064ffffffffff821682036102f257565b359061ffff821682036102f257565b9190916101a0818403126102f257604051906138078261373a565b8193813583526020820135602084015260408201356040840152606082013560018060401b0381116102f25782019080601f830112156102f25781602061385093359101613794565b606083015260808101356001600160a01b03811681036102f257608083015261387b60a082016137cb565b60a083015261388c60c082016137cb565b60c083015261389d60e082016137dd565b60e08301526138af61010082016137cb565b6101008301526101208101359060088210156102f2576101806139009181936101208601526138e161014082016137cb565b6101408601526138f461016082016137dd565b610160860152016137cb565b910152565b346102f25760003660031901126102f25760206040516127108152f35b60405190613931604083613756565b6005825264312e312e3360d81b6020830152565b6001600160401b03811161242b5760051b60200190565b51906001600160581b03821682036102f257565b9080601f830112156102f257815161398781613945565b926139956040519485613756565b81845260208085019260051b8201019283116102f257602001905b8282106139bd5750505090565b602080916139ca8461395c565b8152019101906139b0565b51906001600160a01b03821682036102f257565b519064ffffffffff821682036102f257565b519061ffff821682036102f257565b6020818303126102f2578051906001600160401b0382116102f257016101a0818303126102f25760405191613a3e8361373a565b81518352602080830151908401526040808301519084015260608201516001600160401b0381116102f257820181601f820112156102f2578051613a8181613779565b92613a8f6040519485613756565b818452602082840101116102f257613aad91602080850191016135fb565b6060830152613abe608082016139d5565b6080830152613acf60a082016139e9565b60a0830152613ae060c082016139e9565b60c0830152613af160e082016139fb565b60e0830152613b0361010082016139e9565b61010083015261012081015160088110156102f257613b529161018091610120850152613b3361014082016139e9565b610140850152613b4661016082016139fb565b610160850152016139e9565b61018082015290565b6020818303126102f2578051906001600160401b0382116102f257019080601f830112156102f2578151613b8e81613945565b92613b9c6040519485613756565b81845260208085019260051b8201019283116102f257602001905b828210613bc45750505090565b8151815260209182019101613bb7565b818102929181159184041417156116ce57565b919082018092116116ce57565b6000526000805160206159f283398151915260205260016040600020015490565b6001600160a01b038116908115610792573b1561273657600780546001600160a01b0319811683179091556001600160a01b03166000805160206159d2833981519152600080a3565b805115613c6b5760200190565b634e487b7160e01b600052603260045260246000fd5b8051821015613c6b5760209160051b010190565b60001981146116ce5760010190565b8115613cae570490565b634e487b7160e01b600052601260045260246000fd5b908160209103126102f2575180151581036102f25790565b91908260409103126102f257613cfd6020613cf68461395c565b930161395c565b90565b60008054604051638d34875560e01b81526004810193909352929392829060249082906001600160a01b03165afa90811561092a57600091613dea575b5060808101516001600160a01b031615610ac45760400151908115613ddf57613d6e92613d69916151c2565b615235565b60015460405163100c48d360e21b815291929190602090829060049082906001600160a01b03165afa90811561092a57600091613dad575b5082101590565b90506020813d602011613dd7575b81613dc860209383613756565b810103126102f2575138613da6565b3d9150613dbb565b505050600090600190565b613dff91503d806000833e610ae88183613756565b38613d3d565b919082039182116116ce57565b6006546001600160a01b0316908115613ed757604051636e252e0160e11b8152602081600481865afa90811561092a57600091613ea4575b50602060049193604051928380926285d89b60e21b82525afa90811561092a57600091613e75575090565b90506020813d602011613e9c575b81613e9060209383613756565b810103126102f2575190565b3d9150613e83565b90506020813d602011613ecf575b81613ebf60209383613756565b810103126102f257516020613e4a565b3d9150613eb2565b600091508190565b60405190613eee604083613756565b60078252660161023b7ba1d160cd1b6020830152565b9590969198939997929460009a87156148c557881561487a57861561482f5781156147e457841561478e578c156147435764e8d4a5100082106146de57655af3107a400082116146795785156146225761012c86018087116145905742116145a45761012c420180421161459057861161450b57613f806152b5565b80860361442957508b54604051638d34875560e01b8152600481018a905297969594939291908d90899060249082906001600160a01b03165afa97881561441e578d98614401575b50875115614391576040880180516040516020810191825260208152613fef604082613756565b5190209081860361424c575050916101649795939160209a9997959360018060a01b036001541697608060018060a01b0391015116966040519e8f9c8d9b632fd74aa960e11b8d5260048d015260248c015260448b015260648a0152608489015260a488015260c487015260e48601526101048501526101248401526101448301525afa91821561424157839261420d575b5060055460405163fb7c6a0f60e01b815290602090829060049082906001600160a01b03165afa9081156142025784916141c0575b506001600160a01b031691823b15613345579184916084859460405197889586948593636b80155f60e01b8552632c545d9960e21b6004860152602485015260606044850152816064850152848401378181018301879052601f01601f191681010301915afa91826141b0575b509061417b5750604051614138606082613756565b602d81527f56616c69646174696f6e20393a20766572696679417574686f72697a6174696f60208201526c1b8818d85b1b0819985a5b1959609a1b604082015290565b5060405161418a604082613756565b6016815275105b1b081d985b1a59185d1a5bdb9cc81c185cdcd95960521b602082015290565b816141ba91613756565b38614123565b90506020813d6020116141fa575b816141db60209383613756565b8101031261334557516001600160a01b038116810361334557386140b6565b3d91506141ce565b6040513d86823e3d90fd5b9091506020813d602011614239575b8161422960209383613756565b8101031261334957519038614081565b3d915061421c565b6040513d85823e3d90fd5b9b509d505050509897505050505050506040519261426b606085613756565b602c845260208401947f56616c69646174696f6e20383a20446562742068617368206d69736d617463688652604085016b0171022bc3832b1ba32b21d160a51b90526142b690615386565b926142bf613edf565b916142c990615386565b9050604051916142da604084613756565b6010835260208301936f0161021bab93932b73a103232b13a1d160851b85525161430390615457565b9460405197889751908160208a0161431a926135fb565b870181519182602083019160200191614332926135fb565b01602001808251602081940191614348926135fb565b0180825160208194019161435b926135fb565b0191829151809361436b926135fb565b0180825160208194019161437e926135fb565b0103601f1981018252613cfd9082613756565b50505050505050505050505080915050506040516143b0606082613756565b603b81527f56616c69646174696f6e20383a20506f736974696f6e206e6f7420666f756e6460208201527a2028706f736974696f6e4964203d3d20627974657333322830292960281b604082015290565b6144179198508d3d8091833e610ae88183613756565b9638613fc8565b6040513d8f823e3d90fd5b98505050505095505050506144cb94506020915083613cfd9450506144fc8260405194614457606087613756565b603086526144ee826144a7818901967f56616c69646174696f6e20373a20436f6e74726163742068617368206d69736d88526f030ba31b4171022bc3832b1ba32b21d160851b60408b0152615386565b6144b86144b2613edf565b94615386565b966040519b8c9a518092858d01906135fb565b89016144df825180938580850191016135fb565b010191828151948592016135fb565b0191828151948592016135fb565b0103601f198101835282613756565b50505050505050505050508091505050604051614529608082613756565b6060815260008051602061595283398151915260208201527f6f6f2066617220696e2066757475726520287175616e74756d54696d6573746160408201527f6d70203e20626c6f636b2e74696d657374616d70202b204d41585f534b455729606082015290565b634e487b7160e01b8d52601160045260248dfd5b505050505050505050505080915050506040516145c2608082613756565b6056815260008051602061595283398151915260208201527f6f6f206f6c6420287175616e74756d54696d657374616d70202b204d41585f536040820152754b4557203c20626c6f636b2e74696d657374616d702960501b606082015290565b50505050505050505050508091505050604051614640606082613756565b602381527f56616c69646174696f6e20343a207175616e74756d54696d657374616d70203d60208201526203d20360ec1b604082015290565b50505050505050505050508091505050604051614697606082613756565b603181527f56616c69646174696f6e20333a206274635072696365203e20444941474e4f536020820152700a89286be84a886bea0a492868abe9a82b607b1b604082015290565b505050505050505050505080915050506040516146fc606082613756565b603181527f56616c69646174696f6e20333a206274635072696365203c20444941474e4f536020820152702a24a1afa12a21afa82924a1a2afa6a4a760791b604082015290565b50505050505050505050508091505050604051614761604082613756565b601d81527f56616c69646174696f6e20313a207369676e617475726520656d707479000000602082015290565b505050505050505050505080915050506040516147ac606082613756565b602281527f56616c69646174696f6e20313a20636f6e747261637448617368206973207a65602082015261726f60f01b604082015290565b50505050505050505050508091505050604051614802604082613756565b601e81527f56616c69646174696f6e20313a206274635072696365206973207a65726f0000602082015290565b5050505050505050505050809150505060405161484d604082613756565b601d81527f56616c69646174696f6e20313a206e657744656274206973207a65726f000000602082015290565b50505050505050505050508091505050604051614898604082613756565b602081527f56616c69646174696f6e20313a206d696e74416d6f756e74206973207a65726f602082015290565b505050505050505050505080915050506040516148e3604082613756565b602081527f56616c69646174696f6e20313a20706f736974696f6e4964206973207a65726f602082015290565b9061491a82613945565b6149276040519182613756565b8281528092614938601f1991613945565b0190602036910137565b60008054604051638d34875560e01b815260048101849052936001600160a01b0390911692909184602481865afa93841561092a57600094614aad575b5060808401516001600160a01b031615614a7957604051926101606149a48186613756565b600a8552601f19013660208601376020806000960151602460405180948193631e1778ad60e11b835260048301525afa908115614a6e578591614a3c575b5003614a27575b8215926149f581614910565b9260005b828110614a0557505050565b8060ff614a1460019385613c81565b5116614a208288613c81565b52016149f9565b600192506002614a3683613c5e565b526149e9565b90506020813d602011614a66575b81614a5760209383613756565b8101031261332d5751386149e2565b3d9150614a4a565b6040513d87823e3d90fd5b50915050604080519190614a8d8184613756565b60018352601f19013660208401376001614aa683613c5e565b5260009190565b614ac39194503d806000833e610ae88183613756565b923861497f565b60008054604051632a6bc2dd60e01b81526001600160a01b03938416600482015293959194939192168482602481845afa91821561092a57600092614c60575b50815193848710801590614c58575b614c335760328111614c2b575b614b309087613be7565b86858211614c23575b614b4291613e05565b91614b4c83614910565b9660005b848110614b5e575050505050565b614b71614b6b8284613be7565b84613c81565b5180614b7d838c613c81565b5260405190638d34875560e01b82526004820152600081602481885afa801561092a5761012091600091614c0a575b50015160088110156113f457600281149060008215614bff575b8215614bf0575b5050614bdc575b600101614b50565b96614be8600191613c95565b979050614bd4565b9091506113f457153880614bcd565b600182149250614bc6565b614c1d913d8091833e610ae88183613756565b38614bac565b859150614b39565b506032614b26565b50505092509050604051614c48602082613756565b6000815260003681379160009190565b508015614b19565b614c769192503d806000833e61091c8183613756565b9038614b0a565b6006546001600160a01b0316908115614d355760405163f609844d60e01b8152602081600481865afa90811561092a57600491602091600091614d18575b50936040519283809263074e13b960e01b82525afa90811561092a57600091614ce6575b5090600090565b90506020813d602011614d10575b81614d0160209383613756565b810103126102f2575138614cdf565b3d9150614cf4565b614d2f9150823d8411610e6557610e578183613756565b38614cbb565b6000915081908190565b6006546001600160a01b0316916000918315614e385760405190633087c5cf60e01b82526004820152602081602481875afa90811561092a57600091614e06575b50600460208295604051928380926285d89b60e21b82525afa90811561092a57600091614dd4575b5080614db2575050565b9091925061271082029180830461271014901517156116ce57613cfd91613ca4565b906020823d602011614dfe575b81614dee60209383613756565b8101031261167f57505138614da8565b3d9150614de1565b906020823d602011614e30575b81614e2060209383613756565b8101031261167f57505138614d80565b3d9150614e13565b5060009250829150565b6001600160a01b03168015614e9e57602060049160405192838092635c975abb60e01b82525afa60009181614e7d575b50613cfd5750600090565b614e9791925060203d602011610e6557610e578183613756565b9038614e72565b50600090565b6001600160a01b03168015614e9e5760206004916040519283809263d53dc73960e01b82525afa60009181614e7d5750613cfd5750600090565b6005546040516303e1469160e61b815290602090829060049082906001600160a01b03165afa8091600091614f26575b5090614f1a5750600090565b6001600160a01b031690565b6020813d602011614f64575b81614f3f60209383613756565b81010312614f605751906001600160a01b038216820361167f575038614f0e565b5080fd5b3d9150614f32565b60015460405163eb373f3f60e01b815290602090829060049082906001600160a01b03165afa8091600091614f26575090614f1a5750600090565b600054604051638998b7cf60e01b815290602090829060049082906001600160a01b03165afa8091600091614f26575090614f1a5750600090565b60015460405163b1d3354f60e01b815290602090829060049082906001600160a01b03165afa6000918161501b5750613cfd5750600090565b9091506020813d602011615048575b8161503760209383613756565b810103126102f257614e97906139d5565b3d915061502a565b60015460405163023b2a9f60e31b815290602090829060049082906001600160a01b03165afa6000918161501b5750613cfd5750600090565b60055460405163db19e96360e01b815290602090829060049082906001600160a01b03165afa6000918161501b5750613cfd5750600090565b60008181526000805160206159f28339815191526020908152604080832033845290915290205460ff16156150f45750565b63e2517d3f60e01b6000523360045260245260446000fd5b615116828261551b565b918261512157505090565b60009182526000805160206159328339815191526020526040909120615150916001600160a01b031690615774565b5090565b61515e82826155c4565b918261516957505090565b60009182526000805160206159328339815191526020526040909120615150916001600160a01b0316906157dd565b60ff600080516020615a1283398151915254166151b157565b63d93c066560e01b60005260046000fd5b90660775f05a07400082116116ac57662386f26fc10000811161169b5781158015908161521f575b5061520e576151f891613bd4565b6064810290808204606414901517156116ce5790565b63450d49cd60e01b60005260046000fd5b9050613cae5760648260001904048111386151ea565b9080156152a45768327cb2734119d3b7a9601e1b821161168a577e068db8bac710cb295e9e1b089a027525460aa64c2f837b4a2339c0ebedfa4382116152935761271082029180830461271014901517156116ce57613cfd91613ca4565b633da428df60e21b60005260046000fd5b6323d359a360e01b60005260046000fd5b60015460405163b1d3354f60e01b81526001600160a01b0390911690602081600481855afa60009181615339575b506152ef575050600090565b600554600454604080516001600160a01b0393841660208201908152918101959095529082166060850152911660808084019190915282529061533360a082613756565b51902090565b9091506020813d60201161536d575b8161535560209383613756565b810103126102f257615366906139d5565b90386152e3565b3d9150615348565b908151811015613c6b570160200190565b60405190615395608083613756565b60428252602082016060368237825115613c6b5760309053815160011015613c6b576078602183015360005b602081106153ce57505090565b81811a6153e060ff8260041c16615704565b908260011b91838304600214841517156116ce578260020191826002116116ce5761541c92615415600f9360001a9189615375565b5316615704565b600091600301918260031161544357600193929161543c911a9186615375565b53016153c1565b634e487b7160e01b81526011600452602490fd5b80156154fb5780816000925b6154e5575061547182613779565b9161547f6040519384613756565b80835281601f1961548f83613779565b013660208601375b6154a057505090565b60001981019081116116ce578091600a810660300191826030116116ce57600a9260f81b6001600160f81b03191660001a906154dc9086615375565b53049081615497565b90916154f2600a91613c95565b92910480615463565b5060405161550a604082613756565b60018152600360fc1b602082015290565b60008181526000805160206159f2833981519152602090815260408083206001600160a01b038616845290915290205460ff166155bd5760008181526000805160206159f2833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19166001179055339291907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a4600190565b5050600090565b60008181526000805160206159f2833981519152602090815260408083206001600160a01b038616845290915290205460ff16156155bd5760008181526000805160206159f2833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19169055339291907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9080a4600190565b9181156156e45768327cb2734119d3b7a9601e1b831161168a577e068db8bac710cb295e9e1b089a027525460aa64c2f837b4a2339c0ebedfa438311615293576000826000190482116156d55761271084029380850461271014901517156154435750906156d191613bd4565b1190565b633da428df60e21b8152600490fd5b505050600090565b8054821015613c6b5760005260206000200190600090565b60ff16600a81101561572b5760300160ff81116116ce5760f81b6001600160f81b03191690565b60570160ff81116116ce5760f81b6001600160f81b03191690565b60ff600080516020615a528339815191525460401c161561576357565b631afcd79f60e31b60005260046000fd5b60018101908260005281602052604060002054156000146156e4578054600160401b81101561242b576157c86157b18260018794018555846156ec565b819391549060031b91821b91600019901b19161790565b90555491600052602052604060002055600190565b90600182019181600052826020526040600020548015156000146158a75760001981018181116116ce5782546000198101919082116116ce57818103615870575b5050508054801561585a57600019019061583882826156ec565b8154906000199060031b1b191690555560005260205260006040812055600190565b634e487b7160e01b600052603160045260246000fd5b6158906158806157b193866156ec565b90549060031b1c928392866156ec565b90556000528360205260406000205538808061581e565b50505050600090565b906158d657508051156158c557602081519101fd5b63d6bda27560e01b60005260046000fd5b81511580615908575b6158e7575090565b639996b31560e01b60009081526001600160a01b0391909116600452602490fd5b50803b156158df56fe0073bca384c5694c6e96fcd606b93d29d3f9c8294a3638967da39aea012c8e58c1f6fe24621ce81ec5827caf0253cadb74709b061630e6b55e8237170593200056616c69646174696f6e20363a207175616e74756d54696d657374616d702074c7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d275027301df982f5215b4963a854cf9c73219df80cb6acd8f098189c9480c7bbc360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc17dc5b1290f7495d7f8cc68476e6941aaf510598fa925d0d2720edc8805a846c02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800cd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300a49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00a164736f6c6343000822000a";
75322
75406
  var isSuperArgs3 = (xs) => xs.length > 1;
75323
- var PositionManagerViews__factory = class extends import_ethers31.ContractFactory {
75407
+ var PositionManagerViews__factory = class extends import_ethers32.ContractFactory {
75324
75408
  constructor(...args) {
75325
75409
  if (isSuperArgs3(args)) {
75326
75410
  super(...args);
@@ -75340,10 +75424,10 @@ var PositionManagerViews__factory = class extends import_ethers31.ContractFactor
75340
75424
  static bytecode = _bytecode3;
75341
75425
  static abi = _abi3;
75342
75426
  static createInterface() {
75343
- return new import_ethers31.Interface(_abi3);
75427
+ return new import_ethers32.Interface(_abi3);
75344
75428
  }
75345
75429
  static connect(address, runner) {
75346
- return new import_ethers31.Contract(
75430
+ return new import_ethers32.Contract(
75347
75431
  address,
75348
75432
  _abi3,
75349
75433
  runner
@@ -75361,7 +75445,7 @@ var SET_DELEGATE_GATE_ABI = [
75361
75445
  "function delegateBurned(address delegate) view returns (bool)"
75362
75446
  ];
75363
75447
  async function getSetDelegateBlocker(delegate, provider, registryAddress) {
75364
- const registry = new import_ethers32.Contract(
75448
+ const registry = new import_ethers33.Contract(
75365
75449
  registryAddress,
75366
75450
  SET_DELEGATE_GATE_ABI,
75367
75451
  provider
@@ -75378,7 +75462,7 @@ async function getSetDelegateBlocker(delegate, provider, registryAddress) {
75378
75462
  return null;
75379
75463
  }
75380
75464
  async function setPositionDelegate(positionId, delegate, signer, registryAddress) {
75381
- const registry = new import_ethers32.Contract(
75465
+ const registry = new import_ethers33.Contract(
75382
75466
  registryAddress,
75383
75467
  POSITION_DELEGATE_REGISTRY_ABI,
75384
75468
  signer
@@ -75386,7 +75470,7 @@ async function setPositionDelegate(positionId, delegate, signer, registryAddress
75386
75470
  return registry["setPositionDelegate"](positionId, delegate);
75387
75471
  }
75388
75472
  async function getPositionDelegate(positionId, provider, registryAddress) {
75389
- const registry = new import_ethers32.Contract(
75473
+ const registry = new import_ethers33.Contract(
75390
75474
  registryAddress,
75391
75475
  POSITION_DELEGATE_REGISTRY_ABI,
75392
75476
  provider
@@ -75593,9 +75677,13 @@ var SIGNABLE_FUNCTIONS2 = [
75593
75677
  "function redeem(address stablecoin, uint256 ucdAmount, uint256 minStablecoinOut) external returns (uint256)",
75594
75678
  // BitcoinWithdrawalAddressRegistry — `msg.sender` must be the borrower, so
75595
75679
  // this too is client-only and never module-whitelisted.
75596
- "function addAddress(string btcAddress) external"
75680
+ "function addAddress(string btcAddress) external",
75681
+ // StUSDCVault 1.1.0 — the hold-only UCD desk. Direct EOA calls like the PSM
75682
+ // pair (the vault pulls from `msg.sender`); never routed through AgentModule.
75683
+ "function sellUCD(uint256 amountUCD, uint256 minUSDC) external returns (uint256)",
75684
+ "function buyUCD(uint256 amountUSDC, uint256 minUCD) external returns (uint256)"
75597
75685
  ];
75598
- var IFACE2 = new import_ethers34.ethers.Interface(SIGNABLE_FUNCTIONS2);
75686
+ var IFACE2 = new import_ethers35.ethers.Interface(SIGNABLE_FUNCTIONS2);
75599
75687
  function encodeSignable2(fn, args) {
75600
75688
  return IFACE2.encodeFunctionData(fn, args);
75601
75689
  }
@@ -75620,7 +75708,7 @@ function eqAddr2(a, b) {
75620
75708
  if (!a || !b)
75621
75709
  return false;
75622
75710
  try {
75623
- return import_ethers35.ethers.getAddress(a) === import_ethers35.ethers.getAddress(b);
75711
+ return import_ethers36.ethers.getAddress(a) === import_ethers36.ethers.getAddress(b);
75624
75712
  } catch {
75625
75713
  return false;
75626
75714
  }
@@ -75686,7 +75774,7 @@ function readValue2(tx2) {
75686
75774
  }
75687
75775
  function normalizePositionId2(id) {
75688
75776
  const hex = id.startsWith("0x") ? id : `0x${id}`;
75689
- return import_ethers35.ethers.zeroPadValue(hex, 32).toLowerCase();
75777
+ return import_ethers36.ethers.zeroPadValue(hex, 32).toLowerCase();
75690
75778
  }
75691
75779
  function requirePositionId(actual, expected) {
75692
75780
  const txPositionId = String(actual).toLowerCase();
@@ -75945,6 +76033,53 @@ function validateUnsignedTx2(unsignedTx, expected, vctx) {
75945
76033
  }
75946
76034
  break;
75947
76035
  }
76036
+ case "desk-approve": {
76037
+ if (name !== "approve") {
76038
+ throw new TxValidationError2(`expected ERC-20 approve, decoded ${name}`);
76039
+ }
76040
+ if (!eqAddr2(to, expected.tokenAddress)) {
76041
+ throw new TxValidationError2(`approve must target the token (${expected.tokenAddress}), got ${to}`);
76042
+ }
76043
+ if (!eqAddr2(String(args[0]), expected.vaultAddress)) {
76044
+ throw new TxValidationError2(`approve spender must be the StUSDCVault (${expected.vaultAddress}), got ${String(args[0])}`);
76045
+ }
76046
+ if (BigInt(String(args[1])).toString() !== expected.amount) {
76047
+ throw new TxValidationError2(
76048
+ `approve amount must be EXACTLY ${expected.amount} (exact-amount rule), got ${BigInt(String(args[1]))}`
76049
+ );
76050
+ }
76051
+ break;
76052
+ }
76053
+ case "desk-sell": {
76054
+ if (name !== "sellUCD")
76055
+ throw new TxValidationError2(`expected sellUCD, decoded ${name}`);
76056
+ if (!eqAddr2(to, expected.vaultAddress)) {
76057
+ throw new TxValidationError2(`sellUCD must target the StUSDCVault (${expected.vaultAddress}), got ${to}`);
76058
+ }
76059
+ if (BigInt(String(args[0])).toString() !== expected.amountUcdWei)
76060
+ throw new TxValidationError2(`sellUCD amountUCD mismatch`);
76061
+ if (BigInt(String(args[1])).toString() !== expected.minUsdc)
76062
+ throw new TxValidationError2(`sellUCD minUSDC mismatch`);
76063
+ if (BigInt(expected.minUsdc) === 0n) {
76064
+ throw new TxValidationError2(`sellUCD minUSDC is 0 \u2014 a slippage floor is mandatory`);
76065
+ }
76066
+ break;
76067
+ }
76068
+ case "desk-buy": {
76069
+ if (name !== "buyUCD")
76070
+ throw new TxValidationError2(`expected buyUCD, decoded ${name}`);
76071
+ if (!eqAddr2(to, expected.vaultAddress)) {
76072
+ throw new TxValidationError2(`buyUCD must target the StUSDCVault (${expected.vaultAddress}), got ${to}`);
76073
+ }
76074
+ if (BigInt(String(args[0])).toString() !== expected.amountUsdc)
76075
+ throw new TxValidationError2(`buyUCD amountUSDC mismatch`);
76076
+ if (BigInt(String(args[1])).toString() !== expected.minUcdWei)
76077
+ throw new TxValidationError2(`buyUCD minUCD mismatch`);
76078
+ if (BigInt(expected.minUcdWei) === 0n) {
76079
+ throw new TxValidationError2(`buyUCD minUCD is 0 \u2014 a slippage floor is mandatory`);
76080
+ }
76081
+ break;
76082
+ }
75948
76083
  default: {
75949
76084
  const _exhaustive = expected;
75950
76085
  throw new TxValidationError2(`unhandled expected action kind: ${JSON.stringify(_exhaustive)}`);
@@ -75978,18 +76113,18 @@ function buildPsmRedeemTx2(p) {
75978
76113
  var PSM_READS_ABI = ["function supportedStablecoins(address) view returns (bool)"];
75979
76114
  var ERC20_READS_ABI = ["function allowance(address owner, address spender) view returns (uint256)"];
75980
76115
  function psmExchangeReadsFromProvider(provider, psmAddress) {
75981
- const psm = new import_ethers33.ethers.Contract(psmAddress, PSM_READS_ABI, provider);
76116
+ const psm = new import_ethers34.ethers.Contract(psmAddress, PSM_READS_ABI, provider);
75982
76117
  return {
75983
76118
  isStablecoinSupported: async (stablecoin) => await psm.getFunction("supportedStablecoins")(stablecoin),
75984
- allowance: async (token, owner, spender) => await new import_ethers33.ethers.Contract(token, ERC20_READS_ABI, provider).getFunction("allowance")(owner, spender)
76119
+ allowance: async (token, owner, spender) => await new import_ethers34.ethers.Contract(token, ERC20_READS_ABI, provider).getFunction("allowance")(owner, spender)
75985
76120
  };
75986
76121
  }
75987
76122
  var refuse = (direction, msg) => new TxValidationError2(msg, `PSM ${direction}`);
75988
76123
  function requireAddress(direction, label, value) {
75989
- if (!value || !import_ethers33.ethers.isAddress(value)) {
76124
+ if (!value || !import_ethers34.ethers.isAddress(value)) {
75990
76125
  throw refuse(direction, `${label} address is missing or invalid (${String(value)})`);
75991
76126
  }
75992
- return import_ethers33.ethers.getAddress(value);
76127
+ return import_ethers34.ethers.getAddress(value);
75993
76128
  }
75994
76129
  async function planPsmExchange(params) {
75995
76130
  const { direction, amountIn, minOut, vctx, reads } = params;
@@ -76071,6 +76206,203 @@ async function executePsmPlan(plan, signer, vctx) {
76071
76206
  });
76072
76207
  return { ...exec, approvalHashes };
76073
76208
  }
76209
+ var DESK_ABI = [
76210
+ "function quoteSellUCD(uint256 amountUCD) view returns (uint256 usdcOut, uint256 feeE18)",
76211
+ "function sellUCD(uint256 amountUCD, uint256 minUSDC) returns (uint256 usdcOut)",
76212
+ "function buyUCD(uint256 amountUSDC, uint256 minUCD) returns (uint256 ucdOut)",
76213
+ "function halted() view returns (bool)",
76214
+ "function haltReasons() view returns (bool psmPaused, bool redeemOff, bool reservesShort, bool oracleUnhealthy, bool unconfigured)",
76215
+ "function markE18() view returns (uint256)",
76216
+ "function freeUsdc() view returns (uint256)",
76217
+ "function deskParams() view returns ((uint256 iMax, uint256 sMax, uint256 rMin, uint32 haircutBps, uint32 feeSlopeBps, uint32 feeCapBps, uint32 reserveCoverageBps))",
76218
+ "function deskState() view returns (uint256 inventoryUCD, uint256 stUCDShares, uint256 claimableReserve, uint64 currentEpoch, uint64 oldestOpenEpoch, address backingOracle, address stUcd, address ucd)",
76219
+ "function exitsFrozen() view returns (bool)",
76220
+ "function paused() view returns (bool)",
76221
+ // IStUSDCDesk errors on the trade path.
76222
+ "error DeskHalted()",
76223
+ "error ZeroDeskAmount()",
76224
+ "error InventoryCapExceeded(uint256 inventoryAfter, uint256 iMax)",
76225
+ "error InsufficientLiquidity(uint256 free, uint256 needed)",
76226
+ "error InsufficientInventory(uint256 available, uint256 needed)",
76227
+ "error SlippageExceeded(uint256 out, uint256 min)",
76228
+ // StUSDCVault / OpenZeppelin gates the desk shares.
76229
+ "error ExitsAreFrozen(uint40 until)",
76230
+ "error EnforcedPause()"
76231
+ ];
76232
+ function buildDeskApproveTx(p) {
76233
+ return {
76234
+ to: p.token,
76235
+ data: encodeSignable2("approve", [p.vault, p.amount]),
76236
+ value: "0x0",
76237
+ chainId: p.chainId
76238
+ };
76239
+ }
76240
+ function buildDeskSellTx(p) {
76241
+ return {
76242
+ to: p.vault,
76243
+ data: encodeSignable2("sellUCD", [p.amountUCD, p.minUSDC]),
76244
+ value: "0x0",
76245
+ chainId: p.chainId
76246
+ };
76247
+ }
76248
+ function buildDeskBuyTx(p) {
76249
+ return {
76250
+ to: p.vault,
76251
+ data: encodeSignable2("buyUCD", [p.amountUSDC, p.minUCD]),
76252
+ value: "0x0",
76253
+ chainId: p.chainId
76254
+ };
76255
+ }
76256
+ var ERC20_READS_ABI2 = ["function allowance(address owner, address spender) view returns (uint256)"];
76257
+ function deskReadsFromProvider(provider, vaultAddress) {
76258
+ const vault = new import_ethers37.ethers.Contract(vaultAddress, DESK_ABI, provider);
76259
+ return {
76260
+ quoteSellUCD: async (amountUCD) => {
76261
+ const r = await vault.getFunction("quoteSellUCD").staticCall(amountUCD);
76262
+ return { usdcOut: r[0], feeE18: r[1] };
76263
+ },
76264
+ status: async () => {
76265
+ const [halted, reasons, paused, exitsFrozen, markE18, freeUsdc, params, state] = await Promise.all([
76266
+ vault.getFunction("halted")(),
76267
+ vault.getFunction("haltReasons")(),
76268
+ vault.getFunction("paused")(),
76269
+ vault.getFunction("exitsFrozen")(),
76270
+ vault.getFunction("markE18")(),
76271
+ vault.getFunction("freeUsdc")(),
76272
+ vault.getFunction("deskParams")(),
76273
+ vault.getFunction("deskState")()
76274
+ ]);
76275
+ return {
76276
+ halted,
76277
+ reasons: {
76278
+ psmPaused: reasons[0],
76279
+ redeemOff: reasons[1],
76280
+ reservesShort: reasons[2],
76281
+ oracleUnhealthy: reasons[3],
76282
+ unconfigured: reasons[4]
76283
+ },
76284
+ paused,
76285
+ exitsFrozen,
76286
+ markE18,
76287
+ freeUsdc,
76288
+ params: {
76289
+ iMax: params[0],
76290
+ sMax: params[1],
76291
+ rMin: params[2],
76292
+ haircutBps: Number(params[3]),
76293
+ feeSlopeBps: Number(params[4]),
76294
+ feeCapBps: Number(params[5]),
76295
+ reserveCoverageBps: Number(params[6])
76296
+ },
76297
+ state: {
76298
+ inventoryUCD: state[0],
76299
+ stUCDShares: state[1],
76300
+ claimableReserve: state[2],
76301
+ currentEpoch: state[3],
76302
+ oldestOpenEpoch: state[4],
76303
+ backingOracle: state[5],
76304
+ stUcd: state[6],
76305
+ ucd: state[7]
76306
+ }
76307
+ };
76308
+ },
76309
+ allowance: async (token, owner, spender) => await new import_ethers37.ethers.Contract(token, ERC20_READS_ABI2, provider).getFunction("allowance")(owner, spender)
76310
+ };
76311
+ }
76312
+ var refuse2 = (direction, msg) => new TxValidationError2(msg, `desk ${direction}`);
76313
+ function requireAddress2(direction, label, value) {
76314
+ if (!value || !import_ethers37.ethers.isAddress(value)) {
76315
+ throw refuse2(direction, `${label} address is missing or invalid (${String(value)})`);
76316
+ }
76317
+ return import_ethers37.ethers.getAddress(value);
76318
+ }
76319
+ async function planDesk(params) {
76320
+ const { direction, amountIn, minOut, vctx, reads } = params;
76321
+ const chainId = vctx.chainId;
76322
+ if (amountIn <= 0n) {
76323
+ throw refuse2(direction, `amount must be greater than zero (got ${amountIn})`);
76324
+ }
76325
+ if (minOut <= 0n) {
76326
+ throw refuse2(direction, `minimum-out floor must be greater than zero (got ${minOut}) \u2014 a zero floor is refused`);
76327
+ }
76328
+ const owner = requireAddress2(direction, "owner", params.owner);
76329
+ const vault = requireAddress2(direction, "StUSDCVault", params.vault);
76330
+ const token = requireAddress2(direction, params.tokenLabel, params.token);
76331
+ const approveExpected = (amount) => ({
76332
+ kind: "desk-approve",
76333
+ tokenAddress: token,
76334
+ vaultAddress: vault,
76335
+ amount: amount.toString()
76336
+ });
76337
+ const allowanceBefore = await reads.allowance(token, owner, vault);
76338
+ const approvals = [];
76339
+ if (allowanceBefore < amountIn) {
76340
+ if (allowanceBefore > 0n) {
76341
+ approvals.push({
76342
+ step: "reset-approve",
76343
+ tx: buildDeskApproveTx({ token, vault, amount: 0n, chainId }),
76344
+ expected: approveExpected(0n)
76345
+ });
76346
+ }
76347
+ approvals.push({
76348
+ step: "approve",
76349
+ tx: buildDeskApproveTx({ token, vault, amount: amountIn, chainId }),
76350
+ expected: approveExpected(amountIn)
76351
+ });
76352
+ }
76353
+ const exec = direction === "sell" ? {
76354
+ step: "sell",
76355
+ tx: buildDeskSellTx({ vault, amountUCD: amountIn, minUSDC: minOut, chainId }),
76356
+ expected: { kind: "desk-sell", vaultAddress: vault, amountUcdWei: amountIn.toString(), minUsdc: minOut.toString() }
76357
+ } : {
76358
+ step: "buy",
76359
+ tx: buildDeskBuyTx({ vault, amountUSDC: amountIn, minUCD: minOut, chainId }),
76360
+ expected: { kind: "desk-buy", vaultAddress: vault, amountUsdc: amountIn.toString(), minUcdWei: minOut.toString() }
76361
+ };
76362
+ for (const leg of [...approvals, exec]) {
76363
+ validateUnsignedTx2({ ...leg.tx }, leg.expected, vctx);
76364
+ }
76365
+ return { direction, owner, vault, token, amountIn, minOut, allowanceBefore, approvals, exec };
76366
+ }
76367
+ function planDeskSell(params) {
76368
+ return planDesk({
76369
+ direction: "sell",
76370
+ owner: params.owner,
76371
+ vault: params.addresses.vault,
76372
+ token: params.addresses.ucdToken,
76373
+ tokenLabel: "UCDToken",
76374
+ amountIn: params.amountUCD,
76375
+ minOut: params.minUSDC,
76376
+ vctx: params.vctx,
76377
+ reads: params.reads
76378
+ });
76379
+ }
76380
+ async function executeDeskPlan(plan, signer, vctx) {
76381
+ const approvalHashes = [];
76382
+ 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.`;
76383
+ const sendLeg = async (leg) => {
76384
+ const request = { to: leg.tx.to, data: leg.tx.data, value: 0n, chainId: leg.tx.chainId };
76385
+ validateUnsignedTx2({ ...request }, leg.expected, vctx);
76386
+ const sent = await signer.sendTransaction(request);
76387
+ const receipt = await sent.wait();
76388
+ if (!receipt)
76389
+ throw new Error(`desk ${leg.step} tx ${sent.hash} returned no receipt`);
76390
+ if (receipt.status !== 1)
76391
+ throw new Error(`desk ${leg.step} tx ${sent.hash} reverted`);
76392
+ return { hash: sent.hash, blockNumber: receipt.blockNumber };
76393
+ };
76394
+ for (const leg of plan.approvals) {
76395
+ const landed = await sendLeg(leg).catch((e) => {
76396
+ throw new Error(`desk ${leg.step} failed: ${e instanceof Error ? e.message : String(e)}.${residual()}`);
76397
+ });
76398
+ approvalHashes.push(landed.hash);
76399
+ }
76400
+ const exec = await sendLeg(plan.exec).catch((e) => {
76401
+ throw new Error(`desk ${plan.exec.step} failed: ${e instanceof Error ? e.message : String(e)}.${residual()}`);
76402
+ });
76403
+ return { ...exec, approvalHashes };
76404
+ }
76405
+ init_deployment_addresses();
76074
76406
  var LIT_ACTION_CHAIN_NAMES = Object.freeze({
76075
76407
  1: "ethereum",
76076
76408
  11155111: "sepolia",
@@ -76309,14 +76641,18 @@ function formatLiquidationFailureMessage(loanId, errorMessage, btcVault, btcVaul
76309
76641
  var CONTRACT_ERROR_FRAGMENTS = [
76310
76642
  { fragment: "error AboveMaxRedeem(uint256 amount, uint256 maximum)", contracts: ["SimplePSMV2"] },
76311
76643
  { fragment: "error AboveMaxSwap(uint256 amount, uint256 maximum)", contracts: ["SimplePSMV2"] },
76312
- { fragment: "error AccessControlBadConfirmation()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
76313
- { fragment: "error AccessControlUnauthorizedAccount(address account, bytes32 neededRole)", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
76314
- { fragment: "error AddressEmptyCode(address target)", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
76644
+ { fragment: "error AccessControlBadConfirmation()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
76645
+ { fragment: "error AccessControlUnauthorizedAccount(address account, bytes32 neededRole)", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
76646
+ { fragment: "error AddressEmptyCode(address target)", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
76315
76647
  { fragment: "error AlreadyActive()", contracts: ["PositionManagerErrors"] },
76648
+ { fragment: "error AlreadyClaimed()", contracts: ["StUSDCVault"] },
76649
+ { fragment: "error AlreadySeeded()", contracts: ["StUSDCVault"] },
76316
76650
  { fragment: "error AlreadySigned()", contracts: ["PositionManagerErrors", "OperationAuthorizationRegistry"] },
76317
76651
  { fragment: "error AmountMustBePositive()", contracts: ["LoanOperationsManagerModule", "SimplePSMV2"] },
76318
76652
  { fragment: "error ArrayLengthMismatch()", contracts: ["BTCSpendAuthorizer", "SimplePSMV2"] },
76653
+ { fragment: "error AssetMismatch()", contracts: ["StUSDCVault"] },
76319
76654
  { fragment: "error BTCSpendAuthorizerNotSet()", contracts: ["LoanOperationsManagerModule"] },
76655
+ { fragment: "error BadRecoveryDestination(address to)", contracts: ["StUSDCVault"] },
76320
76656
  { fragment: "error BalanceMismatch()", contracts: ["UCDController"] },
76321
76657
  { fragment: "error BatchSizeTooLarge()", contracts: ["BTCSpendAuthorizer"] },
76322
76658
  { fragment: "error BelowMinRedeem(uint256 amount, uint256 minimum)", contracts: ["SimplePSMV2"] },
@@ -76331,7 +76667,7 @@ var CONTRACT_ERROR_FRAGMENTS = [
76331
76667
  { fragment: "error BurnGuardFailed(uint8 code)", contracts: ["UCDController"] },
76332
76668
  { fragment: "error BurnVerificationFailed()", contracts: ["PositionManager", "PositionManagerErrors"] },
76333
76669
  { fragment: "error CannotRemoveLastTerm()", contracts: ["PositionManagerErrors"] },
76334
- { fragment: "error CannotUpgradeToSelf()", contracts: ["PositionManagerErrors", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer"] },
76670
+ { fragment: "error CannotUpgradeToSelf()", contracts: ["PositionManagerErrors", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "StUSDCVault"] },
76335
76671
  { fragment: "error CircuitBreakerNotActive()", contracts: ["PositionManagerErrors"] },
76336
76672
  { fragment: "error CircuitBreakerTriggered()", contracts: ["PositionManagerErrors"] },
76337
76673
  { fragment: "error CollateralOverflow()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule"] },
@@ -76347,39 +76683,62 @@ var CONTRACT_ERROR_FRAGMENTS = [
76347
76683
  { fragment: "error DebtUpdateVerificationFailedDetailed(bytes32 positionId, uint256 currentDebt, uint256 newDebt, uint256 quantumTimestamp, uint256 supplyAfterMint, uint256 expectedIncrease)", contracts: ["LoanOperationsManagerModule"] },
76348
76684
  { fragment: "error DecimalsMismatch(uint8 provided, uint8 actual)", contracts: ["SimplePSMV2"] },
76349
76685
  { fragment: "error DecimalsQueryFailed()", contracts: ["SimplePSMV2"] },
76686
+ { fragment: "error DeskHalted()", contracts: ["StUSDCVault"] },
76687
+ { fragment: "error DeskParamOutOfRange()", contracts: ["StUSDCVault"] },
76350
76688
  { fragment: "error DivisionByZero()", contracts: ["PositionManager", "CollateralManagerModule"] },
76351
76689
  { fragment: "error ECDSAInvalidSignature()", contracts: ["BTCSpendAuthorizer"] },
76352
76690
  { fragment: "error ECDSAInvalidSignatureLength(uint256 length)", contracts: ["BTCSpendAuthorizer"] },
76353
76691
  { fragment: "error ECDSAInvalidSignatureS(bytes32 s)", contracts: ["BTCSpendAuthorizer"] },
76354
- { fragment: "error ERC1967InvalidImplementation(address implementation)", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
76355
- { fragment: "error ERC1967NonPayable()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
76356
- { fragment: "error EnforcedPause()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
76692
+ { fragment: "error ERC1967InvalidImplementation(address implementation)", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
76693
+ { fragment: "error ERC1967NonPayable()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
76694
+ { fragment: "error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed)", contracts: ["StUSDCVault"] },
76695
+ { fragment: "error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed)", contracts: ["StUSDCVault"] },
76696
+ { fragment: "error ERC20InvalidApprover(address approver)", contracts: ["StUSDCVault"] },
76697
+ { fragment: "error ERC20InvalidReceiver(address receiver)", contracts: ["StUSDCVault"] },
76698
+ { fragment: "error ERC20InvalidSender(address sender)", contracts: ["StUSDCVault"] },
76699
+ { fragment: "error ERC20InvalidSpender(address spender)", contracts: ["StUSDCVault"] },
76700
+ { fragment: "error ERC4626ExceededMaxDeposit(address receiver, uint256 assets, uint256 max)", contracts: ["StUSDCVault"] },
76701
+ { fragment: "error ERC4626ExceededMaxMint(address receiver, uint256 shares, uint256 max)", contracts: ["StUSDCVault"] },
76702
+ { fragment: "error ERC4626ExceededMaxRedeem(address owner, uint256 shares, uint256 max)", contracts: ["StUSDCVault"] },
76703
+ { fragment: "error ERC4626ExceededMaxWithdraw(address owner, uint256 assets, uint256 max)", contracts: ["StUSDCVault"] },
76704
+ { fragment: "error EnforcedPause()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
76357
76705
  { fragment: "error EntryFeeTooHigh(uint256 fee, uint256 max)", contracts: ["SimplePSMV2"] },
76706
+ { fragment: "error EpochAlreadyPriced()", contracts: ["StUSDCVault"] },
76707
+ { fragment: "error EpochNotComplete()", contracts: ["StUSDCVault"] },
76708
+ { fragment: "error EpochNotOpen()", contracts: ["StUSDCVault"] },
76358
76709
  { fragment: "error ExceedsFeeBalance(uint256 requested, uint256 max)", contracts: ["SimplePSMV2"] },
76359
76710
  { fragment: "error ExceedsMaxLoan()", contracts: ["PositionManagerErrors"] },
76711
+ { fragment: "error ExceedsUntracked(uint256 untracked, uint256 amount)", contracts: ["StUSDCVault"] },
76360
76712
  { fragment: "error ExitFeeTooHigh(uint256 fee, uint256 max)", contracts: ["SimplePSMV2"] },
76361
- { fragment: "error ExpectedPause()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
76713
+ { fragment: "error ExitsAreFrozen(uint40 until)", contracts: ["StUSDCVault"] },
76714
+ { fragment: "error ExpectedPause()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
76362
76715
  { fragment: "error ExtensionFeeMintingFailed()", contracts: ["PositionManager", "PositionManagerErrors"] },
76363
76716
  { fragment: "error ExtensionNotAllowed()", contracts: ["PositionManagerErrors"] },
76364
- { fragment: "error FailedCall()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
76717
+ { fragment: "error FailedCall()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
76365
76718
  { fragment: "error FailedToGetStablecoinDecimals()", contracts: ["SimplePSMV2"] },
76366
76719
  { fragment: "error FailedToGetUCDDecimals()", contracts: ["SimplePSMV2"] },
76367
76720
  { fragment: "error FeeOnTransferNotSupported()", contracts: ["SimplePSMV2"] },
76368
76721
  { fragment: "error FeeTooHigh(uint256 fee, uint256 max)", contracts: ["PositionManagerErrors"] },
76369
76722
  { fragment: "error FeeTooLow(uint256 fee, uint256 min)", contracts: ["PositionManagerErrors"] },
76723
+ { fragment: "error FreezeBoundOutOfRange(uint40 value, uint40 min, uint40 max)", contracts: ["StUSDCVault"] },
76724
+ { fragment: "error FreezeCooldown(uint40 availableAt)", contracts: ["StUSDCVault"] },
76725
+ { fragment: "error FreezeInPast(uint40 until)", contracts: ["StUSDCVault"] },
76726
+ { fragment: "error FreezeTooLong(uint40 until, uint40 latestAllowed)", contracts: ["StUSDCVault"] },
76370
76727
  { fragment: "error GlobalReentrancyGuardReentrantCall()", contracts: ["PositionManager", "CollateralManagerModule"] },
76371
76728
  { fragment: "error ImplNotDeployed()", contracts: ["LoanOperationsManagerModule", "BTCSpendAuthorizer"] },
76372
- { fragment: "error ImplementationNotDeployed()", contracts: ["UCDController"] },
76729
+ { fragment: "error ImplementationNotDeployed()", contracts: ["UCDController", "StUSDCVault"] },
76373
76730
  { fragment: "error InitialBalanceTooLarge()", contracts: ["SimplePSMV2"] },
76374
76731
  { fragment: "error InsufficientBalance()", contracts: ["PositionManagerErrors"] },
76375
76732
  { fragment: "error InsufficientCollateralForAmount()", contracts: ["PositionManagerErrors"] },
76376
76733
  { fragment: "error InsufficientCollateralRatio()", contracts: ["CollateralManagerModule"] },
76377
76734
  { fragment: "error InsufficientFeeBal()", contracts: ["LoanOperationsManagerModule"] },
76735
+ { fragment: "error InsufficientInventory(uint256 available, uint256 needed)", contracts: ["StUSDCVault"] },
76736
+ { fragment: "error InsufficientLiquidity(uint256 free, uint256 needed)", contracts: ["StUSDCVault"] },
76378
76737
  { fragment: "error InsufficientReserves(uint256 available, uint256 required)", contracts: ["SimplePSMV2"] },
76379
76738
  { fragment: "error InsufficientSignatures()", contracts: ["OperationAuthorizationRegistry"] },
76380
76739
  { fragment: "error IntegrityCheckFailed()", contracts: ["PositionManagerErrors"] },
76381
76740
  { fragment: "error InvalidActionHash()", contracts: ["CollateralManagerModule"] },
76382
- { fragment: "error InvalidAddress()", contracts: ["PositionManager", "PositionManagerErrors", "OperationAuthorizationRegistry", "CollateralManagerModule", "SimplePSMV2"] },
76741
+ { fragment: "error InvalidAddress()", contracts: ["PositionManager", "PositionManagerErrors", "OperationAuthorizationRegistry", "CollateralManagerModule", "SimplePSMV2", "StUSDCVault"] },
76383
76742
  { fragment: "error InvalidAdmin()", contracts: ["LoanOperationsManagerModule", "BTCSpendAuthorizer", "SimplePSMV2"] },
76384
76743
  { fragment: "error InvalidAmount()", contracts: ["PositionManagerErrors", "SimplePSMV2"] },
76385
76744
  { fragment: "error InvalidBTCPrice()", contracts: ["PositionManager", "PositionManagerErrors"] },
@@ -76390,7 +76749,7 @@ var CONTRACT_ERROR_FRAGMENTS = [
76390
76749
  { fragment: "error InvalidExchangeRate()", contracts: ["SimplePSMV2"] },
76391
76750
  { fragment: "error InvalidImpl()", contracts: ["LoanOperationsManagerModule", "BTCSpendAuthorizer"] },
76392
76751
  { fragment: "error InvalidImplementation()", contracts: ["UCDController"] },
76393
- { fragment: "error InvalidInitialization()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
76752
+ { fragment: "error InvalidInitialization()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
76394
76753
  { fragment: "error InvalidLitSignature()", contracts: ["BTCSpendAuthorizer"] },
76395
76754
  { fragment: "error InvalidLoanOps()", contracts: ["BTCSpendAuthorizer"] },
76396
76755
  { fragment: "error InvalidModuleAddress()", contracts: ["UCDController"] },
@@ -76426,6 +76785,7 @@ var CONTRACT_ERROR_FRAGMENTS = [
76426
76785
  { fragment: "error InvalidVolumeCap(bool isRedeem)", contracts: ["SimplePSMV2"] },
76427
76786
  { fragment: "error InvalidWithdrawalAddress()", contracts: ["CollateralManagerModule"] },
76428
76787
  { fragment: "error InvalidWithdrawalLoanStatusType()", contracts: ["CollateralManagerModule"] },
76788
+ { fragment: "error InventoryCapExceeded(uint256 totalUcdAfter, uint256 iMax)", contracts: ["StUSDCVault"] },
76429
76789
  { fragment: "error LiquidationsPaused()", contracts: ["PositionManager", "PositionManagerErrors"] },
76430
76790
  { fragment: "error LoanAmountTooHigh()", contracts: ["PositionManagerErrors"] },
76431
76791
  { fragment: "error LoanAmountTooLow()", contracts: ["PositionManagerErrors"] },
@@ -76451,23 +76811,31 @@ var CONTRACT_ERROR_FRAGMENTS = [
76451
76811
  { fragment: "error NoVersion()", contracts: ["LoanOperationsManagerModule", "BTCSpendAuthorizer", "UCDController"] },
76452
76812
  { fragment: "error NonZeroReserves(address stablecoin, uint256 reserves)", contracts: ["SimplePSMV2"] },
76453
76813
  { fragment: "error NormalizationOverflow()", contracts: ["SimplePSMV2"] },
76454
- { fragment: "error NotAdminModule()", contracts: ["PositionManager", "PositionManagerErrors", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
76814
+ { fragment: "error NotATransferFee(bytes4 selector)", contracts: ["StUSDCVault"] },
76815
+ { fragment: "error NotAdminModule()", contracts: ["PositionManager", "PositionManagerErrors", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
76816
+ { fragment: "error NotArrived(uint256 available, uint256 amount)", contracts: ["StUSDCVault"] },
76455
76817
  { fragment: "error NotAuthorized()", contracts: ["PositionManager", "PositionManagerErrors"] },
76456
76818
  { fragment: "error NotAuthorizedConsumer()", contracts: ["OperationAuthorizationRegistry"] },
76457
76819
  { fragment: "error NotAuthorizedSigner()", contracts: ["OperationAuthorizationRegistry"] },
76458
76820
  { fragment: "error NotBorrower()", contracts: ["PositionManager", "PositionManagerErrors", "LoanOperationsManagerModule"] },
76821
+ { fragment: "error NotCarryReceiver(address caller)", contracts: ["StUSDCVault"] },
76459
76822
  { fragment: "error NotContract()", contracts: ["PositionManagerErrors", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "SimplePSMV2"] },
76460
- { fragment: "error NotInitializing()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
76823
+ { fragment: "error NotController()", contracts: ["StUSDCVault"] },
76824
+ { fragment: "error NotInitializing()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
76461
76825
  { fragment: "error NotLiquidationPkpOwner()", contracts: ["PositionManager", "PositionManagerErrors"] },
76462
76826
  { fragment: "error NotLiquidator()", contracts: ["PositionManager", "PositionManagerErrors"] },
76463
76827
  { fragment: "error NotOwner()", contracts: ["OperationAuthorizationRegistry"] },
76464
76828
  { fragment: "error NotPendingOwner()", contracts: ["OperationAuthorizationRegistry"] },
76465
76829
  { fragment: "error NotProductionAuthorizer()", contracts: ["PositionManagerErrors", "LoanOperationsManagerModule"] },
76466
76830
  { fragment: "error NotProductionRegistry()", contracts: ["PositionManager", "PositionManagerErrors", "LoanOperationsManagerModule"] },
76831
+ { fragment: "error NotSeeded()", contracts: ["StUSDCVault"] },
76832
+ { fragment: "error NotSeeder(address caller)", contracts: ["StUSDCVault"] },
76833
+ { fragment: "error NothingToFulfil()", contracts: ["StUSDCVault"] },
76467
76834
  { fragment: "error OnlyCore()", contracts: ["CollateralManagerModule"] },
76468
76835
  { fragment: "error OnlyLoanOps()", contracts: ["BTCSpendAuthorizer"] },
76469
76836
  { fragment: "error OnlyPosMgr()", contracts: ["LoanOperationsManagerModule"] },
76470
76837
  { fragment: "error OnlyPositionManager()", contracts: ["LoanOperationsManagerModule"] },
76838
+ { fragment: "error OpNotExecuted(bytes32 sweepId)", contracts: ["StUSDCVault"] },
76471
76839
  { fragment: "error OperationInProgress()", contracts: ["PositionManager", "PositionManagerErrors"] },
76472
76840
  { fragment: "error OracleDecimalMismatch()", contracts: ["LoanOperationsManagerModule"] },
76473
76841
  { fragment: "error PKPAlreadyUsed()", contracts: ["PositionManagerErrors"] },
@@ -76475,6 +76843,7 @@ var CONTRACT_ERROR_FRAGMENTS = [
76475
76843
  { fragment: "error PaymentAmountZero()", contracts: ["PositionManager", "PositionManagerErrors"] },
76476
76844
  { fragment: "error PaymentMustBeLessThanDebt()", contracts: ["LoanOperationsManagerModule"] },
76477
76845
  { fragment: "error PaymentMustBePositive()", contracts: ["LoanOperationsManagerModule"] },
76846
+ { fragment: "error PeriodOutOfBounds(uint40 period, uint40 min, uint40 max)", contracts: ["StUSDCVault"] },
76478
76847
  { fragment: "error PositionAlreadyExists()", contracts: ["PositionManager", "PositionManagerErrors"] },
76479
76848
  { fragment: "error PositionDoesNotExist()", contracts: ["CollateralManagerModule"] },
76480
76849
  { fragment: "error PositionLiquidatable()", contracts: ["PositionManagerErrors"] },
@@ -76505,22 +76874,29 @@ var CONTRACT_ERROR_FRAGMENTS = [
76505
76874
  { fragment: "error ReserveOverflow()", contracts: ["SimplePSMV2"] },
76506
76875
  { fragment: "error ReserveTooLarge()", contracts: ["SimplePSMV2"] },
76507
76876
  { fragment: "error ReserveUnderflow()", contracts: ["SimplePSMV2"] },
76508
- { fragment: "error SafeERC20FailedOperation(address token)", contracts: ["PositionManager", "LoanOperationsManagerModule", "SimplePSMV2"] },
76877
+ { fragment: "error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value)", contracts: ["StUSDCVault"] },
76878
+ { fragment: "error SafeERC20FailedOperation(address token)", contracts: ["PositionManager", "LoanOperationsManagerModule", "SimplePSMV2", "StUSDCVault"] },
76509
76879
  { fragment: "error SameBlockInteraction()", contracts: ["PositionManager", "PositionManagerErrors"] },
76510
76880
  { fragment: "error SameImpl()", contracts: ["LoanOperationsManagerModule", "BTCSpendAuthorizer"] },
76511
76881
  { fragment: "error SameImplementation()", contracts: ["PositionManagerErrors", "CollateralManagerModule"] },
76882
+ { fragment: "error SeedTooSmall(uint256 amount, uint256 min)", contracts: ["StUSDCVault"] },
76512
76883
  { fragment: "error SignatureVerificationFailed(bytes4 selector, address recovered, address expected, bytes32 messageHash, uint8 errorCode)", contracts: ["OperationAuthorizationRegistry"] },
76513
76884
  { fragment: "error SlippageExceeded(uint256 got, uint256 minimum)", contracts: ["SimplePSMV2"] },
76885
+ { fragment: "error SlippageExceeded(uint256 out, uint256 min)", contracts: ["StUSDCVault"] },
76514
76886
  { fragment: "error SlippageProtectionRequired()", contracts: ["SimplePSMV2"] },
76887
+ { fragment: "error StUcdHeld()", contracts: ["StUSDCVault"] },
76515
76888
  { fragment: "error StablecoinAlreadySupported(address stablecoin)", contracts: ["SimplePSMV2"] },
76516
76889
  { fragment: "error StablecoinNotContract(address stablecoin)", contracts: ["SimplePSMV2"] },
76517
76890
  { fragment: "error StablecoinNotSupported(address stablecoin)", contracts: ["SimplePSMV2"] },
76518
76891
  { fragment: "error StablecoinNotSupportedInV1(address stablecoin)", contracts: ["SimplePSMV2"] },
76892
+ { fragment: "error StakeCapExceeded(uint256 value, uint256 sMax)", contracts: ["StUSDCVault"] },
76519
76893
  { fragment: "error StaleAttestationMismatch()", contracts: ["BTCSpendAuthorizer"] },
76520
76894
  { fragment: "error StaleAttestationTooOld()", contracts: ["BTCSpendAuthorizer"] },
76521
76895
  { fragment: "error StaleSpendValidatorNotSet()", contracts: ["BTCSpendAuthorizer"] },
76522
76896
  { fragment: "error StateHashMismatch()", contracts: ["LoanOperationsValidation", "LoanOperationsManagerModule", "CollateralManagerModule"] },
76523
76897
  { fragment: "error SwapVolumeExceededThisBlock(address stablecoin, uint256 attempted, uint256 cap)", contracts: ["SimplePSMV2"] },
76898
+ { fragment: "error SweepAlreadyCredited(bytes32 sweepId)", contracts: ["StUSDCVault"] },
76899
+ { fragment: "error SweepMismatch()", contracts: ["StUSDCVault"] },
76524
76900
  { fragment: "error SyncDriftTooLarge()", contracts: ["SimplePSMV2"] },
76525
76901
  { fragment: "error TargetAddrRequired()", contracts: ["BTCSpendAuthorizer"] },
76526
76902
  { fragment: "error TargetExceedsInputValue()", contracts: ["BTCSpendAuthorizer"] },
@@ -76535,11 +76911,12 @@ var CONTRACT_ERROR_FRAGMENTS = [
76535
76911
  { fragment: "error TooManySigners()", contracts: ["OperationAuthorizationRegistry"] },
76536
76912
  { fragment: "error UTXOAlreadyAuthorized()", contracts: ["BTCSpendAuthorizer"] },
76537
76913
  { fragment: "error UTXONotAuthorized()", contracts: ["BTCSpendAuthorizer"] },
76538
- { fragment: "error UUPSUnauthorizedCallContext()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
76539
- { fragment: "error UUPSUnsupportedProxiableUUID(bytes32 slot)", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
76914
+ { fragment: "error UUPSUnauthorizedCallContext()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
76915
+ { fragment: "error UUPSUnsupportedProxiableUUID(bytes32 slot)", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
76540
76916
  { fragment: "error UcdAmountTooLarge()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule"] },
76541
76917
  { fragment: "error Unauthorized()", contracts: ["UCDController"] },
76542
- { fragment: "error UnexpectedRoleGrantFailure()", contracts: ["PositionManager", "PositionManagerErrors", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
76918
+ { fragment: "error UnexpectedRoleGrantFailure()", contracts: ["PositionManager", "PositionManagerErrors", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2", "StUSDCVault"] },
76919
+ { fragment: "error UnknownSource(address target)", contracts: ["StUSDCVault"] },
76543
76920
  { fragment: "error UnsupportedFeeToken(address token)", contracts: ["SimplePSMV2"] },
76544
76921
  { fragment: "error UserDailyMintLimitExceeded()", contracts: ["LoanOperationsManagerModule"] },
76545
76922
  { fragment: "error V2AlreadyInitialized()", contracts: ["SimplePSMV2"] },
@@ -76548,32 +76925,29 @@ var CONTRACT_ERROR_FRAGMENTS = [
76548
76925
  { fragment: "error WithdrawalAddressNotApproved()", contracts: ["CollateralManagerModule"] },
76549
76926
  { fragment: "error WithdrawalExceedsReserves(uint256 amount, uint256 reserves)", contracts: ["SimplePSMV2"] },
76550
76927
  { fragment: "error ZeroAddress()", contracts: ["PositionManager", "UCDController"] },
76551
- { fragment: "error ZeroAmount()", contracts: ["UCDController"] }
76928
+ { fragment: "error ZeroAmount()", contracts: ["UCDController", "StUSDCVault"] },
76929
+ { fragment: "error ZeroDeskAmount()", contracts: ["StUSDCVault"] }
76552
76930
  ];
76553
76931
  var TABLE = null;
76554
76932
  function contractErrorTable() {
76555
76933
  if (TABLE)
76556
76934
  return TABLE;
76557
76935
  const table = /* @__PURE__ */ new Map();
76558
- const iface = new import_ethers36.Interface(CONTRACT_ERROR_FRAGMENTS.map((e) => e.fragment));
76559
- const contractsByName = new Map(
76560
- CONTRACT_ERROR_FRAGMENTS.map((e) => [e.fragment.slice("error ".length, e.fragment.indexOf("(")), e.contracts])
76561
- );
76562
- iface.forEachError((fragment) => {
76936
+ for (const generated of CONTRACT_ERROR_FRAGMENTS) {
76937
+ const fragment = import_ethers38.ErrorFragment.from(generated.fragment);
76563
76938
  const existing = table.get(fragment.selector);
76564
- const contracts = contractsByName.get(fragment.name) ?? [];
76565
76939
  if (existing) {
76566
- for (const c of contracts)
76940
+ for (const c of generated.contracts)
76567
76941
  if (!existing.contracts.includes(c))
76568
76942
  existing.contracts.push(c);
76569
- return;
76943
+ continue;
76570
76944
  }
76571
76945
  table.set(fragment.selector, {
76572
76946
  signature: fragment.format("sighash"),
76573
76947
  fragment,
76574
- contracts: [...contracts]
76948
+ contracts: [...generated.contracts]
76575
76949
  });
76576
- });
76950
+ }
76577
76951
  TABLE = table;
76578
76952
  return table;
76579
76953
  }
@@ -76664,7 +77038,7 @@ function decodeContractError(error) {
76664
77038
  const contract = entry.contracts.join(" | ");
76665
77039
  let args = [];
76666
77040
  try {
76667
- const decoded = new import_ethers36.Interface([entry.fragment]).decodeErrorResult(entry.fragment, errorData);
77041
+ const decoded = new import_ethers38.Interface([entry.fragment]).decodeErrorResult(entry.fragment, errorData);
76668
77042
  args = Array.from(decoded);
76669
77043
  } catch {
76670
77044
  args = [];
@@ -77506,7 +77880,7 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
77506
77880
  addEndpoint("config.provider", enrichedConfig.provider);
77507
77881
  addEndpoint("the contractSigner's provider", enrichedConfig.contractSigner?.provider);
77508
77882
  addEndpoint("the litOpsSigner's provider", enrichedConfig.litOpsSigner?.provider);
77509
- if (enrichedConfig.ethRpcUrl?.trim()) {
77883
+ if (!enrichedConfig.provider && enrichedConfig.ethRpcUrl?.trim()) {
77510
77884
  addEndpoint("ethRpcUrl", new import_ethers13.JsonRpcProvider(enrichedConfig.ethRpcUrl.trim()));
77511
77885
  }
77512
77886
  const refusal = await describeStandaloneMainnetRefusal(config.chainId, endpoints);
@@ -78845,15 +79219,13 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
78845
79219
  signatureHexMint
78846
79220
  ]);
78847
79221
  const fromAddress = await signer.getAddress();
79222
+ let mintSubmission;
78848
79223
  try {
78849
- await assertSafeQuantumSubmission({
78850
- provider: signerProvider,
79224
+ mintSubmission = await this.prepareQuantumSend("mintUCD", {
78851
79225
  to: positionManagerAddress,
78852
79226
  from: fromAddress,
78853
79227
  data: mintCalldata,
78854
- quantumTimestamp: Number(validationResponse.timestamp),
78855
- laneGuardActive: await this.isLocalLaneGuardActive(),
78856
- onDebug: this.config.debug ? (msg) => log.info(msg, {}) : void 0
79228
+ quantumTimestamp: Number(validationResponse.timestamp)
78857
79229
  });
78858
79230
  } catch (simError) {
78859
79231
  if (!(simError instanceof QuantumRevertError)) {
@@ -78871,7 +79243,7 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
78871
79243
  [
78872
79244
  "function diagnoseMintUCD(bytes32,uint256,uint256,uint256,uint256,uint256,bytes32,bytes32,bytes32,uint256,bytes) view returns (string)"
78873
79245
  ],
78874
- signerProvider
79246
+ this.getProviderOrThrow()
78875
79247
  );
78876
79248
  diagnosis = await views["diagnoseMintUCD"](
78877
79249
  request.positionId,
@@ -78978,7 +79350,7 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
78978
79350
  feeProvider: this.getProviderOrThrow(),
78979
79351
  to: positionManagerAddress,
78980
79352
  data: mintCalldata,
78981
- gasLimit: MINT_UCD_GAS_CEILING
79353
+ gasLimit: mintSubmission.gasLimit
78982
79354
  });
78983
79355
  const receipt = await signerProvider.waitForTransaction(
78984
79356
  tx2.hash,
@@ -79639,16 +80011,26 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
79639
80011
  if (this.config.debug) {
79640
80012
  log.info(`\u{1F512} Executing commit phase...`);
79641
80013
  }
79642
- const commitTx = await positionManager["commitLiquidation"](
80014
+ const commitArgs = [
79643
80015
  positionIdBytes32,
79644
80016
  BigInt(quantumTimestamp.toString()),
79645
80017
  BigInt(btcPrice.toString()),
79646
80018
  BigInt(
79647
80019
  (litActionResult.btcAmountSats || "0").toString()
79648
80020
  ),
79649
- litActionResult.signature || "0x",
79650
- { gasLimit: LIQUIDATION_COMMIT_GAS_CEILING }
79651
- // see definition: measured on Sepolia 2026-10-20
80021
+ litActionResult.signature || "0x"
80022
+ ];
80023
+ const liquidationTarget = await positionManager.getAddress();
80024
+ const liquidationFrom = await this.getSignerOrThrow().getAddress();
80025
+ const commitSubmission = await this.prepareQuantumSend("commitLiquidation", {
80026
+ to: liquidationTarget,
80027
+ from: liquidationFrom,
80028
+ data: positionManager.interface.encodeFunctionData("commitLiquidation", [...commitArgs]),
80029
+ quantumTimestamp: Number(quantumTimestamp)
80030
+ });
80031
+ const commitTx = await positionManager["commitLiquidation"](
80032
+ ...commitArgs,
80033
+ { gasLimit: commitSubmission.gasLimit }
79652
80034
  );
79653
80035
  const commitReceipt = await commitTx.wait();
79654
80036
  if (this.config.debug) {
@@ -79771,15 +80153,23 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
79771
80153
  hasSignature: !!revealResult.signature
79772
80154
  });
79773
80155
  }
79774
- const revealTx = await positionManager["revealAndLiquidate"](
80156
+ const revealArgs = [
79775
80157
  positionIdBytes32,
79776
80158
  revealQuantumTimestamp,
79777
80159
  revealBtcPrice,
79778
80160
  revealBtcAmountSats,
79779
80161
  revealResult.signature || "0x",
79780
- BigInt(revealDeadline.toString()),
79781
- { gasLimit: LIQUIDATION_REVEAL_GAS_CEILING }
79782
- // see definition: measured on Sepolia 2026-10-20
80162
+ BigInt(revealDeadline.toString())
80163
+ ];
80164
+ const revealSubmission = await this.prepareQuantumSend("revealAndLiquidate", {
80165
+ to: liquidationTarget,
80166
+ from: liquidationFrom,
80167
+ data: positionManager.interface.encodeFunctionData("revealAndLiquidate", [...revealArgs]),
80168
+ quantumTimestamp: Number(revealQuantumTimestamp)
80169
+ });
80170
+ const revealTx = await positionManager["revealAndLiquidate"](
80171
+ ...revealArgs,
80172
+ { gasLimit: revealSubmission.gasLimit }
79783
80173
  );
79784
80174
  if (this.config.debug) {
79785
80175
  log.info(` \u{1F4E4} Reveal TX submitted`, { txHash: revealTx.hash });
@@ -80181,15 +80571,13 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
80181
80571
  ]);
80182
80572
  const extendTo = this.getContractAddressesOrThrow().positionManager;
80183
80573
  const extendSigner = this.getSignerOrThrow();
80574
+ let extendSubmission;
80184
80575
  try {
80185
- await assertSafeQuantumSubmission({
80186
- provider: this.getProviderOrThrow(),
80576
+ extendSubmission = await this.prepareQuantumSend("extendPosition", {
80187
80577
  to: extendTo,
80188
80578
  from: await extendSigner.getAddress(),
80189
80579
  data: extendCalldata,
80190
- quantumTimestamp: Number(quantumTimestamp),
80191
- laneGuardActive: await this.isLocalLaneGuardActive(),
80192
- onDebug: this.config.debug ? (msg) => log.info(msg, {}) : void 0
80580
+ quantumTimestamp: Number(quantumTimestamp)
80193
80581
  });
80194
80582
  } catch (simError) {
80195
80583
  if (!(simError instanceof QuantumRevertError)) {
@@ -80204,7 +80592,7 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
80204
80592
  feeProvider: this.getProviderOrThrow(),
80205
80593
  to: extendTo,
80206
80594
  data: extendCalldata,
80207
- gasLimit: EXTEND_POSITION_GAS_CEILING
80595
+ gasLimit: extendSubmission.gasLimit
80208
80596
  });
80209
80597
  const txWithProvider = tx2;
80210
80598
  if (!txWithProvider.provider) {
@@ -81097,7 +81485,6 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
81097
81485
  const paymentContractAddress = this.getContractAddressesOrThrow().positionManager;
81098
81486
  const paymentSigner = this.getSignerOrThrow();
81099
81487
  const paymentFrom = await paymentSigner.getAddress();
81100
- const paymentProvider = contractManager.getProvider();
81101
81488
  const paymentIface = new import_ethers13.Interface([
81102
81489
  "function makePayment(bytes32 positionId, uint256 paymentAmount, uint256 quantumTimestamp, uint256 btcPrice, bytes calldata paymentValidatorSignature) external returns (bool)"
81103
81490
  ]);
@@ -81108,15 +81495,13 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
81108
81495
  btcPriceStr,
81109
81496
  signature
81110
81497
  ]);
81498
+ let paymentSubmission;
81111
81499
  try {
81112
- await assertSafeQuantumSubmission({
81113
- provider: paymentProvider,
81500
+ paymentSubmission = await this.prepareQuantumSend("makePayment", {
81114
81501
  to: paymentContractAddress,
81115
81502
  from: paymentFrom,
81116
81503
  data: paymentCalldata,
81117
- quantumTimestamp: Number(quantumTimestamp),
81118
- laneGuardActive: await this.isLocalLaneGuardActive(),
81119
- onDebug: this.config.debug ? (msg) => log.info(msg, {}) : void 0
81504
+ quantumTimestamp: Number(quantumTimestamp)
81120
81505
  });
81121
81506
  } catch (simError) {
81122
81507
  if (!(simError instanceof QuantumRevertError)) {
@@ -81139,7 +81524,7 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
81139
81524
  feeProvider: this.getProviderOrThrow(),
81140
81525
  to: paymentContractAddress,
81141
81526
  data: paymentCalldata,
81142
- gasLimit: MAKE_PAYMENT_GAS_CEILING
81527
+ gasLimit: paymentSubmission.gasLimit
81143
81528
  });
81144
81529
  if (this.config.debug) {
81145
81530
  log.info("\u2705 makePayment broadcast", { txHash: tx2.hash });
@@ -81896,21 +82281,18 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
81896
82281
  const withdrawSigner = this.getSignerOrThrow();
81897
82282
  let tx2;
81898
82283
  try {
81899
- await assertSafeQuantumSubmission({
81900
- provider: this.getProviderOrThrow(),
82284
+ const withdrawSubmission = await this.prepareQuantumSend("withdrawBTC", {
81901
82285
  to: positionManagerAddress,
81902
82286
  from: await withdrawSigner.getAddress(),
81903
82287
  data: withdrawCalldata,
81904
- quantumTimestamp: Number(withdrawalParams.quantumTimestamp),
81905
- laneGuardActive: await this.isLocalLaneGuardActive(),
81906
- onDebug: this.config.debug ? (msg) => log.info(msg, {}) : void 0
82288
+ quantumTimestamp: Number(withdrawalParams.quantumTimestamp)
81907
82289
  });
81908
82290
  tx2 = await sendEip1559Transaction({
81909
82291
  signer: withdrawSigner,
81910
82292
  feeProvider: this.getProviderOrThrow(),
81911
82293
  to: positionManagerAddress,
81912
82294
  data: withdrawCalldata,
81913
- gasLimit: WITHDRAW_BTC_GAS_CEILING
82295
+ gasLimit: withdrawSubmission.gasLimit
81914
82296
  });
81915
82297
  } catch (txError) {
81916
82298
  const txErrorMsg = txError instanceof QuantumRevertError ? `Withdrawal would revert (pre-send simulation): ${txError.errorName ?? txError.selector ?? "unknown"}` : txError instanceof Error ? txError.message : String(txError);
@@ -81921,6 +82303,12 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
81921
82303
  signatureBytesLength: signatureBytes.length
81922
82304
  });
81923
82305
  }
82306
+ if (txError instanceof GasEstimateUnavailableError) {
82307
+ return {
82308
+ success: false,
82309
+ error: `Transaction submission failed: ${txErrorMsg}`
82310
+ };
82311
+ }
81924
82312
  try {
81925
82313
  const position = await this.getPosition(positionId);
81926
82314
  const btcAmount = (Number(withdrawalAmount) / 1e8).toFixed(8);
@@ -83603,6 +83991,97 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
83603
83991
  const { hash, blockNumber } = await executePsmPlan(plan, params.signer, vctx);
83604
83992
  return { hash, blockNumber };
83605
83993
  }
83994
+ // ============================================================================
83995
+ // HIGH-LEVEL API - stUSDC desk (StUSDCVault 1.1.0, hold-only UCD desk)
83996
+ // ============================================================================
83997
+ /**
83998
+ * The desk's addresses and the chain they belong to. The vault comes from the deployment
83999
+ * manifest (`getContractsByNetwork(network).StUSDCVault`); UCD and USDC from the SDK config,
84000
+ * the way `psmRedeem` resolves its tokens. Every address is required — nothing is guessed.
84001
+ */
84002
+ resolveDeskAddresses() {
84003
+ const chainId = this.config.chainId ?? this.config.networkOverride?.chainId;
84004
+ if (typeof chainId !== "number") {
84005
+ throw new Error("desk needs the SDK's chainId \u2014 configure chainId");
84006
+ }
84007
+ const manifestKey = chainId === 1 ? "mainnet" : chainId === 11155111 ? "sepolia" : "localhost";
84008
+ const manifest = getContractsByNetwork(manifestKey);
84009
+ const vault = manifest?.StUSDCVault;
84010
+ if (!vault) {
84011
+ throw new Error(`StUSDCVault is not deployed on ${manifestKey} (chainId ${chainId}) \u2014 no manifest address`);
84012
+ }
84013
+ const ucdToken = this.config.contractAddresses?.ucdToken;
84014
+ const usdcToken = this.config.contractAddresses?.usdcToken;
84015
+ if (!ucdToken)
84016
+ throw new Error("UCDToken address not configured \u2014 provide contractAddresses.ucdToken");
84017
+ if (!usdcToken)
84018
+ throw new Error("USDC address not configured \u2014 provide contractAddresses.usdcToken");
84019
+ return { chainId, vault, ucdToken, usdcToken };
84020
+ }
84021
+ /**
84022
+ * Live desk status: halt matrix, pause, exit freeze, mark, free USDC, params and state —
84023
+ * one `Promise.all` over the vault's views.
84024
+ */
84025
+ async getDeskStatus() {
84026
+ const { vault } = this.resolveDeskAddresses();
84027
+ return deskReadsFromProvider(this.getProviderOrThrow(), vault).status();
84028
+ }
84029
+ /**
84030
+ * What `sellUCD(amountUCDWei, ·)` would pay now. A static call: it reverts exactly as the sell
84031
+ * would (`ZeroDeskAmount`, `InventoryCapExceeded`, `InsufficientLiquidity`, `DeskHalted`,
84032
+ * `EnforcedPause`, `ExitsAreFrozen`), decoded by ethers against `DESK_ABI`.
84033
+ *
84034
+ * @param amountUCDWei - UCD to sell (18 decimals)
84035
+ */
84036
+ async quoteDeskSell(amountUCDWei) {
84037
+ const { vault } = this.resolveDeskAddresses();
84038
+ return deskReadsFromProvider(this.getProviderOrThrow(), vault).quoteSellUCD(amountUCDWei);
84039
+ }
84040
+ /**
84041
+ * Build and validate the legs of a UCD → USDC desk sale for `owner`: an EXACT approve of UCD
84042
+ * to the vault when the allowance is short (reset to zero first when partial), then
84043
+ * `sellUCD(amountUCDWei, minUSDCWei)`. Nothing is sent — hand the plan to `executeDeskPlan`,
84044
+ * or take the validated legs into your own signing pipeline.
84045
+ *
84046
+ * @param amountUCDWei - UCD to sell (18 decimals)
84047
+ * @param minUSDCWei - Minimum USDC to receive (6 decimals); must be > 0 — see `deskSellMinOut`
84048
+ * @param owner - The seller; defaults to the configured contract signer
84049
+ */
84050
+ async planDeskSell(amountUCDWei, minUSDCWei, owner) {
84051
+ const { chainId, vault, ucdToken } = this.resolveDeskAddresses();
84052
+ const seller = owner ?? await this.config.contractSigner?.getAddress();
84053
+ if (!seller)
84054
+ throw new Error("desk sell needs an owner \u2014 pass one or configure contractSigner");
84055
+ const provider = this.getProviderOrThrow();
84056
+ const vctx = { chainId, network: String(chainId), contracts: {} };
84057
+ return planDeskSell({
84058
+ addresses: { vault, ucdToken },
84059
+ owner: seller,
84060
+ amountUCD: amountUCDWei,
84061
+ minUSDC: minUSDCWei,
84062
+ vctx,
84063
+ reads: deskReadsFromProvider(provider, vault)
84064
+ });
84065
+ }
84066
+ /**
84067
+ * Send a desk plan through `signer`, approvals first, each leg re-validated against the chain
84068
+ * the SIGNER is on — which must be the SDK's configured chain, where the addresses came from.
84069
+ */
84070
+ async executeDeskPlan(plan, signer) {
84071
+ const provider = signer.provider;
84072
+ if (!provider)
84073
+ throw new Error(`desk ${plan.direction} needs a signer connected to a provider`);
84074
+ const { chainId } = this.resolveDeskAddresses();
84075
+ const mismatch = await describeProviderChainMismatch(provider, chainId);
84076
+ if (mismatch)
84077
+ throw new Error(mismatch);
84078
+ const signerAddress = await signer.getAddress();
84079
+ if ((0, import_ethers13.getAddress)(signerAddress) !== (0, import_ethers13.getAddress)(plan.owner)) {
84080
+ throw new Error(`desk ${plan.direction} plan was built for ${plan.owner}, signer is ${signerAddress}`);
84081
+ }
84082
+ const vctx = { chainId, network: String(chainId), contracts: {} };
84083
+ return executeDeskPlan(plan, signer, vctx);
84084
+ }
83606
84085
  /**
83607
84086
  * Wait for the subgraph to index up to (and including) the given block number.
83608
84087
  * Call after on-chain actions (createLoan, mintUCD, etc.) before querying the subgraph.
@@ -84768,6 +85247,32 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
84768
85247
  provider
84769
85248
  );
84770
85249
  }
85250
+ /**
85251
+ * Gate + estimate-as-simulation for a quantum-signed send, always on the SDK READ
85252
+ * provider — never the wallet's (docs/vigil/plans/2026-11-11-sdk-estimate-sized-gas-limits-plan.md,
85253
+ * Design 1–2). Returns the estimate and the gasLimit to broadcast with, and (in debug)
85254
+ * logs both for every send so the margin stays visible across the mainnet Glamsterdam fork.
85255
+ *
85256
+ * Throws `QuantumRevertError` (decodable revert — callers map it to their own message),
85257
+ * `GasEstimateUnavailableError` (no estimate: retryable, nothing sent) and
85258
+ * `GasLimitCeilingError` (the sized limit exceeds the 5M sign-guard ceiling).
85259
+ */
85260
+ async prepareQuantumSend(operation, tx2) {
85261
+ const result = await assertSafeQuantumSubmission({
85262
+ provider: this.getProviderOrThrow(),
85263
+ ...tx2,
85264
+ laneGuardActive: await this.isLocalLaneGuardActive(),
85265
+ ...this.config.debug ? { onDebug: (msg) => log.info(msg, {}) } : {}
85266
+ });
85267
+ if (this.config.debug) {
85268
+ log.info("\u26FD gasLimit sized from eth_estimateGas", {
85269
+ operation,
85270
+ estimate: result.estimate.toString(),
85271
+ gasLimit: result.gasLimit.toString()
85272
+ });
85273
+ }
85274
+ return result;
85275
+ }
84771
85276
  /**
84772
85277
  * Get Bitcoin network based on chain.
84773
85278
  *
@@ -85406,13 +85911,14 @@ init_deployment_addresses();
85406
85911
  init_deployment_addresses();
85407
85912
 
85408
85913
  // node_modules/@gvnrdao/dh-sdk/dist/sign-guard.mjs
85409
- var import_ethers38 = require("ethers");
85410
- var import_ethers39 = require("ethers");
85411
85914
  var import_ethers40 = require("ethers");
85412
85915
  var import_ethers41 = require("ethers");
85413
85916
  var import_ethers42 = require("ethers");
85414
85917
  var import_ethers43 = require("ethers");
85415
85918
  var import_ethers44 = require("ethers");
85919
+ var import_ethers45 = require("ethers");
85920
+ var import_ethers46 = require("ethers");
85921
+ var import_ethers47 = require("ethers");
85416
85922
  var TxValidationError3 = class extends Error {
85417
85923
  /**
85418
85924
  * @param subject What is being refused. Defaults to the server-returned transaction the
@@ -85457,9 +85963,13 @@ var SIGNABLE_FUNCTIONS3 = [
85457
85963
  "function redeem(address stablecoin, uint256 ucdAmount, uint256 minStablecoinOut) external returns (uint256)",
85458
85964
  // BitcoinWithdrawalAddressRegistry — `msg.sender` must be the borrower, so
85459
85965
  // this too is client-only and never module-whitelisted.
85460
- "function addAddress(string btcAddress) external"
85966
+ "function addAddress(string btcAddress) external",
85967
+ // StUSDCVault 1.1.0 — the hold-only UCD desk. Direct EOA calls like the PSM
85968
+ // pair (the vault pulls from `msg.sender`); never routed through AgentModule.
85969
+ "function sellUCD(uint256 amountUCD, uint256 minUSDC) external returns (uint256)",
85970
+ "function buyUCD(uint256 amountUSDC, uint256 minUCD) external returns (uint256)"
85461
85971
  ];
85462
- var IFACE3 = new import_ethers38.ethers.Interface(SIGNABLE_FUNCTIONS3);
85972
+ var IFACE3 = new import_ethers40.ethers.Interface(SIGNABLE_FUNCTIONS3);
85463
85973
  function encodeSignable3(fn, args) {
85464
85974
  return IFACE3.encodeFunctionData(fn, args);
85465
85975
  }
@@ -85489,10 +85999,10 @@ var DEFAULT_FEE_CEILING2 = {
85489
85999
  maxTxFeeWei: DEFAULT_MAX_TX_FEE_WEI2
85490
86000
  };
85491
86001
  function fmtEth2(wei) {
85492
- return `${import_ethers39.ethers.formatEther(wei)} ETH`;
86002
+ return `${import_ethers41.ethers.formatEther(wei)} ETH`;
85493
86003
  }
85494
86004
  function fmtGwei2(wei) {
85495
- return `${import_ethers39.ethers.formatUnits(wei, "gwei")} gwei`;
86005
+ return `${import_ethers41.ethers.formatUnits(wei, "gwei")} gwei`;
85496
86006
  }
85497
86007
  function worstCaseFeeWei2(gasLimit, maxFeePerGas) {
85498
86008
  if (gasLimit == null || maxFeePerGas == null)
@@ -85542,8 +86052,6 @@ var SEPOLIA_DEPLOYMENT2 = {
85542
86052
  BitcoinProviderRegistry: "0xbfA0c48B070D0a9A9CD27469AeacFD2d4261cEE2",
85543
86053
  ContractVersionRegistry: "0x97E43AA6aFF2C0cf659d3aE501658D2Ef6777522",
85544
86054
  usdcToken: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
85545
- mockUsdcToken: "0x96409A98e0D322d6566b7F44a0fAbD1BD4ce2AEc",
85546
- mockUsdtToken: "0xF8b7fB38b17a310960E47805Be9adba0b0e0394D",
85547
86055
  PositionDelegateRegistry: "0x482369De283622E7b05731875ec137d4E3D208F9",
85548
86056
  FeeRecipientRegistry: "0x95795F8403DDb629E8527B2934C4e71f5fC0C374",
85549
86057
  BitcoinWithdrawalAddressRegistry: "0x6376D392097F0A81e51BD83960A97EA20eaf1dbe",
@@ -85728,10 +86236,10 @@ var SEPOLIA_DEPLOYMENT2 = {
85728
86236
  },
85729
86237
  StUSDCVault: {
85730
86238
  previousImplementation: "0x3619b14C23c5F7d950EF845481C2299939873004",
85731
- newImplementation: "0x3619b14C23c5F7d950EF845481C2299939873004",
85732
- upgradedAt: "2026-10-30T16:50:49.227Z",
86239
+ newImplementation: "0xE94DFBacA21fEFB0BB2e95D33510Ca702d2b6c5f",
86240
+ upgradedAt: "2026-11-08T16:07:36.867Z",
85733
86241
  upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
85734
- reason: "Initial StUSDCVault deployment"
86242
+ reason: "StUSDCVault 1.1.0: Phase 5 desk (linked StUSDCDeskLib 0x0880ce721b0A50C8Fe8d5c911097F0c24e57b6aA)"
85735
86243
  },
85736
86244
  CarryFeeReceiver: {
85737
86245
  previousImplementation: "0x9c43996C6f6BAD82F2A5152AbA61137E929EFA17",
@@ -85796,6 +86304,9 @@ var SEPOLIA_DEPLOYMENT2 = {
85796
86304
  setPKPValidationRegistryTx: "0xab6b7e610c1ecf68da9a1e1150e61631e1f2a945bec12608c8357e03be25c4a5",
85797
86305
  replacedAddress: "0xC8Ca02238fbCDAEbE6dbF804461D43F46F9406F4"
85798
86306
  },
86307
+ libraries: {
86308
+ StUSDCDeskLib: "0x0880ce721b0A50C8Fe8d5c911097F0c24e57b6aA"
86309
+ },
85799
86310
  latestEnv: {
85800
86311
  UCD_TOKEN: "0xdd817Ff47C9b8f81335Ac579895D8EA321Fa86Df",
85801
86312
  UCD_CONTROLLER: "0x360Bde4e489ee94E26601B206932De09EE60FF04",
@@ -85848,8 +86359,6 @@ var SEPOLIA_DEPLOYMENT2 = {
85848
86359
  CONTRACT_VERSION_REGISTRY: "0x97E43AA6aFF2C0cf659d3aE501658D2Ef6777522",
85849
86360
  CONTRACT_VERSION_REGISTRY_IMPL: "0xF3389De4bCeC735e4F6d35b9f71170D96037D1B7",
85850
86361
  USDC_TOKEN: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
85851
- MOCK_USDC_TOKEN: "0x96409A98e0D322d6566b7F44a0fAbD1BD4ce2AEc",
85852
- MOCK_USDT_TOKEN: "0xF8b7fB38b17a310960E47805Be9adba0b0e0394D",
85853
86362
  POSITION_DELEGATE_REGISTRY: "0x482369De283622E7b05731875ec137d4E3D208F9",
85854
86363
  POSITION_DELEGATE_REGISTRY_IMPL: "0xc681c48688cdAA966119E265e4a378ef8Fe0eBcA",
85855
86364
  AGENT_MODULE: "0xefb8C29C1e7e92ed7d81a52dbedaed74e37fe380",
@@ -85864,7 +86373,7 @@ var SEPOLIA_DEPLOYMENT2 = {
85864
86373
  STUCD_VAULT: "0xc04Dd4d6799FFDE57feAfD5B3B1B038827014fd3",
85865
86374
  STUCD_VAULT_IMPL: "0xd596A866ee5273aedaC21BC6e88649E087fC8EcB",
85866
86375
  STUSDC_VAULT: "0x7aBac04d4Bf2b3A63AF363B9527970791346463a",
85867
- STUSDC_VAULT_IMPL: "0x3619b14C23c5F7d950EF845481C2299939873004",
86376
+ STUSDC_VAULT_IMPL: "0xE94DFBacA21fEFB0BB2e95D33510Ca702d2b6c5f",
85868
86377
  CARRY_FEE_RECEIVER: "0x2C8e54f099Cf479182D7c87D76FeD88b4172cdB4",
85869
86378
  CARRY_FEE_RECEIVER_IMPL: "0x3a86A23ff3cd6c26B1Fa2C5aeBAeEEdbF6095D69",
85870
86379
  FEE_RECOGNITION_LEDGER: "0xA5EBfb856fe2b847cC6011B0fe2dB6ACE63D6C3c",
@@ -86135,7 +86644,7 @@ function eqAddr3(a, b) {
86135
86644
  if (!a || !b)
86136
86645
  return false;
86137
86646
  try {
86138
- return import_ethers40.ethers.getAddress(a) === import_ethers40.ethers.getAddress(b);
86647
+ return import_ethers42.ethers.getAddress(a) === import_ethers42.ethers.getAddress(b);
86139
86648
  } catch {
86140
86649
  return false;
86141
86650
  }
@@ -86201,7 +86710,7 @@ function readValue3(tx2) {
86201
86710
  }
86202
86711
  function normalizePositionId3(id) {
86203
86712
  const hex = id.startsWith("0x") ? id : `0x${id}`;
86204
- return import_ethers40.ethers.zeroPadValue(hex, 32).toLowerCase();
86713
+ return import_ethers42.ethers.zeroPadValue(hex, 32).toLowerCase();
86205
86714
  }
86206
86715
  function requirePositionId2(actual, expected) {
86207
86716
  const txPositionId = String(actual).toLowerCase();
@@ -86460,6 +86969,53 @@ function validateUnsignedTx3(unsignedTx, expected, vctx) {
86460
86969
  }
86461
86970
  break;
86462
86971
  }
86972
+ case "desk-approve": {
86973
+ if (name !== "approve") {
86974
+ throw new TxValidationError3(`expected ERC-20 approve, decoded ${name}`);
86975
+ }
86976
+ if (!eqAddr3(to, expected.tokenAddress)) {
86977
+ throw new TxValidationError3(`approve must target the token (${expected.tokenAddress}), got ${to}`);
86978
+ }
86979
+ if (!eqAddr3(String(args[0]), expected.vaultAddress)) {
86980
+ throw new TxValidationError3(`approve spender must be the StUSDCVault (${expected.vaultAddress}), got ${String(args[0])}`);
86981
+ }
86982
+ if (BigInt(String(args[1])).toString() !== expected.amount) {
86983
+ throw new TxValidationError3(
86984
+ `approve amount must be EXACTLY ${expected.amount} (exact-amount rule), got ${BigInt(String(args[1]))}`
86985
+ );
86986
+ }
86987
+ break;
86988
+ }
86989
+ case "desk-sell": {
86990
+ if (name !== "sellUCD")
86991
+ throw new TxValidationError3(`expected sellUCD, decoded ${name}`);
86992
+ if (!eqAddr3(to, expected.vaultAddress)) {
86993
+ throw new TxValidationError3(`sellUCD must target the StUSDCVault (${expected.vaultAddress}), got ${to}`);
86994
+ }
86995
+ if (BigInt(String(args[0])).toString() !== expected.amountUcdWei)
86996
+ throw new TxValidationError3(`sellUCD amountUCD mismatch`);
86997
+ if (BigInt(String(args[1])).toString() !== expected.minUsdc)
86998
+ throw new TxValidationError3(`sellUCD minUSDC mismatch`);
86999
+ if (BigInt(expected.minUsdc) === 0n) {
87000
+ throw new TxValidationError3(`sellUCD minUSDC is 0 \u2014 a slippage floor is mandatory`);
87001
+ }
87002
+ break;
87003
+ }
87004
+ case "desk-buy": {
87005
+ if (name !== "buyUCD")
87006
+ throw new TxValidationError3(`expected buyUCD, decoded ${name}`);
87007
+ if (!eqAddr3(to, expected.vaultAddress)) {
87008
+ throw new TxValidationError3(`buyUCD must target the StUSDCVault (${expected.vaultAddress}), got ${to}`);
87009
+ }
87010
+ if (BigInt(String(args[0])).toString() !== expected.amountUsdc)
87011
+ throw new TxValidationError3(`buyUCD amountUSDC mismatch`);
87012
+ if (BigInt(String(args[1])).toString() !== expected.minUcdWei)
87013
+ throw new TxValidationError3(`buyUCD minUCD mismatch`);
87014
+ if (BigInt(expected.minUcdWei) === 0n) {
87015
+ throw new TxValidationError3(`buyUCD minUCD is 0 \u2014 a slippage floor is mandatory`);
87016
+ }
87017
+ break;
87018
+ }
86463
87019
  default: {
86464
87020
  const _exhaustive = expected;
86465
87021
  throw new TxValidationError3(`unhandled expected action kind: ${JSON.stringify(_exhaustive)}`);
@@ -86494,38 +87050,38 @@ function buildPsmRedeemTx3(p) {
86494
87050
  };
86495
87051
  }
86496
87052
  var PSM_READS_ABI2 = ["function supportedStablecoins(address) view returns (bool)"];
86497
- var ERC20_READS_ABI2 = ["function allowance(address owner, address spender) view returns (uint256)"];
87053
+ var ERC20_READS_ABI3 = ["function allowance(address owner, address spender) view returns (uint256)"];
86498
87054
  function psmExchangeReadsFromProvider2(provider, psmAddress) {
86499
- const psm = new import_ethers43.ethers.Contract(psmAddress, PSM_READS_ABI2, provider);
87055
+ const psm = new import_ethers45.ethers.Contract(psmAddress, PSM_READS_ABI2, provider);
86500
87056
  return {
86501
87057
  isStablecoinSupported: async (stablecoin) => await psm.getFunction("supportedStablecoins")(stablecoin),
86502
- allowance: async (token, owner, spender) => await new import_ethers43.ethers.Contract(token, ERC20_READS_ABI2, provider).getFunction("allowance")(owner, spender)
87058
+ allowance: async (token, owner, spender) => await new import_ethers45.ethers.Contract(token, ERC20_READS_ABI3, provider).getFunction("allowance")(owner, spender)
86503
87059
  };
86504
87060
  }
86505
- var refuse2 = (direction, msg) => new TxValidationError3(msg, `PSM ${direction}`);
86506
- function requireAddress2(direction, label, value) {
86507
- if (!value || !import_ethers43.ethers.isAddress(value)) {
86508
- throw refuse2(direction, `${label} address is missing or invalid (${String(value)})`);
87061
+ var refuse3 = (direction, msg) => new TxValidationError3(msg, `PSM ${direction}`);
87062
+ function requireAddress3(direction, label, value) {
87063
+ if (!value || !import_ethers45.ethers.isAddress(value)) {
87064
+ throw refuse3(direction, `${label} address is missing or invalid (${String(value)})`);
86509
87065
  }
86510
- return import_ethers43.ethers.getAddress(value);
87066
+ return import_ethers45.ethers.getAddress(value);
86511
87067
  }
86512
87068
  async function planPsmExchange2(params) {
86513
87069
  const { direction, amountIn, minOut, vctx, reads } = params;
86514
87070
  const chainId = vctx.chainId;
86515
87071
  if (amountIn <= 0n) {
86516
- throw refuse2(direction, `amount must be greater than zero (got ${amountIn})`);
87072
+ throw refuse3(direction, `amount must be greater than zero (got ${amountIn})`);
86517
87073
  }
86518
87074
  if (minOut <= 0n) {
86519
- throw refuse2(direction, `minimum-out floor must be greater than zero (got ${minOut}) \u2014 a zero floor is refused on-chain`);
87075
+ throw refuse3(direction, `minimum-out floor must be greater than zero (got ${minOut}) \u2014 a zero floor is refused on-chain`);
86520
87076
  }
86521
- const owner = requireAddress2(direction, "owner", params.owner);
86522
- const psm = requireAddress2(direction, "SimplePSMV2", params.addresses.psm);
86523
- const stablecoin = requireAddress2(direction, "stablecoin", params.addresses.stablecoin);
87077
+ const owner = requireAddress3(direction, "owner", params.owner);
87078
+ const psm = requireAddress3(direction, "SimplePSMV2", params.addresses.psm);
87079
+ const stablecoin = requireAddress3(direction, "stablecoin", params.addresses.stablecoin);
86524
87080
  const isSwap = direction === "swap";
86525
- const token = isSwap ? stablecoin : requireAddress2(direction, "UCDToken", params.addresses.ucdToken);
86526
- const spender = isSwap ? psm : requireAddress2(direction, "UCDController", params.addresses.ucdController);
87081
+ const token = isSwap ? stablecoin : requireAddress3(direction, "UCDToken", params.addresses.ucdToken);
87082
+ const spender = isSwap ? psm : requireAddress3(direction, "UCDController", params.addresses.ucdController);
86527
87083
  if (!await reads.isStablecoinSupported(stablecoin)) {
86528
- throw refuse2(direction, `stablecoin ${stablecoin} is not supported by the PSM at ${psm}`);
87084
+ throw refuse3(direction, `stablecoin ${stablecoin} is not supported by the PSM at ${psm}`);
86529
87085
  }
86530
87086
  const approveExpected = (amount) => isSwap ? { kind: "stablecoin-approve", tokenAddress: token, spender, amountUnits: amount.toString() } : { kind: "ucd-approve-controller", ucdTokenAddress: token, spender, amountWei: amount.toString() };
86531
87087
  const allowanceBefore = await reads.allowance(token, owner, spender);
@@ -86692,7 +87248,7 @@ function assertSignableTypedData(chainId, domain, types, primaryType, message) {
86692
87248
  if (structNames.length !== 1) {
86693
87249
  throw new TypedDataRefused(`expected exactly one struct type, got ${structNames.join(", ") || "none"}`);
86694
87250
  }
86695
- const derived = import_ethers44.TypedDataEncoder.getPrimaryType(structs);
87251
+ const derived = import_ethers47.TypedDataEncoder.getPrimaryType(structs);
86696
87252
  if (derived !== primaryType) {
86697
87253
  throw new TypedDataRefused(`primaryType "${primaryType}" does not match the types' primary "${derived}"`);
86698
87254
  }
@@ -86784,7 +87340,7 @@ var SUPPORTED_STABLECOINS = `
86784
87340
  }`;
86785
87341
 
86786
87342
  // src/boundary/upstream/real/psm-calls.ts
86787
- var import_ethers45 = require("ethers");
87343
+ var import_ethers48 = require("ethers");
86788
87344
  var PSM_VIEW_FRAGMENTS = [
86789
87345
  "function VERSION() view returns (string)",
86790
87346
  "function supportedStablecoins(address) view returns (bool)",
@@ -86853,8 +87409,8 @@ var PsmCalls = class {
86853
87409
  constructor(deps) {
86854
87410
  this.deps = deps;
86855
87411
  const abi = [...PSM_VIEW_FRAGMENTS, ...PSM_ERROR_FRAGMENTS];
86856
- this.iface = new import_ethers45.ethers.Interface(abi);
86857
- this.psm = new import_ethers45.ethers.Contract(deps.psmAddress, abi, deps.provider);
87412
+ this.iface = new import_ethers48.ethers.Interface(abi);
87413
+ this.psm = new import_ethers48.ethers.Contract(deps.psmAddress, abi, deps.provider);
86858
87414
  }
86859
87415
  psm;
86860
87416
  iface;
@@ -86883,8 +87439,8 @@ var PsmCalls = class {
86883
87439
  });
86884
87440
  }
86885
87441
  return this.call(async () => {
86886
- const ucd = new import_ethers45.ethers.Contract(ucdToken, ERC20_FRAGMENTS, this.deps.provider);
86887
- const stable = new import_ethers45.ethers.Contract(this.deps.stablecoinAddress, ERC20_FRAGMENTS, this.deps.provider);
87442
+ const ucd = new import_ethers48.ethers.Contract(ucdToken, ERC20_FRAGMENTS, this.deps.provider);
87443
+ const stable = new import_ethers48.ethers.Contract(this.deps.stablecoinAddress, ERC20_FRAGMENTS, this.deps.provider);
86888
87444
  const [ucdWei, stablecoinUnits] = await Promise.all([ucd["balanceOf"](holder), stable["balanceOf"](holder)]);
86889
87445
  return { ucdWei: ucdWei.toString(), stablecoinUnits: stablecoinUnits.toString() };
86890
87446
  });
@@ -87002,7 +87558,7 @@ var PsmCalls = class {
87002
87558
  };
87003
87559
 
87004
87560
  // src/boundary/upstream/real/session.ts
87005
- var import_ethers46 = require("ethers");
87561
+ var import_ethers49 = require("ethers");
87006
87562
  var REFRESH_LEEWAY_SEC = 30;
87007
87563
  var LOGIN_TYPES_WITH_AUDIENCE3 = {
87008
87564
  DiamondHands: [
@@ -87050,7 +87606,7 @@ var LitOpsSession = class {
87050
87606
  const message = {
87051
87607
  address: this.wallet.address,
87052
87608
  issuedAt: Math.floor(Date.now() / 1e3),
87053
- nonce: "0x" + Buffer.from(import_ethers46.ethers.randomBytes(32)).toString("hex"),
87609
+ nonce: "0x" + Buffer.from(import_ethers49.ethers.randomBytes(32)).toString("hex"),
87054
87610
  audience: this.serviceEndpoint
87055
87611
  };
87056
87612
  const signature = await this.wallet.signTypedData(
@@ -87092,7 +87648,7 @@ function decodeJwtExp(token) {
87092
87648
  }
87093
87649
 
87094
87650
  // src/boundary/upstream/real/write-ops.ts
87095
- var import_ethers48 = require("ethers");
87651
+ var import_ethers51 = require("ethers");
87096
87652
 
87097
87653
  // src/signer/types.ts
87098
87654
  var OperationDeclined = class extends Error {
@@ -87102,7 +87658,7 @@ var OperationDeclined = class extends Error {
87102
87658
  init_tx_validator();
87103
87659
 
87104
87660
  // src/boundary/upstream/shared/external-bridge/page-crypto.ts
87105
- var import_ethers47 = require("ethers");
87661
+ var import_ethers50 = require("ethers");
87106
87662
  var PERSONAL_SIGN_LAYOUTS = {
87107
87663
  "dh-op-envelope-v1": {
87108
87664
  types: ["bytes32", "uint256", "uint256", "uint256", "bytes32"],
@@ -87117,9 +87673,9 @@ function hashForLayout(layout, fields) {
87117
87673
  const values = def.fieldOrder.map((name) => {
87118
87674
  const raw = fields[name];
87119
87675
  if (raw === void 0) throw new Error(`page-crypto: layout "${layout}" missing field "${name}"`);
87120
- return hashUtf8.has(name) ? import_ethers47.ethers.keccak256(import_ethers47.ethers.toUtf8Bytes(raw)) : raw;
87676
+ return hashUtf8.has(name) ? import_ethers50.ethers.keccak256(import_ethers50.ethers.toUtf8Bytes(raw)) : raw;
87121
87677
  });
87122
- return import_ethers47.ethers.solidityPackedKeccak256(def.types, values);
87678
+ return import_ethers50.ethers.solidityPackedKeccak256(def.types, values);
87123
87679
  }
87124
87680
  var PAGE_CRYPTO_JS = `"use strict";
87125
87681
  (function () {
@@ -87358,7 +87914,7 @@ function mcpExpected(leg) {
87358
87914
  }
87359
87915
  var OP_LAYOUT = "dh-op-envelope-v1";
87360
87916
  function randomNonceHex() {
87361
- return "0x" + Buffer.from(import_ethers48.ethers.randomBytes(16)).toString("hex");
87917
+ return "0x" + Buffer.from(import_ethers51.ethers.randomBytes(16)).toString("hex");
87362
87918
  }
87363
87919
  async function postJson(url2, body, headers) {
87364
87920
  const res = await fetch(url2, {
@@ -87426,7 +87982,7 @@ function buildWriteOps(deps) {
87426
87982
  return {
87427
87983
  to: String(tx2["to"] ?? ""),
87428
87984
  data: String(tx2["data"] ?? "0x"),
87429
- value: tx2["value"] != null ? import_ethers48.ethers.toBeHex(BigInt(String(tx2["value"]))) : "0x0",
87985
+ value: tx2["value"] != null ? import_ethers51.ethers.toBeHex(BigInt(String(tx2["value"]))) : "0x0",
87430
87986
  chainId: tx2["chainId"] != null ? Number(tx2["chainId"]) : chainId
87431
87987
  };
87432
87988
  }
@@ -87592,7 +88148,7 @@ function buildWriteOps(deps) {
87592
88148
  mintedUcdWei: minted,
87593
88149
  feeUcdWei: mintFee,
87594
88150
  echoedAmountUcdWei: minted,
87595
- authorization: auth(action, `mint ${import_ethers48.ethers.formatEther(amountWei)} UCD against ${p.positionId}`, r.value.digest)
88151
+ authorization: auth(action, `mint ${import_ethers51.ethers.formatEther(amountWei)} UCD against ${p.positionId}`, r.value.digest)
87596
88152
  },
87597
88153
  { id: SOURCE5, kind: "lit-ops", fetchedAt: (/* @__PURE__ */ new Date()).toISOString() }
87598
88154
  );
@@ -87633,7 +88189,7 @@ function buildWriteOps(deps) {
87633
88189
  txRef: { kind: "eth-tx", id: r.value.txHash },
87634
88190
  paidUcdWei: paid,
87635
88191
  echoedAmountUcdWei: paid,
87636
- authorization: auth(action, `repay ${import_ethers48.ethers.formatEther(amountWei)} UCD on ${p.positionId}`, r.value.digest)
88192
+ authorization: auth(action, `repay ${import_ethers51.ethers.formatEther(amountWei)} UCD on ${p.positionId}`, r.value.digest)
87637
88193
  },
87638
88194
  { id: SOURCE5, kind: "lit-ops", fetchedAt: (/* @__PURE__ */ new Date()).toISOString() }
87639
88195
  );
@@ -87896,7 +88452,7 @@ function buildWriteOps(deps) {
87896
88452
  }
87897
88453
 
87898
88454
  // src/signer/eoa-dh.ts
87899
- var import_ethers49 = require("ethers");
88455
+ var import_ethers52 = require("ethers");
87900
88456
  var EoaDHSigner = class {
87901
88457
  constructor(wallet, broadcast, clock = Date.now) {
87902
88458
  this.wallet = wallet;
@@ -87913,7 +88469,7 @@ var EoaDHSigner = class {
87913
88469
  async signAuthorization(spec) {
87914
88470
  const quantumTs = nextQuantumTimestamp(this.clock());
87915
88471
  const { fields, hashHex } = spec.stamp(quantumTs);
87916
- const signature = await this.wallet.signMessage(import_ethers49.ethers.getBytes(hashHex));
88472
+ const signature = await this.wallet.signMessage(import_ethers52.ethers.getBytes(hashHex));
87917
88473
  return { signature, quantumTs, fields };
87918
88474
  }
87919
88475
  async wrapInnerTx(innerTx) {
@@ -87931,13 +88487,13 @@ var EoaDHSigner = class {
87931
88487
 
87932
88488
  // src/signer/external-eoa.ts
87933
88489
  var import_node_crypto7 = require("crypto");
87934
- var import_ethers53 = require("ethers");
88490
+ var import_ethers56 = require("ethers");
87935
88491
 
87936
88492
  // src/boundary/upstream/shared/external-bridge/bridge.ts
87937
88493
  var fs4 = __toESM(require("fs"));
87938
88494
  var http3 = __toESM(require("http"));
87939
88495
  var import_node_crypto6 = require("crypto");
87940
- var import_ethers51 = require("ethers");
88496
+ var import_ethers54 = require("ethers");
87941
88497
 
87942
88498
  // src/util/brand-assets.ts
87943
88499
  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>`;
@@ -88547,7 +89103,7 @@ function presenceStatement(origin2, chainId, nonce) {
88547
89103
  }
88548
89104
  function recoverPresenceSigner(statement, signature) {
88549
89105
  try {
88550
- return import_ethers51.ethers.verifyMessage(statement, signature);
89106
+ return import_ethers54.ethers.verifyMessage(statement, signature);
88551
89107
  } catch {
88552
89108
  return null;
88553
89109
  }
@@ -89794,7 +90350,7 @@ data: ${JSON.stringify(payload)}
89794
90350
  };
89795
90351
 
89796
90352
  // src/boundary/upstream/shared/external-bridge/verify-landed-tx.ts
89797
- var import_ethers52 = require("ethers");
90353
+ var import_ethers55 = require("ethers");
89798
90354
  function eq2(a, b) {
89799
90355
  return a.toLowerCase() === b.toLowerCase();
89800
90356
  }
@@ -89817,7 +90373,7 @@ function compareLandedTx(landed, approved, borrower) {
89817
90373
  return { status: "verified", from: landed.from, hash: landed.hash };
89818
90374
  }
89819
90375
  function verifyRawSignedTx(rawSignedTx, approved, borrower) {
89820
- const parsed = import_ethers52.ethers.Transaction.from(rawSignedTx);
90376
+ const parsed = import_ethers55.ethers.Transaction.from(rawSignedTx);
89821
90377
  if (!parsed.from || !parsed.to || !parsed.hash) {
89822
90378
  return { status: "mismatch", hash: parsed.hash ?? "0x", reason: "the returned raw transaction is unsigned or malformed" };
89823
90379
  }
@@ -89864,7 +90420,7 @@ async function gasHintAcrossBlocks(provider, from, tx2, action) {
89864
90420
  for (let attempt = 0; attempt < 4; attempt++) {
89865
90421
  try {
89866
90422
  const est = await provider.estimateGas({ from, to: tx2.to, data: tx2.data, value: BigInt(tx2.value) });
89867
- return import_ethers53.ethers.toBeHex(est * 15n / 10n);
90423
+ return import_ethers56.ethers.toBeHex(est * 15n / 10n);
89868
90424
  } catch (e) {
89869
90425
  lastErr = e;
89870
90426
  await new Promise((r) => setTimeout(r, 13e3));
@@ -89914,7 +90470,7 @@ var ExternalEoaDHSigner = class {
89914
90470
  throw new OperationDeclined(`the ${spec.action} authorization was not signed: ${describeOutcome(outcome)}`);
89915
90471
  }
89916
90472
  const finalHash = spec.stamp(used.quantumTs).hashHex;
89917
- const recovered = import_ethers53.ethers.verifyMessage(import_ethers53.ethers.getBytes(finalHash), outcome.signature);
90473
+ const recovered = import_ethers56.ethers.verifyMessage(import_ethers56.ethers.getBytes(finalHash), outcome.signature);
89918
90474
  if (recovered.toLowerCase() !== this.deps.borrower.toLowerCase()) {
89919
90475
  throw new Error(`the ${spec.action} authorization was signed by ${recovered}, not the borrower ${this.deps.borrower}`);
89920
90476
  }
@@ -89925,7 +90481,7 @@ var ExternalEoaDHSigner = class {
89925
90481
  }
89926
90482
  async submitValidatedTx(outerTx, ctx) {
89927
90483
  const approved = toApprovedTx(outerTx, this.deps.chainId);
89928
- const gas = outerTx.gasLimit != null ? import_ethers53.ethers.toBeHex(BigInt(String(outerTx.gasLimit))) : await gasHintAcrossBlocks(this.deps.provider, this.deps.borrower, approved, ctx.action);
90484
+ const gas = outerTx.gasLimit != null ? import_ethers56.ethers.toBeHex(BigInt(String(outerTx.gasLimit))) : await gasHintAcrossBlocks(this.deps.provider, this.deps.borrower, approved, ctx.action);
89929
90485
  const outcome = await this.deps.bridge.requestSignature({
89930
90486
  id: (0, import_node_crypto7.randomUUID)(),
89931
90487
  kind: "transaction",
@@ -89959,7 +90515,7 @@ var ExternalEoaDHSigner = class {
89959
90515
  return new BridgeEthersSigner(this.deps);
89960
90516
  }
89961
90517
  };
89962
- var BridgeEthersSigner = class _BridgeEthersSigner extends import_ethers53.ethers.AbstractSigner {
90518
+ var BridgeEthersSigner = class _BridgeEthersSigner extends import_ethers56.ethers.AbstractSigner {
89963
90519
  constructor(deps) {
89964
90520
  super(deps.provider);
89965
90521
  this.deps = deps;
@@ -89970,7 +90526,7 @@ var BridgeEthersSigner = class _BridgeEthersSigner extends import_ethers53.ether
89970
90526
  return this.deps.borrower;
89971
90527
  }
89972
90528
  async signMessage(message) {
89973
- const length = typeof message === "string" ? import_ethers53.ethers.toUtf8Bytes(message).length : message.length;
90529
+ const length = typeof message === "string" ? import_ethers56.ethers.toUtf8Bytes(message).length : message.length;
89974
90530
  throw new Error(
89975
90531
  `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.`
89976
90532
  );
@@ -90023,7 +90579,7 @@ var BridgeEthersSigner = class _BridgeEthersSigner extends import_ethers53.ether
90023
90579
  const structs = Object.fromEntries(
90024
90580
  Object.entries(types).filter(([name]) => name !== "EIP712Domain").map(([name, fields]) => [name, fields.map((f) => ({ name: f.name, type: f.type }))])
90025
90581
  );
90026
- const primaryType = import_ethers53.ethers.TypedDataEncoder.getPrimaryType(structs);
90582
+ const primaryType = import_ethers56.ethers.TypedDataEncoder.getPrimaryType(structs);
90027
90583
  const { label } = this.deps.guardTypedData(this.deps.chainId, domain, structs, primaryType, message);
90028
90584
  const typedData = { domain, types: structs, primaryType, message };
90029
90585
  if (BTC_SPEND_PRIMARY_TYPES.has(primaryType)) {
@@ -90081,17 +90637,17 @@ var BridgeEthersSigner = class _BridgeEthersSigner extends import_ethers53.ether
90081
90637
  async verifyTypedSigner(typedData, signature) {
90082
90638
  const types = typedData.types;
90083
90639
  let recovered = null;
90084
- if (import_ethers53.ethers.isHexString(signature, 65)) {
90085
- const v = Number(BigInt(import_ethers53.ethers.dataSlice(signature, 64, 65)));
90640
+ if (import_ethers56.ethers.isHexString(signature, 65)) {
90641
+ const v = Number(BigInt(import_ethers56.ethers.dataSlice(signature, 64, 65)));
90086
90642
  if (v === 0 || v === 1 || v === 27 || v === 28) {
90087
- recovered = import_ethers53.ethers.verifyTypedData(typedData.domain, types, typedData.message, signature);
90643
+ recovered = import_ethers56.ethers.verifyTypedData(typedData.domain, types, typedData.message, signature);
90088
90644
  if (recovered.toLowerCase() === this.deps.borrower.toLowerCase()) return;
90089
90645
  }
90090
90646
  }
90091
90647
  const code = await this.deps.provider.getCode(this.deps.borrower);
90092
90648
  if (codeIsContractWallet(code)) {
90093
- const digest = import_ethers53.ethers.TypedDataEncoder.hash(typedData.domain, types, typedData.message);
90094
- const wallet = new import_ethers53.ethers.Contract(
90649
+ const digest = import_ethers56.ethers.TypedDataEncoder.hash(typedData.domain, types, typedData.message);
90650
+ const wallet = new import_ethers56.ethers.Contract(
90095
90651
  this.deps.borrower,
90096
90652
  ["function isValidSignature(bytes32,bytes) view returns (bytes4)"],
90097
90653
  this.deps.provider
@@ -90115,11 +90671,11 @@ var BridgeEthersSigner = class _BridgeEthersSigner extends import_ethers53.ether
90115
90671
  const approved = {
90116
90672
  to: tx2.to,
90117
90673
  data: tx2.data,
90118
- value: tx2.value != null ? import_ethers53.ethers.toBeHex(BigInt(String(tx2.value))) : "0x0",
90674
+ value: tx2.value != null ? import_ethers56.ethers.toBeHex(BigInt(String(tx2.value))) : "0x0",
90119
90675
  chainId: tx2.chainId != null ? Number(tx2.chainId) : this.deps.chainId
90120
90676
  };
90121
90677
  const card = cardForTx(approved);
90122
- const gas = tx2.gasLimit != null ? import_ethers53.ethers.toBeHex(BigInt(String(tx2.gasLimit))) : await gasHintAcrossBlocks(this.deps.provider, this.deps.borrower, approved, describeFn(approved.data));
90678
+ const gas = tx2.gasLimit != null ? import_ethers56.ethers.toBeHex(BigInt(String(tx2.gasLimit))) : await gasHintAcrossBlocks(this.deps.provider, this.deps.borrower, approved, describeFn(approved.data));
90123
90679
  const outcome = await this.deps.bridge.requestSignature({
90124
90680
  id: (0, import_node_crypto7.randomUUID)(),
90125
90681
  kind: "transaction",
@@ -90161,7 +90717,7 @@ function toApprovedTx(tx2, fallbackChainId) {
90161
90717
  return {
90162
90718
  to: tx2.to,
90163
90719
  data: tx2.data,
90164
- value: tx2.value != null ? import_ethers53.ethers.toBeHex(BigInt(String(tx2.value))) : "0x0",
90720
+ value: tx2.value != null ? import_ethers56.ethers.toBeHex(BigInt(String(tx2.value))) : "0x0",
90165
90721
  chainId: tx2.chainId != null ? Number(tx2.chainId) : fallbackChainId
90166
90722
  };
90167
90723
  }
@@ -90211,9 +90767,9 @@ var MIN_CONFIRMATIONS = { mainnet: 6, sepolia: 1 };
90211
90767
  var RealUpstreamPlugin = class {
90212
90768
  constructor(config, wallet, runtime) {
90213
90769
  this.config = config;
90214
- const rpc = new import_ethers54.ethers.FetchRequest(config.rpcUrl);
90770
+ const rpc = new import_ethers57.ethers.FetchRequest(config.rpcUrl);
90215
90771
  if (config.rpcDrpcKey !== void 0) rpc.setHeader("Drpc-Key", config.rpcDrpcKey);
90216
- this.provider = new import_ethers54.ethers.JsonRpcProvider(rpc, config.chainId);
90772
+ this.provider = new import_ethers57.ethers.JsonRpcProvider(rpc, config.chainId);
90217
90773
  this.wallet = wallet ?? null;
90218
90774
  this.runtime = runtime ?? null;
90219
90775
  this.session = wallet ? new LitOpsSession(wallet.connect(this.provider), config.serviceEndpoint, config.chainId) : null;
@@ -90520,14 +91076,14 @@ var RealUpstreamPlugin = class {
90520
91076
  if (!pkpValidation) {
90521
91077
  throw new Error(`the SDK's ${this.config.network} deployment table has no PKPValidation address \u2014 cannot verify validator version ${version}.`);
90522
91078
  }
90523
- const registry = new import_ethers54.ethers.Contract(pkpValidation, ["function validatorForVersion(uint256) view returns (address)"], this.provider);
91079
+ const registry = new import_ethers57.ethers.Contract(pkpValidation, ["function validatorForVersion(uint256) view returns (address)"], this.provider);
90524
91080
  let validator;
90525
91081
  try {
90526
91082
  validator = await registry.validatorForVersion(version);
90527
91083
  } catch (e) {
90528
91084
  throw new Error(`could not verify validator version ${version} on-chain (PKPValidation ${pkpValidation}): ${e.message}`);
90529
91085
  }
90530
- if (validator === import_ethers54.ethers.ZeroAddress) {
91086
+ if (validator === import_ethers57.ethers.ZeroAddress) {
90531
91087
  throw new Error(
90532
91088
  `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.`
90533
91089
  );
@@ -90820,7 +91376,7 @@ var RealUpstreamPlugin = class {
90820
91376
  );
90821
91377
  if (!r.ok) return r;
90822
91378
  const raw = r.value.data.supportedStablecoins ?? [];
90823
- const bad = raw.find((x) => !import_ethers54.ethers.isAddress(String(x.address)) || !Number.isFinite(Number(x.decimals)));
91379
+ const bad = raw.find((x) => !import_ethers57.ethers.isAddress(String(x.address)) || !Number.isFinite(Number(x.decimals)));
90824
91380
  if (bad) {
90825
91381
  return {
90826
91382
  ok: false,
@@ -90903,7 +91459,7 @@ var RealUpstreamPlugin = class {
90903
91459
  };
90904
91460
  }
90905
91461
  const symbol = raw.toLowerCase();
90906
- if (import_ethers54.ethers.isAddress(raw)) return this.psmCallsFor(symbol);
91462
+ if (import_ethers57.ethers.isAddress(raw)) return this.psmCallsFor(symbol);
90907
91463
  const verified = await this.verifiedStablecoins();
90908
91464
  if (!verified.ok) return { ok: false, failure: verified.failure };
90909
91465
  const hits = verified.rows.filter((r) => r.symbol.toLowerCase() === symbol);
@@ -90941,7 +91497,7 @@ var RealUpstreamPlugin = class {
90941
91497
  * chain, then sign.
90942
91498
  */
90943
91499
  async psmCallsFor(stablecoinAddress) {
90944
- if (!import_ethers54.ethers.isAddress(stablecoinAddress)) {
91500
+ if (!import_ethers57.ethers.isAddress(stablecoinAddress)) {
90945
91501
  throw new Error(`psmCallsFor requires a resolved 0x address, got '${stablecoinAddress}' \u2014 resolve through psmCallsForChoice`);
90946
91502
  }
90947
91503
  const key = stablecoinAddress.toLowerCase();
@@ -90960,7 +91516,7 @@ var RealUpstreamPlugin = class {
90960
91516
  }
90961
91517
  let supported;
90962
91518
  try {
90963
- const psm = new import_ethers54.ethers.Contract(psmAddress, ["function supportedStablecoins(address) view returns (bool)"], this.provider);
91519
+ const psm = new import_ethers57.ethers.Contract(psmAddress, ["function supportedStablecoins(address) view returns (bool)"], this.provider);
90964
91520
  supported = await psm["supportedStablecoins"](key);
90965
91521
  } catch (e) {
90966
91522
  return { ok: false, failure: { kind: "unavailable", source: "chain-rpc", message: `PSM stablecoin check failed for ${key}: ${e.message}` } };
@@ -90977,7 +91533,7 @@ var RealUpstreamPlugin = class {
90977
91533
  }
90978
91534
  let symbol;
90979
91535
  try {
90980
- const erc20 = new import_ethers54.ethers.Contract(key, ["function symbol() view returns (string)"], this.provider);
91536
+ const erc20 = new import_ethers57.ethers.Contract(key, ["function symbol() view returns (string)"], this.provider);
90981
91537
  symbol = await erc20["symbol"]();
90982
91538
  } catch (e) {
90983
91539
  return { ok: false, failure: { kind: "unavailable", source: "chain-rpc", message: `PSM stablecoin symbol read failed for ${key}: ${e.message}` } };
@@ -91192,7 +91748,7 @@ var RealUpstreamPlugin = class {
91192
91748
  const pm = this.contracts["PositionManager"];
91193
91749
  if (!pm) return false;
91194
91750
  try {
91195
- const c = new import_ethers54.ethers.Contract(pm, PAUSABLE_ABI, this.provider);
91751
+ const c = new import_ethers57.ethers.Contract(pm, PAUSABLE_ABI, this.provider);
91196
91752
  return Boolean(await c["paused"]());
91197
91753
  } catch {
91198
91754
  return false;
@@ -91201,10 +91757,10 @@ var RealUpstreamPlugin = class {
91201
91757
  async readPositionDetails(id) {
91202
91758
  const core = this.contracts["PositionManagerCoreModule"] ?? this.contracts["PositionManager"];
91203
91759
  if (!core) throw new Error(`no PositionManager address for network ${this.config.network}`);
91204
- const c = new import_ethers54.ethers.Contract(core, POSITION_DETAILS_ABI, this.provider);
91760
+ const c = new import_ethers57.ethers.Contract(core, POSITION_DETAILS_ABI, this.provider);
91205
91761
  let d;
91206
91762
  try {
91207
- d = await c["getPositionDetails"](import_ethers54.ethers.zeroPadValue(id, 32));
91763
+ d = await c["getPositionDetails"](import_ethers57.ethers.zeroPadValue(id, 32));
91208
91764
  } catch (e) {
91209
91765
  if (isContractRevert(e)) return null;
91210
91766
  const nodeMessage = e.info?.error?.message;
@@ -91214,7 +91770,7 @@ var RealUpstreamPlugin = class {
91214
91770
  throw e;
91215
91771
  }
91216
91772
  const borrower = String(d["borrower"]);
91217
- if (borrower === import_ethers54.ethers.ZeroAddress) return null;
91773
+ if (borrower === import_ethers57.ethers.ZeroAddress) return null;
91218
91774
  return {
91219
91775
  positionId: String(d["positionId"]),
91220
91776
  pkpId: String(d["pkpId"]),
@@ -91420,7 +91976,7 @@ async function createRealBoundary(config, wallet, overrides) {
91420
91976
  const manager = new SignerManager({
91421
91977
  persistence: overrides?.signerPersistence?.(config.network) ?? fileSignerPersistence(stateFile),
91422
91978
  initialMode,
91423
- ...overrides?.boundBorrower ? { authenticatedBorrower: import_ethers55.ethers.getAddress(overrides.boundBorrower) } : {},
91979
+ ...overrides?.boundBorrower ? { authenticatedBorrower: import_ethers58.ethers.getAddress(overrides.boundBorrower) } : {},
91424
91980
  candidate: () => bridge.walletState()?.account ?? null,
91425
91981
  pendingCeremonies: () => bridge.pendingCount(),
91426
91982
  keystore
@@ -91498,7 +92054,7 @@ mime-types/index.js:
91498
92054
  *)
91499
92055
 
91500
92056
  axios/dist/node/axios.cjs:
91501
- (*! Axios v1.21.0 Copyright (c) 2026 Matt Zabriskie and contributors *)
92057
+ (*! Axios v1.21.1 Copyright (c) 2026 Matt Zabriskie and contributors *)
91502
92058
 
91503
92059
  safe-buffer/index.js:
91504
92060
  (*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)