Skip to content

Commit 74e47e6

Browse files
feat(usdt): add USDTSTAGE warp route for mode staging (#8150)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
1 parent c557a80 commit 74e47e6

File tree

6 files changed

+140
-1
lines changed

6 files changed

+140
-1
lines changed

.registryrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
03e9cc03ce36db8372ddfeb5a3d31a2b8056a7d3
1+
73605458fc8ef111705e2ff487b8dabfcf1886f1
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"solanamainnet": {
3+
"hex": "0x6757b182c660f93690f02377b1b5806d51b47e9558411862611bf53ec3f80e93",
4+
"base58": "7xQYs3RZvycfk3nwDPGZhbkA9318xx324xhWDcENVfjg"
5+
},
6+
"arbitrum": {
7+
"hex": "0x00000000000000000000000022ef52c822329e96c3be0bbb165805603777296c",
8+
"base58": "111111111111VEGG2QJdDuL4q7ejSSu2FfV2wAb"
9+
},
10+
"plasma": {
11+
"hex": "0x000000000000000000000000a7e4dc4078bac6e97eec52a4f7642ff51cbb17c1",
12+
"base58": "1111111111113LfYq5LBr9evqvLDj4ZDxFMtwGC8"
13+
},
14+
"mode": {
15+
"hex": "0x00000000000000000000000001419427c18cc14d66817e90d2e550760230cf3d",
16+
"base58": "11111111111121sZXUUD3xLh1tZCPUH6sKuQLLk"
17+
},
18+
"ethereum": {
19+
"hex": "0x0000000000000000000000004f7635a2f9795c10df260c2fc0a23e0f60b4829c",
20+
"base58": "11111111111127D4yQKcubVU6AG4Jo7N1fqohhiK"
21+
}
22+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"solanamainnet": {
3+
"type": "collateral",
4+
"decimals": 6,
5+
"interchainGasPaymaster": "AkeHBbE5JkwVppujCQQ6WuxsVsJtruBAjUo6fDCFp6fF",
6+
"token": "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",
7+
"owner": "5seKh2p3B8Kq9nAE7X4svfX9uLt81wWAiDJuLK1XNgXf"
8+
},
9+
"ethereum": {
10+
"type": "collateral",
11+
"decimals": 6,
12+
"token": "0xdac17f958d2ee523a2206206994597c13d831ec7",
13+
"foreignDeployment": "0x4f7635A2F9795c10DF260C2fc0A23e0F60B4829C"
14+
},
15+
"plasma": {
16+
"type": "collateral",
17+
"decimals": 6,
18+
"token": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
19+
"foreignDeployment": "0xa7E4dC4078bAc6e97Eec52a4F7642fF51cbb17C1"
20+
},
21+
"arbitrum": {
22+
"type": "collateral",
23+
"decimals": 6,
24+
"token": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
25+
"foreignDeployment": "0x22eF52C822329E96C3bE0bBB165805603777296C"
26+
},
27+
"mode": {
28+
"type": "synthetic",
29+
"decimals": 6,
30+
"name": "Tether USD STAGE",
31+
"symbol": "USDTSTAGE",
32+
"foreignDeployment": "0x01419427C18cC14d66817E90d2e550760230Cf3D"
33+
}
34+
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
import { ChainMap, HypTokenRouterConfig, TokenType } from '@hyperlane-xyz/sdk';
2+
import { ethers } from 'ethers';
3+
4+
import {
5+
RouterConfigWithoutOwner,
6+
tokens,
7+
} from '../../../../../src/config/warp.js';
8+
import { SEALEVEL_WARP_ROUTE_HANDLER_GAS_AMOUNT } from '../consts.js';
9+
10+
interface RouteConfig<T> {
11+
ethereum: T;
12+
plasma: T;
13+
arbitrum: T;
14+
mode: T;
15+
solanamainnet: T;
16+
}
17+
18+
type RouteChains = keyof RouteConfig<any>;
19+
20+
const SOLANA_OWNER = '5seKh2p3B8Kq9nAE7X4svfX9uLt81wWAiDJuLK1XNgXf';
21+
22+
const STAGING_PROGRAM_IDS = {
23+
solanamainnet: '7xQYs3RZvycfk3nwDPGZhbkA9318xx324xhWDcENVfjg',
24+
};
25+
26+
export async function getUSDTSTAGEWarpConfig(
27+
routerConfig: ChainMap<RouterConfigWithoutOwner>,
28+
): Promise<ChainMap<HypTokenRouterConfig>> {
29+
const config: RouteConfig<HypTokenRouterConfig> = {
30+
ethereum: {
31+
...routerConfig.ethereum,
32+
owner: '0x3e0A78A330F2b97059A4D507ca9d8292b65B6FB5',
33+
type: TokenType.collateral,
34+
token: tokens.ethereum.USDT,
35+
interchainSecurityModule: ethers.constants.AddressZero,
36+
name: 'Tether USD STAGE',
37+
symbol: 'USDTSTAGE',
38+
decimals: 6,
39+
},
40+
plasma: {
41+
...routerConfig.plasma,
42+
owner: '0x3e0A78A330F2b97059A4D507ca9d8292b65B6FB5',
43+
type: TokenType.collateral,
44+
token: '0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb',
45+
interchainSecurityModule: ethers.constants.AddressZero,
46+
name: 'Tether USD STAGE',
47+
symbol: 'USDTSTAGE',
48+
decimals: 6,
49+
},
50+
arbitrum: {
51+
...routerConfig.arbitrum,
52+
owner: '0x3e0A78A330F2b97059A4D507ca9d8292b65B6FB5',
53+
type: TokenType.collateral,
54+
token: tokens.arbitrum.USDT,
55+
interchainSecurityModule: ethers.constants.AddressZero,
56+
name: 'Tether USD STAGE',
57+
symbol: 'USDTSTAGE',
58+
decimals: 6,
59+
},
60+
solanamainnet: {
61+
type: TokenType.collateral,
62+
token: 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB',
63+
mailbox: routerConfig.solanamainnet.mailbox,
64+
foreignDeployment: STAGING_PROGRAM_IDS.solanamainnet,
65+
gas: SEALEVEL_WARP_ROUTE_HANDLER_GAS_AMOUNT,
66+
owner: SOLANA_OWNER,
67+
},
68+
mode: {
69+
...routerConfig.mode,
70+
owner: '0x3e0A78A330F2b97059A4D507ca9d8292b65B6FB5',
71+
type: TokenType.synthetic,
72+
interchainSecurityModule: ethers.constants.AddressZero,
73+
name: 'Tether USD STAGE',
74+
symbol: 'USDTSTAGE',
75+
decimals: 6,
76+
},
77+
};
78+
return config as Record<RouteChains, HypTokenRouterConfig>;
79+
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,4 +131,6 @@ export enum WarpRouteIds {
131131
EniWBTC = 'WBTC/eni',
132132
EniUSDC = 'USDC/eni',
133133
EniUSDT = 'USDT/eni',
134+
135+
ModeUSDTSTAGE = 'USDTSTAGE/mode',
134136
}

typescript/infra/config/warp.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ import {
121121
import { WarpRouteIds } from './environments/mainnet3/warp/warpIds.js';
122122
import { getCCTPWarpConfig as getTestnetCCTPWarpConfig } from './environments/testnet4/warp/getCCTPConfig.js';
123123
import { DEFAULT_REGISTRY_URI } from './registry.js';
124+
import { getUSDTSTAGEWarpConfig } from './environments/mainnet3/warp/configGetters/getUSDTSTAGEWarpConfig.js';
124125

125126
type WarpConfigGetter = (
126127
routerConfig: ChainMap<RouterConfigWithoutOwner>,
@@ -203,6 +204,7 @@ export const warpConfigGetterMap: Record<string, WarpConfigGetter> = {
203204
[WarpRouteIds.EniWBTC]: getEniWbtcWarpConfig,
204205
[WarpRouteIds.EniUSDC]: getEniUsdcWarpConfig,
205206
[WarpRouteIds.EniUSDT]: getEniUsdtWarpConfig,
207+
[WarpRouteIds.ModeUSDTSTAGE]: getUSDTSTAGEWarpConfig,
206208
};
207209

208210
type StrategyConfigGetter = () => ChainSubmissionStrategy;

0 commit comments

Comments
 (0)