From 9574b1b4983833b3f7912a4c76363d0c3e5317f1 Mon Sep 17 00:00:00 2001 From: xeno097 Date: Tue, 14 Jan 2025 14:54:44 -0400 Subject: [PATCH] feat(infra): added the getEthereumFormUSDTWarpConfig func (#5056) ### Description Adds the warp route config getter for the USDT route on Form network associated registry PR https://github.com/hyperlane-xyz/hyperlane-registry/pull/449 ### Drive-by changes - NO ### Backward compatibility -YES ### Testing - Manual --------- Co-authored-by: nambrot --- .registryrc | 2 +- .../getEthereumFormUSDCWarpConfig.ts | 43 +++++++++++++++++++ .../getEthereumFormUSDTWarpConfig.ts | 40 +++++++++++++++++ .../environments/mainnet3/warp/warpIds.ts | 2 + typescript/infra/config/warp.ts | 4 ++ typescript/infra/src/warp/helm.ts | 2 +- 6 files changed, 91 insertions(+), 2 deletions(-) create mode 100644 typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumFormUSDCWarpConfig.ts create mode 100644 typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumFormUSDTWarpConfig.ts diff --git a/.registryrc b/.registryrc index 41ee7283ce..001391d9ac 100644 --- a/.registryrc +++ b/.registryrc @@ -1 +1 @@ -9d7868fa55b97d610c9c1916d22d71d3e67b5aa8 +195c073c3c34b234c8d0aed2a16962a2d3945354 diff --git a/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumFormUSDCWarpConfig.ts b/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumFormUSDCWarpConfig.ts new file mode 100644 index 0000000000..2118a3860f --- /dev/null +++ b/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumFormUSDCWarpConfig.ts @@ -0,0 +1,43 @@ +import { ethers } from 'ethers'; + +import { ChainMap, HypTokenRouterConfig, TokenType } from '@hyperlane-xyz/sdk'; +import { Address } from '@hyperlane-xyz/utils'; + +import { getOwnerConfigForAddress } from '../../../../../src/config/environment.js'; +import { + RouterConfigWithoutOwner, + tokens, +} from '../../../../../src/config/warp.js'; + +// Safes from the FORM team +const safeOwners: ChainMap
= { + ethereum: '0xec5ad23e29203301B2C1a765718Cc1de7A8d3FbF', + form: '0x41B624412B529409A437f08Ef80bCabE81053650', +}; + +export const getEthereumFormUSDCWarpConfig = async ( + routerConfig: ChainMap, +): Promise> => { + const ethereum: HypTokenRouterConfig = { + ...routerConfig.ethereum, + ...getOwnerConfigForAddress(safeOwners.ethereum), + type: TokenType.collateral, + token: tokens.ethereum.USDC, + interchainSecurityModule: ethers.constants.AddressZero, + }; + + // FiatTokenProxy 0xFBf489bb4783D4B1B2e7D07ba39873Fb8068507D + // MasterMinter 0x9Dec8Dfafcce2d45E8FF8C7792DB1D704AB1dc9D + const form: HypTokenRouterConfig = { + ...routerConfig.form, + ...getOwnerConfigForAddress(safeOwners.form), + type: TokenType.collateralFiat, + token: '0xFBf489bb4783D4B1B2e7D07ba39873Fb8068507D', + interchainSecurityModule: ethers.constants.AddressZero, + }; + + return { + ethereum, + form, + }; +}; diff --git a/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumFormUSDTWarpConfig.ts b/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumFormUSDTWarpConfig.ts new file mode 100644 index 0000000000..aa8bd4013a --- /dev/null +++ b/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumFormUSDTWarpConfig.ts @@ -0,0 +1,40 @@ +import { ethers } from 'ethers'; + +import { ChainMap, HypTokenRouterConfig, TokenType } from '@hyperlane-xyz/sdk'; +import { Address } from '@hyperlane-xyz/utils'; + +import { getOwnerConfigForAddress } from '../../../../../src/config/environment.js'; +import { + RouterConfigWithoutOwner, + tokens, +} from '../../../../../src/config/warp.js'; + +// Safes from the FORM team +const safeOwners: ChainMap
= { + ethereum: '0xec5ad23e29203301B2C1a765718Cc1de7A8d3FbF', + form: '0x41B624412B529409A437f08Ef80bCabE81053650', +}; + +export const getEthereumFormUSDTWarpConfig = async ( + routerConfig: ChainMap, +): Promise> => { + const ethereum: HypTokenRouterConfig = { + ...routerConfig.ethereum, + ...getOwnerConfigForAddress(safeOwners.ethereum), + type: TokenType.collateral, + token: tokens.ethereum.USDT, + interchainSecurityModule: ethers.constants.AddressZero, + }; + + const form: HypTokenRouterConfig = { + ...routerConfig.form, + ...getOwnerConfigForAddress(safeOwners.form), + type: TokenType.synthetic, + interchainSecurityModule: ethers.constants.AddressZero, + }; + + return { + ethereum, + form, + }; +}; diff --git a/typescript/infra/config/environments/mainnet3/warp/warpIds.ts b/typescript/infra/config/environments/mainnet3/warp/warpIds.ts index 97655e7c6b..3c86014b4c 100644 --- a/typescript/infra/config/environments/mainnet3/warp/warpIds.ts +++ b/typescript/infra/config/environments/mainnet3/warp/warpIds.ts @@ -43,6 +43,8 @@ export enum WarpRouteIds { ArbitrumBaseBlastBscEthereumGnosisLiskMantleModeOptimismPolygonScrollZeroNetworkZoraMainnet = 'ETH/arbitrum-base-blast-bsc-ethereum-gnosis-lisk-mantle-mode-optimism-polygon-scroll-zeronetwork-zoramainnet', AppchainBaseUSDC = 'USDC/appchain-base', BobaBsquaredSwellUBTC = 'UBTC/boba-bsquared-swell', + EthereumFormUSDT = 'USDT/ethereum-form', + EthereumFormUSDC = 'USDC/ethereum-form', EthereumSuperseedUSDT = 'USDT/ethereum-superseed', OptimismSuperseedOP = 'OP/optimism-superseed', EthereumZircuitRstETH = 'rstETH/ethereum-zircuit', diff --git a/typescript/infra/config/warp.ts b/typescript/infra/config/warp.ts index e15ec37e71..f01ea7edc5 100644 --- a/typescript/infra/config/warp.ts +++ b/typescript/infra/config/warp.ts @@ -33,6 +33,8 @@ import { getEclipseStrideTiaWarpConfig } from './environments/mainnet3/warp/conf import { getEclipseStrideStTiaWarpConfig } from './environments/mainnet3/warp/configGetters/getEclipseStrideTIAWarpConfig.js'; import { getEthereumBscLUMIAWarpConfig } from './environments/mainnet3/warp/configGetters/getEthereumBscLumiaLUMIAWarpConfig.js'; import { getEthereumFlowCbBTCWarpConfig } from './environments/mainnet3/warp/configGetters/getEthereumFlowCbBTCWarpConfig.js'; +import { getEthereumFormUSDCWarpConfig } from './environments/mainnet3/warp/configGetters/getEthereumFormUSDCWarpConfig.js'; +import { getEthereumFormUSDTWarpConfig } from './environments/mainnet3/warp/configGetters/getEthereumFormUSDTWarpConfig.js'; import { getEthereumFormWBTCWarpConfig } from './environments/mainnet3/warp/configGetters/getEthereumFormWBTCWarpConfig.js'; import { getEthereumFormWSTETHWarpConfig } from './environments/mainnet3/warp/configGetters/getEthereumFormWSTETHWarpConfig.js'; import { getEthereumInevmUSDCWarpConfig } from './environments/mainnet3/warp/configGetters/getEthereumInevmUSDCWarpConfig.js'; @@ -100,6 +102,8 @@ export const warpConfigGetterMap: Record = { [WarpRouteIds.AppchainBaseUSDC]: getAppChainBaseUSDCWarpConfig, [WarpRouteIds.BobaBsquaredSwellUBTC]: getBobaBsquaredSwellUBTCWarpConfig, [WarpRouteIds.EthereumZircuitRe7LRT]: getEthereumZircuitRe7LRTWarpConfig, + [WarpRouteIds.EthereumFormUSDT]: getEthereumFormUSDTWarpConfig, + [WarpRouteIds.EthereumFormUSDC]: getEthereumFormUSDCWarpConfig, [WarpRouteIds.EthereumSuperseedUSDT]: getEthereumSuperseedUSDTConfig, [WarpRouteIds.OptimismSuperseedOP]: getOptimismSuperseedOPConfig, [WarpRouteIds.EthereumZircuitRstETH]: getEthereumZircuitRstETHWarpConfig, diff --git a/typescript/infra/src/warp/helm.ts b/typescript/infra/src/warp/helm.ts index 830e8f3e81..42d3b957c2 100644 --- a/typescript/infra/src/warp/helm.ts +++ b/typescript/infra/src/warp/helm.ts @@ -28,7 +28,7 @@ export class WarpRouteMonitorHelmManager extends HelmManager { return { image: { repository: 'gcr.io/abacus-labs-dev/hyperlane-monorepo', - tag: '98f8c26-20250110-182641', + tag: '702c800-20250113-210127', }, warpRouteId: this.warpRouteId, fullnameOverride: this.helmReleaseName,