From 66d9b2907dd9308e630292876c1c6ad985cf692c Mon Sep 17 00:00:00 2001 From: Yorke Rhodes Date: Tue, 13 Feb 2024 16:39:58 -0500 Subject: [PATCH] Deploy stable warp routes to inEVM (#3233) ### Description Deploy USDC and USDT from ethereum to inEVM ### Related issues - Fixes https://github.com/hyperlane-xyz/issues/issues/1010 ### Backward compatibility Yes ### Testing - [x] Manul warp UI testing --------- Co-authored-by: Daniel Savu <23065004+daniel-savu@users.noreply.github.com> Co-authored-by: J M Rossy --- .../environments/mainnet3/warp/addresses.json | 5 +++- .../warp/ethereumUSDC-inevm-deployments.yaml | 22 ++++++++++++++++ .../warp/ethereumUSDT-inevm-deployments.yaml | 22 ++++++++++++++++ .../mainnet3/warp/inevm-USDC-addresses.json | 8 ++++++ .../mainnet3/warp/inevm-USDT-addresses.json | 8 ++++++ .../mainnet3/warp/verification.json | 26 +++++++++++++++++++ typescript/infra/scripts/deploy.ts | 26 ++++++++++++++++++- .../warp-routes/deploy-warp-monitor.ts | 2 +- typescript/infra/scripts/warp-routes/helm.ts | 4 +-- 9 files changed, 118 insertions(+), 5 deletions(-) create mode 100644 typescript/infra/config/environments/mainnet3/warp/ethereumUSDC-inevm-deployments.yaml create mode 100644 typescript/infra/config/environments/mainnet3/warp/ethereumUSDT-inevm-deployments.yaml create mode 100644 typescript/infra/config/environments/mainnet3/warp/inevm-USDC-addresses.json create mode 100644 typescript/infra/config/environments/mainnet3/warp/inevm-USDT-addresses.json diff --git a/typescript/infra/config/environments/mainnet3/warp/addresses.json b/typescript/infra/config/environments/mainnet3/warp/addresses.json index a84f3a7094..2e38c664a0 100644 --- a/typescript/infra/config/environments/mainnet3/warp/addresses.json +++ b/typescript/infra/config/environments/mainnet3/warp/addresses.json @@ -1,5 +1,8 @@ { "inevm": { - "router": "0x26f32245fCF5Ad53159E875d5Cae62aEcf19c2d4" + "HypERC20": "0x8358D8291e3bEDb04804975eEa0fe9fe0fAfB147" + }, + "ethereum": { + "HypERC20Collateral": "0xED56728fb977b0bBdacf65bCdD5e17Bb7e84504f" } } diff --git a/typescript/infra/config/environments/mainnet3/warp/ethereumUSDC-inevm-deployments.yaml b/typescript/infra/config/environments/mainnet3/warp/ethereumUSDC-inevm-deployments.yaml new file mode 100644 index 0000000000..0d8ff77557 --- /dev/null +++ b/typescript/infra/config/environments/mainnet3/warp/ethereumUSDC-inevm-deployments.yaml @@ -0,0 +1,22 @@ +# Configs and artifacts for the deployment of Hyperlane Warp Routes +# Between injective and inevm +description: Hyperlane Warp Route artifacts +timestamp: '2024-02-06T16:00:00.000Z' +deployer: Abacus Works (Hyperlane) +data: + config: + ethereum: + protocolType: ethereum + type: collateral + hypAddress: '0xED56728fb977b0bBdacf65bCdD5e17Bb7e84504f' + tokenAddress: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' # USDC + name: USDC + symbol: USDC + decimals: 6 + inevm: + protocolType: ethereum + type: synthetic + hypAddress: '0x8358D8291e3bEDb04804975eEa0fe9fe0fAfB147' + name: USDC + symbol: USDC + decimals: 6 diff --git a/typescript/infra/config/environments/mainnet3/warp/ethereumUSDT-inevm-deployments.yaml b/typescript/infra/config/environments/mainnet3/warp/ethereumUSDT-inevm-deployments.yaml new file mode 100644 index 0000000000..25ec599f73 --- /dev/null +++ b/typescript/infra/config/environments/mainnet3/warp/ethereumUSDT-inevm-deployments.yaml @@ -0,0 +1,22 @@ +# Configs and artifacts for the deployment of Hyperlane Warp Routes +# Between injective and inevm +description: Hyperlane Warp Route artifacts +timestamp: '2024-02-06T16:00:00.000Z' +deployer: Abacus Works (Hyperlane) +data: + config: + ethereum: + protocolType: ethereum + type: collateral + hypAddress: '0xab852e67bf03E74C89aF67C4BA97dd1088D3dA19' + tokenAddress: '0xdac17f958d2ee523a2206206994597c13d831ec7' # USDT + name: Tether USD + symbol: USDT + decimals: 6 + inevm: + protocolType: ethereum + type: synthetic + hypAddress: '0x97423A68BAe94b5De52d767a17aBCc54c157c0E5' + name: Tether USD + symbol: USDT + decimals: 6 diff --git a/typescript/infra/config/environments/mainnet3/warp/inevm-USDC-addresses.json b/typescript/infra/config/environments/mainnet3/warp/inevm-USDC-addresses.json new file mode 100644 index 0000000000..2e38c664a0 --- /dev/null +++ b/typescript/infra/config/environments/mainnet3/warp/inevm-USDC-addresses.json @@ -0,0 +1,8 @@ +{ + "inevm": { + "HypERC20": "0x8358D8291e3bEDb04804975eEa0fe9fe0fAfB147" + }, + "ethereum": { + "HypERC20Collateral": "0xED56728fb977b0bBdacf65bCdD5e17Bb7e84504f" + } +} diff --git a/typescript/infra/config/environments/mainnet3/warp/inevm-USDT-addresses.json b/typescript/infra/config/environments/mainnet3/warp/inevm-USDT-addresses.json new file mode 100644 index 0000000000..b9e1b65223 --- /dev/null +++ b/typescript/infra/config/environments/mainnet3/warp/inevm-USDT-addresses.json @@ -0,0 +1,8 @@ +{ + "inevm": { + "HypERC20": "0x97423A68BAe94b5De52d767a17aBCc54c157c0E5" + }, + "ethereum": { + "HypERC20Collateral": "0xab852e67bf03E74C89aF67C4BA97dd1088D3dA19" + } +} diff --git a/typescript/infra/config/environments/mainnet3/warp/verification.json b/typescript/infra/config/environments/mainnet3/warp/verification.json index c3f3dfc0f5..a48214e7e4 100644 --- a/typescript/infra/config/environments/mainnet3/warp/verification.json +++ b/typescript/infra/config/environments/mainnet3/warp/verification.json @@ -45,6 +45,32 @@ "address": "0x4221a16A01F61c2b38A03C52d828a7041f6AAA49", "constructorArguments": "000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000c005dc82818d67af737725bd4bf75435d065d239", "isProxy": false + }, + { + "name": "HypERC20Collateral", + "address": "0xab852e67bf03E74C89aF67C4BA97dd1088D3dA19", + "constructorArguments": "000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000c005dc82818d67af737725bd4bf75435d065d239", + "isProxy": false + }, + { + "name": "HypERC20Collateral", + "address": "0xED56728fb977b0bBdacf65bCdD5e17Bb7e84504f", + "constructorArguments": "000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000c005dc82818d67af737725bd4bf75435d065d239", + "isProxy": false + } + ], + "inevm": [ + { + "name": "HypERC20", + "address": "0x97423A68BAe94b5De52d767a17aBCc54c157c0E5", + "constructorArguments": "00000000000000000000000000000000000000000000000000000000000000060000000000000000000000002f2afae1139ce54fefc03593fee8ab2adf4a85a7", + "isProxy": false + }, + { + "name": "HypERC20", + "address": "0x8358D8291e3bEDb04804975eEa0fe9fe0fAfB147", + "constructorArguments": "00000000000000000000000000000000000000000000000000000000000000060000000000000000000000002f2afae1139ce54fefc03593fee8ab2adf4a85a7", + "isProxy": false } ] } diff --git a/typescript/infra/scripts/deploy.ts b/typescript/infra/scripts/deploy.ts index 1fdf1ff9fd..61616e2af5 100644 --- a/typescript/infra/scripts/deploy.ts +++ b/typescript/infra/scripts/deploy.ts @@ -4,6 +4,7 @@ import { prompt } from 'prompts'; import { HelloWorldDeployer } from '@hyperlane-xyz/helloworld'; import { ChainMap, + HypERC20Deployer, HyperlaneCore, HyperlaneCoreDeployer, HyperlaneDeployer, @@ -13,10 +14,12 @@ import { InterchainAccountDeployer, InterchainQueryDeployer, LiquidityLayerDeployer, + TokenType, } from '@hyperlane-xyz/sdk'; import { objMap } from '@hyperlane-xyz/utils'; import { Contexts } from '../config/contexts'; +import { aggregationIsm } from '../config/routingIsm'; import { deployEnvToSdkEnv } from '../src/config/environment'; import { deployWithArtifacts } from '../src/deployment/deploy'; import { TestQuerySenderDeployer } from '../src/deployment/testcontracts/testquerysender'; @@ -71,7 +74,28 @@ async function main() { ); deployer = new HyperlaneCoreDeployer(multiProvider, ismFactory); } else if (module === Modules.WARP) { - throw new Error('Warp is not supported. Use CLI instead.'); + const core = HyperlaneCore.fromEnvironment(env, multiProvider); + const ismFactory = HyperlaneIsmFactory.fromAddressesMap( + getAddresses(environment, Modules.PROXY_FACTORY), + multiProvider, + ); + const routerConfig = core.getRouterConfig(envConfig.owners); + const inevm = { + ...routerConfig.inevm, + type: TokenType.synthetic, + }; + const ethereum = { + ...routerConfig.ethereum, + type: TokenType.collateral, + token: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', + hook: '0xb87AC8EA4533AE017604E44470F7c1E550AC6F10', // aggregation of IGP and Merkle, arbitrary config not supported for now + interchainSecurityModule: aggregationIsm('inevm', Contexts.Hyperlane), + }; + config = { + inevm, + ethereum, + }; + deployer = new HypERC20Deployer(multiProvider, ismFactory); } else if (module === Modules.INTERCHAIN_GAS_PAYMASTER) { config = envConfig.igp; deployer = new HyperlaneIgpDeployer(multiProvider); diff --git a/typescript/infra/scripts/warp-routes/deploy-warp-monitor.ts b/typescript/infra/scripts/warp-routes/deploy-warp-monitor.ts index 4d903b2c38..8c765ba63b 100644 --- a/typescript/infra/scripts/warp-routes/deploy-warp-monitor.ts +++ b/typescript/infra/scripts/warp-routes/deploy-warp-monitor.ts @@ -9,7 +9,7 @@ async function main() { .alias('f', 'filePath') .describe( 'filePath', - 'indicate the filepatch to the warp route yaml file relative to typescript/infra', + 'indicate the filepath to the warp route yaml file relative to the monorepo root', ) .demandOption('filePath') .string('filePath') diff --git a/typescript/infra/scripts/warp-routes/helm.ts b/typescript/infra/scripts/warp-routes/helm.ts index 8a28f85f6e..9dc9e4c242 100644 --- a/typescript/infra/scripts/warp-routes/helm.ts +++ b/typescript/infra/scripts/warp-routes/helm.ts @@ -23,14 +23,14 @@ export async function runWarpRouteHelmCommand( function getHelmReleaseName(route: string): string { const match = route.match(/\/([^/]+)-deployments\.yaml$/); const name = match ? match[1] : route; - return `hyperlane-warp-route-${name}`; + return `hyperlane-warp-route-${name.toLowerCase()}`; // helm requires lower case release names } function getWarpRoutesHelmValues(configFilePath: string) { const values = { image: { repository: 'gcr.io/abacus-labs-dev/hyperlane-monorepo', - tag: 'a84e439-20240131-224743', + tag: '4a8f20f-20240207-232324', }, configFilePath: configFilePath, };