Skip to content

Commit

Permalink
feat: Add unichain berachain to EZETH and EZETHSTAGE (#5423)
Browse files Browse the repository at this point in the history
### Description
This PR adds Unichain and Berchain to EZETH and EZETHSTAGE

### Drive-by changes
- Add try-catch to `submitWarpApplyTransactions()`
- Add zsh script to call transferRemote with forked networks

### Related issues

- Fixes #5422

### Backward compatibility
Yes

### Testing
Deployment tested with shell script to test outbound (transferRemote),
Checker with fork
  • Loading branch information
ltyu authored Feb 11, 2025
1 parent 7d131d0 commit 7dd1f64
Show file tree
Hide file tree
Showing 11 changed files with 92 additions and 41 deletions.
5 changes: 5 additions & 0 deletions .changeset/violet-peas-raise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hyperlane-xyz/cli': minor
---

Update submitWarpApplyTransactions() to try-catch and print safe errors
2 changes: 1 addition & 1 deletion typescript/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"dependencies": {
"@aws-sdk/client-kms": "^3.577.0",
"@aws-sdk/client-s3": "^3.577.0",
"@hyperlane-xyz/registry": "9.3.0",
"@hyperlane-xyz/registry": "9.4.0",
"@hyperlane-xyz/sdk": "8.6.1",
"@hyperlane-xyz/utils": "8.6.1",
"@inquirer/core": "9.0.10",
Expand Down
51 changes: 28 additions & 23 deletions typescript/cli/src/deploy/warp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1018,29 +1018,34 @@ async function submitWarpApplyTransactions(

await promiseObjAll(
objMap(chainTransactions, async (chainId, transactions) => {
await retryAsync(
async () => {
const chain = chainIdToName[chainId];
const submitter: TxSubmitterBuilder<ProtocolType> =
await getWarpApplySubmitter({
chain,
context: params.context,
strategyUrl: params.strategyUrl,
});
const transactionReceipts = await submitter.submit(...transactions);
if (transactionReceipts) {
const receiptPath = `${params.receiptsDir}/${chain}-${
submitter.txSubmitterType
}-${Date.now()}-receipts.json`;
writeYamlOrJson(receiptPath, transactionReceipts);
logGreen(
`Transactions receipts successfully written to ${receiptPath}`,
);
}
},
5, // attempts
100, // baseRetryMs
);
try {
await retryAsync(
async () => {
const chain = chainIdToName[chainId];
const submitter: TxSubmitterBuilder<ProtocolType> =
await getWarpApplySubmitter({
chain,
context: params.context,
strategyUrl: params.strategyUrl,
});
const transactionReceipts = await submitter.submit(...transactions);
if (transactionReceipts) {
const receiptPath = `${params.receiptsDir}/${chain}-${
submitter.txSubmitterType
}-${Date.now()}-receipts.json`;
writeYamlOrJson(receiptPath, transactionReceipts);
logGreen(
`Transactions receipts successfully written to ${receiptPath}`,
);
}
},
5, // attempts
100, // baseRetryMs
);
} catch (e) {
logBlue(`Error in submitWarpApplyTransactions`, e);
console.dir(transactions);
}
}),
);
}
Expand Down
2 changes: 1 addition & 1 deletion typescript/helloworld/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "8.6.1",
"dependencies": {
"@hyperlane-xyz/core": "5.11.3",
"@hyperlane-xyz/registry": "9.3.0",
"@hyperlane-xyz/registry": "9.4.0",
"@hyperlane-xyz/sdk": "8.6.1",
"@openzeppelin/contracts-upgradeable": "^4.9.3",
"ethers": "^5.7.2"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
chainsToDeploy,
getRenzoEZETHWarpConfigGenerator,
getRenzoGnosisSafeBuilderStrategyConfigGenerator,
} from './getRenzoEZETHWarpConfig.js';

const xERC20: Record<(typeof chainsToDeploy)[number], string> = {
Expand All @@ -17,6 +18,8 @@ const xERC20: Record<(typeof chainsToDeploy)[number], string> = {
taiko: '0x585afea249031Ea4168A379F664e91dFc5F77E7D',
sei: '0x585afea249031Ea4168A379F664e91dFc5F77E7D',
swell: '0x585afea249031Ea4168A379F664e91dFc5F77E7D',
unichain: '0x585afea249031Ea4168A379F664e91dFc5F77E7D',
berachain: '0x585afea249031Ea4168A379F664e91dFc5F77E7D',
};

export const ezEthSafes: Record<(typeof chainsToDeploy)[number], string> = {
Expand All @@ -33,6 +36,8 @@ export const ezEthSafes: Record<(typeof chainsToDeploy)[number], string> = {
taiko: '0x31FF35F84ADB120DbE089D190F03Ac74731Ae83F',
sei: '0xa30FF77d30Eb2d785f574344B4D11CAAe1949807',
swell: '0xf40b75fb85C3bEc70D75A1B45ef08FC48Db61115',
unichain: '0xa7eccdb9be08178f896c26b7bbd8c3d4e844d9ba',
berachain: '0xf013c8Be28421b050cca5bD95cc57Af49568e8be',
};

const xERC20StagingLockbox = '0x74c8290836612e6251E49e8f3198fdD80C4DbEB8';
Expand All @@ -41,3 +46,6 @@ export const getRenzoEZETHSTAGEWarpConfig = getRenzoEZETHWarpConfigGenerator(
xERC20,
xERC20StagingLockbox,
);

export const getRenzoGnosisSafeBuilderStagingStrategyConfig =
getRenzoGnosisSafeBuilderStrategyConfigGenerator(ezEthSafes);
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export const chainsToDeploy = [
'taiko',
'sei',
'swell',
'unichain',
'berachain',
];
export const MAX_PROTOCOL_FEE = parseEther('100').toString(); // Changing this will redeploy the PROTOCOL_FEE hook

Expand All @@ -50,6 +52,8 @@ const tokenPrices: ChainMap<string> = {
taiko: '3157.26',
sei: '0.354988',
swell: '3157.26',
unichain: '2602.66',
berachain: '10',
};
export function getProtocolFee(chain: ChainName) {
return (0.5 / Number(tokenPrices[chain])).toFixed(10).toString(); // ~$0.50 USD
Expand Down Expand Up @@ -93,6 +97,8 @@ const xERC20: Record<(typeof chainsToDeploy)[number], string> = {
taiko: '0x2416092f143378750bb29b79eD961ab195CcEea5',
sei: '0x6DCfbF4729890043DFd34A93A2694E5303BA2703', // redEth
swell: '0x2416092f143378750bb29b79eD961ab195CcEea5',
unichain: '0x2416092f143378750bb29b79eD961ab195CcEea5',
berachain: '0x2416092f143378750bb29b79eD961ab195CcEea5',
};

export const ezEthValidators: ChainMap<MultisigConfig> = {
Expand Down Expand Up @@ -226,6 +232,26 @@ export const ezEthValidators: ChainMap<MultisigConfig> = {
{ address: '0xb6b9b4bd4eb6eb3aef5e9826e7f8b8455947f67c', alias: 'Renzo' },
],
},
unichain: {
threshold: 1,
validators: [
{
address: '0xa9d517776fe8beba7d67c21cac1e805bd609c08e',
alias: 'Luganodes',
},
{ address: '0xfe318024ca6197f2157905209149067a11e6982c', alias: 'Renzo' },
],
},
berachain: {
threshold: 1,
validators: [
{
address: '0xa7341aa60faad0ce728aa9aeb67bb880f55e4392',
alias: 'Luganodes',
},
{ address: '0xae09cb3febc4cad59ef5a56c1df741df4eb1f4b6', alias: 'Renzo' },
],
},
};

export const ezEthSafes: Record<(typeof chainsToDeploy)[number], string> = {
Expand All @@ -242,6 +268,8 @@ export const ezEthSafes: Record<(typeof chainsToDeploy)[number], string> = {
taiko: '0x8410927C286A38883BC23721e640F31D3E3E79F8',
sei: '0x0e60fd361fF5b90088e1782e6b21A7D177d462C5',
swell: '0x435E8c9652Da151292F3981bbf663EBEB6668501',
unichain: '0x70aF964829DA7F3f51973EE806AEeAB9225F2661',
berachain: '0x865BA5789D82F2D4C5595a3968dad729A8C3daE6',
};

const existingProxyAdmins: ChainMap<{ address: string; owner: string }> = {
Expand Down
4 changes: 2 additions & 2 deletions typescript/infra/config/environments/mainnet3/warp/warpIds.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export enum WarpRouteIds {
Ancient8EthereumUSDC = 'USDC/ancient8-ethereum',
ArbitrumBaseBlastBscEthereumFraxtalLineaModeOptimismSeiSwellTaikoZircuitEZETH = 'EZETH/arbitrum-base-blast-bsc-ethereum-fraxtal-linea-mode-optimism-sei-swell-taiko-zircuit',
ArbitrumBaseBlastBscEthereumFraxtalLineaModeOptimismSeiSwellTaikoZircuitEZETHSTAGE = 'EZETHSTAGE/arbitrum-base-blast-bsc-ethereum-fraxtal-linea-mode-optimism-sei-swell-taiko-zircuit',
ArbitrumBaseBerachainBlastBscEthereumFraxtalLineaModeOptimismSeiSwellTaikoUnichainZircuitEZETH = 'EZETH/arbitrum-base-berachain-blast-bsc-ethereum-fraxtal-linea-mode-optimism-sei-swell-taiko-unichain-zircuit',
ArbitrumBaseBerachainBlastBscEthereumFraxtalLineaModeOptimismSeiSwellTaikoUnichainZircuitEZETHSTAGE = 'EZETHSTAGE/arbitrum-base-berachain-blast-bsc-ethereum-fraxtal-linea-mode-optimism-sei-swell-taiko-unichain-zircuit',
ArbitrumBaseEnduranceUSDC = 'USDC/arbitrum-base-endurance',
ArbitrumEthereumZircuitAMPHRETH = 'AMPHRETH/arbitrum-ethereum-zircuit',
ArbitrumNeutronEclip = 'ECLIP/arbitrum-neutron',
Expand Down
13 changes: 9 additions & 4 deletions typescript/infra/config/warp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ import { getEthereumVictionUSDTWarpConfig } from './environments/mainnet3/warp/c
import { getEthereumZircuitRe7LRTWarpConfig } from './environments/mainnet3/warp/configGetters/getEthereumZircuitRe7LRTWarpConfig.js';
import { getInevmInjectiveINJWarpConfig } from './environments/mainnet3/warp/configGetters/getInevmInjectiveINJWarpConfig.js';
import { getMantapacificNeutronTiaWarpConfig } from './environments/mainnet3/warp/configGetters/getMantapacificNeutronTiaWarpConfig.js';
import { getRenzoEZETHSTAGEWarpConfig } from './environments/mainnet3/warp/configGetters/getRenzoEZETHSTAGEWarpConfig.js';
import {
getRenzoEZETHSTAGEWarpConfig,
getRenzoGnosisSafeBuilderStagingStrategyConfig,
} from './environments/mainnet3/warp/configGetters/getRenzoEZETHSTAGEWarpConfig.js';
import {
getRenzoEZETHWarpConfig,
getRenzoGnosisSafeBuilderStrategyConfig,
Expand All @@ -64,9 +67,9 @@ export const warpConfigGetterMap: Record<string, WarpConfigGetter> = {
[WarpRouteIds.EthereumInevmUSDC]: getEthereumInevmUSDCWarpConfig,
[WarpRouteIds.EthereumInevmUSDT]: getEthereumInevmUSDTWarpConfig,
[WarpRouteIds.ArbitrumNeutronTIA]: getArbitrumNeutronTiaWarpConfig,
[WarpRouteIds.ArbitrumBaseBlastBscEthereumFraxtalLineaModeOptimismSeiSwellTaikoZircuitEZETH]:
[WarpRouteIds.ArbitrumBaseBerachainBlastBscEthereumFraxtalLineaModeOptimismSeiSwellTaikoUnichainZircuitEZETH]:
getRenzoEZETHWarpConfig,
[WarpRouteIds.ArbitrumBaseBlastBscEthereumFraxtalLineaModeOptimismSeiSwellTaikoZircuitEZETHSTAGE]:
[WarpRouteIds.ArbitrumBaseBerachainBlastBscEthereumFraxtalLineaModeOptimismSeiSwellTaikoUnichainZircuitEZETHSTAGE]:
getRenzoEZETHSTAGEWarpConfig,
[WarpRouteIds.InevmInjectiveINJ]: getInevmInjectiveINJWarpConfig,
[WarpRouteIds.ArbitrumAvalancheBaseFlowmainnetFormOptimismSolanamainnetWorldchainTRUMP]:
Expand Down Expand Up @@ -101,8 +104,10 @@ export const warpConfigGetterMap: Record<string, WarpConfigGetter> = {

type StrategyConfigGetter = () => ChainSubmissionStrategy;
export const strategyConfigGetterMap: Record<string, StrategyConfigGetter> = {
[WarpRouteIds.ArbitrumBaseBlastBscEthereumFraxtalLineaModeOptimismSeiSwellTaikoZircuitEZETH]:
[WarpRouteIds.ArbitrumBaseBerachainBlastBscEthereumFraxtalLineaModeOptimismSeiSwellTaikoUnichainZircuitEZETH]:
getRenzoGnosisSafeBuilderStrategyConfig,
[WarpRouteIds.ArbitrumBaseBerachainBlastBscEthereumFraxtalLineaModeOptimismSeiSwellTaikoUnichainZircuitEZETHSTAGE]:
getRenzoGnosisSafeBuilderStagingStrategyConfig,
};

/**
Expand Down
2 changes: 1 addition & 1 deletion typescript/infra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@google-cloud/secret-manager": "^5.5.0",
"@hyperlane-xyz/cli": "8.6.1",
"@hyperlane-xyz/helloworld": "8.6.1",
"@hyperlane-xyz/registry": "9.3.0",
"@hyperlane-xyz/registry": "9.4.0",
"@hyperlane-xyz/sdk": "8.6.1",
"@hyperlane-xyz/utils": "8.6.1",
"@inquirer/prompts": "3.3.2",
Expand Down
2 changes: 1 addition & 1 deletion typescript/widgets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0",
"@eslint/js": "^9.15.0",
"@hyperlane-xyz/registry": "9.3.0",
"@hyperlane-xyz/registry": "9.4.0",
"@storybook/addon-essentials": "^7.6.14",
"@storybook/addon-interactions": "^7.6.14",
"@storybook/addon-links": "^7.6.14",
Expand Down
16 changes: 8 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7320,7 +7320,7 @@ __metadata:
"@eslint/js": "npm:^9.15.0"
"@ethersproject/abi": "npm:*"
"@ethersproject/providers": "npm:*"
"@hyperlane-xyz/registry": "npm:9.3.0"
"@hyperlane-xyz/registry": "npm:9.4.0"
"@hyperlane-xyz/sdk": "npm:8.6.1"
"@hyperlane-xyz/utils": "npm:8.6.1"
"@inquirer/core": "npm:9.0.10"
Expand Down Expand Up @@ -7425,7 +7425,7 @@ __metadata:
dependencies:
"@eslint/js": "npm:^9.15.0"
"@hyperlane-xyz/core": "npm:5.11.3"
"@hyperlane-xyz/registry": "npm:9.3.0"
"@hyperlane-xyz/registry": "npm:9.4.0"
"@hyperlane-xyz/sdk": "npm:8.6.1"
"@nomiclabs/hardhat-ethers": "npm:^2.2.3"
"@nomiclabs/hardhat-waffle": "npm:^2.0.6"
Expand Down Expand Up @@ -7477,7 +7477,7 @@ __metadata:
"@google-cloud/secret-manager": "npm:^5.5.0"
"@hyperlane-xyz/cli": "npm:8.6.1"
"@hyperlane-xyz/helloworld": "npm:8.6.1"
"@hyperlane-xyz/registry": "npm:9.3.0"
"@hyperlane-xyz/registry": "npm:9.4.0"
"@hyperlane-xyz/sdk": "npm:8.6.1"
"@hyperlane-xyz/utils": "npm:8.6.1"
"@inquirer/prompts": "npm:3.3.2"
Expand Down Expand Up @@ -7540,13 +7540,13 @@ __metadata:
languageName: unknown
linkType: soft

"@hyperlane-xyz/registry@npm:9.3.0":
version: 9.3.0
resolution: "@hyperlane-xyz/registry@npm:9.3.0"
"@hyperlane-xyz/registry@npm:9.4.0":
version: 9.4.0
resolution: "@hyperlane-xyz/registry@npm:9.4.0"
dependencies:
yaml: "npm:2.4.5"
zod: "npm:^3.21.2"
checksum: 10/22d34cf5b002b9bca751dbfcc5ba0ea1cb145b0f1e9394c9a6fa4b80d84cc0f9b8f1461c9aed902892b6d351cfd7aaf77484f0db531aa913e646086ac467e80f
checksum: 10/13eb3ed671d70cc4b66a3546eb54b82e5606aed6c97cea82df54208415941026aab809ac434208a15b698d1b9fe88a828ce2e2b2d64239a6ca60d0dc2666c2fb
languageName: node
linkType: hard

Expand Down Expand Up @@ -7645,7 +7645,7 @@ __metadata:
"@emotion/styled": "npm:^11.13.0"
"@eslint/js": "npm:^9.15.0"
"@headlessui/react": "npm:^2.1.8"
"@hyperlane-xyz/registry": "npm:9.3.0"
"@hyperlane-xyz/registry": "npm:9.4.0"
"@hyperlane-xyz/sdk": "npm:8.6.1"
"@hyperlane-xyz/utils": "npm:8.6.1"
"@interchain-ui/react": "npm:^1.23.28"
Expand Down

0 comments on commit 7dd1f64

Please sign in to comment.