@@ -3,6 +3,7 @@ import { stringify as yamlStringify } from 'yaml';
3
3
4
4
import {
5
5
ChainMap ,
6
+ ChainTechnicalStack ,
6
7
DeployedOwnableConfig ,
7
8
IsmConfig ,
8
9
IsmType ,
@@ -158,6 +159,10 @@ export async function createWarpRouteDeployConfig({
158
159
owner ,
159
160
) ;
160
161
162
+ const excludeStaticIsms =
163
+ context . multiProvider . getChainMetadata ( chain ) . technicalStack ===
164
+ ChainTechnicalStack . ZkSync ;
165
+
161
166
/**
162
167
* The logic from the cli is as follows:
163
168
* --advanced flag is provided: the user will have to build their own configuration using the available ISM types
@@ -168,15 +173,24 @@ export async function createWarpRouteDeployConfig({
168
173
*/
169
174
let interchainSecurityModule : IsmConfig ;
170
175
if ( advanced ) {
171
- interchainSecurityModule = await createAdvancedIsmConfig ( context ) ;
176
+ interchainSecurityModule = await createAdvancedIsmConfig (
177
+ context ,
178
+ excludeStaticIsms ,
179
+ ) ;
172
180
} else if ( context . skipConfirmation ) {
173
- interchainSecurityModule = createDefaultWarpIsmConfig ( owner ) ;
181
+ interchainSecurityModule = createDefaultWarpIsmConfig (
182
+ owner ,
183
+ excludeStaticIsms ,
184
+ ) ;
174
185
} else if (
175
186
await confirm ( {
176
187
message : 'Do you want to use a trusted ISM for warp route?' ,
177
188
} )
178
189
) {
179
- interchainSecurityModule = createDefaultWarpIsmConfig ( owner ) ;
190
+ interchainSecurityModule = createDefaultWarpIsmConfig (
191
+ owner ,
192
+ excludeStaticIsms ,
193
+ ) ;
180
194
} else {
181
195
interchainSecurityModule = createFallbackRoutingConfig ( owner ) ;
182
196
}
@@ -291,23 +305,36 @@ export function readWarpCoreConfig(filePath: string): WarpCoreConfig {
291
305
}
292
306
293
307
/**
294
- * Creates a default configuration for an ISM with a TRUSTED_RELAYER and FALLBACK_ROUTING .
308
+ * Creates a default configuration for an ISM.
295
309
*
296
- * Properties relayer and owner are both set as input owner.
310
+ * When excludeStaticIsms is false (default):
311
+ * - Creates an AGGREGATION ISM with TRUSTED_RELAYER and FALLBACK_ROUTING modules
312
+ * - Properties relayer and owner are both set as input owner
297
313
*
298
- * @param owner - The address of the owner of the ISM.
299
- * @returns The default Aggregation ISM configuration.
314
+ * When excludeStaticIsms is true:
315
+ * - Creates only a TRUSTED_RELAYER ISM (as static ISMs like AGGREGATION are not supported)
316
+ * - Properties relayer is set as input owner
317
+ *
318
+ * @param owner - The address of the owner of the ISM
319
+ * @param excludeStaticIsms - Whether to exclude static ISM types (default: false)
320
+ * @returns The ISM configuration
300
321
*/
301
- function createDefaultWarpIsmConfig ( owner : Address ) : IsmConfig {
322
+ function createDefaultWarpIsmConfig (
323
+ owner : Address ,
324
+ excludeStaticIsms : boolean = false ,
325
+ ) : IsmConfig {
326
+ const trustedRelayerModule : IsmConfig = {
327
+ type : IsmType . TRUSTED_RELAYER ,
328
+ relayer : owner ,
329
+ } ;
330
+
331
+ if ( excludeStaticIsms ) {
332
+ return trustedRelayerModule ;
333
+ }
334
+
302
335
return {
303
336
type : IsmType . AGGREGATION ,
304
- modules : [
305
- {
306
- type : IsmType . TRUSTED_RELAYER ,
307
- relayer : owner ,
308
- } ,
309
- createFallbackRoutingConfig ( owner ) ,
310
- ] ,
337
+ modules : [ trustedRelayerModule , createFallbackRoutingConfig ( owner ) ] ,
311
338
threshold : 1 ,
312
339
} ;
313
340
}
0 commit comments