Skip to content

Commit

Permalink
feat(infra): usdc appchain base + ubtc boba (#5028)
Browse files Browse the repository at this point in the history
### Description

 uBTC warp route extension + USDC route that connects AppChain to Base

### Drive-by changes

- No

### Backward compatibility

- YES

### Testing

Manual

---------

Co-authored-by: nambrot <nambrot@googlemail.com>
  • Loading branch information
xeno097 and nambrot authored Dec 19, 2024
1 parent 1e187ae commit 0e83758
Show file tree
Hide file tree
Showing 7 changed files with 119 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/neat-apples-marry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hyperlane-xyz/infra': minor
---

added ubtc route extension config + usdc from appchain to base
2 changes: 1 addition & 1 deletion .registryrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d3e1e71965d7d06a8f8761c8255e718699c78f11
32b4ab3b3df2bedd0d905c6745bcf1c673a60a01
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { ethers } from 'ethers';

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

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

const safeOwners: ChainMap<Address> = {
appchain: '0xe3436b3335fa6d4f1b58153079FB360c6Aa83Fd9',
base: '0xE3b50a565fbcdb6CC67B30bEB112f9e7FC855359',
};

export const getAppChainBaseUSDCWarpConfig = async (
routerConfig: ChainMap<RouterConfigWithoutOwner>,
): Promise<ChainMap<HypTokenRouterConfig>> => {
const ISM_CONFIG: IsmConfig = ethers.constants.AddressZero; // Use the default ISM

const appchain: HypTokenRouterConfig = {
mailbox: routerConfig.appchain.mailbox,
owner: safeOwners.appchain,
type: TokenType.synthetic,
interchainSecurityModule: ISM_CONFIG,
};

const base: HypTokenRouterConfig = {
mailbox: routerConfig.base.mailbox,
owner: safeOwners.base,
type: TokenType.collateral,
token: tokens.base.USDC,
interchainSecurityModule: ISM_CONFIG,
};

return {
appchain,
base,
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import { ethers } from 'ethers';

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

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

const safeOwners: ChainMap<Address> = {
bsquared: '0x7A363efD42305BeDBA307d25351F8ea157b69A1A',
swell: '0xC11e22A31787394950B31e2DEb1d2b5546689B65',
boba: '0x207FfFa7325fC5d0362aB01605D84B268b61888f',
};

export const getBobaBsquaredSwellUBTCWarpConfig = async (
routerConfig: ChainMap<RouterConfigWithoutOwner>,
): Promise<ChainMap<HypTokenRouterConfig>> => {
const ISM_CONFIG: IsmConfig = ethers.constants.AddressZero; // Use the default ISM

const boba: HypTokenRouterConfig = {
mailbox: routerConfig.boba.mailbox,
owner: safeOwners.boba,
type: TokenType.synthetic,
interchainSecurityModule: ISM_CONFIG,
};

const bsquared: HypTokenRouterConfig = {
mailbox: routerConfig.bsquared.mailbox,
owner: safeOwners.bsquared,
type: TokenType.collateral,
token: tokens.bsquared.uBTC,
interchainSecurityModule: ISM_CONFIG,
};

const swell: HypTokenRouterConfig = {
mailbox: routerConfig.swell.mailbox,
owner: safeOwners.swell,
type: TokenType.synthetic,
interchainSecurityModule: ISM_CONFIG,
};

return {
boba,
bsquared,
swell,
};
};
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 @@ -36,4 +36,6 @@ export enum WarpRouteIds {
ArbitrumEthereumMantleModePolygonScrollZeroNetworkUSDT = 'USDT/arbitrum-ethereum-mantle-mode-polygon-scroll-zeronetwork',
ArbitrumBaseEthereumLiskOptimismPolygonZeroNetworkUSDC = 'USDC/arbitrum-base-ethereum-lisk-optimism-polygon-zeronetwork',
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',
}
10 changes: 9 additions & 1 deletion typescript/infra/config/warp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ import {
import { RouterConfigWithoutOwner } from '../src/config/warp.js';

import { getAncient8EthereumUSDCWarpConfig } from './environments/mainnet3/warp/configGetters/getAncient8EthereumUSDCWarpConfig.js';
import { getAppChainBaseUSDCWarpConfig } from './environments/mainnet3/warp/configGetters/getAppchainBaseUSDCWarpConfig.js';
import { getArbitrumBaseBlastBscEthereumGnosisMantleModeOptimismPolygonScrollZeroNetworkZoraMainnetETHWarpConfig } from './environments/mainnet3/warp/configGetters/getArbitrumBaseBlastBscEthereumGnosisMantleModeOptimismPolygonScrollZeroNetworkZoraMainnetETHWarpConfig.js';
import { getArbitrumBaseEthereumOptimismPolygonZeroNetworkUSDC } from './environments/mainnet3/warp/configGetters/getArbitrumBaseEthereumOptimismPolygonZeroNetworkUSDCWarpConfig.js';
import { getArbitrumEthereumMantleModePolygonScrollZeroNetworkUSDTWarpConfig } from './environments/mainnet3/warp/configGetters/getArbitrumBscEthereumMantleModePolygonScrollZeronetworkUSDTWarpConfig.js';
import { getArbitrumEthereumZircuitAmphrETHWarpConfig } from './environments/mainnet3/warp/configGetters/getArbitrumEthereumZircuitAmphrETHWarpConfig.js';
import { getArbitrumNeutronEclipWarpConfig } from './environments/mainnet3/warp/configGetters/getArbitrumNeutronEclipWarpConfig.js';
import { getArbitrumNeutronTiaWarpConfig } from './environments/mainnet3/warp/configGetters/getArbitrumNeutronTiaWarpConfig.js';
import { getBaseZeroNetworkCBBTCWarpConfig } from './environments/mainnet3/warp/configGetters/getBaseZeroNetworkCBBTCWarpConfig.js';
import { getBobaBsquaredSwellUBTCWarpConfig } from './environments/mainnet3/warp/configGetters/getBobaBsquaredSwellUBTCWarpConfig.js';
import { getEclipseEthereumApxEthWarpConfig } from './environments/mainnet3/warp/configGetters/getEclipseEthereumApxETHWarpConfig.js';
import { getEclipseEthereumSolanaUSDTWarpConfig } from './environments/mainnet3/warp/configGetters/getEclipseEthereumSolanaUSDTWarpConfig.js';
import { getEclipseEthereumWBTCWarpConfig } from './environments/mainnet3/warp/configGetters/getEclipseEthereumWBTCWarpConfig.js';
Expand Down Expand Up @@ -79,6 +81,8 @@ export const warpConfigGetterMap: Record<string, WarpConfigGetter> = {
getArbitrumBaseBlastBscEthereumGnosisMantleModeOptimismPolygonScrollZeroNetworkZoraMainnetETHWarpConfig,
[WarpRouteIds.EclipseStrideTIA]: getEclipseStrideTiaWarpConfig,
[WarpRouteIds.EclipseStrideSTTIA]: getEclipseStrideStTiaWarpConfig,
[WarpRouteIds.AppchainBaseUSDC]: getAppChainBaseUSDCWarpConfig,
[WarpRouteIds.BobaBsquaredSwellUBTC]: getBobaBsquaredSwellUBTCWarpConfig,
[WarpRouteIds.EthereumZircuitRe7LRT]: getEthereumZircuitRe7LRTWarpConfig,
};

Expand All @@ -93,7 +97,11 @@ export async function getWarpConfig(
);
// Strip the owners from the router config
const routerConfigWithoutOwner = objMap(routerConfig, (_chain, config) => {
const { owner, ownerOverrides, ...configWithoutOwner } = config;
const {
owner: _owner,
ownerOverrides: _ownerOverrides,
...configWithoutOwner
} = config;
return configWithoutOwner;
});
// Isolate the owners from the router config
Expand Down
3 changes: 3 additions & 0 deletions typescript/infra/src/config/warp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ export const tokens: ChainMap<Record<string, Address>> = {
cbBTC: '0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf',
USDC: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
},
bsquared: {
uBTC: '0x796e4D53067FF374B89b2Ac101ce0c1f72ccaAc2',
},
arbitrum: {
USDT: '0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9',
USDC: '0xaf88d065e77c8cC2239327C5EDb3A432268e5831',
Expand Down

0 comments on commit 0e83758

Please sign in to comment.