Skip to content

Commit e85e62d

Browse files
authored
feat: add USDCSTAGE/eclipsemainnet route (#7251)
1 parent ac0249a commit e85e62d

File tree

7 files changed

+196
-1
lines changed

7 files changed

+196
-1
lines changed

.registryrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
bc390f0b0d4fbd52c7fc4ebb3e49b8cb88342eae
1+
72ce1f22cb091110eed8b5c9c04129a33b4c3eb6
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"ethereum": {
3+
"hex": "0x00000000000000000000000004c26a1efb87d5ac9ee6179754b4cddc61fc11d5",
4+
"base58": "1111111111114r4GbDr6GpjADEPGeD9AtRdhQXE"
5+
},
6+
"solanamainnet": {
7+
"hex": "0xc266368bc2886153843d9c8f894956f16795cccfef8957a87fe088c4ce2fb428",
8+
"base58": "E5rVV8zXwtc4TKGypCJvSBaYbgxa4XaYg5MS6N9QGdeo"
9+
},
10+
"base": {
11+
"hex": "0x0000000000000000000000005a0e13290ec57f5e9031d01d03c6a40029cc24ea",
12+
"base58": "1111111111112FmXstQD1rxBjW64ydHaB5rgGxSV"
13+
},
14+
"arbitrum": {
15+
"hex": "0x000000000000000000000000604610e6b3310852f1599a6edbebd6b6b2b766dc",
16+
"base58": "1111111111112LnypxSnrNqS5179u14fDdfwNncs"
17+
},
18+
"eclipsemainnet": {
19+
"hex": "0x504ba2b10af57f82d8a4b657495f5eaf81ba69873f5735733da684564167095b",
20+
"base58": "6QSWUmEaEcE2KJrU5jq7T11tNRaVsgnG8XULezjg7JjL"
21+
}
22+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"solanamainnet": {
3+
"type": "collateral",
4+
"decimals": 6,
5+
"interchainGasPaymaster": "AkeHBbE5JkwVppujCQQ6WuxsVsJtruBAjUo6fDCFp6fF",
6+
"token": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
7+
"owner": "9bRSUPjfS3xS6n5EfkJzHFTRDa4AHLda8BU2pP4HoWnf"
8+
},
9+
"eclipsemainnet": {
10+
"type": "synthetic",
11+
"decimals": 6,
12+
"name": "USD Coin STAGE",
13+
"symbol": "USDCSTAGE",
14+
"uri": "https://raw.githubusercontent.com/hyperlane-xyz/hyperlane-registry/03b8562eb54afc52c0be0529a3d454aebed31a7d/deployments/warp_routes/USDCSTAGE/metadata.json",
15+
"interchainGasPaymaster": "3Wp4qKkgf4tjXz1soGyTSndCgBPLZFSrZkiDZ8Qp9EEj",
16+
"owner": "9bRSUPjfS3xS6n5EfkJzHFTRDa4AHLda8BU2pP4HoWnf"
17+
},
18+
"ethereum": {
19+
"type": "collateral",
20+
"decimals": 6,
21+
"token": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
22+
"foreignDeployment": "0x04C26A1Efb87D5Ac9ee6179754B4CDDC61fC11d5"
23+
},
24+
"arbitrum": {
25+
"type": "collateral",
26+
"decimals": 6,
27+
"token": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
28+
"foreignDeployment": "0x604610E6B3310852f1599a6eDbEbd6b6b2B766DC"
29+
},
30+
"base": {
31+
"type": "collateral",
32+
"decimals": 6,
33+
"token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
34+
"foreignDeployment": "0x5A0E13290ec57F5e9031D01D03C6A40029Cc24ea"
35+
}
36+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
warpRouteId: USDCSTAGE/eclipsemainnet
2+
strategy:
3+
rebalanceStrategy: minAmount
4+
chains:
5+
base:
6+
minAmount:
7+
min: 0.000002
8+
target: 0.000002
9+
type: 'absolute'
10+
bridgeLockTime: 1800 # 30 mins in seconds
11+
bridge: '0x5C4aFb7e23B1Dc1B409dc1702f89C64527b25975'
12+
13+
ethereum:
14+
minAmount:
15+
min: 0.000002
16+
target: 0.000002
17+
type: 'absolute'
18+
bridgeLockTime: 1800 # 30 mins in seconds
19+
bridge: '0xedCBAa585FD0F80f20073F9958246476466205b8'
20+
21+
arbitrum:
22+
minAmount:
23+
min: 0.000002
24+
target: 0.000002
25+
type: 'absolute'
26+
bridgeLockTime: 1800 # 30 mins in seconds
27+
bridge: '0x8a82186EA618b91D13A2041fb7aC31Bf01C02aD2'
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
import { ChainMap, HypTokenRouterConfig, TokenType } from '@hyperlane-xyz/sdk';
2+
import { Address } from '@hyperlane-xyz/utils';
3+
4+
import { RouterConfigWithoutOwner } from '../../../../../src/config/warp.js';
5+
import { usdcTokenAddresses } from '../cctp.js';
6+
import { SEALEVEL_WARP_ROUTE_HANDLER_GAS_AMOUNT } from '../consts.js';
7+
8+
import {
9+
getRebalancingUSDCConfigForChain,
10+
getUSDCRebalancingBridgesConfigFor,
11+
} from './utils.js';
12+
13+
const SOLANA_OWNER = '9bRSUPjfS3xS6n5EfkJzHFTRDa4AHLda8BU2pP4HoWnf';
14+
15+
const deploymentChains = [
16+
'ethereum',
17+
'arbitrum',
18+
'base',
19+
'eclipsemainnet',
20+
'solanamainnet',
21+
] as const;
22+
23+
type DeploymentChain = (typeof deploymentChains)[number];
24+
25+
// Chains that support CCTP-based rebalancing
26+
const rebalanceableCollateralChains = [
27+
'ethereum',
28+
'arbitrum',
29+
'base',
30+
] as const satisfies DeploymentChain[];
31+
32+
const CONTRACT_VERSION = '9.0.13';
33+
34+
const STAGING_PROGRAM_IDS = {
35+
eclipsemainnet: '6QSWUmEaEcE2KJrU5jq7T11tNRaVsgnG8XULezjg7JjL',
36+
solanamainnet: 'E5rVV8zXwtc4TKGypCJvSBaYbgxa4XaYg5MS6N9QGdeo',
37+
};
38+
39+
// Staging-specific branding
40+
const STAGING_TOKEN_METADATA = {
41+
symbol: 'USDCSTAGE',
42+
name: 'USD Coin STAGE',
43+
};
44+
45+
export const getEclipseUSDCSTAGEWarpConfig = async (
46+
routerConfig: ChainMap<RouterConfigWithoutOwner>,
47+
): Promise<ChainMap<HypTokenRouterConfig>> => {
48+
const rebalancingConfigByChain = getUSDCRebalancingBridgesConfigFor(
49+
rebalanceableCollateralChains,
50+
);
51+
52+
// All EVM chains use the same owner (Safe)
53+
const evmOwner: Address = '0x7fDFd78B278f88C1A1921B7AeC69aC509862C44f';
54+
const ownersByChain: ChainMap<Address> = {
55+
ethereum: evmOwner,
56+
arbitrum: evmOwner,
57+
base: evmOwner,
58+
};
59+
60+
const configs: Array<[DeploymentChain, HypTokenRouterConfig]> = [];
61+
62+
// Handle rebalanceable collateral chains (EVM chains with rebalancing)
63+
for (const currentChain of rebalanceableCollateralChains) {
64+
const baseConfig = getRebalancingUSDCConfigForChain(
65+
currentChain,
66+
routerConfig,
67+
ownersByChain,
68+
rebalancingConfigByChain,
69+
);
70+
71+
configs.push([
72+
currentChain,
73+
{
74+
...baseConfig,
75+
contractVersion: CONTRACT_VERSION,
76+
...STAGING_TOKEN_METADATA,
77+
},
78+
]);
79+
}
80+
81+
// Handle synthetic chain (Eclipse)
82+
configs.push([
83+
'eclipsemainnet',
84+
{
85+
type: TokenType.synthetic,
86+
mailbox: routerConfig.eclipsemainnet.mailbox,
87+
foreignDeployment: STAGING_PROGRAM_IDS.eclipsemainnet,
88+
gas: SEALEVEL_WARP_ROUTE_HANDLER_GAS_AMOUNT,
89+
owner: SOLANA_OWNER,
90+
},
91+
]);
92+
93+
// Handle non-rebalanceable collateral chain (Solana)
94+
configs.push([
95+
'solanamainnet',
96+
{
97+
type: TokenType.collateral,
98+
token: usdcTokenAddresses.solanamainnet,
99+
mailbox: routerConfig.solanamainnet.mailbox,
100+
foreignDeployment: STAGING_PROGRAM_IDS.solanamainnet,
101+
gas: SEALEVEL_WARP_ROUTE_HANDLER_GAS_AMOUNT,
102+
owner: SOLANA_OWNER,
103+
},
104+
]);
105+
106+
return Object.fromEntries(configs);
107+
};

typescript/infra/config/environments/mainnet3/warp/warpIds.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export enum WarpRouteIds {
1515
ArbitrumAvalancheBaseFlowmainnetFormOptimismSolanamainnetWorldchainTRUMP = 'TRUMP/arbitrum-avalanche-base-flowmainnet-form-optimism-solanamainnet-worldchain',
1616
EclipseEthereumApxEth = 'APXETH/eclipsemainnet-ethereum',
1717
EclipseEthereumSolanaUSDC = 'USDC/eclipsemainnet-ethereum-solanamainnet',
18+
EclipseUSDCSTAGE = 'USDCSTAGE/eclipsemainnet',
1819
EclipseEthereumSolanaUSDT = 'USDT/eclipsemainnet-ethereum-solanamainnet',
1920
EclipseEthereumTETH = 'tETH/eclipsemainnet-ethereum',
2021
EclipseEthereumWBTC = 'WBTC/eclipsemainnet-ethereum',

typescript/infra/config/warp.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ import { getEclipseEthereumSolanaUSDTWarpConfig } from './environments/mainnet3/
5050
import { getEclipseEthereumWBTCWarpConfig } from './environments/mainnet3/warp/configGetters/getEclipseEthereumWBTCWarpConfig.js';
5151
import { getEclipseStrideTiaWarpConfig } from './environments/mainnet3/warp/configGetters/getEclipseStrideSTTIAWarpConfig.js';
5252
import { getEclipseStrideStTiaWarpConfig } from './environments/mainnet3/warp/configGetters/getEclipseStrideTIAWarpConfig.js';
53+
import { getEclipseUSDCSTAGEWarpConfig } from './environments/mainnet3/warp/configGetters/getEclipseUSDCSTAGEWarpConfig.js';
5354
import { getElectroneumUSDCWarpConfig } from './environments/mainnet3/warp/configGetters/getElectroneumUSDCWarpConfig.js';
5455
import { getEthereumFormFORMWarpConfig } from './environments/mainnet3/warp/configGetters/getEthereumFormFORMWarpConfig.js';
5556
import { getEthereumInevmUSDCWarpConfig } from './environments/mainnet3/warp/configGetters/getEthereumInevmUSDCWarpConfig.js';
@@ -134,6 +135,7 @@ export const warpConfigGetterMap: Record<string, WarpConfigGetter> = {
134135
[WarpRouteIds.BerachainEthereumSwellUnichainZircuitPZETHSTAGE]:
135136
getRenzoPZETHStagingWarpConfig,
136137
[WarpRouteIds.MantapacificNeutronTIA]: getMantapacificNeutronTiaWarpConfig,
138+
[WarpRouteIds.EclipseUSDCSTAGE]: getEclipseUSDCSTAGEWarpConfig,
137139
[WarpRouteIds.EclipseEthereumSolanaUSDT]:
138140
getEclipseEthereumSolanaUSDTWarpConfig,
139141
[WarpRouteIds.EclipseEthereumWBTC]: getEclipseEthereumWBTCWarpConfig,

0 commit comments

Comments
 (0)