-
Notifications
You must be signed in to change notification settings - Fork 422
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merkle Tree Hook Deployer changes (#2747)
### Description - Interceptor is the pair <hook, ism> - `MerkleTreeInterceptorDeployer` for deploying merkle root hook and the `StaticMerkleRootMultisigIsm` on chain ### Drive-by changes - None ### Related issues - addresses hyperlane-xyz/issues#621 ### Backward compatibility Yes ### Testing Manual
- Loading branch information
1 parent
8e4f2bb
commit f0a45bd
Showing
22 changed files
with
225 additions
and
401 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
This file was deleted.
Oops, something went wrong.
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,35 +1,16 @@ | ||
import { | ||
ChainMap, | ||
HookConfig, | ||
HookContractType, | ||
MessageHookConfig, | ||
NoMetadataIsmConfig, | ||
filterByChains, | ||
} from '@hyperlane-xyz/sdk'; | ||
import { ChainMap } from '@hyperlane-xyz/sdk'; | ||
import { MerkleTreeHookConfig } from '@hyperlane-xyz/sdk/dist/hook/types'; | ||
import { HookType } from '@hyperlane-xyz/sdk/src/hook/types'; | ||
import { objMap } from '@hyperlane-xyz/utils'; | ||
|
||
import { owners } from './owners'; | ||
|
||
const chainNameFilter = new Set(['test1', 'test2']); | ||
const filteredOwnersResult = filterByChains<string>(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 | ||
destination: 'test2', | ||
}; | ||
return hookConfig; | ||
} else { | ||
const ismConfig: NoMetadataIsmConfig = { | ||
hookContractType: HookContractType.ISM, | ||
nativeBridge: '0x4200000000000000000000000000000000000007', | ||
}; | ||
return ismConfig; | ||
} | ||
export const merkleTree: ChainMap<MerkleTreeHookConfig> = objMap( | ||
owners, | ||
(_, __) => { | ||
const config: MerkleTreeHookConfig = { | ||
type: HookType.MERKLE_TREE_HOOK, | ||
}; | ||
return config; | ||
}, | ||
); |
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 was deleted.
Oops, something went wrong.
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,96 +1,41 @@ | ||
import { ChainMap, MultisigConfig } from '@hyperlane-xyz/sdk'; | ||
import { | ||
ChainMap, | ||
ChainName, | ||
MultisigIsmConfig, | ||
defaultMultisigIsmConfigs, | ||
} from '@hyperlane-xyz/sdk'; | ||
import { objFilter, objMap } from '@hyperlane-xyz/utils'; | ||
|
||
export const rcMultisigIsmConfigs: ChainMap<MultisigConfig> = { | ||
// ----------------- Mainnets ----------------- | ||
celo: { | ||
threshold: 1, | ||
validators: [ | ||
'0xe7a82e210f512f8e9900d6bc2acbf7981c63e66e', // abacus | ||
], | ||
}, | ||
ethereum: { | ||
threshold: 1, | ||
validators: [ | ||
'0xaea1adb1c687b061e5b60b9da84cb69e7b5fab44', // abacus | ||
], | ||
}, | ||
avalanche: { | ||
threshold: 1, | ||
validators: [ | ||
'0x706976391e23dea28152e0207936bd942aba01ce', // abacus | ||
], | ||
}, | ||
polygon: { | ||
threshold: 1, | ||
validators: [ | ||
'0xef372f6ff7775989b3ac884506ee31c79638c989', // abacus | ||
], | ||
}, | ||
bsc: { | ||
threshold: 1, | ||
validators: [ | ||
'0x0823081031a4a6f97c6083775c191d17ca96d0ab', // abacus | ||
], | ||
}, | ||
arbitrum: { | ||
threshold: 1, | ||
validators: [ | ||
'0x1a95b35fb809d57faf1117c1cc29a6c5df289df1', // abacus | ||
], | ||
}, | ||
optimism: { | ||
threshold: 1, | ||
validators: [ | ||
'0x60e938bf280bbc21bacfd8bf435459d9003a8f98', // abacus | ||
], | ||
}, | ||
moonbeam: { | ||
threshold: 1, | ||
validators: [ | ||
'0x0df7140811e309dc69638352545151ebb9d5e0fd', // abacus | ||
], | ||
}, | ||
gnosis: { | ||
threshold: 1, | ||
validators: [ | ||
'0x15f48e78092a4f79febface509cfd76467c6cdbb', // abacus | ||
], | ||
}, | ||
// ----------------- Testnets ----------------- | ||
alfajores: { | ||
threshold: 1, | ||
validators: ['0x45e5c228b38e1cf09e9a3423ed0cf4862c4bf3de'], | ||
}, | ||
fuji: { | ||
threshold: 1, | ||
validators: ['0xd81ba169170a9b582812cf0e152d2c168572e21f'], | ||
}, | ||
mumbai: { | ||
threshold: 1, | ||
validators: ['0xb537c4ce34e1cad718be52aa30b095e416eae46a'], | ||
}, | ||
bsctestnet: { | ||
threshold: 1, | ||
validators: ['0x77f80ef5b18977e15d81aea8dd3a88e7df4bc0eb'], | ||
}, | ||
goerli: { | ||
threshold: 1, | ||
validators: ['0x9597ddb4ad2af237665559574b820596bb77ae7a'], | ||
}, | ||
sepolia: { | ||
threshold: 1, | ||
validators: ['0x183f15924f3a464c54c9393e8d268eb44d2b208c'], | ||
}, | ||
moonbasealpha: { | ||
threshold: 1, | ||
validators: ['0xbeaf158f85d7b64ced36b8aea0bbc4cd0f2d1a5d'], | ||
}, | ||
optimismgoerli: { | ||
threshold: 1, | ||
validators: ['0x1d6798671ac532f2bf30c3a5230697a4695705e4'], | ||
}, | ||
arbitrumgoerli: { | ||
threshold: 1, | ||
validators: ['0x6d13367c7cd713a4ea79a2552adf824bf1ecdd5e'], | ||
}, | ||
import { DeployEnvironment } from '../src/config'; | ||
|
||
import { Contexts } from './contexts'; | ||
import { supportedChainNames as mainnet2Chains } from './environments/mainnet2/chains'; | ||
import { chainNames as testChains } from './environments/test/chains'; | ||
import { supportedChainNames as testnet3Chains } from './environments/testnet3/chains'; | ||
import { rcMultisigIsmConfigs } from './rcMultisigIsmConfigs'; | ||
|
||
const chains = { | ||
mainnet2: mainnet2Chains, | ||
testnet3: testnet3Chains, | ||
test: testChains, | ||
}; | ||
|
||
export const multisigIsms = ( | ||
env: DeployEnvironment, | ||
local: ChainName, | ||
type: MultisigIsmConfig['type'], | ||
context: Contexts, | ||
): ChainMap<MultisigIsmConfig> => | ||
objMap( | ||
objFilter( | ||
context === Contexts.ReleaseCandidate | ||
? rcMultisigIsmConfigs | ||
: defaultMultisigIsmConfigs, | ||
(chain, config): config is MultisigIsmConfig => | ||
chain !== local && chains[env].includes(chain), | ||
), | ||
(_, config) => ({ | ||
...config, | ||
type, | ||
}), | ||
); |
Oops, something went wrong.