Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Superseed warp route config #5122

Merged
merged 6 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .registryrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
47aba98bdd78ecb5a3f756dca6dc2e28325bab43
be1835384fb7687f766a07ad3efdad041e5d01cc
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,
};
};
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',
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 @@ -44,6 +44,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 @@ -104,6 +108,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
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ async function main() {
const parsed = WarpRouteDeployConfigSchema.safeParse(warpConfig);

if (!parsed.success) {
console.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: {
nambrot marked this conversation as resolved.
Show resolved Hide resolved
amphrETH: '0x5fD13359Ba15A84B76f7F87568309040176167cd',
apxETH: '0x9ba021b0a9b958b5e75ce9f6dff97c7ee52cb3e6',
Expand Down
Loading