@gvnrdao/dh-sdk 0.0.340 → 0.0.342
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/browser/dist/browser.js +1 -1
- package/dist/constants/chunks/contract-errors.generated.d.ts +15 -0
- package/dist/contract-errors.js +498 -0
- package/dist/contract-errors.mjs +461 -0
- package/dist/index.js +587 -225
- package/dist/index.mjs +453 -92
- package/dist/sign-guard.js +6 -0
- package/dist/sign-guard.mjs +4 -0
- package/dist/utils/chunks/eip1559-broadcast.utils.d.ts +2 -2
- package/dist/utils/contract-error-decoder.d.ts +47 -0
- package/dist/utils/quantum-revert.utils.d.ts +14 -2
- package/dist/utils/sign-guard/fee-ceiling.d.ts +16 -0
- package/dist/utils/sign-guard/index.d.ts +1 -1
- package/package.json +13 -3
package/dist/index.mjs
CHANGED
|
@@ -2357,7 +2357,7 @@ ${errorReport}`);
|
|
|
2357
2357
|
}
|
|
2358
2358
|
init_debug_logger();
|
|
2359
2359
|
init_session_signature_cache();
|
|
2360
|
-
var
|
|
2360
|
+
var import_ethers24 = __require("ethers");
|
|
2361
2361
|
var EXPIRED_LOAN_MIN_LIQUIDATION_THRESHOLD_BPS = 11e3;
|
|
2362
2362
|
var GRACE_PERIOD_DAYS = 30;
|
|
2363
2363
|
var SATOSHIS_PER_BITCOIN = 100000000n;
|
|
@@ -5285,12 +5285,12 @@ ${auth.clientId}`;
|
|
|
5285
5285
|
}
|
|
5286
5286
|
async function executeVaultSnapshot(params) {
|
|
5287
5287
|
global.ethers = {
|
|
5288
|
-
...
|
|
5288
|
+
...import_ethers24.ethers,
|
|
5289
5289
|
providers: {
|
|
5290
|
-
StaticJsonRpcProvider:
|
|
5290
|
+
StaticJsonRpcProvider: import_ethers24.ethers.JsonRpcProvider
|
|
5291
5291
|
},
|
|
5292
|
-
Contract:
|
|
5293
|
-
utils:
|
|
5292
|
+
Contract: import_ethers24.ethers.Contract,
|
|
5293
|
+
utils: import_ethers24.ethers
|
|
5294
5294
|
// v6 moved utils to top level
|
|
5295
5295
|
};
|
|
5296
5296
|
global.Lit = {
|
|
@@ -5774,7 +5774,7 @@ var init_network_configs = __esm({
|
|
|
5774
5774
|
});
|
|
5775
5775
|
|
|
5776
5776
|
// src/modules/diamond-hands-sdk.ts
|
|
5777
|
-
import { Contract as Contract9, Interface as
|
|
5777
|
+
import { Contract as Contract9, Interface as Interface6, JsonRpcProvider, AbiCoder as AbiCoder2, keccak256 as keccak2565, solidityPackedKeccak256 as solidityPackedKeccak2564, toUtf8Bytes as toUtf8Bytes5, getBytes as getBytes4, zeroPadValue as zeroPadValue5, toBeHex as toBeHex2, parseEther, formatEther, formatUnits, computeAddress, Signature, ZeroHash, ZeroAddress as ZeroAddress3 } from "ethers";
|
|
5778
5778
|
|
|
5779
5779
|
// src/types/result.ts
|
|
5780
5780
|
function success(value) {
|
|
@@ -6159,17 +6159,56 @@ var SDKError = class _SDKError extends Error {
|
|
|
6159
6159
|
// src/utils/chunks/eip1559-broadcast.utils.ts
|
|
6160
6160
|
import {
|
|
6161
6161
|
getBigInt,
|
|
6162
|
-
parseUnits,
|
|
6163
6162
|
toQuantity
|
|
6164
6163
|
} from "ethers";
|
|
6164
|
+
|
|
6165
|
+
// src/utils/sign-guard/fee-ceiling.ts
|
|
6166
|
+
import { ethers as ethers2 } from "ethers";
|
|
6167
|
+
var MAX_GAS_LIMIT = 5000000n;
|
|
6168
|
+
var MAX_FEE_PER_GAS_WEI = 2000000000000n;
|
|
6169
|
+
var DEFAULT_MAX_TX_FEE_WEI = 250000000000000000n;
|
|
6170
|
+
var PRIORITY_FEE_FLOOR_WEI = 100000000n;
|
|
6171
|
+
var PRIORITY_FEE_CAP_WEI = 3000000000n;
|
|
6172
|
+
var DEFAULT_FEE_CEILING = {
|
|
6173
|
+
maxGasLimit: MAX_GAS_LIMIT,
|
|
6174
|
+
maxFeePerGasWei: MAX_FEE_PER_GAS_WEI,
|
|
6175
|
+
maxTxFeeWei: DEFAULT_MAX_TX_FEE_WEI
|
|
6176
|
+
};
|
|
6177
|
+
function fmtEth(wei) {
|
|
6178
|
+
return `${ethers2.formatEther(wei)} ETH`;
|
|
6179
|
+
}
|
|
6180
|
+
function fmtGwei(wei) {
|
|
6181
|
+
return `${ethers2.formatUnits(wei, "gwei")} gwei`;
|
|
6182
|
+
}
|
|
6183
|
+
function worstCaseFeeWei(gasLimit, maxFeePerGas) {
|
|
6184
|
+
if (gasLimit == null || maxFeePerGas == null)
|
|
6185
|
+
return null;
|
|
6186
|
+
return gasLimit * maxFeePerGas;
|
|
6187
|
+
}
|
|
6188
|
+
function assertFeeCeiling(gasLimit, maxFeePerGas, raise, ceiling = DEFAULT_FEE_CEILING) {
|
|
6189
|
+
if (gasLimit != null && gasLimit > ceiling.maxGasLimit) {
|
|
6190
|
+
raise(`gasLimit ${gasLimit} exceeds the signing ceiling of ${ceiling.maxGasLimit}`);
|
|
6191
|
+
}
|
|
6192
|
+
if (maxFeePerGas != null && maxFeePerGas > ceiling.maxFeePerGasWei) {
|
|
6193
|
+
raise(
|
|
6194
|
+
`maxFeePerGas ${fmtGwei(maxFeePerGas)} exceeds the signing ceiling of ${fmtGwei(ceiling.maxFeePerGasWei)}`
|
|
6195
|
+
);
|
|
6196
|
+
}
|
|
6197
|
+
const worst = worstCaseFeeWei(gasLimit, maxFeePerGas);
|
|
6198
|
+
if (worst != null && worst > ceiling.maxTxFeeWei) {
|
|
6199
|
+
raise(
|
|
6200
|
+
`worst-case transaction fee ${fmtEth(worst)} (gasLimit ${gasLimit} \xD7 ${fmtGwei(maxFeePerGas)}) exceeds the signing ceiling of ${fmtEth(ceiling.maxTxFeeWei)}.${ceiling.raiseHint ? ` ${ceiling.raiseHint}` : ""}`
|
|
6201
|
+
);
|
|
6202
|
+
}
|
|
6203
|
+
}
|
|
6204
|
+
|
|
6205
|
+
// src/utils/chunks/eip1559-broadcast.utils.ts
|
|
6165
6206
|
var MINT_UCD_GAS_CEILING = BigInt(13e5);
|
|
6166
6207
|
var WITHDRAW_BTC_GAS_CEILING = BigInt(3e6);
|
|
6167
6208
|
var MAKE_PAYMENT_GAS_CEILING = BigInt(1e6);
|
|
6168
6209
|
var EXTEND_POSITION_GAS_CEILING = BigInt(1e6);
|
|
6169
6210
|
var LIQUIDATION_COMMIT_GAS_CEILING = BigInt(1e6);
|
|
6170
6211
|
var LIQUIDATION_REVEAL_GAS_CEILING = BigInt(2e6);
|
|
6171
|
-
var PRIORITY_FEE_FLOOR_WEI = parseUnits("0.1", "gwei");
|
|
6172
|
-
var PRIORITY_FEE_CAP_WEI = parseUnits("3", "gwei");
|
|
6173
6212
|
var FEE_HISTORY_BLOCK_COUNT = 20;
|
|
6174
6213
|
var FEE_HISTORY_REWARD_PERCENTILE = 75;
|
|
6175
6214
|
function isJsonRpcSendable(provider) {
|
|
@@ -7467,16 +7506,13 @@ var ERROR_STRING_SELECTOR = "0x08c379a0";
|
|
|
7467
7506
|
var PANIC_SELECTOR = "0x4e487b71";
|
|
7468
7507
|
var QUANTUM_REVERT_NAMES = {
|
|
7469
7508
|
"0xbe4b82c1": "DeadZoneViolation()",
|
|
7470
|
-
"0x137f3b70": "InDeadZone()",
|
|
7471
|
-
"0x131d9a21": "QuantumExpired()",
|
|
7472
7509
|
"0x52ce5d58": "QuantumAlreadyUsed()",
|
|
7473
7510
|
"0x3e76a3c9": "QuantumOutsideWindow()",
|
|
7474
|
-
"0x8baa579f": "InvalidSignature()",
|
|
7475
7511
|
"0x62278171": "InvalidValidatorSignature()",
|
|
7476
|
-
"
|
|
7477
|
-
"
|
|
7478
|
-
"
|
|
7479
|
-
"0xd92e233d": "
|
|
7512
|
+
"0x82b42900": "Unauthorized()",
|
|
7513
|
+
"0x3ee5aeb5": "ReentrancyGuardReentrantCall()",
|
|
7514
|
+
"0x0a0b0d79": "ValidationFailed()",
|
|
7515
|
+
"0xd92e233d": "ZeroAddress()",
|
|
7480
7516
|
"0x36bfdeea": "StateHashMismatch()",
|
|
7481
7517
|
"0xb9d419a7": "DebtUpdateVerificationFailed()",
|
|
7482
7518
|
"0xc7e20553": "DebtUpdateVerificationFailedDetailed(bytes32,uint256,uint256,uint256,uint256,uint256)",
|
|
@@ -19161,7 +19197,7 @@ var TxValidationError = class extends Error {
|
|
|
19161
19197
|
};
|
|
19162
19198
|
|
|
19163
19199
|
// src/utils/sign-guard/signable-functions.ts
|
|
19164
|
-
import { ethers as
|
|
19200
|
+
import { ethers as ethers3 } from "ethers";
|
|
19165
19201
|
var SIGNABLE_FUNCTIONS = [
|
|
19166
19202
|
"function mintUCD(bytes32 positionId, uint256 mintAmount, uint256 mintFee, uint256 newDebt, uint256 newCollateral, uint256 btcPrice, bytes32 authorizedSpendsHash, bytes32 ucdDebtHash, bytes32 contractHash, uint256 quantumTimestamp, bytes calldata mintValidatorSignature) external returns (bool)",
|
|
19167
19203
|
// `makePayment` is the ONLY repayment entry point. A `repayPosition` entry
|
|
@@ -19198,7 +19234,7 @@ var SIGNABLE_FUNCTIONS = [
|
|
|
19198
19234
|
// this too is client-only and never module-whitelisted.
|
|
19199
19235
|
"function addAddress(string btcAddress) external"
|
|
19200
19236
|
];
|
|
19201
|
-
var IFACE = new
|
|
19237
|
+
var IFACE = new ethers3.Interface(SIGNABLE_FUNCTIONS);
|
|
19202
19238
|
function encodeSignable(fn, args) {
|
|
19203
19239
|
return IFACE.encodeFunctionData(fn, args);
|
|
19204
19240
|
}
|
|
@@ -19222,46 +19258,6 @@ function decodeSignable(data) {
|
|
|
19222
19258
|
|
|
19223
19259
|
// src/utils/sign-guard/tx-validator.ts
|
|
19224
19260
|
import { ethers as ethers4 } from "ethers";
|
|
19225
|
-
|
|
19226
|
-
// src/utils/sign-guard/fee-ceiling.ts
|
|
19227
|
-
import { ethers as ethers3 } from "ethers";
|
|
19228
|
-
var MAX_GAS_LIMIT = 5000000n;
|
|
19229
|
-
var MAX_FEE_PER_GAS_WEI = 2000000000000n;
|
|
19230
|
-
var DEFAULT_MAX_TX_FEE_WEI = 250000000000000000n;
|
|
19231
|
-
var DEFAULT_FEE_CEILING = {
|
|
19232
|
-
maxGasLimit: MAX_GAS_LIMIT,
|
|
19233
|
-
maxFeePerGasWei: MAX_FEE_PER_GAS_WEI,
|
|
19234
|
-
maxTxFeeWei: DEFAULT_MAX_TX_FEE_WEI
|
|
19235
|
-
};
|
|
19236
|
-
function fmtEth(wei) {
|
|
19237
|
-
return `${ethers3.formatEther(wei)} ETH`;
|
|
19238
|
-
}
|
|
19239
|
-
function fmtGwei(wei) {
|
|
19240
|
-
return `${ethers3.formatUnits(wei, "gwei")} gwei`;
|
|
19241
|
-
}
|
|
19242
|
-
function worstCaseFeeWei(gasLimit, maxFeePerGas) {
|
|
19243
|
-
if (gasLimit == null || maxFeePerGas == null)
|
|
19244
|
-
return null;
|
|
19245
|
-
return gasLimit * maxFeePerGas;
|
|
19246
|
-
}
|
|
19247
|
-
function assertFeeCeiling(gasLimit, maxFeePerGas, raise, ceiling = DEFAULT_FEE_CEILING) {
|
|
19248
|
-
if (gasLimit != null && gasLimit > ceiling.maxGasLimit) {
|
|
19249
|
-
raise(`gasLimit ${gasLimit} exceeds the signing ceiling of ${ceiling.maxGasLimit}`);
|
|
19250
|
-
}
|
|
19251
|
-
if (maxFeePerGas != null && maxFeePerGas > ceiling.maxFeePerGasWei) {
|
|
19252
|
-
raise(
|
|
19253
|
-
`maxFeePerGas ${fmtGwei(maxFeePerGas)} exceeds the signing ceiling of ${fmtGwei(ceiling.maxFeePerGasWei)}`
|
|
19254
|
-
);
|
|
19255
|
-
}
|
|
19256
|
-
const worst = worstCaseFeeWei(gasLimit, maxFeePerGas);
|
|
19257
|
-
if (worst != null && worst > ceiling.maxTxFeeWei) {
|
|
19258
|
-
raise(
|
|
19259
|
-
`worst-case transaction fee ${fmtEth(worst)} (gasLimit ${gasLimit} \xD7 ${fmtGwei(maxFeePerGas)}) exceeds the signing ceiling of ${fmtEth(ceiling.maxTxFeeWei)}.${ceiling.raiseHint ? ` ${ceiling.raiseHint}` : ""}`
|
|
19260
|
-
);
|
|
19261
|
-
}
|
|
19262
|
-
}
|
|
19263
|
-
|
|
19264
|
-
// src/utils/sign-guard/tx-validator.ts
|
|
19265
19261
|
function eqAddr(a, b) {
|
|
19266
19262
|
if (!a || !b)
|
|
19267
19263
|
return false;
|
|
@@ -19964,6 +19960,391 @@ function formatLiquidationFailureMessage(loanId, errorMessage, btcVault, btcVaul
|
|
|
19964
19960
|
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}`;
|
|
19965
19961
|
}
|
|
19966
19962
|
|
|
19963
|
+
// src/utils/contract-error-decoder.ts
|
|
19964
|
+
import { Interface as Interface5 } from "ethers";
|
|
19965
|
+
|
|
19966
|
+
// src/constants/chunks/contract-errors.generated.ts
|
|
19967
|
+
var CONTRACT_ERROR_FRAGMENTS = [
|
|
19968
|
+
{ fragment: "error AboveMaxRedeem(uint256 amount, uint256 maximum)", contracts: ["SimplePSMV2"] },
|
|
19969
|
+
{ fragment: "error AboveMaxSwap(uint256 amount, uint256 maximum)", contracts: ["SimplePSMV2"] },
|
|
19970
|
+
{ fragment: "error AccessControlBadConfirmation()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
19971
|
+
{ fragment: "error AccessControlUnauthorizedAccount(address account, bytes32 neededRole)", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
19972
|
+
{ fragment: "error AddressEmptyCode(address target)", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
19973
|
+
{ fragment: "error AlreadyActive()", contracts: ["PositionManagerErrors"] },
|
|
19974
|
+
{ fragment: "error AlreadySigned()", contracts: ["PositionManagerErrors", "OperationAuthorizationRegistry"] },
|
|
19975
|
+
{ fragment: "error AmountMustBePositive()", contracts: ["LoanOperationsManagerModule", "SimplePSMV2"] },
|
|
19976
|
+
{ fragment: "error ArrayLengthMismatch()", contracts: ["BTCSpendAuthorizer", "SimplePSMV2"] },
|
|
19977
|
+
{ fragment: "error BTCSpendAuthorizerNotSet()", contracts: ["LoanOperationsManagerModule"] },
|
|
19978
|
+
{ fragment: "error BalanceMismatch()", contracts: ["UCDController"] },
|
|
19979
|
+
{ fragment: "error BatchSizeTooLarge()", contracts: ["BTCSpendAuthorizer"] },
|
|
19980
|
+
{ fragment: "error BelowMinRedeem(uint256 amount, uint256 minimum)", contracts: ["SimplePSMV2"] },
|
|
19981
|
+
{ fragment: "error BelowMinSwap(uint256 amount, uint256 minimum)", contracts: ["SimplePSMV2"] },
|
|
19982
|
+
{ fragment: "error BorrowerBTCSpendMutationDisabled()", contracts: ["LoanOperationsManagerModule"] },
|
|
19983
|
+
{ fragment: "error BtcAmountTooLarge()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule"] },
|
|
19984
|
+
{ fragment: "error BtcPriceBoundOutOfRange()", contracts: ["LoanOperationsManagerModule"] },
|
|
19985
|
+
{ fragment: "error BtcPriceDeviationExceeded(uint256 signedPrice, uint256 chainlinkPrice, uint16 deviationBps)", contracts: ["LoanOperationsManagerModule"] },
|
|
19986
|
+
{ fragment: "error BtcPriceFeedStale(uint256 updatedAt, uint256 maxAge)", contracts: ["LoanOperationsManagerModule"] },
|
|
19987
|
+
{ fragment: "error BtcPriceTooHigh()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule"] },
|
|
19988
|
+
{ fragment: "error BurnCallFailed()", contracts: ["UCDController"] },
|
|
19989
|
+
{ fragment: "error BurnGuardFailed(uint8 code)", contracts: ["UCDController"] },
|
|
19990
|
+
{ fragment: "error BurnVerificationFailed()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
19991
|
+
{ fragment: "error CannotRemoveLastTerm()", contracts: ["PositionManagerErrors"] },
|
|
19992
|
+
{ fragment: "error CannotUpgradeToSelf()", contracts: ["PositionManagerErrors", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer"] },
|
|
19993
|
+
{ fragment: "error CircuitBreakerNotActive()", contracts: ["PositionManagerErrors"] },
|
|
19994
|
+
{ fragment: "error CircuitBreakerTriggered()", contracts: ["PositionManagerErrors"] },
|
|
19995
|
+
{ fragment: "error CollateralOverflow()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule"] },
|
|
19996
|
+
{ fragment: "error CollateralRatioTooLargeForStorage()", contracts: ["PositionManagerErrors"] },
|
|
19997
|
+
{ fragment: "error CollateralRatioTooLow()", contracts: ["PositionManager", "PositionManagerErrors", "LoanOperationsManagerModule"] },
|
|
19998
|
+
{ fragment: "error ContractNotDeployed(address addr)", contracts: ["PositionManager"] },
|
|
19999
|
+
{ fragment: "error DailyLimitExceeded()", contracts: ["UCDController"] },
|
|
20000
|
+
{ fragment: "error DeadZoneViolation()", contracts: ["OperationAuthorizationRegistry"] },
|
|
20001
|
+
{ fragment: "error DebtCalculationMismatch()", contracts: ["LoanOperationsManagerModule"] },
|
|
20002
|
+
{ fragment: "error DebtNotZero()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
20003
|
+
{ fragment: "error DebtOverflow()", contracts: ["LoanOperationsManagerModule"] },
|
|
20004
|
+
{ fragment: "error DebtUpdateVerificationFailed()", contracts: ["LoanOperationsValidation", "LoanOperationsManagerModule"] },
|
|
20005
|
+
{ fragment: "error DebtUpdateVerificationFailedDetailed(bytes32 positionId, uint256 currentDebt, uint256 newDebt, uint256 quantumTimestamp, uint256 supplyAfterMint, uint256 expectedIncrease)", contracts: ["LoanOperationsManagerModule"] },
|
|
20006
|
+
{ fragment: "error DecimalsMismatch(uint8 provided, uint8 actual)", contracts: ["SimplePSMV2"] },
|
|
20007
|
+
{ fragment: "error DecimalsQueryFailed()", contracts: ["SimplePSMV2"] },
|
|
20008
|
+
{ fragment: "error DivisionByZero()", contracts: ["PositionManager", "CollateralManagerModule"] },
|
|
20009
|
+
{ fragment: "error ECDSAInvalidSignature()", contracts: ["BTCSpendAuthorizer"] },
|
|
20010
|
+
{ fragment: "error ECDSAInvalidSignatureLength(uint256 length)", contracts: ["BTCSpendAuthorizer"] },
|
|
20011
|
+
{ fragment: "error ECDSAInvalidSignatureS(bytes32 s)", contracts: ["BTCSpendAuthorizer"] },
|
|
20012
|
+
{ fragment: "error ERC1967InvalidImplementation(address implementation)", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
20013
|
+
{ fragment: "error ERC1967NonPayable()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
20014
|
+
{ fragment: "error EnforcedPause()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
20015
|
+
{ fragment: "error EntryFeeTooHigh(uint256 fee, uint256 max)", contracts: ["SimplePSMV2"] },
|
|
20016
|
+
{ fragment: "error ExceedsFeeBalance(uint256 requested, uint256 max)", contracts: ["SimplePSMV2"] },
|
|
20017
|
+
{ fragment: "error ExceedsMaxLoan()", contracts: ["PositionManagerErrors"] },
|
|
20018
|
+
{ fragment: "error ExitFeeTooHigh(uint256 fee, uint256 max)", contracts: ["SimplePSMV2"] },
|
|
20019
|
+
{ fragment: "error ExpectedPause()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
20020
|
+
{ fragment: "error ExtensionFeeMintingFailed()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
20021
|
+
{ fragment: "error ExtensionNotAllowed()", contracts: ["PositionManagerErrors"] },
|
|
20022
|
+
{ fragment: "error FailedCall()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
20023
|
+
{ fragment: "error FailedToGetStablecoinDecimals()", contracts: ["SimplePSMV2"] },
|
|
20024
|
+
{ fragment: "error FailedToGetUCDDecimals()", contracts: ["SimplePSMV2"] },
|
|
20025
|
+
{ fragment: "error FeeOnTransferNotSupported()", contracts: ["SimplePSMV2"] },
|
|
20026
|
+
{ fragment: "error FeeTooHigh(uint256 fee, uint256 max)", contracts: ["PositionManagerErrors"] },
|
|
20027
|
+
{ fragment: "error FeeTooLow(uint256 fee, uint256 min)", contracts: ["PositionManagerErrors"] },
|
|
20028
|
+
{ fragment: "error ImplNotDeployed()", contracts: ["LoanOperationsManagerModule", "BTCSpendAuthorizer"] },
|
|
20029
|
+
{ fragment: "error ImplementationNotDeployed()", contracts: ["UCDController"] },
|
|
20030
|
+
{ fragment: "error InitialBalanceTooLarge()", contracts: ["SimplePSMV2"] },
|
|
20031
|
+
{ fragment: "error InsufficientBalance()", contracts: ["PositionManagerErrors"] },
|
|
20032
|
+
{ fragment: "error InsufficientCollateralForAmount()", contracts: ["PositionManagerErrors"] },
|
|
20033
|
+
{ fragment: "error InsufficientCollateralRatio()", contracts: ["CollateralManagerModule"] },
|
|
20034
|
+
{ fragment: "error InsufficientFeeBal()", contracts: ["LoanOperationsManagerModule"] },
|
|
20035
|
+
{ fragment: "error InsufficientReserves(uint256 available, uint256 required)", contracts: ["SimplePSMV2"] },
|
|
20036
|
+
{ fragment: "error InsufficientSignatures()", contracts: ["OperationAuthorizationRegistry"] },
|
|
20037
|
+
{ fragment: "error IntegrityCheckFailed()", contracts: ["PositionManagerErrors"] },
|
|
20038
|
+
{ fragment: "error InvalidActionHash()", contracts: ["CollateralManagerModule"] },
|
|
20039
|
+
{ fragment: "error InvalidAddress()", contracts: ["PositionManager", "PositionManagerErrors", "OperationAuthorizationRegistry", "CollateralManagerModule", "SimplePSMV2"] },
|
|
20040
|
+
{ fragment: "error InvalidAdmin()", contracts: ["LoanOperationsManagerModule", "BTCSpendAuthorizer", "SimplePSMV2"] },
|
|
20041
|
+
{ fragment: "error InvalidAmount()", contracts: ["PositionManagerErrors", "SimplePSMV2"] },
|
|
20042
|
+
{ fragment: "error InvalidBTCPrice()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
20043
|
+
{ fragment: "error InvalidBytes32()", contracts: ["PositionManager"] },
|
|
20044
|
+
{ fragment: "error InvalidCollateralAmount()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
20045
|
+
{ fragment: "error InvalidController()", contracts: ["SimplePSMV2"] },
|
|
20046
|
+
{ fragment: "error InvalidDecimals(uint8 decimals)", contracts: ["SimplePSMV2"] },
|
|
20047
|
+
{ fragment: "error InvalidExchangeRate()", contracts: ["SimplePSMV2"] },
|
|
20048
|
+
{ fragment: "error InvalidImpl()", contracts: ["LoanOperationsManagerModule", "BTCSpendAuthorizer"] },
|
|
20049
|
+
{ fragment: "error InvalidImplementation()", contracts: ["UCDController"] },
|
|
20050
|
+
{ fragment: "error InvalidInitialization()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
20051
|
+
{ fragment: "error InvalidLitSignature()", contracts: ["BTCSpendAuthorizer"] },
|
|
20052
|
+
{ fragment: "error InvalidLoanOps()", contracts: ["BTCSpendAuthorizer"] },
|
|
20053
|
+
{ fragment: "error InvalidModuleAddress()", contracts: ["UCDController"] },
|
|
20054
|
+
{ fragment: "error InvalidNetwork()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
20055
|
+
{ fragment: "error InvalidNetworkMode()", contracts: ["PositionManagerErrors"] },
|
|
20056
|
+
{ fragment: "error InvalidOracleConfig()", contracts: ["LoanOperationsManagerModule"] },
|
|
20057
|
+
{ fragment: "error InvalidPKPId()", contracts: ["PositionManagerErrors"] },
|
|
20058
|
+
{ fragment: "error InvalidParameter()", contracts: ["UCDController"] },
|
|
20059
|
+
{ fragment: "error InvalidPkpPublicKey()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
20060
|
+
{ fragment: "error InvalidPosMgr()", contracts: ["LoanOperationsManagerModule"] },
|
|
20061
|
+
{ fragment: "error InvalidPositionId()", contracts: ["PositionManager", "PositionManagerErrors", "LoanOperationsValidation", "LoanOperationsManagerModule", "CollateralManagerModule"] },
|
|
20062
|
+
{ fragment: "error InvalidPositionState()", contracts: ["LoanOperationsManagerModule"] },
|
|
20063
|
+
{ fragment: "error InvalidPriceFeed()", contracts: ["LoanOperationsManagerModule"] },
|
|
20064
|
+
{ fragment: "error InvalidRecipient()", contracts: ["LoanOperationsManagerModule", "SimplePSMV2"] },
|
|
20065
|
+
{ fragment: "error InvalidRegistry()", contracts: ["LoanOperationsManagerModule"] },
|
|
20066
|
+
{ fragment: "error InvalidRequestedExpiryDate()", contracts: ["PositionManagerErrors"] },
|
|
20067
|
+
{ fragment: "error InvalidSignature(string reason)", contracts: ["PositionManager"] },
|
|
20068
|
+
{ fragment: "error InvalidSignatureLength()", contracts: ["PositionManagerErrors"] },
|
|
20069
|
+
{ fragment: "error InvalidStablecoinAddress()", contracts: ["SimplePSMV2"] },
|
|
20070
|
+
{ fragment: "error InvalidStaleSpendAttestation()", contracts: ["BTCSpendAuthorizer"] },
|
|
20071
|
+
{ fragment: "error InvalidString(string value)", contracts: ["PositionManager"] },
|
|
20072
|
+
{ fragment: "error InvalidTerm()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
20073
|
+
{ fragment: "error InvalidTerm(uint256 term, uint256 min, uint256 max)", contracts: ["PositionManager"] },
|
|
20074
|
+
{ fragment: "error InvalidTermMgr()", contracts: ["LoanOperationsManagerModule"] },
|
|
20075
|
+
{ fragment: "error InvalidTermStartTime()", contracts: ["PositionManagerErrors"] },
|
|
20076
|
+
{ fragment: "error InvalidToken()", contracts: ["SimplePSMV2"] },
|
|
20077
|
+
{ fragment: "error InvalidUCDCtrl()", contracts: ["LoanOperationsManagerModule"] },
|
|
20078
|
+
{ fragment: "error InvalidUCDDecimals(uint8 decimals)", contracts: ["SimplePSMV2"] },
|
|
20079
|
+
{ fragment: "error InvalidUCDToken()", contracts: ["LoanOperationsManagerModule"] },
|
|
20080
|
+
{ fragment: "error InvalidValidatorAddress()", contracts: ["BTCSpendAuthorizer"] },
|
|
20081
|
+
{ fragment: "error InvalidValidatorSignature()", contracts: ["PositionManagerErrors"] },
|
|
20082
|
+
{ fragment: "error InvalidVaultAddress()", contracts: ["PositionManagerErrors"] },
|
|
20083
|
+
{ fragment: "error InvalidVolumeCap(bool isRedeem)", contracts: ["SimplePSMV2"] },
|
|
20084
|
+
{ fragment: "error InvalidWithdrawalAddress()", contracts: ["CollateralManagerModule"] },
|
|
20085
|
+
{ fragment: "error InvalidWithdrawalLoanStatusType()", contracts: ["CollateralManagerModule"] },
|
|
20086
|
+
{ fragment: "error LiquidationsPaused()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
20087
|
+
{ fragment: "error LoanAmountTooHigh()", contracts: ["PositionManagerErrors"] },
|
|
20088
|
+
{ fragment: "error LoanAmountTooLow()", contracts: ["PositionManagerErrors"] },
|
|
20089
|
+
{ fragment: "error MaxAuthorizedSpendsReached()", contracts: ["BTCSpendAuthorizer"] },
|
|
20090
|
+
{ fragment: "error MaxLoanOutOfBounds()", contracts: ["LoanOperationsManagerModule"] },
|
|
20091
|
+
{ fragment: "error MaxRedeemBelowMin(uint256 maximum, uint256 minimum)", contracts: ["SimplePSMV2"] },
|
|
20092
|
+
{ fragment: "error MaxRedeemCapDisabled()", contracts: ["SimplePSMV2"] },
|
|
20093
|
+
{ fragment: "error MaxSupplyExceeded()", contracts: ["UCDController"] },
|
|
20094
|
+
{ fragment: "error MaxSwapBelowMin(uint256 maximum, uint256 minimum)", contracts: ["SimplePSMV2"] },
|
|
20095
|
+
{ fragment: "error MaxSwapCapDisabled()", contracts: ["SimplePSMV2"] },
|
|
20096
|
+
{ fragment: "error MinLoanOutOfBounds()", contracts: ["LoanOperationsManagerModule"] },
|
|
20097
|
+
{ fragment: "error MintBorrowerMismatch()", contracts: ["LoanOperationsManagerModule"] },
|
|
20098
|
+
{ fragment: "error MintCallFailed()", contracts: ["UCDController"] },
|
|
20099
|
+
{ fragment: "error MintFailed()", contracts: ["LoanOperationsManagerModule"] },
|
|
20100
|
+
{ fragment: "error MintGuardFailed(uint8 code)", contracts: ["UCDController"] },
|
|
20101
|
+
{ fragment: "error MintVerificationFailed()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
20102
|
+
{ fragment: "error MintVerificationMismatch(uint256 expectedSupply, uint256 currentSupply)", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
20103
|
+
{ fragment: "error MissingVERSION()", contracts: ["LoanOperationsManagerModule", "BTCSpendAuthorizer", "UCDController"] },
|
|
20104
|
+
{ fragment: "error MissingVersion()", contracts: ["PositionManagerErrors", "CollateralManagerModule"] },
|
|
20105
|
+
{ fragment: "error ModuleCallFailed()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
20106
|
+
{ fragment: "error NoFeesToTransfer()", contracts: ["SimplePSMV2"] },
|
|
20107
|
+
{ fragment: "error NoRegistry()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
20108
|
+
{ fragment: "error NoVersion()", contracts: ["LoanOperationsManagerModule", "BTCSpendAuthorizer", "UCDController"] },
|
|
20109
|
+
{ fragment: "error NonZeroReserves(address stablecoin, uint256 reserves)", contracts: ["SimplePSMV2"] },
|
|
20110
|
+
{ fragment: "error NormalizationOverflow()", contracts: ["SimplePSMV2"] },
|
|
20111
|
+
{ fragment: "error NotAdminModule()", contracts: ["PositionManager", "PositionManagerErrors", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
20112
|
+
{ fragment: "error NotAuthorized()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
20113
|
+
{ fragment: "error NotAuthorizedConsumer()", contracts: ["OperationAuthorizationRegistry"] },
|
|
20114
|
+
{ fragment: "error NotAuthorizedSigner()", contracts: ["OperationAuthorizationRegistry"] },
|
|
20115
|
+
{ fragment: "error NotBorrower()", contracts: ["PositionManager", "PositionManagerErrors", "LoanOperationsManagerModule"] },
|
|
20116
|
+
{ fragment: "error NotContract()", contracts: ["PositionManagerErrors", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "SimplePSMV2"] },
|
|
20117
|
+
{ fragment: "error NotInitializing()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
20118
|
+
{ fragment: "error NotLiquidationPkpOwner()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
20119
|
+
{ fragment: "error NotLiquidator()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
20120
|
+
{ fragment: "error NotOwner()", contracts: ["OperationAuthorizationRegistry"] },
|
|
20121
|
+
{ fragment: "error NotPendingOwner()", contracts: ["OperationAuthorizationRegistry"] },
|
|
20122
|
+
{ fragment: "error NotProductionAuthorizer()", contracts: ["PositionManagerErrors", "LoanOperationsManagerModule"] },
|
|
20123
|
+
{ fragment: "error NotProductionRegistry()", contracts: ["PositionManager", "PositionManagerErrors", "LoanOperationsManagerModule"] },
|
|
20124
|
+
{ fragment: "error OnlyCore()", contracts: ["CollateralManagerModule"] },
|
|
20125
|
+
{ fragment: "error OnlyLoanOps()", contracts: ["BTCSpendAuthorizer"] },
|
|
20126
|
+
{ fragment: "error OnlyPosMgr()", contracts: ["LoanOperationsManagerModule"] },
|
|
20127
|
+
{ fragment: "error OnlyPositionManager()", contracts: ["LoanOperationsManagerModule"] },
|
|
20128
|
+
{ fragment: "error OperationInProgress()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
20129
|
+
{ fragment: "error OracleDecimalMismatch()", contracts: ["LoanOperationsManagerModule"] },
|
|
20130
|
+
{ fragment: "error PKPAlreadyUsed()", contracts: ["PositionManagerErrors"] },
|
|
20131
|
+
{ fragment: "error PaymentAmountTooLarge()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
20132
|
+
{ fragment: "error PaymentAmountZero()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
20133
|
+
{ fragment: "error PaymentMustBeLessThanDebt()", contracts: ["LoanOperationsManagerModule"] },
|
|
20134
|
+
{ fragment: "error PaymentMustBePositive()", contracts: ["LoanOperationsManagerModule"] },
|
|
20135
|
+
{ fragment: "error PositionAlreadyExists()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
20136
|
+
{ fragment: "error PositionDoesNotExist()", contracts: ["CollateralManagerModule"] },
|
|
20137
|
+
{ fragment: "error PositionLiquidatable()", contracts: ["PositionManagerErrors"] },
|
|
20138
|
+
{ fragment: "error PositionManagerNotContract()", contracts: ["LoanOperationsValidation"] },
|
|
20139
|
+
{ fragment: "error PositionManagerNotSet()", contracts: ["LoanOperationsValidation"] },
|
|
20140
|
+
{ fragment: "error PositionNotActive()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
20141
|
+
{ fragment: "error PositionNotEligible()", contracts: ["LoanOperationsManagerModule"] },
|
|
20142
|
+
{ fragment: "error PositionNotEligibleForOperation()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
20143
|
+
{ fragment: "error PositionNotFound()", contracts: ["PositionManager", "PositionManagerErrors", "LoanOperationsManagerModule"] },
|
|
20144
|
+
{ fragment: "error PositionNotInCore()", contracts: ["LoanOperationsValidation"] },
|
|
20145
|
+
{ fragment: "error PositionStatusInvalid()", contracts: ["PositionManager", "PositionManagerErrors", "LoanOperationsManagerModule"] },
|
|
20146
|
+
{ fragment: "error PositionWouldBecomeLiquidatable()", contracts: ["PositionManagerErrors"] },
|
|
20147
|
+
{ fragment: "error ProposalAlreadyExecuted()", contracts: ["OperationAuthorizationRegistry"] },
|
|
20148
|
+
{ fragment: "error ProposalAlreadyExists()", contracts: ["OperationAuthorizationRegistry"] },
|
|
20149
|
+
{ fragment: "error ProposalCancelled()", contracts: ["OperationAuthorizationRegistry"] },
|
|
20150
|
+
{ fragment: "error ProposalNotFound()", contracts: ["OperationAuthorizationRegistry"] },
|
|
20151
|
+
{ fragment: "error PsmBurnSupplyMismatch(uint256 expected, uint256 actual)", contracts: ["SimplePSMV2"] },
|
|
20152
|
+
{ fragment: "error PsmMintSupplyMismatch(uint256 expected, uint256 actual)", contracts: ["SimplePSMV2"] },
|
|
20153
|
+
{ fragment: "error QuantumAlreadyUsed()", contracts: ["OperationAuthorizationRegistry"] },
|
|
20154
|
+
{ fragment: "error QuantumOutsideWindow()", contracts: ["OperationAuthorizationRegistry"] },
|
|
20155
|
+
{ fragment: "error RateLimitExceeded()", contracts: ["SimplePSMV2"] },
|
|
20156
|
+
{ fragment: "error RatioOverflow()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule"] },
|
|
20157
|
+
{ fragment: "error RecipientNotAllowed()", contracts: ["LoanOperationsManagerModule", "SimplePSMV2"] },
|
|
20158
|
+
{ fragment: "error RedeemVolumeExceededThisBlock(address stablecoin, uint256 attempted, uint256 cap)", contracts: ["SimplePSMV2"] },
|
|
20159
|
+
{ fragment: "error RedemptionsPaused()", contracts: ["SimplePSMV2"] },
|
|
20160
|
+
{ fragment: "error ReentrancyGuardReentrantCall()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
20161
|
+
{ fragment: "error RegistryNotSet()", contracts: ["LoanOperationsManagerModule", "SimplePSMV2"] },
|
|
20162
|
+
{ fragment: "error ReserveOverflow()", contracts: ["SimplePSMV2"] },
|
|
20163
|
+
{ fragment: "error ReserveTooLarge()", contracts: ["SimplePSMV2"] },
|
|
20164
|
+
{ fragment: "error ReserveUnderflow()", contracts: ["SimplePSMV2"] },
|
|
20165
|
+
{ fragment: "error SafeERC20FailedOperation(address token)", contracts: ["PositionManager", "LoanOperationsManagerModule", "SimplePSMV2"] },
|
|
20166
|
+
{ fragment: "error SameBlockInteraction()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
20167
|
+
{ fragment: "error SameImpl()", contracts: ["LoanOperationsManagerModule", "BTCSpendAuthorizer"] },
|
|
20168
|
+
{ fragment: "error SameImplementation()", contracts: ["PositionManagerErrors", "CollateralManagerModule"] },
|
|
20169
|
+
{ fragment: "error SignatureVerificationFailed(bytes4 selector, address recovered, address expected, bytes32 messageHash, uint8 errorCode)", contracts: ["OperationAuthorizationRegistry"] },
|
|
20170
|
+
{ fragment: "error SlippageExceeded(uint256 got, uint256 minimum)", contracts: ["SimplePSMV2"] },
|
|
20171
|
+
{ fragment: "error SlippageProtectionRequired()", contracts: ["SimplePSMV2"] },
|
|
20172
|
+
{ fragment: "error StablecoinAlreadySupported(address stablecoin)", contracts: ["SimplePSMV2"] },
|
|
20173
|
+
{ fragment: "error StablecoinNotContract(address stablecoin)", contracts: ["SimplePSMV2"] },
|
|
20174
|
+
{ fragment: "error StablecoinNotSupported(address stablecoin)", contracts: ["SimplePSMV2"] },
|
|
20175
|
+
{ fragment: "error StablecoinNotSupportedInV1(address stablecoin)", contracts: ["SimplePSMV2"] },
|
|
20176
|
+
{ fragment: "error StaleAttestationMismatch()", contracts: ["BTCSpendAuthorizer"] },
|
|
20177
|
+
{ fragment: "error StaleAttestationTooOld()", contracts: ["BTCSpendAuthorizer"] },
|
|
20178
|
+
{ fragment: "error StaleSpendValidatorNotSet()", contracts: ["BTCSpendAuthorizer"] },
|
|
20179
|
+
{ fragment: "error StateHashMismatch()", contracts: ["LoanOperationsValidation", "LoanOperationsManagerModule", "CollateralManagerModule"] },
|
|
20180
|
+
{ fragment: "error SwapVolumeExceededThisBlock(address stablecoin, uint256 attempted, uint256 cap)", contracts: ["SimplePSMV2"] },
|
|
20181
|
+
{ fragment: "error SyncDriftTooLarge()", contracts: ["SimplePSMV2"] },
|
|
20182
|
+
{ fragment: "error TargetAddrRequired()", contracts: ["BTCSpendAuthorizer"] },
|
|
20183
|
+
{ fragment: "error TargetExceedsInputValue()", contracts: ["BTCSpendAuthorizer"] },
|
|
20184
|
+
{ fragment: "error TargetMustBePositive()", contracts: ["BTCSpendAuthorizer"] },
|
|
20185
|
+
{ fragment: "error TermAlreadyExists()", contracts: ["PositionManagerErrors"] },
|
|
20186
|
+
{ fragment: "error TermExceedsMaximum()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
20187
|
+
{ fragment: "error TermNotFound()", contracts: ["PositionManagerErrors"] },
|
|
20188
|
+
{ fragment: "error ThresholdTooHigh()", contracts: ["LoanOperationsManagerModule"] },
|
|
20189
|
+
{ fragment: "error TimelockNotMet()", contracts: ["OperationAuthorizationRegistry"] },
|
|
20190
|
+
{ fragment: "error TimelockRequiredOnThisChain()", contracts: ["OperationAuthorizationRegistry"] },
|
|
20191
|
+
{ fragment: "error TimestampOverflow()", contracts: ["LoanOperationsManagerModule"] },
|
|
20192
|
+
{ fragment: "error TooManySigners()", contracts: ["OperationAuthorizationRegistry"] },
|
|
20193
|
+
{ fragment: "error UTXOAlreadyAuthorized()", contracts: ["BTCSpendAuthorizer"] },
|
|
20194
|
+
{ fragment: "error UTXONotAuthorized()", contracts: ["BTCSpendAuthorizer"] },
|
|
20195
|
+
{ fragment: "error UUPSUnauthorizedCallContext()", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
20196
|
+
{ fragment: "error UUPSUnsupportedProxiableUUID(bytes32 slot)", contracts: ["PositionManager", "LoanOperationsManagerModule", "OperationAuthorizationRegistry", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
20197
|
+
{ fragment: "error UcdAmountTooLarge()", contracts: ["PositionManager", "LoanOperationsManagerModule", "CollateralManagerModule"] },
|
|
20198
|
+
{ fragment: "error Unauthorized()", contracts: ["UCDController"] },
|
|
20199
|
+
{ fragment: "error UnexpectedRoleGrantFailure()", contracts: ["PositionManager", "PositionManagerErrors", "LoanOperationsManagerModule", "CollateralManagerModule", "BTCSpendAuthorizer", "UCDController", "SimplePSMV2"] },
|
|
20200
|
+
{ fragment: "error UnsupportedFeeToken(address token)", contracts: ["SimplePSMV2"] },
|
|
20201
|
+
{ fragment: "error UserDailyMintLimitExceeded()", contracts: ["LoanOperationsManagerModule"] },
|
|
20202
|
+
{ fragment: "error V2AlreadyInitialized()", contracts: ["SimplePSMV2"] },
|
|
20203
|
+
{ fragment: "error ValidationFailed()", contracts: ["PositionManager", "PositionManagerErrors"] },
|
|
20204
|
+
{ fragment: "error ValidatorNotActive()", contracts: ["OperationAuthorizationRegistry"] },
|
|
20205
|
+
{ fragment: "error WithdrawalAddressNotApproved()", contracts: ["CollateralManagerModule"] },
|
|
20206
|
+
{ fragment: "error WithdrawalExceedsReserves(uint256 amount, uint256 reserves)", contracts: ["SimplePSMV2"] },
|
|
20207
|
+
{ fragment: "error ZeroAddress()", contracts: ["PositionManager", "UCDController"] },
|
|
20208
|
+
{ fragment: "error ZeroAmount()", contracts: ["UCDController"] }
|
|
20209
|
+
];
|
|
20210
|
+
|
|
20211
|
+
// src/utils/contract-error-decoder.ts
|
|
20212
|
+
var TABLE = null;
|
|
20213
|
+
function contractErrorTable() {
|
|
20214
|
+
if (TABLE)
|
|
20215
|
+
return TABLE;
|
|
20216
|
+
const table = /* @__PURE__ */ new Map();
|
|
20217
|
+
const iface = new Interface5(CONTRACT_ERROR_FRAGMENTS.map((e) => e.fragment));
|
|
20218
|
+
const contractsByName = new Map(
|
|
20219
|
+
CONTRACT_ERROR_FRAGMENTS.map((e) => [e.fragment.slice("error ".length, e.fragment.indexOf("(")), e.contracts])
|
|
20220
|
+
);
|
|
20221
|
+
iface.forEachError((fragment) => {
|
|
20222
|
+
const existing = table.get(fragment.selector);
|
|
20223
|
+
const contracts = contractsByName.get(fragment.name) ?? [];
|
|
20224
|
+
if (existing) {
|
|
20225
|
+
for (const c of contracts)
|
|
20226
|
+
if (!existing.contracts.includes(c))
|
|
20227
|
+
existing.contracts.push(c);
|
|
20228
|
+
return;
|
|
20229
|
+
}
|
|
20230
|
+
table.set(fragment.selector, {
|
|
20231
|
+
signature: fragment.format("sighash"),
|
|
20232
|
+
fragment,
|
|
20233
|
+
contracts: [...contracts]
|
|
20234
|
+
});
|
|
20235
|
+
});
|
|
20236
|
+
TABLE = table;
|
|
20237
|
+
return table;
|
|
20238
|
+
}
|
|
20239
|
+
function lookupContractError(selector) {
|
|
20240
|
+
return contractErrorTable().get(selector.toLowerCase()) ?? null;
|
|
20241
|
+
}
|
|
20242
|
+
function extractErrorData(error) {
|
|
20243
|
+
const viaQuantum = decodeQuantumRevert(error).data;
|
|
20244
|
+
if (viaQuantum && viaQuantum.length >= 10)
|
|
20245
|
+
return viaQuantum;
|
|
20246
|
+
const candidates = [
|
|
20247
|
+
error?.error?.error?.error?.data,
|
|
20248
|
+
error?.error?.error?.data,
|
|
20249
|
+
error?.data?.data,
|
|
20250
|
+
error?.transaction?.data
|
|
20251
|
+
];
|
|
20252
|
+
for (const data of candidates) {
|
|
20253
|
+
if (typeof data === "string" && data.startsWith("0x") && data.length >= 10)
|
|
20254
|
+
return data;
|
|
20255
|
+
}
|
|
20256
|
+
const body = typeof error?.body === "string" ? error.body : null;
|
|
20257
|
+
if (body) {
|
|
20258
|
+
try {
|
|
20259
|
+
const parsed = JSON.parse(body);
|
|
20260
|
+
const data = parsed?.error?.data;
|
|
20261
|
+
if (typeof data === "string" && data.startsWith("0x") && data.length >= 10)
|
|
20262
|
+
return data;
|
|
20263
|
+
} catch {
|
|
20264
|
+
}
|
|
20265
|
+
}
|
|
20266
|
+
return null;
|
|
20267
|
+
}
|
|
20268
|
+
function extractRevertString(error) {
|
|
20269
|
+
if (typeof error?.reason === "string" && error.reason.length > 0)
|
|
20270
|
+
return error.reason;
|
|
20271
|
+
const message = typeof error?.message === "string" ? error.message : null;
|
|
20272
|
+
if (!message)
|
|
20273
|
+
return null;
|
|
20274
|
+
const withReasonString = message.match(/reverted with reason string ['"](.+?)['"]/);
|
|
20275
|
+
if (withReasonString)
|
|
20276
|
+
return withReasonString[1];
|
|
20277
|
+
const withReason = message.match(/reason: ['"](.+?)['"]/);
|
|
20278
|
+
return withReason ? withReason[1] : null;
|
|
20279
|
+
}
|
|
20280
|
+
function renderArgs(args) {
|
|
20281
|
+
return args.map((arg) => typeof arg === "object" && arg !== null ? JSON.stringify(arg) : String(arg)).join(", ");
|
|
20282
|
+
}
|
|
20283
|
+
function decodeContractError(error) {
|
|
20284
|
+
const errorData = extractErrorData(error);
|
|
20285
|
+
if (!errorData) {
|
|
20286
|
+
const revertString2 = extractRevertString(error);
|
|
20287
|
+
if (revertString2 && !revertString2.includes("cannot estimate gas")) {
|
|
20288
|
+
return {
|
|
20289
|
+
name: "RevertString",
|
|
20290
|
+
selector: "0x00000000",
|
|
20291
|
+
args: [revertString2],
|
|
20292
|
+
contract: "Unknown",
|
|
20293
|
+
message: `Revert: ${revertString2}`
|
|
20294
|
+
};
|
|
20295
|
+
}
|
|
20296
|
+
return null;
|
|
20297
|
+
}
|
|
20298
|
+
const selector = errorData.slice(0, 10).toLowerCase();
|
|
20299
|
+
if (selector === ERROR_STRING_SELECTOR || selector === PANIC_SELECTOR) {
|
|
20300
|
+
const { name } = decodeQuantumRevert(error);
|
|
20301
|
+
if (name) {
|
|
20302
|
+
return { name, selector, args: [], contract: "Solidity", message: name };
|
|
20303
|
+
}
|
|
20304
|
+
}
|
|
20305
|
+
const entry = lookupContractError(selector);
|
|
20306
|
+
if (entry) {
|
|
20307
|
+
const contract = entry.contracts.join(" | ");
|
|
20308
|
+
let args = [];
|
|
20309
|
+
try {
|
|
20310
|
+
const decoded = new Interface5([entry.fragment]).decodeErrorResult(entry.fragment, errorData);
|
|
20311
|
+
args = Array.from(decoded);
|
|
20312
|
+
} catch {
|
|
20313
|
+
args = [];
|
|
20314
|
+
}
|
|
20315
|
+
return {
|
|
20316
|
+
name: entry.fragment.name,
|
|
20317
|
+
selector,
|
|
20318
|
+
args,
|
|
20319
|
+
contract,
|
|
20320
|
+
message: `${contract}.${entry.fragment.name}(${renderArgs(args)})`
|
|
20321
|
+
};
|
|
20322
|
+
}
|
|
20323
|
+
const revertString = extractRevertString(error);
|
|
20324
|
+
if (revertString && !revertString.includes("cannot estimate gas")) {
|
|
20325
|
+
return {
|
|
20326
|
+
name: "RevertString",
|
|
20327
|
+
selector,
|
|
20328
|
+
args: [revertString],
|
|
20329
|
+
contract: "Unknown",
|
|
20330
|
+
message: `Revert: ${revertString}`
|
|
20331
|
+
};
|
|
20332
|
+
}
|
|
20333
|
+
return {
|
|
20334
|
+
name: "UnknownError",
|
|
20335
|
+
selector,
|
|
20336
|
+
args: [],
|
|
20337
|
+
contract: "Unknown",
|
|
20338
|
+
message: `Unknown error (selector: ${selector})`
|
|
20339
|
+
};
|
|
20340
|
+
}
|
|
20341
|
+
function formatDecodedError(decoded) {
|
|
20342
|
+
if (decoded.args && decoded.args.length > 0) {
|
|
20343
|
+
return `${decoded.contract}.${decoded.name}(${renderArgs(decoded.args)})`;
|
|
20344
|
+
}
|
|
20345
|
+
return `${decoded.contract}.${decoded.name}()`;
|
|
20346
|
+
}
|
|
20347
|
+
|
|
19967
20348
|
// src/utils/ethers-interop.utils.ts
|
|
19968
20349
|
function normalizeBigNumberish(value) {
|
|
19969
20350
|
if (value === null || value === void 0) {
|
|
@@ -22031,7 +22412,7 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
|
|
|
22031
22412
|
});
|
|
22032
22413
|
}
|
|
22033
22414
|
const signatureHexMint = finalSignature.startsWith("0x") ? finalSignature : "0x" + finalSignature;
|
|
22034
|
-
const mintIface = new
|
|
22415
|
+
const mintIface = new Interface6(positionManagerAbi);
|
|
22035
22416
|
const mintCalldata = mintIface.encodeFunctionData("mintUCD", [
|
|
22036
22417
|
positionIdBytes32,
|
|
22037
22418
|
validationResponse.mintAmount,
|
|
@@ -22144,7 +22525,6 @@ Mint/debt diagnostics (LoanOperationsManager mint path \u2192 increaseDebtFromMi
|
|
|
22144
22525
|
let quantumContext = "";
|
|
22145
22526
|
if (selector === "0x131d9a21" || // QuantumExpired()
|
|
22146
22527
|
selector === "0x52ce5d58" || // QuantumAlreadyUsed()
|
|
22147
|
-
selector === "0x137f3b70" || // InDeadZone()
|
|
22148
22528
|
selector === "0xbe4b82c1" || // DeadZoneViolation()
|
|
22149
22529
|
selector === "0x3e76a3c9") {
|
|
22150
22530
|
const nowSecs = Math.floor(Date.now() / 1e3);
|
|
@@ -22197,7 +22577,7 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
|
|
|
22197
22577
|
if (receipt.logs && receipt.logs.length > 0) {
|
|
22198
22578
|
for (const receiptLog of receipt.logs) {
|
|
22199
22579
|
if (receiptLog.topics && receiptLog.topics[0] === "0x08c379a0") {
|
|
22200
|
-
const iface = new
|
|
22580
|
+
const iface = new Interface6([
|
|
22201
22581
|
"error Error(string)"
|
|
22202
22582
|
]);
|
|
22203
22583
|
const decoded = iface.decodeErrorResult("Error", receiptLog.data);
|
|
@@ -22214,7 +22594,7 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
|
|
|
22214
22594
|
const minimalAbi = [
|
|
22215
22595
|
"event UCDMintedWithAuthorization(bytes32 indexed positionId, address indexed borrower, uint256 mintAmount, uint256 mintFee, uint256 newDebt, uint256 newCollateral, uint256 btcPrice, uint256 quantumTimestamp, bytes32 authorizedSpendsHash)"
|
|
22216
22596
|
];
|
|
22217
|
-
const iface = new
|
|
22597
|
+
const iface = new Interface6(minimalAbi);
|
|
22218
22598
|
for (const receiptLog of receipt.logs) {
|
|
22219
22599
|
const parsed = (() => {
|
|
22220
22600
|
const logIface = iface;
|
|
@@ -22267,33 +22647,14 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
|
|
|
22267
22647
|
return result;
|
|
22268
22648
|
} catch (error) {
|
|
22269
22649
|
let customErrorDetails = "";
|
|
22270
|
-
const
|
|
22271
|
-
if (
|
|
22272
|
-
|
|
22273
|
-
const knownErrors = {
|
|
22274
|
-
"0x8baa579f": "InvalidSignature()",
|
|
22275
|
-
"0xd92e233d": "ValidationFailed()",
|
|
22276
|
-
"0x3ee5aeb5": "OperationNotAuthorized()",
|
|
22277
|
-
"0x70f4b32a": "UnauthorizedSigner()",
|
|
22278
|
-
"0x48f5c3ed": "Unauthorized()",
|
|
22279
|
-
"0x36bfdeea": "StateHashMismatch()",
|
|
22280
|
-
"0xb9d419a7": "DebtUpdateVerificationFailed()",
|
|
22281
|
-
"0xc7e20553": "DebtUpdateVerificationFailedDetailed(bytes32,uint256,uint256,uint256,uint256,uint256)",
|
|
22282
|
-
"0x0cfd2a97": "MintVerificationMismatch(uint256,uint256)",
|
|
22283
|
-
"0x07637bd8": "MintFailed()",
|
|
22284
|
-
"0x131d9a21": "QuantumExpired() - Signature quantum window has closed",
|
|
22285
|
-
"0x52ce5d58": "QuantumAlreadyUsed() - This quantum was already used for this position",
|
|
22286
|
-
"0x137f3b70": "InDeadZone() - Timestamp in dead zone (near quantum boundary)",
|
|
22287
|
-
"0xbe4b82c1": "DeadZoneViolation() - Non-current-quantum signature mined in the last 8s of the current quantum",
|
|
22288
|
-
"0x3e76a3c9": "QuantumOutsideWindow() - Timestamp not in past/current/next quantum window"
|
|
22289
|
-
};
|
|
22290
|
-
const errorName = knownErrors[selector] || `Unknown error ${selector}`;
|
|
22291
|
-
customErrorDetails = ` [${errorName}]`;
|
|
22650
|
+
const decoded = decodeContractError(error);
|
|
22651
|
+
if (decoded) {
|
|
22652
|
+
customErrorDetails = ` [${formatDecodedError(decoded)}]`;
|
|
22292
22653
|
if (this.config.debug) {
|
|
22293
22654
|
log.error("Custom error decoded from transaction receipt", {
|
|
22294
|
-
selector,
|
|
22295
|
-
errorName,
|
|
22296
|
-
|
|
22655
|
+
selector: decoded.selector,
|
|
22656
|
+
errorName: decoded.name,
|
|
22657
|
+
contract: decoded.contract
|
|
22297
22658
|
});
|
|
22298
22659
|
}
|
|
22299
22660
|
}
|
|
@@ -23365,7 +23726,7 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
|
|
|
23365
23726
|
if (!signatureBytes.startsWith("0x")) {
|
|
23366
23727
|
signatureBytes = "0x" + signatureBytes;
|
|
23367
23728
|
}
|
|
23368
|
-
const extendIface = new
|
|
23729
|
+
const extendIface = new Interface6([
|
|
23369
23730
|
"function extendPosition(bytes32 positionId, uint256 selectedTerm, uint256 quantumTimestamp, uint256 btcPrice, uint256 availableBTCBalance, uint256 proRataRenewalFee, bytes calldata extensionValidatorSignature) external returns (bool)"
|
|
23370
23731
|
]);
|
|
23371
23732
|
const extendCalldata = extendIface.encodeFunctionData("extendPosition", [
|
|
@@ -24290,7 +24651,7 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
|
|
|
24290
24651
|
const paymentSigner = this.getSignerOrThrow();
|
|
24291
24652
|
const paymentFrom = await paymentSigner.getAddress();
|
|
24292
24653
|
const paymentProvider = contractManager.getProvider();
|
|
24293
|
-
const paymentIface = new
|
|
24654
|
+
const paymentIface = new Interface6([
|
|
24294
24655
|
"function makePayment(bytes32 positionId, uint256 paymentAmount, uint256 quantumTimestamp, uint256 btcPrice, bytes calldata paymentValidatorSignature) external returns (bool)"
|
|
24295
24656
|
]);
|
|
24296
24657
|
const paymentCalldata = paymentIface.encodeFunctionData("makePayment", [
|
|
@@ -25072,7 +25433,7 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
|
|
|
25072
25433
|
utxoVout: withdrawalParams.utxoVout
|
|
25073
25434
|
});
|
|
25074
25435
|
}
|
|
25075
|
-
const withdrawIface = new
|
|
25436
|
+
const withdrawIface = new Interface6([
|
|
25076
25437
|
"function withdrawBTC((bytes32 positionId, bytes32 actionHash, bytes32 authorizedSpendsHash, bytes32 ucdDebtHash, bytes32 contractBundleHash, string withdrawalAddress, uint256 totalDeduction, uint256 newCollateral, uint256 quantumTimestamp, uint256 btcPrice, string utxoTxid, uint32 utxoVout) params, bytes withdrawalValidatorSignature, bytes btcSpendAuthSignature) external returns (bool)"
|
|
25077
25438
|
]);
|
|
25078
25439
|
const withdrawCalldata = withdrawIface.encodeFunctionData("withdrawBTC", [
|
|
@@ -26815,7 +27176,7 @@ Message: ${causeMessage}${quantumContext}${loanCapDiagnostics}${mintDebtDiagnost
|
|
|
26815
27176
|
*
|
|
26816
27177
|
* Deliberately omits `minWithdrawRatioBps` — see {@link readLoanGrant}.
|
|
26817
27178
|
*/
|
|
26818
|
-
static LOAN_GRANT_PREFIX_IFACE = new
|
|
27179
|
+
static LOAN_GRANT_PREFIX_IFACE = new Interface6([
|
|
26819
27180
|
"function getLoanGrant(bytes32 positionId) view returns (address borrower, uint32 scopeBits, uint32 minCollateralRatioBps)"
|
|
26820
27181
|
]);
|
|
26821
27182
|
/**
|
|
@@ -28429,7 +28790,7 @@ var EventHelpers = {
|
|
|
28429
28790
|
|
|
28430
28791
|
// src/utils/safe-agent-delegation.utils.ts
|
|
28431
28792
|
init_deployment_addresses();
|
|
28432
|
-
import { Contract as Contract10, Interface as
|
|
28793
|
+
import { Contract as Contract10, Interface as Interface7 } from "ethers";
|
|
28433
28794
|
var SAFE_ABI = [
|
|
28434
28795
|
"function getModulesPaginated(address start, uint256 pageSize) view returns (address[] modules, address next)"
|
|
28435
28796
|
];
|