Skip to content

Commit a87d5a0

Browse files
authored
feat(infra): USDT OFT warp route deployment + SDK fix for unproxied contracts (#8507)
1 parent 7fb6194 commit a87d5a0

6 files changed

Lines changed: 159 additions & 2 deletions

File tree

.registryrc

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

rust/main/app-contexts/mainnet_config.json

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42215,6 +42215,71 @@
4221542215
}
4221642216
]
4221742217
},
42218+
{
42219+
"name": "USDT/oft",
42220+
"matchingList": [
42221+
{
42222+
"originDomain": 42161,
42223+
"senderAddress": [
42224+
"0x000000000000000000000000e4c1a1e54c232454311cf68610c3885fdd991c0e"
42225+
],
42226+
"destinationDomain": 1,
42227+
"recipientAddress": [
42228+
"0x0000000000000000000000007bb4fe8f406fb7b22487fa2e3bcbcb6a38cf29e6"
42229+
]
42230+
},
42231+
{
42232+
"originDomain": 42161,
42233+
"senderAddress": [
42234+
"0x000000000000000000000000e4c1a1e54c232454311cf68610c3885fdd991c0e"
42235+
],
42236+
"destinationDomain": 9745,
42237+
"recipientAddress": [
42238+
"0x00000000000000000000000093bffa2231fba5029997603fb68d9ac08024baa2"
42239+
]
42240+
},
42241+
{
42242+
"originDomain": 1,
42243+
"senderAddress": [
42244+
"0x0000000000000000000000007bb4fe8f406fb7b22487fa2e3bcbcb6a38cf29e6"
42245+
],
42246+
"destinationDomain": 42161,
42247+
"recipientAddress": [
42248+
"0x000000000000000000000000e4c1a1e54c232454311cf68610c3885fdd991c0e"
42249+
]
42250+
},
42251+
{
42252+
"originDomain": 1,
42253+
"senderAddress": [
42254+
"0x0000000000000000000000007bb4fe8f406fb7b22487fa2e3bcbcb6a38cf29e6"
42255+
],
42256+
"destinationDomain": 9745,
42257+
"recipientAddress": [
42258+
"0x00000000000000000000000093bffa2231fba5029997603fb68d9ac08024baa2"
42259+
]
42260+
},
42261+
{
42262+
"originDomain": 9745,
42263+
"senderAddress": [
42264+
"0x00000000000000000000000093bffa2231fba5029997603fb68d9ac08024baa2"
42265+
],
42266+
"destinationDomain": 42161,
42267+
"recipientAddress": [
42268+
"0x000000000000000000000000e4c1a1e54c232454311cf68610c3885fdd991c0e"
42269+
]
42270+
},
42271+
{
42272+
"originDomain": 9745,
42273+
"senderAddress": [
42274+
"0x00000000000000000000000093bffa2231fba5029997603fb68d9ac08024baa2"
42275+
],
42276+
"destinationDomain": 1,
42277+
"recipientAddress": [
42278+
"0x0000000000000000000000007bb4fe8f406fb7b22487fa2e3bcbcb6a38cf29e6"
42279+
]
42280+
}
42281+
]
42282+
},
4221842283
{
4221942284
"name": "RISE/bsc-ethereum",
4222042285
"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', 'plasma'] as const;
11+
12+
export type DeploymentChain = (typeof deploymentChains)[number];
13+
14+
const lzEids: Record<DeploymentChain, number> = {
15+
ethereum: 30101,
16+
arbitrum: 30110,
17+
plasma: 30383,
18+
};
19+
20+
const oftAddresses: Record<DeploymentChain, string> = {
21+
ethereum: '0x6C96dE32CEa08842dcc4058c14d3aaAD7Fa41dee',
22+
arbitrum: '0x14E4A1B13bf7F943c8ff7C51fb60FA964A298D92',
23+
plasma: '0x02ca37966753bDdDf11216B73B16C1dE756A7CF9',
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+
plasma: awIcas.plasma,
31+
};
32+
33+
export const getUSDTOftWarpConfig = 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
@@ -151,7 +151,7 @@ export enum WarpRouteIds {
151151

152152
// TODO: uncomment when USDTOft warp routes are in the registry
153153
// USDT OFT
154-
// USDTOft = 'USDT/oft',
154+
USDTOft = 'USDT/oft',
155155
// USDTOftLegacy = 'USDT/oft-legacy',
156156

157157
// RISE routes

typescript/infra/config/warp.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ import {
139139
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';
142+
import { getUSDTOftWarpConfig } from './environments/mainnet3/warp/configGetters/getUSDTOftWarpConfig.js';
142143
import { getUSDTSTAGEWarpConfig } from './environments/mainnet3/warp/configGetters/getUSDTSTAGEWarpConfig.js';
143144

144145
type WarpConfigGetter = (
@@ -226,6 +227,7 @@ export const warpConfigGetterMap: Record<string, WarpConfigGetter> = {
226227
[WarpRouteIds.Eni1Piece]: getEni1PieceWarpConfig,
227228
[WarpRouteIds.ModeUSDTSTAGE]: getUSDTSTAGEWarpConfig,
228229
[WarpRouteIds.AleoUSDC]: getAleoUSDCWarpConfig,
230+
[WarpRouteIds.USDTOft]: getUSDTOftWarpConfig,
229231
};
230232

231233
type StrategyConfigGetter = () => ChainSubmissionStrategy;

typescript/sdk/src/token/EvmWarpModule.hardhat-test.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2314,4 +2314,40 @@ describe('EvmWarpModule', async () => {
23142314
);
23152315
});
23162316
});
2317+
2318+
describe('createHookUpdateTxs', () => {
2319+
const ROUTE_ADDRESS = '0x1111111111111111111111111111111111111111';
2320+
const TOKEN_ADDRESS = '0x2222222222222222222222222222222222222222';
2321+
2322+
let warpModule: EvmWarpModule;
2323+
2324+
before(() => {
2325+
warpModule = new EvmWarpModule(multiProvider, {
2326+
chain,
2327+
config: {} as HypTokenRouterConfig,
2328+
addresses: {
2329+
deployedTokenRoute: ROUTE_ADDRESS,
2330+
...ismFactoryAddresses,
2331+
},
2332+
});
2333+
});
2334+
2335+
it('returns empty when expected hook is AddressZero', async () => {
2336+
const actual = {
2337+
...baseConfig,
2338+
type: TokenType.collateral,
2339+
token: TOKEN_ADDRESS,
2340+
} as DerivedTokenRouterConfig;
2341+
const expected = {
2342+
...baseConfig,
2343+
type: TokenType.collateral,
2344+
token: TOKEN_ADDRESS,
2345+
hook: ethers.constants.AddressZero,
2346+
} as HypTokenRouterConfig;
2347+
2348+
expect(
2349+
await warpModule.createHookUpdateTxs(actual, expected),
2350+
).to.deep.equal([]);
2351+
});
2352+
});
23172353
});

0 commit comments

Comments
 (0)