@hyperlane-xyz/cli 25.4.0 → 25.5.0
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/bundle/index.js +1011 -1184
- package/package.json +13 -13
package/bundle/index.js
CHANGED
|
@@ -596241,6 +596241,9 @@ class AleoWarpArtifactManager {
|
|
|
596241
596241
|
this.aleoClient = aleoClient;
|
|
596242
596242
|
this.onChainArtifactManagers = onChainArtifactManagers;
|
|
596243
596243
|
}
|
|
596244
|
+
supportsHookUpdates() {
|
|
596245
|
+
return true;
|
|
596246
|
+
}
|
|
596244
596247
|
async readWarpToken(address) {
|
|
596245
596248
|
// Detect warp token type first
|
|
596246
596249
|
const aleoTokenType = await (0,_warp_query_js__WEBPACK_IMPORTED_MODULE_4__/* .getAleoWarpTokenType */ .D1)(this.aleoClient, address);
|
|
@@ -601430,7 +601433,7 @@ __nccwpck_require__.a(__webpack_module__, async (__webpack_handle_async_dependen
|
|
|
601430
601433
|
/* harmony export */ });
|
|
601431
601434
|
/* unused harmony export getContext */
|
|
601432
601435
|
/* harmony import */ var _inquirer_prompts__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(98720);
|
|
601433
|
-
/* harmony import */ var _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(
|
|
601436
|
+
/* harmony import */ var _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(78272);
|
|
601434
601437
|
/* harmony import */ var _hyperlane_xyz_provider_sdk__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(18951);
|
|
601435
601438
|
/* harmony import */ var _hyperlane_xyz_registry_fs__WEBPACK_IMPORTED_MODULE_12__ = __nccwpck_require__(40384);
|
|
601436
601439
|
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_14__ = __nccwpck_require__(97480);
|
|
@@ -602248,11 +602251,12 @@ const SignerKeyProtocolMapSchema = zod__WEBPACK_IMPORTED_MODULE_0__/* .record */
|
|
|
602248
602251
|
__nccwpck_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
|
602249
602252
|
/* harmony export */ __nccwpck_require__.d(__webpack_exports__, {
|
|
602250
602253
|
/* harmony export */ d: () => (/* binding */ validateCoreConfigForAltVM),
|
|
602251
|
-
/* harmony export */ u: () => (/*
|
|
602254
|
+
/* harmony export */ u: () => (/* reexport safe */ _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_1__.u_)
|
|
602252
602255
|
/* harmony export */ });
|
|
602253
|
-
/* harmony import */ var _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(
|
|
602254
|
-
/* harmony import */ var
|
|
602255
|
-
|
|
602256
|
+
/* harmony import */ var _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(78272);
|
|
602257
|
+
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(38231);
|
|
602258
|
+
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_1__]);
|
|
602259
|
+
_hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
|
|
602256
602260
|
/**
|
|
602257
602261
|
* Configuration validation utilities for converting SDK types to provider-sdk types.
|
|
602258
602262
|
*
|
|
@@ -602264,16 +602268,6 @@ __nccwpck_require__.a(__webpack_module__, async (__webpack_handle_async_dependen
|
|
|
602264
602268
|
*/
|
|
602265
602269
|
|
|
602266
602270
|
|
|
602267
|
-
|
|
602268
|
-
/**
|
|
602269
|
-
* Supported token types in provider-sdk.
|
|
602270
|
-
* Alt-VM chains currently support collateral, synthetic, and native tokens.
|
|
602271
|
-
*/
|
|
602272
|
-
const SUPPORTED_TOKEN_TYPES = new Set([
|
|
602273
|
-
_hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_2__/* .TokenType */ .ks.synthetic,
|
|
602274
|
-
_hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_2__/* .TokenType */ .ks.collateral,
|
|
602275
|
-
_hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_2__/* .TokenType */ .ks.native,
|
|
602276
|
-
]);
|
|
602277
602271
|
/**
|
|
602278
602272
|
* Validates that a CoreConfig is compatible with provider-sdk requirements.
|
|
602279
602273
|
*
|
|
@@ -602294,68 +602288,6 @@ function validateCoreConfigForAltVM(config, chain) {
|
|
|
602294
602288
|
// and provider-sdk types are a subset of SDK types
|
|
602295
602289
|
return config;
|
|
602296
602290
|
}
|
|
602297
|
-
/**
|
|
602298
|
-
* Validates that a WarpRouteDeployConfig is compatible with provider-sdk requirements.
|
|
602299
|
-
*
|
|
602300
|
-
* @param config - WarpRouteDeployConfig from the main SDK
|
|
602301
|
-
* @param chain - Chain name for error messages
|
|
602302
|
-
* @returns a provider-sdk WarpConfig derived from the given config
|
|
602303
|
-
* @throws Error if config contains unsupported token types
|
|
602304
|
-
*/
|
|
602305
|
-
function validateWarpConfigForAltVM(config, chain) {
|
|
602306
|
-
// Check if token type is supported
|
|
602307
|
-
if (!SUPPORTED_TOKEN_TYPES.has(config.type)) {
|
|
602308
|
-
const supportedTypes = Array.from(SUPPORTED_TOKEN_TYPES).join(', ');
|
|
602309
|
-
const errorMsg = `Unsupported token type '${config.type}' for Alt-VM chain '${chain}'.\n` +
|
|
602310
|
-
`Supported token types: ${supportedTypes}.`;
|
|
602311
|
-
throw new Error(errorMsg);
|
|
602312
|
-
}
|
|
602313
|
-
// Validate the token conforms to basic collateral or synthetic structure
|
|
602314
|
-
if (config.type === _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_2__/* .TokenType */ .ks.collateral) {
|
|
602315
|
-
if (!config.token) {
|
|
602316
|
-
const errorMsg = `Collateral token config for chain '${chain}' must specify 'token' address`;
|
|
602317
|
-
throw new Error(errorMsg);
|
|
602318
|
-
}
|
|
602319
|
-
}
|
|
602320
|
-
// Validate ISM if present (handles recursion for routing ISMs)
|
|
602321
|
-
if (config.interchainSecurityModule) {
|
|
602322
|
-
(0,_hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_0__/* .validateIsmConfig */ .mM)(config.interchainSecurityModule, chain, 'warp config');
|
|
602323
|
-
}
|
|
602324
|
-
// Construct the provider-sdk config
|
|
602325
|
-
const baseConfig = {
|
|
602326
|
-
owner: config.owner,
|
|
602327
|
-
mailbox: config.mailbox,
|
|
602328
|
-
interchainSecurityModule: config.interchainSecurityModule,
|
|
602329
|
-
hook: config.hook,
|
|
602330
|
-
remoteRouters: config.remoteRouters,
|
|
602331
|
-
destinationGas: config.destinationGas,
|
|
602332
|
-
};
|
|
602333
|
-
if (config.type === _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_2__/* .TokenType */ .ks.collateral) {
|
|
602334
|
-
return {
|
|
602335
|
-
...baseConfig,
|
|
602336
|
-
type: _hyperlane_xyz_provider_sdk_warp__WEBPACK_IMPORTED_MODULE_1__/* .TokenType */ .ks.collateral,
|
|
602337
|
-
token: config.token,
|
|
602338
|
-
};
|
|
602339
|
-
}
|
|
602340
|
-
else if (config.type === _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_2__/* .TokenType */ .ks.synthetic) {
|
|
602341
|
-
return {
|
|
602342
|
-
...baseConfig,
|
|
602343
|
-
type: _hyperlane_xyz_provider_sdk_warp__WEBPACK_IMPORTED_MODULE_1__/* .TokenType */ .ks.synthetic,
|
|
602344
|
-
name: config.name,
|
|
602345
|
-
symbol: config.symbol,
|
|
602346
|
-
decimals: config.decimals,
|
|
602347
|
-
};
|
|
602348
|
-
}
|
|
602349
|
-
else if (config.type === _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_2__/* .TokenType */ .ks.native) {
|
|
602350
|
-
return {
|
|
602351
|
-
...baseConfig,
|
|
602352
|
-
type: _hyperlane_xyz_provider_sdk_warp__WEBPACK_IMPORTED_MODULE_1__/* .TokenType */ .ks.native,
|
|
602353
|
-
};
|
|
602354
|
-
}
|
|
602355
|
-
else {
|
|
602356
|
-
throw new Error(`Unsupported token type '${config.type}' for Alt-VM chain '${chain}'.`);
|
|
602357
|
-
}
|
|
602358
|
-
}
|
|
602359
602291
|
//# sourceMappingURL=configValidation.js.map
|
|
602360
602292
|
__webpack_async_result__();
|
|
602361
602293
|
} catch(e) { __webpack_async_result__(e); } });
|
|
@@ -602372,7 +602304,7 @@ __nccwpck_require__.a(__webpack_module__, async (__webpack_handle_async_dependen
|
|
|
602372
602304
|
/* harmony export */ });
|
|
602373
602305
|
/* harmony import */ var yaml__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(10684);
|
|
602374
602306
|
/* harmony import */ var _hyperlane_xyz_core_buildArtifact_js__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(74119);
|
|
602375
|
-
/* harmony import */ var _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(
|
|
602307
|
+
/* harmony import */ var _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(78272);
|
|
602376
602308
|
/* harmony import */ var _hyperlane_xyz_provider_sdk__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(18951);
|
|
602377
602309
|
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_8__ = __nccwpck_require__(76939);
|
|
602378
602310
|
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_9__ = __nccwpck_require__(26492);
|
|
@@ -602857,41 +602789,45 @@ __nccwpck_require__.a(__webpack_module__, async (__webpack_handle_async_dependen
|
|
|
602857
602789
|
/* harmony import */ var _inquirer_prompts__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(98720);
|
|
602858
602790
|
/* harmony import */ var yaml__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(10684);
|
|
602859
602791
|
/* harmony import */ var _hyperlane_xyz_core_buildArtifact_js__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(74119);
|
|
602860
|
-
/* harmony import */ var _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(
|
|
602861
|
-
/* harmony import */ var
|
|
602792
|
+
/* harmony import */ var _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(78272);
|
|
602793
|
+
/* harmony import */ var _hyperlane_xyz_deploy_sdk_AltVMFileSubmitter__WEBPACK_IMPORTED_MODULE_36__ = __nccwpck_require__(49988);
|
|
602862
602794
|
/* harmony import */ var _hyperlane_xyz_provider_sdk__WEBPACK_IMPORTED_MODULE_4__ = __nccwpck_require__(18951);
|
|
602863
|
-
/* harmony import */ var
|
|
602864
|
-
/* harmony import */ var
|
|
602865
|
-
/* harmony import */ var
|
|
602866
|
-
/* harmony import */ var
|
|
602867
|
-
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_20__ = __nccwpck_require__(
|
|
602868
|
-
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_21__ = __nccwpck_require__(
|
|
602869
|
-
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_22__ = __nccwpck_require__(
|
|
602870
|
-
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_23__ = __nccwpck_require__(
|
|
602871
|
-
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_24__ = __nccwpck_require__(
|
|
602872
|
-
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_25__ = __nccwpck_require__(
|
|
602873
|
-
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_26__ = __nccwpck_require__(
|
|
602874
|
-
/* harmony import */ var
|
|
602875
|
-
/* harmony import */ var
|
|
602876
|
-
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_30__ = __nccwpck_require__(
|
|
602877
|
-
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_31__ = __nccwpck_require__(
|
|
602878
|
-
/* harmony import */ var
|
|
602879
|
-
/* harmony import */ var
|
|
602880
|
-
/* harmony import */ var
|
|
602881
|
-
/* harmony import */ var
|
|
602882
|
-
/* harmony import */ var
|
|
602883
|
-
/* harmony import */ var
|
|
602884
|
-
/* harmony import */ var
|
|
602885
|
-
/* harmony import */ var
|
|
602886
|
-
/* harmony import */ var
|
|
602887
|
-
/* harmony import */ var
|
|
602888
|
-
/* harmony import */ var
|
|
602889
|
-
/* harmony import */ var
|
|
602890
|
-
/* harmony import */ var
|
|
602891
|
-
/* harmony import */ var
|
|
602892
|
-
/* harmony import */ var
|
|
602893
|
-
|
|
602894
|
-
|
|
602795
|
+
/* harmony import */ var _hyperlane_xyz_provider_sdk_artifact__WEBPACK_IMPORTED_MODULE_5__ = __nccwpck_require__(4287);
|
|
602796
|
+
/* harmony import */ var _hyperlane_xyz_provider_sdk_warp__WEBPACK_IMPORTED_MODULE_6__ = __nccwpck_require__(17791);
|
|
602797
|
+
/* harmony import */ var _hyperlane_xyz_registry__WEBPACK_IMPORTED_MODULE_18__ = __nccwpck_require__(46861);
|
|
602798
|
+
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_16__ = __nccwpck_require__(38231);
|
|
602799
|
+
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_20__ = __nccwpck_require__(19186);
|
|
602800
|
+
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_21__ = __nccwpck_require__(38466);
|
|
602801
|
+
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_22__ = __nccwpck_require__(4879);
|
|
602802
|
+
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_23__ = __nccwpck_require__(29842);
|
|
602803
|
+
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_24__ = __nccwpck_require__(5102);
|
|
602804
|
+
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_25__ = __nccwpck_require__(63776);
|
|
602805
|
+
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_26__ = __nccwpck_require__(93035);
|
|
602806
|
+
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_27__ = __nccwpck_require__(76939);
|
|
602807
|
+
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_28__ = __nccwpck_require__(26492);
|
|
602808
|
+
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_30__ = __nccwpck_require__(48807);
|
|
602809
|
+
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_31__ = __nccwpck_require__(764);
|
|
602810
|
+
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_32__ = __nccwpck_require__(22887);
|
|
602811
|
+
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_33__ = __nccwpck_require__(69352);
|
|
602812
|
+
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_35__ = __nccwpck_require__(59138);
|
|
602813
|
+
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_37__ = __nccwpck_require__(4430);
|
|
602814
|
+
/* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_17__ = __nccwpck_require__(14918);
|
|
602815
|
+
/* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_19__ = __nccwpck_require__(73938);
|
|
602816
|
+
/* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_29__ = __nccwpck_require__(21387);
|
|
602817
|
+
/* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_34__ = __nccwpck_require__(94523);
|
|
602818
|
+
/* harmony import */ var _context_context_js__WEBPACK_IMPORTED_MODULE_7__ = __nccwpck_require__(94986);
|
|
602819
|
+
/* harmony import */ var _logger_js__WEBPACK_IMPORTED_MODULE_15__ = __nccwpck_require__(54321);
|
|
602820
|
+
/* harmony import */ var _send_transfer_js__WEBPACK_IMPORTED_MODULE_8__ = __nccwpck_require__(67793);
|
|
602821
|
+
/* harmony import */ var _submitters_EV5FileSubmitter_js__WEBPACK_IMPORTED_MODULE_9__ = __nccwpck_require__(10155);
|
|
602822
|
+
/* harmony import */ var _submitters_types_js__WEBPACK_IMPORTED_MODULE_10__ = __nccwpck_require__(17555);
|
|
602823
|
+
/* harmony import */ var _utils_files_js__WEBPACK_IMPORTED_MODULE_11__ = __nccwpck_require__(17468);
|
|
602824
|
+
/* harmony import */ var _utils_relay_js__WEBPACK_IMPORTED_MODULE_12__ = __nccwpck_require__(92941);
|
|
602825
|
+
/* harmony import */ var _configValidation_js__WEBPACK_IMPORTED_MODULE_13__ = __nccwpck_require__(34804);
|
|
602826
|
+
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_14__ = __nccwpck_require__(62356);
|
|
602827
|
+
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_context_context_js__WEBPACK_IMPORTED_MODULE_7__, _send_transfer_js__WEBPACK_IMPORTED_MODULE_8__, _submitters_EV5FileSubmitter_js__WEBPACK_IMPORTED_MODULE_9__, _submitters_types_js__WEBPACK_IMPORTED_MODULE_10__, _utils_relay_js__WEBPACK_IMPORTED_MODULE_12__, _configValidation_js__WEBPACK_IMPORTED_MODULE_13__, _utils_js__WEBPACK_IMPORTED_MODULE_14__, _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_16__, _hyperlane_xyz_registry__WEBPACK_IMPORTED_MODULE_18__, _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_30__]);
|
|
602828
|
+
([_context_context_js__WEBPACK_IMPORTED_MODULE_7__, _send_transfer_js__WEBPACK_IMPORTED_MODULE_8__, _submitters_EV5FileSubmitter_js__WEBPACK_IMPORTED_MODULE_9__, _submitters_types_js__WEBPACK_IMPORTED_MODULE_10__, _utils_relay_js__WEBPACK_IMPORTED_MODULE_12__, _configValidation_js__WEBPACK_IMPORTED_MODULE_13__, _utils_js__WEBPACK_IMPORTED_MODULE_14__, _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_16__, _hyperlane_xyz_registry__WEBPACK_IMPORTED_MODULE_18__, _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_30__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
|
|
602829
|
+
|
|
602830
|
+
|
|
602895
602831
|
|
|
602896
602832
|
|
|
602897
602833
|
|
|
@@ -602913,11 +602849,11 @@ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_con
|
|
|
602913
602849
|
async function runWarpRouteDeploy({ context, warpDeployConfig, warpRouteId, warpDeployConfigFileName, }) {
|
|
602914
602850
|
const { skipConfirmation, chainMetadata, registry, multiProvider, altVmSigners, } = context;
|
|
602915
602851
|
// Validate ISM compatibility for all chains
|
|
602916
|
-
(0,
|
|
602852
|
+
(0,_utils_js__WEBPACK_IMPORTED_MODULE_14__/* .validateWarpIsmCompatibility */ .oF)(warpDeployConfig, context);
|
|
602917
602853
|
const chains = Object.keys(warpDeployConfig);
|
|
602918
602854
|
let apiKeys = {};
|
|
602919
602855
|
if (!skipConfirmation)
|
|
602920
|
-
apiKeys = await (0,
|
|
602856
|
+
apiKeys = await (0,_context_context_js__WEBPACK_IMPORTED_MODULE_7__/* .requestAndSaveApiKeys */ .SH)(chains, chainMetadata, registry);
|
|
602921
602857
|
const deploymentParams = {
|
|
602922
602858
|
context,
|
|
602923
602859
|
warpDeployConfig,
|
|
@@ -602926,16 +602862,16 @@ async function runWarpRouteDeploy({ context, warpDeployConfig, warpRouteId, warp
|
|
|
602926
602862
|
// Some of the below functions throw if passed non-EVM or non-supported chains
|
|
602927
602863
|
const deploymentChains = chains.filter((chain) => chainMetadata[chain].protocol === _hyperlane_xyz_provider_sdk__WEBPACK_IMPORTED_MODULE_4__/* .ProtocolType */ .Hb.Ethereum ||
|
|
602928
602864
|
!!altVmSigners[chain]);
|
|
602929
|
-
await (0,
|
|
602865
|
+
await (0,_utils_js__WEBPACK_IMPORTED_MODULE_14__/* .runPreflightChecksForChains */ .DF)({
|
|
602930
602866
|
context,
|
|
602931
602867
|
chains: deploymentChains,
|
|
602932
602868
|
minGas: _hyperlane_xyz_provider_sdk__WEBPACK_IMPORTED_MODULE_4__/* .GasAction */ .Y1.WARP_DEPLOY_GAS,
|
|
602933
602869
|
});
|
|
602934
|
-
const initialBalances = await (0,
|
|
602935
|
-
(0,
|
|
602870
|
+
const initialBalances = await (0,_utils_js__WEBPACK_IMPORTED_MODULE_14__/* .getBalances */ .kA)(context, deploymentChains);
|
|
602871
|
+
(0,_logger_js__WEBPACK_IMPORTED_MODULE_15__/* .logBlue */ .RK)('🚀 All systems ready, captain! Beginning deployment...');
|
|
602936
602872
|
const { deployedContracts } = await executeDeploy(deploymentParams, apiKeys);
|
|
602937
602873
|
const registryAddresses = await registry.getAddresses();
|
|
602938
|
-
const enrollTxs = await (0,
|
|
602874
|
+
const enrollTxs = await (0,_hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_16__/* .enrollCrossChainRouters */ .A2)({ multiProvider, altVmSigners, registryAddresses, warpDeployConfig }, deployedContracts);
|
|
602939
602875
|
// Group chains by protocol type for appropriate parallelization
|
|
602940
602876
|
// EVM chains can run in parallel (each chain has an independent nonce)
|
|
602941
602877
|
// Non-EVM chains (e.g., Cosmos) must run sequentially because when the same
|
|
@@ -602948,7 +602884,7 @@ async function runWarpRouteDeploy({ context, warpDeployConfig, warpRouteId, warp
|
|
|
602948
602884
|
const enrollFailures = [];
|
|
602949
602885
|
// Helper function to submit enrollment for a single chain
|
|
602950
602886
|
const submitEnrollment = async (chain) => {
|
|
602951
|
-
(0,
|
|
602887
|
+
(0,_logger_js__WEBPACK_IMPORTED_MODULE_15__/* .log */ .Rm)(`Enrolling routers for chain ${chain}`);
|
|
602952
602888
|
const { submitter } = await getSubmitterByStrategy({
|
|
602953
602889
|
chain,
|
|
602954
602890
|
context: context,
|
|
@@ -602957,9 +602893,9 @@ async function runWarpRouteDeploy({ context, warpDeployConfig, warpRouteId, warp
|
|
|
602957
602893
|
};
|
|
602958
602894
|
// Submit EVM chains in parallel (they have independent signers)
|
|
602959
602895
|
if (evmChains.length > 0) {
|
|
602960
|
-
const { rejected } = await (0,
|
|
602896
|
+
const { rejected } = await (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_17__/* .mapAllSettled */ .bh)(evmChains, (chain) => submitEnrollment(chain), (chain) => chain);
|
|
602961
602897
|
for (const [chain, error] of rejected) {
|
|
602962
|
-
(0,
|
|
602898
|
+
(0,_logger_js__WEBPACK_IMPORTED_MODULE_15__/* .errorRed */ .aq)(`Failed to enroll routers for chain ${chain}: ${error.message}`);
|
|
602963
602899
|
enrollFailures.push(chain);
|
|
602964
602900
|
}
|
|
602965
602901
|
}
|
|
@@ -602970,7 +602906,7 @@ async function runWarpRouteDeploy({ context, warpDeployConfig, warpRouteId, warp
|
|
|
602970
602906
|
}
|
|
602971
602907
|
catch (error) {
|
|
602972
602908
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
602973
|
-
(0,
|
|
602909
|
+
(0,_logger_js__WEBPACK_IMPORTED_MODULE_15__/* .errorRed */ .aq)(`Failed to enroll routers for chain ${chain}: ${errorMessage}`);
|
|
602974
602910
|
enrollFailures.push(chain);
|
|
602975
602911
|
}
|
|
602976
602912
|
}
|
|
@@ -602988,15 +602924,15 @@ async function runWarpRouteDeploy({ context, warpDeployConfig, warpRouteId, warp
|
|
|
602988
602924
|
else if (warpDeployConfigFileName && 'symbol' in addWarpRouteOptions) {
|
|
602989
602925
|
// validate that the id is correct
|
|
602990
602926
|
let isIdOk = true;
|
|
602991
|
-
const maybeId = (0,
|
|
602927
|
+
const maybeId = (0,_utils_js__WEBPACK_IMPORTED_MODULE_14__/* .warpRouteIdFromFileName */ .uu)(warpDeployConfigFileName, addWarpRouteOptions.symbol);
|
|
602992
602928
|
try {
|
|
602993
|
-
|
|
602929
|
+
_hyperlane_xyz_registry__WEBPACK_IMPORTED_MODULE_18__/* .BaseRegistry */ .H.warpDeployConfigToId(warpDeployConfig, {
|
|
602994
602930
|
warpRouteId: maybeId,
|
|
602995
602931
|
});
|
|
602996
602932
|
}
|
|
602997
602933
|
catch {
|
|
602998
602934
|
isIdOk = false;
|
|
602999
|
-
(0,
|
|
602935
|
+
(0,_logger_js__WEBPACK_IMPORTED_MODULE_15__/* .warnYellow */ .dE)(`Generated id "${maybeId}" from input config file would be invalid, falling back to default options`);
|
|
603000
602936
|
}
|
|
603001
602937
|
warpRouteIdOptions = isIdOk
|
|
603002
602938
|
? { warpRouteId: maybeId }
|
|
@@ -603006,7 +602942,7 @@ async function runWarpRouteDeploy({ context, warpDeployConfig, warpRouteId, warp
|
|
|
603006
602942
|
warpRouteIdOptions = addWarpRouteOptions;
|
|
603007
602943
|
}
|
|
603008
602944
|
await writeDeploymentArtifacts(warpCoreConfig, context, warpRouteIdOptions);
|
|
603009
|
-
await (0,
|
|
602945
|
+
await (0,_utils_js__WEBPACK_IMPORTED_MODULE_14__/* .completeDeploy */ .xA)(context, 'warp', initialBalances, null, deploymentChains);
|
|
603010
602946
|
}
|
|
603011
602947
|
async function runDeployPlanStep({ context, warpDeployConfig }) {
|
|
603012
602948
|
const { skipConfirmation } = context;
|
|
@@ -603022,15 +602958,15 @@ async function runDeployPlanStep({ context, warpDeployConfig }) {
|
|
|
603022
602958
|
async function executeDeploy(params, apiKeys) {
|
|
603023
602959
|
const { warpDeployConfig, context: { multiProvider, altVmSigners, registry }, } = params;
|
|
603024
602960
|
const registryAddresses = await registry.getAddresses();
|
|
603025
|
-
const deployedContracts = await (0,
|
|
602961
|
+
const deployedContracts = await (0,_hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_16__/* .executeWarpDeploy */ .$h)(warpDeployConfig, multiProvider, altVmSigners, registryAddresses, apiKeys);
|
|
603026
602962
|
const { warpCoreConfig: deployments } = await getWarpCoreConfig({ context: params.context, warpDeployConfig }, deployedContracts);
|
|
603027
|
-
(0,
|
|
602963
|
+
(0,_logger_js__WEBPACK_IMPORTED_MODULE_15__/* .logGreen */ .In)('✅ Warp contract deployments complete');
|
|
603028
602964
|
return { deployedContracts, deployments };
|
|
603029
602965
|
}
|
|
603030
602966
|
async function writeDeploymentArtifacts(warpCoreConfig, context, addWarpRouteOptions) {
|
|
603031
|
-
(0,
|
|
602967
|
+
(0,_logger_js__WEBPACK_IMPORTED_MODULE_15__/* .log */ .Rm)('Writing deployment artifacts...');
|
|
603032
602968
|
await context.registry.addWarpRoute(warpCoreConfig, addWarpRouteOptions);
|
|
603033
|
-
(0,
|
|
602969
|
+
(0,_logger_js__WEBPACK_IMPORTED_MODULE_15__/* .log */ .Rm)((0,_utils_files_js__WEBPACK_IMPORTED_MODULE_11__/* .indentYamlOrJson */ .R7)((0,yaml__WEBPACK_IMPORTED_MODULE_1__/* .stringify */ .As)(warpCoreConfig, null, 2), 4));
|
|
603034
602970
|
}
|
|
603035
602971
|
async function getWarpCoreConfig(params, contracts) {
|
|
603036
602972
|
const warpCoreConfig = { tokens: [] };
|
|
@@ -603038,9 +602974,9 @@ async function getWarpCoreConfig(params, contracts) {
|
|
|
603038
602974
|
// During partial failures, some chains may have broken RPCs — deriveTokenMetadata
|
|
603039
602975
|
// would fail trying to call erc20.name()/symbol() on unreachable chains.
|
|
603040
602976
|
const deployedChains = Object.keys(contracts);
|
|
603041
|
-
const deployedWarpConfig = (0,
|
|
602977
|
+
const deployedWarpConfig = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_19__/* .objFilter */ .s3)(params.warpDeployConfig, (chain, _) => deployedChains.includes(chain));
|
|
603042
602978
|
// TODO: replace with warp read
|
|
603043
|
-
const tokenMetadataMap = await
|
|
602979
|
+
const tokenMetadataMap = await _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_20__/* .HypERC20Deployer */ .A7.deriveTokenMetadata(params.context.multiProvider, deployedWarpConfig);
|
|
603044
602980
|
generateTokenConfigs(params.context.multiProvider, warpCoreConfig, deployedWarpConfig, contracts, tokenMetadataMap);
|
|
603045
602981
|
fullyConnectTokens(warpCoreConfig, params.context.multiProvider);
|
|
603046
602982
|
const symbol = tokenMetadataMap.getDefaultSymbol();
|
|
@@ -603052,13 +602988,13 @@ async function getWarpCoreConfig(params, contracts) {
|
|
|
603052
602988
|
function generateTokenConfigs(multiProvider, warpCoreConfig, warpDeployConfig, contracts, tokenMetadataMap) {
|
|
603053
602989
|
for (const chainName of Object.keys(contracts)) {
|
|
603054
602990
|
const config = warpDeployConfig[chainName];
|
|
603055
|
-
const collateralAddressOrDenom = (0,
|
|
602991
|
+
const collateralAddressOrDenom = (0,_hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_21__/* .isCollateralTokenConfig */ .Pc)(config) || (0,_hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_21__/* .isXERC20TokenConfig */ .Kh)(config)
|
|
603056
602992
|
? config.token // gets set in the above deriveTokenMetadata()
|
|
603057
602993
|
: undefined;
|
|
603058
602994
|
const protocol = multiProvider.getProtocol(chainName);
|
|
603059
602995
|
warpCoreConfig.tokens.push({
|
|
603060
602996
|
chainName,
|
|
603061
|
-
standard: (0,
|
|
602997
|
+
standard: (0,_hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_22__/* .tokenTypeToStandard */ ._T)(protocol, config.type),
|
|
603062
602998
|
decimals: tokenMetadataMap.getDecimals(chainName),
|
|
603063
602999
|
symbol: config.symbol || tokenMetadataMap.getSymbol(chainName),
|
|
603064
603000
|
name: tokenMetadataMap.getName(chainName),
|
|
@@ -603081,7 +603017,7 @@ function fullyConnectTokens(warpCoreConfig, multiProvider) {
|
|
|
603081
603017
|
continue;
|
|
603082
603018
|
token1.connections ||= [];
|
|
603083
603019
|
token1.connections.push({
|
|
603084
|
-
token: (0,
|
|
603020
|
+
token: (0,_hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_23__/* .getTokenConnectionId */ .tG)(multiProvider.getProtocol(token2.chainName), token2.chainName, token2.addressOrDenom),
|
|
603085
603021
|
});
|
|
603086
603022
|
}
|
|
603087
603023
|
}
|
|
@@ -603089,15 +603025,15 @@ function fullyConnectTokens(warpCoreConfig, multiProvider) {
|
|
|
603089
603025
|
async function runWarpRouteApply(params) {
|
|
603090
603026
|
const { warpDeployConfig, warpCoreConfig, context } = params;
|
|
603091
603027
|
const { chainMetadata, skipConfirmation, multiProvider } = context;
|
|
603092
|
-
|
|
603093
|
-
|
|
603028
|
+
_hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_21__/* .WarpRouteDeployConfigSchema */ .Wl.parse(warpDeployConfig);
|
|
603029
|
+
_hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_24__/* .WarpCoreConfigSchema */ .$.parse(warpCoreConfig);
|
|
603094
603030
|
const chains = Object.keys(warpDeployConfig);
|
|
603095
603031
|
let apiKeys = {};
|
|
603096
603032
|
if (!skipConfirmation)
|
|
603097
|
-
apiKeys = await (0,
|
|
603033
|
+
apiKeys = await (0,_context_context_js__WEBPACK_IMPORTED_MODULE_7__/* .requestAndSaveApiKeys */ .SH)(chains, chainMetadata, context.registry);
|
|
603098
603034
|
// temporarily configure deployer as owner so that warp update after extension
|
|
603099
603035
|
// can leverage JSON RPC submitter on new chains
|
|
603100
|
-
const intermediateOwnerConfig = await (0,
|
|
603036
|
+
const intermediateOwnerConfig = await (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_19__/* .promiseObjAll */ .a1)((0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_19__/* .objMap */ .Yp)(params.warpDeployConfig, async (chain, config) => {
|
|
603101
603037
|
const protocolType = multiProvider.getProtocol(chain);
|
|
603102
603038
|
if (protocolType === _hyperlane_xyz_provider_sdk__WEBPACK_IMPORTED_MODULE_4__/* .ProtocolType */ .Hb.Ethereum) {
|
|
603103
603039
|
return {
|
|
@@ -603106,7 +603042,7 @@ async function runWarpRouteApply(params) {
|
|
|
603106
603042
|
};
|
|
603107
603043
|
}
|
|
603108
603044
|
else if (context.altVmSigners[chain]) {
|
|
603109
|
-
const signer = (0,
|
|
603045
|
+
const signer = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_19__/* .mustGet */ .Qd)(context.altVmSigners, chain);
|
|
603110
603046
|
return {
|
|
603111
603047
|
...config,
|
|
603112
603048
|
owner: signer.getSignerAddress(),
|
|
@@ -603123,7 +603059,7 @@ async function runWarpRouteApply(params) {
|
|
|
603123
603059
|
// Check if update transactions are empty
|
|
603124
603060
|
const hasAnyTx = Object.values(updateTransactions).some((txs) => txs.length > 0);
|
|
603125
603061
|
if (!hasAnyTx)
|
|
603126
|
-
return (0,
|
|
603062
|
+
return (0,_logger_js__WEBPACK_IMPORTED_MODULE_15__/* .logGreen */ .In)(`Warp config is the same as target. No updates needed.`);
|
|
603127
603063
|
await submitWarpApplyTransactions(params, updateTransactions);
|
|
603128
603064
|
}
|
|
603129
603065
|
/**
|
|
@@ -603136,7 +603072,7 @@ function getWarpRouteExtensionDetails(warpCoreConfig, warpDeployConfig) {
|
|
|
603136
603072
|
const warpCoreConfigByChain = Object.fromEntries(warpCoreConfig.tokens.map((token) => [token.chainName, token]));
|
|
603137
603073
|
const warpCoreChains = Object.keys(warpCoreConfigByChain);
|
|
603138
603074
|
// Split between the existing and additional config
|
|
603139
|
-
const [existingConfigs, initialExtendedConfigs] = (0,
|
|
603075
|
+
const [existingConfigs, initialExtendedConfigs] = (0,_hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_25__/* .splitWarpCoreAndExtendedConfigs */ .v9)(warpDeployConfig, warpCoreChains);
|
|
603140
603076
|
const extendedChains = Object.keys(initialExtendedConfigs);
|
|
603141
603077
|
return {
|
|
603142
603078
|
existingConfigs,
|
|
@@ -603159,9 +603095,9 @@ async function extendWarpRoute(params, apiKeys, warpCoreConfig) {
|
|
|
603159
603095
|
const { existingConfigs, initialExtendedConfigs, warpCoreConfigByChain } = getWarpRouteExtensionDetails(warpCoreConfig, warpDeployConfig);
|
|
603160
603096
|
// Remove all the non compatible chains from the extended configuration to avoid
|
|
603161
603097
|
// having the extension crash
|
|
603162
|
-
const filteredExtendedConfigs = (0,
|
|
603163
|
-
const filteredExistingConfigs = (0,
|
|
603164
|
-
const filteredWarpCoreConfigByChain = (0,
|
|
603098
|
+
const filteredExtendedConfigs = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_19__/* .objFilter */ .s3)(initialExtendedConfigs, (chainName, _) => context.supportedProtocols.includes(context.multiProvider.getProtocol(chainName)));
|
|
603099
|
+
const filteredExistingConfigs = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_19__/* .objFilter */ .s3)(existingConfigs, (chainName, _) => context.supportedProtocols.includes(context.multiProvider.getProtocol(chainName)));
|
|
603100
|
+
const filteredWarpCoreConfigByChain = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_19__/* .objFilter */ .s3)(warpCoreConfigByChain, (chainName, _) => context.supportedProtocols.includes(context.multiProvider.getProtocol(chainName)));
|
|
603165
603101
|
// Get the non compatible chains that should not be unenrolled/removed after the extension
|
|
603166
603102
|
// otherwise the update will generate unenroll transactions
|
|
603167
603103
|
const nonCompatibleWarpCoreConfigs = Object.entries(warpCoreConfigByChain)
|
|
@@ -603171,17 +603107,17 @@ async function extendWarpRoute(params, apiKeys, warpCoreConfig) {
|
|
|
603171
603107
|
if (filteredExtendedChains.length === 0) {
|
|
603172
603108
|
return warpCoreConfig;
|
|
603173
603109
|
}
|
|
603174
|
-
(0,
|
|
603110
|
+
(0,_logger_js__WEBPACK_IMPORTED_MODULE_15__/* .logBlue */ .RK)(`Extending Warp Route to ${filteredExtendedChains.join(', ')}`);
|
|
603175
603111
|
// Derive metadata once for all new chains
|
|
603176
603112
|
const extendedConfigs = await deriveMetadataFromExisting(context.multiProvider, filteredExistingConfigs, filteredExtendedConfigs);
|
|
603177
603113
|
// Helper to deploy a single extension chain
|
|
603178
603114
|
const deployExtension = async (chain) => {
|
|
603179
|
-
(0,
|
|
603115
|
+
(0,_logger_js__WEBPACK_IMPORTED_MODULE_15__/* .logBlue */ .RK)(`Deploying extension to ${chain}...`);
|
|
603180
603116
|
const { deployedContracts } = await executeDeploy({
|
|
603181
603117
|
context: params.context,
|
|
603182
603118
|
warpDeployConfig: { [chain]: extendedConfigs[chain] },
|
|
603183
603119
|
}, apiKeys);
|
|
603184
|
-
(0,
|
|
603120
|
+
(0,_logger_js__WEBPACK_IMPORTED_MODULE_15__/* .logGreen */ .In)(`Successfully deployed extension to ${chain}`);
|
|
603185
603121
|
return deployedContracts;
|
|
603186
603122
|
};
|
|
603187
603123
|
// Group chains by protocol type for appropriate parallelization
|
|
@@ -603195,12 +603131,12 @@ async function extendWarpRoute(params, apiKeys, warpCoreConfig) {
|
|
|
603195
603131
|
const allRejected = new Map();
|
|
603196
603132
|
// Deploy EVM chains in parallel
|
|
603197
603133
|
if (evmExtendChains.length > 0) {
|
|
603198
|
-
const { fulfilled, rejected } = await (0,
|
|
603134
|
+
const { fulfilled, rejected } = await (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_17__/* .mapAllSettled */ .bh)(evmExtendChains, (chain) => deployExtension(chain), (chain) => chain);
|
|
603199
603135
|
for (const [, contracts] of fulfilled) {
|
|
603200
603136
|
newDeployedContracts = { ...newDeployedContracts, ...contracts };
|
|
603201
603137
|
}
|
|
603202
603138
|
for (const [chain, error] of rejected) {
|
|
603203
|
-
(0,
|
|
603139
|
+
(0,_logger_js__WEBPACK_IMPORTED_MODULE_15__/* .errorRed */ .aq)(`Failed to deploy extension to ${chain}: ${error.message}`);
|
|
603204
603140
|
allRejected.set(chain, error);
|
|
603205
603141
|
}
|
|
603206
603142
|
}
|
|
@@ -603212,7 +603148,7 @@ async function extendWarpRoute(params, apiKeys, warpCoreConfig) {
|
|
|
603212
603148
|
}
|
|
603213
603149
|
catch (error) {
|
|
603214
603150
|
const message = error instanceof Error ? error.message : String(error);
|
|
603215
|
-
(0,
|
|
603151
|
+
(0,_logger_js__WEBPACK_IMPORTED_MODULE_15__/* .errorRed */ .aq)(`Failed to deploy extension to ${chain}: ${message}`);
|
|
603216
603152
|
allRejected.set(chain, error instanceof Error ? error : new Error(message));
|
|
603217
603153
|
}
|
|
603218
603154
|
}
|
|
@@ -603221,7 +603157,7 @@ async function extendWarpRoute(params, apiKeys, warpCoreConfig) {
|
|
|
603221
603157
|
}
|
|
603222
603158
|
const mergedRouters = mergeAllRouters(filteredExistingConfigs, newDeployedContracts, filteredWarpCoreConfigByChain);
|
|
603223
603159
|
const { warpCoreConfig: updatedWarpCoreConfig, addWarpRouteOptions } = await getWarpCoreConfig(params, mergedRouters);
|
|
603224
|
-
|
|
603160
|
+
_hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_24__/* .WarpCoreConfigSchema */ .$.parse(updatedWarpCoreConfig);
|
|
603225
603161
|
// Re-add the non compatible chains to the warp core config so that expanding the config
|
|
603226
603162
|
// to get the proper remote routers and gas config works as expected
|
|
603227
603163
|
updatedWarpCoreConfig.tokens.push(...nonCompatibleWarpCoreConfigs);
|
|
@@ -603252,40 +603188,40 @@ async function extendWarpRoute(params, apiKeys, warpCoreConfig) {
|
|
|
603252
603188
|
}
|
|
603253
603189
|
// Updates Warp routes with new configurations.
|
|
603254
603190
|
async function updateExistingWarpRoute(params, apiKeys, warpDeployConfig, warpCoreConfig) {
|
|
603255
|
-
(0,
|
|
603191
|
+
(0,_logger_js__WEBPACK_IMPORTED_MODULE_15__/* .logBlue */ .RK)('Updating deployed Warp Routes');
|
|
603256
603192
|
const { multiProvider, altVmSigners, registry } = params.context;
|
|
603257
603193
|
const registryAddresses = (await registry.getAddresses());
|
|
603258
|
-
const ccipContractCache = new
|
|
603259
|
-
const contractVerifier = new
|
|
603194
|
+
const ccipContractCache = new _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_26__/* .CCIPContractCache */ .G5(registryAddresses);
|
|
603195
|
+
const contractVerifier = new _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_27__/* .ContractVerifier */ .j(multiProvider, apiKeys, _hyperlane_xyz_core_buildArtifact_js__WEBPACK_IMPORTED_MODULE_2__/* .buildArtifact */ .L, _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_28__/* .ExplorerLicenseType */ .p8.MIT);
|
|
603260
603196
|
const updateTransactions = {};
|
|
603261
603197
|
// Get all deployed router addresses
|
|
603262
|
-
const deployedRoutersAddresses = (0,
|
|
603263
|
-
const expandedWarpDeployConfig = await (0,
|
|
603198
|
+
const deployedRoutersAddresses = (0,_hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_25__/* .getRouterAddressesFromWarpCoreConfig */ .Ji)(warpCoreConfig);
|
|
603199
|
+
const expandedWarpDeployConfig = await (0,_hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_25__/* .expandWarpDeployConfig */ .WZ)({
|
|
603264
603200
|
multiProvider,
|
|
603265
603201
|
warpDeployConfig,
|
|
603266
603202
|
deployedRoutersAddresses,
|
|
603267
603203
|
});
|
|
603268
|
-
await (0,
|
|
603269
|
-
await (0,
|
|
603204
|
+
await (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_19__/* .promiseObjAll */ .a1)((0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_19__/* .objMap */ .Yp)(expandedWarpDeployConfig, async (chain, config) => {
|
|
603205
|
+
await (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_17__/* .retryAsync */ .tH)(async () => {
|
|
603270
603206
|
const protocolType = multiProvider.getProtocol(chain);
|
|
603271
603207
|
if (protocolType !== _hyperlane_xyz_provider_sdk__WEBPACK_IMPORTED_MODULE_4__/* .ProtocolType */ .Hb.Ethereum && !altVmSigners[chain]) {
|
|
603272
|
-
(0,
|
|
603208
|
+
(0,_logger_js__WEBPACK_IMPORTED_MODULE_15__/* .logBlue */ .RK)(`Skipping non-compatible chain ${chain}`);
|
|
603273
603209
|
return;
|
|
603274
603210
|
}
|
|
603275
603211
|
const deployedTokenRoute = deployedRoutersAddresses[chain];
|
|
603276
|
-
(0,
|
|
603212
|
+
(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_29__/* .assert */ .v)(deployedTokenRoute, `Missing artifacts for ${chain}.`);
|
|
603277
603213
|
const configWithMailbox = {
|
|
603278
603214
|
...config,
|
|
603279
603215
|
mailbox: registryAddresses[chain].mailbox,
|
|
603280
603216
|
};
|
|
603281
603217
|
switch (protocolType) {
|
|
603282
603218
|
case _hyperlane_xyz_provider_sdk__WEBPACK_IMPORTED_MODULE_4__/* .ProtocolType */ .Hb.Ethereum: {
|
|
603283
|
-
const evmERC20WarpModule = new
|
|
603219
|
+
const evmERC20WarpModule = new _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_30__/* .EvmWarpModule */ .N(multiProvider, {
|
|
603284
603220
|
config: configWithMailbox,
|
|
603285
603221
|
chain,
|
|
603286
603222
|
addresses: {
|
|
603287
603223
|
deployedTokenRoute,
|
|
603288
|
-
...(0,
|
|
603224
|
+
...(0,_hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_31__/* .extractIsmAndHookFactoryAddresses */ .zs)(registryAddresses[chain]),
|
|
603289
603225
|
},
|
|
603290
603226
|
}, ccipContractCache, contractVerifier);
|
|
603291
603227
|
const transactions = await evmERC20WarpModule.update(configWithMailbox);
|
|
@@ -603293,16 +603229,18 @@ async function updateExistingWarpRoute(params, apiKeys, warpDeployConfig, warpCo
|
|
|
603293
603229
|
break;
|
|
603294
603230
|
}
|
|
603295
603231
|
default: {
|
|
603296
|
-
const signer = (0,
|
|
603297
|
-
const validatedConfig = (0,
|
|
603298
|
-
const
|
|
603299
|
-
|
|
603300
|
-
|
|
603301
|
-
|
|
603302
|
-
|
|
603303
|
-
|
|
603304
|
-
|
|
603305
|
-
|
|
603232
|
+
const signer = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_19__/* .mustGet */ .Qd)(altVmSigners, chain);
|
|
603233
|
+
const validatedConfig = (0,_configValidation_js__WEBPACK_IMPORTED_MODULE_13__/* .validateWarpConfigForAltVM */ .u)(configWithMailbox, chain);
|
|
603234
|
+
const chainLookup = (0,_hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_32__/* .altVmChainLookup */ .O)(multiProvider);
|
|
603235
|
+
const chainMetadata = chainLookup.getChainMetadata(chain);
|
|
603236
|
+
const writer = (0,_hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_3__/* .createWarpTokenWriter */ .l5)(chainMetadata, chainLookup, signer);
|
|
603237
|
+
const artifact = (0,_hyperlane_xyz_provider_sdk_warp__WEBPACK_IMPORTED_MODULE_6__/* .warpConfigToArtifact */ .ku)(validatedConfig, chainLookup);
|
|
603238
|
+
const artifactToUpdate = {
|
|
603239
|
+
artifactState: _hyperlane_xyz_provider_sdk_artifact__WEBPACK_IMPORTED_MODULE_5__/* .ArtifactState */ .O2.DEPLOYED,
|
|
603240
|
+
config: artifact.config,
|
|
603241
|
+
deployed: { address: deployedTokenRoute },
|
|
603242
|
+
};
|
|
603243
|
+
const transactions = await writer.update(artifactToUpdate);
|
|
603306
603244
|
updateTransactions[chain] = transactions;
|
|
603307
603245
|
break;
|
|
603308
603246
|
}
|
|
@@ -603317,16 +603255,16 @@ async function updateExistingWarpRoute(params, apiKeys, warpDeployConfig, warpCo
|
|
|
603317
603255
|
* @returns a formatted submission strategy
|
|
603318
603256
|
*/
|
|
603319
603257
|
function readChainSubmissionStrategy(submissionStrategyFilepath) {
|
|
603320
|
-
const submissionStrategyFileContent = (0,
|
|
603321
|
-
return
|
|
603258
|
+
const submissionStrategyFileContent = (0,_utils_files_js__WEBPACK_IMPORTED_MODULE_11__/* .readYamlOrJson */ .xQ)(submissionStrategyFilepath.trim());
|
|
603259
|
+
return _submitters_types_js__WEBPACK_IMPORTED_MODULE_10__/* .ExtendedChainSubmissionStrategySchema */ .VH.parse(submissionStrategyFileContent);
|
|
603322
603260
|
}
|
|
603323
603261
|
/**
|
|
603324
603262
|
* Derives token metadata from existing config and merges it with extended config.
|
|
603325
603263
|
* @returns The merged Warp route deployment config with token metadata.
|
|
603326
603264
|
*/
|
|
603327
603265
|
async function deriveMetadataFromExisting(multiProvider, existingConfigs, extendedConfigs) {
|
|
603328
|
-
const existingTokenMetadata = await
|
|
603329
|
-
return (0,
|
|
603266
|
+
const existingTokenMetadata = await _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_20__/* .HypERC20Deployer */ .A7.deriveTokenMetadata(multiProvider, existingConfigs);
|
|
603267
|
+
return (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_19__/* .objMap */ .Yp)(extendedConfigs, (_chain, extendedConfig) => {
|
|
603330
603268
|
return {
|
|
603331
603269
|
...existingTokenMetadata.getMetadataForChain(_chain),
|
|
603332
603270
|
...extendedConfig,
|
|
@@ -603350,22 +603288,22 @@ function mergeAllRouters(existingConfigs, deployedContractsMap, warpCoreConfigBy
|
|
|
603350
603288
|
};
|
|
603351
603289
|
}
|
|
603352
603290
|
function displayWarpDeployPlan(deployConfig) {
|
|
603353
|
-
(0,
|
|
603354
|
-
(0,
|
|
603355
|
-
(0,
|
|
603291
|
+
(0,_logger_js__WEBPACK_IMPORTED_MODULE_15__/* .logBlue */ .RK)('\nWarp Route Deployment Plan');
|
|
603292
|
+
(0,_logger_js__WEBPACK_IMPORTED_MODULE_15__/* .logGray */ ._P)('==========================');
|
|
603293
|
+
(0,_logger_js__WEBPACK_IMPORTED_MODULE_15__/* .log */ .Rm)(`📋 Token Standard: ${deployConfig.isNft ? 'ERC721' : 'ERC20'}`);
|
|
603356
603294
|
const { transformedDeployConfig, transformedIsmConfigs } = transformDeployConfigForDisplay(deployConfig);
|
|
603357
|
-
(0,
|
|
603358
|
-
(0,
|
|
603359
|
-
(0,
|
|
603360
|
-
(0,
|
|
603295
|
+
(0,_logger_js__WEBPACK_IMPORTED_MODULE_15__/* .log */ .Rm)('📋 Warp Route Config:');
|
|
603296
|
+
(0,_logger_js__WEBPACK_IMPORTED_MODULE_15__/* .logTable */ .Jn)(transformedDeployConfig);
|
|
603297
|
+
(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_19__/* .objMap */ .Yp)(transformedIsmConfigs, (chain, ismConfigs) => {
|
|
603298
|
+
(0,_logger_js__WEBPACK_IMPORTED_MODULE_15__/* .log */ .Rm)(`📋 ${chain} ISM Config(s):`);
|
|
603361
603299
|
ismConfigs.forEach((ismConfig) => {
|
|
603362
|
-
(0,
|
|
603300
|
+
(0,_logger_js__WEBPACK_IMPORTED_MODULE_15__/* .logTable */ .Jn)(ismConfig);
|
|
603363
603301
|
});
|
|
603364
603302
|
});
|
|
603365
603303
|
}
|
|
603366
603304
|
function transformDeployConfigForDisplay(deployConfig) {
|
|
603367
603305
|
const transformedIsmConfigs = {};
|
|
603368
|
-
const transformedDeployConfig = (0,
|
|
603306
|
+
const transformedDeployConfig = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_19__/* .objMap */ .Yp)(deployConfig, (chain, config) => {
|
|
603369
603307
|
if (config.interchainSecurityModule)
|
|
603370
603308
|
transformedIsmConfigs[chain] = transformIsmConfigForDisplay(config.interchainSecurityModule);
|
|
603371
603309
|
return {
|
|
@@ -603386,7 +603324,7 @@ function transformDeployConfigForDisplay(deployConfig) {
|
|
|
603386
603324
|
function transformIsmConfigForDisplay(ismConfig) {
|
|
603387
603325
|
const ismConfigs = [];
|
|
603388
603326
|
switch (ismConfig.type) {
|
|
603389
|
-
case
|
|
603327
|
+
case _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_33__/* .IsmType */ .GO.AGGREGATION:
|
|
603390
603328
|
ismConfigs.push({
|
|
603391
603329
|
Type: ismConfig.type,
|
|
603392
603330
|
Threshold: ismConfig.threshold,
|
|
@@ -603396,7 +603334,7 @@ function transformIsmConfigForDisplay(ismConfig) {
|
|
|
603396
603334
|
ismConfigs.push(...transformIsmConfigForDisplay(module));
|
|
603397
603335
|
});
|
|
603398
603336
|
return ismConfigs;
|
|
603399
|
-
case
|
|
603337
|
+
case _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_33__/* .IsmType */ .GO.ROUTING:
|
|
603400
603338
|
return [
|
|
603401
603339
|
{
|
|
603402
603340
|
Type: ismConfig.type,
|
|
@@ -603405,7 +603343,7 @@ function transformIsmConfigForDisplay(ismConfig) {
|
|
|
603405
603343
|
Domains: 'See warp config for domain specification.',
|
|
603406
603344
|
},
|
|
603407
603345
|
];
|
|
603408
|
-
case
|
|
603346
|
+
case _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_33__/* .IsmType */ .GO.FALLBACK_ROUTING:
|
|
603409
603347
|
return [
|
|
603410
603348
|
{
|
|
603411
603349
|
Type: ismConfig.type,
|
|
@@ -603414,7 +603352,7 @@ function transformIsmConfigForDisplay(ismConfig) {
|
|
|
603414
603352
|
Domains: 'See warp config for domain specification.',
|
|
603415
603353
|
},
|
|
603416
603354
|
];
|
|
603417
|
-
case
|
|
603355
|
+
case _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_33__/* .IsmType */ .GO.MERKLE_ROOT_MULTISIG:
|
|
603418
603356
|
return [
|
|
603419
603357
|
{
|
|
603420
603358
|
Type: ismConfig.type,
|
|
@@ -603422,7 +603360,7 @@ function transformIsmConfigForDisplay(ismConfig) {
|
|
|
603422
603360
|
Threshold: ismConfig.threshold,
|
|
603423
603361
|
},
|
|
603424
603362
|
];
|
|
603425
|
-
case
|
|
603363
|
+
case _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_33__/* .IsmType */ .GO.MESSAGE_ID_MULTISIG:
|
|
603426
603364
|
return [
|
|
603427
603365
|
{
|
|
603428
603366
|
Type: ismConfig.type,
|
|
@@ -603430,7 +603368,7 @@ function transformIsmConfigForDisplay(ismConfig) {
|
|
|
603430
603368
|
Threshold: ismConfig.threshold,
|
|
603431
603369
|
},
|
|
603432
603370
|
];
|
|
603433
|
-
case
|
|
603371
|
+
case _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_33__/* .IsmType */ .GO.OP_STACK:
|
|
603434
603372
|
return [
|
|
603435
603373
|
{
|
|
603436
603374
|
Type: ismConfig.type,
|
|
@@ -603438,7 +603376,7 @@ function transformIsmConfigForDisplay(ismConfig) {
|
|
|
603438
603376
|
'Native Bridge': ismConfig.nativeBridge,
|
|
603439
603377
|
},
|
|
603440
603378
|
];
|
|
603441
|
-
case
|
|
603379
|
+
case _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_33__/* .IsmType */ .GO.PAUSABLE:
|
|
603442
603380
|
return [
|
|
603443
603381
|
{
|
|
603444
603382
|
Type: ismConfig.type,
|
|
@@ -603447,7 +603385,7 @@ function transformIsmConfigForDisplay(ismConfig) {
|
|
|
603447
603385
|
'Owner Overrides': ismConfig.ownerOverrides ?? 'Undefined',
|
|
603448
603386
|
},
|
|
603449
603387
|
];
|
|
603450
|
-
case
|
|
603388
|
+
case _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_33__/* .IsmType */ .GO.TRUSTED_RELAYER:
|
|
603451
603389
|
return [
|
|
603452
603390
|
{
|
|
603453
603391
|
Type: ismConfig.type,
|
|
@@ -603463,7 +603401,7 @@ function transformIsmConfigForDisplay(ismConfig) {
|
|
|
603463
603401
|
*/
|
|
603464
603402
|
async function submitChainTransactions(params, chain, transactions, isExtendedChain) {
|
|
603465
603403
|
const protocol = params.context.multiProvider.getProtocol(chain);
|
|
603466
|
-
await (0,
|
|
603404
|
+
await (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_17__/* .retryAsync */ .tH)(async () => {
|
|
603467
603405
|
const { submitter, config } = await getSubmitterByStrategy({
|
|
603468
603406
|
chain,
|
|
603469
603407
|
context: params.context,
|
|
@@ -603476,10 +603414,10 @@ async function submitChainTransactions(params, chain, transactions, isExtendedCh
|
|
|
603476
603414
|
}
|
|
603477
603415
|
if (transactionReceipts) {
|
|
603478
603416
|
const receiptPath = `${params.receiptsDir}/${chain}-${submitter.txSubmitterType}-${Date.now()}-receipts.json`;
|
|
603479
|
-
(0,
|
|
603480
|
-
(0,
|
|
603417
|
+
(0,_utils_files_js__WEBPACK_IMPORTED_MODULE_11__/* .writeYamlOrJson */ .o9)(receiptPath, transactionReceipts);
|
|
603418
|
+
(0,_logger_js__WEBPACK_IMPORTED_MODULE_15__/* .logGreen */ .In)(`Transaction receipts for ${protocol} chain ${chain} successfully written to ${receiptPath}`);
|
|
603481
603419
|
}
|
|
603482
|
-
const canRelay = (0,
|
|
603420
|
+
const canRelay = (0,_utils_relay_js__WEBPACK_IMPORTED_MODULE_12__/* .canSelfRelay */ .sN)(params.selfRelay ?? false, config, transactionReceipts);
|
|
603483
603421
|
if (!canRelay.relay) {
|
|
603484
603422
|
return;
|
|
603485
603423
|
}
|
|
@@ -603487,15 +603425,15 @@ async function submitChainTransactions(params, chain, transactions, isExtendedCh
|
|
|
603487
603425
|
// we don't want to rerun the complete code block as this will result in
|
|
603488
603426
|
// the update transactions being sent multiple times
|
|
603489
603427
|
try {
|
|
603490
|
-
await (0,
|
|
603428
|
+
await (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_17__/* .retryAsync */ .tH)(() => (0,_utils_relay_js__WEBPACK_IMPORTED_MODULE_12__/* .runSelfRelay */ .VC)({
|
|
603491
603429
|
txReceipt: canRelay.txReceipt,
|
|
603492
603430
|
multiProvider: params.context.multiProvider,
|
|
603493
603431
|
registry: params.context.registry,
|
|
603494
|
-
successMessage:
|
|
603432
|
+
successMessage: _send_transfer_js__WEBPACK_IMPORTED_MODULE_8__/* .WarpSendLogs */ .g.SUCCESS,
|
|
603495
603433
|
}));
|
|
603496
603434
|
}
|
|
603497
603435
|
catch (error) {
|
|
603498
|
-
(0,
|
|
603436
|
+
(0,_logger_js__WEBPACK_IMPORTED_MODULE_15__/* .warnYellow */ .dE)(`Error when self-relaying Warp transaction`, error);
|
|
603499
603437
|
}
|
|
603500
603438
|
}, 5, // attempts
|
|
603501
603439
|
100);
|
|
@@ -603518,10 +603456,10 @@ async function submitWarpApplyTransactions(params, updateTransactions) {
|
|
|
603518
603456
|
const isExtended = (chain) => extendedChains.includes(chain);
|
|
603519
603457
|
// Submit EVM chains in parallel (they have independent signers)
|
|
603520
603458
|
if (evmChains.length > 0) {
|
|
603521
|
-
const { rejected } = await (0,
|
|
603459
|
+
const { rejected } = await (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_17__/* .mapAllSettled */ .bh)(evmChains, (chain) => submitChainTransactions(params, chain, updateTransactions[chain], isExtended(chain)), (chain) => chain);
|
|
603522
603460
|
for (const [chain, error] of rejected) {
|
|
603523
|
-
|
|
603524
|
-
(0,
|
|
603461
|
+
_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_34__/* .rootLogger */ .Jk.debug(`Error in submitWarpApplyTransactions for ${chain}`, error);
|
|
603462
|
+
(0,_logger_js__WEBPACK_IMPORTED_MODULE_15__/* .errorRed */ .aq)(`Failed to submit warp apply transactions for ${chain}: ${error.message}`);
|
|
603525
603463
|
failures.push(chain);
|
|
603526
603464
|
}
|
|
603527
603465
|
}
|
|
@@ -603532,8 +603470,8 @@ async function submitWarpApplyTransactions(params, updateTransactions) {
|
|
|
603532
603470
|
}
|
|
603533
603471
|
catch (e) {
|
|
603534
603472
|
const errorMessage = e instanceof Error ? e.message : String(e);
|
|
603535
|
-
|
|
603536
|
-
(0,
|
|
603473
|
+
_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_34__/* .rootLogger */ .Jk.debug(`Error in submitWarpApplyTransactions for ${chain}`, e);
|
|
603474
|
+
(0,_logger_js__WEBPACK_IMPORTED_MODULE_15__/* .errorRed */ .aq)(`Failed to submit warp apply transactions for ${chain}: ${errorMessage}`);
|
|
603537
603475
|
failures.push(chain);
|
|
603538
603476
|
}
|
|
603539
603477
|
}
|
|
@@ -603551,7 +603489,7 @@ async function getSubmitterByStrategy({ chain, context, strategyUrl, isExtendedC
|
|
|
603551
603489
|
const defaultSubmitter = {
|
|
603552
603490
|
submitter: {
|
|
603553
603491
|
chain,
|
|
603554
|
-
type:
|
|
603492
|
+
type: _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_35__/* .TxSubmitterType */ .u.JSON_RPC,
|
|
603555
603493
|
},
|
|
603556
603494
|
};
|
|
603557
603495
|
// if the requested chain is not defined in the config, transaction submission will crash
|
|
@@ -603563,26 +603501,26 @@ async function getSubmitterByStrategy({ chain, context, strategyUrl, isExtendedC
|
|
|
603563
603501
|
const additionalSubmitterFactories = {
|
|
603564
603502
|
[_hyperlane_xyz_provider_sdk__WEBPACK_IMPORTED_MODULE_4__/* .ProtocolType */ .Hb.Ethereum]: {
|
|
603565
603503
|
file: (_multiProvider, metadata) => {
|
|
603566
|
-
return new
|
|
603504
|
+
return new _submitters_EV5FileSubmitter_js__WEBPACK_IMPORTED_MODULE_9__/* .EV5FileSubmitter */ .S(metadata);
|
|
603567
603505
|
},
|
|
603568
603506
|
},
|
|
603569
603507
|
};
|
|
603570
603508
|
// Only add non-Ethereum protocol factories if we have an alt VM signer
|
|
603571
603509
|
if (protocol !== _hyperlane_xyz_provider_sdk__WEBPACK_IMPORTED_MODULE_4__/* .ProtocolType */ .Hb.Ethereum) {
|
|
603572
|
-
const signer = (0,
|
|
603510
|
+
const signer = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_19__/* .mustGet */ .Qd)(altVmSigners, chain);
|
|
603573
603511
|
additionalSubmitterFactories[protocol] = {
|
|
603574
603512
|
jsonRpc: () => {
|
|
603575
603513
|
return new _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_3__/* .AltVMJsonRpcSubmitter */ .lU(signer, {
|
|
603576
603514
|
chain: chain,
|
|
603577
603515
|
});
|
|
603578
603516
|
},
|
|
603579
|
-
[
|
|
603580
|
-
return new
|
|
603517
|
+
[_submitters_types_js__WEBPACK_IMPORTED_MODULE_10__/* .CustomTxSubmitterType */ .pW.FILE]: (_multiProvider, metadata) => {
|
|
603518
|
+
return new _hyperlane_xyz_deploy_sdk_AltVMFileSubmitter__WEBPACK_IMPORTED_MODULE_36__/* .AltVMFileSubmitter */ .U(signer, metadata);
|
|
603581
603519
|
},
|
|
603582
603520
|
};
|
|
603583
603521
|
}
|
|
603584
603522
|
return {
|
|
603585
|
-
submitter: await (0,
|
|
603523
|
+
submitter: await (0,_hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_37__/* .getSubmitterBuilder */ .x)({
|
|
603586
603524
|
submissionStrategy: strategyToUse, // TODO: fix this
|
|
603587
603525
|
multiProvider,
|
|
603588
603526
|
coreAddressesByChain: await registry.getAddresses(),
|
|
@@ -604060,7 +603998,7 @@ __nccwpck_require__.a(__webpack_module__, async (__webpack_handle_async_dependen
|
|
|
604060
603998
|
/* harmony export */ __nccwpck_require__.d(__webpack_exports__, {
|
|
604061
603999
|
/* harmony export */ C: () => (/* binding */ readHookConfig)
|
|
604062
604000
|
/* harmony export */ });
|
|
604063
|
-
/* harmony import */ var _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(
|
|
604001
|
+
/* harmony import */ var _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(78272);
|
|
604064
604002
|
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(69319);
|
|
604065
604003
|
/* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(16639);
|
|
604066
604004
|
/* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__ = __nccwpck_require__(73938);
|
|
@@ -604121,23 +604059,25 @@ __nccwpck_require__.a(__webpack_module__, async (__webpack_handle_async_dependen
|
|
|
604121
604059
|
/* harmony export */ E: () => (/* binding */ runIsmDeploy)
|
|
604122
604060
|
/* harmony export */ });
|
|
604123
604061
|
/* harmony import */ var _hyperlane_xyz_core_buildArtifact_js__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(74119);
|
|
604124
|
-
/* harmony import */ var _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(
|
|
604062
|
+
/* harmony import */ var _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(78272);
|
|
604125
604063
|
/* harmony import */ var _hyperlane_xyz_provider_sdk__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(18951);
|
|
604126
|
-
/* harmony import */ var
|
|
604127
|
-
/* harmony import */ var
|
|
604128
|
-
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_10__ = __nccwpck_require__(
|
|
604129
|
-
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_11__ = __nccwpck_require__(
|
|
604130
|
-
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_12__ = __nccwpck_require__(
|
|
604131
|
-
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_13__ = __nccwpck_require__(
|
|
604132
|
-
/* harmony import */ var
|
|
604133
|
-
/* harmony import */ var
|
|
604134
|
-
/* harmony import */ var
|
|
604135
|
-
/* harmony import */ var
|
|
604136
|
-
/* harmony import */ var
|
|
604137
|
-
/* harmony import */ var
|
|
604138
|
-
/* harmony import */ var
|
|
604139
|
-
var
|
|
604140
|
-
|
|
604064
|
+
/* harmony import */ var _hyperlane_xyz_provider_sdk_ism__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(96426);
|
|
604065
|
+
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_8__ = __nccwpck_require__(69352);
|
|
604066
|
+
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_10__ = __nccwpck_require__(37748);
|
|
604067
|
+
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_11__ = __nccwpck_require__(76939);
|
|
604068
|
+
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_12__ = __nccwpck_require__(26492);
|
|
604069
|
+
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_13__ = __nccwpck_require__(764);
|
|
604070
|
+
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_14__ = __nccwpck_require__(3612);
|
|
604071
|
+
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_16__ = __nccwpck_require__(22887);
|
|
604072
|
+
/* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_9__ = __nccwpck_require__(21387);
|
|
604073
|
+
/* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_15__ = __nccwpck_require__(73938);
|
|
604074
|
+
/* harmony import */ var _context_context_js__WEBPACK_IMPORTED_MODULE_4__ = __nccwpck_require__(94986);
|
|
604075
|
+
/* harmony import */ var _deploy_utils_js__WEBPACK_IMPORTED_MODULE_5__ = __nccwpck_require__(62356);
|
|
604076
|
+
/* harmony import */ var _logger_js__WEBPACK_IMPORTED_MODULE_7__ = __nccwpck_require__(54321);
|
|
604077
|
+
/* harmony import */ var _utils_files_js__WEBPACK_IMPORTED_MODULE_6__ = __nccwpck_require__(17468);
|
|
604078
|
+
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_context_context_js__WEBPACK_IMPORTED_MODULE_4__, _deploy_utils_js__WEBPACK_IMPORTED_MODULE_5__]);
|
|
604079
|
+
([_context_context_js__WEBPACK_IMPORTED_MODULE_4__, _deploy_utils_js__WEBPACK_IMPORTED_MODULE_5__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
|
|
604080
|
+
|
|
604141
604081
|
|
|
604142
604082
|
|
|
604143
604083
|
|
|
@@ -604151,41 +604091,41 @@ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_con
|
|
|
604151
604091
|
* Deploys an ISM based on the provided configuration.
|
|
604152
604092
|
*/
|
|
604153
604093
|
async function runIsmDeploy({ context, chain, configPath, outPath, }) {
|
|
604154
|
-
(0,
|
|
604094
|
+
(0,_logger_js__WEBPACK_IMPORTED_MODULE_7__/* .logCommandHeader */ .dp)('Hyperlane ISM Deploy');
|
|
604155
604095
|
const { multiProvider, registry, skipConfirmation, chainMetadata } = context;
|
|
604156
604096
|
// Read and validate ISM config
|
|
604157
|
-
const rawConfig = await (0,
|
|
604158
|
-
const parseResult =
|
|
604097
|
+
const rawConfig = await (0,_utils_files_js__WEBPACK_IMPORTED_MODULE_6__/* .readYamlOrJson */ .xQ)(configPath);
|
|
604098
|
+
const parseResult = _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_8__/* .IsmConfigSchema */ .nb.safeParse(rawConfig);
|
|
604159
604099
|
if (!parseResult.success) {
|
|
604160
604100
|
const firstIssue = parseResult.error.issues[0];
|
|
604161
604101
|
throw new Error(`Invalid ISM config: ${firstIssue.path.join('.')} => ${firstIssue.message}`);
|
|
604162
604102
|
}
|
|
604163
604103
|
const ismConfig = parseResult.data;
|
|
604164
604104
|
// Validate that config is not just an address
|
|
604165
|
-
(0,
|
|
604105
|
+
(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_9__/* .assert */ .v)(typeof ismConfig !== 'string', 'ISM config must be an object, not an address string');
|
|
604166
604106
|
// Validate ISM compatibility with chain technical stack
|
|
604167
604107
|
const { technicalStack } = multiProvider.getChainMetadata(chain);
|
|
604168
|
-
(0,
|
|
604108
|
+
(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_9__/* .assert */ .v)((0,_hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_10__/* .isIsmCompatible */ .Sb)({
|
|
604169
604109
|
ismType: ismConfig.type,
|
|
604170
604110
|
chainTechnicalStack: technicalStack,
|
|
604171
604111
|
}), `ISM type ${ismConfig.type} is not compatible with chain ${chain} (technical stack: ${technicalStack})`);
|
|
604172
604112
|
// Get registry addresses for the chain
|
|
604173
604113
|
const chainAddresses = await registry.getChainAddresses(chain);
|
|
604174
|
-
(0,
|
|
604175
|
-
(0,
|
|
604114
|
+
(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_9__/* .assert */ .v)(chainAddresses, `No registry addresses found for chain ${chain}`);
|
|
604115
|
+
(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_9__/* .assert */ .v)(chainAddresses.mailbox, `No mailbox address found for chain ${chain}`);
|
|
604176
604116
|
// Request API keys for contract verification (unless skipping confirmation)
|
|
604177
604117
|
let apiKeys = {};
|
|
604178
604118
|
if (!skipConfirmation) {
|
|
604179
|
-
apiKeys = await (0,
|
|
604119
|
+
apiKeys = await (0,_context_context_js__WEBPACK_IMPORTED_MODULE_4__/* .requestAndSaveApiKeys */ .SH)([chain], chainMetadata, registry);
|
|
604180
604120
|
}
|
|
604181
604121
|
// Run preflight checks
|
|
604182
|
-
await (0,
|
|
604122
|
+
await (0,_deploy_utils_js__WEBPACK_IMPORTED_MODULE_5__/* .runPreflightChecksForChains */ .DF)({
|
|
604183
604123
|
context,
|
|
604184
604124
|
chains: [chain],
|
|
604185
604125
|
minGas: _hyperlane_xyz_provider_sdk__WEBPACK_IMPORTED_MODULE_2__/* .GasAction */ .Y1.ISM_DEPLOY_GAS,
|
|
604186
604126
|
});
|
|
604187
|
-
const initialBalances = await (0,
|
|
604188
|
-
(0,
|
|
604127
|
+
const initialBalances = await (0,_deploy_utils_js__WEBPACK_IMPORTED_MODULE_5__/* .getBalances */ .kA)(context, [chain]);
|
|
604128
|
+
(0,_logger_js__WEBPACK_IMPORTED_MODULE_7__/* .logBlue */ .RK)(`Deploying ${ismConfig.type} ISM to ${chain}...`);
|
|
604189
604129
|
const protocol = multiProvider.getProtocol(chain);
|
|
604190
604130
|
let deployedAddress;
|
|
604191
604131
|
if (protocol === _hyperlane_xyz_provider_sdk__WEBPACK_IMPORTED_MODULE_2__/* .ProtocolType */ .Hb.Ethereum) {
|
|
@@ -604204,10 +604144,10 @@ async function runIsmDeploy({ context, chain, configPath, outPath, }) {
|
|
|
604204
604144
|
ismConfig,
|
|
604205
604145
|
});
|
|
604206
604146
|
}
|
|
604207
|
-
(0,
|
|
604208
|
-
(0,
|
|
604209
|
-
(0,
|
|
604210
|
-
(0,
|
|
604147
|
+
(0,_logger_js__WEBPACK_IMPORTED_MODULE_7__/* .logGreen */ .In)(`\n✅ ISM deployed successfully!`);
|
|
604148
|
+
(0,_logger_js__WEBPACK_IMPORTED_MODULE_7__/* .log */ .Rm)(`ISM Address: ${deployedAddress}`);
|
|
604149
|
+
(0,_logger_js__WEBPACK_IMPORTED_MODULE_7__/* .log */ .Rm)(`Chain: ${chain}`);
|
|
604150
|
+
(0,_logger_js__WEBPACK_IMPORTED_MODULE_7__/* .log */ .Rm)(`Type: ${ismConfig.type}`);
|
|
604211
604151
|
// Write output if requested
|
|
604212
604152
|
if (outPath) {
|
|
604213
604153
|
const output = {
|
|
@@ -604215,16 +604155,16 @@ async function runIsmDeploy({ context, chain, configPath, outPath, }) {
|
|
|
604215
604155
|
type: ismConfig.type,
|
|
604216
604156
|
address: deployedAddress,
|
|
604217
604157
|
};
|
|
604218
|
-
(0,
|
|
604219
|
-
(0,
|
|
604158
|
+
(0,_utils_files_js__WEBPACK_IMPORTED_MODULE_6__/* .writeFileAtPath */ .Sc)(outPath, JSON.stringify(output, null, 2) + '\n');
|
|
604159
|
+
(0,_logger_js__WEBPACK_IMPORTED_MODULE_7__/* .logGreen */ .In)(`Output written to ${outPath}`);
|
|
604220
604160
|
}
|
|
604221
|
-
await (0,
|
|
604161
|
+
await (0,_deploy_utils_js__WEBPACK_IMPORTED_MODULE_5__/* .completeDeploy */ .xA)(context, 'ism', initialBalances, null, [chain]);
|
|
604222
604162
|
}
|
|
604223
604163
|
async function deployEvmIsm({ context, chain, ismConfig, chainAddresses, apiKeys, }) {
|
|
604224
604164
|
const { multiProvider } = context;
|
|
604225
|
-
const contractVerifier = new
|
|
604226
|
-
const proxyFactoryFactories = (0,
|
|
604227
|
-
const evmIsmModule = await
|
|
604165
|
+
const contractVerifier = new _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_11__/* .ContractVerifier */ .j(multiProvider, apiKeys, _hyperlane_xyz_core_buildArtifact_js__WEBPACK_IMPORTED_MODULE_0__/* .buildArtifact */ .L, _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_12__/* .ExplorerLicenseType */ .p8.MIT);
|
|
604166
|
+
const proxyFactoryFactories = (0,_hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_13__/* .extractIsmAndHookFactoryAddresses */ .zs)(chainAddresses);
|
|
604167
|
+
const evmIsmModule = await _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_14__/* .EvmIsmModule */ .a.create({
|
|
604228
604168
|
chain,
|
|
604229
604169
|
mailbox: chainAddresses.mailbox,
|
|
604230
604170
|
multiProvider,
|
|
@@ -604237,16 +604177,16 @@ async function deployEvmIsm({ context, chain, ismConfig, chainAddresses, apiKeys
|
|
|
604237
604177
|
}
|
|
604238
604178
|
async function deployNonEvmIsm({ context, chain, ismConfig, }) {
|
|
604239
604179
|
const { multiProvider, altVmSigners } = context;
|
|
604240
|
-
const signer = (0,
|
|
604241
|
-
const chainLookup = (0,
|
|
604180
|
+
const signer = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_15__/* .mustGet */ .Qd)(altVmSigners, chain);
|
|
604181
|
+
const chainLookup = (0,_hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_16__/* .altVmChainLookup */ .O)(multiProvider);
|
|
604242
604182
|
const chainMetadata = chainLookup.getChainMetadata(chain);
|
|
604243
604183
|
const writer = (0,_hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_1__/* .createIsmWriter */ .lN)(chainMetadata, chainLookup, signer);
|
|
604244
604184
|
// Convert ISM config to artifact format
|
|
604245
|
-
const artifact = (0,
|
|
604185
|
+
const artifact = (0,_hyperlane_xyz_provider_sdk_ism__WEBPACK_IMPORTED_MODULE_3__/* .ismConfigToArtifact */ .HL)(
|
|
604246
604186
|
// FIXME: not all ISM types are supported yet (treated the same in `warp deploy`)
|
|
604247
604187
|
ismConfig, chainLookup);
|
|
604248
604188
|
const result = await writer.create(artifact);
|
|
604249
|
-
(0,
|
|
604189
|
+
(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_9__/* .assert */ .v)(result.length > 0, `ISM deployment via writer.create() returned no results for chain ${chain}`);
|
|
604250
604190
|
return result[0].deployed.address;
|
|
604251
604191
|
}
|
|
604252
604192
|
//# sourceMappingURL=deploy.js.map
|
|
@@ -604262,7 +604202,7 @@ __nccwpck_require__.a(__webpack_module__, async (__webpack_handle_async_dependen
|
|
|
604262
604202
|
/* harmony export */ __nccwpck_require__.d(__webpack_exports__, {
|
|
604263
604203
|
/* harmony export */ Y: () => (/* binding */ readIsmConfig)
|
|
604264
604204
|
/* harmony export */ });
|
|
604265
|
-
/* harmony import */ var _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(
|
|
604205
|
+
/* harmony import */ var _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(78272);
|
|
604266
604206
|
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(60715);
|
|
604267
604207
|
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_5__ = __nccwpck_require__(22887);
|
|
604268
604208
|
/* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(16639);
|
|
@@ -604382,7 +604322,7 @@ __nccwpck_require__.a(__webpack_module__, async (__webpack_handle_async_dependen
|
|
|
604382
604322
|
/* harmony export */ __nccwpck_require__.d(__webpack_exports__, {
|
|
604383
604323
|
/* harmony export */ R: () => (/* binding */ executeCoreRead)
|
|
604384
604324
|
/* harmony export */ });
|
|
604385
|
-
/* harmony import */ var _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(
|
|
604325
|
+
/* harmony import */ var _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(78272);
|
|
604386
604326
|
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(80031);
|
|
604387
604327
|
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_6__ = __nccwpck_require__(22887);
|
|
604388
604328
|
/* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(21387);
|
|
@@ -604447,7 +604387,7 @@ __nccwpck_require__.a(__webpack_module__, async (__webpack_handle_async_dependen
|
|
|
604447
604387
|
/* unused harmony export logXERC20Limits */
|
|
604448
604388
|
/* harmony import */ var ethers__WEBPACK_IMPORTED_MODULE_10__ = __nccwpck_require__(61934);
|
|
604449
604389
|
/* harmony import */ var _hyperlane_xyz_core__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(9156);
|
|
604450
|
-
/* harmony import */ var _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(
|
|
604390
|
+
/* harmony import */ var _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(78272);
|
|
604451
604391
|
/* harmony import */ var _hyperlane_xyz_provider_sdk__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(18951);
|
|
604452
604392
|
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_6__ = __nccwpck_require__(40945);
|
|
604453
604393
|
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_7__ = __nccwpck_require__(22887);
|
|
@@ -604515,10 +604455,10 @@ async function deriveWarpRouteConfigs(context, addresses, warpCoreConfig) {
|
|
|
604515
604455
|
return new _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_6__/* .EvmWarpRouteReader */ .pr(multiProvider, chain).deriveWarpRouteConfig(address);
|
|
604516
604456
|
}
|
|
604517
604457
|
default: {
|
|
604518
|
-
const provider = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .mustGet */ .Qd)(context.altVmProviders, chain);
|
|
604519
604458
|
const chainLookup = (0,_hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_7__/* .altVmChainLookup */ .O)(multiProvider);
|
|
604520
|
-
const
|
|
604521
|
-
|
|
604459
|
+
const chainMetadata = chainLookup.getChainMetadata(chain);
|
|
604460
|
+
const reader = (0,_hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_1__/* .createWarpTokenReader */ .ZJ)(chainMetadata, chainLookup);
|
|
604461
|
+
return reader.deriveWarpConfig(address);
|
|
604522
604462
|
}
|
|
604523
604463
|
}
|
|
604524
604464
|
}));
|
|
@@ -612825,7 +612765,7 @@ __webpack_async_result__();
|
|
|
612825
612765
|
/* harmony export */ __nccwpck_require__.d(__webpack_exports__, {
|
|
612826
612766
|
/* harmony export */ x: () => (/* binding */ VERSION)
|
|
612827
612767
|
/* harmony export */ });
|
|
612828
|
-
const VERSION = '25.
|
|
612768
|
+
const VERSION = '25.5.0';
|
|
612829
612769
|
//# sourceMappingURL=version.js.map
|
|
612830
612770
|
|
|
612831
612771
|
/***/ }),
|
|
@@ -629069,6 +629009,8 @@ function setupWarpExtension(base) {
|
|
|
629069
629009
|
//# sourceMappingURL=query.js.map
|
|
629070
629010
|
// EXTERNAL MODULE: ../provider-sdk/dist/warp.js
|
|
629071
629011
|
var warp = __nccwpck_require__(17791);
|
|
629012
|
+
// EXTERNAL MODULE: ../utils/dist/logging.js
|
|
629013
|
+
var logging = __nccwpck_require__(94523);
|
|
629072
629014
|
;// CONCATENATED MODULE: ../cosmos-sdk/dist/warp/warp-query.js
|
|
629073
629015
|
|
|
629074
629016
|
|
|
@@ -629123,6 +629065,8 @@ async function getCollateralWarpTokenConfig(query, tokenAddress) {
|
|
|
629123
629065
|
(0,validation/* assert */.v)(token, `No token found at address ${tokenAddress}`);
|
|
629124
629066
|
(0,validation/* assert */.v)(token.token_type === HypTokenType.HYP_TOKEN_TYPE_COLLATERAL, `Token at ${tokenAddress} is not a collateral token`);
|
|
629125
629067
|
const { remoteRouters, destinationGas } = await getRemoteRoutersAndGas(query, tokenAddress);
|
|
629068
|
+
// Cosmos SDK tokens do not store token metadata on chain yet
|
|
629069
|
+
logging/* rootLogger */.Jk.warn(`Token metadata (name, symbol, decimals) is not stored on-chain for Cosmos collateral token at ${tokenAddress}. Falling back to placeholder values.`);
|
|
629126
629070
|
return {
|
|
629127
629071
|
type: dist/* AltVM.TokenType */.bx.ks.collateral,
|
|
629128
629072
|
address: token.id,
|
|
@@ -629130,8 +629074,9 @@ async function getCollateralWarpTokenConfig(query, tokenAddress) {
|
|
|
629130
629074
|
mailbox: token.origin_mailbox,
|
|
629131
629075
|
interchainSecurityModule: token.ism_id,
|
|
629132
629076
|
token: token.origin_denom,
|
|
629133
|
-
|
|
629134
|
-
|
|
629077
|
+
// Cosmos SDK tokens do not store token metadata on chain yet
|
|
629078
|
+
name: 'Unknown',
|
|
629079
|
+
symbol: 'Unknown',
|
|
629135
629080
|
decimals: 0,
|
|
629136
629081
|
remoteRouters,
|
|
629137
629082
|
destinationGas,
|
|
@@ -629150,14 +629095,17 @@ async function getSyntheticWarpTokenConfig(query, tokenAddress) {
|
|
|
629150
629095
|
(0,validation/* assert */.v)(token, `No token found at address ${tokenAddress}`);
|
|
629151
629096
|
(0,validation/* assert */.v)(token.token_type === HypTokenType.HYP_TOKEN_TYPE_SYNTHETIC, `Token at ${tokenAddress} is not a synthetic token`);
|
|
629152
629097
|
const { remoteRouters, destinationGas } = await getRemoteRoutersAndGas(query, tokenAddress);
|
|
629098
|
+
// Cosmos SDK tokens do not store token metadata on chain yet
|
|
629099
|
+
logging/* rootLogger */.Jk.warn(`Token metadata (name, symbol, decimals) is not stored on-chain for Cosmos synthetic token at ${tokenAddress}. Falling back to placeholder values.`);
|
|
629153
629100
|
return {
|
|
629154
629101
|
type: dist/* AltVM.TokenType */.bx.ks.synthetic,
|
|
629155
629102
|
address: token.id,
|
|
629156
629103
|
owner: token.owner,
|
|
629157
629104
|
mailbox: token.origin_mailbox,
|
|
629158
629105
|
interchainSecurityModule: token.ism_id,
|
|
629159
|
-
|
|
629160
|
-
|
|
629106
|
+
// Cosmos SDK tokens do not store token metadata on chain yet
|
|
629107
|
+
name: 'Unknown',
|
|
629108
|
+
symbol: 'Unknown',
|
|
629161
629109
|
decimals: 0,
|
|
629162
629110
|
remoteRouters,
|
|
629163
629111
|
destinationGas,
|
|
@@ -629539,6 +629487,9 @@ class CosmosWarpArtifactManager {
|
|
|
629539
629487
|
const cometClient = await (0,tendermint_rpc_build.connectComet)(this.rpcUrls[0]);
|
|
629540
629488
|
return build.QueryClient.withExtensions(cometClient, setupWarpExtension);
|
|
629541
629489
|
}
|
|
629490
|
+
supportsHookUpdates() {
|
|
629491
|
+
return false;
|
|
629492
|
+
}
|
|
629542
629493
|
async readWarpToken(address) {
|
|
629543
629494
|
const query = await this.getQuery();
|
|
629544
629495
|
const altVMType = await getWarpTokenType(query, address);
|
|
@@ -630585,7 +630536,7 @@ class AltVMFileSubmitter {
|
|
|
630585
630536
|
|
|
630586
630537
|
/***/ }),
|
|
630587
630538
|
|
|
630588
|
-
/***/
|
|
630539
|
+
/***/ 78272:
|
|
630589
630540
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __nccwpck_require__) => {
|
|
630590
630541
|
|
|
630591
630542
|
|
|
@@ -630593,20 +630544,18 @@ class AltVMFileSubmitter {
|
|
|
630593
630544
|
__nccwpck_require__.d(__webpack_exports__, {
|
|
630594
630545
|
KX: () => (/* reexport */ AltVMCoreModule_AltVMCoreModule),
|
|
630595
630546
|
rX: () => (/* reexport */ AltVMCoreReader_AltVMCoreReader),
|
|
630596
|
-
HT: () => (/* reexport */ AltVMDeployer),
|
|
630597
630547
|
lU: () => (/* reexport */ AltVMJsonRpcSubmitter),
|
|
630598
|
-
hT: () => (/* reexport */ AltVMWarpModule_AltVMWarpModule),
|
|
630599
|
-
HG: () => (/* reexport */ AltVMWarpRouteReader_AltVMWarpRouteReader),
|
|
630600
630548
|
rz: () => (/* reexport */ createHookReader),
|
|
630601
630549
|
JM: () => (/* reexport */ createHookWriter),
|
|
630602
630550
|
BT: () => (/* reexport */ createIsmReader),
|
|
630603
630551
|
lN: () => (/* reexport */ createIsmWriter),
|
|
630604
|
-
|
|
630552
|
+
ZJ: () => (/* reexport */ createWarpTokenReader),
|
|
630553
|
+
l5: () => (/* reexport */ createWarpTokenWriter),
|
|
630605
630554
|
ff: () => (/* reexport */ loadProtocolProviders),
|
|
630606
630555
|
mM: () => (/* reexport */ validateIsmConfig)
|
|
630607
630556
|
});
|
|
630608
630557
|
|
|
630609
|
-
// UNUSED EXPORTS: HookWriter, IsmWriter, UnsupportedIsmTypeError,
|
|
630558
|
+
// UNUSED EXPORTS: HookWriter, IsmWriter, UnsupportedIsmTypeError, WarpTokenReader, WarpTokenWriter, coreModuleProvider, validateIsmType
|
|
630610
630559
|
|
|
630611
630560
|
// EXTERNAL MODULE: ../utils/dist/logging.js
|
|
630612
630561
|
var logging = __nccwpck_require__(94523);
|
|
@@ -631253,79 +631202,6 @@ class IsmWriter extends IsmReader {
|
|
|
631253
631202
|
}
|
|
631254
631203
|
}
|
|
631255
631204
|
//# sourceMappingURL=generic-ism-writer.js.map
|
|
631256
|
-
;// CONCATENATED MODULE: ../deploy-sdk/dist/ism/ism-config-utils.js
|
|
631257
|
-
|
|
631258
|
-
// Re-export ISM utility functions from provider-sdk for convenience
|
|
631259
|
-
|
|
631260
|
-
/**
|
|
631261
|
-
* Converts IsmConfig (Config API) to IsmArtifactConfig (Artifact API).
|
|
631262
|
-
*
|
|
631263
|
-
* Key transformations:
|
|
631264
|
-
* - String chain names → numeric domain IDs (for routing ISM domains)
|
|
631265
|
-
* - Address string references → ArtifactUnderived objects
|
|
631266
|
-
* - Recursively handles nested routing ISM configurations
|
|
631267
|
-
* - Other ISM types (multisig, testIsm) pass through unchanged
|
|
631268
|
-
*
|
|
631269
|
-
* @param config The ISM configuration using Config API format
|
|
631270
|
-
* @param chainLookup Chain lookup interface for resolving chain names to domain IDs
|
|
631271
|
-
* @returns Artifact wrapper around IsmArtifactConfig suitable for artifact writers
|
|
631272
|
-
*
|
|
631273
|
-
* @example
|
|
631274
|
-
* ```typescript
|
|
631275
|
-
* // Config API format
|
|
631276
|
-
* const ismConfig: IsmConfig = {
|
|
631277
|
-
* type: 'domainRoutingIsm',
|
|
631278
|
-
* owner: '0x123...',
|
|
631279
|
-
* domains: {
|
|
631280
|
-
* ethereum: { type: 'merkleRootMultisigIsm', validators: [...], threshold: 2 },
|
|
631281
|
-
* polygon: '0xabc...' // address reference
|
|
631282
|
-
* }
|
|
631283
|
-
* };
|
|
631284
|
-
*
|
|
631285
|
-
* // Convert to Artifact API format
|
|
631286
|
-
* const artifact = ismConfigToArtifact(ismConfig, chainLookup);
|
|
631287
|
-
* // artifact.config.domains is now Record<number, Artifact<IsmArtifactConfig>>
|
|
631288
|
-
* // with numeric domain IDs and properly wrapped nested configs
|
|
631289
|
-
* ```
|
|
631290
|
-
*/
|
|
631291
|
-
function ismConfigToArtifact(config, chainLookup) {
|
|
631292
|
-
// Handle routing ISMs - need to convert chain names to domain IDs
|
|
631293
|
-
if (config.type === 'domainRoutingIsm') {
|
|
631294
|
-
const domains = {};
|
|
631295
|
-
for (const [chainName, nestedConfig] of Object.entries(config.domains)) {
|
|
631296
|
-
const domainId = chainLookup.getDomainId(chainName);
|
|
631297
|
-
if (!domainId) {
|
|
631298
|
-
// Skip unknown chains - they'll be warned about during deployment
|
|
631299
|
-
continue;
|
|
631300
|
-
}
|
|
631301
|
-
if (typeof nestedConfig === 'string') {
|
|
631302
|
-
// Address reference - create an UNDERIVED artifact
|
|
631303
|
-
// This represents a predeployed ISM with unspecified type
|
|
631304
|
-
// The routing ISM writer will pass it through without reading
|
|
631305
|
-
// Only readers will fetch its config from chain if needed
|
|
631306
|
-
domains[domainId] = {
|
|
631307
|
-
artifactState: dist_artifact/* ArtifactState */.O2.UNDERIVED,
|
|
631308
|
-
deployed: { address: nestedConfig },
|
|
631309
|
-
};
|
|
631310
|
-
}
|
|
631311
|
-
else {
|
|
631312
|
-
// Nested ISM config - recursively convert
|
|
631313
|
-
domains[domainId] = ismConfigToArtifact(nestedConfig, chainLookup);
|
|
631314
|
-
}
|
|
631315
|
-
}
|
|
631316
|
-
return {
|
|
631317
|
-
config: {
|
|
631318
|
-
type: 'domainRoutingIsm',
|
|
631319
|
-
owner: config.owner,
|
|
631320
|
-
domains,
|
|
631321
|
-
},
|
|
631322
|
-
};
|
|
631323
|
-
}
|
|
631324
|
-
// Other ISM types (multisig, testIsm) have identical config structure
|
|
631325
|
-
// between Config API and Artifact API - just wrap in artifact object
|
|
631326
|
-
return { artifactState: dist_artifact/* ArtifactState */.O2.NEW, config };
|
|
631327
|
-
}
|
|
631328
|
-
//# sourceMappingURL=ism-config-utils.js.map
|
|
631329
631205
|
;// CONCATENATED MODULE: ../deploy-sdk/dist/utils/validation.js
|
|
631330
631206
|
/**
|
|
631331
631207
|
* ISM types supported by provider-sdk for Alt-VM chains.
|
|
@@ -631402,7 +631278,6 @@ class UnsupportedIsmTypeError extends Error {
|
|
|
631402
631278
|
|
|
631403
631279
|
|
|
631404
631280
|
|
|
631405
|
-
|
|
631406
631281
|
class AltVMCoreModule_AltVMCoreModule {
|
|
631407
631282
|
chainLookup;
|
|
631408
631283
|
signer;
|
|
@@ -631461,7 +631336,7 @@ class AltVMCoreModule_AltVMCoreModule {
|
|
|
631461
631336
|
else {
|
|
631462
631337
|
// Deploy new ISM
|
|
631463
631338
|
const writer = createIsmWriter(metadata, chainLookup, signer);
|
|
631464
|
-
const artifact = ismConfigToArtifact(config.defaultIsm, chainLookup);
|
|
631339
|
+
const artifact = (0,ism/* ismConfigToArtifact */.HL)(config.defaultIsm, chainLookup);
|
|
631465
631340
|
const [deployed] = await writer.create(artifact);
|
|
631466
631341
|
defaultIsm = deployed.deployed.address;
|
|
631467
631342
|
}
|
|
@@ -631653,7 +631528,7 @@ class AltVMCoreModule_AltVMCoreModule {
|
|
|
631653
631528
|
// Read actual ISM state
|
|
631654
631529
|
const actualArtifact = await writer.read(actualDefaultIsmConfig.address);
|
|
631655
631530
|
// Convert expected config to artifact format
|
|
631656
|
-
const expectedArtifact = ismConfigToArtifact(expectDefaultIsmConfig, this.chainLookup);
|
|
631531
|
+
const expectedArtifact = (0,ism/* ismConfigToArtifact */.HL)(expectDefaultIsmConfig, this.chainLookup);
|
|
631657
631532
|
this.logger.info(`Comparing target ISM config with ${this.args.chain} chain`);
|
|
631658
631533
|
// Update existing ISM (only routing ISMs support updates)
|
|
631659
631534
|
// Merge artifacts to preserve DEPLOYED state for unchanged nested ISMs
|
|
@@ -631763,672 +631638,6 @@ class AltVMCoreModule_AltVMCoreModule {
|
|
|
631763
631638
|
}
|
|
631764
631639
|
}
|
|
631765
631640
|
//# sourceMappingURL=AltVMCoreModule.js.map
|
|
631766
|
-
// EXTERNAL MODULE: ../utils/dist/validation.js
|
|
631767
|
-
var validation = __nccwpck_require__(21387);
|
|
631768
|
-
// EXTERNAL MODULE: ../utils/dist/addresses.js
|
|
631769
|
-
var addresses = __nccwpck_require__(93142);
|
|
631770
|
-
// EXTERNAL MODULE: ../utils/dist/objects.js + 31 modules
|
|
631771
|
-
var objects = __nccwpck_require__(73938);
|
|
631772
|
-
// EXTERNAL MODULE: ../utils/dist/config.js
|
|
631773
|
-
var config = __nccwpck_require__(98474);
|
|
631774
|
-
// EXTERNAL MODULE: ../provider-sdk/dist/warp.js
|
|
631775
|
-
var warp = __nccwpck_require__(17791);
|
|
631776
|
-
;// CONCATENATED MODULE: ../deploy-sdk/dist/AltVMWarpDeployer.js
|
|
631777
|
-
|
|
631778
|
-
|
|
631779
|
-
class AltVMDeployer {
|
|
631780
|
-
signersMap;
|
|
631781
|
-
logger;
|
|
631782
|
-
constructor(signersMap) {
|
|
631783
|
-
this.signersMap = signersMap;
|
|
631784
|
-
this.logger = logging/* rootLogger */.Jk.child({ module: 'AltVMDeployer' });
|
|
631785
|
-
}
|
|
631786
|
-
async deploy(configMap) {
|
|
631787
|
-
const result = {};
|
|
631788
|
-
for (const chain of Object.keys(configMap)) {
|
|
631789
|
-
const config = configMap[chain];
|
|
631790
|
-
(0,validation/* assert */.v)(this.signersMap[chain], `No signer configured for ${chain}`);
|
|
631791
|
-
(0,validation/* assert */.v)(config, `No config configured for ${chain}`);
|
|
631792
|
-
this.logger.info(`Deploying ${config.type} token to chain ${chain}`);
|
|
631793
|
-
if (config.type === warp/* TokenType */.ks.native) {
|
|
631794
|
-
result[chain] = await this.deployNativeToken(chain, config.mailbox);
|
|
631795
|
-
}
|
|
631796
|
-
else if (config.type === warp/* TokenType */.ks.collateral) {
|
|
631797
|
-
result[chain] = await this.deployCollateralToken(chain, config.mailbox, config.token);
|
|
631798
|
-
}
|
|
631799
|
-
else if (config.type === warp/* TokenType */.ks.synthetic) {
|
|
631800
|
-
result[chain] = await this.deploySyntheticToken(chain, config.mailbox, config.name, config.symbol, config.decimals);
|
|
631801
|
-
}
|
|
631802
|
-
else {
|
|
631803
|
-
// This should never happen with proper type guards above
|
|
631804
|
-
const exhaustiveCheck = config;
|
|
631805
|
-
throw new Error(`Token type ${exhaustiveCheck.type} not supported on chain ${chain}`);
|
|
631806
|
-
}
|
|
631807
|
-
if (config.interchainSecurityModule &&
|
|
631808
|
-
typeof config.interchainSecurityModule === 'string') {
|
|
631809
|
-
this.logger.info(`Set ISM for token`);
|
|
631810
|
-
await this.signersMap[chain].setTokenIsm({
|
|
631811
|
-
tokenAddress: result[chain],
|
|
631812
|
-
ismAddress: config.interchainSecurityModule,
|
|
631813
|
-
});
|
|
631814
|
-
}
|
|
631815
|
-
this.logger.info(`Successfully deployed contracts on ${chain}`);
|
|
631816
|
-
}
|
|
631817
|
-
return result;
|
|
631818
|
-
}
|
|
631819
|
-
async deployNativeToken(chain, originMailbox) {
|
|
631820
|
-
this.logger.info(`Deploying native token to ${chain}`);
|
|
631821
|
-
const { tokenAddress } = await this.signersMap[chain].createNativeToken({
|
|
631822
|
-
mailboxAddress: originMailbox,
|
|
631823
|
-
});
|
|
631824
|
-
return tokenAddress;
|
|
631825
|
-
}
|
|
631826
|
-
async deployCollateralToken(chain, originMailbox, originDenom) {
|
|
631827
|
-
this.logger.info(`Deploying collateral token to ${chain}`);
|
|
631828
|
-
const { tokenAddress } = await this.signersMap[chain].createCollateralToken({
|
|
631829
|
-
mailboxAddress: originMailbox,
|
|
631830
|
-
collateralDenom: originDenom,
|
|
631831
|
-
});
|
|
631832
|
-
return tokenAddress;
|
|
631833
|
-
}
|
|
631834
|
-
async deploySyntheticToken(chain, originMailbox, name, denom, decimals) {
|
|
631835
|
-
this.logger.info(`Deploying synthetic token to ${chain}`);
|
|
631836
|
-
const { tokenAddress } = await this.signersMap[chain].createSyntheticToken({
|
|
631837
|
-
mailboxAddress: originMailbox,
|
|
631838
|
-
name: name || '',
|
|
631839
|
-
denom: denom || '',
|
|
631840
|
-
decimals: decimals || 0,
|
|
631841
|
-
});
|
|
631842
|
-
return tokenAddress;
|
|
631843
|
-
}
|
|
631844
|
-
}
|
|
631845
|
-
//# sourceMappingURL=AltVMWarpDeployer.js.map
|
|
631846
|
-
;// CONCATENATED MODULE: ../deploy-sdk/dist/AltVMWarpRouteReader.js
|
|
631847
|
-
|
|
631848
|
-
|
|
631849
|
-
|
|
631850
|
-
|
|
631851
|
-
|
|
631852
|
-
class AltVMWarpRouteReader_AltVMWarpRouteReader {
|
|
631853
|
-
chainMetadata;
|
|
631854
|
-
chainLookup;
|
|
631855
|
-
provider;
|
|
631856
|
-
logger;
|
|
631857
|
-
hookReader;
|
|
631858
|
-
ismReader;
|
|
631859
|
-
constructor(chainMetadata, chainLookup, provider) {
|
|
631860
|
-
this.chainMetadata = chainMetadata;
|
|
631861
|
-
this.chainLookup = chainLookup;
|
|
631862
|
-
this.provider = provider;
|
|
631863
|
-
this.hookReader = createHookReader(this.chainMetadata, this.chainLookup);
|
|
631864
|
-
this.logger = logging/* rootLogger */.Jk.child({
|
|
631865
|
-
module: AltVMWarpRouteReader_AltVMWarpRouteReader.name,
|
|
631866
|
-
});
|
|
631867
|
-
this.ismReader = createIsmReader(this.chainMetadata, this.chainLookup);
|
|
631868
|
-
}
|
|
631869
|
-
/**
|
|
631870
|
-
* Reads the configuration for a Warp Route at the given address.
|
|
631871
|
-
* Implements the HypReader interface.
|
|
631872
|
-
*
|
|
631873
|
-
* @param address - The address of the Warp Route contract.
|
|
631874
|
-
* @returns The derived Warp Route configuration.
|
|
631875
|
-
*/
|
|
631876
|
-
async read(address) {
|
|
631877
|
-
return this.deriveWarpRouteConfig(address);
|
|
631878
|
-
}
|
|
631879
|
-
/**
|
|
631880
|
-
* Derives the configuration for a Hyperlane ERC20 router contract at the given address.
|
|
631881
|
-
*
|
|
631882
|
-
* @param warpRouteAddress - The address of the Hyperlane ERC20 router contract.
|
|
631883
|
-
* @returns The configuration for the Hyperlane ERC20 router.
|
|
631884
|
-
*
|
|
631885
|
-
*/
|
|
631886
|
-
async deriveWarpRouteConfig(warpRouteAddress) {
|
|
631887
|
-
// Fetch token info once - this gives us type, metadata, owner, mailbox, ISM, etc.
|
|
631888
|
-
const token = await this.provider.getToken({
|
|
631889
|
-
tokenAddress: warpRouteAddress,
|
|
631890
|
-
});
|
|
631891
|
-
const remoteRouters = await this.fetchRemoteRouters(warpRouteAddress);
|
|
631892
|
-
const destinationGas = await this.fetchDestinationGas(warpRouteAddress);
|
|
631893
|
-
// Derive ISM config if present, otherwise use zero address
|
|
631894
|
-
const interchainSecurityModule = token.ismAddress && !(0,addresses/* isZeroishAddress */.Hi)(token.ismAddress)
|
|
631895
|
-
? await this.ismReader.deriveIsmConfig(token.ismAddress)
|
|
631896
|
-
: // TODO: replace with protocol-specific zero address
|
|
631897
|
-
'0x0000000000000000000000000000000000000000';
|
|
631898
|
-
// Hook address is not exposed by providers yet, use zero address as placeholder
|
|
631899
|
-
// TODO: replace with protocol-specific zero address
|
|
631900
|
-
let hook;
|
|
631901
|
-
if (this.chainMetadata.protocol !== dist/* ProtocolType */.Hb.Aleo) {
|
|
631902
|
-
hook = '0x0000000000000000000000000000000000000000';
|
|
631903
|
-
}
|
|
631904
|
-
else {
|
|
631905
|
-
hook =
|
|
631906
|
-
// Not using isNullish because some protocol impl might return an empty string
|
|
631907
|
-
token.hookAddress && !(0,addresses/* isZeroishAddress */.Hi)(token.hookAddress)
|
|
631908
|
-
? await this.hookReader.deriveHookConfig(token.hookAddress)
|
|
631909
|
-
: '0x0000000000000000000000000000000000000000';
|
|
631910
|
-
}
|
|
631911
|
-
const baseConfig = {
|
|
631912
|
-
owner: token.owner,
|
|
631913
|
-
mailbox: token.mailboxAddress,
|
|
631914
|
-
interchainSecurityModule,
|
|
631915
|
-
hook,
|
|
631916
|
-
remoteRouters,
|
|
631917
|
-
destinationGas,
|
|
631918
|
-
name: token.name ?? undefined,
|
|
631919
|
-
symbol: token.symbol ?? undefined,
|
|
631920
|
-
decimals: token.decimals ?? undefined,
|
|
631921
|
-
};
|
|
631922
|
-
// Return discriminated union based on type
|
|
631923
|
-
switch (token.tokenType) {
|
|
631924
|
-
case dist/* AltVM.TokenType */.bx.ks.native: {
|
|
631925
|
-
const nativeConfig = {
|
|
631926
|
-
...baseConfig,
|
|
631927
|
-
type: warp/* TokenType */.ks.native,
|
|
631928
|
-
};
|
|
631929
|
-
return nativeConfig;
|
|
631930
|
-
}
|
|
631931
|
-
case dist/* AltVM.TokenType */.bx.ks.collateral: {
|
|
631932
|
-
const collateralConfig = {
|
|
631933
|
-
...baseConfig,
|
|
631934
|
-
type: warp/* TokenType */.ks.collateral,
|
|
631935
|
-
token: token.denom, // The underlying collateral denom
|
|
631936
|
-
};
|
|
631937
|
-
return collateralConfig;
|
|
631938
|
-
}
|
|
631939
|
-
case dist/* AltVM.TokenType */.bx.ks.synthetic: {
|
|
631940
|
-
const syntheticConfig = {
|
|
631941
|
-
...baseConfig,
|
|
631942
|
-
type: warp/* TokenType */.ks.synthetic,
|
|
631943
|
-
};
|
|
631944
|
-
return syntheticConfig;
|
|
631945
|
-
}
|
|
631946
|
-
default:
|
|
631947
|
-
throw new Error(`Failed to determine token type for address ${warpRouteAddress}`);
|
|
631948
|
-
}
|
|
631949
|
-
}
|
|
631950
|
-
/**
|
|
631951
|
-
* Derives the token type for a given Warp Route address using specific methods
|
|
631952
|
-
*
|
|
631953
|
-
* @param warpRouteAddress - The Warp Route address to derive the token type for.
|
|
631954
|
-
* @returns The derived TokenType, which can be either 'collateral' or 'synthetic'.
|
|
631955
|
-
* @throws Error if the token type is not supported (i.e., not collateral or synthetic).
|
|
631956
|
-
*/
|
|
631957
|
-
async deriveTokenType(warpRouteAddress) {
|
|
631958
|
-
const token = await this.provider.getToken({
|
|
631959
|
-
tokenAddress: warpRouteAddress,
|
|
631960
|
-
});
|
|
631961
|
-
switch (token.tokenType) {
|
|
631962
|
-
case dist/* AltVM.TokenType */.bx.ks.native:
|
|
631963
|
-
return warp/* TokenType */.ks.native;
|
|
631964
|
-
case dist/* AltVM.TokenType */.bx.ks.collateral:
|
|
631965
|
-
return warp/* TokenType */.ks.collateral;
|
|
631966
|
-
case dist/* AltVM.TokenType */.bx.ks.synthetic:
|
|
631967
|
-
return warp/* TokenType */.ks.synthetic;
|
|
631968
|
-
default:
|
|
631969
|
-
throw new Error(`Failed to determine token type for address ${warpRouteAddress}`);
|
|
631970
|
-
}
|
|
631971
|
-
}
|
|
631972
|
-
/**
|
|
631973
|
-
* Fetches the base metadata for a Warp Route contract.
|
|
631974
|
-
*
|
|
631975
|
-
* @param routerAddress - The address of the Warp Route contract.
|
|
631976
|
-
* @returns The base metadata for the Warp Route contract, including the mailbox, owner, hook, and ism.
|
|
631977
|
-
*/
|
|
631978
|
-
async fetchMailboxClientConfig(routerAddress) {
|
|
631979
|
-
const token = await this.provider.getToken({
|
|
631980
|
-
tokenAddress: routerAddress,
|
|
631981
|
-
});
|
|
631982
|
-
const config = {
|
|
631983
|
-
mailbox: token.mailboxAddress,
|
|
631984
|
-
owner: token.owner,
|
|
631985
|
-
};
|
|
631986
|
-
if (token.ismAddress) {
|
|
631987
|
-
const derivedIsm = await this.ismReader.deriveIsmConfig(token.ismAddress);
|
|
631988
|
-
config.interchainSecurityModule = derivedIsm;
|
|
631989
|
-
}
|
|
631990
|
-
return config;
|
|
631991
|
-
}
|
|
631992
|
-
async fetchRemoteRouters(warpRouteAddress) {
|
|
631993
|
-
const { remoteRouters } = await this.provider.getRemoteRouters({
|
|
631994
|
-
tokenAddress: warpRouteAddress,
|
|
631995
|
-
});
|
|
631996
|
-
const routers = {};
|
|
631997
|
-
for (const router of remoteRouters) {
|
|
631998
|
-
routers[router.receiverDomainId] = {
|
|
631999
|
-
address: (0,addresses/* ensure0x */.Ho)(router.receiverAddress),
|
|
632000
|
-
};
|
|
632001
|
-
}
|
|
632002
|
-
return routers;
|
|
632003
|
-
}
|
|
632004
|
-
async fetchDestinationGas(warpRouteAddress) {
|
|
632005
|
-
const { remoteRouters } = await this.provider.getRemoteRouters({
|
|
632006
|
-
tokenAddress: warpRouteAddress,
|
|
632007
|
-
});
|
|
632008
|
-
return Object.fromEntries(remoteRouters.map((routerConfig) => [
|
|
632009
|
-
routerConfig.receiverDomainId,
|
|
632010
|
-
routerConfig.gas,
|
|
632011
|
-
]));
|
|
632012
|
-
}
|
|
632013
|
-
}
|
|
632014
|
-
//# sourceMappingURL=AltVMWarpRouteReader.js.map
|
|
632015
|
-
;// CONCATENATED MODULE: ../deploy-sdk/dist/AltVMWarpModule.js
|
|
632016
|
-
|
|
632017
|
-
|
|
632018
|
-
|
|
632019
|
-
|
|
632020
|
-
|
|
632021
|
-
|
|
632022
|
-
|
|
632023
|
-
|
|
632024
|
-
|
|
632025
|
-
|
|
632026
|
-
class AltVMWarpModule_AltVMWarpModule {
|
|
632027
|
-
chainLookup;
|
|
632028
|
-
signer;
|
|
632029
|
-
args;
|
|
632030
|
-
logger;
|
|
632031
|
-
reader;
|
|
632032
|
-
chainName;
|
|
632033
|
-
constructor(chainLookup, signer, args) {
|
|
632034
|
-
this.chainLookup = chainLookup;
|
|
632035
|
-
this.signer = signer;
|
|
632036
|
-
this.args = args;
|
|
632037
|
-
const metadata = chainLookup.getChainMetadata(args.chain);
|
|
632038
|
-
this.chainName = metadata.name;
|
|
632039
|
-
this.reader = new AltVMWarpRouteReader_AltVMWarpRouteReader(metadata, chainLookup, signer);
|
|
632040
|
-
this.logger = logging/* rootLogger */.Jk.child({
|
|
632041
|
-
module: AltVMWarpModule_AltVMWarpModule.name,
|
|
632042
|
-
});
|
|
632043
|
-
}
|
|
632044
|
-
/**
|
|
632045
|
-
* Retrieves the token router configuration for the specified address.
|
|
632046
|
-
*
|
|
632047
|
-
* @param address - The address to derive the token router configuration from.
|
|
632048
|
-
* @returns A promise that resolves to the token router configuration.
|
|
632049
|
-
*/
|
|
632050
|
-
async read() {
|
|
632051
|
-
return this.reader.deriveWarpRouteConfig(this.args.addresses.deployedTokenRoute);
|
|
632052
|
-
}
|
|
632053
|
-
serialize() {
|
|
632054
|
-
return this.args.addresses;
|
|
632055
|
-
}
|
|
632056
|
-
/**
|
|
632057
|
-
* Updates the Warp Route contract with the provided configuration.
|
|
632058
|
-
*
|
|
632059
|
-
* @param expectedConfig - The configuration for the token router to be updated.
|
|
632060
|
-
* @returns An array of transactions that were executed to update the contract, or an error if the update failed.
|
|
632061
|
-
*/
|
|
632062
|
-
async update(expectedConfig) {
|
|
632063
|
-
const actualConfig = await this.read();
|
|
632064
|
-
const transactions = [];
|
|
632065
|
-
/**
|
|
632066
|
-
* @remark
|
|
632067
|
-
* The order of operations matter
|
|
632068
|
-
* createOwnershipUpdateTxs() must always be LAST because no updates possible after ownership transferred
|
|
632069
|
-
*/
|
|
632070
|
-
transactions.push(...(await this.createIsmUpdateTxs(actualConfig, expectedConfig)), ...(await this.createHookUpdateTxs(actualConfig, expectedConfig)), ...(await this.createRemoteRouterUpdateTxs(actualConfig, expectedConfig)), ...(await this.createOwnershipUpdateTxs(actualConfig, expectedConfig)));
|
|
632071
|
-
return transactions;
|
|
632072
|
-
}
|
|
632073
|
-
/**
|
|
632074
|
-
* Create transactions to update the remote routers for the Warp Route contract.
|
|
632075
|
-
*
|
|
632076
|
-
* @param actualConfig - The on-chain router configuration, including the remoteRouters array.
|
|
632077
|
-
* @param expectedConfig - The expected token router configuration.
|
|
632078
|
-
* @returns An array with transactions that need to be executed to enroll the routers
|
|
632079
|
-
*/
|
|
632080
|
-
async createRemoteRouterUpdateTxs(actualConfig, expectedConfig) {
|
|
632081
|
-
this.logger.debug(`Start creating remote router update transactions`);
|
|
632082
|
-
const updateTransactions = [];
|
|
632083
|
-
if (!expectedConfig.remoteRouters) {
|
|
632084
|
-
return [];
|
|
632085
|
-
}
|
|
632086
|
-
(0,validation/* assert */.v)(actualConfig.remoteRouters, 'actualRemoteRouters is undefined');
|
|
632087
|
-
(0,validation/* assert */.v)(expectedConfig.remoteRouters, 'expectedRemoteRouters is undefined');
|
|
632088
|
-
(0,validation/* assert */.v)(actualConfig.destinationGas, 'actualDestinationGas is undefined');
|
|
632089
|
-
(0,validation/* assert */.v)(expectedConfig.destinationGas, 'expectedDestinationGas is undefined');
|
|
632090
|
-
const { remoteRouters: actualRemoteRouters } = actualConfig;
|
|
632091
|
-
const { remoteRouters: expectedRemoteRouters } = expectedConfig;
|
|
632092
|
-
const { destinationGas: actualDestinationGas } = actualConfig;
|
|
632093
|
-
const { destinationGas: expectedDestinationGas } = expectedConfig;
|
|
632094
|
-
// perform checks if domain Ids match between remote router
|
|
632095
|
-
// and destination gas configs
|
|
632096
|
-
const actualRemoteRoutersString = Object.keys(actualRemoteRouters)
|
|
632097
|
-
.sort()
|
|
632098
|
-
.toString();
|
|
632099
|
-
const actualDestinationGasString = Object.keys(actualDestinationGas)
|
|
632100
|
-
.sort()
|
|
632101
|
-
.toString();
|
|
632102
|
-
const expectedRemoteRoutersString = Object.keys(expectedRemoteRouters)
|
|
632103
|
-
.sort()
|
|
632104
|
-
.toString();
|
|
632105
|
-
const expectedDestinationGasString = Object.keys(expectedDestinationGas)
|
|
632106
|
-
.sort()
|
|
632107
|
-
.toString();
|
|
632108
|
-
(0,validation/* assert */.v)(actualRemoteRoutersString === actualDestinationGasString, `domain Ids from actual remote router config differ from actual destination gas config: ${actualRemoteRoutersString} : ${actualDestinationGasString}`);
|
|
632109
|
-
(0,validation/* assert */.v)(expectedRemoteRoutersString === expectedDestinationGasString, `domain Ids from expected remote router config differ from actual destination gas config: ${expectedRemoteRoutersString} : ${expectedDestinationGasString}`);
|
|
632110
|
-
const routesToEnroll = [];
|
|
632111
|
-
const routesToUnenroll = [];
|
|
632112
|
-
// get domain Ids where we need to enroll, if the address
|
|
632113
|
-
// or the gas updates inside a remote route we need to unenroll
|
|
632114
|
-
// and enroll again
|
|
632115
|
-
for (const domainId of Object.keys(expectedRemoteRouters)) {
|
|
632116
|
-
if (!actualRemoteRouters[domainId]) {
|
|
632117
|
-
routesToEnroll.push(domainId);
|
|
632118
|
-
continue;
|
|
632119
|
-
}
|
|
632120
|
-
if (actualRemoteRouters[domainId].address !==
|
|
632121
|
-
expectedRemoteRouters[domainId].address) {
|
|
632122
|
-
routesToEnroll.push(domainId);
|
|
632123
|
-
routesToUnenroll.push(domainId);
|
|
632124
|
-
continue;
|
|
632125
|
-
}
|
|
632126
|
-
if (actualDestinationGas[domainId] !== expectedDestinationGas[domainId]) {
|
|
632127
|
-
routesToEnroll.push(domainId);
|
|
632128
|
-
routesToUnenroll.push(domainId);
|
|
632129
|
-
continue;
|
|
632130
|
-
}
|
|
632131
|
-
}
|
|
632132
|
-
// get domain Ids where we need to unenroll
|
|
632133
|
-
for (const domainId of Object.keys(actualRemoteRouters)) {
|
|
632134
|
-
if (!expectedRemoteRouters[domainId]) {
|
|
632135
|
-
routesToUnenroll.push(domainId);
|
|
632136
|
-
}
|
|
632137
|
-
}
|
|
632138
|
-
if (routesToEnroll.length === 0 && routesToUnenroll.length === 0) {
|
|
632139
|
-
this.logger.debug(`No routes to change. No updates needed.`);
|
|
632140
|
-
return [];
|
|
632141
|
-
}
|
|
632142
|
-
// first be unenroll all routes that need to be unenrolled,
|
|
632143
|
-
// afterwards we enroll again
|
|
632144
|
-
for (const domainId of routesToUnenroll) {
|
|
632145
|
-
updateTransactions.push({
|
|
632146
|
-
annotation: `Unenrolling Router ${this.args.addresses.deployedTokenRoute} on ${this.args.chain}`,
|
|
632147
|
-
...(await this.signer.getUnenrollRemoteRouterTransaction({
|
|
632148
|
-
signer: actualConfig.owner,
|
|
632149
|
-
tokenAddress: this.args.addresses.deployedTokenRoute,
|
|
632150
|
-
receiverDomainId: parseInt(domainId),
|
|
632151
|
-
})),
|
|
632152
|
-
});
|
|
632153
|
-
}
|
|
632154
|
-
for (const domainId of routesToEnroll) {
|
|
632155
|
-
updateTransactions.push({
|
|
632156
|
-
annotation: `Enrolling Router ${this.args.addresses.deployedTokenRoute} on ${this.args.chain}`,
|
|
632157
|
-
...(await this.signer.getEnrollRemoteRouterTransaction({
|
|
632158
|
-
signer: actualConfig.owner,
|
|
632159
|
-
tokenAddress: this.args.addresses.deployedTokenRoute,
|
|
632160
|
-
remoteRouter: {
|
|
632161
|
-
receiverDomainId: parseInt(domainId),
|
|
632162
|
-
receiverAddress: (0,addresses/* addressToBytes32 */.In)(expectedRemoteRouters[domainId].address),
|
|
632163
|
-
gas: expectedDestinationGas[domainId],
|
|
632164
|
-
},
|
|
632165
|
-
})),
|
|
632166
|
-
});
|
|
632167
|
-
}
|
|
632168
|
-
this.logger.debug(`Created ${updateTransactions.length} remote router update transactions.`);
|
|
632169
|
-
return updateTransactions;
|
|
632170
|
-
}
|
|
632171
|
-
/**
|
|
632172
|
-
* Create transactions to update an existing ISM config, or deploy a new ISM and return a tx to setInterchainSecurityModule
|
|
632173
|
-
*
|
|
632174
|
-
* @param actualConfig - The on-chain router configuration, including the ISM configuration, and address.
|
|
632175
|
-
* @param expectedConfig - The expected token router configuration, including the ISM configuration.
|
|
632176
|
-
* @returns transaction that need to be executed to update the ISM configuration.
|
|
632177
|
-
*/
|
|
632178
|
-
async createIsmUpdateTxs(actualConfig, expectedConfig) {
|
|
632179
|
-
this.logger.debug(`Start creating token ISM update transactions`);
|
|
632180
|
-
const updateTransactions = [];
|
|
632181
|
-
if (actualConfig.interchainSecurityModule ===
|
|
632182
|
-
expectedConfig.interchainSecurityModule) {
|
|
632183
|
-
this.logger.debug(`Token ISM config is the same as target. No updates needed.`);
|
|
632184
|
-
return updateTransactions;
|
|
632185
|
-
}
|
|
632186
|
-
const actualDeployedIsm = actualConfig.interchainSecurityModule?.address ??
|
|
632187
|
-
'';
|
|
632188
|
-
const actualIsmIsNonZero = actualDeployedIsm && !(0,addresses/* isZeroishAddress */.Hi)(actualDeployedIsm);
|
|
632189
|
-
const expectedIsmIsEmpty = !expectedConfig.interchainSecurityModule ||
|
|
632190
|
-
(typeof expectedConfig.interchainSecurityModule === 'string' &&
|
|
632191
|
-
(0,addresses/* isZeroishAddress */.Hi)(expectedConfig.interchainSecurityModule));
|
|
632192
|
-
// If expected ISM is empty/zero but actual ISM exists, reset to zero address if
|
|
632193
|
-
// the protocol type is not cosmos as the underlying implementation does not support
|
|
632194
|
-
// resetting to the default ism yet (will be fixed in the next release of the cosmos sdk)
|
|
632195
|
-
const metadata = this.chainLookup.getChainMetadata(this.args.chain);
|
|
632196
|
-
if (expectedIsmIsEmpty && actualIsmIsNonZero) {
|
|
632197
|
-
if (metadata.protocol === dist/* ProtocolType */.Hb.CosmosNative) {
|
|
632198
|
-
this.logger.warn(`CosmosNative does not support unsetting token ISM. Skipping reset from ${actualDeployedIsm} to zero address.`);
|
|
632199
|
-
return updateTransactions;
|
|
632200
|
-
}
|
|
632201
|
-
this.logger.debug(`Resetting ISM from ${actualDeployedIsm} to zero address`);
|
|
632202
|
-
return [
|
|
632203
|
-
{
|
|
632204
|
-
annotation: `Resetting ISM for Warp Route to zero address`,
|
|
632205
|
-
...(await this.signer.getSetTokenIsmTransaction({
|
|
632206
|
-
signer: actualConfig.owner,
|
|
632207
|
-
tokenAddress: this.args.addresses.deployedTokenRoute,
|
|
632208
|
-
})),
|
|
632209
|
-
},
|
|
632210
|
-
];
|
|
632211
|
-
}
|
|
632212
|
-
// If both are empty/zero, no updates needed
|
|
632213
|
-
if (expectedIsmIsEmpty) {
|
|
632214
|
-
this.logger.debug(`Token ISM config is empty. No updates needed.`);
|
|
632215
|
-
return updateTransactions;
|
|
632216
|
-
}
|
|
632217
|
-
// Try to update (may also deploy) Ism with the expected config
|
|
632218
|
-
const { deployedIsm: expectedDeployedIsm, updateTransactions: ismUpdateTransactions, } = await this.deployOrUpdateIsm(actualConfig, expectedConfig);
|
|
632219
|
-
// If an ISM is updated in-place, push the update txs
|
|
632220
|
-
updateTransactions.push(...ismUpdateTransactions);
|
|
632221
|
-
// If a new ISM is deployed, push the setInterchainSecurityModule tx
|
|
632222
|
-
if (actualDeployedIsm !== expectedDeployedIsm) {
|
|
632223
|
-
updateTransactions.push({
|
|
632224
|
-
annotation: `Setting ISM for Warp Route to ${expectedDeployedIsm}`,
|
|
632225
|
-
...(await this.signer.getSetTokenIsmTransaction({
|
|
632226
|
-
signer: actualConfig.owner,
|
|
632227
|
-
tokenAddress: this.args.addresses.deployedTokenRoute,
|
|
632228
|
-
ismAddress: expectedDeployedIsm,
|
|
632229
|
-
})),
|
|
632230
|
-
});
|
|
632231
|
-
}
|
|
632232
|
-
this.logger.debug(`Created ${updateTransactions.length} update token ISM transactions.`);
|
|
632233
|
-
return updateTransactions;
|
|
632234
|
-
}
|
|
632235
|
-
/**
|
|
632236
|
-
* Create transactions to update an existing Hook config, or deploy a new Hook and return a tx to setHook
|
|
632237
|
-
*
|
|
632238
|
-
* @param actualConfig - The on-chain router configuration, including the ISM configuration, and address.
|
|
632239
|
-
* @param expectedConfig - The expected token router configuration, including the ISM configuration.
|
|
632240
|
-
* @returns transaction that need to be executed to update the ISM configuration.
|
|
632241
|
-
*/
|
|
632242
|
-
async createHookUpdateTxs(actualConfig, expectedConfig) {
|
|
632243
|
-
this.logger.debug(`Start creating token Hook update transactions`);
|
|
632244
|
-
const updateTransactions = [];
|
|
632245
|
-
// Only Aleo supports hook updates for AltVM chains
|
|
632246
|
-
const metadata = this.chainLookup.getChainMetadata(this.args.chain);
|
|
632247
|
-
if (metadata.protocol !== dist/* ProtocolType */.Hb.Aleo) {
|
|
632248
|
-
this.logger.debug(`Hook updates not supported for protocol ${metadata.protocol}. Skipping.`);
|
|
632249
|
-
return updateTransactions;
|
|
632250
|
-
}
|
|
632251
|
-
if ((0,objects/* deepEquals */.c2)((0,config/* normalizeConfig */.I)(actualConfig.hook), (0,config/* normalizeConfig */.I)(expectedConfig.hook))) {
|
|
632252
|
-
this.logger.debug(`Token Hook config is the same as target. No updates needed.`);
|
|
632253
|
-
return updateTransactions;
|
|
632254
|
-
}
|
|
632255
|
-
const actualDeployedHook = actualConfig.hook?.address ?? '';
|
|
632256
|
-
const actualHookIsNonZero = actualDeployedHook && !(0,addresses/* isZeroishAddress */.Hi)(actualDeployedHook);
|
|
632257
|
-
const expectedHookIsEmpty = !expectedConfig.hook ||
|
|
632258
|
-
(typeof expectedConfig.hook === 'string' &&
|
|
632259
|
-
(0,addresses/* isZeroishAddress */.Hi)(expectedConfig.hook));
|
|
632260
|
-
if (expectedHookIsEmpty && actualHookIsNonZero) {
|
|
632261
|
-
this.logger.debug(`Resetting Hook from ${actualDeployedHook} to zero address`);
|
|
632262
|
-
return [
|
|
632263
|
-
{
|
|
632264
|
-
annotation: `Resetting Hook for Warp Route to zero address`,
|
|
632265
|
-
...(await this.signer.getSetTokenHookTransaction({
|
|
632266
|
-
signer: actualConfig.owner,
|
|
632267
|
-
tokenAddress: this.args.addresses.deployedTokenRoute,
|
|
632268
|
-
})),
|
|
632269
|
-
},
|
|
632270
|
-
];
|
|
632271
|
-
}
|
|
632272
|
-
// If both are empty/zero, no updates needed
|
|
632273
|
-
if (expectedHookIsEmpty) {
|
|
632274
|
-
this.logger.debug(`Token Hook config is empty. No updates needed.`);
|
|
632275
|
-
return updateTransactions;
|
|
632276
|
-
}
|
|
632277
|
-
// Try to update (may also deploy) Hook with the expected config
|
|
632278
|
-
const { deployedHook: expectedDeployedHook, updateTransactions: hookUpdateTransactions, } = await this.deployOrUpdateHook(actualConfig, expectedConfig);
|
|
632279
|
-
// If an Hook is updated in-place, push the update txs
|
|
632280
|
-
updateTransactions.push(...hookUpdateTransactions);
|
|
632281
|
-
// If a new Hook is deployed, push the setHook tx
|
|
632282
|
-
if (actualDeployedHook !== expectedDeployedHook) {
|
|
632283
|
-
updateTransactions.push({
|
|
632284
|
-
annotation: `Setting Hook for Warp Route to ${expectedDeployedHook}`,
|
|
632285
|
-
...(await this.signer.getSetTokenHookTransaction({
|
|
632286
|
-
signer: actualConfig.owner,
|
|
632287
|
-
tokenAddress: this.args.addresses.deployedTokenRoute,
|
|
632288
|
-
hookAddress: expectedDeployedHook,
|
|
632289
|
-
})),
|
|
632290
|
-
});
|
|
632291
|
-
}
|
|
632292
|
-
this.logger.debug(`Created ${updateTransactions.length} update token Hook transactions.`);
|
|
632293
|
-
return updateTransactions;
|
|
632294
|
-
}
|
|
632295
|
-
/**
|
|
632296
|
-
* Transfer ownership of an existing Warp route with a given config.
|
|
632297
|
-
*
|
|
632298
|
-
* @param actualConfig - The on-chain router configuration.
|
|
632299
|
-
* @param expectedConfig - The expected token router configuration.
|
|
632300
|
-
* @returns transaction that need to be executed to update the owner.
|
|
632301
|
-
*/
|
|
632302
|
-
async createOwnershipUpdateTxs(actualConfig, expectedConfig) {
|
|
632303
|
-
this.logger.debug(`Start creating token owner update transactions`);
|
|
632304
|
-
if (actualConfig.owner === expectedConfig.owner) {
|
|
632305
|
-
this.logger.debug(`Token owner is the same as target. No updates needed.`);
|
|
632306
|
-
return [];
|
|
632307
|
-
}
|
|
632308
|
-
this.logger.debug(`Created 1 update token owner update transaction.`);
|
|
632309
|
-
return [
|
|
632310
|
-
{
|
|
632311
|
-
annotation: `Transferring ownership of ${this.args.addresses.deployedTokenRoute} from ${actualConfig.owner} to ${expectedConfig.owner}`,
|
|
632312
|
-
...(await this.signer.getSetTokenOwnerTransaction({
|
|
632313
|
-
signer: actualConfig.owner,
|
|
632314
|
-
tokenAddress: this.args.addresses.deployedTokenRoute,
|
|
632315
|
-
newOwner: expectedConfig.owner,
|
|
632316
|
-
})),
|
|
632317
|
-
},
|
|
632318
|
-
];
|
|
632319
|
-
}
|
|
632320
|
-
/**
|
|
632321
|
-
* Updates or deploys the ISM using the provided configuration.
|
|
632322
|
-
*
|
|
632323
|
-
* @returns Object with deployedIsm address, and update Transactions
|
|
632324
|
-
*/
|
|
632325
|
-
async deployOrUpdateIsm(actualConfig, expectedConfig) {
|
|
632326
|
-
this.logger.debug(`Start deploying token ISM`);
|
|
632327
|
-
(0,validation/* assert */.v)(expectedConfig.interchainSecurityModule, 'Ism derived incorrectly');
|
|
632328
|
-
// Validate ISM configuration is supported by provider-sdk
|
|
632329
|
-
validateIsmConfig(expectedConfig.interchainSecurityModule, this.chainName, 'warp route ISM');
|
|
632330
|
-
// If ISM is an address reference, use it directly without updates
|
|
632331
|
-
if (typeof expectedConfig.interchainSecurityModule === 'string') {
|
|
632332
|
-
return {
|
|
632333
|
-
deployedIsm: expectedConfig.interchainSecurityModule,
|
|
632334
|
-
updateTransactions: [],
|
|
632335
|
-
};
|
|
632336
|
-
}
|
|
632337
|
-
const metadata = this.chainLookup.getChainMetadata(this.args.chain);
|
|
632338
|
-
const writer = createIsmWriter(metadata, this.chainLookup, this.signer);
|
|
632339
|
-
const actualIsmAddress = actualConfig.interchainSecurityModule?.address ??
|
|
632340
|
-
'';
|
|
632341
|
-
// Convert expected config to artifact format
|
|
632342
|
-
const expectedArtifact = ismConfigToArtifact(expectedConfig.interchainSecurityModule, this.chainLookup);
|
|
632343
|
-
// If no existing ISM, deploy new one directly (no comparison needed)
|
|
632344
|
-
if (!actualIsmAddress) {
|
|
632345
|
-
this.logger.debug(`No existing ISM found, deploying new one`);
|
|
632346
|
-
const [deployed] = await writer.create(expectedArtifact);
|
|
632347
|
-
return {
|
|
632348
|
-
deployedIsm: deployed.deployed.address,
|
|
632349
|
-
updateTransactions: [],
|
|
632350
|
-
};
|
|
632351
|
-
}
|
|
632352
|
-
// Read actual ISM state (only when we have existing ISM to compare)
|
|
632353
|
-
const actualArtifact = await writer.read(actualIsmAddress);
|
|
632354
|
-
this.logger.debug(`Comparing target ISM config with ${this.args.chain} chain`);
|
|
632355
|
-
// Update existing ISM (only routing ISMs support updates)
|
|
632356
|
-
// Merge artifacts to preserve DEPLOYED state for unchanged nested ISMs
|
|
632357
|
-
const mergedArtifact = (0,ism/* mergeIsmArtifacts */.FE)(actualArtifact, expectedArtifact);
|
|
632358
|
-
// If merge resulted in NEW state, deploy it
|
|
632359
|
-
if ((0,dist_artifact/* isArtifactNew */.v_)(mergedArtifact)) {
|
|
632360
|
-
const [deployed] = await writer.create(mergedArtifact);
|
|
632361
|
-
return {
|
|
632362
|
-
deployedIsm: deployed.deployed.address,
|
|
632363
|
-
updateTransactions: [],
|
|
632364
|
-
};
|
|
632365
|
-
}
|
|
632366
|
-
else {
|
|
632367
|
-
// Otherwise update in-place (artifact is DEPLOYED)
|
|
632368
|
-
const updateTransactions = await writer.update(mergedArtifact);
|
|
632369
|
-
return {
|
|
632370
|
-
deployedIsm: mergedArtifact.deployed.address,
|
|
632371
|
-
updateTransactions,
|
|
632372
|
-
};
|
|
632373
|
-
}
|
|
632374
|
-
}
|
|
632375
|
-
/**
|
|
632376
|
-
* Updates or deploys the Hook using the provided configuration.
|
|
632377
|
-
*
|
|
632378
|
-
* @returns Object with deployedHook address, and update Transactions
|
|
632379
|
-
*/
|
|
632380
|
-
async deployOrUpdateHook(actualConfig, expectedConfig) {
|
|
632381
|
-
this.logger.debug(`Start deploying token Hook`);
|
|
632382
|
-
(0,validation/* assert */.v)(expectedConfig.hook, 'Hook derived incorrectly');
|
|
632383
|
-
// If expected hook is an address reference, use it directly
|
|
632384
|
-
if (typeof expectedConfig.hook === 'string') {
|
|
632385
|
-
return {
|
|
632386
|
-
deployedHook: expectedConfig.hook,
|
|
632387
|
-
updateTransactions: [],
|
|
632388
|
-
};
|
|
632389
|
-
}
|
|
632390
|
-
const metadata = this.chainLookup.getChainMetadata(this.args.chain);
|
|
632391
|
-
const writer = createHookWriter(metadata, this.chainLookup, this.signer, {
|
|
632392
|
-
mailbox: expectedConfig.mailbox,
|
|
632393
|
-
});
|
|
632394
|
-
const actualHookAddress = actualConfig.hook?.address ?? '';
|
|
632395
|
-
this.logger.debug(`Comparing target Hook config with ${this.args.chain} chain`);
|
|
632396
|
-
// Use the new deployOrUpdate method from HookWriter
|
|
632397
|
-
const result = await writer.deployOrUpdate({
|
|
632398
|
-
actualAddress: actualHookAddress || undefined,
|
|
632399
|
-
expectedConfig: expectedConfig.hook,
|
|
632400
|
-
});
|
|
632401
|
-
return {
|
|
632402
|
-
deployedHook: result.address,
|
|
632403
|
-
updateTransactions: result.transactions,
|
|
632404
|
-
};
|
|
632405
|
-
}
|
|
632406
|
-
/**
|
|
632407
|
-
* Deploys the Warp Route.
|
|
632408
|
-
*
|
|
632409
|
-
* @param chain - The chain to deploy the module on.
|
|
632410
|
-
* @param config - The configuration for the token router.
|
|
632411
|
-
* @param chainLookup - Chain metadata lookup functions
|
|
632412
|
-
* @param signer - The AltVM signing client
|
|
632413
|
-
* @returns A new instance of the AltVMWarpModule.
|
|
632414
|
-
*/
|
|
632415
|
-
static async create(params) {
|
|
632416
|
-
const deployer = new AltVMDeployer({
|
|
632417
|
-
[params.chain]: params.signer,
|
|
632418
|
-
});
|
|
632419
|
-
const { [params.chain]: deployedTokenRoute } = await deployer.deploy({
|
|
632420
|
-
[params.chain]: params.config,
|
|
632421
|
-
});
|
|
632422
|
-
return new AltVMWarpModule_AltVMWarpModule(params.chainLookup, params.signer, {
|
|
632423
|
-
addresses: {
|
|
632424
|
-
deployedTokenRoute,
|
|
632425
|
-
},
|
|
632426
|
-
chain: params.chain,
|
|
632427
|
-
config: params.config,
|
|
632428
|
-
});
|
|
632429
|
-
}
|
|
632430
|
-
}
|
|
632431
|
-
//# sourceMappingURL=AltVMWarpModule.js.map
|
|
632432
631641
|
;// CONCATENATED MODULE: ../deploy-sdk/dist/core-module.js
|
|
632433
631642
|
|
|
632434
631643
|
|
|
@@ -632458,35 +631667,351 @@ function coreModuleProvider(chainLookup, chainMetadata) {
|
|
|
632458
631667
|
return new CoreModuleProvider(chainLookup, chainMetadata);
|
|
632459
631668
|
}
|
|
632460
631669
|
//# sourceMappingURL=core-module.js.map
|
|
632461
|
-
|
|
631670
|
+
// EXTERNAL MODULE: ../provider-sdk/dist/warp.js
|
|
631671
|
+
var warp = __nccwpck_require__(17791);
|
|
631672
|
+
;// CONCATENATED MODULE: ../deploy-sdk/dist/warp/warp-reader.js
|
|
632462
631673
|
|
|
632463
631674
|
|
|
632464
|
-
|
|
632465
|
-
|
|
631675
|
+
|
|
631676
|
+
|
|
631677
|
+
|
|
631678
|
+
/**
|
|
631679
|
+
* Generic Warp Token Reader that can read any warp token type by detecting its type
|
|
631680
|
+
* and expanding nested ISM artifacts if present.
|
|
631681
|
+
*/
|
|
631682
|
+
class WarpTokenReader {
|
|
631683
|
+
artifactManager;
|
|
632466
631684
|
chainMetadata;
|
|
632467
|
-
|
|
632468
|
-
|
|
631685
|
+
chainLookup;
|
|
631686
|
+
ismReader;
|
|
631687
|
+
hookReader;
|
|
631688
|
+
constructor(artifactManager, chainMetadata, chainLookup) {
|
|
631689
|
+
this.artifactManager = artifactManager;
|
|
632469
631690
|
this.chainMetadata = chainMetadata;
|
|
631691
|
+
this.chainLookup = chainLookup;
|
|
631692
|
+
this.ismReader = createIsmReader(chainMetadata, chainLookup);
|
|
631693
|
+
this.hookReader = createHookReader(chainMetadata, chainLookup);
|
|
632470
631694
|
}
|
|
632471
|
-
async
|
|
632472
|
-
|
|
632473
|
-
|
|
632474
|
-
|
|
632475
|
-
|
|
632476
|
-
|
|
632477
|
-
|
|
631695
|
+
async read(address) {
|
|
631696
|
+
// Read warp token via artifactManager - detects type and returns raw config
|
|
631697
|
+
const rawArtifact = await this.artifactManager.readWarpToken(address);
|
|
631698
|
+
// Expand nested ISM artifact if present
|
|
631699
|
+
const expandedIsmArtifact = await this.expandIsmArtifact(rawArtifact.config.interchainSecurityModule);
|
|
631700
|
+
// Expand nested Hook artifact if present
|
|
631701
|
+
const expandedHookArtifact = await this.expandHookArtifact(rawArtifact.config.hook);
|
|
631702
|
+
return {
|
|
631703
|
+
...rawArtifact,
|
|
631704
|
+
config: {
|
|
631705
|
+
...rawArtifact.config,
|
|
631706
|
+
interchainSecurityModule: expandedIsmArtifact,
|
|
631707
|
+
hook: expandedHookArtifact,
|
|
631708
|
+
},
|
|
631709
|
+
};
|
|
632478
631710
|
}
|
|
632479
|
-
|
|
632480
|
-
|
|
631711
|
+
/**
|
|
631712
|
+
* Expands an ISM artifact by recursively reading it if underived.
|
|
631713
|
+
* Returns undefined if no ISM is configured.
|
|
631714
|
+
*/
|
|
631715
|
+
async expandIsmArtifact(ismArtifact) {
|
|
631716
|
+
if (!ismArtifact) {
|
|
631717
|
+
return undefined;
|
|
631718
|
+
}
|
|
631719
|
+
// If ISM is underived (just an address), read it recursively to get full config
|
|
631720
|
+
if ((0,dist_artifact/* isArtifactUnderived */.l2)(ismArtifact)) {
|
|
631721
|
+
return this.ismReader.read(ismArtifact.deployed.address);
|
|
631722
|
+
}
|
|
631723
|
+
// If already a full deployed artifact, use as-is
|
|
631724
|
+
if ((0,dist_artifact/* isArtifactDeployed */.R)(ismArtifact)) {
|
|
631725
|
+
return ismArtifact;
|
|
631726
|
+
}
|
|
631727
|
+
// NEW state should not occur in read artifacts
|
|
631728
|
+
throw new Error(`Unexpected ISM artifact state 'new' when reading warp token ISM configuration`);
|
|
632481
631729
|
}
|
|
632482
|
-
|
|
632483
|
-
|
|
631730
|
+
/**
|
|
631731
|
+
* Expands a Hook artifact by recursively reading it if underived.
|
|
631732
|
+
* Returns undefined if no Hook is configured.
|
|
631733
|
+
*/
|
|
631734
|
+
async expandHookArtifact(hookArtifact) {
|
|
631735
|
+
if (!hookArtifact) {
|
|
631736
|
+
return undefined;
|
|
631737
|
+
}
|
|
631738
|
+
// If Hook is underived (just an address), read it recursively to get full config
|
|
631739
|
+
if ((0,dist_artifact/* isArtifactUnderived */.l2)(hookArtifact)) {
|
|
631740
|
+
return this.hookReader.read(hookArtifact.deployed.address);
|
|
631741
|
+
}
|
|
631742
|
+
// If already a full deployed artifact, use as-is
|
|
631743
|
+
if ((0,dist_artifact/* isArtifactDeployed */.R)(hookArtifact)) {
|
|
631744
|
+
return hookArtifact;
|
|
631745
|
+
}
|
|
631746
|
+
// NEW state should not occur in read artifacts
|
|
631747
|
+
throw new Error(`Unexpected Hook artifact state 'new' when reading warp token Hook configuration`);
|
|
631748
|
+
}
|
|
631749
|
+
/**
|
|
631750
|
+
* Backward compatibility method that converts DeployedWarpArtifact to DerivedWarpConfig.
|
|
631751
|
+
* This allows WarpTokenReader to be used as a drop-in replacement for the old AltVMWarpRouteReader.
|
|
631752
|
+
*/
|
|
631753
|
+
async deriveWarpConfig(address) {
|
|
631754
|
+
const artifact = await this.read(address);
|
|
631755
|
+
return (0,warp/* warpArtifactToDerivedConfig */.L2)(artifact, this.chainLookup);
|
|
632484
631756
|
}
|
|
632485
631757
|
}
|
|
632486
|
-
|
|
632487
|
-
|
|
631758
|
+
/**
|
|
631759
|
+
* Factory function to create a WarpTokenReader instance.
|
|
631760
|
+
* This helper centralizes the creation of artifact managers and warp token readers,
|
|
631761
|
+
* making it easier to instantiate readers across the codebase.
|
|
631762
|
+
*
|
|
631763
|
+
* @param chainMetadata Chain metadata for the target chain (protocol type is extracted from metadata.protocol)
|
|
631764
|
+
* @param chainLookup Chain lookup interface for resolving chain names and domain IDs
|
|
631765
|
+
* @returns A WarpTokenReader instance
|
|
631766
|
+
*
|
|
631767
|
+
* @example
|
|
631768
|
+
* ```typescript
|
|
631769
|
+
* const reader = createWarpTokenReader(chainMetadata, chainLookup);
|
|
631770
|
+
* const warpConfig = await reader.read(warpTokenAddress);
|
|
631771
|
+
* ```
|
|
631772
|
+
*/
|
|
631773
|
+
function createWarpTokenReader(chainMetadata, chainLookup) {
|
|
631774
|
+
const protocolProvider = (0,dist/* getProtocolProvider */.IU)(chainMetadata.protocol);
|
|
631775
|
+
const artifactManager = protocolProvider.createWarpArtifactManager(chainMetadata);
|
|
631776
|
+
return new WarpTokenReader(artifactManager, chainMetadata, chainLookup);
|
|
631777
|
+
}
|
|
631778
|
+
//# sourceMappingURL=warp-reader.js.map
|
|
631779
|
+
// EXTERNAL MODULE: ../utils/dist/validation.js
|
|
631780
|
+
var validation = __nccwpck_require__(21387);
|
|
631781
|
+
// EXTERNAL MODULE: ../utils/dist/typeof.js
|
|
631782
|
+
var dist_typeof = __nccwpck_require__(73689);
|
|
631783
|
+
;// CONCATENATED MODULE: ../deploy-sdk/dist/warp/warp-writer.js
|
|
631784
|
+
|
|
631785
|
+
|
|
631786
|
+
|
|
631787
|
+
|
|
631788
|
+
|
|
631789
|
+
|
|
631790
|
+
|
|
631791
|
+
|
|
631792
|
+
/**
|
|
631793
|
+
* Factory function to create a WarpTokenWriter instance.
|
|
631794
|
+
*
|
|
631795
|
+
* @param chainMetadata Chain metadata for the target chain
|
|
631796
|
+
* @param chainLookup Chain lookup interface for resolving chain names and domain IDs
|
|
631797
|
+
* @param signer Signer interface for signing transactions
|
|
631798
|
+
* @returns A WarpTokenWriter instance
|
|
631799
|
+
*
|
|
631800
|
+
* @example
|
|
631801
|
+
* ```typescript
|
|
631802
|
+
* const writer = createWarpTokenWriter(chainMetadata, chainLookup, signer);
|
|
631803
|
+
* const [deployed, receipts] = await writer.create(warpArtifact);
|
|
631804
|
+
* ```
|
|
631805
|
+
*/
|
|
631806
|
+
function createWarpTokenWriter(chainMetadata, chainLookup, signer) {
|
|
631807
|
+
const protocolProvider = (0,dist/* getProtocolProvider */.IU)(chainMetadata.protocol);
|
|
631808
|
+
const artifactManager = protocolProvider.createWarpArtifactManager(chainMetadata);
|
|
631809
|
+
return new WarpTokenWriter(artifactManager, chainMetadata, chainLookup, signer);
|
|
632488
631810
|
}
|
|
632489
|
-
|
|
631811
|
+
/**
|
|
631812
|
+
* WarpTokenWriter handles creation and updates of warp tokens using the Artifact API.
|
|
631813
|
+
* It delegates to protocol-specific artifact writers for individual warp token types.
|
|
631814
|
+
*
|
|
631815
|
+
* Key features:
|
|
631816
|
+
* - Extends WarpTokenReader to inherit read() functionality
|
|
631817
|
+
* - Works with pure Artifact API (WarpArtifactConfig)
|
|
631818
|
+
* - Handles nested ISM deployment before warp token deployment
|
|
631819
|
+
* - Delegates to typed writers from artifact manager for specific warp token types
|
|
631820
|
+
* - Protocol-agnostic through artifact manager abstraction
|
|
631821
|
+
*/
|
|
631822
|
+
class WarpTokenWriter extends WarpTokenReader {
|
|
631823
|
+
artifactManager;
|
|
631824
|
+
chainMetadata;
|
|
631825
|
+
chainLookup;
|
|
631826
|
+
signer;
|
|
631827
|
+
ismWriter;
|
|
631828
|
+
hookWriterFactory;
|
|
631829
|
+
constructor(artifactManager, chainMetadata, chainLookup, signer) {
|
|
631830
|
+
super(artifactManager, chainMetadata, chainLookup);
|
|
631831
|
+
this.artifactManager = artifactManager;
|
|
631832
|
+
this.chainMetadata = chainMetadata;
|
|
631833
|
+
this.chainLookup = chainLookup;
|
|
631834
|
+
this.signer = signer;
|
|
631835
|
+
this.ismWriter = createIsmWriter(chainMetadata, chainLookup, signer);
|
|
631836
|
+
this.hookWriterFactory = (mailbox) => createHookWriter(chainMetadata, chainLookup, signer, { mailbox });
|
|
631837
|
+
}
|
|
631838
|
+
/**
|
|
631839
|
+
* Creates a new warp token by deploying it on-chain.
|
|
631840
|
+
* If the warp token has a nested ISM artifact, deploys the ISM first.
|
|
631841
|
+
*
|
|
631842
|
+
* @param artifact The warp token configuration to deploy
|
|
631843
|
+
* @returns A tuple of [deployed artifact, transaction receipts]
|
|
631844
|
+
*/
|
|
631845
|
+
async create(artifact) {
|
|
631846
|
+
const { config } = artifact;
|
|
631847
|
+
const allReceipts = [];
|
|
631848
|
+
if (config.hook) {
|
|
631849
|
+
(0,validation/* assert */.v)(config.mailbox, 'Mailbox is required when hook configuration is provided');
|
|
631850
|
+
}
|
|
631851
|
+
// Deploy ISM if configured as a NEW artifact
|
|
631852
|
+
let onChainIsmArtifact;
|
|
631853
|
+
if (config.interchainSecurityModule) {
|
|
631854
|
+
if ((0,dist_artifact/* isArtifactNew */.v_)(config.interchainSecurityModule)) {
|
|
631855
|
+
const [deployedIsm, ismReceipts] = await this.ismWriter.create(config.interchainSecurityModule);
|
|
631856
|
+
allReceipts.push(...ismReceipts);
|
|
631857
|
+
onChainIsmArtifact = deployedIsm;
|
|
631858
|
+
}
|
|
631859
|
+
else {
|
|
631860
|
+
onChainIsmArtifact = config.interchainSecurityModule;
|
|
631861
|
+
}
|
|
631862
|
+
}
|
|
631863
|
+
// Deploy Hook if configured as a NEW artifact
|
|
631864
|
+
let onChainHookArtifact;
|
|
631865
|
+
if (config.hook) {
|
|
631866
|
+
if (!this.artifactManager.supportsHookUpdates()) {
|
|
631867
|
+
logging/* rootLogger */.Jk.warn('Hook configuration is not supported for this protocol. Hook configuration will be ignored.');
|
|
631868
|
+
}
|
|
631869
|
+
else {
|
|
631870
|
+
const hookWriter = this.hookWriterFactory(config.mailbox);
|
|
631871
|
+
if ((0,dist_artifact/* isArtifactNew */.v_)(config.hook)) {
|
|
631872
|
+
const [deployedHook, hookReceipts] = await hookWriter.create(config.hook);
|
|
631873
|
+
allReceipts.push(...hookReceipts);
|
|
631874
|
+
onChainHookArtifact = deployedHook;
|
|
631875
|
+
}
|
|
631876
|
+
else {
|
|
631877
|
+
onChainHookArtifact = config.hook;
|
|
631878
|
+
}
|
|
631879
|
+
}
|
|
631880
|
+
}
|
|
631881
|
+
// Convert to raw artifact config (flatten nested artifacts)
|
|
631882
|
+
const rawArtifact = {
|
|
631883
|
+
artifactState: dist_artifact/* ArtifactState */.O2.NEW,
|
|
631884
|
+
config: {
|
|
631885
|
+
...config,
|
|
631886
|
+
interchainSecurityModule: onChainIsmArtifact,
|
|
631887
|
+
hook: onChainHookArtifact,
|
|
631888
|
+
},
|
|
631889
|
+
};
|
|
631890
|
+
// Delegate to protocol-specific writer
|
|
631891
|
+
const writer = this.artifactManager.createWriter(config.type, this.signer);
|
|
631892
|
+
const [deployed, tokenReceipts] = await writer.create(rawArtifact);
|
|
631893
|
+
allReceipts.push(...tokenReceipts);
|
|
631894
|
+
// Return deployed config
|
|
631895
|
+
return [
|
|
631896
|
+
{
|
|
631897
|
+
artifactState: dist_artifact/* ArtifactState */.O2.DEPLOYED,
|
|
631898
|
+
config: {
|
|
631899
|
+
...artifact.config,
|
|
631900
|
+
interchainSecurityModule: onChainIsmArtifact,
|
|
631901
|
+
hook: onChainHookArtifact,
|
|
631902
|
+
},
|
|
631903
|
+
deployed: deployed.deployed,
|
|
631904
|
+
},
|
|
631905
|
+
allReceipts,
|
|
631906
|
+
];
|
|
631907
|
+
}
|
|
631908
|
+
/**
|
|
631909
|
+
* Updates an existing warp token to match the desired configuration.
|
|
631910
|
+
* Warp tokens are mutable - supports remote router enrollment/unenrollment,
|
|
631911
|
+
* ISM updates, and owner changes.
|
|
631912
|
+
*
|
|
631913
|
+
* The protocol-specific writer will read the current on-chain state and compare
|
|
631914
|
+
* with the expected config to generate the necessary update transactions.
|
|
631915
|
+
*
|
|
631916
|
+
* @param artifact The desired warp token state (must include deployed address)
|
|
631917
|
+
* @returns Array of transactions needed to perform the update
|
|
631918
|
+
* @throws Error if the token type cannot be changed (e.g., collateral -> synthetic)
|
|
631919
|
+
*/
|
|
631920
|
+
async update(artifact) {
|
|
631921
|
+
const { config, deployed } = artifact;
|
|
631922
|
+
const expectedHook = config.hook;
|
|
631923
|
+
if (expectedHook && !(0,dist_artifact/* isArtifactUnderived */.l2)(expectedHook)) {
|
|
631924
|
+
(0,validation/* assert */.v)(config.mailbox, 'Mailbox is required when hook configuration is provided');
|
|
631925
|
+
}
|
|
631926
|
+
// Read current on-chain state to verify token type hasn't changed
|
|
631927
|
+
const currentArtifact = await this.read(deployed.address);
|
|
631928
|
+
(0,validation/* assert */.v)(currentArtifact.config.type === config.type, `Cannot change warp token type from '${currentArtifact.config.type}' to '${config.type}'. ` +
|
|
631929
|
+
`Token type is immutable after deployment.`);
|
|
631930
|
+
(0,validation/* assert */.v)((0,dist_typeof/* isNullish */.u)(currentArtifact.config.interchainSecurityModule) ||
|
|
631931
|
+
(0,dist_artifact/* isArtifactDeployed */.R)(currentArtifact.config.interchainSecurityModule), `Expected Warp Reader to expand the ISM config`);
|
|
631932
|
+
(0,validation/* assert */.v)((0,dist_typeof/* isNullish */.u)(currentArtifact.config.hook) ||
|
|
631933
|
+
(0,dist_artifact/* isArtifactDeployed */.R)(currentArtifact.config.hook), `Expected Warp Reader to expand the Hook config`);
|
|
631934
|
+
const updateTxs = [];
|
|
631935
|
+
// Resolve ISM updates
|
|
631936
|
+
const expectedIsm = config.interchainSecurityModule;
|
|
631937
|
+
const currentIsm = currentArtifact.config.interchainSecurityModule;
|
|
631938
|
+
let onChainIsmArtifact;
|
|
631939
|
+
if (expectedIsm && !(0,dist_artifact/* isArtifactUnderived */.l2)(expectedIsm)) {
|
|
631940
|
+
// NEW or DEPLOYED: Merge with current and decide deploy vs update
|
|
631941
|
+
const mergedIsmConfig = (0,ism/* mergeIsmArtifacts */.FE)(currentIsm, expectedIsm);
|
|
631942
|
+
if ((0,dist_artifact/* isArtifactNew */.v_)(mergedIsmConfig)) {
|
|
631943
|
+
// Deploy new ISM
|
|
631944
|
+
const [deployed] = await this.ismWriter.create(mergedIsmConfig);
|
|
631945
|
+
onChainIsmArtifact = {
|
|
631946
|
+
artifactState: dist_artifact/* ArtifactState */.O2.UNDERIVED,
|
|
631947
|
+
deployed: { address: deployed.deployed.address },
|
|
631948
|
+
};
|
|
631949
|
+
}
|
|
631950
|
+
else if ((0,dist_artifact/* isArtifactDeployed */.R)(mergedIsmConfig)) {
|
|
631951
|
+
// DEPLOYED: update existing ISM (or reuse if unchanged)
|
|
631952
|
+
const txs = await this.ismWriter.update(mergedIsmConfig);
|
|
631953
|
+
updateTxs.push(...txs);
|
|
631954
|
+
onChainIsmArtifact = {
|
|
631955
|
+
artifactState: dist_artifact/* ArtifactState */.O2.UNDERIVED,
|
|
631956
|
+
deployed: { address: mergedIsmConfig.deployed.address },
|
|
631957
|
+
};
|
|
631958
|
+
}
|
|
631959
|
+
}
|
|
631960
|
+
else {
|
|
631961
|
+
onChainIsmArtifact = expectedIsm;
|
|
631962
|
+
}
|
|
631963
|
+
// Resolve Hook updates
|
|
631964
|
+
const currentHook = currentArtifact.config.hook;
|
|
631965
|
+
let onChainHookArtifact;
|
|
631966
|
+
if (expectedHook && !(0,dist_artifact/* isArtifactUnderived */.l2)(expectedHook)) {
|
|
631967
|
+
if (!this.artifactManager.supportsHookUpdates()) {
|
|
631968
|
+
logging/* rootLogger */.Jk.warn('Hook updates are not supported for this protocol. Hook configuration will be ignored.');
|
|
631969
|
+
onChainHookArtifact = currentHook;
|
|
631970
|
+
}
|
|
631971
|
+
else {
|
|
631972
|
+
const hookWriter = this.hookWriterFactory(config.mailbox);
|
|
631973
|
+
// NEW or DEPLOYED: Merge with current and decide deploy vs update
|
|
631974
|
+
const mergedHookConfig = (0,hook/* mergeHookArtifacts */.l9)(currentHook, expectedHook);
|
|
631975
|
+
if ((0,dist_artifact/* isArtifactNew */.v_)(mergedHookConfig)) {
|
|
631976
|
+
// Deploy new Hook
|
|
631977
|
+
const [deployed] = await hookWriter.create(mergedHookConfig);
|
|
631978
|
+
onChainHookArtifact = {
|
|
631979
|
+
artifactState: dist_artifact/* ArtifactState */.O2.UNDERIVED,
|
|
631980
|
+
deployed: { address: deployed.deployed.address },
|
|
631981
|
+
};
|
|
631982
|
+
}
|
|
631983
|
+
else if ((0,dist_artifact/* isArtifactDeployed */.R)(mergedHookConfig)) {
|
|
631984
|
+
// DEPLOYED: update existing Hook (or reuse if unchanged)
|
|
631985
|
+
const txs = await hookWriter.update(mergedHookConfig);
|
|
631986
|
+
updateTxs.push(...txs);
|
|
631987
|
+
onChainHookArtifact = {
|
|
631988
|
+
artifactState: dist_artifact/* ArtifactState */.O2.UNDERIVED,
|
|
631989
|
+
deployed: { address: mergedHookConfig.deployed.address },
|
|
631990
|
+
};
|
|
631991
|
+
}
|
|
631992
|
+
}
|
|
631993
|
+
}
|
|
631994
|
+
else {
|
|
631995
|
+
onChainHookArtifact = expectedHook;
|
|
631996
|
+
}
|
|
631997
|
+
// Build raw artifact with flattened ISM and Hook references
|
|
631998
|
+
const rawArtifact = {
|
|
631999
|
+
artifactState: dist_artifact/* ArtifactState */.O2.DEPLOYED,
|
|
632000
|
+
config: {
|
|
632001
|
+
...config,
|
|
632002
|
+
interchainSecurityModule: onChainIsmArtifact,
|
|
632003
|
+
hook: onChainHookArtifact,
|
|
632004
|
+
},
|
|
632005
|
+
deployed,
|
|
632006
|
+
};
|
|
632007
|
+
// Delegate to protocol-specific writer which will read current state and compare
|
|
632008
|
+
const writer = this.artifactManager.createWriter(config.type, this.signer);
|
|
632009
|
+
const warpUpdateTxs = await writer.update(rawArtifact);
|
|
632010
|
+
updateTxs.push(...warpUpdateTxs);
|
|
632011
|
+
return updateTxs;
|
|
632012
|
+
}
|
|
632013
|
+
}
|
|
632014
|
+
//# sourceMappingURL=warp-writer.js.map
|
|
632490
632015
|
;// CONCATENATED MODULE: ../deploy-sdk/dist/protocol.js
|
|
632491
632016
|
|
|
632492
632017
|
|
|
@@ -632532,9 +632057,6 @@ async function loadProtocolProviders(neededProtocols) {
|
|
|
632532
632057
|
|
|
632533
632058
|
|
|
632534
632059
|
|
|
632535
|
-
|
|
632536
|
-
|
|
632537
|
-
|
|
632538
632060
|
//# sourceMappingURL=index.js.map
|
|
632539
632061
|
|
|
632540
632062
|
/***/ }),
|
|
@@ -634210,6 +633732,7 @@ function isArtifactUnderived(artifact) {
|
|
|
634210
633732
|
/* harmony export */ __nccwpck_require__.d(__webpack_exports__, {
|
|
634211
633733
|
/* harmony export */ WL: () => (/* binding */ shouldDeployNewHook),
|
|
634212
633734
|
/* harmony export */ hV: () => (/* binding */ hookConfigToArtifact),
|
|
633735
|
+
/* harmony export */ l9: () => (/* binding */ mergeHookArtifacts),
|
|
634213
633736
|
/* harmony export */ nJ: () => (/* binding */ altVmHookTypeToProviderHookType),
|
|
634214
633737
|
/* harmony export */ q6: () => (/* binding */ hookArtifactToDerivedConfig)
|
|
634215
633738
|
/* harmony export */ });
|
|
@@ -634357,6 +633880,40 @@ function shouldDeployNewHook(actual, expected) {
|
|
|
634357
633880
|
}
|
|
634358
633881
|
}
|
|
634359
633882
|
}
|
|
633883
|
+
/**
|
|
633884
|
+
* Merges current on-chain hook artifact with expected hook artifact.
|
|
633885
|
+
* Determines whether to deploy a new hook or update/reuse existing one.
|
|
633886
|
+
*
|
|
633887
|
+
* @param currentArtifact Current deployed hook artifact (from on-chain state)
|
|
633888
|
+
* @param expectedArtifact Expected hook artifact (desired configuration)
|
|
633889
|
+
* @returns Merged artifact - either NEW (deploy needed) or DEPLOYED (update/reuse)
|
|
633890
|
+
*/
|
|
633891
|
+
function mergeHookArtifacts(currentArtifact, expectedArtifact) {
|
|
633892
|
+
const expectedConfig = expectedArtifact.config;
|
|
633893
|
+
// No current hook - return expected as-is
|
|
633894
|
+
if (!currentArtifact) {
|
|
633895
|
+
return expectedArtifact;
|
|
633896
|
+
}
|
|
633897
|
+
const currentConfig = currentArtifact.config;
|
|
633898
|
+
// Type changed or config requires new deployment
|
|
633899
|
+
if (shouldDeployNewHook(currentConfig, expectedConfig)) {
|
|
633900
|
+
return {
|
|
633901
|
+
artifactState: _artifact_js__WEBPACK_IMPORTED_MODULE_1__/* .ArtifactState */ .O2.NEW,
|
|
633902
|
+
config: expectedConfig,
|
|
633903
|
+
};
|
|
633904
|
+
}
|
|
633905
|
+
// Hook can be updated/reused
|
|
633906
|
+
// If expected is DEPLOYED (has address), use that address (switching to different deployed hook)
|
|
633907
|
+
// Otherwise use current address (updating current hook)
|
|
633908
|
+
const deployedAddress = (0,_artifact_js__WEBPACK_IMPORTED_MODULE_1__/* .isArtifactDeployed */ .R)(expectedArtifact)
|
|
633909
|
+
? expectedArtifact.deployed
|
|
633910
|
+
: currentArtifact.deployed;
|
|
633911
|
+
return {
|
|
633912
|
+
artifactState: _artifact_js__WEBPACK_IMPORTED_MODULE_1__/* .ArtifactState */ .O2.DEPLOYED,
|
|
633913
|
+
config: expectedConfig,
|
|
633914
|
+
deployed: deployedAddress,
|
|
633915
|
+
};
|
|
633916
|
+
}
|
|
634360
633917
|
/**
|
|
634361
633918
|
* Converts a DeployedHookArtifact to DerivedHookConfig format.
|
|
634362
633919
|
* This handles the conversion between the new Artifact API and the old Config API.
|
|
@@ -634536,12 +634093,15 @@ const listProtocols = protocolRegistry.listProtocols.bind(protocolRegistry);
|
|
|
634536
634093
|
|
|
634537
634094
|
/* harmony export */ __nccwpck_require__.d(__webpack_exports__, {
|
|
634538
634095
|
/* harmony export */ EJ: () => (/* binding */ altVMIsmTypeToProviderSdkType),
|
|
634539
|
-
/* harmony export */ FE: () => (/* binding */ mergeIsmArtifacts)
|
|
634096
|
+
/* harmony export */ FE: () => (/* binding */ mergeIsmArtifacts),
|
|
634097
|
+
/* harmony export */ HL: () => (/* binding */ ismConfigToArtifact),
|
|
634098
|
+
/* harmony export */ co: () => (/* binding */ ismArtifactToDerivedConfig)
|
|
634540
634099
|
/* harmony export */ });
|
|
634541
|
-
/* unused harmony exports STATIC_ISM_TYPES, shouldDeployNewIsm
|
|
634100
|
+
/* unused harmony exports STATIC_ISM_TYPES, shouldDeployNewIsm */
|
|
634542
634101
|
/* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(98474);
|
|
634543
634102
|
/* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(73938);
|
|
634544
634103
|
/* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__ = __nccwpck_require__(21387);
|
|
634104
|
+
/* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_5__ = __nccwpck_require__(73689);
|
|
634545
634105
|
/* harmony import */ var _altvm_js__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(63183);
|
|
634546
634106
|
/* harmony import */ var _artifact_js__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(4287);
|
|
634547
634107
|
|
|
@@ -634681,15 +634241,15 @@ function ismArtifactToDerivedConfig(artifact, chainLookup) {
|
|
|
634681
634241
|
// Skip unknown domains
|
|
634682
634242
|
continue;
|
|
634683
634243
|
}
|
|
634684
|
-
if (isArtifactDeployed(domainArtifact)) {
|
|
634244
|
+
if ((0,_artifact_js__WEBPACK_IMPORTED_MODULE_1__/* .isArtifactDeployed */ .R)(domainArtifact)) {
|
|
634685
634245
|
// Recursively convert nested ISM artifacts
|
|
634686
634246
|
domains[chainName] = ismArtifactToDerivedConfig(domainArtifact, chainLookup);
|
|
634687
634247
|
}
|
|
634688
|
-
else if (isArtifactUnderived(domainArtifact)) {
|
|
634248
|
+
else if ((0,_artifact_js__WEBPACK_IMPORTED_MODULE_1__/* .isArtifactUnderived */ .l2)(domainArtifact)) {
|
|
634689
634249
|
// Use the address string for underived artifacts
|
|
634690
634250
|
domains[chainName] = domainArtifact.deployed.address;
|
|
634691
634251
|
}
|
|
634692
|
-
else if (isArtifactNew(domainArtifact)) {
|
|
634252
|
+
else if ((0,_artifact_js__WEBPACK_IMPORTED_MODULE_1__/* .isArtifactNew */ .v_)(domainArtifact)) {
|
|
634693
634253
|
throw new Error(`Cannot convert routing ISM to derived config: nested ISM for domain ${chainName} (${domainId}) is NEW and has no address`);
|
|
634694
634254
|
}
|
|
634695
634255
|
}
|
|
@@ -634719,6 +634279,75 @@ function ismArtifactToDerivedConfig(artifact, chainLookup) {
|
|
|
634719
634279
|
}
|
|
634720
634280
|
}
|
|
634721
634281
|
}
|
|
634282
|
+
/**
|
|
634283
|
+
* Converts IsmConfig (Config API) to IsmArtifactConfig (Artifact API).
|
|
634284
|
+
*
|
|
634285
|
+
* Key transformations:
|
|
634286
|
+
* - String chain names → numeric domain IDs (for routing ISM domains)
|
|
634287
|
+
* - Address string references → ArtifactUnderived objects
|
|
634288
|
+
* - Recursively handles nested routing ISM configurations
|
|
634289
|
+
* - Other ISM types (multisig, testIsm) pass through unchanged
|
|
634290
|
+
*
|
|
634291
|
+
* @param config The ISM configuration using Config API format
|
|
634292
|
+
* @param chainLookup Chain lookup interface for resolving chain names to domain IDs
|
|
634293
|
+
* @returns Artifact wrapper around IsmArtifactConfig suitable for artifact writers
|
|
634294
|
+
*
|
|
634295
|
+
* @example
|
|
634296
|
+
* ```typescript
|
|
634297
|
+
* // Config API format
|
|
634298
|
+
* const ismConfig: IsmConfig = {
|
|
634299
|
+
* type: 'domainRoutingIsm',
|
|
634300
|
+
* owner: '0x123...',
|
|
634301
|
+
* domains: {
|
|
634302
|
+
* ethereum: { type: 'merkleRootMultisigIsm', validators: [...], threshold: 2 },
|
|
634303
|
+
* polygon: '0xabc...' // address reference
|
|
634304
|
+
* }
|
|
634305
|
+
* };
|
|
634306
|
+
*
|
|
634307
|
+
* // Convert to Artifact API format
|
|
634308
|
+
* const artifact = ismConfigToArtifact(ismConfig, chainLookup);
|
|
634309
|
+
* // artifact.config.domains is now Record<number, Artifact<IsmArtifactConfig>>
|
|
634310
|
+
* // with numeric domain IDs and properly wrapped nested configs
|
|
634311
|
+
* ```
|
|
634312
|
+
*/
|
|
634313
|
+
function ismConfigToArtifact(config, chainLookup) {
|
|
634314
|
+
// Handle routing ISMs - need to convert chain names to domain IDs
|
|
634315
|
+
if (config.type === 'domainRoutingIsm') {
|
|
634316
|
+
const domains = {};
|
|
634317
|
+
for (const [chainName, nestedConfig] of Object.entries(config.domains)) {
|
|
634318
|
+
const domainId = chainLookup.getDomainId(chainName);
|
|
634319
|
+
if ((0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_5__/* .isNullish */ .u)(domainId)) {
|
|
634320
|
+
// Skip unknown chains - they'll be warned about during deployment
|
|
634321
|
+
continue;
|
|
634322
|
+
}
|
|
634323
|
+
if (typeof nestedConfig === 'string') {
|
|
634324
|
+
// Address reference - create an UNDERIVED artifact
|
|
634325
|
+
// This represents a predeployed ISM with unspecified type
|
|
634326
|
+
// The routing ISM writer will pass it through without reading
|
|
634327
|
+
// Only readers will fetch its config from chain if needed
|
|
634328
|
+
domains[domainId] = {
|
|
634329
|
+
artifactState: _artifact_js__WEBPACK_IMPORTED_MODULE_1__/* .ArtifactState */ .O2.UNDERIVED,
|
|
634330
|
+
deployed: { address: nestedConfig },
|
|
634331
|
+
};
|
|
634332
|
+
}
|
|
634333
|
+
else {
|
|
634334
|
+
// Nested ISM config - recursively convert
|
|
634335
|
+
domains[domainId] = ismConfigToArtifact(nestedConfig, chainLookup);
|
|
634336
|
+
}
|
|
634337
|
+
}
|
|
634338
|
+
return {
|
|
634339
|
+
artifactState: _artifact_js__WEBPACK_IMPORTED_MODULE_1__/* .ArtifactState */ .O2.NEW,
|
|
634340
|
+
config: {
|
|
634341
|
+
type: 'domainRoutingIsm',
|
|
634342
|
+
owner: config.owner,
|
|
634343
|
+
domains,
|
|
634344
|
+
},
|
|
634345
|
+
};
|
|
634346
|
+
}
|
|
634347
|
+
// Other ISM types (multisig, testIsm) have identical config structure
|
|
634348
|
+
// between Config API and Artifact API - just wrap in artifact object
|
|
634349
|
+
return { artifactState: _artifact_js__WEBPACK_IMPORTED_MODULE_1__/* .ArtifactState */ .O2.NEW, config };
|
|
634350
|
+
}
|
|
634722
634351
|
//# sourceMappingURL=ism.js.map
|
|
634723
634352
|
|
|
634724
634353
|
/***/ }),
|
|
@@ -634727,12 +634356,13 @@ function ismArtifactToDerivedConfig(artifact, chainLookup) {
|
|
|
634727
634356
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __nccwpck_require__) => {
|
|
634728
634357
|
|
|
634729
634358
|
/* harmony export */ __nccwpck_require__.d(__webpack_exports__, {
|
|
634359
|
+
/* harmony export */ L2: () => (/* binding */ warpArtifactToDerivedConfig),
|
|
634730
634360
|
/* harmony export */ aq: () => (/* binding */ computeRemoteRoutersUpdates),
|
|
634731
|
-
/* harmony export */ ks: () => (/* binding */ TokenType)
|
|
634361
|
+
/* harmony export */ ks: () => (/* binding */ TokenType),
|
|
634362
|
+
/* harmony export */ ku: () => (/* binding */ warpConfigToArtifact)
|
|
634732
634363
|
/* harmony export */ });
|
|
634733
|
-
/*
|
|
634734
|
-
/* harmony import */ var
|
|
634735
|
-
/* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__ = __nccwpck_require__(73689);
|
|
634364
|
+
/* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(73689);
|
|
634365
|
+
/* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__ = __nccwpck_require__(21387);
|
|
634736
634366
|
/* harmony import */ var _artifact_js__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(4287);
|
|
634737
634367
|
/* harmony import */ var _hook_js__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(77230);
|
|
634738
634368
|
/* harmony import */ var _ism_js__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(96426);
|
|
@@ -634755,18 +634385,46 @@ const TokenType = {
|
|
|
634755
634385
|
*
|
|
634756
634386
|
* @param config The warp configuration using Config API format
|
|
634757
634387
|
* @param chainLookup Chain lookup interface for resolving chain names to domain IDs
|
|
634758
|
-
* @param ismArtifact Optional ISM artifact if ISM is configured
|
|
634759
|
-
* @param hookArtifact Optional hook artifact if hook is configured
|
|
634760
634388
|
* @param logger Logger for warnings
|
|
634761
634389
|
* @returns Artifact wrapper around WarpArtifactConfig suitable for artifact writers
|
|
634762
634390
|
*/
|
|
634763
|
-
function warpConfigToArtifact(config, chainLookup,
|
|
634391
|
+
function warpConfigToArtifact(config, chainLookup, logger) {
|
|
634392
|
+
// Convert ISM config to artifact if present
|
|
634393
|
+
let ismArtifact;
|
|
634394
|
+
if (config.interchainSecurityModule) {
|
|
634395
|
+
if (typeof config.interchainSecurityModule === 'string') {
|
|
634396
|
+
// Address reference - create UNDERIVED artifact
|
|
634397
|
+
ismArtifact = {
|
|
634398
|
+
artifactState: _artifact_js__WEBPACK_IMPORTED_MODULE_0__/* .ArtifactState */ .O2.UNDERIVED,
|
|
634399
|
+
deployed: { address: config.interchainSecurityModule },
|
|
634400
|
+
};
|
|
634401
|
+
}
|
|
634402
|
+
else {
|
|
634403
|
+
// ISM config - convert using ismConfigToArtifact
|
|
634404
|
+
ismArtifact = (0,_ism_js__WEBPACK_IMPORTED_MODULE_2__/* .ismConfigToArtifact */ .HL)(config.interchainSecurityModule, chainLookup);
|
|
634405
|
+
}
|
|
634406
|
+
}
|
|
634407
|
+
// Convert Hook config to artifact if present
|
|
634408
|
+
let hookArtifact;
|
|
634409
|
+
if (config.hook) {
|
|
634410
|
+
if (typeof config.hook === 'string') {
|
|
634411
|
+
// Address reference - create UNDERIVED artifact
|
|
634412
|
+
hookArtifact = {
|
|
634413
|
+
artifactState: _artifact_js__WEBPACK_IMPORTED_MODULE_0__/* .ArtifactState */ .O2.UNDERIVED,
|
|
634414
|
+
deployed: { address: config.hook },
|
|
634415
|
+
};
|
|
634416
|
+
}
|
|
634417
|
+
else {
|
|
634418
|
+
// Hook config - convert using hookConfigToArtifact
|
|
634419
|
+
hookArtifact = (0,_hook_js__WEBPACK_IMPORTED_MODULE_1__/* .hookConfigToArtifact */ .hV)(config.hook, chainLookup);
|
|
634420
|
+
}
|
|
634421
|
+
}
|
|
634764
634422
|
// Convert remoteRouters from chain names to domain IDs
|
|
634765
634423
|
const remoteRouters = {};
|
|
634766
634424
|
if (config.remoteRouters) {
|
|
634767
634425
|
for (const [chainName, router] of Object.entries(config.remoteRouters)) {
|
|
634768
634426
|
const domainId = chainLookup.getDomainId(chainName);
|
|
634769
|
-
if (isNullish(domainId)) {
|
|
634427
|
+
if ((0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_3__/* .isNullish */ .u)(domainId)) {
|
|
634770
634428
|
logger?.warn(`Skipping remote router for unknown chain: ${chainName}. ` +
|
|
634771
634429
|
`Chain not found in chain lookup.`);
|
|
634772
634430
|
continue;
|
|
@@ -634779,7 +634437,7 @@ function warpConfigToArtifact(config, chainLookup, ismArtifact, hookArtifact, lo
|
|
|
634779
634437
|
if (config.destinationGas) {
|
|
634780
634438
|
for (const [chainName, gas] of Object.entries(config.destinationGas)) {
|
|
634781
634439
|
const domainId = chainLookup.getDomainId(chainName);
|
|
634782
|
-
if (isNullish(domainId)) {
|
|
634440
|
+
if ((0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_3__/* .isNullish */ .u)(domainId)) {
|
|
634783
634441
|
logger?.warn(`Skipping destination gas for unknown chain: ${chainName}. ` +
|
|
634784
634442
|
`Chain not found in chain lookup.`);
|
|
634785
634443
|
continue;
|
|
@@ -634787,12 +634445,6 @@ function warpConfigToArtifact(config, chainLookup, ismArtifact, hookArtifact, lo
|
|
|
634787
634445
|
destinationGas[domainId] = gas;
|
|
634788
634446
|
}
|
|
634789
634447
|
}
|
|
634790
|
-
if (!isNullish(config.interchainSecurityModule)) {
|
|
634791
|
-
assert(!isNullish(ismArtifact), 'Expected ISM artifact when interchainSecurityModule is configured');
|
|
634792
|
-
}
|
|
634793
|
-
if (!isNullish(config.hook)) {
|
|
634794
|
-
assert(!isNullish(hookArtifact), 'Expected hook artifact when hook is configured');
|
|
634795
|
-
}
|
|
634796
634448
|
const baseArtifactConfig = {
|
|
634797
634449
|
owner: config.owner,
|
|
634798
634450
|
mailbox: config.mailbox,
|
|
@@ -634804,7 +634456,7 @@ function warpConfigToArtifact(config, chainLookup, ismArtifact, hookArtifact, lo
|
|
|
634804
634456
|
switch (config.type) {
|
|
634805
634457
|
case 'collateral':
|
|
634806
634458
|
return {
|
|
634807
|
-
artifactState: ArtifactState.NEW,
|
|
634459
|
+
artifactState: _artifact_js__WEBPACK_IMPORTED_MODULE_0__/* .ArtifactState */ .O2.NEW,
|
|
634808
634460
|
config: {
|
|
634809
634461
|
...baseArtifactConfig,
|
|
634810
634462
|
type: 'collateral',
|
|
@@ -634813,11 +634465,11 @@ function warpConfigToArtifact(config, chainLookup, ismArtifact, hookArtifact, lo
|
|
|
634813
634465
|
};
|
|
634814
634466
|
case 'synthetic':
|
|
634815
634467
|
// Validate required fields for synthetic token
|
|
634816
|
-
assert(config.name, 'name is required for synthetic token deployment');
|
|
634817
|
-
assert(config.symbol, 'symbol is required for synthetic token deployment');
|
|
634818
|
-
assert(config.decimals !== undefined, 'decimals is required for synthetic token deployment');
|
|
634468
|
+
(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .assert */ .v)(config.name, 'name is required for synthetic token deployment');
|
|
634469
|
+
(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .assert */ .v)(config.symbol, 'symbol is required for synthetic token deployment');
|
|
634470
|
+
(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .assert */ .v)(config.decimals !== undefined, 'decimals is required for synthetic token deployment');
|
|
634819
634471
|
return {
|
|
634820
|
-
artifactState: ArtifactState.NEW,
|
|
634472
|
+
artifactState: _artifact_js__WEBPACK_IMPORTED_MODULE_0__/* .ArtifactState */ .O2.NEW,
|
|
634821
634473
|
config: {
|
|
634822
634474
|
...baseArtifactConfig,
|
|
634823
634475
|
type: 'synthetic',
|
|
@@ -634828,7 +634480,7 @@ function warpConfigToArtifact(config, chainLookup, ismArtifact, hookArtifact, lo
|
|
|
634828
634480
|
};
|
|
634829
634481
|
case 'native':
|
|
634830
634482
|
return {
|
|
634831
|
-
artifactState: ArtifactState.NEW,
|
|
634483
|
+
artifactState: _artifact_js__WEBPACK_IMPORTED_MODULE_0__/* .ArtifactState */ .O2.NEW,
|
|
634832
634484
|
config: {
|
|
634833
634485
|
...baseArtifactConfig,
|
|
634834
634486
|
type: 'native',
|
|
@@ -634874,26 +634526,26 @@ function warpArtifactToDerivedConfig(artifact, chainLookup) {
|
|
|
634874
634526
|
destinationGas[chainName] = gas;
|
|
634875
634527
|
}
|
|
634876
634528
|
// Convert ISM artifact to config if present
|
|
634877
|
-
assert(isNullish(config.interchainSecurityModule) ||
|
|
634878
|
-
!isArtifactNew(config.interchainSecurityModule), 'Expected ISM to be a deployed or underived artifact');
|
|
634529
|
+
(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .assert */ .v)((0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_3__/* .isNullish */ .u)(config.interchainSecurityModule) ||
|
|
634530
|
+
!(0,_artifact_js__WEBPACK_IMPORTED_MODULE_0__/* .isArtifactNew */ .v_)(config.interchainSecurityModule), 'Expected ISM to be a deployed or underived artifact');
|
|
634879
634531
|
let ismConfig;
|
|
634880
|
-
if (isNullish(config.interchainSecurityModule)) {
|
|
634881
|
-
ismConfig = '';
|
|
634532
|
+
if ((0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_3__/* .isNullish */ .u)(config.interchainSecurityModule)) {
|
|
634533
|
+
ismConfig = '0x0000000000000000000000000000000000000000';
|
|
634882
634534
|
}
|
|
634883
|
-
else if (isArtifactDeployed(config.interchainSecurityModule)) {
|
|
634884
|
-
ismConfig = ismArtifactToDerivedConfig(config.interchainSecurityModule, chainLookup);
|
|
634535
|
+
else if ((0,_artifact_js__WEBPACK_IMPORTED_MODULE_0__/* .isArtifactDeployed */ .R)(config.interchainSecurityModule)) {
|
|
634536
|
+
ismConfig = (0,_ism_js__WEBPACK_IMPORTED_MODULE_2__/* .ismArtifactToDerivedConfig */ .co)(config.interchainSecurityModule, chainLookup);
|
|
634885
634537
|
}
|
|
634886
634538
|
else {
|
|
634887
634539
|
ismConfig = config.interchainSecurityModule.deployed.address;
|
|
634888
634540
|
}
|
|
634889
634541
|
// Convert hook artifact to config if present
|
|
634890
|
-
assert(isNullish(config.hook) || !isArtifactNew(config.hook), 'Expected hook to be a deployed or underived artifact');
|
|
634542
|
+
(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .assert */ .v)((0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_3__/* .isNullish */ .u)(config.hook) || !(0,_artifact_js__WEBPACK_IMPORTED_MODULE_0__/* .isArtifactNew */ .v_)(config.hook), 'Expected hook to be a deployed or underived artifact');
|
|
634891
634543
|
let hookConfig;
|
|
634892
|
-
if (isNullish(config.hook)) {
|
|
634893
|
-
hookConfig = '';
|
|
634544
|
+
if ((0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_3__/* .isNullish */ .u)(config.hook)) {
|
|
634545
|
+
hookConfig = '0x0000000000000000000000000000000000000000';
|
|
634894
634546
|
}
|
|
634895
|
-
else if (isArtifactDeployed(config.hook)) {
|
|
634896
|
-
hookConfig = hookArtifactToDerivedConfig(config.hook, chainLookup);
|
|
634547
|
+
else if ((0,_artifact_js__WEBPACK_IMPORTED_MODULE_0__/* .isArtifactDeployed */ .R)(config.hook)) {
|
|
634548
|
+
hookConfig = (0,_hook_js__WEBPACK_IMPORTED_MODULE_1__/* .hookArtifactToDerivedConfig */ .q6)(config.hook, chainLookup);
|
|
634897
634549
|
}
|
|
634898
634550
|
else {
|
|
634899
634551
|
hookConfig = config.hook.deployed.address;
|
|
@@ -634956,7 +634608,7 @@ function computeRemoteRoutersUpdates(currentRoutersConfig, expectedRoutersConfig
|
|
|
634956
634608
|
for (const [domainIdStr, expectedRemoteRouter] of Object.entries(expectedRoutersConfig.remoteRouters)) {
|
|
634957
634609
|
const domainId = parseInt(domainIdStr);
|
|
634958
634610
|
const expectedDestinationGas = expectedRoutersConfig.destinationGas[domainId];
|
|
634959
|
-
(0,
|
|
634611
|
+
(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .assert */ .v)(!(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_3__/* .isNullish */ .u)(expectedDestinationGas), `Missing destination gas for domain ${domainId} in expected router configuration`);
|
|
634960
634612
|
const currentRouterAddress = currentRoutersConfig.remoteRouters[domainId];
|
|
634961
634613
|
const currentDestinationGas = currentRoutersConfig.destinationGas[domainId] ?? '0';
|
|
634962
634614
|
const needsUpdate = !currentRouterAddress ||
|
|
@@ -672449,6 +672101,9 @@ class RadixWarpArtifactManager {
|
|
|
672449
672101
|
this.gateway = gateway;
|
|
672450
672102
|
this.base = base;
|
|
672451
672103
|
}
|
|
672104
|
+
supportsHookUpdates() {
|
|
672105
|
+
return false;
|
|
672106
|
+
}
|
|
672452
672107
|
async readWarpToken(address) {
|
|
672453
672108
|
// Detect warp token type first
|
|
672454
672109
|
const warpType = await getRadixWarpTokenType(this.gateway, address);
|
|
@@ -680898,11 +680553,14 @@ var arbitrum = __nccwpck_require__(78235);
|
|
|
680898
680553
|
var base = __nccwpck_require__(49768);
|
|
680899
680554
|
// EXTERNAL MODULE: ../../node_modules/.pnpm/viem@2.39.3_bufferutil@4.0.9_typescript@5.8.3_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/chains/definitions/optimism.js
|
|
680900
680555
|
var optimism = __nccwpck_require__(75231);
|
|
680556
|
+
// EXTERNAL MODULE: ../utils/dist/validation.js
|
|
680557
|
+
var validation = __nccwpck_require__(21387);
|
|
680901
680558
|
;// CONCATENATED MODULE: ../rebalancer/dist/bridges/LiFiBridge.js
|
|
680902
680559
|
|
|
680903
680560
|
|
|
680904
680561
|
|
|
680905
680562
|
|
|
680563
|
+
|
|
680906
680564
|
/**
|
|
680907
680565
|
* LiFi API base URL for REST endpoints.
|
|
680908
680566
|
* The SDK doesn't support toAmount quotes, so we use REST API directly.
|
|
@@ -680952,7 +680610,7 @@ function getViemChain(chainId, rpcUrl) {
|
|
|
680952
680610
|
* @see https://docs.li.fi/integrate-li.fi-sdk
|
|
680953
680611
|
*/
|
|
680954
680612
|
class LiFiBridge {
|
|
680955
|
-
static NATIVE_TOKEN_ADDRESS = '
|
|
680613
|
+
static NATIVE_TOKEN_ADDRESS = '0x0000000000000000000000000000000000000000';
|
|
680956
680614
|
externalBridgeId = 'lifi';
|
|
680957
680615
|
logger;
|
|
680958
680616
|
initialized = false;
|
|
@@ -681005,6 +680663,8 @@ class LiFiBridge {
|
|
|
681005
680663
|
if (params.fromAmount === undefined && params.toAmount === undefined) {
|
|
681006
680664
|
throw new Error('Must specify either fromAmount or toAmount');
|
|
681007
680665
|
}
|
|
680666
|
+
(0,validation/* assert */.v)(params.fromAmount === undefined || params.fromAmount > 0n, 'fromAmount must be positive');
|
|
680667
|
+
(0,validation/* assert */.v)(params.toAmount === undefined || params.toAmount > 0n, 'toAmount must be positive');
|
|
681008
680668
|
// Dispatch to appropriate quote method
|
|
681009
680669
|
if (params.toAmount !== undefined) {
|
|
681010
680670
|
return this.quoteByReceivingAmount(params);
|
|
@@ -681052,6 +680712,7 @@ class LiFiBridge {
|
|
|
681052
680712
|
gasCosts,
|
|
681053
680713
|
feeCosts,
|
|
681054
680714
|
route: quote, // Store full quote for conversion to route
|
|
680715
|
+
requestParams: { ...params },
|
|
681055
680716
|
};
|
|
681056
680717
|
}
|
|
681057
680718
|
/**
|
|
@@ -681106,6 +680767,7 @@ class LiFiBridge {
|
|
|
681106
680767
|
gasCosts,
|
|
681107
680768
|
feeCosts,
|
|
681108
680769
|
route: quote, // Store full quote for conversion to route
|
|
680770
|
+
requestParams: { ...params },
|
|
681109
680771
|
};
|
|
681110
680772
|
}
|
|
681111
680773
|
/**
|
|
@@ -681144,6 +680806,7 @@ class LiFiBridge {
|
|
|
681144
680806
|
this.initialize();
|
|
681145
680807
|
// Convert quote to route for execution
|
|
681146
680808
|
const route = convertQuoteToRoute(quote.route);
|
|
680809
|
+
this.validateRouteAgainstRequest(route, quote.requestParams);
|
|
681147
680810
|
const fromChain = route.fromChainId;
|
|
681148
680811
|
const toChain = route.toChainId;
|
|
681149
680812
|
this.logger.info({
|
|
@@ -681236,6 +680899,35 @@ class LiFiBridge {
|
|
|
681236
680899
|
transferId,
|
|
681237
680900
|
};
|
|
681238
680901
|
}
|
|
680902
|
+
/**
|
|
680903
|
+
* Validate that the route returned by LiFi matches the original request parameters.
|
|
680904
|
+
* Prevents execution against wrong chains, tokens, or recipients if the bridge API
|
|
680905
|
+
* returns a route that diverges from what was originally requested.
|
|
680906
|
+
*
|
|
680907
|
+
* TODO: Layer 2 validation — validate transaction calldata in route.steps[].transactionRequest
|
|
680908
|
+
* and route.steps[0].estimate.approvalAddress against a known whitelist.
|
|
680909
|
+
*/
|
|
680910
|
+
validateRouteAgainstRequest(route, requestParams) {
|
|
680911
|
+
(0,validation/* assert */.v)(route.fromChainId === requestParams.fromChain, `Route fromChainId ${route.fromChainId} does not match requested ${requestParams.fromChain}`);
|
|
680912
|
+
(0,validation/* assert */.v)(route.toChainId === requestParams.toChain, `Route toChainId ${route.toChainId} does not match requested ${requestParams.toChain}`);
|
|
680913
|
+
(0,validation/* assert */.v)(route.fromToken.address.toLowerCase() ===
|
|
680914
|
+
requestParams.fromToken.toLowerCase(), `Route fromToken ${route.fromToken.address} does not match requested ${requestParams.fromToken}`);
|
|
680915
|
+
(0,validation/* assert */.v)(route.toToken.address.toLowerCase() ===
|
|
680916
|
+
requestParams.toToken.toLowerCase(), `Route toToken ${route.toToken.address} does not match requested ${requestParams.toToken}`);
|
|
680917
|
+
const expectedToAddress = (requestParams.toAddress ?? requestParams.fromAddress).toLowerCase();
|
|
680918
|
+
(0,validation/* assert */.v)(route.toAddress?.toLowerCase() === expectedToAddress, `Route toAddress ${route.toAddress} does not match requested ${expectedToAddress}`);
|
|
680919
|
+
(0,validation/* assert */.v)(route.fromAddress?.toLowerCase() ===
|
|
680920
|
+
requestParams.fromAddress.toLowerCase(), `Route fromAddress ${route.fromAddress} does not match requested ${requestParams.fromAddress}`);
|
|
680921
|
+
const routeFromAmount = BigInt(route.fromAmount);
|
|
680922
|
+
if (requestParams.fromAmount !== undefined) {
|
|
680923
|
+
(0,validation/* assert */.v)(routeFromAmount === requestParams.fromAmount, `Route fromAmount ${route.fromAmount} does not match requested ${requestParams.fromAmount}`);
|
|
680924
|
+
}
|
|
680925
|
+
if (requestParams.toAmount !== undefined) {
|
|
680926
|
+
const routeToAmount = BigInt(route.toAmount);
|
|
680927
|
+
(0,validation/* assert */.v)(routeToAmount >= requestParams.toAmount, `Route toAmount ${route.toAmount} is less than requested ${requestParams.toAmount}`);
|
|
680928
|
+
}
|
|
680929
|
+
(0,validation/* assert */.v)(routeFromAmount > 0n, 'Route fromAmount must be positive');
|
|
680930
|
+
}
|
|
681239
680931
|
/**
|
|
681240
680932
|
* Get the status of a bridge transfer.
|
|
681241
680933
|
* Uses SDK's built-in status tracking.
|
|
@@ -681341,6 +681033,7 @@ class RebalancerConfig {
|
|
|
681341
681033
|
/* harmony export */ __nccwpck_require__.d(__webpack_exports__, {
|
|
681342
681034
|
/* harmony export */ Pf: () => (/* binding */ ExecutionType),
|
|
681343
681035
|
/* harmony export */ W4: () => (/* binding */ getAllBridges),
|
|
681036
|
+
/* harmony export */ gB: () => (/* binding */ DEFAULT_MOVEMENT_STALENESS_MS),
|
|
681344
681037
|
/* harmony export */ gK: () => (/* binding */ RebalancerMinAmountType),
|
|
681345
681038
|
/* harmony export */ nt: () => (/* binding */ getStrategyChainConfig),
|
|
681346
681039
|
/* harmony export */ rU: () => (/* binding */ RebalancerConfigSchema),
|
|
@@ -681438,6 +681131,7 @@ const RebalancerStrategySchema = zod__WEBPACK_IMPORTED_MODULE_0__/* .union */ .K
|
|
|
681438
681131
|
.transform((val) => (Array.isArray(val) ? val : [val]));
|
|
681439
681132
|
const DEFAULT_INTENT_TTL_S = 604800; // 7 days
|
|
681440
681133
|
const DEFAULT_INTENT_TTL_MS = DEFAULT_INTENT_TTL_S * 1_000;
|
|
681134
|
+
const DEFAULT_MOVEMENT_STALENESS_MS = 30 * 60 * 1_000; // 30 minutes
|
|
681441
681135
|
const LiFiBridgeConfigSchema = zod__WEBPACK_IMPORTED_MODULE_0__/* .object */ .Ik({
|
|
681442
681136
|
integrator: zod__WEBPACK_IMPORTED_MODULE_0__/* .string */ .Yj(),
|
|
681443
681137
|
defaultSlippage: zod__WEBPACK_IMPORTED_MODULE_0__/* .number */ .ai().optional(),
|
|
@@ -683496,27 +683190,27 @@ __nccwpck_require__.a(__webpack_module__, async (__webpack_handle_async_dependen
|
|
|
683496
683190
|
/* harmony export */ __nccwpck_require__.d(__webpack_exports__, {
|
|
683497
683191
|
/* harmony export */ n: () => (/* binding */ RebalancerContextFactory)
|
|
683498
683192
|
/* harmony export */ });
|
|
683499
|
-
/* harmony import */ var
|
|
683500
|
-
/* harmony import */ var
|
|
683501
|
-
/* harmony import */ var
|
|
683502
|
-
/* harmony import */ var
|
|
683503
|
-
/* harmony import */ var
|
|
683193
|
+
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_11__ = __nccwpck_require__(95176);
|
|
683194
|
+
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_12__ = __nccwpck_require__(9035);
|
|
683195
|
+
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_17__ = __nccwpck_require__(90954);
|
|
683196
|
+
/* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_10__ = __nccwpck_require__(73938);
|
|
683197
|
+
/* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_13__ = __nccwpck_require__(39196);
|
|
683504
683198
|
/* harmony import */ var _bridges_LiFiBridge_js__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(19534);
|
|
683505
683199
|
/* harmony import */ var _config_types_js__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(75102);
|
|
683506
683200
|
/* harmony import */ var _core_InventoryRebalancer_js__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(13081);
|
|
683507
|
-
/* harmony import */ var
|
|
683201
|
+
/* harmony import */ var _core_Rebalancer_js__WEBPACK_IMPORTED_MODULE_14__ = __nccwpck_require__(3903);
|
|
683508
683202
|
/* harmony import */ var _core_RebalancerOrchestrator_js__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(67279);
|
|
683509
683203
|
/* harmony import */ var _metrics_Metrics_js__WEBPACK_IMPORTED_MODULE_4__ = __nccwpck_require__(42575);
|
|
683510
683204
|
/* harmony import */ var _metrics_PriceGetter_js__WEBPACK_IMPORTED_MODULE_5__ = __nccwpck_require__(81708);
|
|
683511
683205
|
/* harmony import */ var _monitor_Monitor_js__WEBPACK_IMPORTED_MODULE_6__ = __nccwpck_require__(14135);
|
|
683512
683206
|
/* harmony import */ var _strategy_StrategyFactory_js__WEBPACK_IMPORTED_MODULE_7__ = __nccwpck_require__(52154);
|
|
683513
|
-
/* harmony import */ var
|
|
683207
|
+
/* harmony import */ var _tracking_ActionTracker_js__WEBPACK_IMPORTED_MODULE_8__ = __nccwpck_require__(60732);
|
|
683514
683208
|
/* harmony import */ var _tracking_InflightContextAdapter_js__WEBPACK_IMPORTED_MODULE_18__ = __nccwpck_require__(52209);
|
|
683515
|
-
/* harmony import */ var
|
|
683516
|
-
/* harmony import */ var
|
|
683517
|
-
/* harmony import */ var
|
|
683518
|
-
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_core_InventoryRebalancer_js__WEBPACK_IMPORTED_MODULE_2__, _core_RebalancerOrchestrator_js__WEBPACK_IMPORTED_MODULE_3__, _metrics_Metrics_js__WEBPACK_IMPORTED_MODULE_4__, _metrics_PriceGetter_js__WEBPACK_IMPORTED_MODULE_5__,
|
|
683519
|
-
([_core_InventoryRebalancer_js__WEBPACK_IMPORTED_MODULE_2__, _core_RebalancerOrchestrator_js__WEBPACK_IMPORTED_MODULE_3__, _metrics_Metrics_js__WEBPACK_IMPORTED_MODULE_4__, _metrics_PriceGetter_js__WEBPACK_IMPORTED_MODULE_5__,
|
|
683209
|
+
/* harmony import */ var _tracking_store_index_js__WEBPACK_IMPORTED_MODULE_15__ = __nccwpck_require__(98867);
|
|
683210
|
+
/* harmony import */ var _utils_ExplorerClient_js__WEBPACK_IMPORTED_MODULE_16__ = __nccwpck_require__(14660);
|
|
683211
|
+
/* harmony import */ var _utils_tokenUtils_js__WEBPACK_IMPORTED_MODULE_9__ = __nccwpck_require__(46618);
|
|
683212
|
+
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_core_InventoryRebalancer_js__WEBPACK_IMPORTED_MODULE_2__, _core_RebalancerOrchestrator_js__WEBPACK_IMPORTED_MODULE_3__, _metrics_Metrics_js__WEBPACK_IMPORTED_MODULE_4__, _metrics_PriceGetter_js__WEBPACK_IMPORTED_MODULE_5__, _utils_tokenUtils_js__WEBPACK_IMPORTED_MODULE_9__, _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_11__, _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_12__, _core_Rebalancer_js__WEBPACK_IMPORTED_MODULE_14__]);
|
|
683213
|
+
([_core_InventoryRebalancer_js__WEBPACK_IMPORTED_MODULE_2__, _core_RebalancerOrchestrator_js__WEBPACK_IMPORTED_MODULE_3__, _metrics_Metrics_js__WEBPACK_IMPORTED_MODULE_4__, _metrics_PriceGetter_js__WEBPACK_IMPORTED_MODULE_5__, _utils_tokenUtils_js__WEBPACK_IMPORTED_MODULE_9__, _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_11__, _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_12__, _core_Rebalancer_js__WEBPACK_IMPORTED_MODULE_14__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
|
|
683520
683214
|
|
|
683521
683215
|
|
|
683522
683216
|
|
|
@@ -683579,7 +683273,7 @@ class RebalancerContextFactory {
|
|
|
683579
683273
|
const addresses = await registry.getAddresses();
|
|
683580
683274
|
// The Sealevel warp adapters require the Mailbox address, so we
|
|
683581
683275
|
// get mailboxes for all chains and merge them with the chain metadata.
|
|
683582
|
-
const mailboxes = (0,
|
|
683276
|
+
const mailboxes = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_10__/* .objMap */ .Yp)(addresses, (_, { mailbox }) => ({ mailbox }));
|
|
683583
683277
|
// Fetch warp route config FIRST to get chain list
|
|
683584
683278
|
const warpCoreConfig = warpCoreConfigOverride ??
|
|
683585
683279
|
(await registry.getWarpRoute(config.warpRouteId));
|
|
@@ -683596,9 +683290,9 @@ class RebalancerContextFactory {
|
|
|
683596
683290
|
}
|
|
683597
683291
|
// Create MultiProtocolProvider (convert from MultiProvider if not provided)
|
|
683598
683292
|
const mpp = multiProtocolProvider ??
|
|
683599
|
-
|
|
683293
|
+
_hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_11__/* .MultiProtocolProvider */ .f.fromMultiProvider(multiProvider);
|
|
683600
683294
|
const extendedMultiProtocolProvider = mpp.extendChainMetadata(mailboxes);
|
|
683601
|
-
const warpCore =
|
|
683295
|
+
const warpCore = _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_12__/* .WarpCore */ .u.FromConfig(extendedMultiProtocolProvider, warpCoreConfig);
|
|
683602
683296
|
const tokensByChainName = Object.fromEntries(warpCore.tokens.map((t) => [t.chainName, t]));
|
|
683603
683297
|
logger.debug({
|
|
683604
683298
|
warpRouteId: config.warpRouteId,
|
|
@@ -683639,7 +683333,7 @@ class RebalancerContextFactory {
|
|
|
683639
683333
|
if (chainConfig?.bridgeMinAcceptedAmount) {
|
|
683640
683334
|
const token = this.tokensByChainName[chainName];
|
|
683641
683335
|
const decimals = token?.decimals ?? 18;
|
|
683642
|
-
minAmountsByChain[chainName] = BigInt((0,
|
|
683336
|
+
minAmountsByChain[chainName] = BigInt((0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_13__/* .toWei */ .fq)(chainConfig.bridgeMinAcceptedAmount, decimals));
|
|
683643
683337
|
}
|
|
683644
683338
|
}
|
|
683645
683339
|
this.logger.debug({
|
|
@@ -683649,16 +683343,16 @@ class RebalancerContextFactory {
|
|
|
683649
683343
|
}
|
|
683650
683344
|
createMovableCollateralRebalancer(actionTracker, metrics) {
|
|
683651
683345
|
this.logger.debug({ warpRouteId: this.config.warpRouteId }, 'Creating Rebalancer');
|
|
683652
|
-
const rebalancer = new
|
|
683346
|
+
const rebalancer = new _core_Rebalancer_js__WEBPACK_IMPORTED_MODULE_14__/* .Rebalancer */ .K(this.warpCore, this.multiProvider.metadata, this.tokensByChainName, this.multiProvider, actionTracker, this.logger, metrics);
|
|
683653
683347
|
return rebalancer;
|
|
683654
683348
|
}
|
|
683655
683349
|
async createActionTracker(explorerUrlOrClient = DEFAULT_EXPLORER_URL) {
|
|
683656
683350
|
this.logger.debug({ warpRouteId: this.config.warpRouteId }, 'Creating ActionTracker');
|
|
683657
|
-
const transferStore = new
|
|
683658
|
-
const intentStore = new
|
|
683659
|
-
const actionStore = new
|
|
683351
|
+
const transferStore = new _tracking_store_index_js__WEBPACK_IMPORTED_MODULE_15__/* .InMemoryStore */ .A();
|
|
683352
|
+
const intentStore = new _tracking_store_index_js__WEBPACK_IMPORTED_MODULE_15__/* .InMemoryStore */ .A();
|
|
683353
|
+
const actionStore = new _tracking_store_index_js__WEBPACK_IMPORTED_MODULE_15__/* .InMemoryStore */ .A();
|
|
683660
683354
|
const explorerClient = typeof explorerUrlOrClient === 'string'
|
|
683661
|
-
? new
|
|
683355
|
+
? new _utils_ExplorerClient_js__WEBPACK_IMPORTED_MODULE_16__/* .ExplorerClient */ .x(explorerUrlOrClient)
|
|
683662
683356
|
: explorerUrlOrClient;
|
|
683663
683357
|
// 3. Get MultiProtocolCore from registry (supports all VM types)
|
|
683664
683358
|
// Only fetch/validate addresses for warp route chains (not all registry chains)
|
|
@@ -683671,7 +683365,7 @@ class RebalancerContextFactory {
|
|
|
683671
683365
|
}
|
|
683672
683366
|
coreAddresses[chain] = addrs;
|
|
683673
683367
|
}
|
|
683674
|
-
const multiProtocolCore =
|
|
683368
|
+
const multiProtocolCore = _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_17__/* .MultiProtocolCore */ .n.fromAddressesMap(coreAddresses, this.multiProtocolProvider);
|
|
683675
683369
|
// 4. Get rebalancer address from signer
|
|
683676
683370
|
// Use the first chain in the strategy to get the signer address
|
|
683677
683371
|
const chainNames = (0,_config_types_js__WEBPACK_IMPORTED_MODULE_1__/* .getStrategyChainNames */ .zj)(this.config.strategyConfig);
|
|
@@ -683695,7 +683389,7 @@ class RebalancerContextFactory {
|
|
|
683695
683389
|
intentTTL: this.config.intentTTL,
|
|
683696
683390
|
};
|
|
683697
683391
|
// 6. Create ActionTracker
|
|
683698
|
-
const tracker = new
|
|
683392
|
+
const tracker = new _tracking_ActionTracker_js__WEBPACK_IMPORTED_MODULE_8__/* .ActionTracker */ .N(transferStore, intentStore, actionStore, explorerClient, multiProtocolCore, trackerConfig, this.logger);
|
|
683699
683393
|
// 7. Create InflightContextAdapter
|
|
683700
683394
|
const adapter = new _tracking_InflightContextAdapter_js__WEBPACK_IMPORTED_MODULE_18__/* .InflightContextAdapter */ .m(tracker, this.multiProvider);
|
|
683701
683395
|
this.logger.debug({
|
|
@@ -683838,7 +683532,7 @@ class RebalancerContextFactory {
|
|
|
683838
683532
|
let initialTotalCollateral = 0n;
|
|
683839
683533
|
const chainNames = new Set((0,_config_types_js__WEBPACK_IMPORTED_MODULE_1__/* .getStrategyChainNames */ .zj)(this.config.strategyConfig));
|
|
683840
683534
|
await Promise.all(this.warpCore.tokens.map(async (token) => {
|
|
683841
|
-
if ((0,
|
|
683535
|
+
if ((0,_utils_tokenUtils_js__WEBPACK_IMPORTED_MODULE_9__/* .isCollateralizedTokenEligibleForRebalancing */ .rC)(token) &&
|
|
683842
683536
|
chainNames.has(token.chainName)) {
|
|
683843
683537
|
const adapter = token.getHypAdapter(this.warpCore.multiProvider);
|
|
683844
683538
|
const bridgedSupply = await adapter.getBridgedSupply();
|
|
@@ -685537,12 +685231,15 @@ const parse = dist/* parse */.qg;
|
|
|
685537
685231
|
var messages = __nccwpck_require__(78160);
|
|
685538
685232
|
// EXTERNAL MODULE: ../utils/dist/validation.js
|
|
685539
685233
|
var validation = __nccwpck_require__(21387);
|
|
685234
|
+
// EXTERNAL MODULE: ../rebalancer/dist/config/types.js
|
|
685235
|
+
var types = __nccwpck_require__(75102);
|
|
685540
685236
|
// EXTERNAL MODULE: ../rebalancer/dist/utils/blockTag.js
|
|
685541
685237
|
var blockTag = __nccwpck_require__(82167);
|
|
685542
685238
|
;// CONCATENATED MODULE: ../rebalancer/dist/tracking/ActionTracker.js
|
|
685543
685239
|
|
|
685544
685240
|
|
|
685545
685241
|
|
|
685242
|
+
|
|
685546
685243
|
/**
|
|
685547
685244
|
* ActionTracker implementation managing the lifecycle of tracked entities.
|
|
685548
685245
|
*/
|
|
@@ -685924,12 +685621,38 @@ class ActionTracker {
|
|
|
685924
685621
|
continue;
|
|
685925
685622
|
const actions = await this.getActionsForIntent(intent.id);
|
|
685926
685623
|
// Check for in-flight inventory_movement actions
|
|
685927
|
-
// Skip intents
|
|
685928
|
-
|
|
685929
|
-
|
|
685624
|
+
// Skip intents with active bridge movement(s). Movements still `pending` on
|
|
685625
|
+
// the bridge are kept alive regardless of age. Non-pending movements are only
|
|
685626
|
+
// failed after they've been in a non-pending state for the staleness window
|
|
685627
|
+
// (nonPendingSince), preventing premature failure from transient not_found polls.
|
|
685628
|
+
// `undefined` status (pre-deploy data) falls back to createdAt for staleness.
|
|
685629
|
+
const inflightMovements = actions.filter((a) => a.status === 'in_progress' && a.type === 'inventory_movement');
|
|
685630
|
+
const now = Date.now();
|
|
685631
|
+
const staleMovements = inflightMovements.filter((a) => {
|
|
685632
|
+
if (a.lastBridgeStatus === 'pending')
|
|
685633
|
+
return false;
|
|
685634
|
+
// Use nonPendingSince when available; fall back to createdAt for
|
|
685635
|
+
// pre-deploy data that lacks the field.
|
|
685636
|
+
const nonPendingStart = a.nonPendingSince ?? a.createdAt;
|
|
685637
|
+
return now - nonPendingStart >= types/* DEFAULT_MOVEMENT_STALENESS_MS */.gB;
|
|
685638
|
+
});
|
|
685639
|
+
const staleMovementIds = new Set(staleMovements.map((a) => a.id));
|
|
685640
|
+
const hasBlockingInflightMovement = inflightMovements.some((a) => !staleMovementIds.has(a.id));
|
|
685641
|
+
if (hasBlockingInflightMovement) {
|
|
685930
685642
|
this.logger.debug({ intentId: intent.id }, 'Skipping partial intent - has in-flight inventory movement');
|
|
685931
685643
|
continue;
|
|
685932
685644
|
}
|
|
685645
|
+
// Fail stale movements so the intent can proceed
|
|
685646
|
+
for (const movement of staleMovements) {
|
|
685647
|
+
await this.failRebalanceAction(movement.id);
|
|
685648
|
+
this.logger.warn({
|
|
685649
|
+
actionId: movement.id,
|
|
685650
|
+
age: now - movement.createdAt,
|
|
685651
|
+
nonPendingDuration: now - (movement.nonPendingSince ?? movement.createdAt),
|
|
685652
|
+
intentId: intent.id,
|
|
685653
|
+
lastBridgeStatus: movement.lastBridgeStatus,
|
|
685654
|
+
}, 'Failing stale inventory movement to unblock intent');
|
|
685655
|
+
}
|
|
685933
685656
|
// Compute amounts from action states
|
|
685934
685657
|
const completedAmount = actions
|
|
685935
685658
|
.filter((a) => a.status === 'complete' && a.type === 'inventory_deposit')
|
|
@@ -686001,13 +685724,26 @@ class ActionTracker {
|
|
|
686001
685724
|
}, 'Inventory movement failed');
|
|
686002
685725
|
}
|
|
686003
685726
|
else if (status.status === 'pending') {
|
|
685727
|
+
await this.rebalanceActionStore.update(action.id, {
|
|
685728
|
+
lastBridgeStatus: 'pending',
|
|
685729
|
+
nonPendingSince: undefined,
|
|
685730
|
+
});
|
|
686004
685731
|
this.logger.debug({
|
|
686005
685732
|
actionId: action.id,
|
|
686006
685733
|
txHash: action.txHash,
|
|
686007
685734
|
substatus: status.substatus,
|
|
686008
685735
|
}, 'Inventory movement still pending');
|
|
686009
685736
|
}
|
|
686010
|
-
|
|
685737
|
+
else if (status.status === 'not_found') {
|
|
685738
|
+
await this.rebalanceActionStore.update(action.id, {
|
|
685739
|
+
lastBridgeStatus: 'not_found',
|
|
685740
|
+
nonPendingSince: action.nonPendingSince ?? Date.now(),
|
|
685741
|
+
});
|
|
685742
|
+
this.logger.debug({
|
|
685743
|
+
actionId: action.id,
|
|
685744
|
+
txHash: action.txHash,
|
|
685745
|
+
}, 'Inventory movement not found');
|
|
685746
|
+
}
|
|
686011
685747
|
}
|
|
686012
685748
|
catch (error) {
|
|
686013
685749
|
this.logger.debug({
|
|
@@ -690443,7 +690179,7 @@ const defaultMultisigConfigs = {
|
|
|
690443
690179
|
},
|
|
690444
690180
|
{
|
|
690445
690181
|
address: '0xa6c998f0db2b56d7a63faf30a9b677c8b9b6faab',
|
|
690446
|
-
alias: '
|
|
690182
|
+
alias: 'P-OPS Team',
|
|
690447
690183
|
},
|
|
690448
690184
|
{
|
|
690449
690185
|
address: '0x21e93a81920b73c0e98aed8e6b058dae409e4909',
|
|
@@ -696612,33 +696348,40 @@ async function getImplementationInput({ bytecode, chainName, contractName, imple
|
|
|
696612
696348
|
|
|
696613
696349
|
__nccwpck_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
|
696614
696350
|
/* harmony export */ __nccwpck_require__.d(__webpack_exports__, {
|
|
696615
|
-
/* harmony export */
|
|
696616
|
-
/* harmony export */
|
|
696351
|
+
/* harmony export */ $h: () => (/* binding */ executeWarpDeploy),
|
|
696352
|
+
/* harmony export */ A2: () => (/* binding */ enrollCrossChainRouters),
|
|
696353
|
+
/* harmony export */ u_: () => (/* binding */ validateWarpConfigForAltVM)
|
|
696617
696354
|
/* harmony export */ });
|
|
696618
696355
|
/* harmony import */ var _hyperlane_xyz_core__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(9156);
|
|
696619
696356
|
/* harmony import */ var _hyperlane_xyz_core_buildArtifact_js__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(74119);
|
|
696620
|
-
/* harmony import */ var _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(
|
|
696357
|
+
/* harmony import */ var _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(78272);
|
|
696621
696358
|
/* harmony import */ var _hyperlane_xyz_provider_sdk__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(18951);
|
|
696622
|
-
/* harmony import */ var
|
|
696623
|
-
/* harmony import */ var
|
|
696624
|
-
/* harmony import */ var
|
|
696625
|
-
/* harmony import */ var
|
|
696626
|
-
/* harmony import */ var
|
|
696627
|
-
/* harmony import */ var
|
|
696628
|
-
/* harmony import */ var
|
|
696629
|
-
/* harmony import */ var
|
|
696630
|
-
/* harmony import */ var
|
|
696631
|
-
/* harmony import */ var
|
|
696359
|
+
/* harmony import */ var _hyperlane_xyz_provider_sdk_artifact__WEBPACK_IMPORTED_MODULE_4__ = __nccwpck_require__(4287);
|
|
696360
|
+
/* harmony import */ var _hyperlane_xyz_provider_sdk_hook__WEBPACK_IMPORTED_MODULE_5__ = __nccwpck_require__(77230);
|
|
696361
|
+
/* harmony import */ var _hyperlane_xyz_provider_sdk_ism__WEBPACK_IMPORTED_MODULE_6__ = __nccwpck_require__(96426);
|
|
696362
|
+
/* harmony import */ var _hyperlane_xyz_provider_sdk_warp__WEBPACK_IMPORTED_MODULE_7__ = __nccwpck_require__(17791);
|
|
696363
|
+
/* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_12__ = __nccwpck_require__(73938);
|
|
696364
|
+
/* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_13__ = __nccwpck_require__(21387);
|
|
696365
|
+
/* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_17__ = __nccwpck_require__(94523);
|
|
696366
|
+
/* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_21__ = __nccwpck_require__(14918);
|
|
696367
|
+
/* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_22__ = __nccwpck_require__(93142);
|
|
696368
|
+
/* harmony import */ var _block_explorer_etherscan_js__WEBPACK_IMPORTED_MODULE_10__ = __nccwpck_require__(26492);
|
|
696369
|
+
/* harmony import */ var _ccip_utils_js__WEBPACK_IMPORTED_MODULE_16__ = __nccwpck_require__(93035);
|
|
696370
|
+
/* harmony import */ var _hook_EvmHookModule_js__WEBPACK_IMPORTED_MODULE_20__ = __nccwpck_require__(10256);
|
|
696371
|
+
/* harmony import */ var _ism_EvmIsmModule_js__WEBPACK_IMPORTED_MODULE_18__ = __nccwpck_require__(3612);
|
|
696632
696372
|
/* harmony import */ var _metadata_ChainMetadataManager_js__WEBPACK_IMPORTED_MODULE_15__ = __nccwpck_require__(22887);
|
|
696633
|
-
/* harmony import */ var
|
|
696634
|
-
/* harmony import */ var
|
|
696635
|
-
/* harmony import */ var
|
|
696636
|
-
/* harmony import */ var
|
|
696637
|
-
/* harmony import */ var
|
|
696638
|
-
/* harmony import */ var
|
|
696639
|
-
/* harmony import */ var
|
|
696640
|
-
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([
|
|
696641
|
-
|
|
696373
|
+
/* harmony import */ var _token_EvmWarpModule_js__WEBPACK_IMPORTED_MODULE_23__ = __nccwpck_require__(48807);
|
|
696374
|
+
/* harmony import */ var _token_config_js__WEBPACK_IMPORTED_MODULE_8__ = __nccwpck_require__(4169);
|
|
696375
|
+
/* harmony import */ var _token_contracts_js__WEBPACK_IMPORTED_MODULE_24__ = __nccwpck_require__(81504);
|
|
696376
|
+
/* harmony import */ var _token_deploy_js__WEBPACK_IMPORTED_MODULE_14__ = __nccwpck_require__(19186);
|
|
696377
|
+
/* harmony import */ var _utils_ism_js__WEBPACK_IMPORTED_MODULE_19__ = __nccwpck_require__(764);
|
|
696378
|
+
/* harmony import */ var _HyperlaneProxyFactoryDeployer_js__WEBPACK_IMPORTED_MODULE_11__ = __nccwpck_require__(84387);
|
|
696379
|
+
/* harmony import */ var _verify_ContractVerifier_js__WEBPACK_IMPORTED_MODULE_9__ = __nccwpck_require__(76939);
|
|
696380
|
+
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_token_EvmWarpModule_js__WEBPACK_IMPORTED_MODULE_23__]);
|
|
696381
|
+
_token_EvmWarpModule_js__WEBPACK_IMPORTED_MODULE_23__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
|
|
696382
|
+
|
|
696383
|
+
|
|
696384
|
+
|
|
696642
696385
|
|
|
696643
696386
|
|
|
696644
696387
|
|
|
@@ -696657,43 +696400,103 @@ _token_EvmWarpModule_js__WEBPACK_IMPORTED_MODULE_20__ = (__webpack_async_depende
|
|
|
696657
696400
|
|
|
696658
696401
|
|
|
696659
696402
|
|
|
696403
|
+
const SUPPORTED_ALTVM_TOKEN_TYPES = new Set([
|
|
696404
|
+
_token_config_js__WEBPACK_IMPORTED_MODULE_8__/* .TokenType */ .ks.synthetic,
|
|
696405
|
+
_token_config_js__WEBPACK_IMPORTED_MODULE_8__/* .TokenType */ .ks.collateral,
|
|
696406
|
+
_token_config_js__WEBPACK_IMPORTED_MODULE_8__/* .TokenType */ .ks.native,
|
|
696407
|
+
]);
|
|
696408
|
+
function validateWarpConfigForAltVM(config, chain) {
|
|
696409
|
+
if (!SUPPORTED_ALTVM_TOKEN_TYPES.has(config.type)) {
|
|
696410
|
+
const supportedTypes = Array.from(SUPPORTED_ALTVM_TOKEN_TYPES).join(', ');
|
|
696411
|
+
throw new Error(`Unsupported token type '${config.type}' for Alt-VM chain '${chain}'.\n` +
|
|
696412
|
+
`Supported token types: ${supportedTypes}.`);
|
|
696413
|
+
}
|
|
696414
|
+
if (config.interchainSecurityModule) {
|
|
696415
|
+
(0,_hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_2__/* .validateIsmConfig */ .mM)(config.interchainSecurityModule, chain, 'warp config');
|
|
696416
|
+
}
|
|
696417
|
+
const baseConfig = {
|
|
696418
|
+
owner: config.owner,
|
|
696419
|
+
mailbox: config.mailbox,
|
|
696420
|
+
interchainSecurityModule: config.interchainSecurityModule,
|
|
696421
|
+
hook: config.hook,
|
|
696422
|
+
remoteRouters: config.remoteRouters,
|
|
696423
|
+
destinationGas: config.destinationGas,
|
|
696424
|
+
};
|
|
696425
|
+
if (config.type === _token_config_js__WEBPACK_IMPORTED_MODULE_8__/* .TokenType */ .ks.collateral) {
|
|
696426
|
+
if (!config.token) {
|
|
696427
|
+
throw new Error(`Collateral token config for chain '${chain}' must specify 'token' address`);
|
|
696428
|
+
}
|
|
696429
|
+
const result = {
|
|
696430
|
+
...baseConfig,
|
|
696431
|
+
type: _hyperlane_xyz_provider_sdk_warp__WEBPACK_IMPORTED_MODULE_7__/* .TokenType */ .ks.collateral,
|
|
696432
|
+
token: config.token,
|
|
696433
|
+
};
|
|
696434
|
+
return result;
|
|
696435
|
+
}
|
|
696436
|
+
else if (config.type === _token_config_js__WEBPACK_IMPORTED_MODULE_8__/* .TokenType */ .ks.synthetic) {
|
|
696437
|
+
const result = {
|
|
696438
|
+
...baseConfig,
|
|
696439
|
+
type: _hyperlane_xyz_provider_sdk_warp__WEBPACK_IMPORTED_MODULE_7__/* .TokenType */ .ks.synthetic,
|
|
696440
|
+
name: config.name,
|
|
696441
|
+
symbol: config.symbol,
|
|
696442
|
+
decimals: config.decimals,
|
|
696443
|
+
};
|
|
696444
|
+
return result;
|
|
696445
|
+
}
|
|
696446
|
+
else {
|
|
696447
|
+
const result = {
|
|
696448
|
+
...baseConfig,
|
|
696449
|
+
type: _hyperlane_xyz_provider_sdk_warp__WEBPACK_IMPORTED_MODULE_7__/* .TokenType */ .ks.native,
|
|
696450
|
+
};
|
|
696451
|
+
return result;
|
|
696452
|
+
}
|
|
696453
|
+
}
|
|
696660
696454
|
async function executeWarpDeploy(warpDeployConfig, multiProvider, altVmSigners, registryAddresses, apiKeys) {
|
|
696661
|
-
const contractVerifier = new
|
|
696662
|
-
const ismFactoryDeployer = new
|
|
696455
|
+
const contractVerifier = new _verify_ContractVerifier_js__WEBPACK_IMPORTED_MODULE_9__/* .ContractVerifier */ .j(multiProvider, apiKeys, _hyperlane_xyz_core_buildArtifact_js__WEBPACK_IMPORTED_MODULE_1__/* .buildArtifact */ .L, _block_explorer_etherscan_js__WEBPACK_IMPORTED_MODULE_10__/* .ExplorerLicenseType */ .p8.MIT);
|
|
696456
|
+
const ismFactoryDeployer = new _HyperlaneProxyFactoryDeployer_js__WEBPACK_IMPORTED_MODULE_11__/* .HyperlaneProxyFactoryDeployer */ .h(multiProvider, contractVerifier);
|
|
696663
696457
|
// For each chain in WarpRouteConfig, deploy each Ism Factory, if it's not in the registry
|
|
696664
696458
|
// Then return a modified config with the ism and/or hook address as a string
|
|
696665
696459
|
const modifiedConfig = await resolveWarpIsmAndHook(warpDeployConfig, multiProvider, altVmSigners, registryAddresses, ismFactoryDeployer, contractVerifier);
|
|
696666
696460
|
// Initialize with unsupported chains so that they are enrolled
|
|
696667
|
-
let deployedContracts = (0,
|
|
696668
|
-
(0,
|
|
696461
|
+
let deployedContracts = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_12__/* .objMap */ .Yp)((0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_12__/* .objFilter */ .s3)(warpDeployConfig, (_chain, config) => !!config.foreignDeployment), (chain, config) => {
|
|
696462
|
+
(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_13__/* .assert */ .v)(config.foreignDeployment, `Expected foreignDeployment field to be defined on ${chain} after filtering`);
|
|
696669
696463
|
return config.foreignDeployment;
|
|
696670
696464
|
});
|
|
696671
696465
|
// get unique list of protocols
|
|
696672
696466
|
const protocols = Array.from(new Set(Object.keys(modifiedConfig).map((chainName) => multiProvider.getProtocol(chainName))));
|
|
696673
696467
|
for (const protocol of protocols) {
|
|
696674
|
-
const protocolSpecificConfig = (0,
|
|
696468
|
+
const protocolSpecificConfig = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_12__/* .objFilter */ .s3)(modifiedConfig, (chainName, config) => multiProvider.getProtocol(chainName) === protocol &&
|
|
696675
696469
|
!config.foreignDeployment);
|
|
696676
|
-
if ((0,
|
|
696470
|
+
if ((0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_12__/* .isObjEmpty */ .XY)(protocolSpecificConfig)) {
|
|
696677
696471
|
continue;
|
|
696678
696472
|
}
|
|
696679
696473
|
switch (protocol) {
|
|
696680
696474
|
case _hyperlane_xyz_provider_sdk__WEBPACK_IMPORTED_MODULE_3__/* .ProtocolType */ .Hb.Ethereum: {
|
|
696681
696475
|
const deployer = warpDeployConfig.isNft
|
|
696682
|
-
? new
|
|
696683
|
-
: new
|
|
696476
|
+
? new _token_deploy_js__WEBPACK_IMPORTED_MODULE_14__/* .HypERC721Deployer */ .il(multiProvider)
|
|
696477
|
+
: new _token_deploy_js__WEBPACK_IMPORTED_MODULE_14__/* .HypERC20Deployer */ .A7(multiProvider); // TODO: replace with EvmWarpModule
|
|
696684
696478
|
const evmContracts = await deployer.deploy(protocolSpecificConfig);
|
|
696685
696479
|
deployedContracts = {
|
|
696686
696480
|
...deployedContracts,
|
|
696687
|
-
...(0,
|
|
696481
|
+
...(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_12__/* .objMap */ .Yp)(evmContracts, (_, contracts) => getRouter(contracts).address),
|
|
696688
696482
|
};
|
|
696689
696483
|
break;
|
|
696690
696484
|
}
|
|
696691
696485
|
default: {
|
|
696692
|
-
const
|
|
696693
|
-
const
|
|
696486
|
+
const chainLookup = (0,_metadata_ChainMetadataManager_js__WEBPACK_IMPORTED_MODULE_15__/* .altVmChainLookup */ .O)(multiProvider);
|
|
696487
|
+
const deployResults = {};
|
|
696488
|
+
for (const chain of (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_12__/* .objKeys */ .cG)(protocolSpecificConfig)) {
|
|
696489
|
+
const config = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_12__/* .mustGet */ .Qd)(protocolSpecificConfig, chain);
|
|
696490
|
+
const signer = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_12__/* .mustGet */ .Qd)(altVmSigners, chain);
|
|
696491
|
+
const chainMetadata = chainLookup.getChainMetadata(chain);
|
|
696492
|
+
const writer = (0,_hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_2__/* .createWarpTokenWriter */ .l5)(chainMetadata, chainLookup, signer);
|
|
696493
|
+
const artifact = (0,_hyperlane_xyz_provider_sdk_warp__WEBPACK_IMPORTED_MODULE_7__/* .warpConfigToArtifact */ .ku)(validateWarpConfigForAltVM(config, chain), chainLookup);
|
|
696494
|
+
const [deployed] = await writer.create(artifact);
|
|
696495
|
+
deployResults[chain] = deployed.deployed.address;
|
|
696496
|
+
}
|
|
696694
696497
|
deployedContracts = {
|
|
696695
696498
|
...deployedContracts,
|
|
696696
|
-
...
|
|
696499
|
+
...deployResults,
|
|
696697
696500
|
};
|
|
696698
696501
|
break;
|
|
696699
696502
|
}
|
|
@@ -696702,8 +696505,8 @@ async function executeWarpDeploy(warpDeployConfig, multiProvider, altVmSigners,
|
|
|
696702
696505
|
return deployedContracts;
|
|
696703
696506
|
}
|
|
696704
696507
|
async function resolveWarpIsmAndHook(warpConfig, multiProvider, altVmSigners, registryAddresses, ismFactoryDeployer, contractVerifier) {
|
|
696705
|
-
return (0,
|
|
696706
|
-
const ccipContractCache = new
|
|
696508
|
+
return (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_12__/* .promiseObjAll */ .a1)((0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_12__/* .objMap */ .Yp)(warpConfig, async (chain, config) => {
|
|
696509
|
+
const ccipContractCache = new _ccip_utils_js__WEBPACK_IMPORTED_MODULE_16__/* .CCIPContractCache */ .G5(registryAddresses);
|
|
696707
696510
|
const chainAddresses = registryAddresses[chain];
|
|
696708
696511
|
if (!chainAddresses) {
|
|
696709
696512
|
throw `Registry factory addresses not found for ${chain}.`;
|
|
@@ -696740,20 +696543,20 @@ async function createWarpIsm({ ccipContractCache, chain, chainAddresses, multiPr
|
|
|
696740
696543
|
const { interchainSecurityModule } = warpConfig;
|
|
696741
696544
|
if (!interchainSecurityModule ||
|
|
696742
696545
|
typeof interchainSecurityModule === 'string') {
|
|
696743
|
-
|
|
696546
|
+
_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_17__/* .rootLogger */ .Jk.info(`Config Ism is ${!interchainSecurityModule ? 'empty' : interchainSecurityModule}, skipping deployment.`);
|
|
696744
696547
|
return interchainSecurityModule;
|
|
696745
696548
|
}
|
|
696746
|
-
|
|
696747
|
-
|
|
696748
|
-
|
|
696549
|
+
_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_17__/* .rootLogger */ .Jk.info(`Loading registry factory addresses for ${chain}...`);
|
|
696550
|
+
_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_17__/* .rootLogger */ .Jk.info(`Creating ${interchainSecurityModule.type} ISM for token on ${chain} chain...`);
|
|
696551
|
+
_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_17__/* .rootLogger */ .Jk.info(`Finished creating ${interchainSecurityModule.type} ISM for token on ${chain} chain.`);
|
|
696749
696552
|
const protocolType = multiProvider.getProtocol(chain);
|
|
696750
696553
|
switch (protocolType) {
|
|
696751
696554
|
case _hyperlane_xyz_provider_sdk__WEBPACK_IMPORTED_MODULE_3__/* .ProtocolType */ .Hb.Ethereum: {
|
|
696752
|
-
const evmIsmModule = await
|
|
696555
|
+
const evmIsmModule = await _ism_EvmIsmModule_js__WEBPACK_IMPORTED_MODULE_18__/* .EvmIsmModule */ .a.create({
|
|
696753
696556
|
chain,
|
|
696754
696557
|
mailbox: chainAddresses.mailbox,
|
|
696755
696558
|
multiProvider: multiProvider,
|
|
696756
|
-
proxyFactoryFactories: (0,
|
|
696559
|
+
proxyFactoryFactories: (0,_utils_ism_js__WEBPACK_IMPORTED_MODULE_19__/* .extractIsmAndHookFactoryAddresses */ .zs)(chainAddresses),
|
|
696757
696560
|
config: interchainSecurityModule,
|
|
696758
696561
|
ccipContractCache,
|
|
696759
696562
|
contractVerifier,
|
|
@@ -696762,11 +696565,11 @@ async function createWarpIsm({ ccipContractCache, chain, chainAddresses, multiPr
|
|
|
696762
696565
|
return deployedIsm;
|
|
696763
696566
|
}
|
|
696764
696567
|
default: {
|
|
696765
|
-
const signer = (0,
|
|
696568
|
+
const signer = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_12__/* .mustGet */ .Qd)(altVmSigners, chain);
|
|
696766
696569
|
const chainLookup = (0,_metadata_ChainMetadataManager_js__WEBPACK_IMPORTED_MODULE_15__/* .altVmChainLookup */ .O)(multiProvider);
|
|
696767
696570
|
const chainMetadata = chainLookup.getChainMetadata(chain);
|
|
696768
696571
|
const writer = (0,_hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_2__/* .createIsmWriter */ .lN)(chainMetadata, chainLookup, signer);
|
|
696769
|
-
const artifact = (0,
|
|
696572
|
+
const artifact = (0,_hyperlane_xyz_provider_sdk_ism__WEBPACK_IMPORTED_MODULE_6__/* .ismConfigToArtifact */ .HL)(
|
|
696770
696573
|
// FIXME: not all ISM types are supported yet
|
|
696771
696574
|
interchainSecurityModule, chainLookup);
|
|
696772
696575
|
const [deployed] = await writer.create(artifact);
|
|
@@ -696777,21 +696580,21 @@ async function createWarpIsm({ ccipContractCache, chain, chainAddresses, multiPr
|
|
|
696777
696580
|
async function createWarpHook({ ccipContractCache, chain, chainAddresses, multiProvider, altVmSigners, contractVerifier, warpConfig, }) {
|
|
696778
696581
|
const { hook } = warpConfig;
|
|
696779
696582
|
if (!hook || typeof hook === 'string') {
|
|
696780
|
-
|
|
696583
|
+
_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_17__/* .rootLogger */ .Jk.info(`Config Hook is ${!hook ? 'empty' : hook}, skipping deployment.`);
|
|
696781
696584
|
return hook;
|
|
696782
696585
|
}
|
|
696783
|
-
|
|
696784
|
-
|
|
696586
|
+
_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_17__/* .rootLogger */ .Jk.info(`Loading registry factory addresses for ${chain}...`);
|
|
696587
|
+
_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_17__/* .rootLogger */ .Jk.info(`Creating ${hook.type} Hook for token on ${chain} chain...`);
|
|
696785
696588
|
const protocolType = multiProvider.getProtocol(chain);
|
|
696786
696589
|
switch (protocolType) {
|
|
696787
696590
|
case _hyperlane_xyz_provider_sdk__WEBPACK_IMPORTED_MODULE_3__/* .ProtocolType */ .Hb.Ethereum: {
|
|
696788
|
-
|
|
696789
|
-
|
|
696591
|
+
_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_17__/* .rootLogger */ .Jk.info(`Loading registry factory addresses for ${chain}...`);
|
|
696592
|
+
_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_17__/* .rootLogger */ .Jk.info(`Creating ${hook.type} Hook for token on ${chain} chain...`);
|
|
696790
696593
|
// If config.proxyadmin.address exists, then use that. otherwise deploy a new proxyAdmin
|
|
696791
696594
|
const proxyAdminAddress = warpConfig.proxyAdmin?.address ??
|
|
696792
696595
|
(await multiProvider.handleDeploy(chain, new _hyperlane_xyz_core__WEBPACK_IMPORTED_MODULE_0__/* .ProxyAdmin__factory */ .Aig(), []))
|
|
696793
696596
|
.address;
|
|
696794
|
-
const evmHookModule = await
|
|
696597
|
+
const evmHookModule = await _hook_EvmHookModule_js__WEBPACK_IMPORTED_MODULE_20__/* .EvmHookModule */ .o.create({
|
|
696795
696598
|
chain,
|
|
696796
696599
|
multiProvider: multiProvider,
|
|
696797
696600
|
coreAddresses: {
|
|
@@ -696801,42 +696604,42 @@ async function createWarpHook({ ccipContractCache, chain, chainAddresses, multiP
|
|
|
696801
696604
|
config: hook,
|
|
696802
696605
|
ccipContractCache,
|
|
696803
696606
|
contractVerifier,
|
|
696804
|
-
proxyFactoryFactories: (0,
|
|
696607
|
+
proxyFactoryFactories: (0,_utils_ism_js__WEBPACK_IMPORTED_MODULE_19__/* .extractIsmAndHookFactoryAddresses */ .zs)(chainAddresses),
|
|
696805
696608
|
});
|
|
696806
|
-
|
|
696609
|
+
_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_17__/* .rootLogger */ .Jk.info(`Finished creating ${hook.type} Hook for token on ${chain} chain.`);
|
|
696807
696610
|
const { deployedHook } = evmHookModule.serialize();
|
|
696808
696611
|
return deployedHook;
|
|
696809
696612
|
}
|
|
696810
696613
|
default: {
|
|
696811
|
-
const signer = (0,
|
|
696614
|
+
const signer = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_12__/* .mustGet */ .Qd)(altVmSigners, chain);
|
|
696812
696615
|
const chainLookup = (0,_metadata_ChainMetadataManager_js__WEBPACK_IMPORTED_MODULE_15__/* .altVmChainLookup */ .O)(multiProvider);
|
|
696813
696616
|
const metadata = multiProvider.getChainMetadata(chain);
|
|
696814
696617
|
// Deploy new hook using artifact writer with mailbox context
|
|
696815
696618
|
const writer = (0,_hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_2__/* .createHookWriter */ .JM)(metadata, chainLookup, signer, {
|
|
696816
696619
|
mailbox: chainAddresses.mailbox,
|
|
696817
696620
|
});
|
|
696818
|
-
const artifact = (0,
|
|
696621
|
+
const artifact = (0,_hyperlane_xyz_provider_sdk_hook__WEBPACK_IMPORTED_MODULE_5__/* .hookConfigToArtifact */ .hV)(hook, chainLookup);
|
|
696819
696622
|
const [deployed] = await writer.create(artifact);
|
|
696820
696623
|
return deployed.deployed.address;
|
|
696821
696624
|
}
|
|
696822
696625
|
}
|
|
696823
696626
|
}
|
|
696824
696627
|
async function enrollCrossChainRouters({ multiProvider, altVmSigners, registryAddresses, warpDeployConfig, }, deployedContracts) {
|
|
696825
|
-
|
|
696826
|
-
const resolvedConfigMap = (0,
|
|
696827
|
-
gas: (0,
|
|
696628
|
+
_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_17__/* .rootLogger */ .Jk.info(`Start enrolling cross chain routers`);
|
|
696629
|
+
const resolvedConfigMap = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_12__/* .objMap */ .Yp)(warpDeployConfig, (_, config) => ({
|
|
696630
|
+
gas: (0,_token_config_js__WEBPACK_IMPORTED_MODULE_8__/* .gasOverhead */ .yv)(config.type),
|
|
696828
696631
|
...config,
|
|
696829
696632
|
}));
|
|
696830
|
-
const supportedChains = Object.keys((0,
|
|
696633
|
+
const supportedChains = Object.keys((0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_12__/* .objFilter */ .s3)(resolvedConfigMap, (_, config) => !config.foreignDeployment));
|
|
696831
696634
|
// Process all chains in parallel since they are independent
|
|
696832
|
-
const { fulfilled, rejected } = await (0,
|
|
696635
|
+
const { fulfilled, rejected } = await (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_21__/* .mapAllSettled */ .bh)(supportedChains, async (currentChain) => {
|
|
696833
696636
|
const protocol = multiProvider.getProtocol(currentChain);
|
|
696834
696637
|
const remoteRouters = Object.fromEntries(Object.entries(deployedContracts)
|
|
696835
696638
|
.filter(([chain, _address]) => chain !== currentChain)
|
|
696836
696639
|
.map(([chain, address]) => [
|
|
696837
696640
|
multiProvider.getDomainId(chain).toString(),
|
|
696838
696641
|
{
|
|
696839
|
-
address: (0,
|
|
696642
|
+
address: (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_22__/* .addressToBytes32 */ .In)(address),
|
|
696840
696643
|
},
|
|
696841
696644
|
]));
|
|
696842
696645
|
const destinationGas = Object.fromEntries(Object.entries(deployedContracts)
|
|
@@ -696846,13 +696649,13 @@ async function enrollCrossChainRouters({ multiProvider, altVmSigners, registryAd
|
|
|
696846
696649
|
resolvedConfigMap[chain].gas.toString(),
|
|
696847
696650
|
]));
|
|
696848
696651
|
for (const domainId of Object.keys(remoteRouters)) {
|
|
696849
|
-
|
|
696652
|
+
_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_17__/* .rootLogger */ .Jk.debug(`Creating enroll remote router transactions with remote domain id ${domainId} and address ${remoteRouters[domainId]} on chain ${currentChain}`);
|
|
696850
696653
|
}
|
|
696851
696654
|
let transactions = [];
|
|
696852
696655
|
switch (protocol) {
|
|
696853
696656
|
case _hyperlane_xyz_provider_sdk__WEBPACK_IMPORTED_MODULE_3__/* .ProtocolType */ .Hb.Ethereum: {
|
|
696854
696657
|
const { domainRoutingIsmFactory, incrementalDomainRoutingIsmFactory, staticMerkleRootMultisigIsmFactory, staticMessageIdMultisigIsmFactory, staticAggregationIsmFactory, staticAggregationHookFactory, staticMerkleRootWeightedMultisigIsmFactory, staticMessageIdWeightedMultisigIsmFactory, } = registryAddresses[currentChain];
|
|
696855
|
-
const evmWarpModule = new
|
|
696658
|
+
const evmWarpModule = new _token_EvmWarpModule_js__WEBPACK_IMPORTED_MODULE_23__/* .EvmWarpModule */ .N(multiProvider, {
|
|
696856
696659
|
chain: currentChain,
|
|
696857
696660
|
config: resolvedConfigMap[currentChain],
|
|
696858
696661
|
addresses: {
|
|
@@ -696880,25 +696683,25 @@ async function enrollCrossChainRouters({ multiProvider, altVmSigners, registryAd
|
|
|
696880
696683
|
break;
|
|
696881
696684
|
}
|
|
696882
696685
|
default: {
|
|
696883
|
-
const signer = (0,
|
|
696884
|
-
const
|
|
696885
|
-
|
|
696886
|
-
|
|
696887
|
-
addresses: {
|
|
696888
|
-
deployedTokenRoute: deployedContracts[currentChain],
|
|
696889
|
-
},
|
|
696890
|
-
});
|
|
696891
|
-
const actualConfig = await warpModule.read();
|
|
696686
|
+
const signer = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_12__/* .mustGet */ .Qd)(altVmSigners, currentChain);
|
|
696687
|
+
const chainLookup = (0,_metadata_ChainMetadataManager_js__WEBPACK_IMPORTED_MODULE_15__/* .altVmChainLookup */ .O)(multiProvider);
|
|
696688
|
+
const chainMetadata = chainLookup.getChainMetadata(currentChain);
|
|
696689
|
+
const writer = (0,_hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_2__/* .createWarpTokenWriter */ .l5)(chainMetadata, chainLookup, signer);
|
|
696892
696690
|
const expectedConfig = {
|
|
696893
|
-
...
|
|
696894
|
-
owner: resolvedConfigMap[currentChain].owner,
|
|
696691
|
+
...resolvedConfigMap[currentChain],
|
|
696895
696692
|
remoteRouters,
|
|
696896
696693
|
destinationGas,
|
|
696897
696694
|
};
|
|
696898
|
-
|
|
696695
|
+
const artifact = (0,_hyperlane_xyz_provider_sdk_warp__WEBPACK_IMPORTED_MODULE_7__/* .warpConfigToArtifact */ .ku)(validateWarpConfigForAltVM(expectedConfig, currentChain), chainLookup);
|
|
696696
|
+
const deployedArtifact = {
|
|
696697
|
+
artifactState: _hyperlane_xyz_provider_sdk_artifact__WEBPACK_IMPORTED_MODULE_4__/* .ArtifactState */ .O2.DEPLOYED,
|
|
696698
|
+
config: artifact.config,
|
|
696699
|
+
deployed: { address: deployedContracts[currentChain] },
|
|
696700
|
+
};
|
|
696701
|
+
transactions = await writer.update(deployedArtifact);
|
|
696899
696702
|
}
|
|
696900
696703
|
}
|
|
696901
|
-
|
|
696704
|
+
_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_17__/* .rootLogger */ .Jk.debug(`Created enroll router update transactions for chain ${currentChain}`);
|
|
696902
696705
|
return { chain: currentChain, transactions };
|
|
696903
696706
|
}, (chain) => chain);
|
|
696904
696707
|
// Process settled results and collect transactions
|
|
@@ -696910,7 +696713,7 @@ async function enrollCrossChainRouters({ multiProvider, altVmSigners, registryAd
|
|
|
696910
696713
|
}
|
|
696911
696714
|
}
|
|
696912
696715
|
for (const [chain, error] of rejected) {
|
|
696913
|
-
|
|
696716
|
+
_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_17__/* .rootLogger */ .Jk.error(`Failed to create enroll router transactions for chain ${chain}: ${error.message}`);
|
|
696914
696717
|
errors.push(`${chain}: ${error.message}`);
|
|
696915
696718
|
}
|
|
696916
696719
|
if (errors.length > 0) {
|
|
@@ -696919,7 +696722,7 @@ async function enrollCrossChainRouters({ multiProvider, altVmSigners, registryAd
|
|
|
696919
696722
|
return updateTransactions;
|
|
696920
696723
|
}
|
|
696921
696724
|
function getRouter(contracts) {
|
|
696922
|
-
for (const key of (0,
|
|
696725
|
+
for (const key of (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_12__/* .objKeys */ .cG)(_token_contracts_js__WEBPACK_IMPORTED_MODULE_24__/* .hypERC20factories */ .AE)) {
|
|
696923
696726
|
if (contracts[key])
|
|
696924
696727
|
return contracts[key];
|
|
696925
696728
|
}
|
|
@@ -703380,6 +703183,8 @@ __nccwpck_require__.d(__webpack_exports__, {
|
|
|
703380
703183
|
var lib = __nccwpck_require__(61934);
|
|
703381
703184
|
// EXTERNAL MODULE: ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js + 4 modules
|
|
703382
703185
|
var types = __nccwpck_require__(49355);
|
|
703186
|
+
// EXTERNAL MODULE: ../sdk/dist/metadata/customZodTypes.js
|
|
703187
|
+
var customZodTypes = __nccwpck_require__(47690);
|
|
703383
703188
|
// EXTERNAL MODULE: ../../solidity/dist/index.js + 424 modules
|
|
703384
703189
|
var dist = __nccwpck_require__(9156);
|
|
703385
703190
|
// EXTERNAL MODULE: ../utils/dist/addresses.js
|
|
@@ -703450,6 +703255,7 @@ var account_contracts = __nccwpck_require__(29817);
|
|
|
703450
703255
|
|
|
703451
703256
|
|
|
703452
703257
|
|
|
703258
|
+
|
|
703453
703259
|
const IGP_DEFAULT_GAS = lib.BigNumber.from(50_000);
|
|
703454
703260
|
const ICA_OVERHEAD = lib.BigNumber.from(50_000);
|
|
703455
703261
|
const PER_CALL_OVERHEAD = lib.BigNumber.from(5_000);
|
|
@@ -703713,12 +703519,12 @@ function commitmentFromIcaCalls(calls, salt) {
|
|
|
703713
703519
|
}
|
|
703714
703520
|
const PostCallsSchema = types/* object */.Ik({
|
|
703715
703521
|
calls: types/* array */.YO(types/* object */.Ik({
|
|
703716
|
-
to:
|
|
703522
|
+
to: customZodTypes/* ZHash */.l,
|
|
703717
703523
|
data: types/* string */.Yj(),
|
|
703718
703524
|
value: types/* string */.Yj().optional(),
|
|
703719
703525
|
}))
|
|
703720
703526
|
.min(1),
|
|
703721
|
-
relayers: types/* array */.YO(
|
|
703527
|
+
relayers: types/* array */.YO(customZodTypes/* ZHash */.l),
|
|
703722
703528
|
salt: types/* string */.Yj(),
|
|
703723
703529
|
commitmentDispatchTx: types/* string */.Yj(),
|
|
703724
703530
|
originDomain: types/* number */.ai(),
|
|
@@ -744528,6 +744334,14 @@ class Token {
|
|
|
744528
744334
|
const { standard, chainName, addressOrDenom, collateralAddressOrDenom } = this;
|
|
744529
744335
|
const chainMetadata = multiProvider.tryGetChainMetadata(chainName);
|
|
744530
744336
|
const mailbox = chainMetadata?.mailbox;
|
|
744337
|
+
if (standard === _TokenStandard_js__WEBPACK_IMPORTED_MODULE_0__/* .TokenStandard */ .ph.EvmNative &&
|
|
744338
|
+
this.connections?.length &&
|
|
744339
|
+
this.connections.every((c) => !c.type || c.type === _TokenConnection_js__WEBPACK_IMPORTED_MODULE_11__/* .TokenConnectionType */ .M6.Hyperlane)) {
|
|
744340
|
+
(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_1__/* .assert */ .v)(chainMetadata, `Token chain ${chainName} not found in multiProvider`);
|
|
744341
|
+
return new _adapters_EvmTokenAdapter_js__WEBPACK_IMPORTED_MODULE_4__/* .EvmHypNativeAdapter */ .uc(chainName, multiProvider, {
|
|
744342
|
+
token: addressOrDenom,
|
|
744343
|
+
});
|
|
744344
|
+
}
|
|
744531
744345
|
(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_1__/* .assert */ .v)(this.isMultiChainToken(), `Token standard ${standard} not applicable to hyp adapter`);
|
|
744532
744346
|
(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_1__/* .assert */ .v)(!this.isNft(), 'NFT adapters not yet supported');
|
|
744533
744347
|
(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_1__/* .assert */ .v)(chainMetadata, `Token chain ${chainName} not found in multiProvider`);
|
|
@@ -745094,6 +744908,7 @@ const TOKEN_NFT_STANDARDS = [
|
|
|
745094
744908
|
];
|
|
745095
744909
|
const TOKEN_COLLATERALIZED_STANDARDS = [
|
|
745096
744910
|
TokenStandard.EvmHypCollateral,
|
|
744911
|
+
TokenStandard.EvmHypOwnerCollateral,
|
|
745097
744912
|
TokenStandard.EvmHypNative,
|
|
745098
744913
|
TokenStandard.SealevelHypCollateral,
|
|
745099
744914
|
TokenStandard.SealevelHypNative,
|
|
@@ -746752,6 +746567,9 @@ class BaseEvmHypXERC20LockboxAdapter extends EvmHypCollateralAdapter {
|
|
|
746752
746567
|
this.addresses = addresses;
|
|
746753
746568
|
this.hypXERC20Lockbox = dist/* HypXERC20Lockbox__factory */.OK0.connect(addresses.token, this.getProvider());
|
|
746754
746569
|
}
|
|
746570
|
+
async loadWrappedTokenAddress() {
|
|
746571
|
+
return this.hypXERC20Lockbox.wrappedToken();
|
|
746572
|
+
}
|
|
746755
746573
|
/**
|
|
746756
746574
|
* Note this may be inaccurate, as this returns the balance
|
|
746757
746575
|
* of the lockbox contract, which may be used by other bridges.
|
|
@@ -756366,8 +756184,17 @@ class WarpCore {
|
|
|
756366
756184
|
}
|
|
756367
756185
|
// Form transactions to estimate local gas with
|
|
756368
756186
|
const recipient = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_5__/* .convertToProtocolAddress */ .Vj)(sender, destinationMetadata.protocol, destinationMetadata.bech32Prefix);
|
|
756187
|
+
// Use a small but viable amount for gas estimation. Must survive on-chain
|
|
756188
|
+
// decimal truncation (e.g. 18→6 decimals) to avoid reverts like
|
|
756189
|
+
// "HypNativeMinter: destination amount < 1". Compute minimum as
|
|
756190
|
+
// 10^(originDecimals - destDecimals) so destination gets exactly 1 unit.
|
|
756191
|
+
const destToken = originToken.getConnectionForChain(destinationMetadata.name)?.token;
|
|
756192
|
+
const decimalDiff = destToken
|
|
756193
|
+
? Math.max(0, originToken.decimals - destToken.decimals)
|
|
756194
|
+
: 0;
|
|
756195
|
+
const gasEstimationAmount = BigInt(10) ** BigInt(decimalDiff);
|
|
756369
756196
|
const txs = await this.getTransferRemoteTxs({
|
|
756370
|
-
originTokenAmount: originToken.amount(
|
|
756197
|
+
originTokenAmount: originToken.amount(gasEstimationAmount),
|
|
756371
756198
|
destination,
|
|
756372
756199
|
sender,
|
|
756373
756200
|
recipient,
|
|
@@ -895936,7 +895763,7 @@ module.exports = /*#__PURE__*/JSON.parse('[{"type":"function","name":"proveL2Lea
|
|
|
895936
895763
|
/***/ 77087:
|
|
895937
895764
|
/***/ ((module) => {
|
|
895938
895765
|
|
|
895939
|
-
module.exports = {"rE":"25.
|
|
895766
|
+
module.exports = {"rE":"25.5.0"};
|
|
895940
895767
|
|
|
895941
895768
|
/***/ })
|
|
895942
895769
|
|