-
Notifications
You must be signed in to change notification settings - Fork 412
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(infra): added the getEthereumFormUSDTWarpConfig func (#5056)
### Description Adds the warp route config getter for the USDT route on Form network associated registry PR hyperlane-xyz/hyperlane-registry#449 ### Drive-by changes - NO ### Backward compatibility -YES ### Testing - Manual --------- Co-authored-by: nambrot <[email protected]>
- Loading branch information
Showing
6 changed files
with
91 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
9d7868fa55b97d610c9c1916d22d71d3e67b5aa8 | ||
195c073c3c34b234c8d0aed2a16962a2d3945354 |
43 changes: 43 additions & 0 deletions
43
...pt/infra/config/environments/mainnet3/warp/configGetters/getEthereumFormUSDCWarpConfig.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { ethers } from 'ethers'; | ||
|
||
import { ChainMap, HypTokenRouterConfig, TokenType } from '@hyperlane-xyz/sdk'; | ||
import { Address } from '@hyperlane-xyz/utils'; | ||
|
||
import { getOwnerConfigForAddress } from '../../../../../src/config/environment.js'; | ||
import { | ||
RouterConfigWithoutOwner, | ||
tokens, | ||
} from '../../../../../src/config/warp.js'; | ||
|
||
// Safes from the FORM team | ||
const safeOwners: ChainMap<Address> = { | ||
ethereum: '0xec5ad23e29203301B2C1a765718Cc1de7A8d3FbF', | ||
form: '0x41B624412B529409A437f08Ef80bCabE81053650', | ||
}; | ||
|
||
export const getEthereumFormUSDCWarpConfig = async ( | ||
routerConfig: ChainMap<RouterConfigWithoutOwner>, | ||
): Promise<ChainMap<HypTokenRouterConfig>> => { | ||
const ethereum: HypTokenRouterConfig = { | ||
...routerConfig.ethereum, | ||
...getOwnerConfigForAddress(safeOwners.ethereum), | ||
type: TokenType.collateral, | ||
token: tokens.ethereum.USDC, | ||
interchainSecurityModule: ethers.constants.AddressZero, | ||
}; | ||
|
||
// FiatTokenProxy 0xFBf489bb4783D4B1B2e7D07ba39873Fb8068507D | ||
// MasterMinter 0x9Dec8Dfafcce2d45E8FF8C7792DB1D704AB1dc9D | ||
const form: HypTokenRouterConfig = { | ||
...routerConfig.form, | ||
...getOwnerConfigForAddress(safeOwners.form), | ||
type: TokenType.collateralFiat, | ||
token: '0xFBf489bb4783D4B1B2e7D07ba39873Fb8068507D', | ||
interchainSecurityModule: ethers.constants.AddressZero, | ||
}; | ||
|
||
return { | ||
ethereum, | ||
form, | ||
}; | ||
}; |
40 changes: 40 additions & 0 deletions
40
...pt/infra/config/environments/mainnet3/warp/configGetters/getEthereumFormUSDTWarpConfig.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { ethers } from 'ethers'; | ||
|
||
import { ChainMap, HypTokenRouterConfig, TokenType } from '@hyperlane-xyz/sdk'; | ||
import { Address } from '@hyperlane-xyz/utils'; | ||
|
||
import { getOwnerConfigForAddress } from '../../../../../src/config/environment.js'; | ||
import { | ||
RouterConfigWithoutOwner, | ||
tokens, | ||
} from '../../../../../src/config/warp.js'; | ||
|
||
// Safes from the FORM team | ||
const safeOwners: ChainMap<Address> = { | ||
ethereum: '0xec5ad23e29203301B2C1a765718Cc1de7A8d3FbF', | ||
form: '0x41B624412B529409A437f08Ef80bCabE81053650', | ||
}; | ||
|
||
export const getEthereumFormUSDTWarpConfig = async ( | ||
routerConfig: ChainMap<RouterConfigWithoutOwner>, | ||
): Promise<ChainMap<HypTokenRouterConfig>> => { | ||
const ethereum: HypTokenRouterConfig = { | ||
...routerConfig.ethereum, | ||
...getOwnerConfigForAddress(safeOwners.ethereum), | ||
type: TokenType.collateral, | ||
token: tokens.ethereum.USDT, | ||
interchainSecurityModule: ethers.constants.AddressZero, | ||
}; | ||
|
||
const form: HypTokenRouterConfig = { | ||
...routerConfig.form, | ||
...getOwnerConfigForAddress(safeOwners.form), | ||
type: TokenType.synthetic, | ||
interchainSecurityModule: ethers.constants.AddressZero, | ||
}; | ||
|
||
return { | ||
ethereum, | ||
form, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters