From 8fe24830ee461c4d2fe62b13cb5ad5e9f3135138 Mon Sep 17 00:00:00 2001 From: Yorke Rhodes Date: Tue, 30 Jan 2024 16:19:34 -0500 Subject: [PATCH] Deploy viction core and warp routes (#3067) ### Description Deploys core and warp to viction ### Related issues - Fixes https://github.com/hyperlane-xyz/issues/issues/850 - Fixes https://github.com/hyperlane-xyz/issues/issues/859 ### Backward compatibility Yes ### Testing Fork tests --------- Co-authored-by: J M Rossy Co-authored-by: Trevor Porter Co-authored-by: Daniel Savu <23065004+daniel-savu@users.noreply.github.com> Co-authored-by: Nam Chu Hoai --- .github/workflows/test.yml | 3 + package.json | 2 +- .../m20230309_000001_create_table_domain.rs | 68 +++-- rust/config/mainnet3_config.json | 40 +++ rust/config/testnet4_config.json | 41 ++- .../config/environments/mainnet3/chains.ts | 41 +-- .../mainnet3/core/verification.json | 236 ++++++++++++++++++ .../environments/mainnet3/gas-oracle.ts | 3 + .../mainnet3/ism/verification.json | 62 ++--- .../config/environments/mainnet3/owners.ts | 2 + .../environments/mainnet3/validators.ts | 16 ++ .../mainnet3/warp/verification.json | 40 +++ .../mainnet3/warp/viction-ETH-addresses.json | 8 + .../mainnet3/warp/viction-USDC-addresses.json | 10 + .../mainnet3/warp/viction-USDT-addresses.json | 10 + .../config/environments/testnet4/agent.ts | 1 - .../config/environments/testnet4/chains.ts | 60 ++--- .../environments/testnet4/gas-oracle.ts | 4 +- .../infra/config/environments/testnet4/igp.ts | 5 +- .../config/environments/testnet4/owners.ts | 4 +- .../testnet4/warp/verification.json | 16 ++ typescript/infra/config/routingIsm.ts | 11 +- .../infra/scripts/announce-validators.ts | 9 +- typescript/infra/scripts/deploy.ts | 48 +--- .../gas-oracle/update-storage-gas-oracle.ts | 10 +- typescript/infra/scripts/utils.ts | 7 + typescript/infra/src/deployment/deploy.ts | 10 +- typescript/sdk/logos/black/viction.svg | 1 + typescript/sdk/logos/color/viction.svg | 1 + typescript/sdk/src/consts/bytecode.ts | 1 + typescript/sdk/src/consts/chainMetadata.ts | 32 +++ typescript/sdk/src/consts/chains.ts | 4 +- .../sdk/src/consts/environments/mainnet.json | 19 ++ typescript/sdk/src/consts/multisigIsm.ts | 9 + .../sdk/src/core/HyperlaneCoreChecker.ts | 11 +- .../sdk/src/deploy/HyperlaneAppChecker.ts | 13 + typescript/sdk/src/gas/HyperlaneIgpChecker.ts | 6 +- .../sdk/src/metadata/ChainMetadataManager.ts | 12 +- .../sdk/src/metadata/chainMetadataTypes.ts | 8 +- typescript/sdk/src/token/deploy.ts | 15 +- 40 files changed, 675 insertions(+), 224 deletions(-) create mode 100644 typescript/infra/config/environments/mainnet3/warp/viction-ETH-addresses.json create mode 100644 typescript/infra/config/environments/mainnet3/warp/viction-USDC-addresses.json create mode 100644 typescript/infra/config/environments/mainnet3/warp/viction-USDT-addresses.json create mode 100644 typescript/infra/config/environments/testnet4/warp/verification.json create mode 100644 typescript/sdk/logos/black/viction.svg create mode 100644 typescript/sdk/logos/color/viction.svg diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d47caa677..781e25b3e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -245,6 +245,9 @@ jobs: chain: sepolia - environment: mainnet3 chain: arbitrum + - environment: mainnet3 + chain: viction + module: core steps: - uses: actions/checkout@v3 diff --git a/package.json b/package.json index 246a43a8d..38f572009 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "build": "yarn workspaces foreach --all --parallel --topological run build", "clean": "yarn workspaces foreach --all --parallel run clean", "prettier": "yarn workspaces foreach --since --parallel run prettier", - "lint": "yarn workspaces foreach --since --parallel run lint", + "lint": "yarn workspaces foreach --all --parallel run lint", "test": "yarn workspaces foreach --all --parallel run test", "test:ci": "yarn workspaces foreach --all --parallel run test:ci", "coverage": "yarn workspaces foreach --all --parallel run coverage", diff --git a/rust/agents/scraper/migration/src/m20230309_000001_create_table_domain.rs b/rust/agents/scraper/migration/src/m20230309_000001_create_table_domain.rs index be7d938e6..afbf4d15c 100644 --- a/rust/agents/scraper/migration/src/m20230309_000001_create_table_domain.rs +++ b/rust/agents/scraper/migration/src/m20230309_000001_create_table_domain.rs @@ -46,6 +46,14 @@ const DOMAINS: &[RawDomain] = &[ is_test_net: false, is_deprecated: false, }, + RawDomain { + name: "base", + token: "ETH", + domain: 8453, + chain_id: 8453, + is_test_net: false, + is_deprecated: false, + }, RawDomain { name: "basegoerli", token: "ETH", @@ -94,6 +102,14 @@ const DOMAINS: &[RawDomain] = &[ is_test_net: true, is_deprecated: false, }, + RawDomain { + name: "gnosis", + token: "xDAI", + domain: 100, + chain_id: 100, + is_test_net: false, + is_deprecated: false, + }, RawDomain { name: "goerli", token: "ETH", @@ -103,10 +119,10 @@ const DOMAINS: &[RawDomain] = &[ is_deprecated: false, }, RawDomain { - name: "gnosis", - token: "xDAI", - domain: 100, - chain_id: 100, + name: "mantapacific", + token: "ETH", + domain: 169, + chain_id: 169, is_test_net: false, is_deprecated: false, }, @@ -159,19 +175,11 @@ const DOMAINS: &[RawDomain] = &[ is_deprecated: false, }, RawDomain { - name: "scrollsepolia", - token: "ETH", - domain: 534351, - chain_id: 534351, - is_test_net: true, - is_deprecated: false, - }, - RawDomain { - name: "sepolia", + name: "polygonzkevm", token: "ETH", - domain: 11155111, - chain_id: 11155111, - is_test_net: true, + domain: 1101, + chain_id: 1101, + is_test_net: false, is_deprecated: false, }, RawDomain { @@ -183,26 +191,34 @@ const DOMAINS: &[RawDomain] = &[ is_deprecated: false, }, RawDomain { - name: "polygonzkevm", + name: "scroll", token: "ETH", - domain: 1101, - chain_id: 1101, + domain: 534352, + chain_id: 534352, is_test_net: false, is_deprecated: false, }, RawDomain { - name: "base", + name: "scrollsepolia", token: "ETH", - domain: 8453, - chain_id: 8453, - is_test_net: false, + domain: 534351, + chain_id: 534351, + is_test_net: true, is_deprecated: false, }, RawDomain { - name: "scroll", + name: "sepolia", token: "ETH", - domain: 534352, - chain_id: 534352, + domain: 11155111, + chain_id: 11155111, + is_test_net: true, + is_deprecated: false, + }, + RawDomain { + name: "viction", + token: "VIC", + domain: 88, + chain_id: 88, is_test_net: false, is_deprecated: false, }, diff --git a/rust/config/mainnet3_config.json b/rust/config/mainnet3_config.json index 9f831e686..6c91592fb 100644 --- a/rust/config/mainnet3_config.json +++ b/rust/config/mainnet3_config.json @@ -817,6 +817,46 @@ "index": { "from": 271840 } + }, + "viction": { + "blocks": { + "confirmations": 1, + "estimateBlockTime": 2, + "reorgPeriod": 0 + }, + "blockExplorers": [], + "chainId": 88, + "domainId": 88, + "displayName": "Viction", + "name": "viction", + "nativeToken": { + "decimals": 18, + "name": "Viction", + "symbol": "VIC" + }, + "protocol": "ethereum", + "rpcUrls": [ + { + "http": "https://viction.blockpi.network/v1/rpc/public" + } + ], + "merkleRootMultisigIsmFactory": "0x2C1FAbEcd7bFBdEBF27CcdB67baADB38b6Df90fC", + "messageIdMultisigIsmFactory": "0x8b83fefd896fAa52057798f6426E9f0B080FCCcE", + "aggregationIsmFactory": "0x8F7454AC98228f3504Bb91eA3D8Adafe6406110A", + "aggregationHookFactory": "0xEb9FcFDC9EfDC17c1EC5E1dc085B98485da213D6", + "routingIsmFactory": "0x1052eF3419f26Bec74Ed7CEf4a4FA6812Bc09908", + "mailbox": "0x2f2aFaE1139Ce54feFC03593FeE8AB2aDF4a85A7", + "proxyAdmin": "0x0761b0827849abbf7b0cC09CE14e1C93D87f5004", + "validatorAnnounce": "0x2fa5F5C96419C222cDbCeC797D696e6cE428A7A9", + "interchainSecurityModule": "0xBD70Ea9D599a0FC8158B026797177773C3445730", + "merkleTreeHook": "0x149db7afD694722747035d5AEC7007ccb6F8f112", + "storageGasOracle": "0x19dc38aeae620380430C200a6E990D5Af5480117", + "interchainGasPaymaster": "0x0D63128D887159d63De29497dfa45AFc7C699AE4", + "protocolFee": "0xd83A4F747fE80Ed98839e05079B1B7Fe037b1638", + "index": { + "from": 73573878, + "chunk": 1000 + } } }, "defaultRpcConsensusType": "fallback" diff --git a/rust/config/testnet4_config.json b/rust/config/testnet4_config.json index 9fd537ab6..8afc199d9 100644 --- a/rust/config/testnet4_config.json +++ b/rust/config/testnet4_config.json @@ -102,36 +102,36 @@ } }, "arbitrumgoerli": { + "blockExplorers": [ + { + "apiUrl": "https://api-goerli.arbiscan.io/api", + "family": "etherscan", + "name": "Arbiscan", + "url": "https://goerli.arbiscan.io" + } + ], + "blocks": { + "confirmations": 1, + "estimateBlockTime": 3, + "reorgPeriod": 1 + }, "chainId": 421613, - "domainId": 421613, - "name": "arbitrumgoerli", - "protocol": "ethereum", "displayName": "Arbitrum Goerli", "displayNameShort": "Arb. Goerli", + "domainId": 421613, + "isTestnet": true, + "name": "arbitrumgoerli", "nativeToken": { + "decimals": 18, "name": "Ether", - "symbol": "ETH", - "decimals": 18 + "symbol": "ETH" }, + "protocol": "ethereum", "rpcUrls": [ { "http": "https://goerli-rollup.arbitrum.io/rpc" } ], - "blockExplorers": [ - { - "name": "Arbiscan", - "url": "https://goerli.arbiscan.io", - "apiUrl": "https://api-goerli.arbiscan.io/api", - "family": "etherscan" - } - ], - "blocks": { - "confirmations": 1, - "reorgPeriod": 1, - "estimateBlockTime": 3 - }, - "isTestnet": true, "merkleRootMultisigIsmFactory": "0x17D58eBb5Ea0E2d360c877E119FAef4C4052e6B9", "messageIdMultisigIsmFactory": "0x922CeEe9e8832a047e6aD68Df4F079F271b73Ac3", "aggregationIsmFactory": "0xC5Bb8CDD44B6c56695df45c7AA8012a97dD6ED13", @@ -140,13 +140,12 @@ "proxyAdmin": "0x00DFB81Bfc45fa03060b605273147F274ea807E5", "mailbox": "0x13dABc0351407d5aAa0A50003a166A73b4febfDc", "validatorAnnounce": "0x4a01EEBa1CC20F47A2e60aE4ec932051601FcB9e", - "defaultIsm": "0x8C841784947dEa42f78263D54bec15c0cF65fA22", "merkleTreeHook": "0xf0A38e1eEA49dAc7968F470c3aA0BDE2565A5d80", "storageGasOracle": "0xFc8229ADB46D96056A6e451Fb3c55d60FFeD056f", "interchainGasPaymaster": "0x76189acFA212298d7022624a4633411eE0d2f26F", "aggregationHook": "0xf852EB6b98d84A4296754043a56759a0Ae0E06df", "protocolFee": "0x0358ba0D90ED2d90fB8cBb610F27C274D8077a0B", - "fallbackRoutingHook": "0x3Ce607F6FcE5Dfb9821f33504d86E04A4CD0C75f", + "fallbackRoutingHook": "0xEdA6f85f4761A1f9e42FD40CA5a4E8Ce1C764015", "index": { "from": 50669378 } diff --git a/typescript/infra/config/environments/mainnet3/chains.ts b/typescript/infra/config/environments/mainnet3/chains.ts index 2204f1ffd..2cd00593f 100644 --- a/typescript/infra/config/environments/mainnet3/chains.ts +++ b/typescript/infra/config/environments/mainnet3/chains.ts @@ -1,16 +1,28 @@ -import { ChainMap, ChainMetadata, chainMetadata } from '@hyperlane-xyz/sdk'; +import { + ChainMap, + ChainMetadata, + Chains, + Mainnets, + chainMetadata, +} from '@hyperlane-xyz/sdk'; +import { ProtocolType } from '@hyperlane-xyz/utils'; import { AgentChainNames, Role } from '../../../src/roles'; +const defaultEthereumMainnetConfigs = Object.fromEntries( + Mainnets.map((chain) => chainMetadata[chain]) + .filter((metadata) => metadata.protocol === ProtocolType.Ethereum) + .map((metadata) => [metadata.name, metadata]), +); + export const ethereumMainnetConfigs: ChainMap = { + ...defaultEthereumMainnetConfigs, bsc: { ...chainMetadata.bsc, transactionOverrides: { gasPrice: 7 * 10 ** 9, // 7 gwei }, }, - avalanche: chainMetadata.avalanche, - base: chainMetadata.base, polygon: { ...chainMetadata.polygon, blocks: { @@ -23,11 +35,6 @@ export const ethereumMainnetConfigs: ChainMap = { // gasPrice: 50 * 10 ** 9, // 50 gwei }, }, - polygonzkevm: chainMetadata.polygonzkevm, - scroll: chainMetadata.scroll, - celo: chainMetadata.celo, - arbitrum: chainMetadata.arbitrum, - optimism: chainMetadata.optimism, ethereum: { ...chainMetadata.ethereum, blocks: { @@ -39,14 +46,11 @@ export const ethereumMainnetConfigs: ChainMap = { maxPriorityFeePerGas: 5 * 10 ** 9, // gwei }, }, - moonbeam: chainMetadata.moonbeam, - gnosis: chainMetadata.gnosis, - mantapacific: chainMetadata.mantapacific, }; // Blessed non-Ethereum chains. export const nonEthereumMainnetConfigs: ChainMap = { - // solana: chainMetadata.solana, + solana: chainMetadata.solana, neutron: chainMetadata.neutron, }; @@ -66,10 +70,15 @@ export const ethereumChainNames = Object.keys( ) as MainnetChains[]; // Remove mantapacific, as it's not considered a "blessed" -// chain. It's not included in the scraper domains table, -// and we don't relay to mantapacific on the Hyperlane or RC contexts. +// chain - we don't relay to mantapacific on the Hyperlane or RC contexts. const hyperlaneContextRelayChains = ethereumChainNames.filter( - (chainName) => chainName !== chainMetadata.mantapacific.name, + (chainName) => chainName !== Chains.mantapacific, +); + +// Skip viction, as it returns incorrect block hashes for eth_getLogs RPCs, +// which breaks the scraper. +const scraperChains = ethereumChainNames.filter( + (chainName) => chainName !== Chains.viction, ); // Hyperlane & RC context agent chain names. @@ -77,5 +86,5 @@ export const agentChainNames: AgentChainNames = { // Run validators for all chains. [Role.Validator]: supportedChainNames, [Role.Relayer]: hyperlaneContextRelayChains, - [Role.Scraper]: hyperlaneContextRelayChains, + [Role.Scraper]: scraperChains, }; diff --git a/typescript/infra/config/environments/mainnet3/core/verification.json b/typescript/infra/config/environments/mainnet3/core/verification.json index 3de017136..7b27ed5bc 100644 --- a/typescript/infra/config/environments/mainnet3/core/verification.json +++ b/typescript/infra/config/environments/mainnet3/core/verification.json @@ -1812,5 +1812,241 @@ "constructorArguments": "", "isProxy": false } + ], + "viction": [ + { + "name": "ProxyAdmin", + "address": "0x0761b0827849abbf7b0cC09CE14e1C93D87f5004", + "constructorArguments": "", + "isProxy": false + }, + { + "name": "Mailbox", + "address": "0x4Ed7d626f1E96cD1C0401607Bf70D95243E3dEd1", + "constructorArguments": "0000000000000000000000000000000000000000000000000000000000000058", + "isProxy": false + }, + { + "name": "TransparentUpgradeableProxy", + "address": "0x2f2aFaE1139Ce54feFC03593FeE8AB2aDF4a85A7", + "constructorArguments": "0000000000000000000000004ed7d626f1e96cd1c0401607bf70d95243e3ded10000000000000000000000000761b0827849abbf7b0cc09ce14e1c93d87f500400000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000", + "isProxy": true + }, + { + "name": "MerkleTreeHook", + "address": "0x149db7afD694722747035d5AEC7007ccb6F8f112", + "constructorArguments": "0000000000000000000000002f2afae1139ce54fefc03593fee8ab2adf4a85a7", + "isProxy": false + }, + { + "name": "StorageGasOracle", + "address": "0x19dc38aeae620380430C200a6E990D5Af5480117", + "constructorArguments": "", + "isProxy": false + }, + { + "name": "InterchainGasPaymaster", + "address": "0xBF12ef4B9f307463D3FB59c3604F294dDCe287E2", + "constructorArguments": "", + "isProxy": false + }, + { + "name": "TransparentUpgradeableProxy", + "address": "0x0D63128D887159d63De29497dfa45AFc7C699AE4", + "constructorArguments": "000000000000000000000000bf12ef4b9f307463d3fb59c3604f294ddce287e20000000000000000000000000761b0827849abbf7b0cc09ce14e1c93d87f500400000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044485cc955000000000000000000000000a7eccdb9be08178f896c26b7bbd8c3d4e844d9ba000000000000000000000000a7eccdb9be08178f896c26b7bbd8c3d4e844d9ba00000000000000000000000000000000000000000000000000000000", + "isProxy": true + }, + { + "name": "MerkleTreeHook", + "address": "0x149db7afD694722747035d5AEC7007ccb6F8f112", + "constructorArguments": "0000000000000000000000002f2afae1139ce54fefc03593fee8ab2adf4a85a7", + "isProxy": false + }, + { + "name": "StorageGasOracle", + "address": "0x19dc38aeae620380430C200a6E990D5Af5480117", + "constructorArguments": "", + "isProxy": false + }, + { + "name": "InterchainGasPaymaster", + "address": "0xBF12ef4B9f307463D3FB59c3604F294dDCe287E2", + "constructorArguments": "", + "isProxy": false + }, + { + "name": "TransparentUpgradeableProxy", + "address": "0x0D63128D887159d63De29497dfa45AFc7C699AE4", + "constructorArguments": "000000000000000000000000bf12ef4b9f307463d3fb59c3604f294ddce287e20000000000000000000000000761b0827849abbf7b0cc09ce14e1c93d87f500400000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044485cc955000000000000000000000000a7eccdb9be08178f896c26b7bbd8c3d4e844d9ba000000000000000000000000a7eccdb9be08178f896c26b7bbd8c3d4e844d9ba00000000000000000000000000000000000000000000000000000000", + "isProxy": true + }, + { + "name": "ProtocolFee", + "address": "0xd83A4F747fE80Ed98839e05079B1B7Fe037b1638", + "constructorArguments": "000000000000000000000000000000000000000000000000000000003b9aca000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a7eccdb9be08178f896c26b7bbd8c3d4e844d9ba000000000000000000000000a7eccdb9be08178f896c26b7bbd8c3d4e844d9ba", + "isProxy": false + }, + { + "name": "ValidatorAnnounce", + "address": "0x2fa5F5C96419C222cDbCeC797D696e6cE428A7A9", + "constructorArguments": "0000000000000000000000002f2afae1139ce54fefc03593fee8ab2adf4a85a7", + "isProxy": false + }, + { + "name": "ProxyAdmin", + "address": "0x0761b0827849abbf7b0cC09CE14e1C93D87f5004", + "constructorArguments": "", + "isProxy": false + }, + { + "name": "Mailbox", + "address": "0x4Ed7d626f1E96cD1C0401607Bf70D95243E3dEd1", + "constructorArguments": "0000000000000000000000000000000000000000000000000000000000000058", + "isProxy": false + }, + { + "name": "TransparentUpgradeableProxy", + "address": "0x2f2aFaE1139Ce54feFC03593FeE8AB2aDF4a85A7", + "constructorArguments": "0000000000000000000000004ed7d626f1e96cd1c0401607bf70d95243e3ded10000000000000000000000000761b0827849abbf7b0cc09ce14e1c93d87f500400000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000", + "isProxy": true + }, + { + "name": "MerkleTreeHook", + "address": "0x149db7afD694722747035d5AEC7007ccb6F8f112", + "constructorArguments": "0000000000000000000000002f2afae1139ce54fefc03593fee8ab2adf4a85a7", + "isProxy": false + }, + { + "name": "StorageGasOracle", + "address": "0x19dc38aeae620380430C200a6E990D5Af5480117", + "constructorArguments": "", + "isProxy": false + }, + { + "name": "InterchainGasPaymaster", + "address": "0xBF12ef4B9f307463D3FB59c3604F294dDCe287E2", + "constructorArguments": "", + "isProxy": false + }, + { + "name": "TransparentUpgradeableProxy", + "address": "0x0D63128D887159d63De29497dfa45AFc7C699AE4", + "constructorArguments": "000000000000000000000000bf12ef4b9f307463d3fb59c3604f294ddce287e20000000000000000000000000761b0827849abbf7b0cc09ce14e1c93d87f500400000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044485cc955000000000000000000000000a7eccdb9be08178f896c26b7bbd8c3d4e844d9ba000000000000000000000000a7eccdb9be08178f896c26b7bbd8c3d4e844d9ba00000000000000000000000000000000000000000000000000000000", + "isProxy": true + }, + { + "name": "MerkleTreeHook", + "address": "0x149db7afD694722747035d5AEC7007ccb6F8f112", + "constructorArguments": "0000000000000000000000002f2afae1139ce54fefc03593fee8ab2adf4a85a7", + "isProxy": false + }, + { + "name": "StorageGasOracle", + "address": "0x19dc38aeae620380430C200a6E990D5Af5480117", + "constructorArguments": "", + "isProxy": false + }, + { + "name": "InterchainGasPaymaster", + "address": "0xBF12ef4B9f307463D3FB59c3604F294dDCe287E2", + "constructorArguments": "", + "isProxy": false + }, + { + "name": "TransparentUpgradeableProxy", + "address": "0x0D63128D887159d63De29497dfa45AFc7C699AE4", + "constructorArguments": "000000000000000000000000bf12ef4b9f307463d3fb59c3604f294ddce287e20000000000000000000000000761b0827849abbf7b0cc09ce14e1c93d87f500400000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044485cc955000000000000000000000000a7eccdb9be08178f896c26b7bbd8c3d4e844d9ba000000000000000000000000a7eccdb9be08178f896c26b7bbd8c3d4e844d9ba00000000000000000000000000000000000000000000000000000000", + "isProxy": true + }, + { + "name": "ProtocolFee", + "address": "0xd83A4F747fE80Ed98839e05079B1B7Fe037b1638", + "constructorArguments": "000000000000000000000000000000000000000000000000000000003b9aca000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a7eccdb9be08178f896c26b7bbd8c3d4e844d9ba000000000000000000000000a7eccdb9be08178f896c26b7bbd8c3d4e844d9ba", + "isProxy": false + }, + { + "name": "ValidatorAnnounce", + "address": "0x2fa5F5C96419C222cDbCeC797D696e6cE428A7A9", + "constructorArguments": "0000000000000000000000002f2afae1139ce54fefc03593fee8ab2adf4a85a7", + "isProxy": false + }, + { + "name": "ProxyAdmin", + "address": "0x0761b0827849abbf7b0cC09CE14e1C93D87f5004", + "constructorArguments": "", + "isProxy": false + }, + { + "name": "Mailbox", + "address": "0x4Ed7d626f1E96cD1C0401607Bf70D95243E3dEd1", + "constructorArguments": "0000000000000000000000000000000000000000000000000000000000000058", + "isProxy": false + }, + { + "name": "TransparentUpgradeableProxy", + "address": "0x2f2aFaE1139Ce54feFC03593FeE8AB2aDF4a85A7", + "constructorArguments": "0000000000000000000000004ed7d626f1e96cd1c0401607bf70d95243e3ded10000000000000000000000000761b0827849abbf7b0cc09ce14e1c93d87f500400000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000", + "isProxy": true + }, + { + "name": "MerkleTreeHook", + "address": "0x149db7afD694722747035d5AEC7007ccb6F8f112", + "constructorArguments": "0000000000000000000000002f2afae1139ce54fefc03593fee8ab2adf4a85a7", + "isProxy": false + }, + { + "name": "StorageGasOracle", + "address": "0x19dc38aeae620380430C200a6E990D5Af5480117", + "constructorArguments": "", + "isProxy": false + }, + { + "name": "InterchainGasPaymaster", + "address": "0xBF12ef4B9f307463D3FB59c3604F294dDCe287E2", + "constructorArguments": "", + "isProxy": false + }, + { + "name": "TransparentUpgradeableProxy", + "address": "0x0D63128D887159d63De29497dfa45AFc7C699AE4", + "constructorArguments": "000000000000000000000000bf12ef4b9f307463d3fb59c3604f294ddce287e20000000000000000000000000761b0827849abbf7b0cc09ce14e1c93d87f500400000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044485cc955000000000000000000000000a7eccdb9be08178f896c26b7bbd8c3d4e844d9ba000000000000000000000000a7eccdb9be08178f896c26b7bbd8c3d4e844d9ba00000000000000000000000000000000000000000000000000000000", + "isProxy": true + }, + { + "name": "MerkleTreeHook", + "address": "0x149db7afD694722747035d5AEC7007ccb6F8f112", + "constructorArguments": "0000000000000000000000002f2afae1139ce54fefc03593fee8ab2adf4a85a7", + "isProxy": false + }, + { + "name": "StorageGasOracle", + "address": "0x19dc38aeae620380430C200a6E990D5Af5480117", + "constructorArguments": "", + "isProxy": false + }, + { + "name": "InterchainGasPaymaster", + "address": "0xBF12ef4B9f307463D3FB59c3604F294dDCe287E2", + "constructorArguments": "", + "isProxy": false + }, + { + "name": "TransparentUpgradeableProxy", + "address": "0x0D63128D887159d63De29497dfa45AFc7C699AE4", + "constructorArguments": "000000000000000000000000bf12ef4b9f307463d3fb59c3604f294ddce287e20000000000000000000000000761b0827849abbf7b0cc09ce14e1c93d87f500400000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044485cc955000000000000000000000000a7eccdb9be08178f896c26b7bbd8c3d4e844d9ba000000000000000000000000a7eccdb9be08178f896c26b7bbd8c3d4e844d9ba00000000000000000000000000000000000000000000000000000000", + "isProxy": true + }, + { + "name": "ProtocolFee", + "address": "0xd83A4F747fE80Ed98839e05079B1B7Fe037b1638", + "constructorArguments": "000000000000000000000000000000000000000000000000000000003b9aca000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a7eccdb9be08178f896c26b7bbd8c3d4e844d9ba000000000000000000000000a7eccdb9be08178f896c26b7bbd8c3d4e844d9ba", + "isProxy": false + }, + { + "name": "ValidatorAnnounce", + "address": "0x2fa5F5C96419C222cDbCeC797D696e6cE428A7A9", + "constructorArguments": "0000000000000000000000002f2afae1139ce54fefc03593fee8ab2adf4a85a7", + "isProxy": false + } ] } diff --git a/typescript/infra/config/environments/mainnet3/gas-oracle.ts b/typescript/infra/config/environments/mainnet3/gas-oracle.ts index 955f5814c..fe5c40ebb 100644 --- a/typescript/infra/config/environments/mainnet3/gas-oracle.ts +++ b/typescript/infra/config/environments/mainnet3/gas-oracle.ts @@ -50,6 +50,7 @@ const gasPrices: ChainMap = { polygonzkevm: ethers.utils.parseUnits('2', 'gwei'), neutron: ethers.utils.parseUnits('1', 'gwei'), mantapacific: ethers.utils.parseUnits('1', 'gwei'), + viction: ethers.utils.parseUnits('0.25', 'gwei'), }; // Accurate from coingecko as of Mar 9, 2023. @@ -92,6 +93,8 @@ const tokenUsdPrices: ChainMap = { '1619.00', TOKEN_EXCHANGE_RATE_DECIMALS, ), + // https://www.coingecko.com/en/coins/viction + viction: ethers.utils.parseUnits('0.881', TOKEN_EXCHANGE_RATE_DECIMALS), }; // Gets the exchange rate of the remote quoted in local tokens diff --git a/typescript/infra/config/environments/mainnet3/ism/verification.json b/typescript/infra/config/environments/mainnet3/ism/verification.json index 658a2085a..e3941bf80 100644 --- a/typescript/infra/config/environments/mainnet3/ism/verification.json +++ b/typescript/infra/config/environments/mainnet3/ism/verification.json @@ -2176,83 +2176,71 @@ "constructorArguments": "", "isProxy": true }, - { - "name": "RoutingIsmFactory", - "address": "0x8061Af3A459093540d17823D651BC5E2A92669a7", - "constructorArguments": "", - "isProxy": false - }, { "name": "DomaingRoutingIsm", - "address": "0x2214b2AC96215d2FF1fffC84E4Af295d7497B013", + "address": "0xE8d610DC4Baf01070FD2f223d45f84d8801D90B1", "constructorArguments": "", "isProxy": true - }, + } + ], + "viction": [ { - "name": "StaticMerkleRootMultisigIsm", - "address": "0x28336d2b8783f2373bCFc173058EA932bf3b901C", + "name": "MerkleRootMultisigIsmFactory", + "address": "0x2C1FAbEcd7bFBdEBF27CcdB67baADB38b6Df90fC", "constructorArguments": "", - "isProxy": true + "isProxy": false }, { - "name": "StaticMessageIdMultisigIsm", - "address": "0x76FD8c164F380107631160d8Fd1f4Edc2719004D", + "name": "StaticMerkleRootMultisigIsm", + "address": "0x4725F7b8037513915aAf6D6CBDE2920E28540dDc", "constructorArguments": "", "isProxy": true }, { - "name": "StaticAggregationIsm", - "address": "0xd5FF00DD9E737c9d1a197246738876fAF43e4aC0", + "name": "MessageIdMultisigIsmFactory", + "address": "0x8b83fefd896fAa52057798f6426E9f0B080FCCcE", "constructorArguments": "", - "isProxy": true + "isProxy": false }, { - "name": "StaticAggregationHook", - "address": "0x568De5f1639Fe7c9eba67f1191DE19eeCc77985B", + "name": "StaticMessageIdMultisigIsm", + "address": "0xAF03386044373E2fe26C5b1dCedF5a7e854a7a3F", "constructorArguments": "", "isProxy": true }, { - "name": "DomaingRoutingIsm", - "address": "0x2214b2AC96215d2FF1fffC84E4Af295d7497B013", - "constructorArguments": "", - "isProxy": true - } - ], - "mantapacific": [ - { - "name": "StaticMerkleRootMultisigIsm", - "address": "0x882CD0C5D50b6dD74b36Da4BDb059507fddEDdf2", + "name": "AggregationIsmFactory", + "address": "0x8F7454AC98228f3504Bb91eA3D8Adafe6406110A", "constructorArguments": "", - "isProxy": true + "isProxy": false }, { - "name": "StaticMessageIdMultisigIsm", - "address": "0x19930232E9aFC4f4F09d09fe2375680fAc2100D0", + "name": "StaticAggregationIsm", + "address": "0x882CD0C5D50b6dD74b36Da4BDb059507fddEDdf2", "constructorArguments": "", "isProxy": true }, { - "name": "StaticAggregationIsm", - "address": "0x12Ed1BbA182CbC63692F813651BD493B7445C874", + "name": "AggregationHookFactory", + "address": "0xEb9FcFDC9EfDC17c1EC5E1dc085B98485da213D6", "constructorArguments": "", - "isProxy": true + "isProxy": false }, { "name": "StaticAggregationHook", - "address": "0x3b9f24fD2ecfed0d3A88fa7f0E4e5747671981D7", + "address": "0x19930232E9aFC4f4F09d09fe2375680fAc2100D0", "constructorArguments": "", "isProxy": true }, { "name": "RoutingIsmFactory", - "address": "0x8358D8291e3bEDb04804975eEa0fe9fe0fAfB147", + "address": "0x1052eF3419f26Bec74Ed7CEf4a4FA6812Bc09908", "constructorArguments": "", "isProxy": false }, { "name": "DomaingRoutingIsm", - "address": "0x6C360932873629929ff3D9ffB70bD4cbC1606541", + "address": "0x12Ed1BbA182CbC63692F813651BD493B7445C874", "constructorArguments": "", "isProxy": true } diff --git a/typescript/infra/config/environments/mainnet3/owners.ts b/typescript/infra/config/environments/mainnet3/owners.ts index 6bf7df49c..b01cb0ed7 100644 --- a/typescript/infra/config/environments/mainnet3/owners.ts +++ b/typescript/infra/config/environments/mainnet3/owners.ts @@ -21,9 +21,11 @@ export const safes: ChainMap
= { scroll: undefined, polygonzkevm: undefined, mantapacific: undefined, + viction: undefined, }; const deployer = '0xa7ECcdb9Be08178f896c26b7BbD8C3D4E844d9Ba'; + export const owners: ChainMap = objMap(safes, (local, __) => ({ owner: deployer, // TODO: change this to the safe ownerOverrides: { diff --git a/typescript/infra/config/environments/mainnet3/validators.ts b/typescript/infra/config/environments/mainnet3/validators.ts index 3f5e60e16..e7fe44e98 100644 --- a/typescript/infra/config/environments/mainnet3/validators.ts +++ b/typescript/infra/config/environments/mainnet3/validators.ts @@ -239,5 +239,21 @@ export const validatorChainConfig = ( 'mantapacific', ), }, + viction: { + interval: 5, + reorgPeriod: 0, + validators: validatorsConfig( + { + [Contexts.Hyperlane]: [ + '0x1f87c368f8e05a85ef9126d984a980a20930cb9c', + '0x4a2ebbe07cd546cfd2b213d41f2d7814f9386157', + '0x00271cf10759e4c6d2f8ca46183ab10d360474b4', + ], + [Contexts.ReleaseCandidate]: [], + [Contexts.Neutron]: [], + }, + 'viction', + ), + }, }; }; diff --git a/typescript/infra/config/environments/mainnet3/warp/verification.json b/typescript/infra/config/environments/mainnet3/warp/verification.json index 6270d27ae..c3f3dfc0f 100644 --- a/typescript/infra/config/environments/mainnet3/warp/verification.json +++ b/typescript/infra/config/environments/mainnet3/warp/verification.json @@ -6,5 +6,45 @@ "constructorArguments": "0000000000000000000000000000000000000000000000000000000000000006000000000000000000000000979ca5202784112f4738403dbec5d0f3b9daabb9", "isProxy": false } + ], + "viction": [ + { + "name": "HypERC20", + "address": "0x182E8d7c5F1B06201b102123FC7dF0EaeB445a7B", + "constructorArguments": "00000000000000000000000000000000000000000000000000000000000000120000000000000000000000002f2afae1139ce54fefc03593fee8ab2adf4a85a7", + "isProxy": false + }, + { + "name": "HypERC20", + "address": "0x811808Dd29ba8B0FC6C0ec0b5537035E59745162", + "constructorArguments": "00000000000000000000000000000000000000000000000000000000000000120000000000000000000000002f2afae1139ce54fefc03593fee8ab2adf4a85a7", + "isProxy": false + }, + { + "name": "HypERC20", + "address": "0x61DDB465eEA5bc3708Cf8B53156aC91a77A2f029", + "constructorArguments": "00000000000000000000000000000000000000000000000000000000000000120000000000000000000000002f2afae1139ce54fefc03593fee8ab2adf4a85a7", + "isProxy": false + } + ], + "ethereum": [ + { + "name": "HypNative", + "address": "0x15b5D6B614242B118AA404528A7f3E2Ad241e4A4", + "constructorArguments": "000000000000000000000000c005dc82818d67af737725bd4bf75435d065d239", + "isProxy": false + }, + { + "name": "HypERC20Collateral", + "address": "0x31Dca7762930f56D81292f85E65c9D67575804fE", + "constructorArguments": "000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000c005dc82818d67af737725bd4bf75435d065d239", + "isProxy": false + }, + { + "name": "HypERC20Collateral", + "address": "0x4221a16A01F61c2b38A03C52d828a7041f6AAA49", + "constructorArguments": "000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000c005dc82818d67af737725bd4bf75435d065d239", + "isProxy": false + } ] } diff --git a/typescript/infra/config/environments/mainnet3/warp/viction-ETH-addresses.json b/typescript/infra/config/environments/mainnet3/warp/viction-ETH-addresses.json new file mode 100644 index 000000000..c5842c176 --- /dev/null +++ b/typescript/infra/config/environments/mainnet3/warp/viction-ETH-addresses.json @@ -0,0 +1,8 @@ +{ + "viction": { + "router": "0x182E8d7c5F1B06201b102123FC7dF0EaeB445a7B" + }, + "ethereum": { + "router": "0x15b5D6B614242B118AA404528A7f3E2Ad241e4A4" + } +} diff --git a/typescript/infra/config/environments/mainnet3/warp/viction-USDC-addresses.json b/typescript/infra/config/environments/mainnet3/warp/viction-USDC-addresses.json new file mode 100644 index 000000000..c56719309 --- /dev/null +++ b/typescript/infra/config/environments/mainnet3/warp/viction-USDC-addresses.json @@ -0,0 +1,10 @@ +{ + "ethereum": { + "HypERC20Collateral": "0x31Dca7762930f56D81292f85E65c9D67575804fE", + "router": "0x31Dca7762930f56D81292f85E65c9D67575804fE" + }, + "viction": { + "HypERC20": "0xBDa330Ea8F3005C421C8088e638fBB64fA71b9e0", + "router": "0xBDa330Ea8F3005C421C8088e638fBB64fA71b9e0" + } +} diff --git a/typescript/infra/config/environments/mainnet3/warp/viction-USDT-addresses.json b/typescript/infra/config/environments/mainnet3/warp/viction-USDT-addresses.json new file mode 100644 index 000000000..49c09c335 --- /dev/null +++ b/typescript/infra/config/environments/mainnet3/warp/viction-USDT-addresses.json @@ -0,0 +1,10 @@ +{ + "ethereum": { + "router": "0x4221a16A01F61c2b38A03C52d828a7041f6AAA49", + "HypERC20Collateral": "0x4221a16A01F61c2b38A03C52d828a7041f6AAA49" + }, + "viction": { + "router": "0xea820f9BCFD5E16a0dd42071EB61A29874Ad81A4", + "HypERC20": "0xea820f9BCFD5E16a0dd42071EB61A29874Ad81A4" + } +} diff --git a/typescript/infra/config/environments/testnet4/agent.ts b/typescript/infra/config/environments/testnet4/agent.ts index 917c07fb7..06996b81c 100644 --- a/typescript/infra/config/environments/testnet4/agent.ts +++ b/typescript/infra/config/environments/testnet4/agent.ts @@ -1,5 +1,4 @@ import { - Chains, GasPaymentEnforcementPolicyType, RpcConsensusType, chainMetadata, diff --git a/typescript/infra/config/environments/testnet4/chains.ts b/typescript/infra/config/environments/testnet4/chains.ts index ac479783c..daef76850 100644 --- a/typescript/infra/config/environments/testnet4/chains.ts +++ b/typescript/infra/config/environments/testnet4/chains.ts @@ -1,12 +1,30 @@ -import { ChainMap, ChainMetadata, chainMetadata } from '@hyperlane-xyz/sdk'; +import { + ChainMap, + ChainMetadata, + Chains, + chainMetadata, +} from '@hyperlane-xyz/sdk'; import { AgentChainNames, Role } from '../../../src/roles'; -// Blessed -export const ethereumTestnetConfigs: ChainMap = { - alfajores: chainMetadata.alfajores, - basegoerli: chainMetadata.basegoerli, - fuji: chainMetadata.fuji, +const selectedChains = [ + Chains.alfajores, + Chains.arbitrumgoerli, + Chains.basegoerli, + Chains.bsctestnet, + Chains.fuji, + Chains.goerli, + Chains.moonbasealpha, + Chains.optimismgoerli, + Chains.polygonzkevmtestnet, + Chains.scrollsepolia, + Chains.sepolia, +]; + +export const testnetConfigs: ChainMap = { + ...Object.fromEntries( + selectedChains.map((chain) => [chain, chainMetadata[chain]]), + ), mumbai: { ...chainMetadata.mumbai, transactionOverrides: { @@ -20,41 +38,15 @@ export const ethereumTestnetConfigs: ChainMap = { gasPrice: 80 * 10 ** 9, // 8 gwei }, }, - goerli: chainMetadata.goerli, - scrollsepolia: chainMetadata.scrollsepolia, - sepolia: chainMetadata.sepolia, - moonbasealpha: chainMetadata.moonbasealpha, - optimismgoerli: chainMetadata.optimismgoerli, - arbitrumgoerli: chainMetadata.arbitrumgoerli, - polygonzkevmtestnet: chainMetadata.polygonzkevmtestnet, -}; - -// Blessed non-Ethereum chains. -export const nonEthereumTestnetConfigs: ChainMap = { - solanatestnet: chainMetadata.solanatestnet, - eclipsetestnet: chainMetadata.eclipsetestnet, }; -export const testnetConfigs: ChainMap = { - ...ethereumTestnetConfigs, - ...nonEthereumTestnetConfigs, -}; - -export type TestnetChains = keyof typeof testnetConfigs; -export const supportedChainNames = Object.keys( - testnetConfigs, -) as TestnetChains[]; +export const supportedChainNames = Object.keys(testnetConfigs); export const environment = 'testnet4'; -export const ethereumChainNames = Object.keys( - ethereumTestnetConfigs, -) as TestnetChains[]; - // Hyperlane & RC context agent chain names. export const agentChainNames: AgentChainNames = { - // Run validators for all chains. [Role.Validator]: supportedChainNames, // Only run relayers for Ethereum chains at the moment. [Role.Relayer]: supportedChainNames, - [Role.Scraper]: ethereumChainNames, + [Role.Scraper]: supportedChainNames, }; diff --git a/typescript/infra/config/environments/testnet4/gas-oracle.ts b/typescript/infra/config/environments/testnet4/gas-oracle.ts index efa98e5f2..40167b797 100644 --- a/typescript/infra/config/environments/testnet4/gas-oracle.ts +++ b/typescript/infra/config/environments/testnet4/gas-oracle.ts @@ -11,7 +11,7 @@ import { getTokenExchangeRateFromValues, } from '../../../src/config/gas-oracle'; -import { TestnetChains, supportedChainNames } from './chains'; +import { supportedChainNames } from './chains'; // Taken by looking at each testnet and overestimating gas prices const gasPrices: ChainMap = { @@ -69,7 +69,7 @@ const chainTokenRarity: ChainMap = { }; // Gets the "value" of a testnet chain -function getApproximateValue(chain: TestnetChains): BigNumber { +function getApproximateValue(chain: ChainName): BigNumber { const rarity = chainTokenRarity[chain]; return RARITY_APPROXIMATE_VALUE[rarity]; } diff --git a/typescript/infra/config/environments/testnet4/igp.ts b/typescript/infra/config/environments/testnet4/igp.ts index 0a4cd987a..e0b44bcae 100644 --- a/typescript/infra/config/environments/testnet4/igp.ts +++ b/typescript/infra/config/environments/testnet4/igp.ts @@ -1,5 +1,6 @@ import { ChainMap, + ChainName, GasOracleContractType, IgpConfig, defaultMultisigConfigs, @@ -7,10 +8,10 @@ import { } from '@hyperlane-xyz/sdk'; import { exclude, objMap } from '@hyperlane-xyz/utils'; -import { TestnetChains, supportedChainNames } from './chains'; +import { supportedChainNames } from './chains'; import { owners } from './owners'; -function getGasOracles(local: TestnetChains) { +function getGasOracles(local: ChainName) { return Object.fromEntries( exclude(local, supportedChainNames).map((name) => [ name, diff --git a/typescript/infra/config/environments/testnet4/owners.ts b/typescript/infra/config/environments/testnet4/owners.ts index b9c1e2e3c..f63732d4c 100644 --- a/typescript/infra/config/environments/testnet4/owners.ts +++ b/typescript/infra/config/environments/testnet4/owners.ts @@ -1,13 +1,13 @@ import { ChainMap, OwnableConfig } from '@hyperlane-xyz/sdk'; -import { ethereumChainNames } from './chains'; +import { supportedChainNames } from '../testnet4/chains'; const ETHEREUM_DEPLOYER_ADDRESS = '0xfaD1C94469700833717Fa8a3017278BC1cA8031C'; // const SEALEVEL_DEPLOYER_ADDRESS = '6DjHX6Ezjpq3zZMZ8KsqyoFYo1zPSDoiZmLLkxD4xKXS'; export const owners: ChainMap = { ...Object.fromEntries( - ethereumChainNames.map((chain) => [ + supportedChainNames.map((chain) => [ chain, { owner: ETHEREUM_DEPLOYER_ADDRESS }, ]), diff --git a/typescript/infra/config/environments/testnet4/warp/verification.json b/typescript/infra/config/environments/testnet4/warp/verification.json new file mode 100644 index 000000000..9f8e5e6bc --- /dev/null +++ b/typescript/infra/config/environments/testnet4/warp/verification.json @@ -0,0 +1,16 @@ +{ + "goerli": [ + { + "name": "HypERC20Collateral", + "address": "0xEF2a1f411d919878159303D9E3fe00D001F7D1D0", + "constructorArguments": "00000000000000000000000007865c6e87b9f70255377e024ace6630c1eaa37f00000000000000000000000049cfd6ef774acab14814d699e3f7ee36fdfba932", + "isProxy": false + }, + { + "name": "HypNative", + "address": "0x0918293aadfa13F8c9F2cdE415811b6AD9ff4a2d", + "constructorArguments": "00000000000000000000000049cfd6ef774acab14814d699e3f7ee36fdfba932", + "isProxy": false + } + ] +} diff --git a/typescript/infra/config/routingIsm.ts b/typescript/infra/config/routingIsm.ts index 7f25c6b9f..7763ef1f8 100644 --- a/typescript/infra/config/routingIsm.ts +++ b/typescript/infra/config/routingIsm.ts @@ -14,22 +14,13 @@ import { DeployEnvironment } from '../src/config'; import { Contexts } from './contexts'; import { environments } from './environments'; import { ethereumChainNames as mainnet3Chains } from './environments/mainnet3/chains'; -import { owners as mainnet3Owners } from './environments/mainnet3/owners'; -import { owners as testOwners } from './environments/test/owners'; import { supportedChainNames as testnet4Chains } from './environments/testnet4/chains'; -import { owners as testnet4Owners } from './environments/testnet4/owners'; import { multisigIsm } from './multisigIsm'; -const owners = { - test: testOwners, - testnet4: testnet4Owners, - mainnet3: mainnet3Owners, -}; - const chains = { test: TestChains, testnet4: testnet4Chains, - mainnet3: mainnet3Chains.filter((_) => _ !== 'mantapacific'), + mainnet3: mainnet3Chains, }; // Intended to be the "entrypoint" ISM. diff --git a/typescript/infra/scripts/announce-validators.ts b/typescript/infra/scripts/announce-validators.ts index 542e9de96..509c0d523 100644 --- a/typescript/infra/scripts/announce-validators.ts +++ b/typescript/infra/scripts/announce-validators.ts @@ -8,6 +8,7 @@ import { AllChains, ChainName, HyperlaneCore } from '@hyperlane-xyz/sdk'; import { S3Validator } from '../src/agents/aws/validator'; import { CheckpointSyncerType } from '../src/config'; import { deployEnvToSdkEnv } from '../src/config/environment'; +import { isEthereumProtocolChain } from '../src/utils/utils'; import { getAgentConfig, @@ -80,8 +81,9 @@ async function main() { return; } await Promise.all( - Object.entries(agentConfig.validators.chains).map( - async ([chain, validatorChainConfig]) => { + Object.entries(agentConfig.validators.chains) + .filter(([chain, _]) => isEthereumProtocolChain(chain)) + .map(async ([chain, validatorChainConfig]) => { for (const validatorBaseConfig of validatorChainConfig.validators) { if ( validatorBaseConfig.checkpointSyncer.type == @@ -104,8 +106,7 @@ async function main() { chains.push(chain); } } - }, - ), + }), ); } diff --git a/typescript/infra/scripts/deploy.ts b/typescript/infra/scripts/deploy.ts index bc2e9c003..1bceb9740 100644 --- a/typescript/infra/scripts/deploy.ts +++ b/typescript/infra/scripts/deploy.ts @@ -4,7 +4,6 @@ import { prompt } from 'prompts'; import { HelloWorldDeployer } from '@hyperlane-xyz/helloworld'; import { ChainMap, - HypERC20Deployer, HyperlaneCore, HyperlaneCoreDeployer, HyperlaneDeployer, @@ -14,9 +13,7 @@ import { InterchainAccountDeployer, InterchainQueryDeployer, LiquidityLayerDeployer, - TokenConfig, } from '@hyperlane-xyz/sdk'; -import { TokenDecimals, TokenType } from '@hyperlane-xyz/sdk/dist/token/config'; import { objMap } from '@hyperlane-xyz/utils'; import { Contexts } from '../config/contexts'; @@ -35,6 +32,7 @@ import { getModuleDirectory, withContext, withModuleAndFork, + withNetwork, } from './utils'; async function main() { @@ -43,7 +41,8 @@ async function main() { module, fork, environment, - } = await withContext(withModuleAndFork(getArgs())).argv; + network, + } = await withContext(withNetwork(withModuleAndFork(getArgs()))).argv; const envConfig = getEnvironmentConfig(environment); const env = deployEnvToSdkEnv[environment]; @@ -72,36 +71,7 @@ async function main() { ); deployer = new HyperlaneCoreDeployer(multiProvider, ismFactory); } else if (module === Modules.WARP) { - const neutronRouter = - '6b04c49fcfd98bc4ea9c05cd5790462a39537c00028333474aebe6ddf20b73a3'; - const ismFactory = HyperlaneIsmFactory.fromAddressesMap( - getAddresses(environment, Modules.PROXY_FACTORY), - multiProvider, - ); - const tokenConfig: TokenConfig & TokenDecimals = { - type: TokenType.synthetic, - name: 'Eclipse Fi', - symbol: 'ECLIP', - decimals: 6, - totalSupply: 0, - }; - const core = HyperlaneCore.fromEnvironment( - deployEnvToSdkEnv[environment], - multiProvider, - ); - const routerConfig = core.getRouterConfig(envConfig.owners); - config = { - arbitrum: { - ...routerConfig['arbitrum'], - ...tokenConfig, - interchainSecurityModule: '0x53A5c239d62ff35c98E0EC9612c86517748ffF59', - gas: 600_000, - }, - neutron: { - foreignDeployment: neutronRouter, - }, - }; - deployer = new HypERC20Deployer(multiProvider, ismFactory); + throw new Error('Warp is not supported. Use CLI instead.'); } else if (module === Modules.INTERCHAIN_GAS_PAYMASTER) { config = envConfig.igp; deployer = new HyperlaneIgpDeployer(multiProvider); @@ -181,6 +151,8 @@ async function main() { // prompt for confirmation in production environments if (environment !== 'test' && !fork) { + const confirmConfig = network ? config[network] : config; + console.log(JSON.stringify(confirmConfig, null, 2)); const { value: confirmed } = await prompt({ type: 'confirm', name: 'value', @@ -192,7 +164,13 @@ async function main() { } } - await deployWithArtifacts(config, deployer, cache, fork, agentConfig); + await deployWithArtifacts( + config, + deployer, + cache, + network ?? fork, + agentConfig, + ); } main() diff --git a/typescript/infra/scripts/gas-oracle/update-storage-gas-oracle.ts b/typescript/infra/scripts/gas-oracle/update-storage-gas-oracle.ts index a3b36a581..67082d509 100644 --- a/typescript/infra/scripts/gas-oracle/update-storage-gas-oracle.ts +++ b/typescript/infra/scripts/gas-oracle/update-storage-gas-oracle.ts @@ -4,7 +4,7 @@ import { ProtocolType } from '@hyperlane-xyz/utils'; import { RemoteGasData, StorageGasOracleConfig } from '../../src/config'; import { deployEnvToSdkEnv } from '../../src/config/environment'; import { RemoteGasDataConfig } from '../../src/config/gas-oracle'; -import { getArgs, getEnvironmentConfig } from '../utils'; +import { getArgs, getEnvironmentConfig, withNetwork } from '../utils'; import { eqRemoteGasData, @@ -19,12 +19,12 @@ import { * Expects the deployer key to be the owner of the StorageGasOracle contract. */ async function main() { - const args = await getArgs() + const args = await withNetwork(getArgs()) .boolean('dry-run') .describe('dry-run', 'If true, will not submit any transactions') .default('dry-run', false).argv; - const { environment } = await getArgs().argv; + const { environment, network } = args; const coreEnvConfig = getEnvironmentConfig(environment); const multiProvider = await coreEnvConfig.getMultiProvider(); @@ -38,7 +38,9 @@ async function main() { multiProvider, ); - for (const chain of igp.chains()) { + const targetChains = network ? [network] : igp.chains(); + + for (const chain of targetChains) { if ( multiProvider.getChainMetadata(chain).protocol !== ProtocolType.Ethereum ) { diff --git a/typescript/infra/scripts/utils.ts b/typescript/infra/scripts/utils.ts index 1820f9883..645aa2ca0 100644 --- a/typescript/infra/scripts/utils.ts +++ b/typescript/infra/scripts/utils.ts @@ -71,6 +71,13 @@ export function withModuleAndFork(args: yargs.Argv) { .alias('f', 'fork'); } +export function withNetwork(args: yargs.Argv) { + return args + .describe('network', 'network to target') + .choices('network', Object.values(Chains)) + .alias('n', 'network'); +} + export function withContext(args: yargs.Argv) { return args .describe('context', 'deploy context') diff --git a/typescript/infra/src/deployment/deploy.ts b/typescript/infra/src/deployment/deploy.ts index f003b9e52..43a7f18c6 100644 --- a/typescript/infra/src/deployment/deploy.ts +++ b/typescript/infra/src/deployment/deploy.ts @@ -29,7 +29,7 @@ export async function deployWithArtifacts( read: boolean; write: boolean; }, - fork?: ChainName, + targetNetwork?: ChainName, agentConfig?: { multiProvider: MultiProvider; addresses: string; @@ -56,11 +56,9 @@ export async function deployWithArtifacts( }); try { - if (fork) { - deployer.deployedContracts[fork] = await deployer.deployContracts( - fork, - configMap[fork], - ); + if (targetNetwork) { + deployer.deployedContracts[targetNetwork] = + await deployer.deployContracts(targetNetwork, configMap[targetNetwork]); } else { await deployer.deploy(configMap); } diff --git a/typescript/sdk/logos/black/viction.svg b/typescript/sdk/logos/black/viction.svg new file mode 100644 index 000000000..911cc7fb5 --- /dev/null +++ b/typescript/sdk/logos/black/viction.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/typescript/sdk/logos/color/viction.svg b/typescript/sdk/logos/color/viction.svg new file mode 100644 index 000000000..911cc7fb5 --- /dev/null +++ b/typescript/sdk/logos/color/viction.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/typescript/sdk/src/consts/bytecode.ts b/typescript/sdk/src/consts/bytecode.ts index 640261bae..fe5605d4e 100644 --- a/typescript/sdk/src/consts/bytecode.ts +++ b/typescript/sdk/src/consts/bytecode.ts @@ -1,6 +1,7 @@ export enum BytecodeHash { V3_MAILBOX_BYTECODE_HASH = '0x6e853444a6e38bb1d7ac7608b92a70cee83153c891c70ed882b2432134bb23a0', // without optimizer OPT_V3_MAILBOX_BYTECODE_HASH = '0x7cc944e10fa5597f10265bdac4a808e705711451ee7f117ebf9a97193b796136', // with optimizer + TRANSPARENT_PROXY_4_9_3_BYTECODE_HASH = '0xae0fb63adc64a29562a3337ed10b8772f89d5241bc3d8f0a82e9462d421e5e4b', // OZ 4.9.3 TRANSPARENT_PROXY_BYTECODE_HASH = '0x320bda003dfa31828115be5c01b9f3e7eecaf2532afdb89d2b53559f2e7ab86d', // without optimizer OPT_TRANSPARENT_PROXY_BYTECODE_HASH = '0x30aa3b1506a94c0fe2749af099851623685d9a24a65e2e8b3746c272499979d1', // with optimizer PROXY_ADMIN_BYTECODE_HASH = '0x13855ae57da3aadecb9259cecece16e1f434b8850fe95531f422e4e262f3f200', diff --git a/typescript/sdk/src/consts/chainMetadata.ts b/typescript/sdk/src/consts/chainMetadata.ts index b460f81ac..7a8a469b6 100644 --- a/typescript/sdk/src/consts/chainMetadata.ts +++ b/typescript/sdk/src/consts/chainMetadata.ts @@ -1011,6 +1011,37 @@ export const test3: ChainMetadata = { rpcUrls: [{ http: 'http://127.0.0.1:8545' }], }; +export const viction: ChainMetadata = { + blockExplorers: [ + { + apiUrl: 'https://www.vicscan.xyz/api', + family: ExplorerFamily.Other, + name: 'Vicscan', + url: 'https://www.vicscan.xyz/', + }, + ], + blocks: { + confirmations: 1, + estimateBlockTime: 2, + reorgPeriod: 0, + }, + chainId: 88, + displayName: 'Viction', + domainId: 88, + name: Chains.viction, + nativeToken: { + decimals: 18, + name: 'Viction', + symbol: 'VIC', + }, + protocol: ProtocolType.Ethereum, + rpcUrls: [ + { + http: 'https://viction.blockpi.network/v1/rpc/public', + }, + ], +}; + /** * Collection maps * @@ -1055,6 +1086,7 @@ export const chainMetadata: ChainMap = { test1, test2, test3, + viction, }; export const chainIdToMetadata = Object.values(chainMetadata).reduce< diff --git a/typescript/sdk/src/consts/chains.ts b/typescript/sdk/src/consts/chains.ts index 7d065f700..1711c1d10 100644 --- a/typescript/sdk/src/consts/chains.ts +++ b/typescript/sdk/src/consts/chains.ts @@ -37,6 +37,7 @@ export enum Chains { solanadevnet = 'solanadevnet', solanatestnet = 'solanatestnet', eclipsetestnet = 'eclipsetestnet', + viction = 'viction', test1 = 'test1', test2 = 'test2', test3 = 'test3', @@ -70,6 +71,7 @@ export const Mainnets: Array = [ Chains.base, Chains.scroll, Chains.polygonzkevm, + Chains.viction, // Chains.solana, ]; @@ -80,8 +82,8 @@ export const Testnets: Array = [ Chains.bsctestnet, Chains.chiado, Chains.fuji, - Chains.lineagoerli, Chains.goerli, + Chains.lineagoerli, Chains.moonbasealpha, Chains.mumbai, Chains.optimismgoerli, diff --git a/typescript/sdk/src/consts/environments/mainnet.json b/typescript/sdk/src/consts/environments/mainnet.json index a7173cb4a..041af75f4 100644 --- a/typescript/sdk/src/consts/environments/mainnet.json +++ b/typescript/sdk/src/consts/environments/mainnet.json @@ -251,8 +251,27 @@ "protocolFee": "0xd83A4F747fE80Ed98839e05079B1B7Fe037b1638", "validatorAnnounce": "0x2fa5F5C96419C222cDbCeC797D696e6cE428A7A9", "routingIsmFactory": "0x8358D8291e3bEDb04804975eEa0fe9fe0fAfB147", + "testRecipient": "0x4E1c88DD261BEe2941e6c1814597e30F53330428", + "testTokenRecipient": "0x5060eCD5dFAD300A90592C04e504600A7cdcF70b", "pausableHook": "0x7556a0E61d577D921Cba8Fca0d7D6299d36E607E", "fallbackRoutingHook": "0xD1E267d2d7876e97E217BfE61c34AB50FEF52807", "interchainSecurityModule": "0xDEed16fe4b1c9b2a93483EDFf34C77A9b57D31Ff" + }, + "viction": { + "merkleRootMultisigIsmFactory": "0x2C1FAbEcd7bFBdEBF27CcdB67baADB38b6Df90fC", + "messageIdMultisigIsmFactory": "0x8b83fefd896fAa52057798f6426E9f0B080FCCcE", + "aggregationIsmFactory": "0x8F7454AC98228f3504Bb91eA3D8Adafe6406110A", + "aggregationHookFactory": "0xEb9FcFDC9EfDC17c1EC5E1dc085B98485da213D6", + "routingIsmFactory": "0x1052eF3419f26Bec74Ed7CEf4a4FA6812Bc09908", + "mailbox": "0x2f2aFaE1139Ce54feFC03593FeE8AB2aDF4a85A7", + "proxyAdmin": "0x0761b0827849abbf7b0cC09CE14e1C93D87f5004", + "validatorAnnounce": "0x2fa5F5C96419C222cDbCeC797D696e6cE428A7A9", + "interchainSecurityModule": "0xBD70Ea9D599a0FC8158B026797177773C3445730", + "merkleTreeHook": "0x149db7afD694722747035d5AEC7007ccb6F8f112", + "storageGasOracle": "0x19dc38aeae620380430C200a6E990D5Af5480117", + "interchainGasPaymaster": "0x0D63128D887159d63De29497dfa45AFc7C699AE4", + "protocolFee": "0xd83A4F747fE80Ed98839e05079B1B7Fe037b1638", + "testRecipient": "0x17E216fBb22dF4ef8A6640ae9Cb147C92710ac84", + "testTokenRecipient": "0xe042D1fbDf59828dd16b9649Ede7abFc856F7a6c" } } diff --git a/typescript/sdk/src/consts/multisigIsm.ts b/typescript/sdk/src/consts/multisigIsm.ts index ebc9516c8..fb507c693 100644 --- a/typescript/sdk/src/consts/multisigIsm.ts +++ b/typescript/sdk/src/consts/multisigIsm.ts @@ -295,4 +295,13 @@ export const defaultMultisigConfigs: ChainMap = { threshold: 1, validators: ['0xd4ce8fa138d4e083fc0e480cca0dbfa4f5f30bd5'], }, + + viction: { + threshold: 2, + validators: [ + '0x1f87c368f8e05a85ef9126d984a980a20930cb9c', + '0x4a2ebbe07cd546cfd2b213d41f2d7814f9386157', + '0x00271cf10759e4c6d2f8ca46183ab10d360474b4', + ], + }, }; diff --git a/typescript/sdk/src/core/HyperlaneCoreChecker.ts b/typescript/sdk/src/core/HyperlaneCoreChecker.ts index 8dc0545a7..108e6361e 100644 --- a/typescript/sdk/src/core/HyperlaneCoreChecker.ts +++ b/typescript/sdk/src/core/HyperlaneCoreChecker.ts @@ -150,15 +150,8 @@ export class HyperlaneCoreChecker extends HyperlaneAppChecker< ); } - await this.checkBytecode( - chain, - 'Mailbox proxy', - contracts.mailbox.address, - [ - BytecodeHash.TRANSPARENT_PROXY_BYTECODE_HASH, - BytecodeHash.OPT_TRANSPARENT_PROXY_BYTECODE_HASH, - ], - ); + await this.checkProxy(chain, 'Mailbox proxy', contracts.mailbox.address); + await this.checkBytecode( chain, 'ProxyAdmin', diff --git a/typescript/sdk/src/deploy/HyperlaneAppChecker.ts b/typescript/sdk/src/deploy/HyperlaneAppChecker.ts index f8d5418e0..3f703ef74 100644 --- a/typescript/sdk/src/deploy/HyperlaneAppChecker.ts +++ b/typescript/sdk/src/deploy/HyperlaneAppChecker.ts @@ -11,6 +11,7 @@ import { } from '@hyperlane-xyz/utils'; import { HyperlaneApp } from '../app/HyperlaneApp'; +import { BytecodeHash } from '../consts/bytecode'; import { filterOwnableContracts } from '../contracts/contracts'; import { MultiProvider } from '../providers/MultiProvider'; import { ChainMap, ChainName } from '../types'; @@ -186,6 +187,18 @@ export abstract class HyperlaneAppChecker< } } + protected async checkProxy( + chain: ChainName, + name: string, + address: string, + ): Promise { + return this.checkBytecode(chain, name, address, [ + BytecodeHash.TRANSPARENT_PROXY_BYTECODE_HASH, + BytecodeHash.TRANSPARENT_PROXY_4_9_3_BYTECODE_HASH, + BytecodeHash.OPT_TRANSPARENT_PROXY_BYTECODE_HASH, + ]); + } + async ownables(chain: ChainName): Promise<{ [key: string]: Ownable }> { const contracts = this.app.getContracts(chain); return filterOwnableContracts(contracts); diff --git a/typescript/sdk/src/gas/HyperlaneIgpChecker.ts b/typescript/sdk/src/gas/HyperlaneIgpChecker.ts index 27ce391c8..b6d1301f6 100644 --- a/typescript/sdk/src/gas/HyperlaneIgpChecker.ts +++ b/typescript/sdk/src/gas/HyperlaneIgpChecker.ts @@ -61,14 +61,10 @@ export class HyperlaneIgpChecker extends HyperlaneAppChecker< ), ); - await this.checkBytecode( + await this.checkProxy( chain, 'InterchainGasPaymaster proxy', contracts.interchainGasPaymaster.address, - [ - BytecodeHash.TRANSPARENT_PROXY_BYTECODE_HASH, - BytecodeHash.OPT_TRANSPARENT_PROXY_BYTECODE_HASH, - ], ); } diff --git a/typescript/sdk/src/metadata/ChainMetadataManager.ts b/typescript/sdk/src/metadata/ChainMetadataManager.ts index 97d5fbaed..714e9c468 100644 --- a/typescript/sdk/src/metadata/ChainMetadataManager.ts +++ b/typescript/sdk/src/metadata/ChainMetadataManager.ts @@ -14,7 +14,7 @@ import { import { ChainMetadata, getDomainId, - isValidChainMetadata, + safeParseChainMetadata, } from './chainMetadataTypes'; export interface ChainMetadataManagerOptions { @@ -55,8 +55,14 @@ export class ChainMetadataManager { * @throws if chain's name or domain/chain ID collide */ addChain(metadata: ChainMetadata): void { - if (!isValidChainMetadata(metadata)) - throw new Error(`Invalid chain metadata for ${metadata.name}`); + const parseResult = safeParseChainMetadata(metadata); + if (!parseResult.success) { + throw new Error( + `Invalid chain metadata for ${ + metadata.name + }: ${parseResult.error.format()}`, + ); + } // Ensure no two chains have overlapping names/domainIds/chainIds for (const chainMetadata of Object.values(this.metadata)) { const { name, chainId, domainId } = chainMetadata; diff --git a/typescript/sdk/src/metadata/chainMetadataTypes.ts b/typescript/sdk/src/metadata/chainMetadataTypes.ts index d8ee61642..b13cea034 100644 --- a/typescript/sdk/src/metadata/chainMetadataTypes.ts +++ b/typescript/sdk/src/metadata/chainMetadataTypes.ts @@ -2,7 +2,7 @@ * The types defined here are the source of truth for chain metadata. * ANY CHANGES HERE NEED TO BE REFLECTED IN HYPERLANE-BASE CONFIG PARSING. */ -import { z } from 'zod'; +import { SafeParseReturnType, z } from 'zod'; import { ProtocolType } from '@hyperlane-xyz/utils'; @@ -244,6 +244,12 @@ export type BlockExplorer = Exclude< undefined >[number]; +export function safeParseChainMetadata( + c: ChainMetadata, +): SafeParseReturnType { + return ChainMetadataSchema.safeParse(c); +} + export function isValidChainMetadata(c: ChainMetadata): boolean { return ChainMetadataSchema.safeParse(c).success; } diff --git a/typescript/sdk/src/token/deploy.ts b/typescript/sdk/src/token/deploy.ts index 23ac7db35..df32fcb45 100644 --- a/typescript/sdk/src/token/deploy.ts +++ b/typescript/sdk/src/token/deploy.ts @@ -183,10 +183,17 @@ export class HypERC20Deployer extends GasRouterDeployer< config.mailbox, ]); - await this.multiProvider.handleTx( - chain, - router.initialize(config.totalSupply, config.name, config.symbol), - ); + try { + await this.multiProvider.handleTx( + chain, + router.initialize(config.totalSupply, config.name, config.symbol), + ); + } catch (e: any) { + if (!e.message.includes('already initialized')) { + throw e; + } + this.logger(`${name} already initialized`); + } return router; }