Skip to content

Commit

Permalink
feat(infra): added superseed USDT and OP config getters (#5130)
Browse files Browse the repository at this point in the history
### Description

Adds config getters for OP and USDT routes on supersede

Related registry PRs:
- hyperlane-xyz/hyperlane-registry#473
- hyperlane-xyz/hyperlane-registry#474

### Drive-by changes

- NO

### Related issues

- 

### Backward compatibility

- YES

### Testing

- CLI
- UI
  • Loading branch information
xeno097 authored Jan 10, 2025
1 parent 79c61c8 commit 5765587
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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<Address> = {
ethereum: '0x11BEBBf509248735203BAAAe90c1a27EEE70D567',
superseed: '0x6652010BaCE855DF870D427daA6141c313994929',
optimism: '0x0D493D7E51212bbBF0F1ca4bcfA1E5514C7fEF10',
};

export const getEthereumSuperseedUSDTConfig = async (
routerConfig: ChainMap<RouterConfigWithoutOwner>,
): Promise<ChainMap<HypTokenRouterConfig>> => {
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<RouterConfigWithoutOwner>,
): Promise<ChainMap<HypTokenRouterConfig>> => {
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,
},
};
};
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 @@ -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',
Expand Down
6 changes: 6 additions & 0 deletions typescript/infra/config/warp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
Expand Down Expand Up @@ -93,6 +97,8 @@ export const warpConfigGetterMap: Record<string, WarpConfigGetter> = {
[WarpRouteIds.AppchainBaseUSDC]: getAppChainBaseUSDCWarpConfig,
[WarpRouteIds.BobaBsquaredSwellUBTC]: getBobaBsquaredSwellUBTCWarpConfig,
[WarpRouteIds.EthereumZircuitRe7LRT]: getEthereumZircuitRe7LRTWarpConfig,
[WarpRouteIds.EthereumSuperseedUSDT]: getEthereumSuperseedUSDTConfig,
[WarpRouteIds.OptimismSuperseedOP]: getOptimismSuperseedOPConfig,
[WarpRouteIds.EthereumZircuitRstETH]: getEthereumZircuitRstETHWarpConfig,
[WarpRouteIds.EthereumFormWBTC]: getEthereumFormWBTCWarpConfig,
[WarpRouteIds.EthereumFormWSTETH]: getEthereumFormWSTETHWarpConfig,
Expand Down
1 change: 1 addition & 0 deletions typescript/infra/src/config/warp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export const tokens: ChainMap<Record<string, Address>> = {
},
optimism: {
USDC: '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85',
OP: '0x4200000000000000000000000000000000000042',
},
gnosis: {
WETH: '0x6A023CCd1ff6F2045C3309768eAd9E68F978f6e1',
Expand Down

0 comments on commit 5765587

Please sign in to comment.