@gearbox-protocol/sdk 14.12.0-next.65 → 14.12.0-next.66
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/cjs/dev/index.js +2 -1
- package/dist/cjs/dev/kycUtils.js +1 -1
- package/dist/cjs/dev/midasUtils.js +104 -0
- package/dist/esm/dev/AccountOpener.js +1 -1
- package/dist/esm/dev/index.js +3 -3
- package/dist/esm/dev/kycUtils.js +1 -1
- package/dist/esm/dev/midasUtils.js +105 -2
- package/dist/esm/dev/withdrawalUtils.js +1 -1
- package/dist/esm/preview/simulate/simulatePoolOperation.js +1 -1
- package/dist/esm/preview/trace/extractTransfers.js +1 -1
- package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +2 -2
- package/dist/esm/sdk/accounts/liquidations/LiquidationsService.js +1 -1
- package/dist/esm/sdk/accounts/withdrawal-compressor/RedemptionLoggerV310Contract.js +1 -1
- package/dist/esm/sdk/accounts/withdrawal-compressor/WithdrawalCompressorV310Contract.js +1 -1
- package/dist/esm/sdk/accounts/withdrawal-compressor/WithdrawalCompressorV311Contract.js +1 -1
- package/dist/esm/sdk/accounts/withdrawal-compressor/WithdrawalCompressorV313Contract.js +1 -1
- package/dist/esm/sdk/base/TokensMeta.js +2 -2
- package/dist/esm/sdk/chain/detectNetwork.js +1 -1
- package/dist/esm/sdk/core/createAddressProvider.js +1 -1
- package/dist/esm/sdk/market/credit/CreditFacadeV310BaseContract.js +1 -1
- package/dist/esm/sdk/market/pool/PoolV310Contract.js +1 -1
- package/dist/esm/sdk/market/zapper/IETHZapperContract.js +1 -1
- package/dist/esm/sdk/market/zapper/ZapperContract.js +1 -1
- package/dist/esm/sdk/pools/PoolService.js +1 -1
- package/dist/esm/sdk/utils/viem/simulateWithPriceUpdates.js +1 -1
- package/dist/types/dev/index.d.ts +2 -2
- package/dist/types/dev/midasUtils.d.ts +31 -2
- package/package.json +1 -1
package/dist/cjs/dev/index.js
CHANGED
|
@@ -2,6 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_dev_abi = require("./abi.js");
|
|
3
3
|
const require_dev_claimFromFaucet = require("./claimFromFaucet.js");
|
|
4
4
|
const require_dev_createAnvilClient = require("./createAnvilClient.js");
|
|
5
|
+
const require_dev_kycUtils = require("./kycUtils.js");
|
|
5
6
|
const require_dev_midasUtils = require("./midasUtils.js");
|
|
6
7
|
const require_dev_mint_factory = require("./mint/factory.js");
|
|
7
8
|
require("./mint/index.js");
|
|
@@ -15,7 +16,6 @@ const require_dev_detectChain = require("./detectChain.js");
|
|
|
15
16
|
const require_dev_isOutOfSyncError = require("./isOutOfSyncError.js");
|
|
16
17
|
const require_dev_isRateLimitError = require("./isRateLimitError.js");
|
|
17
18
|
const require_dev_isTransientError = require("./isTransientError.js");
|
|
18
|
-
const require_dev_kycUtils = require("./kycUtils.js");
|
|
19
19
|
const require_dev_logSplitterTransport = require("./logSplitterTransport.js");
|
|
20
20
|
const require_dev_ltUtils = require("./ltUtils.js");
|
|
21
21
|
const require_dev_migrateFaucet = require("./migrateFaucet.js");
|
|
@@ -85,5 +85,6 @@ exports.revolverTransportConfigSchema = require_dev_RevolverTransport.revolverTr
|
|
|
85
85
|
exports.rpcProvidersSchema = require_dev_providers.rpcProvidersSchema;
|
|
86
86
|
exports.setLTZero = require_dev_ltUtils.setLTZero;
|
|
87
87
|
exports.setLTs = require_dev_ltUtils.setLTs;
|
|
88
|
+
exports.unpauseMidasIssuanceVault = require_dev_midasUtils.unpauseMidasIssuanceVault;
|
|
88
89
|
exports.verifyTestnet = require_dev_verifyTestnet.verifyTestnet;
|
|
89
90
|
exports.writeAndWait = require_dev_kycUtils.writeAndWait;
|
package/dist/cjs/dev/kycUtils.js
CHANGED
|
@@ -3,9 +3,9 @@ const require_sdk_utils_AddressSet = require("../sdk/utils/AddressSet.js");
|
|
|
3
3
|
const require_sdk_constants_math = require("../sdk/constants/math.js");
|
|
4
4
|
const require_sdk_OnchainSDK = require("../sdk/OnchainSDK.js");
|
|
5
5
|
require("../sdk/index.js");
|
|
6
|
-
const require_dev_withdrawalAbi = require("./withdrawalAbi.js");
|
|
7
6
|
const require_abi_rwa_iDSRegistryService = require("../abi/rwa/iDSRegistryService.js");
|
|
8
7
|
const require_abi_rwa_iDSToken = require("../abi/rwa/iDSToken.js");
|
|
8
|
+
const require_dev_withdrawalAbi = require("./withdrawalAbi.js");
|
|
9
9
|
let viem = require("viem");
|
|
10
10
|
let viem_accounts = require("viem/accounts");
|
|
11
11
|
//#region src/dev/kycUtils.ts
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_dev_withdrawalAbi = require("./withdrawalAbi.js");
|
|
3
|
+
const require_dev_kycUtils = require("./kycUtils.js");
|
|
3
4
|
let viem = require("viem");
|
|
4
5
|
//#region src/dev/midasUtils.ts
|
|
5
6
|
const ADAPTER_MIDAS_GATEWAY = "ADAPTER::MIDAS_GATEWAY";
|
|
@@ -16,6 +17,18 @@ const MIDAS_MODE_PERMISSIONLESS = 0;
|
|
|
16
17
|
*/
|
|
17
18
|
const iMidasMTokenAbi = (0, viem.parseAbi)(["function mToken() external view returns (address)"]);
|
|
18
19
|
const iMidasGatewayAdapterExtAbi = (0, viem.parseAbi)(["function receiveGreenlist() external returns (bool)"]);
|
|
20
|
+
/**
|
|
21
|
+
* Midas vaults inherit their own `Pausable`, whose global pause is guarded by
|
|
22
|
+
* `pauseAdminRole()` in the vault's access control instead of `Ownable`
|
|
23
|
+
*/
|
|
24
|
+
const iMidasPausableVaultAbi = (0, viem.parseAbi)([
|
|
25
|
+
"function paused() external view returns (bool)",
|
|
26
|
+
"function pause() external",
|
|
27
|
+
"function unpause() external",
|
|
28
|
+
"function pauseAdminRole() external view returns (bytes32)",
|
|
29
|
+
"function accessControl() external view returns (address)"
|
|
30
|
+
]);
|
|
31
|
+
const iMidasAccessControlAbi = (0, viem.parseAbi)(["function hasRole(bytes32 role, address account) external view returns (bool)", "function grantRole(bytes32 role, address account) external"]);
|
|
19
32
|
const receiveGreenlistCallData = (0, viem.encodeFunctionData)({
|
|
20
33
|
abi: iMidasGatewayAdapterExtAbi,
|
|
21
34
|
functionName: "receiveGreenlist"
|
|
@@ -86,6 +99,96 @@ async function prependMidasReceiveGreenlist(props) {
|
|
|
86
99
|
}
|
|
87
100
|
return prepended.length > 0 ? [...prepended, ...calls] : calls;
|
|
88
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* Unpauses a globally paused Midas issuance vault on an anvil fork, so that
|
|
104
|
+
* `depositInstant` stops reverting with `Pausable: paused`, and returns a
|
|
105
|
+
* callback that restores the original pause state.
|
|
106
|
+
*
|
|
107
|
+
* Impersonates `admin` and grants it `pauseAdminRole()` when missing, same as
|
|
108
|
+
* `greenlistMidasGateway` does with the greenlist roles. The grant is not
|
|
109
|
+
* reverted by the callback, only the pause state is.
|
|
110
|
+
*/
|
|
111
|
+
async function unpauseMidasIssuanceVault(props) {
|
|
112
|
+
const { anvil, vault, admin, logger } = props;
|
|
113
|
+
if (!await anvil.readContract({
|
|
114
|
+
address: vault,
|
|
115
|
+
abi: iMidasPausableVaultAbi,
|
|
116
|
+
functionName: "paused"
|
|
117
|
+
})) {
|
|
118
|
+
logger?.debug(`midas: issuance vault ${vault} is not paused`);
|
|
119
|
+
return async () => {};
|
|
120
|
+
}
|
|
121
|
+
const [accessControl, pauseAdminRole] = await anvil.multicall({
|
|
122
|
+
allowFailure: false,
|
|
123
|
+
contracts: [{
|
|
124
|
+
address: vault,
|
|
125
|
+
abi: iMidasPausableVaultAbi,
|
|
126
|
+
functionName: "accessControl"
|
|
127
|
+
}, {
|
|
128
|
+
address: vault,
|
|
129
|
+
abi: iMidasPausableVaultAbi,
|
|
130
|
+
functionName: "pauseAdminRole"
|
|
131
|
+
}]
|
|
132
|
+
});
|
|
133
|
+
const isPauseAdmin = await anvil.readContract({
|
|
134
|
+
address: accessControl,
|
|
135
|
+
abi: iMidasAccessControlAbi,
|
|
136
|
+
functionName: "hasRole",
|
|
137
|
+
args: [pauseAdminRole, admin]
|
|
138
|
+
});
|
|
139
|
+
logger?.debug(`midas: unpausing issuance vault ${vault} as ${admin}, access control ${accessControl}, pause admin role ${pauseAdminRole}`);
|
|
140
|
+
await anvil.impersonateAccount({ address: admin });
|
|
141
|
+
try {
|
|
142
|
+
await anvil.setBalance({
|
|
143
|
+
address: admin,
|
|
144
|
+
value: (0, viem.parseEther)("100")
|
|
145
|
+
});
|
|
146
|
+
if (!isPauseAdmin) {
|
|
147
|
+
await require_dev_kycUtils.writeAndWait(anvil, {
|
|
148
|
+
account: admin,
|
|
149
|
+
chain: anvil.chain,
|
|
150
|
+
address: accessControl,
|
|
151
|
+
abi: iMidasAccessControlAbi,
|
|
152
|
+
functionName: "grantRole",
|
|
153
|
+
args: [pauseAdminRole, admin]
|
|
154
|
+
});
|
|
155
|
+
logger?.debug(`midas: granted pause admin role to ${admin}`);
|
|
156
|
+
}
|
|
157
|
+
await require_dev_kycUtils.writeAndWait(anvil, {
|
|
158
|
+
account: admin,
|
|
159
|
+
chain: anvil.chain,
|
|
160
|
+
address: vault,
|
|
161
|
+
abi: iMidasPausableVaultAbi,
|
|
162
|
+
functionName: "unpause"
|
|
163
|
+
});
|
|
164
|
+
} finally {
|
|
165
|
+
await anvil.stopImpersonatingAccount({ address: admin });
|
|
166
|
+
}
|
|
167
|
+
let toRestore = true;
|
|
168
|
+
return async () => {
|
|
169
|
+
if (!toRestore) return;
|
|
170
|
+
toRestore = false;
|
|
171
|
+
logger?.debug(`midas: pausing issuance vault ${vault} back`);
|
|
172
|
+
await anvil.impersonateAccount({ address: admin });
|
|
173
|
+
try {
|
|
174
|
+
await anvil.setBalance({
|
|
175
|
+
address: admin,
|
|
176
|
+
value: (0, viem.parseEther)("100")
|
|
177
|
+
});
|
|
178
|
+
await require_dev_kycUtils.writeAndWait(anvil, {
|
|
179
|
+
account: admin,
|
|
180
|
+
chain: anvil.chain,
|
|
181
|
+
address: vault,
|
|
182
|
+
abi: iMidasPausableVaultAbi,
|
|
183
|
+
functionName: "pause"
|
|
184
|
+
});
|
|
185
|
+
} catch (e) {
|
|
186
|
+
logger?.warn(`midas: failed to pause issuance vault ${vault} back: ${e}`);
|
|
187
|
+
} finally {
|
|
188
|
+
await anvil.stopImpersonatingAccount({ address: admin });
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
}
|
|
89
192
|
async function readMTokens(client, adapters) {
|
|
90
193
|
return await client.multicall({
|
|
91
194
|
allowFailure: false,
|
|
@@ -98,3 +201,4 @@ async function readMTokens(client, adapters) {
|
|
|
98
201
|
}
|
|
99
202
|
//#endregion
|
|
100
203
|
exports.prependMidasReceiveGreenlist = prependMidasReceiveGreenlist;
|
|
204
|
+
exports.unpauseMidasIssuanceVault = unpauseMidasIssuanceVault;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { ierc20Abi } from "../abi/iERC20.js";
|
|
1
2
|
import { iCreditFacadeV310Abi } from "../abi/310/generated.js";
|
|
2
3
|
import { AddressMap } from "../sdk/utils/AddressMap.js";
|
|
3
4
|
import { AddressSet } from "../sdk/utils/AddressSet.js";
|
|
4
5
|
import { AssetsMap } from "../sdk/utils/AssetsMap.js";
|
|
5
6
|
import { childLogger } from "../sdk/utils/childLogger.js";
|
|
6
|
-
import { ierc20Abi } from "../abi/iERC20.js";
|
|
7
7
|
import "../sdk/constants/addresses.js";
|
|
8
8
|
import { MAX_UINT256, PERCENTAGE_FACTOR } from "../sdk/constants/math.js";
|
|
9
9
|
import { SDKConstruct } from "../sdk/base/SDKConstruct.js";
|
package/dist/esm/dev/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { faucetAbi, iDegenNftv2Abi, iOnchainExecutionIdAbi, iOwnableAbi, iaclTraitAbi } from "./abi.js";
|
|
2
2
|
import { claimFromFaucet } from "./claimFromFaucet.js";
|
|
3
3
|
import { anvilNodeInfo, createAnvilClient, evmMineDetailed, extendAnvilClient, isAnvil } from "./createAnvilClient.js";
|
|
4
|
-
import {
|
|
4
|
+
import { greenlistMidasGateway, registerMidasInvestor, registerRWAInvestor, registerSecuritizeInvestor, writeAndWait } from "./kycUtils.js";
|
|
5
|
+
import { prependMidasReceiveGreenlist, unpauseMidasIssuanceVault } from "./midasUtils.js";
|
|
5
6
|
import { createMinter } from "./mint/factory.js";
|
|
6
7
|
import "./mint/index.js";
|
|
7
8
|
import { AccountOpener, OpenTxRevertedError } from "./AccountOpener.js";
|
|
@@ -14,7 +15,6 @@ import { detectChain } from "./detectChain.js";
|
|
|
14
15
|
import { isOutOfSyncError } from "./isOutOfSyncError.js";
|
|
15
16
|
import { isRateLimitError } from "./isRateLimitError.js";
|
|
16
17
|
import { isTransientError } from "./isTransientError.js";
|
|
17
|
-
import { greenlistMidasGateway, registerMidasInvestor, registerRWAInvestor, registerSecuritizeInvestor, writeAndWait } from "./kycUtils.js";
|
|
18
18
|
import { isRangeError, logSplitterTransport } from "./logSplitterTransport.js";
|
|
19
19
|
import { setLTZero, setLTs } from "./ltUtils.js";
|
|
20
20
|
import { migrateFaucet } from "./migrateFaucet.js";
|
|
@@ -25,4 +25,4 @@ import { claimDSToken, claimDSTokens, enableDSTokenBackDating } from "./securiti
|
|
|
25
25
|
import "./types.js";
|
|
26
26
|
import { ONCHAIN_EXECUTION_ID_ADDRESS, verifyTestnet } from "./verifyTestnet.js";
|
|
27
27
|
import { makePendingWithdrawalsClaimable } from "./withdrawalUtils.js";
|
|
28
|
-
export { AccountOpener, Create2Deployer, DEFAULT_CREATE2_SALT, EthCallSpy, NoAvailableTransportsError, ONCHAIN_EXECUTION_ID_ADDRESS, OpenTxRevertedError, PUBLIC_CREATE2_FACTORY, RevolverTransport, SUPPORTED_RPC_PROVIDERS, SelectionStrategy, anvilNodeInfo, calcLiquidatableLTs, claimDSToken, claimDSTokens, claimFromFaucet, createAnvilClient, createMinter, deployUsingPublicCreate2, detectChain, enableDSTokenBackDating, evmMineDetailed, extendAnvilClient, faucetAbi, getAlchemyUrl, getAnkrUrl, getDrpcUrl, getErpcKey, getPublicCreate2Address, getRpcProviderUrl, getThirdWebUrl, greenlistMidasGateway, httpTransportOptionsSchema, iDegenNftv2Abi, iOnchainExecutionIdAbi, iOwnableAbi, iaclTraitAbi, isAnvil, isDeployedUsingPublicCreate2, isOutOfSyncError, isRangeError, isRateLimitError, isTransientError, logSplitterTransport, makePendingWithdrawalsClaimable, migrateFaucet, prependMidasReceiveGreenlist, providerConfigSchema, registerMidasInvestor, registerRWAInvestor, registerSecuritizeInvestor, replaceStorage, resilientTransport, resilientTransportOptionsSchema, revolverTransportConfigBaseSchema, revolverTransportConfigSchema, rpcProvidersSchema, setLTZero, setLTs, verifyTestnet, writeAndWait };
|
|
28
|
+
export { AccountOpener, Create2Deployer, DEFAULT_CREATE2_SALT, EthCallSpy, NoAvailableTransportsError, ONCHAIN_EXECUTION_ID_ADDRESS, OpenTxRevertedError, PUBLIC_CREATE2_FACTORY, RevolverTransport, SUPPORTED_RPC_PROVIDERS, SelectionStrategy, anvilNodeInfo, calcLiquidatableLTs, claimDSToken, claimDSTokens, claimFromFaucet, createAnvilClient, createMinter, deployUsingPublicCreate2, detectChain, enableDSTokenBackDating, evmMineDetailed, extendAnvilClient, faucetAbi, getAlchemyUrl, getAnkrUrl, getDrpcUrl, getErpcKey, getPublicCreate2Address, getRpcProviderUrl, getThirdWebUrl, greenlistMidasGateway, httpTransportOptionsSchema, iDegenNftv2Abi, iOnchainExecutionIdAbi, iOwnableAbi, iaclTraitAbi, isAnvil, isDeployedUsingPublicCreate2, isOutOfSyncError, isRangeError, isRateLimitError, isTransientError, logSplitterTransport, makePendingWithdrawalsClaimable, migrateFaucet, prependMidasReceiveGreenlist, providerConfigSchema, registerMidasInvestor, registerRWAInvestor, registerSecuritizeInvestor, replaceStorage, resilientTransport, resilientTransportOptionsSchema, revolverTransportConfigBaseSchema, revolverTransportConfigSchema, rpcProvidersSchema, setLTZero, setLTs, unpauseMidasIssuanceVault, verifyTestnet, writeAndWait };
|
package/dist/esm/dev/kycUtils.js
CHANGED
|
@@ -2,9 +2,9 @@ import { AddressSet } from "../sdk/utils/AddressSet.js";
|
|
|
2
2
|
import { MAX_UINT256 } from "../sdk/constants/math.js";
|
|
3
3
|
import { OnchainSDK } from "../sdk/OnchainSDK.js";
|
|
4
4
|
import "../sdk/index.js";
|
|
5
|
-
import { midasGatewayAbi } from "./withdrawalAbi.js";
|
|
6
5
|
import { iDSRegistryServiceAbi } from "../abi/rwa/iDSRegistryService.js";
|
|
7
6
|
import { iDSTokenAbi } from "../abi/rwa/iDSToken.js";
|
|
7
|
+
import { midasGatewayAbi } from "./withdrawalAbi.js";
|
|
8
8
|
import { isAddressEqual, parseAbi, parseEther, zeroAddress } from "viem";
|
|
9
9
|
import { privateKeyToAccount } from "viem/accounts";
|
|
10
10
|
//#region src/dev/kycUtils.ts
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { midasGatewayAbi } from "./withdrawalAbi.js";
|
|
2
|
-
import {
|
|
2
|
+
import { writeAndWait } from "./kycUtils.js";
|
|
3
|
+
import { encodeFunctionData, isAddressEqual, parseAbi, parseEther } from "viem";
|
|
3
4
|
//#region src/dev/midasUtils.ts
|
|
4
5
|
const ADAPTER_MIDAS_GATEWAY = "ADAPTER::MIDAS_GATEWAY";
|
|
5
6
|
const ADAPTER_MIDAS_ISSUANCE_VAULT = "ADAPTER::MIDAS_ISSUANCE_VAULT";
|
|
@@ -15,6 +16,18 @@ const MIDAS_MODE_PERMISSIONLESS = 0;
|
|
|
15
16
|
*/
|
|
16
17
|
const iMidasMTokenAbi = parseAbi(["function mToken() external view returns (address)"]);
|
|
17
18
|
const iMidasGatewayAdapterExtAbi = parseAbi(["function receiveGreenlist() external returns (bool)"]);
|
|
19
|
+
/**
|
|
20
|
+
* Midas vaults inherit their own `Pausable`, whose global pause is guarded by
|
|
21
|
+
* `pauseAdminRole()` in the vault's access control instead of `Ownable`
|
|
22
|
+
*/
|
|
23
|
+
const iMidasPausableVaultAbi = parseAbi([
|
|
24
|
+
"function paused() external view returns (bool)",
|
|
25
|
+
"function pause() external",
|
|
26
|
+
"function unpause() external",
|
|
27
|
+
"function pauseAdminRole() external view returns (bytes32)",
|
|
28
|
+
"function accessControl() external view returns (address)"
|
|
29
|
+
]);
|
|
30
|
+
const iMidasAccessControlAbi = parseAbi(["function hasRole(bytes32 role, address account) external view returns (bool)", "function grantRole(bytes32 role, address account) external"]);
|
|
18
31
|
const receiveGreenlistCallData = encodeFunctionData({
|
|
19
32
|
abi: iMidasGatewayAdapterExtAbi,
|
|
20
33
|
functionName: "receiveGreenlist"
|
|
@@ -85,6 +98,96 @@ async function prependMidasReceiveGreenlist(props) {
|
|
|
85
98
|
}
|
|
86
99
|
return prepended.length > 0 ? [...prepended, ...calls] : calls;
|
|
87
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* Unpauses a globally paused Midas issuance vault on an anvil fork, so that
|
|
103
|
+
* `depositInstant` stops reverting with `Pausable: paused`, and returns a
|
|
104
|
+
* callback that restores the original pause state.
|
|
105
|
+
*
|
|
106
|
+
* Impersonates `admin` and grants it `pauseAdminRole()` when missing, same as
|
|
107
|
+
* `greenlistMidasGateway` does with the greenlist roles. The grant is not
|
|
108
|
+
* reverted by the callback, only the pause state is.
|
|
109
|
+
*/
|
|
110
|
+
async function unpauseMidasIssuanceVault(props) {
|
|
111
|
+
const { anvil, vault, admin, logger } = props;
|
|
112
|
+
if (!await anvil.readContract({
|
|
113
|
+
address: vault,
|
|
114
|
+
abi: iMidasPausableVaultAbi,
|
|
115
|
+
functionName: "paused"
|
|
116
|
+
})) {
|
|
117
|
+
logger?.debug(`midas: issuance vault ${vault} is not paused`);
|
|
118
|
+
return async () => {};
|
|
119
|
+
}
|
|
120
|
+
const [accessControl, pauseAdminRole] = await anvil.multicall({
|
|
121
|
+
allowFailure: false,
|
|
122
|
+
contracts: [{
|
|
123
|
+
address: vault,
|
|
124
|
+
abi: iMidasPausableVaultAbi,
|
|
125
|
+
functionName: "accessControl"
|
|
126
|
+
}, {
|
|
127
|
+
address: vault,
|
|
128
|
+
abi: iMidasPausableVaultAbi,
|
|
129
|
+
functionName: "pauseAdminRole"
|
|
130
|
+
}]
|
|
131
|
+
});
|
|
132
|
+
const isPauseAdmin = await anvil.readContract({
|
|
133
|
+
address: accessControl,
|
|
134
|
+
abi: iMidasAccessControlAbi,
|
|
135
|
+
functionName: "hasRole",
|
|
136
|
+
args: [pauseAdminRole, admin]
|
|
137
|
+
});
|
|
138
|
+
logger?.debug(`midas: unpausing issuance vault ${vault} as ${admin}, access control ${accessControl}, pause admin role ${pauseAdminRole}`);
|
|
139
|
+
await anvil.impersonateAccount({ address: admin });
|
|
140
|
+
try {
|
|
141
|
+
await anvil.setBalance({
|
|
142
|
+
address: admin,
|
|
143
|
+
value: parseEther("100")
|
|
144
|
+
});
|
|
145
|
+
if (!isPauseAdmin) {
|
|
146
|
+
await writeAndWait(anvil, {
|
|
147
|
+
account: admin,
|
|
148
|
+
chain: anvil.chain,
|
|
149
|
+
address: accessControl,
|
|
150
|
+
abi: iMidasAccessControlAbi,
|
|
151
|
+
functionName: "grantRole",
|
|
152
|
+
args: [pauseAdminRole, admin]
|
|
153
|
+
});
|
|
154
|
+
logger?.debug(`midas: granted pause admin role to ${admin}`);
|
|
155
|
+
}
|
|
156
|
+
await writeAndWait(anvil, {
|
|
157
|
+
account: admin,
|
|
158
|
+
chain: anvil.chain,
|
|
159
|
+
address: vault,
|
|
160
|
+
abi: iMidasPausableVaultAbi,
|
|
161
|
+
functionName: "unpause"
|
|
162
|
+
});
|
|
163
|
+
} finally {
|
|
164
|
+
await anvil.stopImpersonatingAccount({ address: admin });
|
|
165
|
+
}
|
|
166
|
+
let toRestore = true;
|
|
167
|
+
return async () => {
|
|
168
|
+
if (!toRestore) return;
|
|
169
|
+
toRestore = false;
|
|
170
|
+
logger?.debug(`midas: pausing issuance vault ${vault} back`);
|
|
171
|
+
await anvil.impersonateAccount({ address: admin });
|
|
172
|
+
try {
|
|
173
|
+
await anvil.setBalance({
|
|
174
|
+
address: admin,
|
|
175
|
+
value: parseEther("100")
|
|
176
|
+
});
|
|
177
|
+
await writeAndWait(anvil, {
|
|
178
|
+
account: admin,
|
|
179
|
+
chain: anvil.chain,
|
|
180
|
+
address: vault,
|
|
181
|
+
abi: iMidasPausableVaultAbi,
|
|
182
|
+
functionName: "pause"
|
|
183
|
+
});
|
|
184
|
+
} catch (e) {
|
|
185
|
+
logger?.warn(`midas: failed to pause issuance vault ${vault} back: ${e}`);
|
|
186
|
+
} finally {
|
|
187
|
+
await anvil.stopImpersonatingAccount({ address: admin });
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
}
|
|
88
191
|
async function readMTokens(client, adapters) {
|
|
89
192
|
return await client.multicall({
|
|
90
193
|
allowFailure: false,
|
|
@@ -96,4 +199,4 @@ async function readMTokens(client, adapters) {
|
|
|
96
199
|
});
|
|
97
200
|
}
|
|
98
201
|
//#endregion
|
|
99
|
-
export { prependMidasReceiveGreenlist };
|
|
202
|
+
export { prependMidasReceiveGreenlist, unpauseMidasIssuanceVault };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { iWithdrawalCompressorV313Abi } from "../abi/IWithdrawalCompressorV313.js";
|
|
1
2
|
import { getNetworkType } from "../sdk/chain/chains.js";
|
|
2
3
|
import { getWithdrawalCompressorAddress } from "../sdk/accounts/withdrawal-compressor/addresses.js";
|
|
3
|
-
import { iWithdrawalCompressorV313Abi } from "../abi/IWithdrawalCompressorV313.js";
|
|
4
4
|
import "../sdk/index.js";
|
|
5
5
|
import { iMidasDataFeedAbi, iMidasRedemptionVaultAbi, midasGatewayAbi, midasRedeemerAbi, midasRedemptionVaultPhantomTokenAbi, securitizeRedeemerAbi, securitizeRedemptionGatewayAbi, securitizeRedemptionPhantomTokenAbi } from "./withdrawalAbi.js";
|
|
6
6
|
import { erc20Abi, hexToString, parseAbi, parseEther } from "viem";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { iPoolV310Abi } from "../../abi/310/generated.js";
|
|
2
1
|
import { iZapperAbi } from "../../abi/iZapper.js";
|
|
2
|
+
import { iPoolV310Abi } from "../../abi/310/generated.js";
|
|
3
3
|
import { asPreviewSimulationError } from "./errors.js";
|
|
4
4
|
//#region src/preview/simulate/simulatePoolOperation.ts
|
|
5
5
|
function previewRead(operation) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { ierc20Abi } from "../../abi/iERC20.js";
|
|
1
2
|
import { iCreditFacadeV310Abi } from "../../abi/310/generated.js";
|
|
2
3
|
import { AddressMap } from "../../sdk/utils/AddressMap.js";
|
|
3
|
-
import { ierc20Abi } from "../../abi/iERC20.js";
|
|
4
4
|
import "../../sdk/index.js";
|
|
5
5
|
import { UnexpectedFacadeEventOrderError } from "./errors.js";
|
|
6
6
|
import { getAddress, isAddressEqual, parseEventLogs } from "viem";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { iBaseRewardPoolAbi } from "../../abi/iBaseRewardPool.js";
|
|
2
|
+
import { ierc4626AdapterAbi } from "../../abi/ierc4626Adapter.js";
|
|
1
3
|
import { iBotListV310Abi, iCreditFacadeMulticallV310Abi } from "../../abi/310/generated.js";
|
|
2
4
|
import { creditAccountCompressorAbi } from "../../abi/compressors/creditAccountCompressor.js";
|
|
3
5
|
import { peripheryCompressorAbi } from "../../abi/compressors/peripheryCompressor.js";
|
|
4
6
|
import { rewardsCompressorAbi } from "../../abi/compressors/rewardsCompressor.js";
|
|
5
|
-
import { iBaseRewardPoolAbi } from "../../abi/iBaseRewardPool.js";
|
|
6
|
-
import { ierc4626AdapterAbi } from "../../abi/ierc4626Adapter.js";
|
|
7
7
|
import { iRWAFactoryAbi } from "../../abi/rwa/iRWAFactory.js";
|
|
8
8
|
import { AddressMap } from "../utils/AddressMap.js";
|
|
9
9
|
import { AddressSet } from "../utils/AddressSet.js";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { iLiquidationCompressorV313Abi } from "../../../abi/ILiquidationCompressorV313.js";
|
|
1
2
|
import { AddressSet } from "../../utils/AddressSet.js";
|
|
2
3
|
import { bytes32ToString } from "../../utils/bytes32ToString.js";
|
|
3
4
|
import { ADDRESS_0X0 } from "../../constants/addresses.js";
|
|
@@ -14,7 +15,6 @@ import { RWA_LIQUIDATOR_SECURITIZE } from "../../market/rwa/securitize/constants
|
|
|
14
15
|
import { SecuritizeLiquidatorContract } from "../../market/rwa/securitize/SecuritizeLiquidatorContract.js";
|
|
15
16
|
import "../../market/rwa/securitize/index.js";
|
|
16
17
|
import { LIQUIDATION_COMPRESSOR_V313_ADDRESS } from "./constants.js";
|
|
17
|
-
import { iLiquidationCompressorV313Abi } from "../../../abi/ILiquidationCompressorV313.js";
|
|
18
18
|
import { calcEstimatedProfit, calcRepaymentAmount, liquidationCallToRawTx, pickMainAsset, toLiquidationApproval, toLiquidatorWithdrawals, toReceivedAssets } from "./helpers.js";
|
|
19
19
|
//#region src/sdk/accounts/liquidations/LiquidationsService.ts
|
|
20
20
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { iRedemptionLoggerV310Abi } from "../../../abi/iRedemptionLoggerV310.js";
|
|
1
2
|
import { BaseContract } from "../../base/BaseContract.js";
|
|
2
3
|
import "../../base/index.js";
|
|
3
4
|
import { decodeDelayedIntent } from "./intent-codec.js";
|
|
4
|
-
import { iRedemptionLoggerV310Abi } from "../../../abi/iRedemptionLoggerV310.js";
|
|
5
5
|
import { InvalidDelayedIntentError } from "./errors.js";
|
|
6
6
|
//#region src/sdk/accounts/withdrawal-compressor/RedemptionLoggerV310Contract.ts
|
|
7
7
|
const abi = iRedemptionLoggerV310Abi;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AbstractWithdrawalCompressorContract } from "./AbstractWithdrawalCompressorContract.js";
|
|
2
1
|
import { iWithdrawalCompressorV310Abi } from "../../../abi/IWithdrawalCompressorV310.js";
|
|
2
|
+
import { AbstractWithdrawalCompressorContract } from "./AbstractWithdrawalCompressorContract.js";
|
|
3
3
|
//#region src/sdk/accounts/withdrawal-compressor/WithdrawalCompressorV310Contract.ts
|
|
4
4
|
const abi = iWithdrawalCompressorV310Abi;
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AbstractWithdrawalCompressorContract } from "./AbstractWithdrawalCompressorContract.js";
|
|
2
1
|
import { iWithdrawalCompressorV311Abi } from "../../../abi/IWithdrawalCompressorV311.js";
|
|
2
|
+
import { AbstractWithdrawalCompressorContract } from "./AbstractWithdrawalCompressorContract.js";
|
|
3
3
|
//#region src/sdk/accounts/withdrawal-compressor/WithdrawalCompressorV311Contract.ts
|
|
4
4
|
const abi = iWithdrawalCompressorV311Abi;
|
|
5
5
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { iWithdrawalCompressorV313Abi } from "../../../abi/IWithdrawalCompressorV313.js";
|
|
1
2
|
import { encodeDelayedIntent } from "./intent-codec.js";
|
|
2
3
|
import { AbstractWithdrawalCompressorContract, iCreditAccountAbi, toClaimableWithdrawal, toPendingWithdrawal, toRequestableWithdrawal } from "./AbstractWithdrawalCompressorContract.js";
|
|
3
|
-
import { iWithdrawalCompressorV313Abi } from "../../../abi/IWithdrawalCompressorV313.js";
|
|
4
4
|
import { toWithdrawalStatus } from "./types.js";
|
|
5
5
|
//#region src/sdk/accounts/withdrawal-compressor/WithdrawalCompressorV313Contract.ts
|
|
6
6
|
const abi = iWithdrawalCompressorV313Abi;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { iStateSerializerAbi } from "../../abi/iStateSerializer.js";
|
|
2
|
+
import { iVersionAbi } from "../../abi/iVersion.js";
|
|
1
3
|
import { AddressMap } from "../utils/AddressMap.js";
|
|
2
4
|
import { AddressSet } from "../utils/AddressSet.js";
|
|
3
5
|
import { bytes32ToString } from "../utils/bytes32ToString.js";
|
|
4
6
|
import { formatBN } from "../utils/formatter.js";
|
|
5
7
|
import "../utils/index.js";
|
|
6
|
-
import { iStateSerializerAbi } from "../../abi/iStateSerializer.js";
|
|
7
|
-
import { iVersionAbi } from "../../abi/iVersion.js";
|
|
8
8
|
//#region src/sdk/base/TokensMeta.ts
|
|
9
9
|
/**
|
|
10
10
|
* Registry of token metadata (symbol, decimals, phantom type) keyed by address.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { iVersionAbi } from "../../abi/iVersion.js";
|
|
1
2
|
import { AP_MARKET_COMPRESSOR, AP_PRICE_FEED_COMPRESSOR } from "../constants/address-provider.js";
|
|
2
3
|
import { isV310 } from "../constants/versions.js";
|
|
3
4
|
import "../constants/index.js";
|
|
4
5
|
import { hexEq } from "../utils/hex.js";
|
|
5
|
-
import { iVersionAbi } from "../../abi/iVersion.js";
|
|
6
6
|
import { AddressProviderV310Contract } from "./AddressProviderV310Contract.js";
|
|
7
7
|
//#region src/sdk/core/createAddressProvider.ts
|
|
8
8
|
const OVERRIDE_ADDRESSES = { Mainnet: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { iPausableAbi } from "../../../abi/iPausable.js";
|
|
1
2
|
import { iCreditFacadeMulticallV310Abi, iCreditFacadeV310Abi } from "../../../abi/310/generated.js";
|
|
2
3
|
import { BaseContract } from "../../base/BaseContract.js";
|
|
3
4
|
import "../../base/index.js";
|
|
4
|
-
import { iPausableAbi } from "../../../abi/iPausable.js";
|
|
5
5
|
//#region src/sdk/market/credit/CreditFacadeV310BaseContract.ts
|
|
6
6
|
const abi = [
|
|
7
7
|
...iCreditFacadeV310Abi,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { iPausableAbi } from "../../../abi/iPausable.js";
|
|
1
2
|
import { iPoolV310Abi } from "../../../abi/310/generated.js";
|
|
2
3
|
import { AddressMap } from "../../utils/AddressMap.js";
|
|
3
4
|
import { formatBN, formatBNvalue, percentFmt } from "../../utils/formatter.js";
|
|
4
5
|
import "../../utils/index.js";
|
|
5
6
|
import { BaseContract } from "../../base/BaseContract.js";
|
|
6
7
|
import "../../base/index.js";
|
|
7
|
-
import { iPausableAbi } from "../../../abi/iPausable.js";
|
|
8
8
|
//#region src/sdk/market/pool/PoolV310Contract.ts
|
|
9
9
|
const abi = [...iPoolV310Abi, ...iPausableAbi];
|
|
10
10
|
var PoolV310Contract = class extends BaseContract {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ZapperContract } from "./ZapperContract.js";
|
|
2
1
|
import { iethZapperAbi } from "../../../abi/iETHZapper.js";
|
|
2
|
+
import { ZapperContract } from "./ZapperContract.js";
|
|
3
3
|
//#region src/sdk/market/zapper/IETHZapperContract.ts
|
|
4
4
|
const abi = iethZapperAbi;
|
|
5
5
|
var IETHZapperContract = class extends ZapperContract {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { iZapperAbi } from "../../../abi/iZapper.js";
|
|
1
2
|
import { BaseContract } from "../../base/BaseContract.js";
|
|
2
3
|
import "../../base/index.js";
|
|
3
|
-
import { iZapperAbi } from "../../../abi/iZapper.js";
|
|
4
4
|
import { UnsupportedZapperFunctionError } from "./errors.js";
|
|
5
5
|
//#region src/sdk/market/zapper/ZapperContract.ts
|
|
6
6
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AddressSet } from "../utils/AddressSet.js";
|
|
2
1
|
import { ierc20Abi } from "../../abi/iERC20.js";
|
|
2
|
+
import { AddressSet } from "../utils/AddressSet.js";
|
|
3
3
|
import "../constants/addresses.js";
|
|
4
4
|
import "../constants/index.js";
|
|
5
5
|
import { hexEq } from "../utils/hex.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { errorAbis } from "../../../abi/errors.js";
|
|
2
|
-
import { generateCastTraceCall } from "./cast.js";
|
|
3
2
|
import { iUpdatablePriceFeedAbi } from "../../../abi/iUpdatablePriceFeed.js";
|
|
3
|
+
import { generateCastTraceCall } from "./cast.js";
|
|
4
4
|
import { simulateMulticall } from "./simulateMulticall.js";
|
|
5
5
|
import { BaseError, CallExecutionError, ContractFunctionRevertedError, decodeFunctionData, decodeFunctionResult, encodeFunctionData, parseAbi } from "viem";
|
|
6
6
|
import { getAction, parseAccount } from "viem/utils";
|
|
@@ -14,7 +14,7 @@ import { isTransientError } from "./isTransientError.js";
|
|
|
14
14
|
import { GreenlistMidasGatewayProps, RWAKycFailure, RegisterMidasInvestorProps, RegisterRWAInvestorProps, RegisterRWAInvestorResult, RegisterSecuritizeInvestorProps, greenlistMidasGateway, registerMidasInvestor, registerRWAInvestor, registerSecuritizeInvestor, writeAndWait } from "./kycUtils.js";
|
|
15
15
|
import { LogSplitterTransportOptions, isRangeError, logSplitterTransport } from "./logSplitterTransport.js";
|
|
16
16
|
import { setLTZero, setLTs } from "./ltUtils.js";
|
|
17
|
-
import { PrependMidasReceiveGreenlistProps, prependMidasReceiveGreenlist } from "./midasUtils.js";
|
|
17
|
+
import { PrependMidasReceiveGreenlistProps, RestoreMidasIssuanceVaultPause, UnpauseMidasIssuanceVaultProps, prependMidasReceiveGreenlist, unpauseMidasIssuanceVault } from "./midasUtils.js";
|
|
18
18
|
import { migrateFaucet } from "./migrateFaucet.js";
|
|
19
19
|
import { IMinter } from "./mint/types.js";
|
|
20
20
|
import { createMinter } from "./mint/factory.js";
|
|
@@ -26,4 +26,4 @@ import { EnableDSTokenBackDatingProps, RestoreDSTokenBackDating, claimDSToken, c
|
|
|
26
26
|
import { httpTransportOptionsSchema } from "./transports.js";
|
|
27
27
|
import { ONCHAIN_EXECUTION_ID_ADDRESS, VerifyTestnetParams, verifyTestnet } from "./verifyTestnet.js";
|
|
28
28
|
import { MakePendingWithdrawalsClaimableOptions, makePendingWithdrawalsClaimable } from "./withdrawalUtils.js";
|
|
29
|
-
export { AccountOpener, AccountOpenerOptions, AnvilActions, AnvilClient, AnvilClientConfig, AnvilDealParameters, AnvilNodeInfo, AnvilRPCSchema, CheckMulticallFn, Create2Deployer, Create2Parameters, DEFAULT_CREATE2_SALT, DetectedCall, EnableDSTokenBackDatingProps, EnsureExistsUsingPublicCreate2ReturnType, EthCallMethod, EthCallRequest, EthCallSpy, GetCreate2AddressParameters, GreenlistMidasGatewayProps, IMinter, type LogSplitterTransportOptions, MakePendingWithdrawalsClaimableOptions, NoAvailableTransportsError, ONCHAIN_EXECUTION_ID_ADDRESS, OpenAccountHumanizedPreview, OpenAccountResult, OpenAccountsResult, OpenTxRevertedError, PUBLIC_CREATE2_FACTORY, PoolDepositResult, PrependMidasReceiveGreenlistProps, ProviderConfig, ProviderStatus, RWAKycFailure, RegisterMidasInvestorProps, RegisterRWAInvestorProps, RegisterRWAInvestorResult, RegisterSecuritizeInvestorProps, ReplaceStorageParams, ResilientTransportOptions, RestoreDSTokenBackDating, RevolverTransport, RevolverTransportConfig, RevolverTransportValue, RpcErrorResult, RpcProvider, RpcResponse, RpcSuccessResult, SUPPORTED_RPC_PROVIDERS, SelectionStrategy, TargetAccount, VerifyTestnetParams, anvilNodeInfo, calcLiquidatableLTs, claimDSToken, claimDSTokens, claimFromFaucet, createAnvilClient, createMinter, deployUsingPublicCreate2, detectChain, enableDSTokenBackDating, evmMineDetailed, extendAnvilClient, faucetAbi, getAlchemyUrl, getAnkrUrl, getDrpcUrl, getErpcKey, getPublicCreate2Address, getRpcProviderUrl, getThirdWebUrl, greenlistMidasGateway, httpTransportOptionsSchema, iDegenNftv2Abi, iOnchainExecutionIdAbi, iOwnableAbi, iaclTraitAbi, isAnvil, isDeployedUsingPublicCreate2, isOutOfSyncError, isRangeError, isRateLimitError, isTransientError, logSplitterTransport, makePendingWithdrawalsClaimable, migrateFaucet, prependMidasReceiveGreenlist, providerConfigSchema, registerMidasInvestor, registerRWAInvestor, registerSecuritizeInvestor, replaceStorage, resilientTransport, resilientTransportOptionsSchema, revolverTransportConfigBaseSchema, revolverTransportConfigSchema, rpcProvidersSchema, setLTZero, setLTs, verifyTestnet, writeAndWait };
|
|
29
|
+
export { AccountOpener, AccountOpenerOptions, AnvilActions, AnvilClient, AnvilClientConfig, AnvilDealParameters, AnvilNodeInfo, AnvilRPCSchema, CheckMulticallFn, Create2Deployer, Create2Parameters, DEFAULT_CREATE2_SALT, DetectedCall, EnableDSTokenBackDatingProps, EnsureExistsUsingPublicCreate2ReturnType, EthCallMethod, EthCallRequest, EthCallSpy, GetCreate2AddressParameters, GreenlistMidasGatewayProps, IMinter, type LogSplitterTransportOptions, MakePendingWithdrawalsClaimableOptions, NoAvailableTransportsError, ONCHAIN_EXECUTION_ID_ADDRESS, OpenAccountHumanizedPreview, OpenAccountResult, OpenAccountsResult, OpenTxRevertedError, PUBLIC_CREATE2_FACTORY, PoolDepositResult, PrependMidasReceiveGreenlistProps, ProviderConfig, ProviderStatus, RWAKycFailure, RegisterMidasInvestorProps, RegisterRWAInvestorProps, RegisterRWAInvestorResult, RegisterSecuritizeInvestorProps, ReplaceStorageParams, ResilientTransportOptions, RestoreDSTokenBackDating, RestoreMidasIssuanceVaultPause, RevolverTransport, RevolverTransportConfig, RevolverTransportValue, RpcErrorResult, RpcProvider, RpcResponse, RpcSuccessResult, SUPPORTED_RPC_PROVIDERS, SelectionStrategy, TargetAccount, UnpauseMidasIssuanceVaultProps, VerifyTestnetParams, anvilNodeInfo, calcLiquidatableLTs, claimDSToken, claimDSTokens, claimFromFaucet, createAnvilClient, createMinter, deployUsingPublicCreate2, detectChain, enableDSTokenBackDating, evmMineDetailed, extendAnvilClient, faucetAbi, getAlchemyUrl, getAnkrUrl, getDrpcUrl, getErpcKey, getPublicCreate2Address, getRpcProviderUrl, getThirdWebUrl, greenlistMidasGateway, httpTransportOptionsSchema, iDegenNftv2Abi, iOnchainExecutionIdAbi, iOwnableAbi, iaclTraitAbi, isAnvil, isDeployedUsingPublicCreate2, isOutOfSyncError, isRangeError, isRateLimitError, isTransientError, logSplitterTransport, makePendingWithdrawalsClaimable, migrateFaucet, prependMidasReceiveGreenlist, providerConfigSchema, registerMidasInvestor, registerRWAInvestor, registerSecuritizeInvestor, replaceStorage, resilientTransport, resilientTransportOptionsSchema, revolverTransportConfigBaseSchema, revolverTransportConfigSchema, rpcProvidersSchema, setLTZero, setLTs, unpauseMidasIssuanceVault, verifyTestnet, writeAndWait };
|
|
@@ -2,7 +2,8 @@ import { ILogger } from "../sdk/types/logger.js";
|
|
|
2
2
|
import { CreditSuite } from "../sdk/market/credit/CreditSuite.js";
|
|
3
3
|
import { MultiCall } from "../sdk/types/transactions.js";
|
|
4
4
|
import "../sdk/index.js";
|
|
5
|
-
import {
|
|
5
|
+
import { AnvilClient } from "./createAnvilClient.js";
|
|
6
|
+
import { Address, PublicClient } from "viem";
|
|
6
7
|
//#region src/dev/midasUtils.d.ts
|
|
7
8
|
interface PrependMidasReceiveGreenlistProps {
|
|
8
9
|
/**
|
|
@@ -35,5 +36,33 @@ interface PrependMidasReceiveGreenlistProps {
|
|
|
35
36
|
* the gateway is permissionless, or the call is already there.
|
|
36
37
|
*/
|
|
37
38
|
declare function prependMidasReceiveGreenlist(props: PrependMidasReceiveGreenlistProps): Promise<MultiCall[]>;
|
|
39
|
+
interface UnpauseMidasIssuanceVaultProps {
|
|
40
|
+
anvil: AnvilClient;
|
|
41
|
+
/**
|
|
42
|
+
* Midas issuance vault (deposit vault) to unpause
|
|
43
|
+
*/
|
|
44
|
+
vault: Address;
|
|
45
|
+
/**
|
|
46
|
+
* Midas access control admin, impersonated on the fork
|
|
47
|
+
* (MIDAS_ACL_ADMIN in periphery-v3/router-v3 foundry tests)
|
|
48
|
+
*/
|
|
49
|
+
admin: Address;
|
|
50
|
+
logger?: ILogger;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Pauses the vault back when it was unpaused by `unpauseMidasIssuanceVault`,
|
|
54
|
+
* and does nothing otherwise. Safe to call more than once.
|
|
55
|
+
*/
|
|
56
|
+
type RestoreMidasIssuanceVaultPause = () => Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Unpauses a globally paused Midas issuance vault on an anvil fork, so that
|
|
59
|
+
* `depositInstant` stops reverting with `Pausable: paused`, and returns a
|
|
60
|
+
* callback that restores the original pause state.
|
|
61
|
+
*
|
|
62
|
+
* Impersonates `admin` and grants it `pauseAdminRole()` when missing, same as
|
|
63
|
+
* `greenlistMidasGateway` does with the greenlist roles. The grant is not
|
|
64
|
+
* reverted by the callback, only the pause state is.
|
|
65
|
+
*/
|
|
66
|
+
declare function unpauseMidasIssuanceVault(props: UnpauseMidasIssuanceVaultProps): Promise<RestoreMidasIssuanceVaultPause>;
|
|
38
67
|
//#endregion
|
|
39
|
-
export { PrependMidasReceiveGreenlistProps, prependMidasReceiveGreenlist };
|
|
68
|
+
export { PrependMidasReceiveGreenlistProps, RestoreMidasIssuanceVaultPause, UnpauseMidasIssuanceVaultProps, prependMidasReceiveGreenlist, unpauseMidasIssuanceVault };
|