@gvnrdao/dh-mcp 0.5.18 → 0.5.19
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 +551 -195
- package/dist/connector-embed.js +560 -204
- package/dist/connector.js +560 -204
- package/dist/index.js +560 -204
- package/package.json +2 -2
package/dist/connector-embed.js
CHANGED
|
@@ -15552,7 +15552,7 @@ ${errorReport}`);
|
|
|
15552
15552
|
}
|
|
15553
15553
|
init_debug_logger();
|
|
15554
15554
|
init_session_signature_cache();
|
|
15555
|
-
var
|
|
15555
|
+
var import_ethers54 = require("ethers");
|
|
15556
15556
|
var EXPIRED_LOAN_MIN_LIQUIDATION_THRESHOLD_BPS = 11e3;
|
|
15557
15557
|
var GRACE_PERIOD_DAYS = 30;
|
|
15558
15558
|
var SATOSHIS_PER_BITCOIN = 100000000n;
|
|
@@ -18468,12 +18468,12 @@ ${auth.clientId}`;
|
|
|
18468
18468
|
}
|
|
18469
18469
|
async function executeVaultSnapshot(params) {
|
|
18470
18470
|
global.ethers = {
|
|
18471
|
-
...
|
|
18471
|
+
...import_ethers54.ethers,
|
|
18472
18472
|
providers: {
|
|
18473
|
-
StaticJsonRpcProvider:
|
|
18473
|
+
StaticJsonRpcProvider: import_ethers54.ethers.JsonRpcProvider
|
|
18474
18474
|
},
|
|
18475
|
-
Contract:
|
|
18476
|
-
utils:
|
|
18475
|
+
Contract: import_ethers54.ethers.Contract,
|
|
18476
|
+
utils: import_ethers54.ethers
|
|
18477
18477
|
// v6 moved utils to top level
|
|
18478
18478
|
};
|
|
18479
18479
|
global.Lit = {
|
|
@@ -40952,7 +40952,7 @@ function htmlPageSecurityHeaders(extra) {
|
|
|
40952
40952
|
}
|
|
40953
40953
|
|
|
40954
40954
|
// src/version.ts
|
|
40955
|
-
var SERVER_VERSION = "0.5.
|
|
40955
|
+
var SERVER_VERSION = "0.5.19";
|
|
40956
40956
|
|
|
40957
40957
|
// src/connector/siwe-oauth.ts
|
|
40958
40958
|
var import_node_crypto2 = require("crypto");
|
|
@@ -41672,7 +41672,7 @@ function resolveRealConfig(env) {
|
|
|
41672
41672
|
|
|
41673
41673
|
// src/boot.ts
|
|
41674
41674
|
var fs6 = __toESM(require("fs"));
|
|
41675
|
-
var
|
|
41675
|
+
var import_ethers51 = require("ethers");
|
|
41676
41676
|
|
|
41677
41677
|
// src/boundary/index.ts
|
|
41678
41678
|
var import_node_crypto9 = require("crypto");
|
|
@@ -46297,7 +46297,7 @@ var SafeModuleCeremony = class {
|
|
|
46297
46297
|
};
|
|
46298
46298
|
|
|
46299
46299
|
// src/boundary/upstream/real/plugin.ts
|
|
46300
|
-
var
|
|
46300
|
+
var import_ethers50 = require("ethers");
|
|
46301
46301
|
|
|
46302
46302
|
// node_modules/@gvnrdao/dh-sdk/dist/index.mjs
|
|
46303
46303
|
var import_ethers14 = require("ethers");
|
|
@@ -46309,6 +46309,7 @@ var import_ethers19 = require("ethers");
|
|
|
46309
46309
|
var import_ethers20 = require("ethers");
|
|
46310
46310
|
var import_ethers21 = require("ethers");
|
|
46311
46311
|
var import_ethers22 = require("ethers");
|
|
46312
|
+
var import_ethers23 = require("ethers");
|
|
46312
46313
|
|
|
46313
46314
|
// node_modules/@noble/hashes/esm/utils.js
|
|
46314
46315
|
function isBytes(a) {
|
|
@@ -46756,11 +46757,11 @@ var ripemd1602 = ripemd160;
|
|
|
46756
46757
|
// node_modules/@gvnrdao/dh-sdk/dist/index.mjs
|
|
46757
46758
|
var import_bech32 = __toESM(require_dist(), 1);
|
|
46758
46759
|
var import_bs58check = __toESM(require_bs58check(), 1);
|
|
46759
|
-
var import_ethers23 = require("ethers");
|
|
46760
46760
|
var import_ethers24 = require("ethers");
|
|
46761
46761
|
var import_ethers25 = require("ethers");
|
|
46762
46762
|
var import_ethers26 = require("ethers");
|
|
46763
46763
|
var import_ethers27 = require("ethers");
|
|
46764
|
+
var import_ethers28 = require("ethers");
|
|
46764
46765
|
|
|
46765
46766
|
// node_modules/axios/lib/helpers/bind.js
|
|
46766
46767
|
function bind(fn, thisArg) {
|
|
@@ -52385,7 +52386,6 @@ var {
|
|
|
52385
52386
|
} = axios_default;
|
|
52386
52387
|
|
|
52387
52388
|
// node_modules/@gvnrdao/dh-sdk/dist/index.mjs
|
|
52388
|
-
var import_ethers28 = require("ethers");
|
|
52389
52389
|
var import_ethers29 = require("ethers");
|
|
52390
52390
|
var import_ethers30 = require("ethers");
|
|
52391
52391
|
var import_ethers31 = require("ethers");
|
|
@@ -52394,6 +52394,7 @@ var import_ethers33 = require("ethers");
|
|
|
52394
52394
|
var import_ethers34 = require("ethers");
|
|
52395
52395
|
var import_dh_lit_ops = __toESM(require_dist3(), 1);
|
|
52396
52396
|
var import_ethers35 = require("ethers");
|
|
52397
|
+
var import_ethers36 = require("ethers");
|
|
52397
52398
|
var __create2 = Object.create;
|
|
52398
52399
|
var __defProp2 = Object.defineProperty;
|
|
52399
52400
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -54756,7 +54757,7 @@ ${errorReport}`);
|
|
|
54756
54757
|
}
|
|
54757
54758
|
init_debug_logger();
|
|
54758
54759
|
init_session_signature_cache();
|
|
54759
|
-
var
|
|
54760
|
+
var import_ethers242 = __require("ethers");
|
|
54760
54761
|
var EXPIRED_LOAN_MIN_LIQUIDATION_THRESHOLD_BPS = 11e3;
|
|
54761
54762
|
var GRACE_PERIOD_DAYS = 30;
|
|
54762
54763
|
var SATOSHIS_PER_BITCOIN = 100000000n;
|
|
@@ -57684,12 +57685,12 @@ ${auth.clientId}`;
|
|
|
57684
57685
|
}
|
|
57685
57686
|
async function executeVaultSnapshot(params) {
|
|
57686
57687
|
global.ethers = {
|
|
57687
|
-
...
|
|
57688
|
+
...import_ethers242.ethers,
|
|
57688
57689
|
providers: {
|
|
57689
|
-
StaticJsonRpcProvider:
|
|
57690
|
+
StaticJsonRpcProvider: import_ethers242.ethers.JsonRpcProvider
|
|
57690
57691
|
},
|
|
57691
|
-
Contract:
|
|
57692
|
-
utils:
|
|
57692
|
+
Contract: import_ethers242.ethers.Contract,
|
|
57693
|
+
utils: import_ethers242.ethers
|
|
57693
57694
|
// v6 moved utils to top level
|
|
57694
57695
|
};
|
|
57695
57696
|
global.Lit = {
|
|
@@ -58465,14 +58466,49 @@ var SDKError = class _SDKError extends Error {
|
|
|
58465
58466
|
};
|
|
58466
58467
|
}
|
|
58467
58468
|
};
|
|
58469
|
+
var MAX_GAS_LIMIT = 5000000n;
|
|
58470
|
+
var MAX_FEE_PER_GAS_WEI = 2000000000000n;
|
|
58471
|
+
var DEFAULT_MAX_TX_FEE_WEI = 250000000000000000n;
|
|
58472
|
+
var PRIORITY_FEE_FLOOR_WEI = 100000000n;
|
|
58473
|
+
var PRIORITY_FEE_CAP_WEI = 3000000000n;
|
|
58474
|
+
var DEFAULT_FEE_CEILING = {
|
|
58475
|
+
maxGasLimit: MAX_GAS_LIMIT,
|
|
58476
|
+
maxFeePerGasWei: MAX_FEE_PER_GAS_WEI,
|
|
58477
|
+
maxTxFeeWei: DEFAULT_MAX_TX_FEE_WEI
|
|
58478
|
+
};
|
|
58479
|
+
function fmtEth(wei) {
|
|
58480
|
+
return `${import_ethers16.ethers.formatEther(wei)} ETH`;
|
|
58481
|
+
}
|
|
58482
|
+
function fmtGwei(wei) {
|
|
58483
|
+
return `${import_ethers16.ethers.formatUnits(wei, "gwei")} gwei`;
|
|
58484
|
+
}
|
|
58485
|
+
function worstCaseFeeWei(gasLimit, maxFeePerGas) {
|
|
58486
|
+
if (gasLimit == null || maxFeePerGas == null)
|
|
58487
|
+
return null;
|
|
58488
|
+
return gasLimit * maxFeePerGas;
|
|
58489
|
+
}
|
|
58490
|
+
function assertFeeCeiling(gasLimit, maxFeePerGas, raise, ceiling = DEFAULT_FEE_CEILING) {
|
|
58491
|
+
if (gasLimit != null && gasLimit > ceiling.maxGasLimit) {
|
|
58492
|
+
raise(`gasLimit ${gasLimit} exceeds the signing ceiling of ${ceiling.maxGasLimit}`);
|
|
58493
|
+
}
|
|
58494
|
+
if (maxFeePerGas != null && maxFeePerGas > ceiling.maxFeePerGasWei) {
|
|
58495
|
+
raise(
|
|
58496
|
+
`maxFeePerGas ${fmtGwei(maxFeePerGas)} exceeds the signing ceiling of ${fmtGwei(ceiling.maxFeePerGasWei)}`
|
|
58497
|
+
);
|
|
58498
|
+
}
|
|
58499
|
+
const worst = worstCaseFeeWei(gasLimit, maxFeePerGas);
|
|
58500
|
+
if (worst != null && worst > ceiling.maxTxFeeWei) {
|
|
58501
|
+
raise(
|
|
58502
|
+
`worst-case transaction fee ${fmtEth(worst)} (gasLimit ${gasLimit} \xD7 ${fmtGwei(maxFeePerGas)}) exceeds the signing ceiling of ${fmtEth(ceiling.maxTxFeeWei)}.${ceiling.raiseHint ? ` ${ceiling.raiseHint}` : ""}`
|
|
58503
|
+
);
|
|
58504
|
+
}
|
|
58505
|
+
}
|
|
58468
58506
|
var MINT_UCD_GAS_CEILING = BigInt(13e5);
|
|
58469
58507
|
var WITHDRAW_BTC_GAS_CEILING = BigInt(3e6);
|
|
58470
58508
|
var MAKE_PAYMENT_GAS_CEILING = BigInt(1e6);
|
|
58471
58509
|
var EXTEND_POSITION_GAS_CEILING = BigInt(1e6);
|
|
58472
58510
|
var LIQUIDATION_COMMIT_GAS_CEILING = BigInt(1e6);
|
|
58473
58511
|
var LIQUIDATION_REVEAL_GAS_CEILING = BigInt(2e6);
|
|
58474
|
-
var PRIORITY_FEE_FLOOR_WEI = (0, import_ethers15.parseUnits)("0.1", "gwei");
|
|
58475
|
-
var PRIORITY_FEE_CAP_WEI = (0, import_ethers15.parseUnits)("3", "gwei");
|
|
58476
58512
|
var FEE_HISTORY_BLOCK_COUNT = 20;
|
|
58477
58513
|
var FEE_HISTORY_REWARD_PERCENTILE = 75;
|
|
58478
58514
|
function isJsonRpcSendable(provider) {
|
|
@@ -58945,7 +58981,7 @@ async function getPKPPublicKeyFromTokenId(pkpTokenId, provider, pkpNftContractAd
|
|
|
58945
58981
|
`pkpNftContractAddress is required for getPKPPublicKeyFromTokenId`
|
|
58946
58982
|
);
|
|
58947
58983
|
}
|
|
58948
|
-
const pkpNft = new
|
|
58984
|
+
const pkpNft = new import_ethers17.Contract(
|
|
58949
58985
|
pkpNftContractAddress,
|
|
58950
58986
|
PKP_NFT_ABI,
|
|
58951
58987
|
provider
|
|
@@ -58982,7 +59018,7 @@ async function generateBalanceConfirmationAuthorization(positionId, chainId, sig
|
|
|
58982
59018
|
const timestamp = calculateNextQuantumTimestamp();
|
|
58983
59019
|
const caller = await signer.getAddress();
|
|
58984
59020
|
const action = "confirm-balance";
|
|
58985
|
-
const actionHash = (0,
|
|
59021
|
+
const actionHash = (0, import_ethers17.keccak256)((0, import_ethers17.toUtf8Bytes)(action));
|
|
58986
59022
|
const types = [
|
|
58987
59023
|
"bytes32",
|
|
58988
59024
|
// positionId
|
|
@@ -58996,8 +59032,8 @@ async function generateBalanceConfirmationAuthorization(positionId, chainId, sig
|
|
|
58996
59032
|
// actionHash
|
|
58997
59033
|
];
|
|
58998
59034
|
const values = [positionId, timestamp, chainId, caller, actionHash];
|
|
58999
|
-
const messageHash = (0,
|
|
59000
|
-
const messageHashBytes = (0,
|
|
59035
|
+
const messageHash = (0, import_ethers17.solidityPackedKeccak256)(types, values);
|
|
59036
|
+
const messageHashBytes = (0, import_ethers17.getBytes)(messageHash);
|
|
59001
59037
|
const signature = await signer.signMessage(messageHashBytes);
|
|
59002
59038
|
return {
|
|
59003
59039
|
positionId,
|
|
@@ -59129,7 +59165,7 @@ async function buildSignedLoginPayload(signer, chainId, audience, reuse, withSta
|
|
|
59129
59165
|
...statement ? { statement } : {},
|
|
59130
59166
|
address,
|
|
59131
59167
|
issuedAt: reuse?.issuedAt ?? Math.floor(Date.now() / 1e3),
|
|
59132
|
-
nonce: reuse?.nonce ?? (0,
|
|
59168
|
+
nonce: reuse?.nonce ?? (0, import_ethers19.hexlify)((0, import_ethers19.randomBytes)(32)),
|
|
59133
59169
|
...audience ? { audience } : {}
|
|
59134
59170
|
};
|
|
59135
59171
|
const signature = await signer.signTypedData(
|
|
@@ -59730,16 +59766,13 @@ var ERROR_STRING_SELECTOR = "0x08c379a0";
|
|
|
59730
59766
|
var PANIC_SELECTOR = "0x4e487b71";
|
|
59731
59767
|
var QUANTUM_REVERT_NAMES = {
|
|
59732
59768
|
"0xbe4b82c1": "DeadZoneViolation()",
|
|
59733
|
-
"0x137f3b70": "InDeadZone()",
|
|
59734
|
-
"0x131d9a21": "QuantumExpired()",
|
|
59735
59769
|
"0x52ce5d58": "QuantumAlreadyUsed()",
|
|
59736
59770
|
"0x3e76a3c9": "QuantumOutsideWindow()",
|
|
59737
|
-
"0x8baa579f": "InvalidSignature()",
|
|
59738
59771
|
"0x62278171": "InvalidValidatorSignature()",
|
|
59739
|
-
"
|
|
59740
|
-
"
|
|
59741
|
-
"
|
|
59742
|
-
"0xd92e233d": "
|
|
59772
|
+
"0x82b42900": "Unauthorized()",
|
|
59773
|
+
"0x3ee5aeb5": "ReentrancyGuardReentrantCall()",
|
|
59774
|
+
"0x0a0b0d79": "ValidationFailed()",
|
|
59775
|
+
"0xd92e233d": "ZeroAddress()",
|
|
59743
59776
|
"0x36bfdeea": "StateHashMismatch()",
|
|
59744
59777
|
"0xb9d419a7": "DebtUpdateVerificationFailed()",
|
|
59745
59778
|
"0xc7e20553": "DebtUpdateVerificationFailedDetailed(bytes32,uint256,uint256,uint256,uint256,uint256)",
|
|
@@ -59755,13 +59788,13 @@ function decodeQuantumRevert(e) {
|
|
|
59755
59788
|
if (!name && selector && data) {
|
|
59756
59789
|
try {
|
|
59757
59790
|
if (selector === ERROR_STRING_SELECTOR) {
|
|
59758
|
-
const [message] =
|
|
59791
|
+
const [message] = import_ethers20.AbiCoder.defaultAbiCoder().decode(
|
|
59759
59792
|
["string"],
|
|
59760
59793
|
"0x" + data.slice(10)
|
|
59761
59794
|
);
|
|
59762
59795
|
name = `Error("${message}")`;
|
|
59763
59796
|
} else if (selector === PANIC_SELECTOR) {
|
|
59764
|
-
const [code] =
|
|
59797
|
+
const [code] = import_ethers20.AbiCoder.defaultAbiCoder().decode(
|
|
59765
59798
|
["uint256"],
|
|
59766
59799
|
"0x" + data.slice(10)
|
|
59767
59800
|
);
|
|
@@ -60009,12 +60042,12 @@ var RECOVERY_INVALIDATE_ACTION = "btc-utxo-invalidator";
|
|
|
60009
60042
|
var QUANTUM_SECONDS = 60;
|
|
60010
60043
|
var QUANTUM_SAFE_THRESHOLD = 40;
|
|
60011
60044
|
function buildInvalidateMessageHash(params) {
|
|
60012
|
-
const positionIdBytes32 = (0,
|
|
60045
|
+
const positionIdBytes32 = (0, import_ethers21.zeroPadValue)(
|
|
60013
60046
|
params.positionId.startsWith("0x") ? params.positionId : `0x${params.positionId}`,
|
|
60014
60047
|
32
|
|
60015
60048
|
);
|
|
60016
|
-
const actionHash = (0,
|
|
60017
|
-
return (0,
|
|
60049
|
+
const actionHash = (0, import_ethers21.keccak256)((0, import_ethers21.toUtf8Bytes)(RECOVERY_INVALIDATE_ACTION));
|
|
60050
|
+
return (0, import_ethers21.solidityPackedKeccak256)(
|
|
60018
60051
|
[
|
|
60019
60052
|
"bytes32",
|
|
60020
60053
|
// positionId
|
|
@@ -60060,7 +60093,7 @@ async function buildInvalidateStaleSpendEnvelope(params) {
|
|
|
60060
60093
|
utxoTxid,
|
|
60061
60094
|
utxoVout
|
|
60062
60095
|
});
|
|
60063
|
-
const signature = await signer.signMessage((0,
|
|
60096
|
+
const signature = await signer.signMessage((0, import_ethers21.getBytes)(messageHash));
|
|
60064
60097
|
const borrowerAddress = await signer.getAddress();
|
|
60065
60098
|
return {
|
|
60066
60099
|
positionId,
|
|
@@ -60103,7 +60136,7 @@ function hashBtcInputSet(utxos) {
|
|
|
60103
60136
|
seen.add(key);
|
|
60104
60137
|
}
|
|
60105
60138
|
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("|");
|
|
60106
|
-
return (0,
|
|
60139
|
+
return (0, import_ethers22.keccak256)((0, import_ethers22.toUtf8Bytes)(canonical));
|
|
60107
60140
|
}
|
|
60108
60141
|
async function buildBtcExecuteEnvelope(params) {
|
|
60109
60142
|
const {
|
|
@@ -60148,15 +60181,15 @@ async function buildBtcExecuteEnvelope(params) {
|
|
|
60148
60181
|
} else {
|
|
60149
60182
|
timestamp = currentQuantumStart;
|
|
60150
60183
|
}
|
|
60151
|
-
const actionHash = (0,
|
|
60152
|
-
(0,
|
|
60184
|
+
const actionHash = (0, import_ethers22.keccak256)(
|
|
60185
|
+
(0, import_ethers22.toUtf8Bytes)("execute-btc-withdrawal")
|
|
60153
60186
|
);
|
|
60154
60187
|
const utxoIdentifier = `${txid}:${vout}`;
|
|
60155
|
-
const positionIdBytes32 = (0,
|
|
60188
|
+
const positionIdBytes32 = (0, import_ethers22.zeroPadValue)(
|
|
60156
60189
|
positionId.startsWith("0x") ? positionId : `0x${positionId}`,
|
|
60157
60190
|
32
|
|
60158
60191
|
);
|
|
60159
|
-
const messageHash = (0,
|
|
60192
|
+
const messageHash = (0, import_ethers22.solidityPackedKeccak256)(
|
|
60160
60193
|
[
|
|
60161
60194
|
"bytes32",
|
|
60162
60195
|
// positionId
|
|
@@ -60189,7 +60222,7 @@ async function buildBtcExecuteEnvelope(params) {
|
|
|
60189
60222
|
actionHash
|
|
60190
60223
|
]
|
|
60191
60224
|
);
|
|
60192
|
-
const userSignature = await signer.signMessage((0,
|
|
60225
|
+
const userSignature = await signer.signMessage((0, import_ethers22.getBytes)(messageHash));
|
|
60193
60226
|
const borrowerAddress = await signer.getAddress();
|
|
60194
60227
|
return {
|
|
60195
60228
|
positionId,
|
|
@@ -60557,7 +60590,7 @@ function rowToStatus(row) {
|
|
|
60557
60590
|
return row;
|
|
60558
60591
|
}
|
|
60559
60592
|
async function fetchProtocolPauseStatus(provider, positionManagerAddress) {
|
|
60560
|
-
const iface = new
|
|
60593
|
+
const iface = new import_ethers24.Interface(GET_PROTOCOL_PAUSE_STATUS_ABI);
|
|
60561
60594
|
const data = iface.encodeFunctionData("getProtocolPauseStatus", []);
|
|
60562
60595
|
const raw = await provider.call({ to: positionManagerAddress, data });
|
|
60563
60596
|
const decoded = iface.decodeFunctionResult("getProtocolPauseStatus", raw);
|
|
@@ -60747,38 +60780,38 @@ var ContractManager = class {
|
|
|
60747
60780
|
}
|
|
60748
60781
|
const contractRunner = runner;
|
|
60749
60782
|
const contracts = {
|
|
60750
|
-
positionManager: new
|
|
60783
|
+
positionManager: new import_ethers25.Contract(
|
|
60751
60784
|
contractAddresses.positionManager,
|
|
60752
60785
|
POSITION_MANAGER_ABI,
|
|
60753
60786
|
contractRunner
|
|
60754
60787
|
),
|
|
60755
|
-
loanOperationsManager: new
|
|
60756
|
-
contractAddresses.loanOperationsManager ||
|
|
60788
|
+
loanOperationsManager: new import_ethers25.Contract(
|
|
60789
|
+
contractAddresses.loanOperationsManager || import_ethers25.ZeroAddress,
|
|
60757
60790
|
LOAN_OPS_ABI,
|
|
60758
60791
|
contractRunner
|
|
60759
60792
|
),
|
|
60760
|
-
ucdController: new
|
|
60793
|
+
ucdController: new import_ethers25.Contract(
|
|
60761
60794
|
contractAddresses.ucdToken,
|
|
60762
60795
|
UCD_CONTROLLER_ABI,
|
|
60763
60796
|
contractRunner
|
|
60764
60797
|
),
|
|
60765
|
-
termManager: new
|
|
60766
|
-
contractAddresses.termManager ||
|
|
60798
|
+
termManager: new import_ethers25.Contract(
|
|
60799
|
+
contractAddresses.termManager || import_ethers25.ZeroAddress,
|
|
60767
60800
|
TERM_MANAGER_ABI,
|
|
60768
60801
|
contractRunner
|
|
60769
60802
|
),
|
|
60770
|
-
circuitBreaker: new
|
|
60771
|
-
contractAddresses.circuitBreaker ||
|
|
60803
|
+
circuitBreaker: new import_ethers25.Contract(
|
|
60804
|
+
contractAddresses.circuitBreaker || import_ethers25.ZeroAddress,
|
|
60772
60805
|
CIRCUIT_BREAKER_ABI,
|
|
60773
60806
|
contractRunner
|
|
60774
60807
|
),
|
|
60775
|
-
liquidationManager: new
|
|
60776
|
-
contractAddresses.liquidationManager ||
|
|
60808
|
+
liquidationManager: new import_ethers25.Contract(
|
|
60809
|
+
contractAddresses.liquidationManager || import_ethers25.ZeroAddress,
|
|
60777
60810
|
LIQUIDATION_MANAGER_ABI,
|
|
60778
60811
|
contractRunner
|
|
60779
60812
|
),
|
|
60780
|
-
bitcoinWithdrawalAddressRegistry: new
|
|
60781
|
-
contractAddresses.bitcoinWithdrawalAddressRegistry ||
|
|
60813
|
+
bitcoinWithdrawalAddressRegistry: new import_ethers25.Contract(
|
|
60814
|
+
contractAddresses.bitcoinWithdrawalAddressRegistry || import_ethers25.ZeroAddress,
|
|
60782
60815
|
BITCOIN_WITHDRAWAL_ADDRESS_REGISTRY_ABI,
|
|
60783
60816
|
contractRunner
|
|
60784
60817
|
)
|
|
@@ -60827,13 +60860,13 @@ var ContractManager = class {
|
|
|
60827
60860
|
const address = addresses[key];
|
|
60828
60861
|
if (!address) {
|
|
60829
60862
|
missing.push(String(key));
|
|
60830
|
-
} else if (!(0,
|
|
60863
|
+
} else if (!(0, import_ethers25.isAddress)(address)) {
|
|
60831
60864
|
invalid.push(String(key));
|
|
60832
60865
|
}
|
|
60833
60866
|
}
|
|
60834
60867
|
for (const key of optionalAddresses) {
|
|
60835
60868
|
const address = addresses[key];
|
|
60836
|
-
if (address && !(0,
|
|
60869
|
+
if (address && !(0, import_ethers25.isAddress)(address)) {
|
|
60837
60870
|
invalid.push(String(key));
|
|
60838
60871
|
}
|
|
60839
60872
|
}
|
|
@@ -62148,11 +62181,11 @@ var LoanCreator = class {
|
|
|
62148
62181
|
try {
|
|
62149
62182
|
const mainnetVaultAddress = bitcoinAddresses.mainnet;
|
|
62150
62183
|
const regtestVaultAddress = bitcoinAddresses.regtest;
|
|
62151
|
-
const pkpIdBytes32 = (0,
|
|
62152
|
-
(0,
|
|
62184
|
+
const pkpIdBytes32 = (0, import_ethers26.zeroPadValue)(
|
|
62185
|
+
(0, import_ethers26.toBeHex)(BigInt(pkpData.tokenId)),
|
|
62153
62186
|
32
|
|
62154
62187
|
);
|
|
62155
|
-
const pkpPublicKeyUncompressed =
|
|
62188
|
+
const pkpPublicKeyUncompressed = import_ethers26.SigningKey.computePublicKey(
|
|
62156
62189
|
pkpData.publicKey,
|
|
62157
62190
|
false
|
|
62158
62191
|
);
|
|
@@ -62165,7 +62198,7 @@ var LoanCreator = class {
|
|
|
62165
62198
|
);
|
|
62166
62199
|
log.debug(`BigInt conversion: ${BigInt(pkpData.tokenId).toString()}`);
|
|
62167
62200
|
log.debug(
|
|
62168
|
-
`Hex from BigInt: ${(0,
|
|
62201
|
+
`Hex from BigInt: ${(0, import_ethers26.toBeHex)(BigInt(pkpData.tokenId))}`
|
|
62169
62202
|
);
|
|
62170
62203
|
log.debug(`Final bytes32 (zero-padded): ${pkpIdBytes32}`);
|
|
62171
62204
|
log.debug(
|
|
@@ -62337,8 +62370,8 @@ var LoanCreator = class {
|
|
|
62337
62370
|
}
|
|
62338
62371
|
}
|
|
62339
62372
|
if (this.config.debug) {
|
|
62340
|
-
const pkpIdBytes32Check = (0,
|
|
62341
|
-
(0,
|
|
62373
|
+
const pkpIdBytes32Check = (0, import_ethers26.zeroPadValue)(
|
|
62374
|
+
(0, import_ethers26.toBeHex)(BigInt(pkpData.tokenId)),
|
|
62342
62375
|
32
|
|
62343
62376
|
);
|
|
62344
62377
|
log.error("\u274C Loan creation transaction failed", {
|
|
@@ -62499,7 +62532,7 @@ var LoanCreator = class {
|
|
|
62499
62532
|
const coreAddress = this.config.contractManager.getContractAddresses().positionManagerCore;
|
|
62500
62533
|
if (coreAddress) {
|
|
62501
62534
|
try {
|
|
62502
|
-
const core = new
|
|
62535
|
+
const core = new import_ethers26.Contract(
|
|
62503
62536
|
coreAddress,
|
|
62504
62537
|
[
|
|
62505
62538
|
"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))"
|
|
@@ -62541,8 +62574,8 @@ var LoanCreator = class {
|
|
|
62541
62574
|
const newEventAbi = [
|
|
62542
62575
|
"event PositionCreated(bytes32 indexed positionId, bytes32 indexed pkpId, address indexed borrower, uint256 requestedCollateralRatio, uint256 selectedTerm, uint256 expiryAt)"
|
|
62543
62576
|
];
|
|
62544
|
-
const oldIface = new
|
|
62545
|
-
const newIface = new
|
|
62577
|
+
const oldIface = new import_ethers26.Interface(oldEventAbi);
|
|
62578
|
+
const newIface = new import_ethers26.Interface(newEventAbi);
|
|
62546
62579
|
let positionId;
|
|
62547
62580
|
if (this.config.debug) {
|
|
62548
62581
|
log.info("\u{1F50D} Parsing transaction receipt logs", {
|
|
@@ -63022,7 +63055,7 @@ var LoanQuery = class {
|
|
|
63022
63055
|
const isChipotlePkpId2 = typeof rawId === "string" && isNormalizedChipotlePkpId(rawId);
|
|
63023
63056
|
if (isChipotlePkpId2) {
|
|
63024
63057
|
if (this.config.positionManagerCoreAddress && this.config.provider) {
|
|
63025
|
-
const pmContract = new
|
|
63058
|
+
const pmContract = new import_ethers27.Contract(
|
|
63026
63059
|
this.config.positionManagerCoreAddress,
|
|
63027
63060
|
POSITION_CORE_ABI,
|
|
63028
63061
|
this.config.provider
|
|
@@ -63125,7 +63158,7 @@ var LoanQuery = class {
|
|
|
63125
63158
|
*/
|
|
63126
63159
|
async getBorrowerUcdDebtSummary(borrower) {
|
|
63127
63160
|
const trimmed = typeof borrower === "string" ? borrower.trim() : "";
|
|
63128
|
-
if (!(0,
|
|
63161
|
+
if (!(0, import_ethers27.isAddress)(trimmed)) {
|
|
63129
63162
|
return failure(
|
|
63130
63163
|
new SDKError({
|
|
63131
63164
|
message: `Borrower must be an EVM address for a UCD debt summary, got "${trimmed}"`,
|
|
@@ -63400,7 +63433,7 @@ var WithdrawalAddressModule = class {
|
|
|
63400
63433
|
if (!res.success)
|
|
63401
63434
|
return res;
|
|
63402
63435
|
const target = res.value.target;
|
|
63403
|
-
if (!target || target ===
|
|
63436
|
+
if (!target || target === import_ethers28.ZeroAddress) {
|
|
63404
63437
|
return failure(
|
|
63405
63438
|
new SDKError({
|
|
63406
63439
|
code: "SDK_WITHDRAWAL_REGISTRY_NOT_CONFIGURED",
|
|
@@ -63419,7 +63452,7 @@ var WithdrawalAddressModule = class {
|
|
|
63419
63452
|
}
|
|
63420
63453
|
/** keccak256 of the canonicalized address — matches the on-chain key. */
|
|
63421
63454
|
static addressHash(btcAddress2) {
|
|
63422
|
-
return (0,
|
|
63455
|
+
return (0, import_ethers28.keccak256)((0, import_ethers28.toUtf8Bytes)(normalizeBitcoinAddress(btcAddress2)));
|
|
63423
63456
|
}
|
|
63424
63457
|
/**
|
|
63425
63458
|
* Add a Bitcoin address to the caller's allowlist. It becomes usable only
|
|
@@ -69439,7 +69472,7 @@ var _abi = [
|
|
|
69439
69472
|
];
|
|
69440
69473
|
var _bytecode = "0x60a080604052346100ea57306080527ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005460ff8160401c166100d9576002600160401b03196001600160401b03821601610073575b60405161485a90816100f0823960805181818161278e01526128870152f35b6001600160401b0319166001600160401b039081177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005581527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a13880610054565b63f92ee8a960e01b60005260046000fd5b600080fdfe6080604052600436101561001257600080fd5b6000803560e01c8062f7fce91461384657806301ffc9a7146137d5578063021d28931461377c5780630871b20614613743578063114249d214610f6157806311d954f81461371a57806313da3166146136e15780631d44a904146136385780631f77bf65146135ff578063248a9ca3146135e05780632b83cccd146131205780632f2ff15d146130ee57806334bac370146130b557806334e181251461307c57806336568abe14613037578063373c86b614612ffe5780633f4ba83a14612f375780634373b57214612f0e5780634451e89b14612b3a5780634ebd25a514612b015780634f1ef2861461280c5780635273b6f6146127e357806352d1902d1461277b578063568fafca146126ed57806359d5d02a146124205780635bc26aea146123eb5780635c975abb146123bb5780635ecc27081461229d5780638456cb59146121a257806385c15d9a1461216957806389d3ad00146120a25780638bff608e146120695780639010d07c1461201657806390ad8b4014611ffa57806391d1485414611fa15780639b759bf714611f5e5780639baf58d214611f415780639f1d0f59146118a8578063a217fddf1461188c578063a3246ad3146117cf578063ad3cb1cc14611788578063b492fc691461168e578063b9f637af14611463578063bf7d911914611424578063c4c5f62414611371578063c55f15ea1461134e578063ca15c87314611317578063ca2ce65d146112de578063cc1f8ffa146112ac578063cf46075e146111a2578063d21a74ff14611165578063d2f8253614611142578063d547741f14611107578063d5d3f78b14610f9a578063d66bd52414610f61578063e1f1c4a714610f44578063e1f3962c14610f18578063ec2f96fe14610ef4578063eda5a26a14610af7578063f1a1eb8414610ab4578063f385116d14610a7b578063f77c479114610a54578063f8c8765e14610661578063faaebd2114610628578063facdfb5e14610488578063fc99bd9a14610377578063fe32e7281461033e5763ffa1ad741461030857600080fd5b3461033b578060031936011261033b57610337610323613a68565b604051918291602083526020830190613a17565b0390f35b80fd5b503461033b57602036600319011261033b576020906040906001600160a01b0361036661392e565b168152601283522054604051908152f35b503461033b57604036600319011261033b5761039161392e565b6010546024359291906001600160a01b03163303610479576001600160a01b03168082526002602052604082205490929060ff16156104665780156104575782825260076020526040822054926103e88285613cb0565b848110610448576001600160ff1b0381116104395760008051602061482e833981519152604085968493846104369852600760205280838a205582519182526020820152a23090339061421c565b80f35b630700fcb360e11b8452600484fd5b63446c8cc960e01b8452600484fd5b63162908e360e11b8252600482fd5b506024916374ed46ad60e01b8252600452fd5b6349db3bd360e01b8252600482fd5b503461033b57602036600319011261033b576104a261392e565b6104aa613f12565b6010546001600160a01b03163303610479576001600160a01b03168082526002602052604082205460ff161561061657808252600760205260408220546040516370a0823160e01b8152306004820152602081602481865afa90811561060b5784916105d4575b50818111156105c5576105248282613b6c565b8215908115610570575b505060008051602061482e833981519152916040918486526007602052808387205582519182526020820152a260016000805160206147ce8339815191525580f35b61271081029080820461271014901517156105b157606484029184830460641417156105b157116105a257388061052e565b63a73af74d60e01b8452600484fd5b634e487b7160e01b86526011600452602486fd5b6105cf8183613b6c565b610524565b90506020813d602011610603575b816105ef602093836139c3565b810103126105fe575138610511565b600080fd5b3d91506105e2565b6040513d86823e3d90fd5b6374ed46ad60e01b8252600452602490fd5b503461033b57602036600319011261033b576020906040906001600160a01b0361065061392e565b168152600483522054604051908152f35b503461033b57608036600319011261033b5761067b61392e565b610683613944565b6044356001600160a01b03811690818103610a50576064356001600160a01b0381169390849003610a4c5760008051602061480e83398151915254604081901c60ff161595906001600160401b031680159081610a44575b6001149081610a3a575b159081610a31575b50610a225760008051602061480e83398151915280546001600160401b0319166001179055856109fd575b6001600160a01b03169081156109ee576001600160a01b03169081156109df5783156109d05761074661448a565b61074e61448a565b61075661448a565b61075e61448a565b60016000805160206147ce8339815191525561077861448a565b61078061448a565b86546001600160a01b0319908116919091178755600180549182168317905560405163313ce56760e01b8152909190602081600481855afa88918161099f575b506107d457633a24e95b60e11b8852600488fd5b6001600160a81b03199092161760a091821b60ff60a01b16176001819055901c60ff16601119810161098d575061080b8186614348565b80610965575b156109205761082e816000805160206147ee833981519152614348565b8061092f575b15610920576108519060008051602061470e833981519152614348565b90816108e9575b50156108da57806108af575b5061086c5780f35b60ff60401b1960008051602061480e833981519152541660008051602061480e833981519152556000805160206146ee833981519152602060405160018152a180f35b601080546001600160a01b031916821790558260008051602061474e8339815191528180a338610864565b63cf5a8e3360e01b8352600483fd5b6109199060008051602061470e83398151915286526000805160206146ae833981519152602052604086206144d0565b5038610858565b63cf5a8e3360e01b8552600485fd5b6000805160206147ee83398151915286526000805160206146ae83398151915260205261095f83604088206144d0565b50610834565b8580526000805160206146ae83398151915260205261098783604088206144d0565b50610811565b63167738cf60e21b8652600452602485fd5b6109c291925060203d6020116109c9575b6109ba81836139c3565b810190613ba9565b90386107c0565b503d6109b0565b630b5eba9f60e41b8752600487fd5b63c1ab6dc160e01b8752600487fd5b6336abb4df60e11b8752600487fd5b60008051602061480e833981519152805460ff60401b1916600160401b179055610718565b63f92ee8a960e01b8752600487fd5b905015386106ed565b303b1591506106e5565b8791506106db565b8580fd5b8480fd5b503461033b578060031936011261033b57546040516001600160a01b039091168152602090f35b503461033b57602036600319011261033b576020906040906001600160a01b03610aa361392e565b168152600a83522054604051908152f35b503461033b57604036600319011261033b576020906040906001600160a01b03610adc61392e565b16815260158352818120602435825283522054604051908152f35b503461033b5761016036600319011261033b57610b1261392e565b90606435604435602435610b24613a58565b9160a4359160c43560e43561010435916101243595610144359760018060a01b03601054163303610ee5576001600160a01b038c16808c52600260205260408c2054909a9060ff16610ed1578a15610ec2578615610eb3576127108811610e99576103e88111610e815760ff82169c60128e118e8115610e76575b50610e6257803b15610e4e578915610e3a578a15610e265782610bc191614260565b84151580610e1d575b610e065785151580610dfd575b610de6578b9c602460208d9e9d604051928380926370a0823160e01b82523060048301525afa9c8d15610dda579c610da6575b506001600160ff1b038c11610d97578a8d8f9760408f97838f918f8f8f8f90859f988f99879f9660008051602061476e8339815191529f978b9f988f8d6000805160206146ce8339815191529f988e8e610d4f9b60008051602061468e8339815191529f8f8f8487526002602052878720600160ff198254161790558487526003602052878720558386526004602052868620558285526006602052878686205582855260056020528585209060ff19825416179055818452600c6020528885852055818452600d6020528985852055818452600e6020528a85852055818452600f6020528b8585205581845260076020528484205582526012602052828220558d8152601360205220558a7f991d1ef1b5c0820d213328cba6682059e00a50e49c469a454eb3557e78eaf6668e80518b81528c6020820152a28c5198899889613cbd565b0390a28151908b82526020820152a28151908782526020820152a280610d73578280f35b604060008051602061482e833981519152918151908582526020820152a281808280f35b63556e7a8160e01b8e5260048efd5b909b506020813d602011610dd2575b81610dc2602093836139c3565b810103126105fe57519a38610c0a565b3d9150610db5565b604051903d90823e3d90fd5b60448c858863dd85772b60e01b8352600452602452fd5b50838610610bd7565b60448c8487637449915760e01b8352600452602452fd5b50828510610bca565b636835314760e11b8d52600160045260248dfd5b636835314760e11b8d5260048d905260248dfd5b63377e3f9960e21b8d5260048c905260248dfd5b63ca95039160e01b8d5260048e905260248dfd5b60069150108e610b9f565b631051834f60e11b8c526004526103e860245260448bfd5b63c1e9a14160e01b8c52600488905261271060245260448cfd5b63a2ec3a5560e01b8c5260048cfd5b63df407ac560e01b8c5260048cfd5b6317f4215b60e21b8c5260048b905260248cfd5b6349db3bd360e01b8b5260048bfd5b503461033b578060031936011261033b57602060ff60015460a01c16604051908152f35b503461033b57602036600319011261033b576020610f3c610f3761392e565b613df5565b604051908152f35b503461033b578060031936011261033b5760206040516127108152f35b503461033b57602036600319011261033b576020906040906001600160a01b03610f8961392e565b168152600783522054604051908152f35b503461033b57602036600319011261033b57610fb461392e565b6010546001600160a01b03163303610479576001600160a01b03168082526002602052604082205460ff16156106165780825260076020526040822054806110f1575080825260026020526040822060ff1981541690558082526003602052816040812055808252600460205281604081205580825260056020526040822060ff198154169055808252600c602052816040812055808252600d602052816040812055808252600e602052816040812055808252600f602052816040812055808252600660205281604081205580825260076020526040822054818352600760205282604081205560405190827f3302a1b37f04242bb55603f5449e7ecd690a35eef08ba1353c48c20e2aae9cda8580a2806110ce578380f35b8160409160008051602061482e8339815191529352846020820152a23880808380f35b604492916376bc059760e11b8352600452602452fd5b503461033b57604036600319011261033b5761113e600435611127613944565b9061113961113482613b79565b614088565b61411a565b5080f35b503461033b578060031936011261033b57602060ff600854166040519015158152f35b503461033b57602036600319011261033b5760209060ff906040906001600160a01b0361119061392e565b16815260058452205416604051908152f35b503461033b57602036600319011261033b576111bc61392e565b6111c4613f12565b6010546001600160a01b03163303610479576001600160a01b03168082526002602052604082205460ff161561061657808252600760205260408220546040516370a0823160e01b8152306004820152602081602481865afa90811561060b57849161126c575b5060008051602061482e833981519152916040918486526007602052808387205582519182526020820152a260016000805160206147ce8339815191525580f35b90506020813d6020116112a4575b81611287602093836139c3565b810103126105fe575160008051602061482e83398151915261122b565b3d915061127a565b503461033b57604036600319011261033b5760206112d46112cb61392e565b60243590613cf6565b6040519015158152f35b503461033b57602036600319011261033b576020906040906001600160a01b0361130661392e565b168152601383522054604051908152f35b503461033b57602036600319011261033b57604060209160043581526000805160206146ae83398151915283522054604051908152f35b503461033b578060031936011261033b576020604051670de0b6b3a76400008152f35b503461033b57604036600319011261033b5761138b61392e565b6010546024359291906001600160a01b03163303610479576001600160a01b031680825260076020526040822054929081841061140d578060008051602061482e8339815191526040866113e3866104369899613b6c565b84895260076020528289205583885260076020528188205482519182526020820152a2339061404c565b5091604492633cb8e07360e01b8352600452602452fd5b503461033b57602036600319011261033b5760209060ff906040906001600160a01b0361144f61392e565b168152600284522054166040519015158152f35b503461033b5761012036600319011261033b5761147e61392e565b6064359190604435602435611491613a58565b601054610104359660e4359260c4359260a43592906001600160a01b0316330361167f576001600160a01b038816808a52600260205260408a205490989060ff161561166b57861561165c576127108811611642576103e882116116285760ff83169060128211801561161e575b61160a578361150d91614260565b85151580611601575b6115ea578a1515806115e1575b6115ca579260008051602061468e83398151915297969592828c956115c4979460408e8e80825260036020528c8383205580825260046020528d838320558152600660205220558b8d52600560205260408d209060ff198254161790558a8c52600c6020528260408d20558a8c52600d6020528360408d20558a8c52600e6020528460408d20558a8c52600f6020528560408d205560405198899889613cbd565b0390a280f35b60448a868d63dd85772b60e01b8352600452602452fd5b50848b10611523565b60448a8588637449915760e01b8352600452602452fd5b50838610611516565b63ca95039160e01b8b52600482905260248bfd5b50600682106114ff565b631051834f60e11b8a5260048290526103e860245260448afd5b63c1e9a14160e01b8a52600488905261271060245260448afd5b63a2ec3a5560e01b8a5260048afd5b6374ed46ad60e01b8a52600489905260248afd5b6349db3bd360e01b8952600489fd5b503461033b57604036600319011261033b576116a861392e565b6001600160a01b0316808252600260205260408220546024359060ff16156117745780156117655761271061172a604085670de0b6b3a76400006117196117329688859a52600560205260ff85852054169080916012811061173f575b505088845260036020528484205490613a8b565b049581526004602052205484613a8b565b048092613b6c565b9082519182526020820152f35b61175e925060ff61175261175892613ad4565b16613ae5565b90613a8b565b3880611705565b63162908e360e11b8352600483fd5b6374ed46ad60e01b83526004829052602483fd5b503461033b578060031936011261033b5761033760408051906117ab81836139c3565b60058252640352e302e360dc1b602083015251918291602083526020830190613a17565b503461033b57602036600319011261033b5760043581526000805160206146ae83398151915260205260408120604051908160208254918281520190819285526020852090855b818110611876575050508261182c9103836139c3565b604051928392602084019060208552518091526040840192915b818110611854575050500390f35b82516001600160a01b0316845285945060209384019390920191600101611846565b8254845260209093019260019283019201611816565b503461033b578060031936011261033b57602090604051908152f35b503461033b576118b736613969565b9190926118c2613f12565b6118ca613f4e565b338152600960205260408120544303611f1f57338152600a602052600360408220541015611f1057338152600a602052604081206119088154613b9a565b90555b6001600160a01b0382168082526002602052604082205490929060ff16611e6f575b828252600260205260ff60408320541615610466578415610457578315611e6057828252600c60205260408220548510611e3b57828252600e60205260408220548015611e2c57808611611e155750846119869161415e565b6040516370a0823160e01b8152306004820152602081602481865afa908115611e0a578291611dd8575b506119bd8530338661421c565b6040516370a0823160e01b8152306004820152602081602481875afa908115611cef57908692918491611d9f575b50906119f691613b6c565b10611d905781815260076020526040812054611a128582613cb0565b818110611d81576001600160ff1b038111611d72576040849260008051602061482e833981519152928486526007602052808387205582519182526020820152a2818152600560205260ff604082205416849060128110611d11575b50611a8f670de0b6b3a7640000918484526003602052604084205490613a8b565b04908281526004602052612710611aaa604083205484613a8b565b0491611ab68382613b6c565b94808610611cfa57506001546040516318160ddd60e01b815290602090829060049082906001600160a01b03165afa908115611cef578391611cbd575b5082546001600160a01b0316803b15611ca45783809160846040518094819363ae494fa160e01b83523360048401528c60248401528b60448401528d60648401525af1801561060b57908491611ca8575b505083611c34575b6001546040516318160ddd60e01b81529190602090839060049082906001600160a01b03165afa801561060b578490611c00575b611b8a9250613b6c565b90808203611bea575050507fb3e2773606abfd36b5bd91394b3a54d1398336c65005baf7bf7a05efeffaf75b611bcd602095604051918291339588429285613bdd565b0390a360016000805160206147ce83398151915255604051908152f35b632d8562a360e11b835260045260245260449150fd5b506020823d602011611c2c575b81611c1a602093836139c3565b810103126105fe57611b8a9151611b80565b3d9150611c0d565b82546001600160a01b0316803b15611ca45783809160846040518094819363ae494fa160e01b83523060048401528a60248401528b60448401528160648401525af1801561060b57908491611c8b575b5050611b4c565b81611c95916139c3565b611ca0578238611c84565b8280fd5b8380fd5b81611cb2916139c3565b611ca0578238611b44565b90506020813d602011611ce7575b81611cd8602093836139c3565b810103126105fe575138611af3565b3d9150611ccb565b6040513d85823e3d90fd5b6371c4efed60e01b83526004869052602452604482fd5b611d21915061175260ff91613ad4565b8015611d5e5780600019048511611d4f57611a8f611d48670de0b6b3a76400009287613a8b565b9150611a6e565b63035fc53d60e41b8252600482fd5b634e487b7160e01b82526012600452602482fd5b630700fcb360e11b8352600483fd5b63446c8cc960e01b8352600483fd5b639bfa3c1760e01b8152600490fd5b919250506020813d602011611dd0575b81611dbc602093836139c3565b810103126105fe57518591906119f66119eb565b3d9150611daf565b90506020813d602011611e02575b81611df3602093836139c3565b810103126105fe5751386119b0565b3d9150611de6565b6040513d84823e3d90fd5b631d7f2ac360e01b83526004869052602452604482fd5b633b5db2f360e11b8352600483fd5b50908152600c6020526040812054630d54e9e160e01b82526004849052602452604490fd5b632cd84af360e01b8252600482fd5b60405163313ce56760e01b815291939291602081600481865afa859181611eef575b50611ea55763105482c760e21b8552600485fd5b93919293838352600560205260ff806040852054169116908103611ec9575061192d565b90506044928252600560205260ff604083205416631e43476360e11b8352600452602452fd5b611f0991925060203d6020116109c9576109ba81836139c3565b9038611e91565b63a74c1c5f60e01b8152600490fd5b3381526009602052436040822055338152600a6020526001604082205561190b565b503461033b578060031936011261033b5760206040516103e88152f35b503461033b57604036600319011261033b576020906040906001600160a01b03611f8661392e565b16815260148352818120602435825283522054604051908152f35b503461033b57604036600319011261033b576040611fbd613944565b91600435815260008051602061478e833981519152602052209060018060a01b0316600052602052602060ff604060002054166040519015158152f35b503461033b578060031936011261033b57602060405160648152f35b503461033b57604036600319011261033b5761205060209160043581526000805160206146ae8339815191528352604060243591206144b8565b905460405160039290921b1c6001600160a01b03168152f35b503461033b57602036600319011261033b576020906040906001600160a01b0361209161392e565b168152600983522054604051908152f35b503461033b57604036600319011261033b576120bc61392e565b60105460243591906001600160a01b0316330361215a576001600160a01b031690811561214b57604060008051602061476e8339815191529183855260136020528185205490848652601360205280838720558486526015602052828620438752602052828620548587526019602052838720558486526017602052438387205582519182526020820152a280f35b63df407ac560e01b8352600483fd5b6349db3bd360e01b8352600483fd5b503461033b57602036600319011261033b576020906040906001600160a01b0361219161392e565b168152600383522054604051908152f35b503461033b578060031936011261033b5760008051602061470e833981519152815260008051602061478e83398151915260209081526040808320336000908152925290205460ff1615612278576121f8613f4e565b600160ff196000805160206147ae8339815191525416176000805160206147ae833981519152557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a16040514281527f80170b5fcdd2bf1e0660ef4b8851f86685f64d41b1a19de1471947ece8725aac60203392a280f35b63e2517d3f60e01b81523360045260008051602061470e833981519152602452604490fd5b503461033b57602036600319011261033b576122b761392e565b60008051602061480e8339815191525460ff8160401c169081156123a3575b506123945760008051602061480e83398151915280546001600160481b0319166003600160401b0117905581805260008051602061478e83398151915260209081526040808420336000908152925290205460ff161561237c5761233990613c5e565b60ff60401b1960008051602061480e833981519152541660008051602061480e833981519152556000805160206146ee833981519152602060405160038152a180f35b63e2517d3f60e01b8252336004526024829052604482fd5b63f92ee8a960e01b8252600482fd5b60036001600160401b039190911610159050386122d6565b503461033b578060031936011261033b57602060ff6000805160206147ae83398151915254166040519015158152f35b503461033b57602036600319011261033b5761240561392e565b6010546001600160a01b031633036104795761043690613c5e565b503461033b57606036600319011261033b5761243a61392e565b612442613944565b60105490926044359290916001600160a01b0316330361047957612464613f4e565b6011546001600160a01b03169182156126de5760405163babcc53960e01b81526001600160a01b0386166004820181905293602090829060249082905afa908115611e0a57829161269f575b5015612690578215612681576001546001600160a01b03928316921682036125d1576040516370a0823160e01b8152306004820152602081602481865afa908115611e0a57829161259f575b50935b841561259057600019810361258a5750835b841561257b5780851161256357505061252d836020958361404c565b7f0bf519e4b3821615dbdd874fa1a5fbb4bb651b4e6beabedd4ac318e770233b2c604080518581524287820152a3604051908152f35b630555ed4f60e31b8252600485905260245260449150fd5b632e11316f60e11b8252600482fd5b93612511565b63f09872eb60e01b8252600482fd5b90506020813d6020116125c9575b816125ba602093836139c3565b810103126105fe5751386124fc565b3d91506125ad565b8181526002602052604081205460ff161561266f576040516370a0823160e01b8152306004820152602081602481865afa908115611e0a57829161263d575b5082825260076020526040822054808211156126355761262f91613b6c565b936124ff565b50508061262f565b90506020813d602011612667575b81612658602093836139c3565b810103126105fe575138612610565b3d915061264b565b60249163eef7849760e01b8252600452fd5b634e46966960e11b8152600490fd5b63133307bb60e21b8152600490fd5b90506020813d6020116126d6575b816126ba602093836139c3565b810103126126d2575180151581036126d257386124b0565b5080fd5b3d91506126ad565b630e048e7160e41b8152600490fd5b503461033b57602036600319011261033b5761270761392e565b6010546001600160a01b03163303610479576001600160a01b0316801561276c57601180546001600160a01b0319811683179091556001600160a01b03167f1e9c406f2707909cfd9f61e744f73bcab77e5997d063276f67883c5257d51cf08380a380f35b634e46966960e11b8252600482fd5b503461033b578060031936011261033b577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031630036127d457602060405160008051602061472e8339815191528152f35b63703e46dd60e11b8152600490fd5b503461033b578060031936011261033b576010546040516001600160a01b039091168152602090f35b50604036600319011261033b5761282161392e565b602435906001600160401b038211611ca05736602383011215611ca0578160040135908361284e836139fc565b9361285c60405195866139c3565b83855260208501933660248284010111611ca057806024602093018637850101526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016308114908115612ade575b50612acf576010546001600160a01b03163303612ac0576001600160a01b038116928315612ab157813b15612aa25760008051602061472e83398151915254846128fa613a68565b7f6ea8b34d59b2818d3f37a08dddaa06f5886b9c20c907b36f03ca6528e106e86f61293060405192604084526040840190613a17565b4260208401526001600160a01b038516929081900390a36040516352d1902d60e01b8152602081600481895afa879181612a6a575b5061297e57634c9c8ce360e01b87526004869052602487fd5b908160008051602061472e83398151915288979303612a585750833b15612a44576001600160a01b031916811760008051602061472e833981519152558491907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8380a2805115612a295761113e9382915190845af43d15612a21573d91612a05836139fc565b92612a1360405194856139c3565b83523d85602085013e61460c565b60609161460c565b5050505034612a355780f35b63b398979f60e01b8152600490fd5b634c9c8ce360e01b86526004829052602486fd5b632a87526960e21b8752600452602486fd5b9091506020813d602011612a9a575b81612a86602093836139c3565b81010312612a9657519038612965565b8780fd5b3d9150612a79565b636f7c43f160e01b8552600485fd5b63e6c4247b60e01b8552600485fd5b6349db3bd360e01b8452600484fd5b63703e46dd60e11b8452600484fd5b60008051602061472e833981519152546001600160a01b031614159050386128b2565b503461033b57602036600319011261033b576020906040906001600160a01b03612b2961392e565b168152600e83522054604051908152f35b503461033b57606036600319011261033b57612b5461395a565b6024356001600160401b038111611ca057612b73903690600401613993565b916044356001600160401b038111610a5057612b93903690600401613993565b60008051602061480e8339815191529291925460ff8160401c16908115612ef6575b50612ee75760008051602061480e83398151915280546001600160481b0319166002600160401b011790556000805160206147ee833981519152865260008051602061478e83398151915260209081526040808820336000908152925290205460ff1615612ec257612c2561448a565b612c2d61448a565b60016000805160206147ce83398151915255600b549160ff8316612eb357818603612ea457612c5b86613bf9565b92612c6960405194856139c3565b868452601f19612c7888613bf9565b01366020860137875b878110612daf575060019060ff191617600b5515159460ff196008541660ff871617600855865b818110612d0c578760008051602061466e833981519152602089604051908152a160ff60401b1960008051602061480e833981519152541660008051602061480e833981519152556000805160206146ee833981519152602060405160028152a180f35b808860008051602061482e8339815191526040612d34612d2f600196888d613c10565b613c36565b612d3f85898c613c10565b357f8f955fa878b4aae8b1ac37b1ab715307470f2822ceff87e23d33ef1e044814a783612d6c888d613c4a565b5193898060a01b0316968793848252600660205280838320558482526007602052858383205582519182526020820152a28151908d82526020820152a201612ca8565b612dbd612d2f828a8a613c10565b612dc8828689613c10565b6001600160a01b03909116808b52600260205260408b20549091359060ff1615612e90576103e88111612e785750906020602492604051938480926370a0823160e01b82523060048301525afa8015612e6d578a90612e37575b60019250612e308288613c4a565b5201612c81565b509060203d8111612e66575b612e4d81836139c3565b6020826000928101031261033b57509060019151612e22565b503d612e43565b6040513d8c823e3d90fd5b631051834f60e11b8b526004526103e860245260448afd5b6351104c5960e01b8b52600482905260248bfd5b63512509d360e11b8752600487fd5b6324d0d1fd60e01b8752600487fd5b63e2517d3f60e01b8652336004526000805160206147ee833981519152602452604486fd5b63f92ee8a960e01b8652600486fd5b60026001600160401b03919091161015905038612bb5565b503461033b578060031936011261033b576011546040516001600160a01b039091168152602090f35b503461033b578060031936011261033b576010546001600160a01b03163303612fef576000805160206147ae8339815191525460ff811615612fe05760ff19166000805160206147ae833981519152557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a16040514281527f107553d8191d85b405879cf752997865edd48d94e20bda4dd27223c94b31a7cc60203392a280f35b638dfc202b60e01b8252600482fd5b6349db3bd360e01b8152600490fd5b503461033b57602036600319011261033b576020906040906001600160a01b0361302661392e565b168152601683522054604051908152f35b503461033b57604036600319011261033b57613051613944565b336001600160a01b0382160361306d5761113e9060043561411a565b63334bd91960e11b8252600482fd5b503461033b57602036600319011261033b576020906040906001600160a01b036130a461392e565b168152600c83522054604051908152f35b503461033b57602036600319011261033b576020906040906001600160a01b036130dd61392e565b168152601783522054604051908152f35b503461033b57604036600319011261033b5761113e60043561310e613944565b9061311b61113482613b79565b6140d2565b503461033b5761312f36613969565b91909261313a613f12565b613142613f4e565b3381526009602052604081205443036135be57338152600a602052600360408220541015611f1057338152600a602052604081206131808154613b9a565b90555b6001600160a01b0382168082526002602052604082205490929060ff16613543575b828252600260205260ff604083205416156104665760ff6008541615613534578415610457578315611e6057828252600d602052604082205480861061351d5750828252600f6020526040822054801561350e578086116134f857508461320b91613f78565b670de0b6b3a76400008402848104670de0b6b3a7640000036134e4578282526003602052604082205461323d91613ab4565b90828152600560205260ff604082205416601281106134c4575b50828152600660205261327c612710613274604084205485613a8b565b048093613b6c565b938085106134ac575082815260076020528360408220541061348857828152600760205260408120548481106134795760008051602061482e8339815191526040826132c9888895613b6c565b8486526007602052808387205582519182526020820152a26001546040516318160ddd60e01b815290602090829060049082906001600160a01b03165afa908115611e0a578291613447575b5081546001600160a01b0316803b15611ca057826040518092633a52b90760e11b82528183816133498d3360048401613bc2565b03925af18015611cef57613432575b506001546040516318160ddd60e01b81529190602090839060049082906001600160a01b03165afa908115611cef5783916133fc575b6133989250613b6c565b8581036133e45750507f8caf04742286d017f9ac3924388e188c73e6e5094311c5e59a61a7ef86dda8bf611bcd6020956133d386338761404c565b604051918291339588429285613bdd565b635ab6e2db60e01b8252600486905260245260449150fd5b90506020823d60201161342a575b81613417602093836139c3565b810103126105fe5761339891519061338e565b3d915061340a565b9161344081600493946139c3565b9190613358565b90506020813d602011613471575b81613462602093836139c3565b810103126126d2575138613315565b3d9150613455565b6308aed4ef60e31b8252600482fd5b82815260076020526040812054635960d22160e01b82526004526024849052604490fd5b6371c4efed60e01b8252600485905260245260449150fd5b916134d760ff6117526134dd9495613ad4565b90613ab4565b9038613257565b634e487b7160e01b82526011600452602482fd5b625502a360e91b83526004869052602452604482fd5b636c6ff70d60e11b8352600483fd5b6361767b8560e01b83526004869052602452604482fd5b630df65d9f60e01b8252600482fd5b60405163313ce56760e01b815291939291602081600481865afa85918161359d575b506135795763105482c760e21b8552600485fd5b93919293838352600560205260ff806040852054169116908103611ec957506131a5565b6135b791925060203d6020116109c9576109ba81836139c3565b9038613565565b3381526009602052436040822055338152600a60205260016040822055613183565b503461033b57602036600319011261033b576020610f3c600435613b79565b503461033b57602036600319011261033b576020906040906001600160a01b0361362761392e565b168152600f83522054604051908152f35b503461033b57604036600319011261033b5761365261392e565b60105460243591906001600160a01b0316330361215a576001600160a01b031690811561214b5760406000805160206146ce8339815191529183855260126020528185205490848652601260205280838720558486526014602052828620438752602052828620548587526018602052838720558486526016602052438387205582519182526020820152a280f35b503461033b57602036600319011261033b576020906040906001600160a01b0361370961392e565b168152600683522054604051908152f35b503461033b578060031936011261033b576001546040516001600160a01b039091168152602090f35b503461033b57602036600319011261033b576020906040906001600160a01b0361376b61392e565b168152600d83522054604051908152f35b503461033b57602036600319011261033b5761379661395a565b6010546001600160a01b0316330361047957602060008051602061466e83398151915291151560ff196008541660ff821617600855604051908152a180f35b503461033b57602036600319011261033b5760043563ffffffff60e01b81168091036126d257602090635a05180f60e01b811490811561381b575b506040519015158152f35b637965db0b60e01b811491508115613835575b5082613810565b6301ffc9a760e01b1490508261382e565b503461033b57604036600319011261033b5761386061392e565b6001600160a01b0316808252600260205260408220546024359060ff161561177457670de0b6b3a7640000810290808204670de0b6b3a7640000149015171561391a57916138bc60409383835260036020528483205490613ab4565b91808252600560205260ff8483205416601281106138f1575b5061172a84836127109361173295526006602052205484613a8b565b846117329361390f61271094966134d760ff61175261172a97613ad4565b9593509350506138d5565b634e487b7160e01b83526011600452602483fd5b600435906001600160a01b03821682036105fe57565b602435906001600160a01b03821682036105fe57565b6004359081151582036105fe57565b60609060031901126105fe576004356001600160a01b03811681036105fe57906024359060443590565b9181601f840112156105fe578235916001600160401b0383116105fe576020808501948460051b0101116105fe57565b601f909101601f19168101906001600160401b038211908210176139e657604052565b634e487b7160e01b600052604160045260246000fd5b6001600160401b0381116139e657601f01601f191660200190565b919082519283825260005b848110613a43575050826000602080949584010152601f8019910116010190565b80602080928401015182828601015201613a22565b6084359060ff821682036105fe57565b60405190613a776040836139c3565b6005825264322e332e3360d81b6020830152565b81810292918115918404141715613a9e57565b634e487b7160e01b600052601160045260246000fd5b8115613abe570490565b634e487b7160e01b600052601260045260246000fd5b60ff166012039060ff8211613a9e57565b8015613b665760009060208110600116604e821060011617613b5e57600a916001915b60018111613b35575082600019048211613b2157500290565b634e487b7160e01b81526011600452602490fd5b92806000190481116134e45760018416613b55575b80029260011c613b08565b80920291613b4a565b9050600a0a90565b50600190565b91908203918211613a9e57565b60005260008051602061478e83398151915260205260016040600020015490565b6000198114613a9e5760010190565b908160209103126105fe575160ff811681036105fe5790565b6001600160a01b039091168152602081019190915260400190565b9094939260609260808301968352602083015260408201520152565b6001600160401b0381116139e65760051b60200190565b9190811015613c205760051b0190565b634e487b7160e01b600052603260045260246000fd5b356001600160a01b03811681036105fe5790565b8051821015613c205760209160051b010190565b6001600160a01b03168015613c9f57601080546001600160a01b0319811683179091556001600160a01b031660008051602061474e833981519152600080a3565b63e6c4247b60e01b60005260046000fd5b91908201809211613a9e57565b94919360e0969360ff929a99989561010088019b885260208801526040870152166060850152608084015260a083015260c08201520152565b6001600160a01b03811660008181526002602052604090205490919060ff16158015613de8575b8015613de0575b613dce5781600052600f6020526040600020548015908115613dd6575b50613dce57613d66926040918251948592839262f7fce960e01b845260048401613bc2565b0381305afa918215613dc257600092613d8e575b506000526007602052604060002054101590565b9091506040813d604011613dba575b81613daa604093836139c3565b810103126105fe57519038613d7a565b3d9150613d9d565b6040513d6000823e3d90fd5b505050600090565b9050831138613d41565b508215613d24565b5060ff6008541615613d1d565b6001546001600160a01b0391821691168103613e6a576020602491604051928380926370a0823160e01b82523060048301525afa908115613dc257600091613e3b575090565b90506020813d602011613e62575b81613e56602093836139c3565b810103126105fe575190565b3d9150613e49565b80600052600260205260ff60406000205416613e865750600090565b6040516370a0823160e01b815230600482015290602082602481845afa918215613dc257600092613ede575b506000526007602052604060002054808211600014613ed757613ed491613b6c565b90565b5050600090565b90916020823d602011613f0a575b81613ef9602093836139c3565b8101031261033b5750519038613eb2565b3d9150613eec565b60026000805160206147ce8339815191525414613f3d5760026000805160206147ce83398151915255565b633ee5aeb560e01b60005260046000fd5b60ff6000805160206147ae8339815191525416613f6757565b63d93c066560e01b60005260046000fd5b6001600160a01b0316600081815260136020526040902054801561404757816000526015602052604060002043600052602052613fbb6040600020549384613cb0565b92831061403657808260005260176020524360406000205414614018575b8311613ffc57506000526015602052604060002043600052602052604060002055565b925063029359d560e41b60005260045260245260445260646000fd5b5081600052601960205261403160406000205482613cb0565b613fd9565b63446c8cc960e01b60005260046000fd5b505050565b614081614086939261407360405194859263a9059cbb60e01b602085015260248401613bc2565b03601f1981018452836139c3565b6142ed565b565b600081815260008051602061478e8339815191526020908152604080832033845290915290205460ff16156140ba5750565b63e2517d3f60e01b6000523360045260245260446000fd5b6140dc8282614348565b91826140e757505090565b60009182526000805160206146ae8339815191526020526040909120614116916001600160a01b0316906144d0565b5090565b61412482826143ea565b918261412f57505090565b60009182526000805160206146ae8339815191526020526040909120614116916001600160a01b031690614539565b6001600160a01b03166000818152601260205260409020548015614047578160005260146020526040600020436000526020526141a16040600020549384613cb0565b928310614036578082600052601660205243604060002054146141fe575b83116141e257506000526014602052604060002043600052602052604060002055565b92506319a4e2a760e01b60005260045260245260445260646000fd5b5081600052601860205261421760406000205482613cb0565b6141bf565b6040516323b872dd60e01b60208201526001600160a01b039283166024820152929091166044830152606480830193909352918152614086916140816084836139c3565b60405163313ce56760e01b81529190602090839060049082906001600160a01b03165afa600092816142cc575b506142a357631eecbb6560e01b60005260046000fd5b60ff91821691168082036142b5575050565b631e43476360e11b60005260045260245260446000fd5b6142e691935060203d6020116109c9576109ba81836139c3565b913861428d565b906000602091828151910182855af115613dc2576000513d61433f57506001600160a01b0381163b155b61431e5750565b635274afe760e01b60009081526001600160a01b0391909116600452602490fd5b60011415614317565b600081815260008051602061478e833981519152602090815260408083206001600160a01b038616845290915290205460ff16613ed757600081815260008051602061478e833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19166001179055339291907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a4600190565b600081815260008051602061478e833981519152602090815260408083206001600160a01b038616845290915290205460ff1615613ed757600081815260008051602061478e833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19169055339291907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9080a4600190565b60ff60008051602061480e8339815191525460401c16156144a757565b631afcd79f60e31b60005260046000fd5b8054821015613c205760005260206000200190600090565b6001810190826000528160205260406000205415600014613dce578054600160401b8110156139e65761452461450d8260018794018555846144b8565b819391549060031b91821b91600019901b19161790565b90555491600052602052604060002055600190565b9060018201918160005282602052604060002054801515600014614603576000198101818111613a9e578254600019810191908211613a9e578181036145cc575b505050805480156145b657600019019061459482826144b8565b8154906000199060031b1b191690555560005260205260006040812055600190565b634e487b7160e01b600052603160045260246000fd5b6145ec6145dc61450d93866144b8565b90549060031b1c928392866144b8565b90556000528360205260406000205538808061457a565b50505050600090565b90614632575080511561462157602081519101fd5b63d6bda27560e01b60005260046000fd5b81511580614664575b614643575090565b639996b31560e01b60009081526001600160a01b0391909116600452602490fd5b50803b1561463b56fe2c0a5f5ab0ba371221bb3612c2d2f90d36566279309f526000c5b354efd1b0658c67aaac7f77de07240e5a9b36dfdccb2a89c438635abbb27a73142d2aa0f629c1f6fe24621ce81ec5827caf0253cadb74709b061630e6b55e8237170593200048b07fab687f450848f1df8a96db08fef7840f53415f18fdc2ec8e9f810f0930c7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d275027301df982f5215b4963a854cf9c73219df80cb6acd8f098189c9480c7bbc360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc17dc5b1290f7495d7f8cc68476e6941aaf510598fa925d0d2720edc8805a846c4460507c21097c15f6883572ebd157a9ee4b1d989a312314e93afd9d2ecd494002dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800cd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033009b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00a49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a006d129bd71f2401cbe77f49f546d7d5f58992faecfca6e51ba06b50b261e83331a164736f6c6343000822000a";
|
|
69441
69474
|
var isSuperArgs = (xs) => xs.length > 1;
|
|
69442
|
-
var SimplePSMV2__factory = class extends
|
|
69475
|
+
var SimplePSMV2__factory = class extends import_ethers29.ContractFactory {
|
|
69443
69476
|
constructor(...args) {
|
|
69444
69477
|
if (isSuperArgs(args)) {
|
|
69445
69478
|
super(...args);
|
|
@@ -69459,10 +69492,10 @@ var SimplePSMV2__factory = class extends import_ethers28.ContractFactory {
|
|
|
69459
69492
|
static bytecode = _bytecode;
|
|
69460
69493
|
static abi = _abi;
|
|
69461
69494
|
static createInterface() {
|
|
69462
|
-
return new
|
|
69495
|
+
return new import_ethers29.Interface(_abi);
|
|
69463
69496
|
}
|
|
69464
69497
|
static connect(address, runner) {
|
|
69465
|
-
return new
|
|
69498
|
+
return new import_ethers29.Contract(address, _abi, runner);
|
|
69466
69499
|
}
|
|
69467
69500
|
};
|
|
69468
69501
|
var _abi2 = [
|
|
@@ -71157,7 +71190,7 @@ var _abi2 = [
|
|
|
71157
71190
|
];
|
|
71158
71191
|
var _bytecode2 = "0x60a080604052346100ea57306080527ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005460ff8160401c166100d9576002600160401b03196001600160401b03821601610073575b60405161304c90816100f0823960805181818161114401526113290152f35b6001600160401b0319166001600160401b039081177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005581527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a13880610054565b63f92ee8a960e01b60005260046000fd5b600080fdfe608080604052600436101561001357600080fd5b60003560e01c90816301ffc9a714611ff7575080630d33f3c214611fd35780630f3f4a9414611f885780631459457a14611be257806318c38b8914611ad15780631d44454114611a005780632106764c146119d9578063248a9ca3146119b35780632ec22d4c146118f25780632f0647ce146118775780632f2ff15d14611846578063324207441461177257806336568abe1461172c578063392f1087146116f65780633f4ba83a146115fe5780633f5aadc91461158f5780634f1ef286146112ad57806352340363146111c45780635273b6f61461119b57806352d1902d14611131578063554c4f4b146110a1578063561b7f8a14610f755780635bc26aea14610ee85780635c975abb14610eb85780636289d18c14610e375780636711cc0b14610e1b5780636e852a7814610d1a5780637e35bf6e14610ce65780638343f67414610cb95780638456cb5914610bc35780638f33527f14610b895780639010d07c14610b3557806391d1485414610adb5780639b9d30c114610ab2578063a19af3f614610a01578063a217fddf146109e5578063a3246ad314610923578063a878086414610907578063ac3c0e30146107fa578063ad3cb1cc146107b3578063b3fad6381461070e578063c34e9c26146106f2578063c86deb31146106d6578063ca15c8731461069d578063d547741f14610665578063dd71d99a14610623578063e0922fa114610576578063efa9b4ae14610507578063f2f4eb26146104de578063f68e9553146104b5578063f94f67ab146103de578063fd437d391461029f5763ffa1ad741461026657600080fd5b3461029a57600036600319011261029a576102966102826121ed565b6040519182916020835260208301906121c8565b0390f35b600080fd5b3461029a57606036600319011261029a576102b861207a565b6102c0612064565b906102c961218f565b906102d2612795565b6001600160a01b0316338190036103ce5780600052600160205260406000209283549360ff8560e01c1660038110156103b8576001036103a75781600160209261033e877fc5d5c5bbf10444998e0ea6d4725e79027b574e1c14ec929279e8a9a95c6c6e919688612c43565b818060a01b038316828060a01b031982541617815561035d878261239f565b0180546001600160401b031916426001600160401b03908116919091179091556001600160a01b0391821660008181526002855260409081902087905551969091168652951693a4005b632437e77160e11b60005260046000fd5b634e487b7160e01b600052602160045260246000fd5b62fca64560e31b60005260046000fd5b3461029a57604036600319011261029a576004356103fa6120c9565b90610403612795565b63ffffffff600554169163ffffffff8116928084109081156104ac575b5061049b5760207f6b7727cc9c3df4a29acf0afe01594c1b7e845d20f40f4a14e4c292164a9ed8e191610452846127e0565b9161046a600863ffffffff845460a01c1617836122e3565b81546001600160e01b031660e09190911b6001600160e01b0319161790556040519485526001600160a01b031693a3005b634346c13160e01b60005260046000fd5b90501584610420565b3461029a57600036600319011261029a576020604051600080516020612fe08339815191528152f35b3461029a57600036600319011261029a576003546040516001600160a01b039091168152602090f35b3461029a57602036600319011261029a57600435610523612795565b61054561052f826127e0565b9190600163ffffffff825460a01c1617906122e3565b6001600160a01b0316907f812690e0a9dff5bf3add998111b8af5c8299608d859025bfe35662060ab4267d600080a3005b3461029a57602036600319011261029a576004356001600160401b0381169081810361029a576000546001600160a01b038116330361061257600160a01b600160e01b0319811660a092831b600160a01b600160e01b031617600055604080519190921c6001600160401b0316815260208101929092527f9c195448332abd01f716db873b329752ea02f19d33f7e311fb0daf082c4edd0391a1005b6349db3bd360e01b60005260046000fd5b3461029a57602036600319011261029a576001600160a01b0361064461207a565b166000526002602052602060018060a01b0360406000205416604051908152f35b3461029a57604036600319011261029a5761069b600435610684612064565b90610696610691826122c2565b6126bf565b612751565b005b3461029a57602036600319011261029a57600435600052600080516020612ee08339815191526020526020604060002054604051908152f35b3461029a57600036600319011261029a57602060405160088152f35b3461029a57600036600319011261029a57602060405160028152f35b3461029a57602036600319011261029a576000606060405161072f81612136565b828152826020820152826040820152015260043560005260046020526080604060002063ffffffff6040519161076483612136565b548160018060a01b038216938481528160208201818560a01c16815260606040840193838760c01c168552019460e01c8552604051968752511660208601525116604084015251166060820152f35b3461029a57600036600319011261029a5761029660408051906107d68183612151565b60058252640352e302e360dc1b6020830152519182916020835260208301906121c8565b3461029a57602036600319011261029a5761081361207a565b6000608060405161082381612105565b828152826020820152826040820152826060820152015260018060a01b03166000526001602052604060002060405161085b81612105565b81546001600160a01b038116825260a081901c6001600160401b03166020830190815292604083019160e01c60ff169060038210156103b857908252600101546001600160401b0380821660608501908152604092831c821660808601908152925194516001600160a01b03168552945116602084015290519260038410156103b857604083019390935291516001600160401b0390811660608301529151909116608082015260a090f35b3461029a57600036600319011261029a57602060405160018152f35b3461029a57602036600319011261029a57600435600052600080516020612ee083398151915260205260406000206040518060208354918281520190819360005260206000209060005b8181106109cf5750505081610983910382612151565b6040519182916020830190602084525180915260408301919060005b8181106109ad575050500390f35b82516001600160a01b031684528594506020938401939092019160010161099f565b825484526020909301926001928301920161096d565b3461029a57600036600319011261029a57602060405160008152f35b3461029a57604036600319011261029a57600435610a1d6120c9565b90610a26612795565b63ffffffff600554169163ffffffff811692808410908115610aa9575b5061049b5760207f1da95b87b4c773f68c1447ffc5644e41a8a8887d55065beb64852014cf7140be91610a96610a78856127e0565b9290610a91600463ffffffff835460a01c1617826122e3565b612210565b6040519485526001600160a01b031693a3005b90501584610a43565b3461029a57600036600319011261029a576020604051600080516020612f208339815191528152f35b3461029a57604036600319011261029a57610af4612064565b600435600052600080516020612fc083398151915260205260406000209060018060a01b0316600052602052602060ff604060002054166040519015158152f35b3461029a57604036600319011261029a57600435600052600080516020612ee08339815191526020526020610b706024356040600020612d0c565b905460405160039290921b1c6001600160a01b03168152f35b3461029a57602036600319011261029a576001600160a01b03610baa61207a565b1660005260026020526020604060002054604051908152f35b3461029a57600036600319011261029a573360009081527f0ac8cc3d209806126662940717264973110c39045b305f6ba49613325a615e09602052604090205460ff1615610c9257610c13612795565b600160ff19600080516020613000833981519152541617600080516020613000833981519152557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a16040514281527f80170b5fcdd2bf1e0660ef4b8851f86685f64d41b1a19de1471947ece8725aac60203392a2005b63e2517d3f60e01b60005233600452600080516020612f2083398151915260245260446000fd5b3461029a57600036600319011261029a5760005460405160a09190911c6001600160401b03168152602090f35b3461029a57604036600319011261029a57610d0a610d02612064565b60043561236c565b906102966040519283928361209a565b3461029a57604036600319011261029a57610d3361207a565b336000908152600080516020612f60833981519152602052604090205460ff161580610e08575b6103ce576001600160a01b03166000818152600160205260409020805460e01c60ff1660038110156103b8576001036103a757805460ff60e01b198116600160e11b1782556001919091018054600160401b600160801b03191642604090811b600160401b600160801b0316919091179091555160243581526001600160a01b0390911691907fc0499cc07ed9d734deec6857802d3f0fa8d5afaf79a7008beb8ba7bef62a271b90602090a3005b50336001600160a01b0382161415610d5a565b3461029a57600036600319011261029a57602060405160048152f35b3461029a57602036600319011261029a57610e506120b6565b6000546001600160a01b031633036106125763ffffffff8116908115610ea757600080516020612fa083398151915291610ea263ffffffff926005549284198416176005556040519384931683612233565b0390a1005b6338f3377360e21b60005260046000fd5b3461029a57600036600319011261029a57602060ff60008051602061300083398151915254166040519015158152f35b3461029a57602036600319011261029a57610f0161207a565b6000546001600160a01b0381169033829003610612576001600160a01b038316928315610f64573b15610f53576001600160a01b03191682176000908155600080516020612f808339815191529080a3005b636f7c43f160e01b60005260046000fd5b63e6c4247b60e01b60005260046000fd5b3461029a57606036600319011261029a57610f8e61207a565b610f96612064565b610f9e61218f565b91610fa7612795565b6001600160a01b031690338290036103ce57816000526001602052604060002060ff815460e01c1660038110156103b857600114611090578160209161100f867ff223dc085722c94c84dcf67427e225799be616382a2a484d378f8921c69a20339587612c43565b80546001600160a01b0319166001600160a01b038316178155611032868261239f565b6001810180546001600160801b031916426001600160401b0390811691909117909155815460ff60e01b1916600160e01b179091556001600160a01b03919091166000818152600284526040908190208690555195909116855293a3005b639d2c8fdf60e01b60005260046000fd5b3461029a57602036600319011261029a576001600160a01b036110c261207a565b166000526001602052604060002060ff60008051602061300083398151915254161580611115575b602091816110fe575b506040519015158152f35b5460a01c6001600160401b031642109050826110f3565b5060ff815460e01c169060038210156103b857906001146110ea565b3461029a57600036600319011261029a577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316300361118a576020604051600080516020612f408339815191528152f35b63703e46dd60e11b60005260046000fd5b3461029a57600036600319011261029a576000546040516001600160a01b039091168152602090f35b3461029a57602036600319011261029a57600435604060008281526004602052209081549160018060a01b03831692831590811561129e575b5061128d57336000908152600080516020612f60833981519152602052604090205460ff161580611283575b611272578061124563fffffffe61124b935460a01c16826122e3565b8261269b565b7fa5ffbdba01b15df97334e34ad816b9986b6057a5ddc97aba93b7e8ccd21759ed600080a3005b630a606ec360e11b60005260046000fd5b5082331415611229565b6360eb6c2360e01b60005260046000fd5b6001915060a01c1615846111fd565b604036600319011261029a576112c161207a565b602435906001600160401b03821161029a573660238301121561029a578160040135906112ed82612174565b916112fb6040519384612151565b8083526020830193366024838301011161029a57816000926024602093018737840101526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630811490811561156c575b5061118a576000546001600160a01b03163303610612576001600160a01b038116928315610f6457813b1561155b5730841461154c57600080516020612f4083398151915254846113a36121ed565b7f6ea8b34d59b2818d3f37a08dddaa06f5886b9c20c907b36f03ca6528e106e86f6113d9604051926040845260408401906121c8565b4260208401526001600160a01b038516929081900390a36040516352d1902d60e01b8152602081600481895afa60009181611518575b506114295785634c9c8ce360e01b60005260045260246000fd5b9081600080516020612f408339815191528793036115045750833b156114ef576001600160a01b0319168117600080516020612f40833981519152557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a28251156114d4576000809161069b945190845af43d156114cc573d916114af83612174565b926114bd6040519485612151565b83523d6000602085013e612e7e565b606091612e7e565b505050346114de57005b63b398979f60e01b60005260046000fd5b50634c9c8ce360e01b60005260045260246000fd5b632a87526960e21b60005260045260246000fd5b9091506020813d602011611544575b8161153460209383612151565b8101031261029a5751908761140f565b3d9150611527565b614e8d60eb1b60005260046000fd5b632e07c4bd60e11b60005260046000fd5b600080516020612f40833981519152546001600160a01b03161415905084611354565b3461029a57602036600319011261029a576004356115ab612795565b6115cd6115b7826127e0565b9190600263ffffffff825460a01c1617906122e3565b6001600160a01b0316907fc2713e691344add4705edc62a0ee5aede95ba66ad68f97316efef9cb50644edd600080a3005b3461029a57600036600319011261029a57336000908152600080516020612f60833981519152602052604090205460ff1615806116e1575b6116d0576000805160206130008339815191525460ff8116156116bf5760ff1916600080516020613000833981519152557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a16040514281527f107553d8191d85b405879cf752997865edd48d94e20bda4dd27223c94b31a7cc60203392a2005b638dfc202b60e01b60005260046000fd5b63659a07b360e11b60005260046000fd5b506000546001600160a01b0316331415611636565b3461029a57604036600319011261029a5761029661171d611715612064565b600435612306565b604093919351938493846120dc565b3461029a57604036600319011261029a57611745612064565b336001600160a01b038216036117615761069b90600435612751565b63334bd91960e11b60005260046000fd5b3461029a57602036600319011261029a57600435604060008281526004602052209081549160018060a01b038316928315908115611837575b5061128d57336000908152600080516020612f60833981519152602052604090205460ff16158061182d575b61127257806117f363fffffff7611806935460a01c16826122e3565b80546001600160e01b031681558261269b565b7f054490ec6650e07db9b97a06ea31d44cebd44b390c9975a380055e1b4d3cac21600080a3005b50823314156117d7565b6008915060a01c1615846117ab565b3461029a57604036600319011261029a5761069b600435611865612064565b90611872610691826122c2565b612709565b3461029a57602036600319011261029a576004356118c161189782612629565b91906118ad63fffffffb825460a01c16826122e3565b805463ffffffff60c01b191681558361269b565b6001600160a01b0316907f09cb4ec44cdef8489412844b9682f87f7900758fa2bd7e039113e9125e538e0f600080a3005b3461029a57602036600319011261029a57600435604060008281526004602052209081549160018060a01b0383169283159081156119a4575b5061128d57336000908152600080516020612f60833981519152602052604090205460ff16158061199a575b611272578061124563fffffffd611973935460a01c16826122e3565b7fb390ab029eab314bd18190ebe73d7e5c1c336beaa5c83ac22578378dc9ccc405600080a3005b5082331415611957565b6002915060a01c16158461192b565b3461029a57602036600319011261029a5760206119d16004356122c2565b604051908152f35b3461029a57604036600319011261029a5761029661171d6119f8612064565b60043561224a565b3461029a57604036600319011261029a57600435611a1c6120c9565b63ffffffff600554169063ffffffff811691808310908115611ac8575b5061049b57611a4783612629565b909263ffffffff845460c01c16809260018060a01b03163314159182611abd575b5050611aac57611a98827e8a218591d4362499c38c38eb1c12e7a7cc97a9068818d1fe6046a42ba4a5ba94612210565b611aa760405192839283612233565b0390a2005b634e80a40760e11b60005260046000fd5b111590508186611a68565b90501584611a39565b3461029a57602036600319011261029a57611aea6120b6565b6000805160206130208339815191525460ff8160401c16908115611bca575b50611bb957600080516020613020833981519152805460026001600160401b0319821681179092556000546001600160481b031990911690911791906001600160a01b031633036106125763ffffffff168015610ea757604081600080516020612fa08339815191529263ffffffff196005541617600555815190600082526020820152a160008051602061302083398151915255600080516020612f00833981519152602060405160028152a1005b63f92ee8a960e01b60005260046000fd5b60026001600160401b03919091161015905082611b09565b3461029a5760a036600319011261029a57611bfb61207a565b611c03612064565b906044356001600160a01b03811680820361029a576064356001600160a01b0381169182820361029a576084356001600160a01b038116949085900361029a5760008051602061302083398151915254604081901c60ff161596906001600160401b031680159081611f80575b6001149081611f76575b159081611f6d575b50611bb95760008051602061302083398151915280546001600160401b031916600117905586611f48575b611cb5612acc565b611cbd612acc565b611cc5612acc565b611ccd612acc565b6001600160a01b038116908115610f64578315610f64578515610f64576001600160a01b038916988915610f64573b15610f5357858414611f375762aa36a746148015611f2c575b8015611f21575b1580611f0f575b610f5357611d32906000612afa565b9081611ec8575b5015611e0d57611d5790600080516020612fe0833981519152612afa565b9081611e73575b5015611e0d57611d7c90600080516020612f20833981519152612afa565b9081611e1e575b5015611e0d57600080546001600160a01b031916841781556040519390600080516020612f808339815191528180a38015610f6457803b15610f5357600380546001600160a01b031916919091179055611dd957005b600080516020613020833981519152805460ff60401b1916905560018152600080516020612f0083398151915290602090a1005b63cf5a8e3360e01b60005260046000fd5b600080516020612f20833981519152600052600080516020612ee0833981519152602052611e6c907ffff5b43478fa6840382eb63777e0da6941d320b940e3f70f0ea4780feff95827612d3a565b5084611d83565b600080516020612fe0833981519152600052600080516020612ee0833981519152602052611ec1907f32d31393d541a265984ec379cddd8b1fcbe5f2b0eb8ad81dddfead454f135eaa612d3a565b5086611d5e565b60008052600080516020612ee0833981519152602052611f08907f615f0f9e84155bea8cc509fe18befeb1baf65611e38a6ba60964480fb29dfd44612d3a565b5088611d39565b50823b1580611d235750843b15611d23565b50617a694614611d1c565b506105394614611d15565b638135316560e01b60005260046000fd5b600080516020613020833981519152805460ff60401b1916600160401b179055611cad565b90501589611c82565b303b159150611c7a565b889150611c70565b3461029a57604036600319011261029a57610296611fbc611fa7612064565b600435600052600460205260406000206123c8565b611fc581612090565b60405191818392158361209a565b3461029a57600036600319011261029a57602063ffffffff60055416604051908152f35b3461029a57602036600319011261029a576004359063ffffffff60e01b821680920361029a57602091635a05180f60e01b8114908115612039575b5015158152f35b637965db0b60e01b811491508115612053575b5083612032565b6301ffc9a760e01b1490508361204c565b602435906001600160a01b038216820361029a57565b600435906001600160a01b038216820361029a57565b600811156103b857565b9015158152604081019291906020906120b283612090565b0152565b6004359063ffffffff8216820361029a57565b6024359063ffffffff8216820361029a57565b91604091949363ffffffff916060850196151585526120fa81612090565b602085015216910152565b60a081019081106001600160401b0382111761212057604052565b634e487b7160e01b600052604160045260246000fd5b608081019081106001600160401b0382111761212057604052565b601f909101601f19168101906001600160401b0382119082101761212057604052565b6001600160401b03811161212057601f01601f191660200190565b604435906001600160401b038216820361029a57565b60005b8381106121b85750506000910152565b81810151838201526020016121a8565b906020916121e1815180928185528580860191016121a5565b601f01601f1916010190565b604051906121fc604083612151565b60058252640322e312e360dc1b6020830152565b805463ffffffff60c01b191660c09290921b63ffffffff60c01b16919091179055565b63ffffffff91821681529116602082015260400190565b600052600460205261226160406000209182612485565b61226a81612090565b806122b857505460e01c63ffffffff60055416811580156122b0575b6122a35780821061229c57505b60019160009190565b9050612293565b5050600090600390600090565b508015612286565b6000929091508290565b600052600080516020612fc083398151915260205260016040600020015490565b805463ffffffff60a01b191660a09290921b63ffffffff60a01b16919091179055565b919091600052600460205261232060406000209283612511565b9161232a83612090565b826123625763ffffffff9192505460c01c1663ffffffff60055416811580156122b0576122a35780821061229c575060019160009190565b5060009190600090565b90612383916000526004602052604060002061259d565b61238c81612090565b8061239a5750600190600090565b600091565b8054600160a01b600160e01b03191660a09290921b600160a01b600160e01b0316919091179055565b60ff600080516020613000833981519152541661247e57546001600160a01b0381169081156124765760a01c6002161561246f5760005260016020526040600020549060ff8260e01c1660038110156103b857801561246757600214612460574260a083901c6001600160401b03161115612459576001600160a01b0390811691160361245457600090565b600790565b5050600690565b5050600590565b505050600490565b5050600390565b505050600290565b5050600190565b60ff600080516020613000833981519152541661247e57546001600160a01b0381169081156124765760a01c6008161561246f5760005260016020526040600020549060ff8260e01c1660038110156103b857801561246757600214612460574260a083901c6001600160401b03161115612459576001600160a01b0390811691160361245457600090565b60ff600080516020613000833981519152541661247e57546001600160a01b0381169081156124765760a01c6004161561246f5760005260016020526040600020549060ff8260e01c1660038110156103b857801561246757600214612460574260a083901c6001600160401b03161115612459576001600160a01b0390811691160361245457600090565b60ff600080516020613000833981519152541661247e57546001600160a01b0381169081156124765760a01c6001161561246f5760005260016020526040600020549060ff8260e01c1660038110156103b857801561246757600214612460574260a083901c6001600160401b03161115612459576001600160a01b0390811691160361245457600090565b6000908152600460205260409020805490916001600160a01b03821691821590811561268c575b5061128d57336000908152600080516020612f60833981519152602052604090205460ff161580612682575b61127257565b508133141561267c565b6004915060a01c161538612650565b905460a01c63ffffffff16156126ae5750565b600052600460205260006040812055565b6000818152600080516020612fc08339815191526020908152604080832033845290915290205460ff16156126f15750565b63e2517d3f60e01b6000523360045260245260446000fd5b6127138282612afa565b918261271e57505090565b6000918252600080516020612ee0833981519152602052604090912061274d916001600160a01b031690612d3a565b5090565b61275b8282612ba3565b918261276657505090565b6000918252600080516020612ee0833981519152602052604090912061274d916001600160a01b031690612dab565b60ff60008051602061300083398151915254166127ae57565b63d93c066560e01b60005260046000fd5b519064ffffffffff8216820361029a57565b519061ffff8216820361029a57565b8015612abb57600354604051638d34875560e01b8152600481018390529190600090839060249082906001600160a01b03165afa918215612aaf57600092612904575b5060808201516001600160a01b0316913383900361127257610120015161284981612090565b61285281612090565b600381149081156128ef575b81156128db575b506128ca5781600052600160205260ff60406000205460e01c1660038110156103b8576001036128b957600090815260046020526040902080546001600160a01b0319166001600160a01b03831617815591565b632e68d1d360e21b60005260046000fd5b63e9f6db8560e01b60005260046000fd5b600791506128e881612090565b1438612865565b90506128fa81612090565b600581149061285e565b90913d8082843e6129158184612151565b820191602081840312612a8f578051906001600160401b038211612a975701906101a082840312612a8c57604051926101a084016001600160401b03811185821017612a9b5760409081528351855260208085015190860152838101519085015260608301516001600160401b038111612a9757830181601f82011215612a97578051906129a282612174565b926129b06040519485612151565b82845260208383010111612a9357906129cf91602080850191016121a5565b606084015260808201516001600160a01b0381168103612a8f5760808401526129fa60a083016127bf565b60a0840152612a0b60c083016127bf565b60c0840152612a1c60e083016127d1565b60e0840152612a2e61010083016127bf565b610100840152610120820151906008821015612a8c5750612a7f9161018091610120850152612a6061014082016127bf565b610140850152612a7361016082016127d1565b610160850152016127bf565b6101808201529038612823565b80fd5b5080fd5b8380fd5b8280fd5b634e487b7160e01b83526041600452602483fd5b6040513d6000823e3d90fd5b637bb0b62160e01b60005260046000fd5b60ff6000805160206130208339815191525460401c1615612ae957565b631afcd79f60e31b60005260046000fd5b6000818152600080516020612fc0833981519152602090815260408083206001600160a01b038616845290915290205460ff16612b9c576000818152600080516020612fc0833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19166001179055339291907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a4600190565b5050600090565b6000818152600080516020612fc0833981519152602090815260408083206001600160a01b038616845290915290205460ff1615612b9c576000818152600080516020612fc0833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19169055339291907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9080a4600190565b158015612cfb575b610f64576001600160a01b0316600090815260026020526040902054612cea576001600160401b031642811115612cd95760005460a01c6001600160401b03168015159182612cae575b5050612c9d57565b63e774e7b560e01b60005260046000fd5b909150428103908111612cc357113880612c95565b634e487b7160e01b600052601160045260246000fd5b63efa7aefd60e01b60005260046000fd5b633b53f64f60e21b60005260046000fd5b506001600160a01b03811615612c4b565b8054821015612d245760005260206000200190600090565b634e487b7160e01b600052603260045260246000fd5b6001810190826000528160205260406000205415600014612da3578054600160401b81101561212057612d8e612d77826001879401855584612d0c565b819391549060031b91821b91600019901b19161790565b90555491600052602052604060002055600190565b505050600090565b9060018201918160005282602052604060002054801515600014612e75576000198101818111612cc3578254600019810191908211612cc357818103612e3e575b50505080548015612e28576000190190612e068282612d0c565b8154906000199060031b1b191690555560005260205260006040812055600190565b634e487b7160e01b600052603160045260246000fd5b612e5e612e4e612d779386612d0c565b90549060031b1c92839286612d0c565b905560005283602052604060002055388080612dec565b50505050600090565b90612ea45750805115612e9357602081519101fd5b63d6bda27560e01b60005260046000fd5b81511580612ed6575b612eb5575090565b639996b31560e01b60009081526001600160a01b0391909116600452602490fd5b50803b15612ead56fec1f6fe24621ce81ec5827caf0253cadb74709b061630e6b55e82371705932000c7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d275027301df982f5215b4963a854cf9c73219df80cb6acd8f098189c9480c7bbc360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc07966f2ab141347034724e9b2a472c2f77f5cd745aeba27cacba797b8fcb708617dc5b1290f7495d7f8cc68476e6941aaf510598fa925d0d2720edc8805a846cd37bc77615afefc793aa17d75d4249a9b517ba91b0e54a49c9c4a44b3d7e228302dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800edcc084d3dcd65a1f7f23c65c46722faca6953d28e43150a467cf43e5c309238cd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00a164736f6c6343000822000a";
|
|
71159
71192
|
var isSuperArgs2 = (xs) => xs.length > 1;
|
|
71160
|
-
var AgentDelegationRegistry__factory = class extends
|
|
71193
|
+
var AgentDelegationRegistry__factory = class extends import_ethers30.ContractFactory {
|
|
71161
71194
|
constructor(...args) {
|
|
71162
71195
|
if (isSuperArgs2(args)) {
|
|
71163
71196
|
super(...args);
|
|
@@ -71177,10 +71210,10 @@ var AgentDelegationRegistry__factory = class extends import_ethers29.ContractFac
|
|
|
71177
71210
|
static bytecode = _bytecode2;
|
|
71178
71211
|
static abi = _abi2;
|
|
71179
71212
|
static createInterface() {
|
|
71180
|
-
return new
|
|
71213
|
+
return new import_ethers30.Interface(_abi2);
|
|
71181
71214
|
}
|
|
71182
71215
|
static connect(address, runner) {
|
|
71183
|
-
return new
|
|
71216
|
+
return new import_ethers30.Contract(
|
|
71184
71217
|
address,
|
|
71185
71218
|
_abi2,
|
|
71186
71219
|
runner
|
|
@@ -71194,7 +71227,7 @@ var POSITION_DELEGATE_REGISTRY_ABI = [
|
|
|
71194
71227
|
"event PositionDelegateUpdated(bytes32 indexed positionId, address indexed oldDelegate, address indexed newDelegate)"
|
|
71195
71228
|
];
|
|
71196
71229
|
async function setPositionDelegate(positionId, delegate, signer, registryAddress) {
|
|
71197
|
-
const registry = new
|
|
71230
|
+
const registry = new import_ethers31.Contract(
|
|
71198
71231
|
registryAddress,
|
|
71199
71232
|
POSITION_DELEGATE_REGISTRY_ABI,
|
|
71200
71233
|
signer
|
|
@@ -71202,7 +71235,7 @@ async function setPositionDelegate(positionId, delegate, signer, registryAddress
|
|
|
71202
71235
|
return registry["setPositionDelegate"](positionId, delegate);
|
|
71203
71236
|
}
|
|
71204
71237
|
async function getPositionDelegate(positionId, provider, registryAddress) {
|
|
71205
|
-
const registry = new
|
|
71238
|
+
const registry = new import_ethers31.Contract(
|
|
71206
71239
|
registryAddress,
|
|
71207
71240
|
POSITION_DELEGATE_REGISTRY_ABI,
|
|
71208
71241
|
provider
|
|
@@ -71317,7 +71350,7 @@ var SIGNABLE_FUNCTIONS2 = [
|
|
|
71317
71350
|
// this too is client-only and never module-whitelisted.
|
|
71318
71351
|
"function addAddress(string btcAddress) external"
|
|
71319
71352
|
];
|
|
71320
|
-
var IFACE2 = new
|
|
71353
|
+
var IFACE2 = new import_ethers33.ethers.Interface(SIGNABLE_FUNCTIONS2);
|
|
71321
71354
|
function encodeSignable2(fn, args) {
|
|
71322
71355
|
return IFACE2.encodeFunctionData(fn, args);
|
|
71323
71356
|
}
|
|
@@ -71338,46 +71371,11 @@ function decodeSignable2(data) {
|
|
|
71338
71371
|
);
|
|
71339
71372
|
}
|
|
71340
71373
|
}
|
|
71341
|
-
var MAX_GAS_LIMIT = 5000000n;
|
|
71342
|
-
var MAX_FEE_PER_GAS_WEI = 2000000000000n;
|
|
71343
|
-
var DEFAULT_MAX_TX_FEE_WEI = 250000000000000000n;
|
|
71344
|
-
var DEFAULT_FEE_CEILING = {
|
|
71345
|
-
maxGasLimit: MAX_GAS_LIMIT,
|
|
71346
|
-
maxFeePerGasWei: MAX_FEE_PER_GAS_WEI,
|
|
71347
|
-
maxTxFeeWei: DEFAULT_MAX_TX_FEE_WEI
|
|
71348
|
-
};
|
|
71349
|
-
function fmtEth(wei) {
|
|
71350
|
-
return `${import_ethers34.ethers.formatEther(wei)} ETH`;
|
|
71351
|
-
}
|
|
71352
|
-
function fmtGwei(wei) {
|
|
71353
|
-
return `${import_ethers34.ethers.formatUnits(wei, "gwei")} gwei`;
|
|
71354
|
-
}
|
|
71355
|
-
function worstCaseFeeWei(gasLimit, maxFeePerGas) {
|
|
71356
|
-
if (gasLimit == null || maxFeePerGas == null)
|
|
71357
|
-
return null;
|
|
71358
|
-
return gasLimit * maxFeePerGas;
|
|
71359
|
-
}
|
|
71360
|
-
function assertFeeCeiling(gasLimit, maxFeePerGas, raise, ceiling = DEFAULT_FEE_CEILING) {
|
|
71361
|
-
if (gasLimit != null && gasLimit > ceiling.maxGasLimit) {
|
|
71362
|
-
raise(`gasLimit ${gasLimit} exceeds the signing ceiling of ${ceiling.maxGasLimit}`);
|
|
71363
|
-
}
|
|
71364
|
-
if (maxFeePerGas != null && maxFeePerGas > ceiling.maxFeePerGasWei) {
|
|
71365
|
-
raise(
|
|
71366
|
-
`maxFeePerGas ${fmtGwei(maxFeePerGas)} exceeds the signing ceiling of ${fmtGwei(ceiling.maxFeePerGasWei)}`
|
|
71367
|
-
);
|
|
71368
|
-
}
|
|
71369
|
-
const worst = worstCaseFeeWei(gasLimit, maxFeePerGas);
|
|
71370
|
-
if (worst != null && worst > ceiling.maxTxFeeWei) {
|
|
71371
|
-
raise(
|
|
71372
|
-
`worst-case transaction fee ${fmtEth(worst)} (gasLimit ${gasLimit} \xD7 ${fmtGwei(maxFeePerGas)}) exceeds the signing ceiling of ${fmtEth(ceiling.maxTxFeeWei)}.${ceiling.raiseHint ? ` ${ceiling.raiseHint}` : ""}`
|
|
71373
|
-
);
|
|
71374
|
-
}
|
|
71375
|
-
}
|
|
71376
71374
|
function eqAddr2(a, b) {
|
|
71377
71375
|
if (!a || !b)
|
|
71378
71376
|
return false;
|
|
71379
71377
|
try {
|
|
71380
|
-
return
|
|
71378
|
+
return import_ethers34.ethers.getAddress(a) === import_ethers34.ethers.getAddress(b);
|
|
71381
71379
|
} catch {
|
|
71382
71380
|
return false;
|
|
71383
71381
|
}
|
|
@@ -71443,7 +71441,7 @@ function readValue2(tx2) {
|
|
|
71443
71441
|
}
|
|
71444
71442
|
function normalizePositionId2(id) {
|
|
71445
71443
|
const hex = id.startsWith("0x") ? id : `0x${id}`;
|
|
71446
|
-
return
|
|
71444
|
+
return import_ethers34.ethers.zeroPadValue(hex, 32).toLowerCase();
|
|
71447
71445
|
}
|
|
71448
71446
|
function requirePositionId(actual, expected) {
|
|
71449
71447
|
const txPositionId = String(actual).toLowerCase();
|
|
@@ -71735,18 +71733,18 @@ function buildPsmRedeemTx2(p) {
|
|
|
71735
71733
|
var PSM_READS_ABI = ["function supportedStablecoins(address) view returns (bool)"];
|
|
71736
71734
|
var ERC20_READS_ABI = ["function allowance(address owner, address spender) view returns (uint256)"];
|
|
71737
71735
|
function psmExchangeReadsFromProvider(provider, psmAddress) {
|
|
71738
|
-
const psm = new
|
|
71736
|
+
const psm = new import_ethers32.ethers.Contract(psmAddress, PSM_READS_ABI, provider);
|
|
71739
71737
|
return {
|
|
71740
71738
|
isStablecoinSupported: async (stablecoin) => await psm.getFunction("supportedStablecoins")(stablecoin),
|
|
71741
|
-
allowance: async (token, owner, spender) => await new
|
|
71739
|
+
allowance: async (token, owner, spender) => await new import_ethers32.ethers.Contract(token, ERC20_READS_ABI, provider).getFunction("allowance")(owner, spender)
|
|
71742
71740
|
};
|
|
71743
71741
|
}
|
|
71744
71742
|
var refuse = (direction, msg) => new TxValidationError2(msg, `PSM ${direction}`);
|
|
71745
71743
|
function requireAddress(direction, label, value) {
|
|
71746
|
-
if (!value || !
|
|
71744
|
+
if (!value || !import_ethers32.ethers.isAddress(value)) {
|
|
71747
71745
|
throw refuse(direction, `${label} address is missing or invalid (${String(value)})`);
|
|
71748
71746
|
}
|
|
71749
|
-
return
|
|
71747
|
+
return import_ethers32.ethers.getAddress(value);
|
|
71750
71748
|
}
|
|
71751
71749
|
async function planPsmExchange(params) {
|
|
71752
71750
|
const { direction, amountIn, minOut, vctx, reads } = params;
|
|
@@ -72063,6 +72061,384 @@ function formatLiquidationFailureMessage(loanId, errorMessage, btcVault, btcVaul
|
|
|
72063
72061
|
const formattedBalance = formatBTCAmount(btcVaultBalance);
|
|
72064
72062
|
return `\u274C DH SDK: Loan Id ${loanId} liquidation FAILED: ${errorMessage}; BTC vault ${btcVault} balance is ${formattedBalance}, UCD Debt of ${ucdDebt} and BTC Price of ${formattedPrice}`;
|
|
72065
72063
|
}
|
|
72064
|
+
var CONTRACT_ERROR_FRAGMENTS = [
|
|
72065
|
+
{ fragment: "error AboveMaxRedeem(uint256 amount, uint256 maximum)", contracts: ["SimplePSMV2"] },
|
|
72066
|
+
{ fragment: "error AboveMaxSwap(uint256 amount, uint256 maximum)", contracts: ["SimplePSMV2"] },
|
|
72067
|
+
{ fragment: "error AccessControlBadConfirmation()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
72068
|
+
{ fragment: "error AccessControlUnauthorizedAccount(address account, bytes32 neededRole)", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
72069
|
+
{ fragment: "error AddressEmptyCode(address target)", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
72070
|
+
{ fragment: "error AlreadyActive()", contracts: ["PositionManagerErrors"] },
|
|
72071
|
+
{ fragment: "error AlreadySigned()", contracts: ["PositionManagerErrors", "OperationAuthorizationRegistry"] },
|
|
72072
|
+
{ fragment: "error AmountMustBePositive()", contracts: ["LoanOperationsManagerModule", "SimplePSMV2"] },
|
|
72073
|
+
{ fragment: "error ArrayLengthMismatch()", contracts: ["BTCSpendAuthorizer", "SimplePSMV2"] },
|
|
72074
|
+
{ fragment: "error BTCSpendAuthorizerNotSet()", contracts: ["LoanOperationsManagerModule"] },
|
|
72075
|
+
{ fragment: "error BalanceMismatch()", contracts: ["UCDController"] },
|
|
72076
|
+
{ fragment: "error BatchSizeTooLarge()", contracts: ["BTCSpendAuthorizer"] },
|
|
72077
|
+
{ fragment: "error BelowMinRedeem(uint256 amount, uint256 minimum)", contracts: ["SimplePSMV2"] },
|
|
72078
|
+
{ fragment: "error BelowMinSwap(uint256 amount, uint256 minimum)", contracts: ["SimplePSMV2"] },
|
|
72079
|
+
{ fragment: "error BorrowerBTCSpendMutationDisabled()", contracts: ["LoanOperationsManagerModule"] },
|
|
72080
|
+
{ fragment: "error BtcAmountTooLarge()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule"] },
|
|
72081
|
+
{ fragment: "error BtcPriceBoundOutOfRange()", contracts: ["LoanOperationsManagerModule"] },
|
|
72082
|
+
{ fragment: "error BtcPriceDeviationExceeded(uint256 signedPrice, uint256 chainlinkPrice, uint16 deviationBps)", contracts: ["LoanOperationsManagerModule"] },
|
|
72083
|
+
{ fragment: "error BtcPriceFeedStale(uint256 updatedAt, uint256 maxAge)", contracts: ["LoanOperationsManagerModule"] },
|
|
72084
|
+
{ fragment: "error BtcPriceTooHigh()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule"] },
|
|
72085
|
+
{ fragment: "error BurnCallFailed()", contracts: ["UCDController"] },
|
|
72086
|
+
{ fragment: "error BurnGuardFailed(uint8 code)", contracts: ["UCDController"] },
|
|
72087
|
+
{ fragment: "error BurnVerificationFailed()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
72088
|
+
{ fragment: "error CannotRemoveLastTerm()", contracts: ["PositionManagerErrors"] },
|
|
72089
|
+
{ fragment: "error CannotUpgradeToSelf()", contracts: ["PositionManagerErrors", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer"] },
|
|
72090
|
+
{ fragment: "error CircuitBreakerNotActive()", contracts: ["PositionManagerErrors"] },
|
|
72091
|
+
{ fragment: "error CircuitBreakerTriggered()", contracts: ["PositionManagerErrors"] },
|
|
72092
|
+
{ fragment: "error CollateralOverflow()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule"] },
|
|
72093
|
+
{ fragment: "error CollateralRatioTooLargeForStorage()", contracts: ["PositionManagerErrors"] },
|
|
72094
|
+
{ fragment: "error CollateralRatioTooLow()", contracts: ["PositionManager", "PositionManagerErrors", "LoanOperationsManagerModule"] },
|
|
72095
|
+
{ fragment: "error ContractNotDeployed(address addr)", contracts: ["PositionManager"] },
|
|
72096
|
+
{ fragment: "error DailyLimitExceeded()", contracts: ["UCDController"] },
|
|
72097
|
+
{ fragment: "error DeadZoneViolation()", contracts: ["OperationAuthorizationRegistry"] },
|
|
72098
|
+
{ fragment: "error DebtCalculationMismatch()", contracts: ["LoanOperationsManagerModule"] },
|
|
72099
|
+
{ fragment: "error DebtNotZero()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
72100
|
+
{ fragment: "error DebtOverflow()", contracts: ["LoanOperationsManagerModule"] },
|
|
72101
|
+
{ fragment: "error DebtUpdateVerificationFailed()", contracts: ["LoanOperationsValidation", "LoanOperationsManagerModule"] },
|
|
72102
|
+
{ fragment: "error DebtUpdateVerificationFailedDetailed(bytes32 positionId, uint256 currentDebt, uint256 newDebt, uint256 quantumTimestamp, uint256 supplyAfterMint, uint256 expectedIncrease)", contracts: ["LoanOperationsManagerModule"] },
|
|
72103
|
+
{ fragment: "error DecimalsMismatch(uint8 provided, uint8 actual)", contracts: ["SimplePSMV2"] },
|
|
72104
|
+
{ fragment: "error DecimalsQueryFailed()", contracts: ["SimplePSMV2"] },
|
|
72105
|
+
{ fragment: "error DivisionByZero()", contracts: ["PositionManager", "CollateralManagerModule"] },
|
|
72106
|
+
{ fragment: "error ECDSAInvalidSignature()", contracts: ["BTCSpendAuthorizer"] },
|
|
72107
|
+
{ fragment: "error ECDSAInvalidSignatureLength(uint256 length)", contracts: ["BTCSpendAuthorizer"] },
|
|
72108
|
+
{ fragment: "error ECDSAInvalidSignatureS(bytes32 s)", contracts: ["BTCSpendAuthorizer"] },
|
|
72109
|
+
{ fragment: "error ERC1967InvalidImplementation(address implementation)", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
72110
|
+
{ fragment: "error ERC1967NonPayable()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
72111
|
+
{ fragment: "error EnforcedPause()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
72112
|
+
{ fragment: "error EntryFeeTooHigh(uint256 fee, uint256 max)", contracts: ["SimplePSMV2"] },
|
|
72113
|
+
{ fragment: "error ExceedsFeeBalance(uint256 requested, uint256 max)", contracts: ["SimplePSMV2"] },
|
|
72114
|
+
{ fragment: "error ExceedsMaxLoan()", contracts: ["PositionManagerErrors"] },
|
|
72115
|
+
{ fragment: "error ExitFeeTooHigh(uint256 fee, uint256 max)", contracts: ["SimplePSMV2"] },
|
|
72116
|
+
{ fragment: "error ExpectedPause()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
72117
|
+
{ fragment: "error ExtensionFeeMintingFailed()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
72118
|
+
{ fragment: "error ExtensionNotAllowed()", contracts: ["PositionManagerErrors"] },
|
|
72119
|
+
{ fragment: "error FailedCall()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
72120
|
+
{ fragment: "error FailedToGetStablecoinDecimals()", contracts: ["SimplePSMV2"] },
|
|
72121
|
+
{ fragment: "error FailedToGetUCDDecimals()", contracts: ["SimplePSMV2"] },
|
|
72122
|
+
{ fragment: "error FeeOnTransferNotSupported()", contracts: ["SimplePSMV2"] },
|
|
72123
|
+
{ fragment: "error FeeTooHigh(uint256 fee, uint256 max)", contracts: ["PositionManagerErrors"] },
|
|
72124
|
+
{ fragment: "error FeeTooLow(uint256 fee, uint256 min)", contracts: ["PositionManagerErrors"] },
|
|
72125
|
+
{ fragment: "error ImplNotDeployed()", contracts: ["LoanOperationsManagerModule", "BTCSpendAuthorizer"] },
|
|
72126
|
+
{ fragment: "error ImplementationNotDeployed()", contracts: ["UCDController"] },
|
|
72127
|
+
{ fragment: "error InitialBalanceTooLarge()", contracts: ["SimplePSMV2"] },
|
|
72128
|
+
{ fragment: "error InsufficientBalance()", contracts: ["PositionManagerErrors"] },
|
|
72129
|
+
{ fragment: "error InsufficientCollateralForAmount()", contracts: ["PositionManagerErrors"] },
|
|
72130
|
+
{ fragment: "error InsufficientCollateralRatio()", contracts: ["CollateralManagerModule"] },
|
|
72131
|
+
{ fragment: "error InsufficientFeeBal()", contracts: ["LoanOperationsManagerModule"] },
|
|
72132
|
+
{ fragment: "error InsufficientReserves(uint256 available, uint256 required)", contracts: ["SimplePSMV2"] },
|
|
72133
|
+
{ fragment: "error InsufficientSignatures()", contracts: ["OperationAuthorizationRegistry"] },
|
|
72134
|
+
{ fragment: "error IntegrityCheckFailed()", contracts: ["PositionManagerErrors"] },
|
|
72135
|
+
{ fragment: "error InvalidActionHash()", contracts: ["CollateralManagerModule"] },
|
|
72136
|
+
{ fragment: "error InvalidAddress()", contracts: ["PositionManager", "PositionManagerErrors", "OperationAuthorizationRegistry", "CollateralManagerModule", "SimplePSMV2"] },
|
|
72137
|
+
{ fragment: "error InvalidAdmin()", contracts: ["LoanOperationsManagerModule", "BTCSpendAuthorizer", "SimplePSMV2"] },
|
|
72138
|
+
{ fragment: "error InvalidAmount()", contracts: ["PositionManagerErrors", "SimplePSMV2"] },
|
|
72139
|
+
{ fragment: "error InvalidBTCPrice()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
72140
|
+
{ fragment: "error InvalidBytes32()", contracts: ["PositionManager"] },
|
|
72141
|
+
{ fragment: "error InvalidCollateralAmount()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
72142
|
+
{ fragment: "error InvalidController()", contracts: ["SimplePSMV2"] },
|
|
72143
|
+
{ fragment: "error InvalidDecimals(uint8 decimals)", contracts: ["SimplePSMV2"] },
|
|
72144
|
+
{ fragment: "error InvalidExchangeRate()", contracts: ["SimplePSMV2"] },
|
|
72145
|
+
{ fragment: "error InvalidImpl()", contracts: ["LoanOperationsManagerModule", "BTCSpendAuthorizer"] },
|
|
72146
|
+
{ fragment: "error InvalidImplementation()", contracts: ["UCDController"] },
|
|
72147
|
+
{ fragment: "error InvalidInitialization()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
72148
|
+
{ fragment: "error InvalidLitSignature()", contracts: ["BTCSpendAuthorizer"] },
|
|
72149
|
+
{ fragment: "error InvalidLoanOps()", contracts: ["BTCSpendAuthorizer"] },
|
|
72150
|
+
{ fragment: "error InvalidModuleAddress()", contracts: ["UCDController"] },
|
|
72151
|
+
{ fragment: "error InvalidNetwork()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
72152
|
+
{ fragment: "error InvalidNetworkMode()", contracts: ["PositionManagerErrors"] },
|
|
72153
|
+
{ fragment: "error InvalidOracleConfig()", contracts: ["LoanOperationsManagerModule"] },
|
|
72154
|
+
{ fragment: "error InvalidPKPId()", contracts: ["PositionManagerErrors"] },
|
|
72155
|
+
{ fragment: "error InvalidParameter()", contracts: ["UCDController"] },
|
|
72156
|
+
{ fragment: "error InvalidPkpPublicKey()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
72157
|
+
{ fragment: "error InvalidPosMgr()", contracts: ["LoanOperationsManagerModule"] },
|
|
72158
|
+
{ fragment: "error InvalidPositionId()", contracts: ["PositionManager", "PositionManagerErrors", "LoanOperationsValidation", "LoanOperationsManagerModule", "CollateralManagerModule"] },
|
|
72159
|
+
{ fragment: "error InvalidPositionState()", contracts: ["LoanOperationsManagerModule"] },
|
|
72160
|
+
{ fragment: "error InvalidPriceFeed()", contracts: ["LoanOperationsManagerModule"] },
|
|
72161
|
+
{ fragment: "error InvalidRecipient()", contracts: ["LoanOperationsManagerModule", "SimplePSMV2"] },
|
|
72162
|
+
{ fragment: "error InvalidRegistry()", contracts: ["LoanOperationsManagerModule"] },
|
|
72163
|
+
{ fragment: "error InvalidRequestedExpiryDate()", contracts: ["PositionManagerErrors"] },
|
|
72164
|
+
{ fragment: "error InvalidSignature(string reason)", contracts: ["PositionManager"] },
|
|
72165
|
+
{ fragment: "error InvalidSignatureLength()", contracts: ["PositionManagerErrors"] },
|
|
72166
|
+
{ fragment: "error InvalidStablecoinAddress()", contracts: ["SimplePSMV2"] },
|
|
72167
|
+
{ fragment: "error InvalidStaleSpendAttestation()", contracts: ["BTCSpendAuthorizer"] },
|
|
72168
|
+
{ fragment: "error InvalidString(string value)", contracts: ["PositionManager"] },
|
|
72169
|
+
{ fragment: "error InvalidTerm()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
72170
|
+
{ fragment: "error InvalidTerm(uint256 term, uint256 min, uint256 max)", contracts: ["PositionManager"] },
|
|
72171
|
+
{ fragment: "error InvalidTermMgr()", contracts: ["LoanOperationsManagerModule"] },
|
|
72172
|
+
{ fragment: "error InvalidTermStartTime()", contracts: ["PositionManagerErrors"] },
|
|
72173
|
+
{ fragment: "error InvalidToken()", contracts: ["SimplePSMV2"] },
|
|
72174
|
+
{ fragment: "error InvalidUCDCtrl()", contracts: ["LoanOperationsManagerModule"] },
|
|
72175
|
+
{ fragment: "error InvalidUCDDecimals(uint8 decimals)", contracts: ["SimplePSMV2"] },
|
|
72176
|
+
{ fragment: "error InvalidUCDToken()", contracts: ["LoanOperationsManagerModule"] },
|
|
72177
|
+
{ fragment: "error InvalidValidatorAddress()", contracts: ["BTCSpendAuthorizer"] },
|
|
72178
|
+
{ fragment: "error InvalidValidatorSignature()", contracts: ["PositionManagerErrors"] },
|
|
72179
|
+
{ fragment: "error InvalidVaultAddress()", contracts: ["PositionManagerErrors"] },
|
|
72180
|
+
{ fragment: "error InvalidVolumeCap(bool isRedeem)", contracts: ["SimplePSMV2"] },
|
|
72181
|
+
{ fragment: "error InvalidWithdrawalAddress()", contracts: ["CollateralManagerModule"] },
|
|
72182
|
+
{ fragment: "error InvalidWithdrawalLoanStatusType()", contracts: ["CollateralManagerModule"] },
|
|
72183
|
+
{ fragment: "error LiquidationsPaused()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
72184
|
+
{ fragment: "error LoanAmountTooHigh()", contracts: ["PositionManagerErrors"] },
|
|
72185
|
+
{ fragment: "error LoanAmountTooLow()", contracts: ["PositionManagerErrors"] },
|
|
72186
|
+
{ fragment: "error MaxAuthorizedSpendsReached()", contracts: ["BTCSpendAuthorizer"] },
|
|
72187
|
+
{ fragment: "error MaxLoanOutOfBounds()", contracts: ["LoanOperationsManagerModule"] },
|
|
72188
|
+
{ fragment: "error MaxRedeemBelowMin(uint256 maximum, uint256 minimum)", contracts: ["SimplePSMV2"] },
|
|
72189
|
+
{ fragment: "error MaxRedeemCapDisabled()", contracts: ["SimplePSMV2"] },
|
|
72190
|
+
{ fragment: "error MaxSupplyExceeded()", contracts: ["UCDController"] },
|
|
72191
|
+
{ fragment: "error MaxSwapBelowMin(uint256 maximum, uint256 minimum)", contracts: ["SimplePSMV2"] },
|
|
72192
|
+
{ fragment: "error MaxSwapCapDisabled()", contracts: ["SimplePSMV2"] },
|
|
72193
|
+
{ fragment: "error MinLoanOutOfBounds()", contracts: ["LoanOperationsManagerModule"] },
|
|
72194
|
+
{ fragment: "error MintBorrowerMismatch()", contracts: ["LoanOperationsManagerModule"] },
|
|
72195
|
+
{ fragment: "error MintCallFailed()", contracts: ["UCDController"] },
|
|
72196
|
+
{ fragment: "error MintFailed()", contracts: ["LoanOperationsManagerModule"] },
|
|
72197
|
+
{ fragment: "error MintGuardFailed(uint8 code)", contracts: ["UCDController"] },
|
|
72198
|
+
{ fragment: "error MintVerificationFailed()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
72199
|
+
{ fragment: "error MintVerificationMismatch(uint256 expectedSupply, uint256 currentSupply)", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
72200
|
+
{ fragment: "error MissingVERSION()", contracts: ["LoanOperationsManagerModule", "BTCSpendAuthorizer", "UCDController"] },
|
|
72201
|
+
{ fragment: "error MissingVersion()", contracts: ["PositionManagerErrors", "CollateralManagerModule"] },
|
|
72202
|
+
{ fragment: "error ModuleCallFailed()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
72203
|
+
{ fragment: "error NoFeesToTransfer()", contracts: ["SimplePSMV2"] },
|
|
72204
|
+
{ fragment: "error NoRegistry()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
72205
|
+
{ fragment: "error NoVersion()", contracts: ["LoanOperationsManagerModule", "BTCSpendAuthorizer", "UCDController"] },
|
|
72206
|
+
{ fragment: "error NonZeroReserves(address stablecoin, uint256 reserves)", contracts: ["SimplePSMV2"] },
|
|
72207
|
+
{ fragment: "error NormalizationOverflow()", contracts: ["SimplePSMV2"] },
|
|
72208
|
+
{ fragment: "error NotAdminModule()", contracts: ["PositionManager", "PositionManagerErrors", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
72209
|
+
{ fragment: "error NotAuthorized()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
72210
|
+
{ fragment: "error NotAuthorizedConsumer()", contracts: ["OperationAuthorizationRegistry"] },
|
|
72211
|
+
{ fragment: "error NotAuthorizedSigner()", contracts: ["OperationAuthorizationRegistry"] },
|
|
72212
|
+
{ fragment: "error NotBorrower()", contracts: ["PositionManager", "PositionManagerErrors", "LoanOperationsManagerModule"] },
|
|
72213
|
+
{ fragment: "error NotContract()", contracts: ["PositionManagerErrors", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "SimplePSMV2"] },
|
|
72214
|
+
{ fragment: "error NotInitializing()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
72215
|
+
{ fragment: "error NotLiquidationPkpOwner()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
72216
|
+
{ fragment: "error NotLiquidator()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
72217
|
+
{ fragment: "error NotOwner()", contracts: ["OperationAuthorizationRegistry"] },
|
|
72218
|
+
{ fragment: "error NotPendingOwner()", contracts: ["OperationAuthorizationRegistry"] },
|
|
72219
|
+
{ fragment: "error NotProductionAuthorizer()", contracts: ["PositionManagerErrors", "LoanOperationsManagerModule"] },
|
|
72220
|
+
{ fragment: "error NotProductionRegistry()", contracts: ["PositionManager", "PositionManagerErrors", "LoanOperationsManagerModule"] },
|
|
72221
|
+
{ fragment: "error OnlyCore()", contracts: ["CollateralManagerModule"] },
|
|
72222
|
+
{ fragment: "error OnlyLoanOps()", contracts: ["BTCSpendAuthorizer"] },
|
|
72223
|
+
{ fragment: "error OnlyPosMgr()", contracts: ["LoanOperationsManagerModule"] },
|
|
72224
|
+
{ fragment: "error OnlyPositionManager()", contracts: ["LoanOperationsManagerModule"] },
|
|
72225
|
+
{ fragment: "error OperationInProgress()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
72226
|
+
{ fragment: "error OracleDecimalMismatch()", contracts: ["LoanOperationsManagerModule"] },
|
|
72227
|
+
{ fragment: "error PKPAlreadyUsed()", contracts: ["PositionManagerErrors"] },
|
|
72228
|
+
{ fragment: "error PaymentAmountTooLarge()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
72229
|
+
{ fragment: "error PaymentAmountZero()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
72230
|
+
{ fragment: "error PaymentMustBeLessThanDebt()", contracts: ["LoanOperationsManagerModule"] },
|
|
72231
|
+
{ fragment: "error PaymentMustBePositive()", contracts: ["LoanOperationsManagerModule"] },
|
|
72232
|
+
{ fragment: "error PositionAlreadyExists()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
72233
|
+
{ fragment: "error PositionDoesNotExist()", contracts: ["CollateralManagerModule"] },
|
|
72234
|
+
{ fragment: "error PositionLiquidatable()", contracts: ["PositionManagerErrors"] },
|
|
72235
|
+
{ fragment: "error PositionManagerNotContract()", contracts: ["LoanOperationsValidation"] },
|
|
72236
|
+
{ fragment: "error PositionManagerNotSet()", contracts: ["LoanOperationsValidation"] },
|
|
72237
|
+
{ fragment: "error PositionNotActive()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
72238
|
+
{ fragment: "error PositionNotEligible()", contracts: ["LoanOperationsManagerModule"] },
|
|
72239
|
+
{ fragment: "error PositionNotEligibleForOperation()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
72240
|
+
{ fragment: "error PositionNotFound()", contracts: ["PositionManager", "PositionManagerErrors", "LoanOperationsManagerModule"] },
|
|
72241
|
+
{ fragment: "error PositionNotInCore()", contracts: ["LoanOperationsValidation"] },
|
|
72242
|
+
{ fragment: "error PositionStatusInvalid()", contracts: ["PositionManager", "PositionManagerErrors", "LoanOperationsManagerModule"] },
|
|
72243
|
+
{ fragment: "error PositionWouldBecomeLiquidatable()", contracts: ["PositionManagerErrors"] },
|
|
72244
|
+
{ fragment: "error ProposalAlreadyExecuted()", contracts: ["OperationAuthorizationRegistry"] },
|
|
72245
|
+
{ fragment: "error ProposalAlreadyExists()", contracts: ["OperationAuthorizationRegistry"] },
|
|
72246
|
+
{ fragment: "error ProposalCancelled()", contracts: ["OperationAuthorizationRegistry"] },
|
|
72247
|
+
{ fragment: "error ProposalNotFound()", contracts: ["OperationAuthorizationRegistry"] },
|
|
72248
|
+
{ fragment: "error PsmBurnSupplyMismatch(uint256 expected, uint256 actual)", contracts: ["SimplePSMV2"] },
|
|
72249
|
+
{ fragment: "error PsmMintSupplyMismatch(uint256 expected, uint256 actual)", contracts: ["SimplePSMV2"] },
|
|
72250
|
+
{ fragment: "error QuantumAlreadyUsed()", contracts: ["OperationAuthorizationRegistry"] },
|
|
72251
|
+
{ fragment: "error QuantumOutsideWindow()", contracts: ["OperationAuthorizationRegistry"] },
|
|
72252
|
+
{ fragment: "error RateLimitExceeded()", contracts: ["SimplePSMV2"] },
|
|
72253
|
+
{ fragment: "error RatioOverflow()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule"] },
|
|
72254
|
+
{ fragment: "error RecipientNotAllowed()", contracts: ["LoanOperationsManagerModule", "SimplePSMV2"] },
|
|
72255
|
+
{ fragment: "error RedeemVolumeExceededThisBlock(address stablecoin, uint256 attempted, uint256 cap)", contracts: ["SimplePSMV2"] },
|
|
72256
|
+
{ fragment: "error RedemptionsPaused()", contracts: ["SimplePSMV2"] },
|
|
72257
|
+
{ fragment: "error ReentrancyGuardReentrantCall()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
72258
|
+
{ fragment: "error RegistryNotSet()", contracts: ["LoanOperationsManagerModule", "SimplePSMV2"] },
|
|
72259
|
+
{ fragment: "error ReserveOverflow()", contracts: ["SimplePSMV2"] },
|
|
72260
|
+
{ fragment: "error ReserveTooLarge()", contracts: ["SimplePSMV2"] },
|
|
72261
|
+
{ fragment: "error ReserveUnderflow()", contracts: ["SimplePSMV2"] },
|
|
72262
|
+
{ fragment: "error SafeERC20FailedOperation(address token)", contracts: ["PositionManager", "LoanOperationsManagerModule", "SimplePSMV2"] },
|
|
72263
|
+
{ fragment: "error SameBlockInteraction()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
72264
|
+
{ fragment: "error SameImpl()", contracts: ["LoanOperationsManagerModule", "BTCSpendAuthorizer"] },
|
|
72265
|
+
{ fragment: "error SameImplementation()", contracts: ["PositionManagerErrors", "CollateralManagerModule"] },
|
|
72266
|
+
{ fragment: "error SignatureVerificationFailed(bytes4 selector, address recovered, address expected, bytes32 messageHash, uint8 errorCode)", contracts: ["OperationAuthorizationRegistry"] },
|
|
72267
|
+
{ fragment: "error SlippageExceeded(uint256 got, uint256 minimum)", contracts: ["SimplePSMV2"] },
|
|
72268
|
+
{ fragment: "error SlippageProtectionRequired()", contracts: ["SimplePSMV2"] },
|
|
72269
|
+
{ fragment: "error StablecoinAlreadySupported(address stablecoin)", contracts: ["SimplePSMV2"] },
|
|
72270
|
+
{ fragment: "error StablecoinNotContract(address stablecoin)", contracts: ["SimplePSMV2"] },
|
|
72271
|
+
{ fragment: "error StablecoinNotSupported(address stablecoin)", contracts: ["SimplePSMV2"] },
|
|
72272
|
+
{ fragment: "error StablecoinNotSupportedInV1(address stablecoin)", contracts: ["SimplePSMV2"] },
|
|
72273
|
+
{ fragment: "error StaleAttestationMismatch()", contracts: ["BTCSpendAuthorizer"] },
|
|
72274
|
+
{ fragment: "error StaleAttestationTooOld()", contracts: ["BTCSpendAuthorizer"] },
|
|
72275
|
+
{ fragment: "error StaleSpendValidatorNotSet()", contracts: ["BTCSpendAuthorizer"] },
|
|
72276
|
+
{ fragment: "error StateHashMismatch()", contracts: ["LoanOperationsValidation", "LoanOperationsManagerModule", "CollateralManagerModule"] },
|
|
72277
|
+
{ fragment: "error SwapVolumeExceededThisBlock(address stablecoin, uint256 attempted, uint256 cap)", contracts: ["SimplePSMV2"] },
|
|
72278
|
+
{ fragment: "error SyncDriftTooLarge()", contracts: ["SimplePSMV2"] },
|
|
72279
|
+
{ fragment: "error TargetAddrRequired()", contracts: ["BTCSpendAuthorizer"] },
|
|
72280
|
+
{ fragment: "error TargetExceedsInputValue()", contracts: ["BTCSpendAuthorizer"] },
|
|
72281
|
+
{ fragment: "error TargetMustBePositive()", contracts: ["BTCSpendAuthorizer"] },
|
|
72282
|
+
{ fragment: "error TermAlreadyExists()", contracts: ["PositionManagerErrors"] },
|
|
72283
|
+
{ fragment: "error TermExceedsMaximum()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
72284
|
+
{ fragment: "error TermNotFound()", contracts: ["PositionManagerErrors"] },
|
|
72285
|
+
{ fragment: "error ThresholdTooHigh()", contracts: ["LoanOperationsManagerModule"] },
|
|
72286
|
+
{ fragment: "error TimelockNotMet()", contracts: ["OperationAuthorizationRegistry"] },
|
|
72287
|
+
{ fragment: "error TimelockRequiredOnThisChain()", contracts: ["OperationAuthorizationRegistry"] },
|
|
72288
|
+
{ fragment: "error TimestampOverflow()", contracts: ["LoanOperationsManagerModule"] },
|
|
72289
|
+
{ fragment: "error TooManySigners()", contracts: ["OperationAuthorizationRegistry"] },
|
|
72290
|
+
{ fragment: "error UTXOAlreadyAuthorized()", contracts: ["BTCSpendAuthorizer"] },
|
|
72291
|
+
{ fragment: "error UTXONotAuthorized()", contracts: ["BTCSpendAuthorizer"] },
|
|
72292
|
+
{ fragment: "error UUPSUnauthorizedCallContext()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
72293
|
+
{ fragment: "error UUPSUnsupportedProxiableUUID(bytes32 slot)", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
72294
|
+
{ fragment: "error UcdAmountTooLarge()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule"] },
|
|
72295
|
+
{ fragment: "error Unauthorized()", contracts: ["UCDController"] },
|
|
72296
|
+
{ fragment: "error UnexpectedRoleGrantFailure()", contracts: ["PositionManager", "PositionManagerErrors", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
72297
|
+
{ fragment: "error UnsupportedFeeToken(address token)", contracts: ["SimplePSMV2"] },
|
|
72298
|
+
{ fragment: "error UserDailyMintLimitExceeded()", contracts: ["LoanOperationsManagerModule"] },
|
|
72299
|
+
{ fragment: "error V2AlreadyInitialized()", contracts: ["SimplePSMV2"] },
|
|
72300
|
+
{ fragment: "error ValidationFailed()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
72301
|
+
{ fragment: "error ValidatorNotActive()", contracts: ["OperationAuthorizationRegistry"] },
|
|
72302
|
+
{ fragment: "error WithdrawalAddressNotApproved()", contracts: ["CollateralManagerModule"] },
|
|
72303
|
+
{ fragment: "error WithdrawalExceedsReserves(uint256 amount, uint256 reserves)", contracts: ["SimplePSMV2"] },
|
|
72304
|
+
{ fragment: "error ZeroAddress()", contracts: ["PositionManager", "UCDController"] },
|
|
72305
|
+
{ fragment: "error ZeroAmount()", contracts: ["UCDController"] }
|
|
72306
|
+
];
|
|
72307
|
+
var TABLE = null;
|
|
72308
|
+
function contractErrorTable() {
|
|
72309
|
+
if (TABLE)
|
|
72310
|
+
return TABLE;
|
|
72311
|
+
const table = /* @__PURE__ */ new Map();
|
|
72312
|
+
const iface = new import_ethers35.Interface(CONTRACT_ERROR_FRAGMENTS.map((e) => e.fragment));
|
|
72313
|
+
const contractsByName = new Map(
|
|
72314
|
+
CONTRACT_ERROR_FRAGMENTS.map((e) => [e.fragment.slice("error ".length, e.fragment.indexOf("(")), e.contracts])
|
|
72315
|
+
);
|
|
72316
|
+
iface.forEachError((fragment) => {
|
|
72317
|
+
const existing = table.get(fragment.selector);
|
|
72318
|
+
const contracts = contractsByName.get(fragment.name) ?? [];
|
|
72319
|
+
if (existing) {
|
|
72320
|
+
for (const c of contracts)
|
|
72321
|
+
if (!existing.contracts.includes(c))
|
|
72322
|
+
existing.contracts.push(c);
|
|
72323
|
+
return;
|
|
72324
|
+
}
|
|
72325
|
+
table.set(fragment.selector, {
|
|
72326
|
+
signature: fragment.format("sighash"),
|
|
72327
|
+
fragment,
|
|
72328
|
+
contracts: [...contracts]
|
|
72329
|
+
});
|
|
72330
|
+
});
|
|
72331
|
+
TABLE = table;
|
|
72332
|
+
return table;
|
|
72333
|
+
}
|
|
72334
|
+
function lookupContractError(selector) {
|
|
72335
|
+
return contractErrorTable().get(selector.toLowerCase()) ?? null;
|
|
72336
|
+
}
|
|
72337
|
+
function extractErrorData(error) {
|
|
72338
|
+
const viaQuantum = decodeQuantumRevert(error).data;
|
|
72339
|
+
if (viaQuantum && viaQuantum.length >= 10)
|
|
72340
|
+
return viaQuantum;
|
|
72341
|
+
const candidates = [
|
|
72342
|
+
error?.error?.error?.error?.data,
|
|
72343
|
+
error?.error?.error?.data,
|
|
72344
|
+
error?.data?.data,
|
|
72345
|
+
error?.transaction?.data
|
|
72346
|
+
];
|
|
72347
|
+
for (const data of candidates) {
|
|
72348
|
+
if (typeof data === "string" && data.startsWith("0x") && data.length >= 10)
|
|
72349
|
+
return data;
|
|
72350
|
+
}
|
|
72351
|
+
const body = typeof error?.body === "string" ? error.body : null;
|
|
72352
|
+
if (body) {
|
|
72353
|
+
try {
|
|
72354
|
+
const parsed = JSON.parse(body);
|
|
72355
|
+
const data = parsed?.error?.data;
|
|
72356
|
+
if (typeof data === "string" && data.startsWith("0x") && data.length >= 10)
|
|
72357
|
+
return data;
|
|
72358
|
+
} catch {
|
|
72359
|
+
}
|
|
72360
|
+
}
|
|
72361
|
+
return null;
|
|
72362
|
+
}
|
|
72363
|
+
function extractRevertString(error) {
|
|
72364
|
+
if (typeof error?.reason === "string" && error.reason.length > 0)
|
|
72365
|
+
return error.reason;
|
|
72366
|
+
const message = typeof error?.message === "string" ? error.message : null;
|
|
72367
|
+
if (!message)
|
|
72368
|
+
return null;
|
|
72369
|
+
const withReasonString = message.match(/reverted with reason string ['"](.+?)['"]/);
|
|
72370
|
+
if (withReasonString)
|
|
72371
|
+
return withReasonString[1];
|
|
72372
|
+
const withReason = message.match(/reason: ['"](.+?)['"]/);
|
|
72373
|
+
return withReason ? withReason[1] : null;
|
|
72374
|
+
}
|
|
72375
|
+
function renderArgs(args) {
|
|
72376
|
+
return args.map((arg) => typeof arg === "object" && arg !== null ? JSON.stringify(arg) : String(arg)).join(", ");
|
|
72377
|
+
}
|
|
72378
|
+
function decodeContractError(error) {
|
|
72379
|
+
const errorData = extractErrorData(error);
|
|
72380
|
+
if (!errorData) {
|
|
72381
|
+
const revertString2 = extractRevertString(error);
|
|
72382
|
+
if (revertString2 && !revertString2.includes("cannot estimate gas")) {
|
|
72383
|
+
return {
|
|
72384
|
+
name: "RevertString",
|
|
72385
|
+
selector: "0x00000000",
|
|
72386
|
+
args: [revertString2],
|
|
72387
|
+
contract: "Unknown",
|
|
72388
|
+
message: `Revert: ${revertString2}`
|
|
72389
|
+
};
|
|
72390
|
+
}
|
|
72391
|
+
return null;
|
|
72392
|
+
}
|
|
72393
|
+
const selector = errorData.slice(0, 10).toLowerCase();
|
|
72394
|
+
if (selector === ERROR_STRING_SELECTOR || selector === PANIC_SELECTOR) {
|
|
72395
|
+
const { name } = decodeQuantumRevert(error);
|
|
72396
|
+
if (name) {
|
|
72397
|
+
return { name, selector, args: [], contract: "Solidity", message: name };
|
|
72398
|
+
}
|
|
72399
|
+
}
|
|
72400
|
+
const entry = lookupContractError(selector);
|
|
72401
|
+
if (entry) {
|
|
72402
|
+
const contract = entry.contracts.join(" | ");
|
|
72403
|
+
let args = [];
|
|
72404
|
+
try {
|
|
72405
|
+
const decoded = new import_ethers35.Interface([entry.fragment]).decodeErrorResult(entry.fragment, errorData);
|
|
72406
|
+
args = Array.from(decoded);
|
|
72407
|
+
} catch {
|
|
72408
|
+
args = [];
|
|
72409
|
+
}
|
|
72410
|
+
return {
|
|
72411
|
+
name: entry.fragment.name,
|
|
72412
|
+
selector,
|
|
72413
|
+
args,
|
|
72414
|
+
contract,
|
|
72415
|
+
message: `${contract}.${entry.fragment.name}(${renderArgs(args)})`
|
|
72416
|
+
};
|
|
72417
|
+
}
|
|
72418
|
+
const revertString = extractRevertString(error);
|
|
72419
|
+
if (revertString && !revertString.includes("cannot estimate gas")) {
|
|
72420
|
+
return {
|
|
72421
|
+
name: "RevertString",
|
|
72422
|
+
selector,
|
|
72423
|
+
args: [revertString],
|
|
72424
|
+
contract: "Unknown",
|
|
72425
|
+
message: `Revert: ${revertString}`
|
|
72426
|
+
};
|
|
72427
|
+
}
|
|
72428
|
+
return {
|
|
72429
|
+
name: "UnknownError",
|
|
72430
|
+
selector,
|
|
72431
|
+
args: [],
|
|
72432
|
+
contract: "Unknown",
|
|
72433
|
+
message: `Unknown error (selector: ${selector})`
|
|
72434
|
+
};
|
|
72435
|
+
}
|
|
72436
|
+
function formatDecodedError(decoded) {
|
|
72437
|
+
if (decoded.args && decoded.args.length > 0) {
|
|
72438
|
+
return `${decoded.contract}.${decoded.name}(${renderArgs(decoded.args)})`;
|
|
72439
|
+
}
|
|
72440
|
+
return `${decoded.contract}.${decoded.name}()`;
|
|
72441
|
+
}
|
|
72066
72442
|
function normalizeBigNumberish(value) {
|
|
72067
72443
|
if (value === null || value === void 0) {
|
|
72068
72444
|
return "0";
|
|
@@ -74251,7 +74627,6 @@ Mint/debt diagnostics (LoanOperationsManager mint path \u2192 increaseDebtFromMi
|
|
|
74251
74627
|
let quantumContext = "";
|
|
74252
74628
|
if (selector === "0x131d9a21" || // QuantumExpired()
|
|
74253
74629
|
selector === "0x52ce5d58" || // QuantumAlreadyUsed()
|
|
74254
|
-
selector === "0x137f3b70" || // InDeadZone()
|
|
74255
74630
|
selector === "0xbe4b82c1" || // DeadZoneViolation()
|
|
74256
74631
|
selector === "0x3e76a3c9") {
|
|
74257
74632
|
const nowSecs = Math.floor(Date.now() / 1e3);
|
|
@@ -74374,33 +74749,14 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
|
|
|
74374
74749
|
return result;
|
|
74375
74750
|
} catch (error) {
|
|
74376
74751
|
let customErrorDetails = "";
|
|
74377
|
-
const
|
|
74378
|
-
if (
|
|
74379
|
-
|
|
74380
|
-
const knownErrors = {
|
|
74381
|
-
"0x8baa579f": "InvalidSignature()",
|
|
74382
|
-
"0xd92e233d": "ValidationFailed()",
|
|
74383
|
-
"0x3ee5aeb5": "OperationNotAuthorized()",
|
|
74384
|
-
"0x70f4b32a": "UnauthorizedSigner()",
|
|
74385
|
-
"0x48f5c3ed": "Unauthorized()",
|
|
74386
|
-
"0x36bfdeea": "StateHashMismatch()",
|
|
74387
|
-
"0xb9d419a7": "DebtUpdateVerificationFailed()",
|
|
74388
|
-
"0xc7e20553": "DebtUpdateVerificationFailedDetailed(bytes32,uint256,uint256,uint256,uint256,uint256)",
|
|
74389
|
-
"0x0cfd2a97": "MintVerificationMismatch(uint256,uint256)",
|
|
74390
|
-
"0x07637bd8": "MintFailed()",
|
|
74391
|
-
"0x131d9a21": "QuantumExpired() - Signature quantum window has closed",
|
|
74392
|
-
"0x52ce5d58": "QuantumAlreadyUsed() - This quantum was already used for this position",
|
|
74393
|
-
"0x137f3b70": "InDeadZone() - Timestamp in dead zone (near quantum boundary)",
|
|
74394
|
-
"0xbe4b82c1": "DeadZoneViolation() - Non-current-quantum signature mined in the last 8s of the current quantum",
|
|
74395
|
-
"0x3e76a3c9": "QuantumOutsideWindow() - Timestamp not in past/current/next quantum window"
|
|
74396
|
-
};
|
|
74397
|
-
const errorName = knownErrors[selector] || `Unknown error ${selector}`;
|
|
74398
|
-
customErrorDetails = ` [${errorName}]`;
|
|
74752
|
+
const decoded = decodeContractError(error);
|
|
74753
|
+
if (decoded) {
|
|
74754
|
+
customErrorDetails = ` [${formatDecodedError(decoded)}]`;
|
|
74399
74755
|
if (this.config.debug) {
|
|
74400
74756
|
log.error("Custom error decoded from transaction receipt", {
|
|
74401
|
-
selector,
|
|
74402
|
-
errorName,
|
|
74403
|
-
|
|
74757
|
+
selector: decoded.selector,
|
|
74758
|
+
errorName: decoded.name,
|
|
74759
|
+
contract: decoded.contract
|
|
74404
74760
|
});
|
|
74405
74761
|
}
|
|
74406
74762
|
}
|
|
@@ -80486,15 +80842,15 @@ var SUPPORTED_STABLECOINS = `
|
|
|
80486
80842
|
}`;
|
|
80487
80843
|
|
|
80488
80844
|
// src/boundary/upstream/real/psm-calls.ts
|
|
80489
|
-
var
|
|
80845
|
+
var import_ethers43 = require("ethers");
|
|
80490
80846
|
|
|
80491
80847
|
// node_modules/@gvnrdao/dh-sdk/dist/sign-guard.mjs
|
|
80492
|
-
var import_ethers36 = require("ethers");
|
|
80493
80848
|
var import_ethers37 = require("ethers");
|
|
80494
80849
|
var import_ethers38 = require("ethers");
|
|
80495
80850
|
var import_ethers39 = require("ethers");
|
|
80496
80851
|
var import_ethers40 = require("ethers");
|
|
80497
80852
|
var import_ethers41 = require("ethers");
|
|
80853
|
+
var import_ethers42 = require("ethers");
|
|
80498
80854
|
var TxValidationError3 = class extends Error {
|
|
80499
80855
|
/**
|
|
80500
80856
|
* @param subject What is being refused. Defaults to the server-returned transaction the
|
|
@@ -80541,7 +80897,7 @@ var SIGNABLE_FUNCTIONS3 = [
|
|
|
80541
80897
|
// this too is client-only and never module-whitelisted.
|
|
80542
80898
|
"function addAddress(string btcAddress) external"
|
|
80543
80899
|
];
|
|
80544
|
-
var IFACE3 = new
|
|
80900
|
+
var IFACE3 = new import_ethers37.ethers.Interface(SIGNABLE_FUNCTIONS3);
|
|
80545
80901
|
function encodeSignable3(fn, args) {
|
|
80546
80902
|
return IFACE3.encodeFunctionData(fn, args);
|
|
80547
80903
|
}
|
|
@@ -80571,10 +80927,10 @@ var DEFAULT_FEE_CEILING2 = {
|
|
|
80571
80927
|
maxTxFeeWei: DEFAULT_MAX_TX_FEE_WEI2
|
|
80572
80928
|
};
|
|
80573
80929
|
function fmtEth2(wei) {
|
|
80574
|
-
return `${
|
|
80930
|
+
return `${import_ethers38.ethers.formatEther(wei)} ETH`;
|
|
80575
80931
|
}
|
|
80576
80932
|
function fmtGwei2(wei) {
|
|
80577
|
-
return `${
|
|
80933
|
+
return `${import_ethers38.ethers.formatUnits(wei, "gwei")} gwei`;
|
|
80578
80934
|
}
|
|
80579
80935
|
function worstCaseFeeWei2(gasLimit, maxFeePerGas) {
|
|
80580
80936
|
if (gasLimit == null || maxFeePerGas == null)
|
|
@@ -80601,7 +80957,7 @@ function eqAddr3(a, b) {
|
|
|
80601
80957
|
if (!a || !b)
|
|
80602
80958
|
return false;
|
|
80603
80959
|
try {
|
|
80604
|
-
return
|
|
80960
|
+
return import_ethers39.ethers.getAddress(a) === import_ethers39.ethers.getAddress(b);
|
|
80605
80961
|
} catch {
|
|
80606
80962
|
return false;
|
|
80607
80963
|
}
|
|
@@ -80667,7 +81023,7 @@ function readValue3(tx2) {
|
|
|
80667
81023
|
}
|
|
80668
81024
|
function normalizePositionId3(id) {
|
|
80669
81025
|
const hex = id.startsWith("0x") ? id : `0x${id}`;
|
|
80670
|
-
return
|
|
81026
|
+
return import_ethers39.ethers.zeroPadValue(hex, 32).toLowerCase();
|
|
80671
81027
|
}
|
|
80672
81028
|
function requirePositionId2(actual, expected) {
|
|
80673
81029
|
const txPositionId = String(actual).toLowerCase();
|
|
@@ -80962,18 +81318,18 @@ function buildPsmRedeemTx3(p) {
|
|
|
80962
81318
|
var PSM_READS_ABI2 = ["function supportedStablecoins(address) view returns (bool)"];
|
|
80963
81319
|
var ERC20_READS_ABI2 = ["function allowance(address owner, address spender) view returns (uint256)"];
|
|
80964
81320
|
function psmExchangeReadsFromProvider2(provider, psmAddress) {
|
|
80965
|
-
const psm = new
|
|
81321
|
+
const psm = new import_ethers42.ethers.Contract(psmAddress, PSM_READS_ABI2, provider);
|
|
80966
81322
|
return {
|
|
80967
81323
|
isStablecoinSupported: async (stablecoin) => await psm.getFunction("supportedStablecoins")(stablecoin),
|
|
80968
|
-
allowance: async (token, owner, spender) => await new
|
|
81324
|
+
allowance: async (token, owner, spender) => await new import_ethers42.ethers.Contract(token, ERC20_READS_ABI2, provider).getFunction("allowance")(owner, spender)
|
|
80969
81325
|
};
|
|
80970
81326
|
}
|
|
80971
81327
|
var refuse2 = (direction, msg) => new TxValidationError3(msg, `PSM ${direction}`);
|
|
80972
81328
|
function requireAddress2(direction, label, value) {
|
|
80973
|
-
if (!value || !
|
|
81329
|
+
if (!value || !import_ethers42.ethers.isAddress(value)) {
|
|
80974
81330
|
throw refuse2(direction, `${label} address is missing or invalid (${String(value)})`);
|
|
80975
81331
|
}
|
|
80976
|
-
return
|
|
81332
|
+
return import_ethers42.ethers.getAddress(value);
|
|
80977
81333
|
}
|
|
80978
81334
|
async function planPsmExchange2(params) {
|
|
80979
81335
|
const { direction, amountIn, minOut, vctx, reads } = params;
|
|
@@ -81100,8 +81456,8 @@ var PsmCalls = class {
|
|
|
81100
81456
|
constructor(deps) {
|
|
81101
81457
|
this.deps = deps;
|
|
81102
81458
|
const abi = [...PSM_VIEW_FRAGMENTS, ...PSM_ERROR_FRAGMENTS];
|
|
81103
|
-
this.iface = new
|
|
81104
|
-
this.psm = new
|
|
81459
|
+
this.iface = new import_ethers43.ethers.Interface(abi);
|
|
81460
|
+
this.psm = new import_ethers43.ethers.Contract(deps.psmAddress, abi, deps.provider);
|
|
81105
81461
|
}
|
|
81106
81462
|
psm;
|
|
81107
81463
|
iface;
|
|
@@ -81130,8 +81486,8 @@ var PsmCalls = class {
|
|
|
81130
81486
|
});
|
|
81131
81487
|
}
|
|
81132
81488
|
return this.call(async () => {
|
|
81133
|
-
const ucd = new
|
|
81134
|
-
const stable = new
|
|
81489
|
+
const ucd = new import_ethers43.ethers.Contract(ucdToken, ERC20_FRAGMENTS, this.deps.provider);
|
|
81490
|
+
const stable = new import_ethers43.ethers.Contract(this.deps.stablecoinAddress, ERC20_FRAGMENTS, this.deps.provider);
|
|
81135
81491
|
const [ucdWei, stablecoinUnits] = await Promise.all([ucd["balanceOf"](holder), stable["balanceOf"](holder)]);
|
|
81136
81492
|
return { ucdWei: ucdWei.toString(), stablecoinUnits: stablecoinUnits.toString() };
|
|
81137
81493
|
});
|
|
@@ -81249,7 +81605,7 @@ var PsmCalls = class {
|
|
|
81249
81605
|
};
|
|
81250
81606
|
|
|
81251
81607
|
// src/boundary/upstream/real/session.ts
|
|
81252
|
-
var
|
|
81608
|
+
var import_ethers44 = require("ethers");
|
|
81253
81609
|
var REFRESH_LEEWAY_SEC = 30;
|
|
81254
81610
|
var LOGIN_TYPES_WITH_AUDIENCE3 = {
|
|
81255
81611
|
DiamondHands: [
|
|
@@ -81297,7 +81653,7 @@ var LitOpsSession = class {
|
|
|
81297
81653
|
const message = {
|
|
81298
81654
|
address: this.wallet.address,
|
|
81299
81655
|
issuedAt: Math.floor(Date.now() / 1e3),
|
|
81300
|
-
nonce: "0x" + Buffer.from(
|
|
81656
|
+
nonce: "0x" + Buffer.from(import_ethers44.ethers.randomBytes(32)).toString("hex"),
|
|
81301
81657
|
audience: this.serviceEndpoint
|
|
81302
81658
|
};
|
|
81303
81659
|
const signature = await this.wallet.signTypedData(
|
|
@@ -81339,7 +81695,7 @@ function decodeJwtExp(token) {
|
|
|
81339
81695
|
}
|
|
81340
81696
|
|
|
81341
81697
|
// src/boundary/upstream/real/write-ops.ts
|
|
81342
|
-
var
|
|
81698
|
+
var import_ethers46 = require("ethers");
|
|
81343
81699
|
|
|
81344
81700
|
// src/signer/types.ts
|
|
81345
81701
|
var OperationDeclined = class extends Error {
|
|
@@ -81349,7 +81705,7 @@ var OperationDeclined = class extends Error {
|
|
|
81349
81705
|
init_tx_validator();
|
|
81350
81706
|
|
|
81351
81707
|
// src/boundary/upstream/shared/external-bridge/page-crypto.ts
|
|
81352
|
-
var
|
|
81708
|
+
var import_ethers45 = require("ethers");
|
|
81353
81709
|
var PERSONAL_SIGN_LAYOUTS = {
|
|
81354
81710
|
"dh-op-envelope-v1": {
|
|
81355
81711
|
types: ["bytes32", "uint256", "uint256", "uint256", "bytes32"],
|
|
@@ -81370,9 +81726,9 @@ function hashForLayout(layout, fields) {
|
|
|
81370
81726
|
const values = def.fieldOrder.map((name) => {
|
|
81371
81727
|
const raw = fields[name];
|
|
81372
81728
|
if (raw === void 0) throw new Error(`page-crypto: layout "${layout}" missing field "${name}"`);
|
|
81373
|
-
return hashUtf8.has(name) ?
|
|
81729
|
+
return hashUtf8.has(name) ? import_ethers45.ethers.keccak256(import_ethers45.ethers.toUtf8Bytes(raw)) : raw;
|
|
81374
81730
|
});
|
|
81375
|
-
return
|
|
81731
|
+
return import_ethers45.ethers.solidityPackedKeccak256(def.types, values);
|
|
81376
81732
|
}
|
|
81377
81733
|
var PAGE_CRYPTO_JS = `"use strict";
|
|
81378
81734
|
(function () {
|
|
@@ -81615,7 +81971,7 @@ function mcpExpected(leg) {
|
|
|
81615
81971
|
}
|
|
81616
81972
|
var OP_LAYOUT = "dh-op-envelope-v1";
|
|
81617
81973
|
function randomNonceHex() {
|
|
81618
|
-
return "0x" + Buffer.from(
|
|
81974
|
+
return "0x" + Buffer.from(import_ethers46.ethers.randomBytes(16)).toString("hex");
|
|
81619
81975
|
}
|
|
81620
81976
|
async function postJson(url2, body, headers) {
|
|
81621
81977
|
const res = await fetch(url2, {
|
|
@@ -81676,7 +82032,7 @@ function buildWriteOps(deps) {
|
|
|
81676
82032
|
return {
|
|
81677
82033
|
to: String(tx2["to"] ?? ""),
|
|
81678
82034
|
data: String(tx2["data"] ?? "0x"),
|
|
81679
|
-
value: tx2["value"] != null ?
|
|
82035
|
+
value: tx2["value"] != null ? import_ethers46.ethers.toBeHex(BigInt(String(tx2["value"]))) : "0x0",
|
|
81680
82036
|
chainId: tx2["chainId"] != null ? Number(tx2["chainId"]) : chainId
|
|
81681
82037
|
};
|
|
81682
82038
|
}
|
|
@@ -81842,7 +82198,7 @@ function buildWriteOps(deps) {
|
|
|
81842
82198
|
mintedUcdWei: minted,
|
|
81843
82199
|
feeUcdWei: mintFee,
|
|
81844
82200
|
echoedAmountUcdWei: minted,
|
|
81845
|
-
authorization: auth(action, `mint ${
|
|
82201
|
+
authorization: auth(action, `mint ${import_ethers46.ethers.formatEther(amountWei)} UCD against ${p.positionId}`, r.value.digest)
|
|
81846
82202
|
},
|
|
81847
82203
|
{ id: SOURCE5, kind: "lit-ops", fetchedAt: (/* @__PURE__ */ new Date()).toISOString() }
|
|
81848
82204
|
);
|
|
@@ -81883,7 +82239,7 @@ function buildWriteOps(deps) {
|
|
|
81883
82239
|
txRef: { kind: "eth-tx", id: r.value.txHash },
|
|
81884
82240
|
paidUcdWei: paid,
|
|
81885
82241
|
echoedAmountUcdWei: paid,
|
|
81886
|
-
authorization: auth(action, `repay ${
|
|
82242
|
+
authorization: auth(action, `repay ${import_ethers46.ethers.formatEther(amountWei)} UCD on ${p.positionId}`, r.value.digest)
|
|
81887
82243
|
},
|
|
81888
82244
|
{ id: SOURCE5, kind: "lit-ops", fetchedAt: (/* @__PURE__ */ new Date()).toISOString() }
|
|
81889
82245
|
);
|
|
@@ -82146,7 +82502,7 @@ function buildWriteOps(deps) {
|
|
|
82146
82502
|
}
|
|
82147
82503
|
|
|
82148
82504
|
// src/signer/eoa-dh.ts
|
|
82149
|
-
var
|
|
82505
|
+
var import_ethers47 = require("ethers");
|
|
82150
82506
|
var EoaDHSigner = class {
|
|
82151
82507
|
constructor(wallet, broadcast, clock = Date.now) {
|
|
82152
82508
|
this.wallet = wallet;
|
|
@@ -82163,7 +82519,7 @@ var EoaDHSigner = class {
|
|
|
82163
82519
|
async signAuthorization(spec) {
|
|
82164
82520
|
const quantumTs = nextQuantumTimestamp(this.clock());
|
|
82165
82521
|
const { fields, hashHex } = spec.stamp(quantumTs);
|
|
82166
|
-
const signature = await this.wallet.signMessage(
|
|
82522
|
+
const signature = await this.wallet.signMessage(import_ethers47.ethers.getBytes(hashHex));
|
|
82167
82523
|
return { signature, quantumTs, fields };
|
|
82168
82524
|
}
|
|
82169
82525
|
async wrapInnerTx(innerTx) {
|
|
@@ -82181,10 +82537,10 @@ var EoaDHSigner = class {
|
|
|
82181
82537
|
|
|
82182
82538
|
// src/signer/external-eoa.ts
|
|
82183
82539
|
var import_node_crypto7 = require("crypto");
|
|
82184
|
-
var
|
|
82540
|
+
var import_ethers49 = require("ethers");
|
|
82185
82541
|
|
|
82186
82542
|
// src/boundary/upstream/shared/external-bridge/verify-landed-tx.ts
|
|
82187
|
-
var
|
|
82543
|
+
var import_ethers48 = require("ethers");
|
|
82188
82544
|
function eq2(a, b) {
|
|
82189
82545
|
return a.toLowerCase() === b.toLowerCase();
|
|
82190
82546
|
}
|
|
@@ -82207,7 +82563,7 @@ function compareLandedTx(landed, approved, borrower) {
|
|
|
82207
82563
|
return { status: "verified", from: landed.from, hash: landed.hash };
|
|
82208
82564
|
}
|
|
82209
82565
|
function verifyRawSignedTx(rawSignedTx, approved, borrower) {
|
|
82210
|
-
const parsed =
|
|
82566
|
+
const parsed = import_ethers48.ethers.Transaction.from(rawSignedTx);
|
|
82211
82567
|
if (!parsed.from || !parsed.to || !parsed.hash) {
|
|
82212
82568
|
return { status: "mismatch", hash: parsed.hash ?? "0x", reason: "the returned raw transaction is unsigned or malformed" };
|
|
82213
82569
|
}
|
|
@@ -82245,7 +82601,7 @@ async function gasHintAcrossBlocks(provider, from, tx2, action) {
|
|
|
82245
82601
|
for (let attempt = 0; attempt < 4; attempt++) {
|
|
82246
82602
|
try {
|
|
82247
82603
|
const est = await provider.estimateGas({ from, to: tx2.to, data: tx2.data, value: BigInt(tx2.value) });
|
|
82248
|
-
return
|
|
82604
|
+
return import_ethers49.ethers.toBeHex(est * 15n / 10n);
|
|
82249
82605
|
} catch (e) {
|
|
82250
82606
|
lastErr = e;
|
|
82251
82607
|
await new Promise((r) => setTimeout(r, 13e3));
|
|
@@ -82295,7 +82651,7 @@ var ExternalEoaDHSigner = class {
|
|
|
82295
82651
|
throw new OperationDeclined(`the ${spec.action} authorization was not signed: ${describeOutcome(outcome)}`);
|
|
82296
82652
|
}
|
|
82297
82653
|
const finalHash = spec.stamp(used.quantumTs).hashHex;
|
|
82298
|
-
const recovered =
|
|
82654
|
+
const recovered = import_ethers49.ethers.verifyMessage(import_ethers49.ethers.getBytes(finalHash), outcome.signature);
|
|
82299
82655
|
if (recovered.toLowerCase() !== this.deps.borrower.toLowerCase()) {
|
|
82300
82656
|
throw new Error(`the ${spec.action} authorization was signed by ${recovered}, not the borrower ${this.deps.borrower}`);
|
|
82301
82657
|
}
|
|
@@ -82306,7 +82662,7 @@ var ExternalEoaDHSigner = class {
|
|
|
82306
82662
|
}
|
|
82307
82663
|
async submitValidatedTx(outerTx, ctx) {
|
|
82308
82664
|
const approved = toApprovedTx(outerTx, this.deps.chainId);
|
|
82309
|
-
const gas = outerTx.gasLimit != null ?
|
|
82665
|
+
const gas = outerTx.gasLimit != null ? import_ethers49.ethers.toBeHex(BigInt(String(outerTx.gasLimit))) : await gasHintAcrossBlocks(this.deps.provider, this.deps.borrower, approved, ctx.action);
|
|
82310
82666
|
const outcome = await this.deps.bridge.requestSignature({
|
|
82311
82667
|
id: (0, import_node_crypto7.randomUUID)(),
|
|
82312
82668
|
kind: "transaction",
|
|
@@ -82340,7 +82696,7 @@ var ExternalEoaDHSigner = class {
|
|
|
82340
82696
|
return new BridgeEthersSigner(this.deps);
|
|
82341
82697
|
}
|
|
82342
82698
|
};
|
|
82343
|
-
var BridgeEthersSigner = class _BridgeEthersSigner extends
|
|
82699
|
+
var BridgeEthersSigner = class _BridgeEthersSigner extends import_ethers49.ethers.AbstractSigner {
|
|
82344
82700
|
constructor(deps) {
|
|
82345
82701
|
super(deps.provider);
|
|
82346
82702
|
this.deps = deps;
|
|
@@ -82351,13 +82707,13 @@ var BridgeEthersSigner = class _BridgeEthersSigner extends import_ethers48.ether
|
|
|
82351
82707
|
return this.deps.borrower;
|
|
82352
82708
|
}
|
|
82353
82709
|
async signMessage(message) {
|
|
82354
|
-
const bytes = typeof message === "string" ?
|
|
82710
|
+
const bytes = typeof message === "string" ? import_ethers49.ethers.toUtf8Bytes(message) : message;
|
|
82355
82711
|
if (bytes.length !== 32) {
|
|
82356
82712
|
throw new Error(
|
|
82357
82713
|
`external-wallet signMessage accepts only the SDK's bare 32-byte auth hashes (got ${bytes.length} bytes) \u2014 no other raw-message signing rides this path.`
|
|
82358
82714
|
);
|
|
82359
82715
|
}
|
|
82360
|
-
const hashHex =
|
|
82716
|
+
const hashHex = import_ethers49.ethers.hexlify(bytes).toLowerCase();
|
|
82361
82717
|
const nowMs = (this.deps.clock ?? Date.now)();
|
|
82362
82718
|
const expiresAtSec = nextQuantumTimestamp(nowMs);
|
|
82363
82719
|
const secondsLeft = Math.max(0, expiresAtSec - Math.floor(nowMs / 1e3));
|
|
@@ -82387,7 +82743,7 @@ var BridgeEthersSigner = class _BridgeEthersSigner extends import_ethers48.ether
|
|
|
82387
82743
|
if (outcome.status !== "approved" || !outcome.signature) {
|
|
82388
82744
|
throw new OperationDeclined(`the btc-withdrawal authorization was not signed: ${describeOutcome(outcome)}`);
|
|
82389
82745
|
}
|
|
82390
|
-
const recovered =
|
|
82746
|
+
const recovered = import_ethers49.ethers.verifyMessage(bytes, outcome.signature);
|
|
82391
82747
|
if (recovered.toLowerCase() !== this.deps.borrower.toLowerCase()) {
|
|
82392
82748
|
throw new Error(`the btc-withdrawal authorization was signed by ${recovered}, not the borrower ${this.deps.borrower}`);
|
|
82393
82749
|
}
|
|
@@ -82421,11 +82777,11 @@ var BridgeEthersSigner = class _BridgeEthersSigner extends import_ethers48.ether
|
|
|
82421
82777
|
const approved = {
|
|
82422
82778
|
to: tx2.to,
|
|
82423
82779
|
data: tx2.data,
|
|
82424
|
-
value: tx2.value != null ?
|
|
82780
|
+
value: tx2.value != null ? import_ethers49.ethers.toBeHex(BigInt(String(tx2.value))) : "0x0",
|
|
82425
82781
|
chainId: tx2.chainId != null ? Number(tx2.chainId) : this.deps.chainId
|
|
82426
82782
|
};
|
|
82427
82783
|
const card = cardForTx(approved);
|
|
82428
|
-
const gas = tx2.gasLimit != null ?
|
|
82784
|
+
const gas = tx2.gasLimit != null ? import_ethers49.ethers.toBeHex(BigInt(String(tx2.gasLimit))) : await gasHintAcrossBlocks(this.deps.provider, this.deps.borrower, approved, describeFn(approved.data));
|
|
82429
82785
|
const outcome = await this.deps.bridge.requestSignature({
|
|
82430
82786
|
id: (0, import_node_crypto7.randomUUID)(),
|
|
82431
82787
|
kind: "transaction",
|
|
@@ -82467,7 +82823,7 @@ function toApprovedTx(tx2, fallbackChainId) {
|
|
|
82467
82823
|
return {
|
|
82468
82824
|
to: tx2.to,
|
|
82469
82825
|
data: tx2.data,
|
|
82470
|
-
value: tx2.value != null ?
|
|
82826
|
+
value: tx2.value != null ? import_ethers49.ethers.toBeHex(BigInt(String(tx2.value))) : "0x0",
|
|
82471
82827
|
chainId: tx2.chainId != null ? Number(tx2.chainId) : fallbackChainId
|
|
82472
82828
|
};
|
|
82473
82829
|
}
|
|
@@ -82511,7 +82867,7 @@ var MIN_CONFIRMATIONS = { mainnet: 6, sepolia: 1 };
|
|
|
82511
82867
|
var RealUpstreamPlugin = class {
|
|
82512
82868
|
constructor(config, wallet, runtime) {
|
|
82513
82869
|
this.config = config;
|
|
82514
|
-
this.provider = new
|
|
82870
|
+
this.provider = new import_ethers50.ethers.JsonRpcProvider(config.rpcUrl, config.chainId);
|
|
82515
82871
|
this.wallet = wallet ?? null;
|
|
82516
82872
|
this.runtime = runtime ?? null;
|
|
82517
82873
|
this.session = wallet ? new LitOpsSession(wallet.connect(this.provider), config.serviceEndpoint, config.chainId) : null;
|
|
@@ -82813,14 +83169,14 @@ var RealUpstreamPlugin = class {
|
|
|
82813
83169
|
if (!pkpValidation) {
|
|
82814
83170
|
throw new Error(`the SDK's ${this.config.network} deployment table has no PKPValidation address \u2014 cannot verify validator version ${version2}.`);
|
|
82815
83171
|
}
|
|
82816
|
-
const registry = new
|
|
83172
|
+
const registry = new import_ethers50.ethers.Contract(pkpValidation, ["function validatorForVersion(uint256) view returns (address)"], this.provider);
|
|
82817
83173
|
let validator;
|
|
82818
83174
|
try {
|
|
82819
83175
|
validator = await registry.validatorForVersion(version2);
|
|
82820
83176
|
} catch (e) {
|
|
82821
83177
|
throw new Error(`could not verify validator version ${version2} on-chain (PKPValidation ${pkpValidation}): ${e.message}`);
|
|
82822
83178
|
}
|
|
82823
|
-
if (validator ===
|
|
83179
|
+
if (validator === import_ethers50.ethers.ZeroAddress) {
|
|
82824
83180
|
throw new Error(
|
|
82825
83181
|
`validator version ${version2} 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.`
|
|
82826
83182
|
);
|
|
@@ -83096,7 +83452,7 @@ var RealUpstreamPlugin = class {
|
|
|
83096
83452
|
);
|
|
83097
83453
|
if (!r.ok) return r;
|
|
83098
83454
|
const raw = r.value.data.supportedStablecoins ?? [];
|
|
83099
|
-
const bad = raw.find((x) => !
|
|
83455
|
+
const bad = raw.find((x) => !import_ethers50.ethers.isAddress(String(x.address)) || !Number.isFinite(Number(x.decimals)));
|
|
83100
83456
|
if (bad) {
|
|
83101
83457
|
return {
|
|
83102
83458
|
ok: false,
|
|
@@ -83179,7 +83535,7 @@ var RealUpstreamPlugin = class {
|
|
|
83179
83535
|
};
|
|
83180
83536
|
}
|
|
83181
83537
|
const symbol = raw.toLowerCase();
|
|
83182
|
-
if (
|
|
83538
|
+
if (import_ethers50.ethers.isAddress(raw)) return this.psmCallsFor(symbol);
|
|
83183
83539
|
const verified = await this.verifiedStablecoins();
|
|
83184
83540
|
if (!verified.ok) return { ok: false, failure: verified.failure };
|
|
83185
83541
|
const hits = verified.rows.filter((r) => r.symbol.toLowerCase() === symbol);
|
|
@@ -83217,7 +83573,7 @@ var RealUpstreamPlugin = class {
|
|
|
83217
83573
|
* chain, then sign.
|
|
83218
83574
|
*/
|
|
83219
83575
|
async psmCallsFor(stablecoinAddress) {
|
|
83220
|
-
if (!
|
|
83576
|
+
if (!import_ethers50.ethers.isAddress(stablecoinAddress)) {
|
|
83221
83577
|
throw new Error(`psmCallsFor requires a resolved 0x address, got '${stablecoinAddress}' \u2014 resolve through psmCallsForChoice`);
|
|
83222
83578
|
}
|
|
83223
83579
|
const key = stablecoinAddress.toLowerCase();
|
|
@@ -83237,9 +83593,9 @@ var RealUpstreamPlugin = class {
|
|
|
83237
83593
|
let supported;
|
|
83238
83594
|
let symbol;
|
|
83239
83595
|
try {
|
|
83240
|
-
const psm = new
|
|
83596
|
+
const psm = new import_ethers50.ethers.Contract(psmAddress, ["function supportedStablecoins(address) view returns (bool)"], this.provider);
|
|
83241
83597
|
supported = await psm["supportedStablecoins"](key);
|
|
83242
|
-
const erc20 = new
|
|
83598
|
+
const erc20 = new import_ethers50.ethers.Contract(key, ["function symbol() view returns (string)"], this.provider);
|
|
83243
83599
|
symbol = await erc20["symbol"]();
|
|
83244
83600
|
} catch (e) {
|
|
83245
83601
|
return { ok: false, failure: { kind: "unavailable", source: "chain-rpc", message: `PSM stablecoin check failed for ${key}: ${e.message}` } };
|
|
@@ -83452,7 +83808,7 @@ var RealUpstreamPlugin = class {
|
|
|
83452
83808
|
const pm = this.contracts["PositionManager"];
|
|
83453
83809
|
if (!pm) return false;
|
|
83454
83810
|
try {
|
|
83455
|
-
const c = new
|
|
83811
|
+
const c = new import_ethers50.ethers.Contract(pm, PAUSABLE_ABI, this.provider);
|
|
83456
83812
|
return Boolean(await c["paused"]());
|
|
83457
83813
|
} catch {
|
|
83458
83814
|
return false;
|
|
@@ -83461,16 +83817,16 @@ var RealUpstreamPlugin = class {
|
|
|
83461
83817
|
async readPositionDetails(id) {
|
|
83462
83818
|
const core = this.contracts["PositionManagerCoreModule"] ?? this.contracts["PositionManager"];
|
|
83463
83819
|
if (!core) throw new Error(`no PositionManager address for network ${this.config.network}`);
|
|
83464
|
-
const c = new
|
|
83820
|
+
const c = new import_ethers50.ethers.Contract(core, POSITION_DETAILS_ABI, this.provider);
|
|
83465
83821
|
let d;
|
|
83466
83822
|
try {
|
|
83467
|
-
d = await c["getPositionDetails"](
|
|
83823
|
+
d = await c["getPositionDetails"](import_ethers50.ethers.zeroPadValue(id, 32));
|
|
83468
83824
|
} catch (e) {
|
|
83469
83825
|
if (e.code === "CALL_EXCEPTION") return null;
|
|
83470
83826
|
throw e;
|
|
83471
83827
|
}
|
|
83472
83828
|
const borrower = String(d["borrower"]);
|
|
83473
|
-
if (borrower ===
|
|
83829
|
+
if (borrower === import_ethers50.ethers.ZeroAddress) return null;
|
|
83474
83830
|
return {
|
|
83475
83831
|
positionId: String(d["positionId"]),
|
|
83476
83832
|
pkpId: String(d["pkpId"]),
|
|
@@ -85072,8 +85428,8 @@ async function buildBoundary(configResult, overrides) {
|
|
|
85072
85428
|
);
|
|
85073
85429
|
}
|
|
85074
85430
|
try {
|
|
85075
|
-
const decrypted = await
|
|
85076
|
-
if (!(decrypted instanceof
|
|
85431
|
+
const decrypted = await import_ethers51.ethers.Wallet.fromEncryptedJson(keystoreJson, config.keystorePassword);
|
|
85432
|
+
if (!(decrypted instanceof import_ethers51.ethers.Wallet)) {
|
|
85077
85433
|
return bootError("DH_KEYSTORE_PATH did not decrypt to an EOA wallet keystore.", ["DH_KEYSTORE_PATH"]);
|
|
85078
85434
|
}
|
|
85079
85435
|
wallet = decrypted;
|
|
@@ -86194,7 +86550,7 @@ var import_mcp2 = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
|
86194
86550
|
|
|
86195
86551
|
// src/tools/loan.ts
|
|
86196
86552
|
var import_zod = require("zod");
|
|
86197
|
-
var
|
|
86553
|
+
var import_ethers52 = require("ethers");
|
|
86198
86554
|
|
|
86199
86555
|
// src/util/format.ts
|
|
86200
86556
|
function bigintReplacer(_key, value) {
|
|
@@ -86382,7 +86738,7 @@ function registerLoanTools(server, getB, adapter2 = "real") {
|
|
|
86382
86738
|
const b = getB();
|
|
86383
86739
|
if (!b.ok) return renderError(b.error);
|
|
86384
86740
|
return renderEnvelope(
|
|
86385
|
-
await b.boundary.mintUcd({ positionId, amountUcdWei: (0,
|
|
86741
|
+
await b.boundary.mintUcd({ positionId, amountUcdWei: (0, import_ethers52.parseEther)(amountUcd.toString()).toString() })
|
|
86386
86742
|
);
|
|
86387
86743
|
})
|
|
86388
86744
|
);
|
|
@@ -86420,7 +86776,7 @@ function registerLoanTools(server, getB, adapter2 = "real") {
|
|
|
86420
86776
|
if (BigInt(detail.data.debtUcdWei) === 0n) return validationFailed("the position has no outstanding debt");
|
|
86421
86777
|
amountUcdWei = detail.data.debtUcdWei;
|
|
86422
86778
|
} else {
|
|
86423
|
-
amountUcdWei = (0,
|
|
86779
|
+
amountUcdWei = (0, import_ethers52.parseEther)(amountUcd.toString()).toString();
|
|
86424
86780
|
}
|
|
86425
86781
|
return renderEnvelope(await b.boundary.repayUcd({ positionId, amountUcdWei }));
|
|
86426
86782
|
})
|
|
@@ -87023,7 +87379,7 @@ function registerMockControlTool(server, control, chainId = 1337) {
|
|
|
87023
87379
|
|
|
87024
87380
|
// src/tools/signer.ts
|
|
87025
87381
|
var import_zod6 = require("zod");
|
|
87026
|
-
var
|
|
87382
|
+
var import_ethers53 = require("ethers");
|
|
87027
87383
|
var MODES = ["external", "keystore", "safe", "safe-module", "mock-simulated"];
|
|
87028
87384
|
var ACTIONS2 = ["status", "use", "reset-borrower", "unlock-keystore", "connect", "disconnect"];
|
|
87029
87385
|
var EXTERNAL_ONLY_MODES = ["external"];
|
|
@@ -87065,7 +87421,7 @@ function registerSignerTool(server, getRuntime, opts) {
|
|
|
87065
87421
|
if (mode !== void 0 && !offeredModes.includes(mode)) {
|
|
87066
87422
|
return validationFailed(looksSecretShaped(mode) ? SECRET_REFUSAL : `mode '${mode}' is not one of: ${offeredModes.join(" | ")}`);
|
|
87067
87423
|
}
|
|
87068
|
-
if (safeAddress !== void 0 && !
|
|
87424
|
+
if (safeAddress !== void 0 && !import_ethers53.ethers.isAddress(safeAddress)) {
|
|
87069
87425
|
return validationFailed(looksSecretShaped(safeAddress) ? SECRET_REFUSAL : `'${safeAddress}' is not a valid Safe address`);
|
|
87070
87426
|
}
|
|
87071
87427
|
if (action === "status") {
|