@ -16,6 +16,7 @@ import {
MailboxClient__factory ,
MailboxClient__factory ,
OPStackIsm ,
OPStackIsm ,
OPStackIsm__factory ,
OPStackIsm__factory ,
PausableIsm__factory ,
StaticAddressSetFactory ,
StaticAddressSetFactory ,
StaticAggregationIsm__factory ,
StaticAggregationIsm__factory ,
StaticThresholdAddressSetFactory ,
StaticThresholdAddressSetFactory ,
@ -145,6 +146,13 @@ export class HyperlaneIsmFactory extends HyperlaneApp<ProxyFactoryFactories> {
case IsmType . OP_STACK :
case IsmType . OP_STACK :
contract = await this . deployOpStackIsm ( destination , config ) ;
contract = await this . deployOpStackIsm ( destination , config ) ;
break ;
break ;
case IsmType . PAUSABLE :
contract = await this . multiProvider . handleDeploy (
destination ,
new PausableIsm__factory ( ) ,
[ config . owner ] ,
) ;
break ;
case IsmType . TEST_ISM :
case IsmType . TEST_ISM :
contract = await this . multiProvider . handleDeploy (
contract = await this . multiProvider . handleDeploy (
destination ,
destination ,
@ -616,7 +624,7 @@ export async function moduleMatchesConfig(
) ;
) ;
// Check that the RoutingISM owner matches the config
// Check that the RoutingISM owner matches the config
const owner = await routingIsm . owner ( ) ;
const owner = await routingIsm . owner ( ) ;
matches = matches && eqAddress ( owner , config . owner ) ;
matches && = eqAddress ( owner , config . owner ) ;
// check if the mailbox matches the config for fallback routing
// check if the mailbox matches the config for fallback routing
if ( config . type === IsmType . FALLBACK_ROUTING ) {
if ( config . type === IsmType . FALLBACK_ROUTING ) {
const client = MailboxClient__factory . connect ( module Address , provider ) ;
const client = MailboxClient__factory . connect ( module Address , provider ) ;
@ -653,8 +661,8 @@ export async function moduleMatchesConfig(
const [ subModules , threshold ] = await aggregationIsm . module sAndThreshold (
const [ subModules , threshold ] = await aggregationIsm . module sAndThreshold (
'0x' ,
'0x' ,
) ;
) ;
matches = matches && threshold === config . threshold ;
matches && = threshold === config . threshold ;
matches = matches && subModules . length === config . module s.length ;
matches && = subModules . length === config . module s.length ;
const configIndexMatched = new Map ( ) ;
const configIndexMatched = new Map ( ) ;
for ( const subModule of subModules ) {
for ( const subModule of subModules ) {
@ -666,12 +674,12 @@ export async function moduleMatchesConfig(
// The submodule returned by the ISM must match exactly one
// The submodule returned by the ISM must match exactly one
// entry in the config.
// entry in the config.
const count = subModuleMatchesConfig . filter ( Boolean ) . length ;
const count = subModuleMatchesConfig . filter ( Boolean ) . length ;
matches = matches && count === 1 ;
matches && = count === 1 ;
// That entry in the config should not have been matched already.
// That entry in the config should not have been matched already.
subModuleMatchesConfig . forEach ( ( matched , index ) = > {
subModuleMatchesConfig . forEach ( ( matched , index ) = > {
if ( matched ) {
if ( matched ) {
matches = matches && ! configIndexMatched . has ( index ) ;
matches && = ! configIndexMatched . has ( index ) ;
configIndexMatched . set ( index , true ) ;
configIndexMatched . set ( index , true ) ;
}
}
} ) ;
} ) ;
@ -681,7 +689,7 @@ export async function moduleMatchesConfig(
case IsmType . OP_STACK : {
case IsmType . OP_STACK : {
const opStackIsm = OPStackIsm__factory . connect ( module Address , provider ) ;
const opStackIsm = OPStackIsm__factory . connect ( module Address , provider ) ;
const type = await opStackIsm . module Type ( ) ;
const type = await opStackIsm . module Type ( ) ;
matches = matches && type === ModuleType . NULL ;
matches && = type === ModuleType . NULL ;
break ;
break ;
}
}
case IsmType . TEST_ISM : {
case IsmType . TEST_ISM : {
@ -689,6 +697,17 @@ export async function moduleMatchesConfig(
matches = true ;
matches = true ;
break ;
break ;
}
}
case IsmType . PAUSABLE : {
const pausableIsm = PausableIsm__factory . connect ( module Address , provider ) ;
const owner = await pausableIsm . owner ( ) ;
matches && = eqAddress ( owner , config . owner ) ;
if ( config . paused ) {
const isPaused = await pausableIsm . paused ( ) ;
matches && = config . paused === isPaused ;
}
break ;
}
default : {
default : {
throw new Error ( 'Unsupported ModuleType' ) ;
throw new Error ( 'Unsupported ModuleType' ) ;
}
}
@ -789,8 +808,10 @@ export function collectValidators(
aggregatedValidators . forEach ( ( set ) = > {
aggregatedValidators . forEach ( ( set ) = > {
validators = validators . concat ( [ . . . set ] ) ;
validators = validators . concat ( [ . . . set ] ) ;
} ) ;
} ) ;
} else if ( config . type === IsmType . TEST_ISM ) {
} else if (
// This is just a TestISM
config . type === IsmType . TEST_ISM ||
config . type === IsmType . PAUSABLE
) {
return new Set ( [ ] ) ;
return new Set ( [ ] ) ;
} else {
} else {
throw new Error ( 'Unsupported ModuleType' ) ;
throw new Error ( 'Unsupported ModuleType' ) ;