Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verify testnet4 deploy #2820

Merged
merged 15 commits into from
Oct 23, 2023
Merged
1 change: 1 addition & 0 deletions solidity/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ coverage.json
out
forge-cache
docs
flattened/
23 changes: 23 additions & 0 deletions solidity/flatten.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
LICENSE="// SPDX-License-Identifier: MIT OR Apache-2.0"
yorhodes marked this conversation as resolved.
Show resolved Hide resolved

rm -rf flattened
mkdir -p flattened

# flatten contracts
yarn hardhat flatten > flattened/flattened.sol

# remove duplicate licenses
grep -vE "// SPDX.*" flattened/flattened.sol > flattened/delicensed.sol

# add license
echo "$LICENSE" | cat - flattened/delicensed.sol > flattened/licensed.sol

# compile
solc flattened/licensed.sol

# TODO: automate this?
if [ $? -ne 0 ]; then
echo "Remove @openzeppelin/../ICrossDomainMessenger and replace Optimism_Bridge with ICrossDomainMessenger"
echo "Then try compiling again with solc flattened/licensed.sol"
exit 1
fi
6 changes: 1 addition & 5 deletions solidity/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ import 'solidity-coverage';
*/
module.exports = {
solidity: {
compilers: [
{
version: '0.8.19',
},
],
version: '0.8.19',
settings: {
optimizer: {
enabled: true,
Expand Down
1 change: 1 addition & 0 deletions solidity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"clean": "hardhat clean && rm -rf ./dist ./cache ./types ./coverage",
"coverage": "./coverage.sh",
"docs": "forge doc",
"flatten": "./flatten.sh",
"prettier": "prettier --write ./contracts ./test",
"test": "hardhat test && forge test -vvv",
"gas": "forge snapshot",
Expand Down
46 changes: 42 additions & 4 deletions typescript/infra/config/environments/testnet4/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,61 @@ import { BigNumber, ethers } from 'ethers';

import {
AggregationHookConfig,
AggregationIsmConfig,
ChainMap,
CoreConfig,
HookType,
IgpHookConfig,
MerkleTreeHookConfig,
ModuleType,
MultisigConfig,
MultisigIsmConfig,
ProtocolFeeHookConfig,
RoutingIsmConfig,
defaultMultisigIsmConfigs,
} from '@hyperlane-xyz/sdk';
import { objMap } from '@hyperlane-xyz/utils';

import { Contexts } from '../../contexts';
import { routingIsm } from '../../routingIsm';

import { supportedChainNames } from './chains';
import { igp } from './igp';
import { owners } from './owners';

export const core: ChainMap<CoreConfig> = objMap(owners, (local, owner) => {
const defaultIsm = routingIsm('testnet4', local, Contexts.Hyperlane);
const originMultisigs: ChainMap<MultisigConfig> = Object.fromEntries(
supportedChainNames
.filter((chain) => chain !== local)
.map((origin) => [origin, defaultMultisigIsmConfigs[origin]]),
);

const messageIdRouting: RoutingIsmConfig = {
type: ModuleType.ROUTING,
domains: objMap(
originMultisigs,
(_, multisig): MultisigIsmConfig => ({
type: ModuleType.MESSAGE_ID_MULTISIG,
...multisig,
}),
),
owner,
};

const merkleRootRouting: RoutingIsmConfig = {
type: ModuleType.ROUTING,
domains: objMap(
originMultisigs,
(_, multisig): MultisigIsmConfig => ({
type: ModuleType.MERKLE_ROOT_MULTISIG,
...multisig,
}),
),
owner,
};

const defaultIsm: AggregationIsmConfig = {
type: ModuleType.AGGREGATION,
modules: [messageIdRouting, merkleRootRouting],
threshold: 1,
};

const merkleHook: MerkleTreeHookConfig = {
type: HookType.MERKLE_TREE,
Expand Down
Loading
Loading