-
Notifications
You must be signed in to change notification settings - Fork 395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(infra): added the getEthereumFormUSDTWarpConfig func #5056
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import { ethers } from 'ethers'; | ||
|
||
import { ChainMap, HypTokenRouterConfig, TokenType } from '@hyperlane-xyz/sdk'; | ||
import { Address } from '@hyperlane-xyz/utils'; | ||
|
||
import { | ||
RouterConfigWithoutOwner, | ||
tokens, | ||
} from '../../../../../src/config/warp.js'; | ||
|
||
const safeOwners: ChainMap<Address> = { | ||
ethereum: '0xec5ad23e29203301B2C1a765718Cc1de7A8d3FbF', | ||
form: '0x41B624412B529409A437f08Ef80bCabE81053650', | ||
}; | ||
|
||
export const getEthereumFormUSDCWarpConfig = async ( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. would probably prefer us to split out these into their own files to stick with the pattern. We can ofc import the owners from one of them into the other |
||
routerConfig: ChainMap<RouterConfigWithoutOwner>, | ||
): Promise<ChainMap<HypTokenRouterConfig>> => { | ||
const ethereum: HypTokenRouterConfig = { | ||
mailbox: routerConfig.ethereum.mailbox, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we do the
pattern that we've been generally using instead of specifying |
||
owner: safeOwners.ethereum, | ||
type: TokenType.collateral, | ||
token: tokens.ethereum.USDC, | ||
interchainSecurityModule: ethers.constants.AddressZero, | ||
}; | ||
|
||
// FiatTokenProxy 0xFBf489bb4783D4B1B2e7D07ba39873Fb8068507D | ||
// MasterMinter 0x9Dec8Dfafcce2d45E8FF8C7792DB1D704AB1dc9D | ||
const form: HypTokenRouterConfig = { | ||
mailbox: routerConfig.form.mailbox, | ||
owner: safeOwners.form, | ||
type: TokenType.collateralFiat, | ||
token: '0xFBf489bb4783D4B1B2e7D07ba39873Fb8068507D', | ||
interchainSecurityModule: ethers.constants.AddressZero, | ||
}; | ||
|
||
return { | ||
ethereum, | ||
form, | ||
}; | ||
}; | ||
|
||
export const getEthereumFormUSDTWarpConfig = async ( | ||
routerConfig: ChainMap<RouterConfigWithoutOwner>, | ||
): Promise<ChainMap<HypTokenRouterConfig>> => { | ||
const ethereum: HypTokenRouterConfig = { | ||
mailbox: routerConfig.ethereum.mailbox, | ||
owner: safeOwners.ethereum, | ||
type: TokenType.collateral, | ||
token: tokens.ethereum.USDT, | ||
interchainSecurityModule: ethers.constants.AddressZero, | ||
}; | ||
|
||
const form: HypTokenRouterConfig = { | ||
mailbox: routerConfig.form.mailbox, | ||
owner: safeOwners.form, | ||
type: TokenType.synthetic, | ||
interchainSecurityModule: ethers.constants.AddressZero, | ||
}; | ||
|
||
return { | ||
ethereum, | ||
form, | ||
}; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a comment on who owns these