From dc009ea205d3a9ab22e530bf9e5ca36935b382dd Mon Sep 17 00:00:00 2001 From: xeno097 Date: Fri, 10 Jan 2025 16:35:56 -0400 Subject: [PATCH] feat(infra): added superseed USDT and OP config getters (#5130) ### Description Adds config getters for OP and USDT routes on supersede Related registry PRs: - https://github.com/hyperlane-xyz/hyperlane-registry/pull/473 - https://github.com/hyperlane-xyz/hyperlane-registry/pull/474 ### Drive-by changes - NO ### Related issues - ### Backward compatibility - YES ### Testing - CLI - UI --- .../configGetters/getSuperseedWarpConfigs.ts | 55 +++++++++++++++++++ .../environments/mainnet3/warp/warpIds.ts | 2 + typescript/infra/config/warp.ts | 6 ++ typescript/infra/src/config/warp.ts | 1 + 4 files changed, 64 insertions(+) create mode 100644 typescript/infra/config/environments/mainnet3/warp/configGetters/getSuperseedWarpConfigs.ts diff --git a/typescript/infra/config/environments/mainnet3/warp/configGetters/getSuperseedWarpConfigs.ts b/typescript/infra/config/environments/mainnet3/warp/configGetters/getSuperseedWarpConfigs.ts new file mode 100644 index 0000000000..e10d681579 --- /dev/null +++ b/typescript/infra/config/environments/mainnet3/warp/configGetters/getSuperseedWarpConfigs.ts @@ -0,0 +1,55 @@ +import { ethers } from 'ethers'; + +import { ChainMap, HypTokenRouterConfig, TokenType } from '@hyperlane-xyz/sdk'; +import { Address } from '@hyperlane-xyz/utils'; + +import { + RouterConfigWithoutOwner, + tokens, +} from '../../../../../src/config/warp.js'; + +const safeOwners: ChainMap
= { + ethereum: '0x11BEBBf509248735203BAAAe90c1a27EEE70D567', + superseed: '0x6652010BaCE855DF870D427daA6141c313994929', + optimism: '0x0D493D7E51212bbBF0F1ca4bcfA1E5514C7fEF10', +}; + +export const getEthereumSuperseedUSDTConfig = async ( + routerConfig: ChainMap, +): Promise> => { + return { + ethereum: { + ...routerConfig.ethereum, + owner: safeOwners.ethereum, + type: TokenType.collateral, + token: tokens.ethereum.USDT, + interchainSecurityModule: ethers.constants.AddressZero, + }, + superseed: { + ...routerConfig.superseed, + owner: safeOwners.superseed, + type: TokenType.synthetic, + interchainSecurityModule: ethers.constants.AddressZero, + }, + }; +}; + +export const getOptimismSuperseedOPConfig = async ( + routerConfig: ChainMap, +): Promise> => { + return { + optimism: { + ...routerConfig.optimism, + owner: safeOwners.optimism, + type: TokenType.collateral, + token: tokens.optimism.OP, + interchainSecurityModule: ethers.constants.AddressZero, + }, + superseed: { + ...routerConfig.superseed, + owner: safeOwners.superseed, + type: TokenType.synthetic, + interchainSecurityModule: ethers.constants.AddressZero, + }, + }; +}; diff --git a/typescript/infra/config/environments/mainnet3/warp/warpIds.ts b/typescript/infra/config/environments/mainnet3/warp/warpIds.ts index 32db67821f..780ebc079c 100644 --- a/typescript/infra/config/environments/mainnet3/warp/warpIds.ts +++ b/typescript/infra/config/environments/mainnet3/warp/warpIds.ts @@ -42,6 +42,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', + EthereumSuperseedUSDT = 'USDT/ethereum-superseed', + OptimismSuperseedOP = 'OP/optimism-superseed', EthereumZircuitRstETH = 'rstETH/ethereum-zircuit', EthereumFormWBTC = 'WBTC/ethereum-form', EthereumFormWSTETH = 'WSTETH/ethereum-form', diff --git a/typescript/infra/config/warp.ts b/typescript/infra/config/warp.ts index 75da6ba959..5318a9ca2b 100644 --- a/typescript/infra/config/warp.ts +++ b/typescript/infra/config/warp.ts @@ -48,6 +48,10 @@ import { getInevmInjectiveINJWarpConfig } from './environments/mainnet3/warp/con import { getMantapacificNeutronTiaWarpConfig } from './environments/mainnet3/warp/configGetters/getMantapacificNeutronTiaWarpConfig.js'; import { getRenzoEZETHWarpConfig } from './environments/mainnet3/warp/configGetters/getRenzoEZETHWarpConfig.js'; import { getRenzoPZETHWarpConfig } from './environments/mainnet3/warp/configGetters/getRenzoPZETHWarpConfig.js'; +import { + getEthereumSuperseedUSDTConfig, + getOptimismSuperseedOPConfig, +} from './environments/mainnet3/warp/configGetters/getSuperseedWarpConfigs.js'; import { WarpRouteIds } from './environments/mainnet3/warp/warpIds.js'; type WarpConfigGetter = ( @@ -93,6 +97,8 @@ export const warpConfigGetterMap: Record = { [WarpRouteIds.AppchainBaseUSDC]: getAppChainBaseUSDCWarpConfig, [WarpRouteIds.BobaBsquaredSwellUBTC]: getBobaBsquaredSwellUBTCWarpConfig, [WarpRouteIds.EthereumZircuitRe7LRT]: getEthereumZircuitRe7LRTWarpConfig, + [WarpRouteIds.EthereumSuperseedUSDT]: getEthereumSuperseedUSDTConfig, + [WarpRouteIds.OptimismSuperseedOP]: getOptimismSuperseedOPConfig, [WarpRouteIds.EthereumZircuitRstETH]: getEthereumZircuitRstETHWarpConfig, [WarpRouteIds.EthereumFormWBTC]: getEthereumFormWBTCWarpConfig, [WarpRouteIds.EthereumFormWSTETH]: getEthereumFormWSTETHWarpConfig, diff --git a/typescript/infra/src/config/warp.ts b/typescript/infra/src/config/warp.ts index e3a04dda95..48e3425701 100644 --- a/typescript/infra/src/config/warp.ts +++ b/typescript/infra/src/config/warp.ts @@ -54,6 +54,7 @@ export const tokens: ChainMap> = { }, optimism: { USDC: '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85', + OP: '0x4200000000000000000000000000000000000042', }, gnosis: { WETH: '0x6A023CCd1ff6F2045C3309768eAd9E68F978f6e1',