-
Notifications
You must be signed in to change notification settings - Fork 387
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Yorke Rhodes <[email protected]> fixes hyperlane-xyz/issues#624
- Loading branch information
1 parent
388824d
commit d69d76a
Showing
34 changed files
with
427 additions
and
285 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 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 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
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,21 +1,51 @@ | ||
import { ChainMap, CoreConfig, HookType } from '@hyperlane-xyz/sdk'; | ||
import { BigNumber, ethers } from 'ethers'; | ||
|
||
import { | ||
AggregationHookConfig, | ||
ChainMap, | ||
CoreConfig, | ||
HookType, | ||
IgpHookConfig, | ||
MerkleTreeHookConfig, | ||
ProtocolFeeHookConfig, | ||
} from '@hyperlane-xyz/sdk'; | ||
import { objMap } from '@hyperlane-xyz/utils'; | ||
|
||
import { aggregationIsm } from '../../aggregationIsm'; | ||
import { Contexts } from '../../contexts'; | ||
|
||
import { igp } from './igp'; | ||
import { owners } from './owners'; | ||
|
||
export const core: ChainMap<CoreConfig> = objMap(owners, (local, owner) => { | ||
const defaultIsm = aggregationIsm('testnet3', local, Contexts.Hyperlane); | ||
|
||
const merkleHook: MerkleTreeHookConfig = { | ||
type: HookType.MERKLE_TREE, | ||
}; | ||
|
||
const igpHook: IgpHookConfig = { | ||
type: HookType.INTERCHAIN_GAS_PAYMASTER, | ||
...igp[local], | ||
}; | ||
|
||
const defaultHook: AggregationHookConfig = { | ||
type: HookType.AGGREGATION, | ||
hooks: [merkleHook, igpHook], | ||
}; | ||
|
||
const requiredHook: ProtocolFeeHookConfig = { | ||
type: HookType.PROTOCOL_FEE, | ||
maxProtocolFee: ethers.utils.parseUnits('1', 'gwei'), // 1 gwei of native token | ||
protocolFee: BigNumber.from(1), // 1 wei | ||
beneficiary: owner, | ||
owner, | ||
}; | ||
|
||
return { | ||
owner, | ||
defaultIsm, | ||
defaultHook: { | ||
type: HookType.INTERCHAIN_GAS_PAYMASTER, | ||
}, | ||
requiredHook: { | ||
type: HookType.MERKLE_TREE, | ||
}, | ||
defaultHook, | ||
requiredHook, | ||
}; | ||
}); |
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.