-
Notifications
You must be signed in to change notification settings - Fork 371
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add Zerion config generator (#4870)
### Description Adds Zero config generators for USDB, WBTC, BNB, Pol ### Drive-by changes - Conditional for address zero check ### Backward compatibility Yes ### Testing Manual
- Loading branch information
Showing
9 changed files
with
167 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@hyperlane-xyz/infra': minor | ||
'@hyperlane-xyz/sdk': minor | ||
--- | ||
|
||
Add Zerion deployments: WBTC, POL, BNB, USDB |
31 changes: 31 additions & 0 deletions
31
...nfra/config/environments/mainnet3/warp/configGetters/getBlastZeroNetworkUSDBWarpConfig.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,31 @@ | ||
import { ethers } from 'ethers'; | ||
|
||
import { | ||
ChainMap, | ||
RouterConfig, | ||
TokenRouterConfig, | ||
TokenType, | ||
} from '@hyperlane-xyz/sdk'; | ||
|
||
import { tokens } from '../../../../../src/config/warp.js'; | ||
|
||
export const getBlastZeroNetworkUSDBWarpConfig = async ( | ||
routerConfig: ChainMap<RouterConfig>, | ||
): Promise<ChainMap<TokenRouterConfig>> => { | ||
const blast: TokenRouterConfig = { | ||
...routerConfig.blast, | ||
type: TokenType.collateral, | ||
token: tokens.blast.usdb, | ||
interchainSecurityModule: ethers.constants.AddressZero, | ||
}; | ||
|
||
const zeronetwork: TokenRouterConfig = { | ||
...routerConfig.zeronetwork, | ||
type: TokenType.synthetic, | ||
interchainSecurityModule: ethers.constants.AddressZero, | ||
}; | ||
return { | ||
blast, | ||
zeronetwork, | ||
}; | ||
}; |
28 changes: 28 additions & 0 deletions
28
...cript/infra/config/environments/mainnet3/warp/configGetters/getBscZeroNetworkBNBConfig.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,28 @@ | ||
import { ethers } from 'ethers'; | ||
|
||
import { | ||
ChainMap, | ||
RouterConfig, | ||
TokenRouterConfig, | ||
TokenType, | ||
} from '@hyperlane-xyz/sdk'; | ||
|
||
export const getBscZeroNetworkBNBWarpConfig = async ( | ||
routerConfig: ChainMap<RouterConfig>, | ||
): Promise<ChainMap<TokenRouterConfig>> => { | ||
const bsc: TokenRouterConfig = { | ||
...routerConfig.bsc, | ||
type: TokenType.native, | ||
interchainSecurityModule: ethers.constants.AddressZero, | ||
}; | ||
|
||
const zeronetwork: TokenRouterConfig = { | ||
...routerConfig.zeronetwork, | ||
type: TokenType.synthetic, | ||
interchainSecurityModule: ethers.constants.AddressZero, | ||
}; | ||
return { | ||
bsc, | ||
zeronetwork, | ||
}; | ||
}; |
53 changes: 53 additions & 0 deletions
53
...ig/environments/mainnet3/warp/configGetters/getEthereumModeScrollZeronetworkWBTCConfig.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,53 @@ | ||
import { ethers } from 'ethers'; | ||
|
||
import { | ||
ChainMap, | ||
RouterConfig, | ||
TokenRouterConfig, | ||
TokenType, | ||
} from '@hyperlane-xyz/sdk'; | ||
import { Address } from '@hyperlane-xyz/utils'; | ||
|
||
const collateralAddresses: ChainMap<Address> = { | ||
ethereum: '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599', | ||
mode: '0xcDd475325D6F564d27247D1DddBb0DAc6fA0a5CF', | ||
scroll: '0x3C1BCa5a656e69edCD0D4E36BEbb3FcDAcA60Cf1', | ||
}; | ||
|
||
export const getEthereumModeScrollZeronetworkWBTCConfig = async ( | ||
routerConfig: ChainMap<RouterConfig>, | ||
): Promise<ChainMap<TokenRouterConfig>> => { | ||
const ethereum: TokenRouterConfig = { | ||
...routerConfig.ethereum, | ||
type: TokenType.collateral, | ||
token: collateralAddresses.ethereum, | ||
interchainSecurityModule: ethers.constants.AddressZero, | ||
}; | ||
|
||
const mode: TokenRouterConfig = { | ||
...routerConfig.mode, | ||
type: TokenType.collateral, | ||
token: collateralAddresses.mode, | ||
interchainSecurityModule: ethers.constants.AddressZero, | ||
}; | ||
|
||
const scroll: TokenRouterConfig = { | ||
...routerConfig.scroll, | ||
type: TokenType.collateral, | ||
token: collateralAddresses.scroll, | ||
interchainSecurityModule: ethers.constants.AddressZero, | ||
}; | ||
|
||
const zeronetwork: TokenRouterConfig = { | ||
...routerConfig.zeronetwork, | ||
type: TokenType.synthetic, | ||
interchainSecurityModule: ethers.constants.AddressZero, | ||
}; | ||
|
||
return { | ||
ethereum, | ||
mode, | ||
scroll, | ||
zeronetwork, | ||
}; | ||
}; |
28 changes: 28 additions & 0 deletions
28
...t/infra/config/environments/mainnet3/warp/configGetters/getPolygonZeroNetworkPolConfig.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,28 @@ | ||
import { ethers } from 'ethers'; | ||
|
||
import { | ||
ChainMap, | ||
RouterConfig, | ||
TokenRouterConfig, | ||
TokenType, | ||
} from '@hyperlane-xyz/sdk'; | ||
|
||
export const getPolygonZeroNetworkPolWarpConfig = async ( | ||
routerConfig: ChainMap<RouterConfig>, | ||
): Promise<ChainMap<TokenRouterConfig>> => { | ||
const polygon: TokenRouterConfig = { | ||
...routerConfig.polygon, | ||
type: TokenType.native, | ||
interchainSecurityModule: ethers.constants.AddressZero, | ||
}; | ||
|
||
const zeronetwork: TokenRouterConfig = { | ||
...routerConfig.zeronetwork, | ||
type: TokenType.synthetic, | ||
interchainSecurityModule: ethers.constants.AddressZero, | ||
}; | ||
return { | ||
polygon, | ||
zeronetwork, | ||
}; | ||
}; |
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
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