Skip to content

Commit

Permalink
fix: proxy factory impl names
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbalaji committed Mar 21, 2024
1 parent d224c06 commit c781caf
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 23 deletions.
4 changes: 2 additions & 2 deletions typescript/cli/src/deploy/warp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ async function runBuildConfigStep({
base.interchainSecurityModule ||
mergedContractAddrs[baseChainName]?.interchainSecurityModule ||
mergedContractAddrs[baseChainName]?.multisigIsm,
// ismFactory: mergedContractAddrs[baseChainName].routingIsmFactory, // TODO fix when updating from routingIsm
// ismFactory: mergedContractAddrs[baseChainName].domainRoutingIsmFactory, // TODO fix when updating from routingIsm
foreignDeployment: base.foreignDeployment,
name: baseMetadata.name,
symbol: baseMetadata.symbol,
Expand All @@ -172,7 +172,7 @@ async function runBuildConfigStep({
synthetic.interchainSecurityModule ||
mergedContractAddrs[sChainName]?.interchainSecurityModule ||
mergedContractAddrs[sChainName]?.multisigIsm,
// ismFactory: mergedContractAddrs[sChainName].routingIsmFactory, // TODO fix
// ismFactory: mergedContractAddrs[sChainName].domainRoutingIsmFactory, // TODO fix
foreignDeployment: synthetic.foreignDeployment,
};
}
Expand Down
21 changes: 11 additions & 10 deletions typescript/sdk/src/deploy/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ import {
} from '@hyperlane-xyz/core';

export const proxyFactoryFactories = {
merkleRootMultisigIsmFactory:
staticMerkleRootMultisigIsmFactory:
new StaticMerkleRootMultisigIsmFactory__factory(),
messageIdMultisigIsmFactory: new StaticMessageIdMultisigIsmFactory__factory(),
aggregationIsmFactory: new StaticAggregationIsmFactory__factory(),
aggregationHookFactory: new StaticAggregationHookFactory__factory(),
routingIsmFactory: new DomainRoutingIsmFactory__factory(),
staticMessageIdMultisigIsmFactory:
new StaticMessageIdMultisigIsmFactory__factory(),
staticAggregationIsmFactory: new StaticAggregationIsmFactory__factory(),
staticAggregationHookFactory: new StaticAggregationHookFactory__factory(),
domainRoutingIsmFactory: new DomainRoutingIsmFactory__factory(),
};

export type ProxyFactoryFactories = typeof proxyFactoryFactories;
Expand All @@ -21,9 +22,9 @@ type ProxyFactoryImplementations = Record<keyof ProxyFactoryFactories, string>;

// must match contract names for verification
export const proxyFactoryImplementations: ProxyFactoryImplementations = {
merkleRootMultisigIsmFactory: 'StaticMerkleRootMultisigIsm',
messageIdMultisigIsmFactory: 'StaticMessageIdMultisigIsm',
aggregationIsmFactory: 'StaticAggregationIsm',
aggregationHookFactory: 'StaticAggregationHook',
routingIsmFactory: 'DomaingRoutingIsm',
staticMerkleRootMultisigIsmFactory: 'StaticMerkleRootMultisigIsm',
staticMessageIdMultisigIsmFactory: 'StaticMessageIdMultisigIsm',
staticAggregationIsmFactory: 'StaticAggregationIsm',
staticAggregationHookFactory: 'StaticAggregationHook',
domainRoutingIsmFactory: 'DomaingRoutingIsm',
};
2 changes: 1 addition & 1 deletion typescript/sdk/src/hook/HyperlaneHookDeployer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export class HyperlaneHookDeployer extends HyperlaneDeployer<
);
const address = await this.ismFactory.deployStaticAddressSet(
chain,
this.ismFactory.getContracts(chain).aggregationHookFactory,
this.ismFactory.getContracts(chain).staticAggregationHookFactory,
aggregatedHooks,
this.logger,
);
Expand Down
17 changes: 9 additions & 8 deletions typescript/sdk/src/ism/HyperlaneIsmFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ export class HyperlaneIsmFactory extends HyperlaneApp<ProxyFactoryFactories> {
const signer = this.multiProvider.getSigner(destination);
const multisigIsmFactory =
config.type === IsmType.MERKLE_ROOT_MULTISIG
? this.getContracts(destination).merkleRootMultisigIsmFactory
: this.getContracts(destination).messageIdMultisigIsmFactory;
? this.getContracts(destination).staticMerkleRootMultisigIsmFactory
: this.getContracts(destination).staticMessageIdMultisigIsmFactory;

const address = await this.deployStaticAddressSet(
destination,
Expand All @@ -234,7 +234,8 @@ export class HyperlaneIsmFactory extends HyperlaneApp<ProxyFactoryFactories> {
}): Promise<IRoutingIsm> {
const { destination, config, mailbox, existingIsmAddress } = params;
const overrides = this.multiProvider.getTransactionOverrides(destination);
const routingIsmFactory = this.getContracts(destination).routingIsmFactory;
const domainRoutingIsmFactory =
this.getContracts(destination).domainRoutingIsmFactory;
let routingIsm: DomainRoutingIsm | DefaultFallbackRoutingIsm;
// filtering out domains which are not part of the multiprovider
config.domains = objFilter(
Expand Down Expand Up @@ -359,7 +360,7 @@ export class HyperlaneIsmFactory extends HyperlaneApp<ProxyFactoryFactories> {
);
} else {
// deploying new domain routing ISM
const tx = await routingIsmFactory.deploy(
const tx = await domainRoutingIsmFactory.deploy(
config.owner,
safeConfigDomains,
submoduleAddresses,
Expand All @@ -371,7 +372,7 @@ export class HyperlaneIsmFactory extends HyperlaneApp<ProxyFactoryFactories> {
const dispatchLogs = receipt.logs
.map((log) => {
try {
return routingIsmFactory.interface.parseLog(log);
return domainRoutingIsmFactory.interface.parseLog(log);
} catch (e) {
return undefined;
}
Expand Down Expand Up @@ -402,8 +403,8 @@ export class HyperlaneIsmFactory extends HyperlaneApp<ProxyFactoryFactories> {
}): Promise<IAggregationIsm> {
const { destination, config, origin, mailbox } = params;
const signer = this.multiProvider.getSigner(destination);
const aggregationIsmFactory =
this.getContracts(destination).aggregationIsmFactory;
const staticAggregationIsmFactory =
this.getContracts(destination).staticAggregationIsmFactory;
const addresses: Address[] = [];
for (const module of config.modules) {
const submodule = await this.deploy({
Expand All @@ -416,7 +417,7 @@ export class HyperlaneIsmFactory extends HyperlaneApp<ProxyFactoryFactories> {
}
const address = await this.deployStaticAddressSet(
destination,
aggregationIsmFactory,
staticAggregationIsmFactory,
addresses,
params.logger,
config.threshold,
Expand Down
4 changes: 2 additions & 2 deletions typescript/sdk/src/ism/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export async function moduleMatchesConfig(
case IsmType.MERKLE_ROOT_MULTISIG: {
// A MerkleRootMultisigIsm matches if validators and threshold match the config
const expectedAddress =
await contracts.merkleRootMultisigIsmFactory.getAddress(
await contracts.staticMerkleRootMultisigIsmFactory.getAddress(
config.validators.sort(),
config.threshold,
);
Expand All @@ -202,7 +202,7 @@ export async function moduleMatchesConfig(
case IsmType.MESSAGE_ID_MULTISIG: {
// A MessageIdMultisigIsm matches if validators and threshold match the config
const expectedAddress =
await contracts.messageIdMultisigIsmFactory.getAddress(
await contracts.staticMessageIdMultisigIsmFactory.getAddress(
config.validators.sort(),
config.threshold,
);
Expand Down

0 comments on commit c781caf

Please sign in to comment.