Skip to content

Commit

Permalink
feat: Add Superseed warp route config (#5122)
Browse files Browse the repository at this point in the history
### Description

Includes the warp route config for SuperSeed FiatToken warp routes

### Drive-by changes

- Add dummy soon owner
- Indicate errors during warp config parsing
  • Loading branch information
nambrot authored Jan 23, 2025
1 parent e4c9c7d commit 754c1c9
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import { ethers } from 'ethers';

import { ChainMap, HypTokenRouterConfig, TokenType } from '@hyperlane-xyz/sdk';

import {
RouterConfigWithoutOwner,
tokens,
} from '../../../../../src/config/warp.js';

const owners = {
ethereum: '0xa7eccdb9be08178f896c26b7bbd8c3d4e844d9ba',
superseed: '0xa7eccdb9be08178f896c26b7bbd8c3d4e844d9ba',
};

const ISM_CONFIG = ethers.constants.AddressZero; // Default ISM

export const getEthereumSuperseedCBBTCWarpConfig = async (
routerConfig: ChainMap<RouterConfigWithoutOwner>,
): Promise<ChainMap<HypTokenRouterConfig>> => {
const ethereum: HypTokenRouterConfig = {
...routerConfig.ethereum,
owner: owners.ethereum,
type: TokenType.collateral,
token: tokens.ethereum.cbBTC,
interchainSecurityModule: ISM_CONFIG,
};

const superseed: HypTokenRouterConfig = {
...routerConfig.superseed,
owner: owners.superseed,
type: TokenType.collateralFiat,
token: '0x6f36dbd829de9b7e077db8a35b480d4329ceb331',
interchainSecurityModule: ISM_CONFIG,
};

return {
ethereum,
superseed,
};
};

export const getEthereumSuperseedUSDCWarpConfig = async (
routerConfig: ChainMap<RouterConfigWithoutOwner>,
): Promise<ChainMap<HypTokenRouterConfig>> => {
const ethereum: HypTokenRouterConfig = {
...routerConfig.ethereum,
owner: owners.ethereum,
type: TokenType.collateral,
token: tokens.ethereum.USDC,
interchainSecurityModule: ISM_CONFIG,
};

const superseed: HypTokenRouterConfig = {
...routerConfig.superseed,
owner: owners.superseed,
type: TokenType.collateralFiat,
token: '0xc316c8252b5f2176d0135ebb0999e99296998f2e',
interchainSecurityModule: ISM_CONFIG,
};

return {
ethereum,
superseed,
};
};
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 @@ -47,6 +47,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',
EthereumSuperseedCBBTC = 'CBBTC/ethereum-superseed',
EthereumSuperseedUSDC = 'USDC/ethereum-superseed',
EthereumFormUSDT = 'USDT/ethereum-form',
EthereumFormUSDC = 'USDC/ethereum-form',
EthereumSuperseedUSDT = 'USDT/ethereum-superseed',
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 @@ -50,6 +50,10 @@ import { getEthereumInevmUSDTWarpConfig } from './environments/mainnet3/warp/con
import { getEthereumInkUSDCConfig } from './environments/mainnet3/warp/configGetters/getEthereumInkUSDCWarpConfig.js';
import { getEthereumSeiFastUSDWarpConfig } from './environments/mainnet3/warp/configGetters/getEthereumSeiFastUSDWarpConfig.js';
import { getEthereumSeiPumpBTCWarpConfig } from './environments/mainnet3/warp/configGetters/getEthereumSeiPumpBTCWarpConfig.js';
import {
getEthereumSuperseedCBBTCWarpConfig,
getEthereumSuperseedUSDCWarpConfig,
} from './environments/mainnet3/warp/configGetters/getEthereumSuperseedWarpConfig.js';
import { getEthereumVictionETHWarpConfig } from './environments/mainnet3/warp/configGetters/getEthereumVictionETHWarpConfig.js';
import { getEthereumVictionUSDCWarpConfig } from './environments/mainnet3/warp/configGetters/getEthereumVictionUSDCWarpConfig.js';
import { getEthereumVictionUSDTWarpConfig } from './environments/mainnet3/warp/configGetters/getEthereumVictionUSDTWarpConfig.js';
Expand Down Expand Up @@ -115,6 +119,8 @@ export const warpConfigGetterMap: Record<string, WarpConfigGetter> = {
[WarpRouteIds.AppchainBaseUSDC]: getAppChainBaseUSDCWarpConfig,
[WarpRouteIds.BobaBsquaredSwellUBTC]: getBobaBsquaredSwellUBTCWarpConfig,
[WarpRouteIds.EthereumZircuitRe7LRT]: getEthereumZircuitRe7LRTWarpConfig,
[WarpRouteIds.EthereumSuperseedCBBTC]: getEthereumSuperseedCBBTCWarpConfig,
[WarpRouteIds.EthereumSuperseedUSDC]: getEthereumSuperseedUSDCWarpConfig,
[WarpRouteIds.EthereumFormUSDT]: getEthereumFormUSDTWarpConfig,
[WarpRouteIds.EthereumFormUSDC]: getEthereumFormUSDCWarpConfig,
[WarpRouteIds.EthereumSuperseedUSDT]: getEthereumSuperseedUSDTConfig,
Expand Down
4 changes: 3 additions & 1 deletion typescript/infra/scripts/warp-routes/generate-warp-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ async function main() {
const parsed = WarpRouteDeployConfigSchema.safeParse(warpConfig);

if (!parsed.success) {
rootLogger.error(parsed.error.format());
rootLogger.error('Error parsing warp config:');
console.dir(warpConfig, { depth: null });
console.dir(parsed.error.format(), { depth: null });
return;
}

Expand Down
5 changes: 2 additions & 3 deletions typescript/infra/src/config/warp.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { ChainMap, OwnableConfig, RouterConfig } from '@hyperlane-xyz/sdk';
import { Address } from '@hyperlane-xyz/utils';
import { OwnableConfig, RouterConfig } from '@hyperlane-xyz/sdk';

// Common collateral tokens to be used by warp route deployments.
export const tokens: ChainMap<Record<string, Address>> = {
export const tokens = {
ethereum: {
amphrETH: '0x5fD13359Ba15A84B76f7F87568309040176167cd',
apxETH: '0x9ba021b0a9b958b5e75ce9f6dff97c7ee52cb3e6',
Expand Down

0 comments on commit 754c1c9

Please sign in to comment.