V3 core deployment tooling (with static hook config assumptions) (#2681)
Co-authored-by: Kunal Arora <55632507+aroralanuk@users.noreply.github.com> Fixes https://github.com/hyperlane-xyz/issues/issues/559pull/2748/head
parent
f0e4f2b89b
commit
10765b7614
@ -1,242 +0,0 @@ |
||||
{ |
||||
"test1": [ |
||||
{ |
||||
"name": "MultisigIsmFactory", |
||||
"address": "0x5FbDB2315678afecb367f032d93F642f64180aa3", |
||||
"constructorArguments": "", |
||||
"isProxy": false |
||||
}, |
||||
{ |
||||
"name": "AggregationIsmFactory", |
||||
"address": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512", |
||||
"constructorArguments": "", |
||||
"isProxy": false |
||||
}, |
||||
{ |
||||
"name": "RoutingIsmFactory", |
||||
"address": "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0", |
||||
"constructorArguments": "", |
||||
"isProxy": false |
||||
}, |
||||
{ |
||||
"name": "MultisigIsmFactory", |
||||
"address": "0x5FbDB2315678afecb367f032d93F642f64180aa3", |
||||
"constructorArguments": "", |
||||
"isProxy": false |
||||
}, |
||||
{ |
||||
"name": "AggregationIsmFactory", |
||||
"address": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512", |
||||
"constructorArguments": "", |
||||
"isProxy": false |
||||
}, |
||||
{ |
||||
"name": "RoutingIsmFactory", |
||||
"address": "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0", |
||||
"constructorArguments": "", |
||||
"isProxy": false |
||||
}, |
||||
{ |
||||
"name": "MultisigIsmFactory", |
||||
"address": "0x5FbDB2315678afecb367f032d93F642f64180aa3", |
||||
"constructorArguments": "", |
||||
"isProxy": false |
||||
}, |
||||
{ |
||||
"name": "AggregationIsmFactory", |
||||
"address": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512", |
||||
"constructorArguments": "", |
||||
"isProxy": false |
||||
}, |
||||
{ |
||||
"name": "RoutingIsmFactory", |
||||
"address": "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0", |
||||
"constructorArguments": "", |
||||
"isProxy": false |
||||
}, |
||||
{ |
||||
"name": "MerkleRootMultisigIsmFactory", |
||||
"address": "0x09635F643e140090A9A8Dcd712eD6285858ceBef", |
||||
"constructorArguments": "", |
||||
"isProxy": false |
||||
}, |
||||
{ |
||||
"name": "MessageIdMultisigIsmFactory", |
||||
"address": "0xc5a5C42992dECbae36851359345FE25997F5C42d", |
||||
"constructorArguments": "", |
||||
"isProxy": false |
||||
}, |
||||
{ |
||||
"name": "AggregationIsmFactory", |
||||
"address": "0x67d269191c92Caf3cD7723F116c85e6E9bf55933", |
||||
"constructorArguments": "", |
||||
"isProxy": false |
||||
}, |
||||
{ |
||||
"name": "RoutingIsmFactory", |
||||
"address": "0xE6E340D132b5f46d1e472DebcD681B2aBc16e57E", |
||||
"constructorArguments": "", |
||||
"isProxy": false |
||||
} |
||||
], |
||||
"test2": [ |
||||
{ |
||||
"name": "MultisigIsmFactory", |
||||
"address": "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9", |
||||
"constructorArguments": "", |
||||
"isProxy": false |
||||
}, |
||||
{ |
||||
"name": "AggregationIsmFactory", |
||||
"address": "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9", |
||||
"constructorArguments": "", |
||||
"isProxy": false |
||||
}, |
||||
{ |
||||
"name": "RoutingIsmFactory", |
||||
"address": "0x5FC8d32690cc91D4c39d9d3abcBD16989F875707", |
||||
"constructorArguments": "", |
||||
"isProxy": false |
||||
}, |
||||
{ |
||||
"name": "MultisigIsmFactory", |
||||
"address": "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9", |
||||
"constructorArguments": "", |
||||
"isProxy": false |
||||
}, |
||||
{ |
||||
"name": "AggregationIsmFactory", |
||||
"address": "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9", |
||||
"constructorArguments": "", |
||||
"isProxy": false |
||||
}, |
||||
{ |
||||
"name": "RoutingIsmFactory", |
||||
"address": "0x5FC8d32690cc91D4c39d9d3abcBD16989F875707", |
||||
"constructorArguments": "", |
||||
"isProxy": false |
||||
}, |
||||
{ |
||||
"name": "MultisigIsmFactory", |
||||
"address": "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9", |
||||
"constructorArguments": "", |
||||
"isProxy": false |
||||
}, |
||||
{ |
||||
"name": "AggregationIsmFactory", |
||||
"address": "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9", |
||||
"constructorArguments": "", |
||||
"isProxy": false |
||||
}, |
||||
{ |
||||
"name": "RoutingIsmFactory", |
||||
"address": "0x5FC8d32690cc91D4c39d9d3abcBD16989F875707", |
||||
"constructorArguments": "", |
||||
"isProxy": false |
||||
}, |
||||
{ |
||||
"name": "MerkleRootMultisigIsmFactory", |
||||
"address": "0xc3e53F4d16Ae77Db1c982e75a937B9f60FE63690", |
||||
"constructorArguments": "", |
||||
"isProxy": false |
||||
}, |
||||
{ |
||||
"name": "MessageIdMultisigIsmFactory", |
||||
"address": "0x84eA74d481Ee0A5332c457a4d796187F6Ba67fEB", |
||||
"constructorArguments": "", |
||||
"isProxy": false |
||||
}, |
||||
{ |
||||
"name": "AggregationIsmFactory", |
||||
"address": "0x9E545E3C0baAB3E08CdfD552C960A1050f373042", |
||||
"constructorArguments": "", |
||||
"isProxy": false |
||||
}, |
||||
{ |
||||
"name": "RoutingIsmFactory", |
||||
"address": "0xa82fF9aFd8f496c3d6ac40E2a0F282E47488CFc9", |
||||
"constructorArguments": "", |
||||
"isProxy": false |
||||
} |
||||
], |
||||
"test3": [ |
||||
{ |
||||
"name": "MultisigIsmFactory", |
||||
"address": "0x0165878A594ca255338adfa4d48449f69242Eb8F", |
||||
"constructorArguments": "", |
||||
"isProxy": false |
||||
}, |
||||
{ |
||||
"name": "AggregationIsmFactory", |
||||
"address": "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853", |
||||
"constructorArguments": "", |
||||
"isProxy": false |
||||
}, |
||||
{ |
||||
"name": "RoutingIsmFactory", |
||||
"address": "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6", |
||||
"constructorArguments": "", |
||||
"isProxy": false |
||||
}, |
||||
{ |
||||
"name": "MultisigIsmFactory", |
||||
"address": "0x0165878A594ca255338adfa4d48449f69242Eb8F", |
||||
"constructorArguments": "", |
||||
"isProxy": false |
||||
}, |
||||
{ |
||||
"name": "AggregationIsmFactory", |
||||
"address": "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853", |
||||
"constructorArguments": "", |
||||
"isProxy": false |
||||
}, |
||||
{ |
||||
"name": "RoutingIsmFactory", |
||||
"address": "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6", |
||||
"constructorArguments": "", |
||||
"isProxy": false |
||||
}, |
||||
{ |
||||
"name": "MultisigIsmFactory", |
||||
"address": "0x0165878A594ca255338adfa4d48449f69242Eb8F", |
||||
"constructorArguments": "", |
||||
"isProxy": false |
||||
}, |
||||
{ |
||||
"name": "AggregationIsmFactory", |
||||
"address": "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853", |
||||
"constructorArguments": "", |
||||
"isProxy": false |
||||
}, |
||||
{ |
||||
"name": "RoutingIsmFactory", |
||||
"address": "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6", |
||||
"constructorArguments": "", |
||||
"isProxy": false |
||||
}, |
||||
{ |
||||
"name": "MerkleRootMultisigIsmFactory", |
||||
"address": "0x1613beB3B2C4f22Ee086B2b38C1476A3cE7f78E8", |
||||
"constructorArguments": "", |
||||
"isProxy": false |
||||
}, |
||||
{ |
||||
"name": "MessageIdMultisigIsmFactory", |
||||
"address": "0x851356ae760d987E095750cCeb3bC6014560891C", |
||||
"constructorArguments": "", |
||||
"isProxy": false |
||||
}, |
||||
{ |
||||
"name": "AggregationIsmFactory", |
||||
"address": "0xf5059a5D33d5853360D16C683c16e67980206f36", |
||||
"constructorArguments": "", |
||||
"isProxy": false |
||||
}, |
||||
{ |
||||
"name": "RoutingIsmFactory", |
||||
"address": "0x95401dc811bb5740090279Ba06cfA8fcF6113778", |
||||
"constructorArguments": "", |
||||
"isProxy": false |
||||
} |
||||
] |
||||
} |
@ -1,41 +0,0 @@ |
||||
{ |
||||
"test1": { |
||||
"storageGasOracle": "0x36C02dA8a0983159322a80FFE9F24b1acfF8B570", |
||||
"validatorAnnounce": "0x322813Fd9A801c5507c9de605d63CEA4f2CE6c44", |
||||
"proxyAdmin": "0x5eb3Bc0a489C5A8288765d2336659EbCA68FCd00", |
||||
"mailbox": "0x4ed7c70F96B99c776995fB64377f0d4aB3B0e1C1", |
||||
"interchainGasPaymaster": "0x1291Be112d480055DaFd8a610b7d1e203891C274", |
||||
"defaultIsmInterchainGasPaymaster": "0xb7278A61aa25c888815aFC32Ad3cC52fF24fE575", |
||||
"legacyMultisigIsm": "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0", |
||||
"merkleRootMultisigIsm": "0x5FbDB2315678afecb367f032d93F642f64180aa3", |
||||
"messageIdMultisigIsm": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512", |
||||
"aggregationIsm": "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9", |
||||
"routingIsm": "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9" |
||||
}, |
||||
"test2": { |
||||
"storageGasOracle": "0x2bdCC0de6bE1f7D2ee689a0342D76F52E8EFABa3", |
||||
"validatorAnnounce": "0xa82fF9aFd8f496c3d6ac40E2a0F282E47488CFc9", |
||||
"proxyAdmin": "0x82e01223d51Eb87e16A03E24687EDF0F294da6f1", |
||||
"mailbox": "0x9E545E3C0baAB3E08CdfD552C960A1050f373042", |
||||
"interchainGasPaymaster": "0xc351628EB244ec633d5f21fBD6621e1a683B1181", |
||||
"defaultIsmInterchainGasPaymaster": "0xcbEAF3BDe82155F56486Fb5a1072cb8baAf547cc", |
||||
"legacyMultisigIsm": "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853", |
||||
"merkleRootMultisigIsm": "0x5FC8d32690cc91D4c39d9d3abcBD16989F875707", |
||||
"messageIdMultisigIsm": "0x0165878A594ca255338adfa4d48449f69242Eb8F", |
||||
"aggregationIsm": "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6", |
||||
"routingIsm": "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318" |
||||
}, |
||||
"test3": { |
||||
"storageGasOracle": "0x162A433068F51e18b7d13932F27e66a3f99E6890", |
||||
"validatorAnnounce": "0x9d4454B023096f34B160D6B654540c56A1F81688", |
||||
"proxyAdmin": "0xB0D4afd8879eD9F52b28595d31B441D079B2Ca07", |
||||
"mailbox": "0x8f86403A4DE0BB5791fa46B8e795C547942fE4Cf", |
||||
"interchainGasPaymaster": "0x1fA02b2d6A771842690194Cf62D91bdd92BfE28d", |
||||
"defaultIsmInterchainGasPaymaster": "0x04C89607413713Ec9775E14b954286519d836FEf", |
||||
"legacyMultisigIsm": "0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0", |
||||
"merkleRootMultisigIsm": "0x610178dA211FEF7D417bC0e6FeD39F05609AD788", |
||||
"messageIdMultisigIsm": "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e", |
||||
"aggregationIsm": "0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82", |
||||
"routingIsm": "0x9A676e781A523b5d0C0e43731313A708CB607508" |
||||
} |
||||
} |
@ -1,23 +1,17 @@ |
||||
import { |
||||
Mailbox__factory, |
||||
ProxyAdmin__factory, |
||||
TimelockController__factory, |
||||
ValidatorAnnounce__factory, |
||||
} from '@hyperlane-xyz/core'; |
||||
import { Address } from '@hyperlane-xyz/utils'; |
||||
|
||||
import { HyperlaneAddresses } from '../contracts/types'; |
||||
|
||||
export const coreFactories = { |
||||
validatorAnnounce: new ValidatorAnnounce__factory(), |
||||
proxyAdmin: new ProxyAdmin__factory(), |
||||
mailbox: new Mailbox__factory(), |
||||
timelockController: new TimelockController__factory(), |
||||
}; |
||||
|
||||
export type CoreAddresses = { |
||||
validatorAnnounce: Address; |
||||
proxyAdmin: Address; |
||||
mailbox: Address; |
||||
timelockController?: Address; |
||||
}; |
||||
|
||||
export type CoreFactories = typeof coreFactories; |
||||
|
||||
export type CoreAddresses = HyperlaneAddresses<CoreFactories>; |
||||
|
@ -1,168 +1,104 @@ |
||||
import debug from 'debug'; |
||||
|
||||
import { |
||||
OptimismISM, |
||||
OptimismISM__factory, |
||||
OptimismMessageHook, |
||||
OptimismMessageHook__factory, |
||||
TestRecipient, |
||||
TestRecipient__factory, |
||||
} from '@hyperlane-xyz/core'; |
||||
import { Address, addressToBytes32 } from '@hyperlane-xyz/utils'; |
||||
import { objFilter, objMap, promiseObjAll } from '@hyperlane-xyz/utils'; |
||||
|
||||
import { HyperlaneContracts, HyperlaneContractsMap } from '../contracts/types'; |
||||
import { |
||||
HyperlaneAddressesMap, |
||||
HyperlaneContracts, |
||||
HyperlaneContractsMap, |
||||
} from '../contracts/types'; |
||||
import { CoreFactories } from '../core/contracts'; |
||||
import { HyperlaneDeployer } from '../deploy/HyperlaneDeployer'; |
||||
import { MultiProvider } from '../providers/MultiProvider'; |
||||
import { ChainMap, ChainName } from '../types'; |
||||
|
||||
import { isHookConfig, isISMConfig } from './config'; |
||||
import { HookFactories, hookFactories } from './contracts'; |
||||
import { HookConfig } from './types'; |
||||
import { OptimismHookFactories, optimismHookFactories } from './contracts'; |
||||
import { HookConfig, MessageHookConfig, NoMetadataIsmConfig } from './types'; |
||||
|
||||
// TODO: make generic from optimism hooks
|
||||
export class HyperlaneHookDeployer extends HyperlaneDeployer< |
||||
HookConfig, |
||||
HookFactories |
||||
OptimismHookFactories |
||||
> { |
||||
constructor(multiProvider: MultiProvider) { |
||||
super(multiProvider, hookFactories, { |
||||
constructor( |
||||
multiProvider: MultiProvider, |
||||
public core: HyperlaneAddressesMap<CoreFactories>, |
||||
) { |
||||
super(multiProvider, optimismHookFactories, { |
||||
logger: debug('hyperlane:HookDeployer'), |
||||
}); |
||||
} |
||||
|
||||
async deploy( |
||||
configMap: ChainMap<HookConfig>, |
||||
): Promise<HyperlaneContractsMap<HookFactories>> { |
||||
let ismContracts: HyperlaneContracts<HookFactories> | undefined; |
||||
let hookContracts: HyperlaneContracts<HookFactories> | undefined; |
||||
|
||||
// Process ISM configs first
|
||||
for (const [chain, config] of Object.entries(configMap)) { |
||||
if (isISMConfig(config)) { |
||||
ismContracts = await this.deployContracts(chain, config); |
||||
} |
||||
} |
||||
|
||||
// Ensure ISM contracts have been deployed
|
||||
if (!ismContracts || !ismContracts?.optimismISM) { |
||||
throw new Error('ISM contracts not deployed'); |
||||
} |
||||
|
||||
// Then process hook configs
|
||||
for (const [chain, config] of Object.entries(configMap)) { |
||||
if (isHookConfig(config)) { |
||||
config.remoteIsm = ismContracts.optimismISM.address; |
||||
this.logger(`Remote ISM address set as ${config.remoteIsm}`); |
||||
hookContracts = await this.deployContracts(chain, config); |
||||
} |
||||
} |
||||
|
||||
// Ensure hook contracts have been deployed
|
||||
if (!hookContracts || !hookContracts?.optimismMessageHook) { |
||||
throw new Error('Hook contracts not deployed'); |
||||
} |
||||
|
||||
const hookAddress = hookContracts.optimismMessageHook.address; |
||||
|
||||
this.logger(`Setting hook address ${hookAddress} for OptimismISM`); |
||||
await ismContracts.optimismISM.setOptimismHook(hookAddress); |
||||
): Promise<HyperlaneContractsMap<OptimismHookFactories>> { |
||||
// deploy ISMs first
|
||||
const ismConfigMap = objFilter( |
||||
configMap, |
||||
(_, config): config is NoMetadataIsmConfig => isISMConfig(config), |
||||
); |
||||
await super.deploy(ismConfigMap); |
||||
|
||||
const deployedContractMap: HyperlaneContractsMap<HookFactories> = { |
||||
optimismISM: ismContracts.optimismISM, |
||||
testRecipient: ismContracts.testRecipient, |
||||
optimismMessageHook: hookContracts.optimismMessageHook, |
||||
}; |
||||
// deploy Hooks next
|
||||
const hookConfigMap = objFilter( |
||||
configMap, |
||||
(_, config): config is MessageHookConfig => isHookConfig(config), |
||||
); |
||||
await super.deploy(hookConfigMap); |
||||
|
||||
// configure ISMs with authorized hooks
|
||||
await promiseObjAll( |
||||
objMap(hookConfigMap, (hookChain, hookConfig) => { |
||||
const hookAddress = this.deployedContracts[hookChain].hook.address; |
||||
const ism = this.deployedContracts[hookConfig.destination].ism; |
||||
return this.multiProvider.handleTx( |
||||
hookConfig.destination, |
||||
ism.setAuthorizedHook(hookAddress), |
||||
); |
||||
}), |
||||
); |
||||
|
||||
return deployedContractMap; |
||||
return this.deployedContracts; |
||||
} |
||||
|
||||
async deployContracts( |
||||
chain: ChainName, |
||||
hookConfig: HookConfig, |
||||
): Promise<HyperlaneContracts<HookFactories>> { |
||||
let optimismISM, optimismMessageHook, testRecipient; |
||||
this.logger(`Deploying ${hookConfig.hookContractType} on ${chain}`); |
||||
if (isISMConfig(hookConfig)) { |
||||
optimismISM = await this.deployOptimismISM( |
||||
config: HookConfig, |
||||
): Promise<HyperlaneContracts<OptimismHookFactories>> { |
||||
this.logger(`Deploying ${config.hookContractType} on ${chain}`); |
||||
if (isISMConfig(config)) { |
||||
const ism = await this.multiProvider.handleDeploy( |
||||
chain, |
||||
hookConfig.nativeBridge, |
||||
this.factories.ism, |
||||
[config.nativeBridge], |
||||
); |
||||
testRecipient = await this.deployTestRecipient( |
||||
chain, |
||||
optimismISM.address, |
||||
); |
||||
this.logger( |
||||
`Deployed test recipient on ${chain} at ${addressToBytes32( |
||||
testRecipient.address, |
||||
)}`,
|
||||
// @ts-ignore
|
||||
return { ism, hook: undefined }; |
||||
} else if (isHookConfig(config)) { |
||||
const remoteIsm = this.deployedContracts[config.destination].ism; |
||||
if (!remoteIsm) { |
||||
throw new Error(`Remote ISM not found for ${config.destination}`); |
||||
} |
||||
|
||||
const mailbox = this.core[chain].mailbox; |
||||
if (!mailbox) { |
||||
throw new Error(`Mailbox not found for ${chain}`); |
||||
} |
||||
const destinationDomain = this.multiProvider.getDomainId( |
||||
config.destination, |
||||
); |
||||
|
||||
return { |
||||
optimismISM, |
||||
testRecipient, |
||||
}; |
||||
} else if (isHookConfig(hookConfig)) { |
||||
optimismMessageHook = await this.deployOptimismMessageHook( |
||||
const hook = await this.multiProvider.handleDeploy( |
||||
chain, |
||||
hookConfig.destinationDomain, |
||||
hookConfig.nativeBridge, |
||||
hookConfig.remoteIsm, |
||||
this.factories.hook, |
||||
[mailbox, destinationDomain, remoteIsm.address, config.nativeBridge], |
||||
); |
||||
return { |
||||
optimismMessageHook, |
||||
}; |
||||
} |
||||
return {}; |
||||
} |
||||
|
||||
async deployOptimismISM( |
||||
chain: ChainName, |
||||
nativeBridge: Address, |
||||
): Promise<OptimismISM> { |
||||
const signer = this.multiProvider.getSigner(chain); |
||||
|
||||
const optimismISM = await new OptimismISM__factory(signer).deploy( |
||||
nativeBridge, |
||||
); |
||||
|
||||
await this.multiProvider.handleTx(chain, optimismISM.deployTransaction); |
||||
|
||||
this.logger(`Deployed OptimismISM on ${chain} at ${optimismISM.address}`); |
||||
return optimismISM; |
||||
} |
||||
|
||||
async deployTestRecipient( |
||||
chain: ChainName, |
||||
ism: Address, |
||||
): Promise<TestRecipient> { |
||||
const signer = this.multiProvider.getSigner(chain); |
||||
|
||||
const testRecipient = await new TestRecipient__factory(signer).deploy(); |
||||
|
||||
await this.multiProvider.handleTx(chain, testRecipient.deployTransaction); |
||||
|
||||
await testRecipient.setInterchainSecurityModule(ism); |
||||
return testRecipient; |
||||
} |
||||
|
||||
async deployOptimismMessageHook( |
||||
chain: ChainName, |
||||
destinationDomain: number, |
||||
nativeBridge: Address, |
||||
optimismISM: Address, |
||||
): Promise<OptimismMessageHook> { |
||||
const signer = this.multiProvider.getSigner(chain); |
||||
|
||||
const optimismMessageHook = await new OptimismMessageHook__factory( |
||||
signer, |
||||
).deploy(destinationDomain, nativeBridge, optimismISM); |
||||
|
||||
await this.multiProvider.handleTx( |
||||
chain, |
||||
optimismMessageHook.deployTransaction, |
||||
); |
||||
this.logger( |
||||
`Deployed OptimismMessageHook on ${chain} at ${optimismMessageHook.address}`, |
||||
); |
||||
return optimismMessageHook; |
||||
// @ts-ignore
|
||||
return { hook, ism: undefined }; |
||||
} else { |
||||
throw new Error(`Invalid config type: ${config}`); |
||||
} |
||||
} |
||||
} |
||||
|
@ -1,30 +1,18 @@ |
||||
import { |
||||
OptimismISM__factory, |
||||
OptimismMessageHook__factory, |
||||
TestRecipient__factory, |
||||
AbstractMessageIdAuthHook__factory, |
||||
AbstractMessageIdAuthorizedIsm__factory, |
||||
OPStackHook__factory, |
||||
OPStackIsm__factory, |
||||
} from '@hyperlane-xyz/core'; |
||||
|
||||
export const optimismMessageHookFactories = { |
||||
optimismMessageHook: new OptimismMessageHook__factory(), |
||||
export type HookFactories = { |
||||
hook: AbstractMessageIdAuthHook__factory; |
||||
ism: AbstractMessageIdAuthorizedIsm__factory; |
||||
}; |
||||
|
||||
export const optimismIsmFactories = { |
||||
optimismISM: new OptimismISM__factory(), |
||||
export const optimismHookFactories = { |
||||
hook: new OPStackHook__factory(), |
||||
ism: new OPStackIsm__factory(), |
||||
}; |
||||
|
||||
export const testRecipientFactories = { |
||||
testRecipient: new TestRecipient__factory(), |
||||
}; |
||||
|
||||
export const hookFactories = { |
||||
...optimismMessageHookFactories, |
||||
...optimismIsmFactories, |
||||
...testRecipientFactories, |
||||
}; |
||||
|
||||
export type MessageHookFactories = typeof optimismMessageHookFactories; |
||||
export type NoMetadataIsmFactories = typeof optimismIsmFactories; |
||||
export type TestRecipientFactories = typeof testRecipientFactories; |
||||
export type HookFactories = Partial<MessageHookFactories> & |
||||
Partial<NoMetadataIsmFactories> & |
||||
Partial<TestRecipientFactories>; |
||||
export type OptimismHookFactories = typeof optimismHookFactories; |
||||
|
Loading…
Reference in new issue