Skip to content

Commit 3c1e67a

Browse files
authored
feat(infra): USDT OFT Legacy Mesh warp route (Tron, Ethereum, Arbitrum) (#8512)
1 parent a87d5a0 commit 3c1e67a

5 files changed

Lines changed: 123 additions & 2 deletions

File tree

.registryrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5f7433dde94644ff91ddb574e77223600a5a1c70
1+
1b6c789d66582d0a33e7880a45aa9f418d1502f5

rust/main/app-contexts/mainnet_config.json

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42280,6 +42280,71 @@
4228042280
}
4228142281
]
4228242282
},
42283+
{
42284+
"name": "USDT/oft-legacy",
42285+
"matchingList": [
42286+
{
42287+
"originDomain": 42161,
42288+
"senderAddress": [
42289+
"0x0000000000000000000000009323793fb9a071ce5fe839079925c0e39f37170f"
42290+
],
42291+
"destinationDomain": 1,
42292+
"recipientAddress": [
42293+
"0x000000000000000000000000c0da8ef1225145e0b720d8a33471fa6360b7e73b"
42294+
]
42295+
},
42296+
{
42297+
"originDomain": 42161,
42298+
"senderAddress": [
42299+
"0x0000000000000000000000009323793fb9a071ce5fe839079925c0e39f37170f"
42300+
],
42301+
"destinationDomain": 728126428,
42302+
"recipientAddress": [
42303+
"0x00000000000000000000000043bb7c9c64a05af94d67b52883a60756950058d7"
42304+
]
42305+
},
42306+
{
42307+
"originDomain": 1,
42308+
"senderAddress": [
42309+
"0x000000000000000000000000c0da8ef1225145e0b720d8a33471fa6360b7e73b"
42310+
],
42311+
"destinationDomain": 42161,
42312+
"recipientAddress": [
42313+
"0x0000000000000000000000009323793fb9a071ce5fe839079925c0e39f37170f"
42314+
]
42315+
},
42316+
{
42317+
"originDomain": 1,
42318+
"senderAddress": [
42319+
"0x000000000000000000000000c0da8ef1225145e0b720d8a33471fa6360b7e73b"
42320+
],
42321+
"destinationDomain": 728126428,
42322+
"recipientAddress": [
42323+
"0x00000000000000000000000043bb7c9c64a05af94d67b52883a60756950058d7"
42324+
]
42325+
},
42326+
{
42327+
"originDomain": 728126428,
42328+
"senderAddress": [
42329+
"0x00000000000000000000000043bb7c9c64a05af94d67b52883a60756950058d7"
42330+
],
42331+
"destinationDomain": 42161,
42332+
"recipientAddress": [
42333+
"0x0000000000000000000000009323793fb9a071ce5fe839079925c0e39f37170f"
42334+
]
42335+
},
42336+
{
42337+
"originDomain": 728126428,
42338+
"senderAddress": [
42339+
"0x00000000000000000000000043bb7c9c64a05af94d67b52883a60756950058d7"
42340+
],
42341+
"destinationDomain": 1,
42342+
"recipientAddress": [
42343+
"0x000000000000000000000000c0da8ef1225145e0b720d8a33471fa6360b7e73b"
42344+
]
42345+
}
42346+
]
42347+
},
4228342348
{
4228442349
"name": "RISE/bsc-ethereum",
4228542350
"matchingList": [
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import { ChainMap, HypTokenRouterConfig, TokenType } from '@hyperlane-xyz/sdk';
2+
3+
import {
4+
RouterConfigWithoutOwner,
5+
tokens,
6+
} from '../../../../../src/config/warp.js';
7+
import { awIcas } from '../../governance/ica/aw.js';
8+
import { awSafes } from '../../governance/safe/aw.js';
9+
10+
const deploymentChains = ['ethereum', 'arbitrum', 'tron'] as const;
11+
12+
export type DeploymentChain = (typeof deploymentChains)[number];
13+
14+
const lzEids: Record<DeploymentChain, number> = {
15+
ethereum: 30101,
16+
arbitrum: 30110,
17+
tron: 30420,
18+
};
19+
20+
const oftAddresses: Record<DeploymentChain, string> = {
21+
ethereum: '0x1F748c76dE468e9D11bd340fA9D5CBADf315dFB0',
22+
arbitrum: '0x77652D5aba086137b595875263FC200182919B92',
23+
tron: '0x3a08f76772e200653bb55c2a92998daca62e0e97',
24+
};
25+
26+
const ownersByChain: Record<DeploymentChain, string> = {
27+
ethereum: awSafes.ethereum,
28+
// arbitrum stays inline until awIcas.arbitrum is exported again in aw.ts
29+
arbitrum: '0xD2757Bbc28C80789Ed679f22Ac65597Cacf51A45',
30+
tron: awIcas.tron,
31+
};
32+
33+
export const getUSDTOftLegacyWarpConfig = async (
34+
routerConfig: ChainMap<RouterConfigWithoutOwner>,
35+
): Promise<ChainMap<HypTokenRouterConfig>> =>
36+
Object.fromEntries(
37+
deploymentChains.map((chain) => [
38+
chain,
39+
{
40+
...routerConfig[chain],
41+
owner: ownersByChain[chain],
42+
type: TokenType.collateralOft,
43+
token: tokens[chain].USDT,
44+
oft: oftAddresses[chain],
45+
decimals: 6,
46+
name: 'Tether USD',
47+
symbol: 'USDT',
48+
domainMappings: Object.fromEntries(
49+
Object.entries(lzEids).filter(([c]) => c !== chain),
50+
),
51+
extraOptions: '0x',
52+
},
53+
]),
54+
);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ export enum WarpRouteIds {
152152
// TODO: uncomment when USDTOft warp routes are in the registry
153153
// USDT OFT
154154
USDTOft = 'USDT/oft',
155-
// USDTOftLegacy = 'USDT/oft-legacy',
155+
USDTOftLegacy = 'USDT/oft-legacy',
156156

157157
// RISE routes
158158
BscEthereumRISE = 'RISE/bsc-ethereum',

typescript/infra/config/warp.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ import { WarpRouteIds } from './environments/mainnet3/warp/warpIds.js';
140140
import { getCCTPWarpConfig as getTestnetCCTPWarpConfig } from './environments/testnet4/warp/getCCTPConfig.js';
141141
import { DEFAULT_REGISTRY_URI } from './registry.js';
142142
import { getUSDTOftWarpConfig } from './environments/mainnet3/warp/configGetters/getUSDTOftWarpConfig.js';
143+
import { getUSDTOftLegacyWarpConfig } from './environments/mainnet3/warp/configGetters/getUSDTOftLegacyWarpConfig.js';
143144
import { getUSDTSTAGEWarpConfig } from './environments/mainnet3/warp/configGetters/getUSDTSTAGEWarpConfig.js';
144145

145146
type WarpConfigGetter = (
@@ -228,6 +229,7 @@ export const warpConfigGetterMap: Record<string, WarpConfigGetter> = {
228229
[WarpRouteIds.ModeUSDTSTAGE]: getUSDTSTAGEWarpConfig,
229230
[WarpRouteIds.AleoUSDC]: getAleoUSDCWarpConfig,
230231
[WarpRouteIds.USDTOft]: getUSDTOftWarpConfig,
232+
[WarpRouteIds.USDTOftLegacy]: getUSDTOftLegacyWarpConfig,
231233
};
232234

233235
type StrategyConfigGetter = () => ChainSubmissionStrategy;

0 commit comments

Comments
 (0)