Skip to content

Commit

Permalink
feat(infra): added the getEthereumFormUSDTWarpConfig func (#5056)
Browse files Browse the repository at this point in the history
### Description

Adds the warp route config getter for the USDT route on Form network

associated registry PR
hyperlane-xyz/hyperlane-registry#449

### Drive-by changes

- NO

### Backward compatibility

 -YES

### Testing

- Manual

---------

Co-authored-by: nambrot <[email protected]>
  • Loading branch information
xeno097 and nambrot authored Jan 14, 2025
1 parent 68d4dce commit 9574b1b
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .registryrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9d7868fa55b97d610c9c1916d22d71d3e67b5aa8
195c073c3c34b234c8d0aed2a16962a2d3945354
Original file line number Diff line number Diff line change
@@ -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<Address> = {
ethereum: '0xec5ad23e29203301B2C1a765718Cc1de7A8d3FbF',
form: '0x41B624412B529409A437f08Ef80bCabE81053650',
};

export const getEthereumFormUSDCWarpConfig = async (
routerConfig: ChainMap<RouterConfigWithoutOwner>,
): Promise<ChainMap<HypTokenRouterConfig>> => {
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,
};
};
Original file line number Diff line number Diff line change
@@ -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<Address> = {
ethereum: '0xec5ad23e29203301B2C1a765718Cc1de7A8d3FbF',
form: '0x41B624412B529409A437f08Ef80bCabE81053650',
};

export const getEthereumFormUSDTWarpConfig = async (
routerConfig: ChainMap<RouterConfigWithoutOwner>,
): Promise<ChainMap<HypTokenRouterConfig>> => {
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,
};
};
2 changes: 2 additions & 0 deletions typescript/infra/config/environments/mainnet3/warp/warpIds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
4 changes: 4 additions & 0 deletions typescript/infra/config/warp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -100,6 +102,8 @@ export const warpConfigGetterMap: Record<string, WarpConfigGetter> = {
[WarpRouteIds.AppchainBaseUSDC]: getAppChainBaseUSDCWarpConfig,
[WarpRouteIds.BobaBsquaredSwellUBTC]: getBobaBsquaredSwellUBTCWarpConfig,
[WarpRouteIds.EthereumZircuitRe7LRT]: getEthereumZircuitRe7LRTWarpConfig,
[WarpRouteIds.EthereumFormUSDT]: getEthereumFormUSDTWarpConfig,
[WarpRouteIds.EthereumFormUSDC]: getEthereumFormUSDCWarpConfig,
[WarpRouteIds.EthereumSuperseedUSDT]: getEthereumSuperseedUSDTConfig,
[WarpRouteIds.OptimismSuperseedOP]: getOptimismSuperseedOPConfig,
[WarpRouteIds.EthereumZircuitRstETH]: getEthereumZircuitRstETHWarpConfig,
Expand Down
2 changes: 1 addition & 1 deletion typescript/infra/src/warp/helm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 9574b1b

Please sign in to comment.