|
| 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 | + ); |
0 commit comments