-
Notifications
You must be signed in to change notification settings - Fork 343
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5bfbf78
commit 7321318
Showing
17 changed files
with
121 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
mod aggregation; | ||
mod base; | ||
mod multisig; | ||
mod no_metadata; | ||
mod null_metadata; | ||
mod routing; | ||
|
||
use aggregation::AggregationIsmMetadataBuilder; | ||
pub(crate) use base::BaseMetadataBuilder; | ||
pub(crate) use base::MetadataBuilder; | ||
use no_metadata::NoMetadataBuilder; | ||
use null_metadata::NullMetadataBuilder; | ||
use routing::RoutingIsmMetadataBuilder; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,35 @@ | ||
import { ChainMap, objMap } from '@hyperlane-xyz/sdk'; | ||
import { | ||
ChainMap, | ||
HookConfig, | ||
HookContractType, | ||
MessageHookConfig, | ||
NativeType, | ||
NoMetadataIsmConfig, | ||
} from '@hyperlane-xyz/sdk/dist/hook/types'; | ||
import { types } from '@hyperlane-xyz/utils'; | ||
objMap, | ||
} from '@hyperlane-xyz/sdk'; | ||
import { filteredOwners } from '@hyperlane-xyz/utils'; | ||
|
||
import { owners } from './owners'; | ||
|
||
const filteredOwners: ChainMap<types.Address> = Object.keys(owners).reduce( | ||
(local, chain) => { | ||
if (chain === 'ethereum' || chain === 'optimism') { | ||
local[chain] = owners[chain]; | ||
const chainNameFilter = new Set(['ethereum', 'optimism']); | ||
const filteredOwnersResult = filteredOwners(owners, chainNameFilter); | ||
|
||
export const hooks: ChainMap<HookConfig> = objMap( | ||
filteredOwnersResult, | ||
(chain) => { | ||
if (chain === 'ethereum') { | ||
const hookConfig: MessageHookConfig = { | ||
hookContractType: HookContractType.HOOK, | ||
nativeBridge: '0x25ace71c97B33Cc4729CF772ae268934F7ab5fA1', | ||
remoteIsm: '0x4c5859f0f772848b2d91f1d83e2fe57935348029', // dummy, remoteISM should be deployed first | ||
destinationDomain: 10, | ||
}; | ||
return hookConfig; | ||
} else { | ||
const ismConfig: NoMetadataIsmConfig = { | ||
hookContractType: HookContractType.ISM, | ||
nativeBridge: '0x4200000000000000000000000000000000000007', | ||
}; | ||
return ismConfig; | ||
} | ||
return local; | ||
}, | ||
{} as ChainMap<types.Address>, | ||
); | ||
|
||
export const hooks: ChainMap<HookConfig> = objMap(filteredOwners, (chain) => { | ||
if (chain === 'ethereum') { | ||
return { | ||
nativeType: NativeType.HOOK, | ||
nativeBridge: '0x25ace71c97B33Cc4729CF772ae268934F7ab5fA1', | ||
remoteIsm: '0x4c5859f0f772848b2d91f1d83e2fe57935348029', // dummy, remoteISM should be deployed first | ||
destinationDomain: 10, | ||
} as MessageHookConfig; | ||
} else { | ||
return { | ||
nativeType: NativeType.ISM, | ||
nativeBridge: '0x4200000000000000000000000000000000000007', | ||
} as NoMetadataIsmConfig; | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,34 @@ | ||
import { ChainMap, objMap } from '@hyperlane-xyz/sdk'; | ||
import { | ||
HookConfig, | ||
HookContractType, | ||
MessageHookConfig, | ||
NativeType, | ||
NoMetadataIsmConfig, | ||
} from '@hyperlane-xyz/sdk/dist/hook/types'; | ||
import { types } from '@hyperlane-xyz/utils'; | ||
import { filteredOwners } from '@hyperlane-xyz/utils'; | ||
|
||
import { owners } from './owners'; | ||
|
||
const filteredOwners: ChainMap<types.Address> = Object.keys(owners).reduce( | ||
(local, chain) => { | ||
if (chain === 'test1' || chain === 'test2') { | ||
local[chain] = owners[chain]; | ||
const chainNameFilter = new Set(['test1', 'test2']); | ||
const filteredOwnersResult = filteredOwners(owners, chainNameFilter); | ||
|
||
export const hooks: ChainMap<HookConfig> = objMap( | ||
filteredOwnersResult, | ||
(chain) => { | ||
if (chain === 'test1') { | ||
const hookConfig: MessageHookConfig = { | ||
hookContractType: HookContractType.HOOK, | ||
nativeBridge: '0x25ace71c97B33Cc4729CF772ae268934F7ab5fA1', | ||
remoteIsm: '0x4c5859f0f772848b2d91f1d83e2fe57935348029', // dummy, remoteISM should be deployed first | ||
destinationDomain: 10, | ||
}; | ||
return hookConfig; | ||
} else { | ||
const ismConfig: NoMetadataIsmConfig = { | ||
hookContractType: HookContractType.ISM, | ||
nativeBridge: '0x4200000000000000000000000000000000000007', | ||
}; | ||
return ismConfig; | ||
} | ||
return local; | ||
}, | ||
{} as ChainMap<types.Address>, | ||
); | ||
|
||
export const hooks: ChainMap<HookConfig> = objMap(filteredOwners, (chain) => { | ||
if (chain === 'test1') { | ||
return { | ||
nativeType: NativeType.HOOK, | ||
nativeBridge: '0x25ace71c97B33Cc4729CF772ae268934F7ab5fA1', | ||
remoteIsm: '0x4c5859f0f772848b2d91f1d83e2fe57935348029', // dummy, remoteISM should be deployed first | ||
destinationDomain: 10, | ||
} as MessageHookConfig; | ||
} else { | ||
return { | ||
nativeType: NativeType.ISM, | ||
nativeBridge: '0x4200000000000000000000000000000000000007', | ||
} as NoMetadataIsmConfig; | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,34 @@ | ||
import { ChainMap, objMap } from '@hyperlane-xyz/sdk'; | ||
import { | ||
HookConfig, | ||
HookContractType, | ||
MessageHookConfig, | ||
NativeType, | ||
NoMetadataIsmConfig, | ||
} from '@hyperlane-xyz/sdk/dist/hook/types'; | ||
import { types } from '@hyperlane-xyz/utils'; | ||
import { filteredOwners } from '@hyperlane-xyz/utils'; | ||
|
||
import { owners } from './owners'; | ||
|
||
const filteredOwners: ChainMap<types.Address> = Object.keys(owners).reduce( | ||
(local, chain) => { | ||
if (chain === 'goerli' || chain === 'optimismgoerli') { | ||
local[chain] = owners[chain]; | ||
const chainNameFilter = new Set(['goerli', 'optimismgoerli']); | ||
const filteredOwnersResult = filteredOwners(owners, chainNameFilter); | ||
|
||
export const hooks: ChainMap<HookConfig> = objMap( | ||
filteredOwnersResult, | ||
(chain) => { | ||
if (chain === 'goerli') { | ||
const hookConfig: MessageHookConfig = { | ||
hookContractType: HookContractType.HOOK, | ||
nativeBridge: '0x5086d1eEF304eb5284A0f6720f79403b4e9bE294', | ||
remoteIsm: '0x4c5859f0f772848b2d91f1d83e2fe57935348029', // dummy, remoteISM should be deployed first | ||
destinationDomain: 420, | ||
}; | ||
return hookConfig; | ||
} else { | ||
const ismConfig: NoMetadataIsmConfig = { | ||
hookContractType: HookContractType.ISM, | ||
nativeBridge: '0x4200000000000000000000000000000000000007', | ||
}; | ||
return ismConfig; | ||
} | ||
return local; | ||
}, | ||
{} as ChainMap<types.Address>, | ||
); | ||
|
||
export const hooks: ChainMap<HookConfig> = objMap(filteredOwners, (chain) => { | ||
if (chain === 'goerli') { | ||
return { | ||
nativeType: NativeType.HOOK, | ||
nativeBridge: '0x5086d1eEF304eb5284A0f6720f79403b4e9bE294', | ||
remoteIsm: '0x4c5859f0f772848b2d91f1d83e2fe57935348029', // dummy, remoteISM should be deployed first | ||
destinationDomain: 420, | ||
} as MessageHookConfig; | ||
} else { | ||
return { | ||
nativeType: NativeType.ISM, | ||
nativeBridge: '0x4200000000000000000000000000000000000007', | ||
} as NoMetadataIsmConfig; | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
import { | ||
HookConfig, | ||
HookContractType, | ||
MessageHookConfig, | ||
NativeType, | ||
NoMetadataIsmConfig, | ||
} from './types'; | ||
|
||
export const isISMConfig = ( | ||
config: HookConfig, | ||
): config is NoMetadataIsmConfig => config.nativeType === NativeType.ISM; | ||
): config is NoMetadataIsmConfig => | ||
config.hookContractType === HookContractType.ISM; | ||
|
||
export const isHookConfig = (config: HookConfig): config is MessageHookConfig => | ||
config.nativeType === NativeType.HOOK; | ||
config.hookContractType === HookContractType.HOOK; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.