From 2b3696371956609a714b88f031dff66e9b3df66e Mon Sep 17 00:00:00 2001
From: Le Yu <6251863+ltyu@users.noreply.github.com>
Date: Thu, 26 Dec 2024 18:28:42 -0500
Subject: [PATCH 1/3] Split safes and tokens to separate environments (staging
and prod). Add pzEth getter
---
.../config/environments/mainnet3/owners.ts | 87 +++++++-----
.../configGetters/getRenzoPZETHWarpConfig.ts | 133 +++++++++++++++---
.../environments/mainnet3/warp/warpIds.ts | 1 +
typescript/infra/config/warp.ts | 7 +-
.../infra/scripts/safes/delete-pending-txs.ts | 2 +-
typescript/infra/scripts/safes/delete-tx.ts | 2 +-
.../infra/scripts/safes/get-pending-txs.ts | 10 +-
.../infra/src/tx/govern-transaction-reader.ts | 4 +-
8 files changed, 183 insertions(+), 63 deletions(-)
diff --git a/typescript/infra/config/environments/mainnet3/owners.ts b/typescript/infra/config/environments/mainnet3/owners.ts
index 01fe1e84b5..4cfd61ff9c 100644
--- a/typescript/infra/config/environments/mainnet3/owners.ts
+++ b/typescript/infra/config/environments/mainnet3/owners.ts
@@ -23,40 +23,55 @@ export function localAccountRouters(): ChainMap
{
);
}
-export const safes: ChainMap = {
- mantapacific: '0x03ed2D65f2742193CeD99D48EbF1F1D6F12345B6', // does not have a UI
- celo: '0x879038d6Fc9F6D5e2BA73188bd078486d77e1156',
- ethereum: '0x3965AC3D295641E452E0ea896a086A9cD7C6C5b6',
- avalanche: '0x5bE94B17112B8F18eA9Ac8e559377B467556a3c3',
- polygon: '0xf9cFD440CfBCfAB8473cc156485B7eE753b2913E',
- bsc: '0x7bB2ADeDdC342ffb611dDC073095cc4B8C547170',
- arbitrum: '0x03fD5BE9DF85F0017dC7F4DC3068dDF64fffF25e',
- optimism: '0xbd7db3821806bc72D223F0AE521Bf82FcBd6Ef4d',
- moonbeam: '0x594203849E52BF6ee0E511cD807Ca2D658893e37',
- gnosis: '0x0Ac72fBc82c9c39F81242229631dfC38aA13031B',
- inevm: '0x77F3863ea99F2360D84d4BA1A2E441857D0357fa', // caldera + injective
- base: '0x3949eD0CD036D9FF662d97BD7aC1686051c4aeBF',
- scroll: '0x6EeEbB9F7FB18DD5E59F82658c59B846715eD4F7',
- polygonzkevm: '0x1610f578D4d77Fc4ae7ce2DD9AA0b98A5Cd0a9b2',
- // injective: 'inj1632x8j35kenryam3mkrsez064sqg2y2fr0frzt',
- // solana: 'EzppBFV2taxWw8kEjxNYvby6q7W1biJEqwP3iC7YgRe3',
- blast: '0xaCD1865B262C89Fb0b50dcc8fB095330ae8F35b5',
- linea: '0xaCD1865B262C89Fb0b50dcc8fB095330ae8F35b5',
- mode: '0xaCD1865B262C89Fb0b50dcc8fB095330ae8F35b5',
- ancient8: '0xD2BFA0F0654E3f2139b8cDC56c32eeC54D32b133',
- taiko: '0xa4864301d3fa2a3e68256309F9F0F570270a1BD0',
- fraxtal: '0x66e9f52800E9F89F0569fddc594Acd5EE609f762',
- sei: '0xCed197FBc360C26C19889745Cf73511b71D03d5D',
- redstone: '0xa1a50ff5FD859558E1899fEC5C3064483177FA23',
- mantle: '0x8aFE6EECc6CcB02aA20DA8Fff7d29aadEBbc2DCd',
- bob: '0x9e2fe7723b018d02cDE4f5cC1A9bC9C65b922Fc8',
- zetachain: '0x9d399876522Fc5C044D048594de399A2349d6026',
- zoramainnet: '0xF87018025575552889062De4b05bBC3DAe35Cd96',
- fusemainnet: '0x29a526227CB864C90Cf078d03872da913B473139',
- endurance: '0xaCD1865B262C89Fb0b50dcc8fB095330ae8F35b5',
- zircuit: '0x9e2fe7723b018d02cDE4f5cC1A9bC9C65b922Fc8',
- zeronetwork: '0xCB21F61A3c8139F18e635d45aD1e62A4A61d2c3D',
- swell: '0x5F7771EA40546e2932754C263455Cb0023a55ca7',
+export const safes: Record<'staging' | 'prod', ChainMap> = {
+ staging: {
+ ethereum: '0xA9421c6F339eC414b7e77449986bE9C2Ae430C25',
+ bsc: '0xA9421c6F339eC414b7e77449986bE9C2Ae430C25',
+ arbitrum: '0xA9421c6F339eC414b7e77449986bE9C2Ae430C25',
+ optimism: '0xA9421c6F339eC414b7e77449986bE9C2Ae430C25',
+ blast: '0xA9421c6F339eC414b7e77449986bE9C2Ae430C25',
+ linea: '0xA9421c6F339eC414b7e77449986bE9C2Ae430C25',
+ base: '0xA9421c6F339eC414b7e77449986bE9C2Ae430C25',
+ mode: '0xf40b75fb85C3bEc70D75A1B45ef08FC48Db61115',
+ swell: '0xf40b75fb85C3bEc70D75A1B45ef08FC48Db61115',
+ fraxtal: '0xf40b75fb85C3bEc70D75A1B45ef08FC48Db61115',
+ zircuit: '0xf40b75fb85C3bEc70D75A1B45ef08FC48Db61115',
+ },
+ prod: {
+ mantapacific: '0x03ed2D65f2742193CeD99D48EbF1F1D6F12345B6', // does not have a UI
+ celo: '0x879038d6Fc9F6D5e2BA73188bd078486d77e1156',
+ ethereum: '0x3965AC3D295641E452E0ea896a086A9cD7C6C5b6',
+ avalanche: '0x5bE94B17112B8F18eA9Ac8e559377B467556a3c3',
+ polygon: '0xf9cFD440CfBCfAB8473cc156485B7eE753b2913E',
+ bsc: '0x7bB2ADeDdC342ffb611dDC073095cc4B8C547170',
+ arbitrum: '0x03fD5BE9DF85F0017dC7F4DC3068dDF64fffF25e',
+ optimism: '0xbd7db3821806bc72D223F0AE521Bf82FcBd6Ef4d',
+ moonbeam: '0x594203849E52BF6ee0E511cD807Ca2D658893e37',
+ gnosis: '0x0Ac72fBc82c9c39F81242229631dfC38aA13031B',
+ inevm: '0x77F3863ea99F2360D84d4BA1A2E441857D0357fa', // caldera + injective
+ base: '0x3949eD0CD036D9FF662d97BD7aC1686051c4aeBF',
+ scroll: '0x6EeEbB9F7FB18DD5E59F82658c59B846715eD4F7',
+ polygonzkevm: '0x1610f578D4d77Fc4ae7ce2DD9AA0b98A5Cd0a9b2',
+ // injective: 'inj1632x8j35kenryam3mkrsez064sqg2y2fr0frzt',
+ // solana: 'EzppBFV2taxWw8kEjxNYvby6q7W1biJEqwP3iC7YgRe3',
+ blast: '0xaCD1865B262C89Fb0b50dcc8fB095330ae8F35b5',
+ linea: '0xaCD1865B262C89Fb0b50dcc8fB095330ae8F35b5',
+ mode: '0xaCD1865B262C89Fb0b50dcc8fB095330ae8F35b5',
+ ancient8: '0xD2BFA0F0654E3f2139b8cDC56c32eeC54D32b133',
+ taiko: '0xa4864301d3fa2a3e68256309F9F0F570270a1BD0',
+ fraxtal: '0x66e9f52800E9F89F0569fddc594Acd5EE609f762',
+ sei: '0xCed197FBc360C26C19889745Cf73511b71D03d5D',
+ redstone: '0xa1a50ff5FD859558E1899fEC5C3064483177FA23',
+ mantle: '0x8aFE6EECc6CcB02aA20DA8Fff7d29aadEBbc2DCd',
+ bob: '0x9e2fe7723b018d02cDE4f5cC1A9bC9C65b922Fc8',
+ zetachain: '0x9d399876522Fc5C044D048594de399A2349d6026',
+ zoramainnet: '0xF87018025575552889062De4b05bBC3DAe35Cd96',
+ fusemainnet: '0x29a526227CB864C90Cf078d03872da913B473139',
+ endurance: '0xaCD1865B262C89Fb0b50dcc8fB095330ae8F35b5',
+ zircuit: '0x9e2fe7723b018d02cDE4f5cC1A9bC9C65b922Fc8',
+ zeronetwork: '0xCB21F61A3c8139F18e635d45aD1e62A4A61d2c3D',
+ swell: '0x5F7771EA40546e2932754C263455Cb0023a55ca7',
+ },
};
export const icaOwnerChain = 'ethereum';
@@ -194,7 +209,7 @@ export const DEPLOYER = '0xa7ECcdb9Be08178f896c26b7BbD8C3D4E844d9Ba';
export const ethereumChainOwners: ChainMap = Object.fromEntries(
ethereumChainNames.map((local) => {
- const owner = icas[local] ?? safes[local] ?? DEPLOYER;
+ const owner = icas[local] ?? safes.prod[local] ?? DEPLOYER;
return [
local,
@@ -209,7 +224,7 @@ export const ethereumChainOwners: ChainMap = Object.fromEntries(
// the checker/governor tooling does not know what type of owner it is.
// So we need to keep the Safe and ICA addresses somewhere in the config
// to be able to track down which addresses are SAFEs, ICAs, or standard SIGNERS.
- ...(safes[local] && { _safeAddress: safes[local] }),
+ ...(safes.prod[local] && { _safeAddress: safes.prod[local] }),
...(icas[local] && { _icaAddress: icas[local] }),
},
},
diff --git a/typescript/infra/config/environments/mainnet3/warp/configGetters/getRenzoPZETHWarpConfig.ts b/typescript/infra/config/environments/mainnet3/warp/configGetters/getRenzoPZETHWarpConfig.ts
index 6196031a8e..8523981462 100644
--- a/typescript/infra/config/environments/mainnet3/warp/configGetters/getRenzoPZETHWarpConfig.ts
+++ b/typescript/infra/config/environments/mainnet3/warp/configGetters/getRenzoPZETHWarpConfig.ts
@@ -10,6 +10,7 @@ import { assert, symmetricDifference } from '@hyperlane-xyz/utils';
import { getEnvironmentConfig } from '../../../../../scripts/core-utils.js';
import { getRegistry as getMainnet3Registry } from '../../chains.js';
+import { safes } from '../../owners.js';
import {
ezEthSafes,
@@ -17,8 +18,6 @@ import {
getRenzoHook,
} from './getRenzoEZETHWarpConfig.js';
-const lockbox = '0xbC5511354C4A9a50DE928F56DB01DD327c4e56d5';
-const xERC20 = '0x9cb41CD74D01ae4b4f640EC40f7A60cA1bCF83E7';
const lockboxChain = 'ethereum';
// over the default 100k to account for xerc20 gas + ISM overhead over the default ISM https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/49f41d9759fd515bfd89e6e22e799c41b27b4119/typescript/sdk/src/router/GasRouterDeployer.ts#L14
const warpRouteOverheadGas = 200_000;
@@ -31,26 +30,125 @@ const pzEthValidators = {
swell: ezEthValidators.swell,
};
-const pzEthSafes: Record = {
- ethereum: ezEthSafes.ethereum,
- zircuit: ezEthSafes.zircuit,
- swell: ezEthSafes.swell,
-};
+export const getRenzoPZETHWarpConfig = async (): Promise<
+ ChainMap
+> => {
+ const lockbox = '0xbC5511354C4A9a50DE928F56DB01DD327c4e56d5';
+ const xERC20 = '0x9cb41CD74D01ae4b4f640EC40f7A60cA1bCF83E7';
+
+ const pzEthSafes: Record = {
+ ethereum: ezEthSafes.ethereum,
+ zircuit: ezEthSafes.zircuit,
+ swell: ezEthSafes.swell,
+ };
+
+ const existingProxyAdmins: ChainMap<{ address: string; owner: string }> = {
+ ethereum: {
+ address: '0x4f4671Ce69c9af15e33eB7Cf6D1358d1B39Af3bF',
+ owner: '0xD1e6626310fD54Eceb5b9a51dA2eC329D6D4B68A',
+ },
+ zircuit: {
+ address: '0x8b789B4A56675240c9f0985B467752b870c75711',
+ owner: '0x8410927C286A38883BC23721e640F31D3E3E79F8',
+ },
+ };
+
+ const config = getEnvironmentConfig('mainnet3');
+ const multiProvider = await config.getMultiProvider();
+ const registry = await getMainnet3Registry();
+
+ const validatorDiff = symmetricDifference(
+ new Set(chainsToDeploy),
+ new Set(Object.keys(pzEthValidators)),
+ );
+ const safeDiff = symmetricDifference(
+ new Set(chainsToDeploy),
+ new Set(Object.keys(pzEthSafes)),
+ );
+ if (validatorDiff.size > 0) {
+ throw new Error(
+ `chainsToDeploy !== validatorConfig, diff is ${Array.from(
+ validatorDiff,
+ ).join(', ')}`,
+ );
+ }
+ if (safeDiff.size > 0) {
+ throw new Error(
+ `chainsToDeploy !== safeDiff, diff is ${Array.from(safeDiff).join(', ')}`,
+ );
+ }
+
+ const tokenConfig = Object.fromEntries(
+ await Promise.all(
+ chainsToDeploy.map(
+ async (chain): Promise<[string, HypTokenRouterConfig]> => {
+ const addresses = await registry.getChainAddresses(chain);
+ assert(addresses, 'No addresses in Registry');
+ const { mailbox } = addresses;
+
+ const mailboxContract = Mailbox__factory.connect(
+ mailbox,
+ multiProvider.getProvider(chain),
+ );
+ const defaultHook = await mailboxContract.defaultHook();
+ const ret: [string, HypTokenRouterConfig] = [
+ chain,
+ {
+ isNft: false,
+ type:
+ chain === lockboxChain
+ ? TokenType.XERC20Lockbox
+ : TokenType.XERC20,
+ token: chain === lockboxChain ? lockbox : xERC20,
+ owner: pzEthSafes[chain],
+ gas: warpRouteOverheadGas,
+ mailbox,
+ interchainSecurityModule: {
+ type: IsmType.AGGREGATION,
+ threshold: 2,
+ modules: [
+ {
+ type: IsmType.ROUTING,
+ owner: pzEthSafes[chain],
+ domains: buildAggregationIsmConfigs(
+ chain,
+ chainsToDeploy,
+ pzEthValidators,
+ ),
+ },
+ {
+ type: IsmType.FALLBACK_ROUTING,
+ domains: {},
+ owner: pzEthSafes[chain],
+ },
+ ],
+ },
+ hook: getRenzoHook(defaultHook, chain),
+ proxyAdmin: existingProxyAdmins[chain],
+ },
+ ];
-const existingProxyAdmins: ChainMap<{ address: string; owner: string }> = {
- ethereum: {
- address: '0x4f4671Ce69c9af15e33eB7Cf6D1358d1B39Af3bF',
- owner: '0xD1e6626310fD54Eceb5b9a51dA2eC329D6D4B68A',
- },
- zircuit: {
- address: '0x8b789B4A56675240c9f0985B467752b870c75711',
- owner: '0x8410927C286A38883BC23721e640F31D3E3E79F8',
- },
+ return ret;
+ },
+ ),
+ ),
+ );
+
+ return tokenConfig;
};
-export const getRenzoPZETHWarpConfig = async (): Promise<
+export const getRenzoPZETHWarpConfigStaging = async (): Promise<
ChainMap
> => {
+ const lockbox = '0xbC5511354C4A9a50DE928F56DB01DD327c4e56d5';
+ const xERC20 = '0x9cb41CD74D01ae4b4f640EC40f7A60cA1bCF83E7';
+
+ const pzEthSafes: Record = {
+ ethereum: safes.staging.ethereum,
+ zircuit: safes.staging.zircuit,
+ swell: safes.staging.swell,
+ };
+
const config = getEnvironmentConfig('mainnet3');
const multiProvider = await config.getMultiProvider();
const registry = await getMainnet3Registry();
@@ -122,7 +220,6 @@ export const getRenzoPZETHWarpConfig = async (): Promise<
],
},
hook: getRenzoHook(defaultHook, chain),
- proxyAdmin: existingProxyAdmins[chain],
},
];
diff --git a/typescript/infra/config/environments/mainnet3/warp/warpIds.ts b/typescript/infra/config/environments/mainnet3/warp/warpIds.ts
index 1cd98d1c8d..ac1526ae41 100644
--- a/typescript/infra/config/environments/mainnet3/warp/warpIds.ts
+++ b/typescript/infra/config/environments/mainnet3/warp/warpIds.ts
@@ -29,6 +29,7 @@ export enum WarpRouteIds {
EthereumVictionUSDC = 'USDC/ethereum-viction',
EthereumVictionUSDT = 'USDT/ethereum-viction',
EthereumSwellZircuitPZETH = 'PZETH/ethereum-swell-zircuit',
+ EthereumSwellZircuitPZETHStaging = 'PZETH/ethereum-swell-zircuit-staging',
EthereumBscLumiaLUMIA = 'LUMIA/bsc-ethereum-lumia',
EthereumZircuitRe7LRT = 'Re7LRT/ethereum-zircuit',
InevmInjectiveINJ = 'INJ/inevm-injective',
diff --git a/typescript/infra/config/warp.ts b/typescript/infra/config/warp.ts
index d87a010be1..9202b1ad2a 100644
--- a/typescript/infra/config/warp.ts
+++ b/typescript/infra/config/warp.ts
@@ -41,7 +41,10 @@ import { getEthereumZircuitRe7LRTWarpConfig } from './environments/mainnet3/warp
import { getInevmInjectiveINJWarpConfig } from './environments/mainnet3/warp/configGetters/getInevmInjectiveINJWarpConfig.js';
import { getMantapacificNeutronTiaWarpConfig } from './environments/mainnet3/warp/configGetters/getMantapacificNeutronTiaWarpConfig.js';
import { getRenzoEZETHWarpConfig } from './environments/mainnet3/warp/configGetters/getRenzoEZETHWarpConfig.js';
-import { getRenzoPZETHWarpConfig } from './environments/mainnet3/warp/configGetters/getRenzoPZETHWarpConfig.js';
+import {
+ getRenzoPZETHWarpConfig,
+ getRenzoPZETHWarpConfigStaging,
+} from './environments/mainnet3/warp/configGetters/getRenzoPZETHWarpConfig.js';
import { WarpRouteIds } from './environments/mainnet3/warp/warpIds.js';
type WarpConfigGetter = (
@@ -67,6 +70,8 @@ export const warpConfigGetterMap: Record = {
[WarpRouteIds.EthereumVictionUSDC]: getEthereumVictionUSDCWarpConfig,
[WarpRouteIds.EthereumVictionUSDT]: getEthereumVictionUSDTWarpConfig,
[WarpRouteIds.EthereumSwellZircuitPZETH]: getRenzoPZETHWarpConfig,
+ [WarpRouteIds.EthereumSwellZircuitPZETHStaging]:
+ getRenzoPZETHWarpConfigStaging,
[WarpRouteIds.EthereumBscLumiaLUMIA]: getEthereumBscLUMIAWarpConfig,
[WarpRouteIds.MantapacificNeutronTIA]: getMantapacificNeutronTiaWarpConfig,
[WarpRouteIds.EclipseEthereumApxEth]: getEclipseEthereumApxEthWarpConfig,
diff --git a/typescript/infra/scripts/safes/delete-pending-txs.ts b/typescript/infra/scripts/safes/delete-pending-txs.ts
index 8fe9187a58..4534b0d64a 100644
--- a/typescript/infra/scripts/safes/delete-pending-txs.ts
+++ b/typescript/infra/scripts/safes/delete-pending-txs.ts
@@ -25,7 +25,7 @@ async function main() {
for (const chain of chains) {
try {
- await deleteAllPendingSafeTxs(chain, multiProvider, safes[chain]);
+ await deleteAllPendingSafeTxs(chain, multiProvider, safes.prod[chain]);
} catch (error) {
console.error(`Error deleting pending transactions for ${chain}:`, error);
}
diff --git a/typescript/infra/scripts/safes/delete-tx.ts b/typescript/infra/scripts/safes/delete-tx.ts
index bca35efcbe..712d292f09 100644
--- a/typescript/infra/scripts/safes/delete-tx.ts
+++ b/typescript/infra/scripts/safes/delete-tx.ts
@@ -36,7 +36,7 @@ async function main() {
for (const chain of chains) {
try {
- await deleteSafeTx(chain, multiProvider, safes[chain], tx);
+ await deleteSafeTx(chain, multiProvider, safes.prod[chain], tx);
} catch (error) {
console.error(`Error deleting transaction ${tx} for ${chain}:`, error);
}
diff --git a/typescript/infra/scripts/safes/get-pending-txs.ts b/typescript/infra/scripts/safes/get-pending-txs.ts
index 13d8c15d88..9a1a898f7a 100644
--- a/typescript/infra/scripts/safes/get-pending-txs.ts
+++ b/typescript/infra/scripts/safes/get-pending-txs.ts
@@ -39,7 +39,7 @@ export async function getPendingTxsForChains(
const txs: SafeStatus[] = [];
await Promise.all(
chains.map(async (chain) => {
- if (!safes[chain]) {
+ if (!safes.prod[chain]) {
console.error(chalk.red.bold(`No safe found for ${chain}`));
return;
}
@@ -58,7 +58,7 @@ export async function getPendingTxsForChains(
({ safeSdk, safeService } = await getSafeAndService(
chain,
multiProvider,
- safes[chain],
+ safes.prod[chain],
));
} catch (error) {
console.warn(
@@ -70,7 +70,9 @@ export async function getPendingTxsForChains(
}
const threshold = await safeSdk.getThreshold();
- const pendingTxs = await safeService.getPendingTransactions(safes[chain]);
+ const pendingTxs = await safeService.getPendingTransactions(
+ safes.prod[chain],
+ );
if (pendingTxs.results.length === 0) {
return;
}
@@ -194,7 +196,7 @@ async function main() {
await executeTx(
tx.chain,
multiProvider,
- safes[tx.chain],
+ safes.prod[tx.chain],
tx.fullTxHash,
);
} catch (error) {
diff --git a/typescript/infra/src/tx/govern-transaction-reader.ts b/typescript/infra/src/tx/govern-transaction-reader.ts
index ef82ab1e1a..c27a8504bb 100644
--- a/typescript/infra/src/tx/govern-transaction-reader.ts
+++ b/typescript/infra/src/tx/govern-transaction-reader.ts
@@ -542,7 +542,7 @@ export class GovernTransactionReader {
this.chainAddresses,
this.multiProvider,
).getAccount(remoteChainName, {
- owner: safes[icaOwnerChain],
+ owner: safes.prod[icaOwnerChain],
origin: icaOwnerChain,
routerOverride: router,
ismOverride: ism,
@@ -679,7 +679,7 @@ export class GovernTransactionReader {
return this.multiSendCallOnlyAddressCache[chain];
}
- const safe = safes[chain];
+ const safe = safes.prod[chain];
if (!safe) {
return undefined;
}
From 0f9578af28b4003493bd57e9a208d2bed6df80af Mon Sep 17 00:00:00 2001
From: Le Yu <6251863+ltyu@users.noreply.github.com>
Date: Thu, 2 Jan 2025 15:27:26 -0500
Subject: [PATCH 2/3] Revert "Split safes and tokens to separate environments
(staging and prod). Add pzEth getter"
This reverts commit 2b3696371956609a714b88f031dff66e9b3df66e.
---
.../config/environments/mainnet3/owners.ts | 87 +++++-------
.../configGetters/getRenzoPZETHWarpConfig.ts | 133 +++---------------
.../environments/mainnet3/warp/warpIds.ts | 1 -
typescript/infra/config/warp.ts | 7 +-
.../infra/scripts/safes/delete-pending-txs.ts | 2 +-
typescript/infra/scripts/safes/delete-tx.ts | 2 +-
.../infra/scripts/safes/get-pending-txs.ts | 10 +-
.../infra/src/tx/govern-transaction-reader.ts | 4 +-
8 files changed, 63 insertions(+), 183 deletions(-)
diff --git a/typescript/infra/config/environments/mainnet3/owners.ts b/typescript/infra/config/environments/mainnet3/owners.ts
index 4cfd61ff9c..01fe1e84b5 100644
--- a/typescript/infra/config/environments/mainnet3/owners.ts
+++ b/typescript/infra/config/environments/mainnet3/owners.ts
@@ -23,55 +23,40 @@ export function localAccountRouters(): ChainMap {
);
}
-export const safes: Record<'staging' | 'prod', ChainMap> = {
- staging: {
- ethereum: '0xA9421c6F339eC414b7e77449986bE9C2Ae430C25',
- bsc: '0xA9421c6F339eC414b7e77449986bE9C2Ae430C25',
- arbitrum: '0xA9421c6F339eC414b7e77449986bE9C2Ae430C25',
- optimism: '0xA9421c6F339eC414b7e77449986bE9C2Ae430C25',
- blast: '0xA9421c6F339eC414b7e77449986bE9C2Ae430C25',
- linea: '0xA9421c6F339eC414b7e77449986bE9C2Ae430C25',
- base: '0xA9421c6F339eC414b7e77449986bE9C2Ae430C25',
- mode: '0xf40b75fb85C3bEc70D75A1B45ef08FC48Db61115',
- swell: '0xf40b75fb85C3bEc70D75A1B45ef08FC48Db61115',
- fraxtal: '0xf40b75fb85C3bEc70D75A1B45ef08FC48Db61115',
- zircuit: '0xf40b75fb85C3bEc70D75A1B45ef08FC48Db61115',
- },
- prod: {
- mantapacific: '0x03ed2D65f2742193CeD99D48EbF1F1D6F12345B6', // does not have a UI
- celo: '0x879038d6Fc9F6D5e2BA73188bd078486d77e1156',
- ethereum: '0x3965AC3D295641E452E0ea896a086A9cD7C6C5b6',
- avalanche: '0x5bE94B17112B8F18eA9Ac8e559377B467556a3c3',
- polygon: '0xf9cFD440CfBCfAB8473cc156485B7eE753b2913E',
- bsc: '0x7bB2ADeDdC342ffb611dDC073095cc4B8C547170',
- arbitrum: '0x03fD5BE9DF85F0017dC7F4DC3068dDF64fffF25e',
- optimism: '0xbd7db3821806bc72D223F0AE521Bf82FcBd6Ef4d',
- moonbeam: '0x594203849E52BF6ee0E511cD807Ca2D658893e37',
- gnosis: '0x0Ac72fBc82c9c39F81242229631dfC38aA13031B',
- inevm: '0x77F3863ea99F2360D84d4BA1A2E441857D0357fa', // caldera + injective
- base: '0x3949eD0CD036D9FF662d97BD7aC1686051c4aeBF',
- scroll: '0x6EeEbB9F7FB18DD5E59F82658c59B846715eD4F7',
- polygonzkevm: '0x1610f578D4d77Fc4ae7ce2DD9AA0b98A5Cd0a9b2',
- // injective: 'inj1632x8j35kenryam3mkrsez064sqg2y2fr0frzt',
- // solana: 'EzppBFV2taxWw8kEjxNYvby6q7W1biJEqwP3iC7YgRe3',
- blast: '0xaCD1865B262C89Fb0b50dcc8fB095330ae8F35b5',
- linea: '0xaCD1865B262C89Fb0b50dcc8fB095330ae8F35b5',
- mode: '0xaCD1865B262C89Fb0b50dcc8fB095330ae8F35b5',
- ancient8: '0xD2BFA0F0654E3f2139b8cDC56c32eeC54D32b133',
- taiko: '0xa4864301d3fa2a3e68256309F9F0F570270a1BD0',
- fraxtal: '0x66e9f52800E9F89F0569fddc594Acd5EE609f762',
- sei: '0xCed197FBc360C26C19889745Cf73511b71D03d5D',
- redstone: '0xa1a50ff5FD859558E1899fEC5C3064483177FA23',
- mantle: '0x8aFE6EECc6CcB02aA20DA8Fff7d29aadEBbc2DCd',
- bob: '0x9e2fe7723b018d02cDE4f5cC1A9bC9C65b922Fc8',
- zetachain: '0x9d399876522Fc5C044D048594de399A2349d6026',
- zoramainnet: '0xF87018025575552889062De4b05bBC3DAe35Cd96',
- fusemainnet: '0x29a526227CB864C90Cf078d03872da913B473139',
- endurance: '0xaCD1865B262C89Fb0b50dcc8fB095330ae8F35b5',
- zircuit: '0x9e2fe7723b018d02cDE4f5cC1A9bC9C65b922Fc8',
- zeronetwork: '0xCB21F61A3c8139F18e635d45aD1e62A4A61d2c3D',
- swell: '0x5F7771EA40546e2932754C263455Cb0023a55ca7',
- },
+export const safes: ChainMap = {
+ mantapacific: '0x03ed2D65f2742193CeD99D48EbF1F1D6F12345B6', // does not have a UI
+ celo: '0x879038d6Fc9F6D5e2BA73188bd078486d77e1156',
+ ethereum: '0x3965AC3D295641E452E0ea896a086A9cD7C6C5b6',
+ avalanche: '0x5bE94B17112B8F18eA9Ac8e559377B467556a3c3',
+ polygon: '0xf9cFD440CfBCfAB8473cc156485B7eE753b2913E',
+ bsc: '0x7bB2ADeDdC342ffb611dDC073095cc4B8C547170',
+ arbitrum: '0x03fD5BE9DF85F0017dC7F4DC3068dDF64fffF25e',
+ optimism: '0xbd7db3821806bc72D223F0AE521Bf82FcBd6Ef4d',
+ moonbeam: '0x594203849E52BF6ee0E511cD807Ca2D658893e37',
+ gnosis: '0x0Ac72fBc82c9c39F81242229631dfC38aA13031B',
+ inevm: '0x77F3863ea99F2360D84d4BA1A2E441857D0357fa', // caldera + injective
+ base: '0x3949eD0CD036D9FF662d97BD7aC1686051c4aeBF',
+ scroll: '0x6EeEbB9F7FB18DD5E59F82658c59B846715eD4F7',
+ polygonzkevm: '0x1610f578D4d77Fc4ae7ce2DD9AA0b98A5Cd0a9b2',
+ // injective: 'inj1632x8j35kenryam3mkrsez064sqg2y2fr0frzt',
+ // solana: 'EzppBFV2taxWw8kEjxNYvby6q7W1biJEqwP3iC7YgRe3',
+ blast: '0xaCD1865B262C89Fb0b50dcc8fB095330ae8F35b5',
+ linea: '0xaCD1865B262C89Fb0b50dcc8fB095330ae8F35b5',
+ mode: '0xaCD1865B262C89Fb0b50dcc8fB095330ae8F35b5',
+ ancient8: '0xD2BFA0F0654E3f2139b8cDC56c32eeC54D32b133',
+ taiko: '0xa4864301d3fa2a3e68256309F9F0F570270a1BD0',
+ fraxtal: '0x66e9f52800E9F89F0569fddc594Acd5EE609f762',
+ sei: '0xCed197FBc360C26C19889745Cf73511b71D03d5D',
+ redstone: '0xa1a50ff5FD859558E1899fEC5C3064483177FA23',
+ mantle: '0x8aFE6EECc6CcB02aA20DA8Fff7d29aadEBbc2DCd',
+ bob: '0x9e2fe7723b018d02cDE4f5cC1A9bC9C65b922Fc8',
+ zetachain: '0x9d399876522Fc5C044D048594de399A2349d6026',
+ zoramainnet: '0xF87018025575552889062De4b05bBC3DAe35Cd96',
+ fusemainnet: '0x29a526227CB864C90Cf078d03872da913B473139',
+ endurance: '0xaCD1865B262C89Fb0b50dcc8fB095330ae8F35b5',
+ zircuit: '0x9e2fe7723b018d02cDE4f5cC1A9bC9C65b922Fc8',
+ zeronetwork: '0xCB21F61A3c8139F18e635d45aD1e62A4A61d2c3D',
+ swell: '0x5F7771EA40546e2932754C263455Cb0023a55ca7',
};
export const icaOwnerChain = 'ethereum';
@@ -209,7 +194,7 @@ export const DEPLOYER = '0xa7ECcdb9Be08178f896c26b7BbD8C3D4E844d9Ba';
export const ethereumChainOwners: ChainMap = Object.fromEntries(
ethereumChainNames.map((local) => {
- const owner = icas[local] ?? safes.prod[local] ?? DEPLOYER;
+ const owner = icas[local] ?? safes[local] ?? DEPLOYER;
return [
local,
@@ -224,7 +209,7 @@ export const ethereumChainOwners: ChainMap = Object.fromEntries(
// the checker/governor tooling does not know what type of owner it is.
// So we need to keep the Safe and ICA addresses somewhere in the config
// to be able to track down which addresses are SAFEs, ICAs, or standard SIGNERS.
- ...(safes.prod[local] && { _safeAddress: safes.prod[local] }),
+ ...(safes[local] && { _safeAddress: safes[local] }),
...(icas[local] && { _icaAddress: icas[local] }),
},
},
diff --git a/typescript/infra/config/environments/mainnet3/warp/configGetters/getRenzoPZETHWarpConfig.ts b/typescript/infra/config/environments/mainnet3/warp/configGetters/getRenzoPZETHWarpConfig.ts
index 8523981462..6196031a8e 100644
--- a/typescript/infra/config/environments/mainnet3/warp/configGetters/getRenzoPZETHWarpConfig.ts
+++ b/typescript/infra/config/environments/mainnet3/warp/configGetters/getRenzoPZETHWarpConfig.ts
@@ -10,7 +10,6 @@ import { assert, symmetricDifference } from '@hyperlane-xyz/utils';
import { getEnvironmentConfig } from '../../../../../scripts/core-utils.js';
import { getRegistry as getMainnet3Registry } from '../../chains.js';
-import { safes } from '../../owners.js';
import {
ezEthSafes,
@@ -18,6 +17,8 @@ import {
getRenzoHook,
} from './getRenzoEZETHWarpConfig.js';
+const lockbox = '0xbC5511354C4A9a50DE928F56DB01DD327c4e56d5';
+const xERC20 = '0x9cb41CD74D01ae4b4f640EC40f7A60cA1bCF83E7';
const lockboxChain = 'ethereum';
// over the default 100k to account for xerc20 gas + ISM overhead over the default ISM https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/49f41d9759fd515bfd89e6e22e799c41b27b4119/typescript/sdk/src/router/GasRouterDeployer.ts#L14
const warpRouteOverheadGas = 200_000;
@@ -30,125 +31,26 @@ const pzEthValidators = {
swell: ezEthValidators.swell,
};
-export const getRenzoPZETHWarpConfig = async (): Promise<
- ChainMap
-> => {
- const lockbox = '0xbC5511354C4A9a50DE928F56DB01DD327c4e56d5';
- const xERC20 = '0x9cb41CD74D01ae4b4f640EC40f7A60cA1bCF83E7';
-
- const pzEthSafes: Record = {
- ethereum: ezEthSafes.ethereum,
- zircuit: ezEthSafes.zircuit,
- swell: ezEthSafes.swell,
- };
-
- const existingProxyAdmins: ChainMap<{ address: string; owner: string }> = {
- ethereum: {
- address: '0x4f4671Ce69c9af15e33eB7Cf6D1358d1B39Af3bF',
- owner: '0xD1e6626310fD54Eceb5b9a51dA2eC329D6D4B68A',
- },
- zircuit: {
- address: '0x8b789B4A56675240c9f0985B467752b870c75711',
- owner: '0x8410927C286A38883BC23721e640F31D3E3E79F8',
- },
- };
-
- const config = getEnvironmentConfig('mainnet3');
- const multiProvider = await config.getMultiProvider();
- const registry = await getMainnet3Registry();
-
- const validatorDiff = symmetricDifference(
- new Set(chainsToDeploy),
- new Set(Object.keys(pzEthValidators)),
- );
- const safeDiff = symmetricDifference(
- new Set(chainsToDeploy),
- new Set(Object.keys(pzEthSafes)),
- );
- if (validatorDiff.size > 0) {
- throw new Error(
- `chainsToDeploy !== validatorConfig, diff is ${Array.from(
- validatorDiff,
- ).join(', ')}`,
- );
- }
- if (safeDiff.size > 0) {
- throw new Error(
- `chainsToDeploy !== safeDiff, diff is ${Array.from(safeDiff).join(', ')}`,
- );
- }
-
- const tokenConfig = Object.fromEntries(
- await Promise.all(
- chainsToDeploy.map(
- async (chain): Promise<[string, HypTokenRouterConfig]> => {
- const addresses = await registry.getChainAddresses(chain);
- assert(addresses, 'No addresses in Registry');
- const { mailbox } = addresses;
-
- const mailboxContract = Mailbox__factory.connect(
- mailbox,
- multiProvider.getProvider(chain),
- );
- const defaultHook = await mailboxContract.defaultHook();
- const ret: [string, HypTokenRouterConfig] = [
- chain,
- {
- isNft: false,
- type:
- chain === lockboxChain
- ? TokenType.XERC20Lockbox
- : TokenType.XERC20,
- token: chain === lockboxChain ? lockbox : xERC20,
- owner: pzEthSafes[chain],
- gas: warpRouteOverheadGas,
- mailbox,
- interchainSecurityModule: {
- type: IsmType.AGGREGATION,
- threshold: 2,
- modules: [
- {
- type: IsmType.ROUTING,
- owner: pzEthSafes[chain],
- domains: buildAggregationIsmConfigs(
- chain,
- chainsToDeploy,
- pzEthValidators,
- ),
- },
- {
- type: IsmType.FALLBACK_ROUTING,
- domains: {},
- owner: pzEthSafes[chain],
- },
- ],
- },
- hook: getRenzoHook(defaultHook, chain),
- proxyAdmin: existingProxyAdmins[chain],
- },
- ];
-
- return ret;
- },
- ),
- ),
- );
+const pzEthSafes: Record = {
+ ethereum: ezEthSafes.ethereum,
+ zircuit: ezEthSafes.zircuit,
+ swell: ezEthSafes.swell,
+};
- return tokenConfig;
+const existingProxyAdmins: ChainMap<{ address: string; owner: string }> = {
+ ethereum: {
+ address: '0x4f4671Ce69c9af15e33eB7Cf6D1358d1B39Af3bF',
+ owner: '0xD1e6626310fD54Eceb5b9a51dA2eC329D6D4B68A',
+ },
+ zircuit: {
+ address: '0x8b789B4A56675240c9f0985B467752b870c75711',
+ owner: '0x8410927C286A38883BC23721e640F31D3E3E79F8',
+ },
};
-export const getRenzoPZETHWarpConfigStaging = async (): Promise<
+export const getRenzoPZETHWarpConfig = async (): Promise<
ChainMap
> => {
- const lockbox = '0xbC5511354C4A9a50DE928F56DB01DD327c4e56d5';
- const xERC20 = '0x9cb41CD74D01ae4b4f640EC40f7A60cA1bCF83E7';
-
- const pzEthSafes: Record = {
- ethereum: safes.staging.ethereum,
- zircuit: safes.staging.zircuit,
- swell: safes.staging.swell,
- };
-
const config = getEnvironmentConfig('mainnet3');
const multiProvider = await config.getMultiProvider();
const registry = await getMainnet3Registry();
@@ -220,6 +122,7 @@ export const getRenzoPZETHWarpConfigStaging = async (): Promise<
],
},
hook: getRenzoHook(defaultHook, chain),
+ proxyAdmin: existingProxyAdmins[chain],
},
];
diff --git a/typescript/infra/config/environments/mainnet3/warp/warpIds.ts b/typescript/infra/config/environments/mainnet3/warp/warpIds.ts
index ac1526ae41..1cd98d1c8d 100644
--- a/typescript/infra/config/environments/mainnet3/warp/warpIds.ts
+++ b/typescript/infra/config/environments/mainnet3/warp/warpIds.ts
@@ -29,7 +29,6 @@ export enum WarpRouteIds {
EthereumVictionUSDC = 'USDC/ethereum-viction',
EthereumVictionUSDT = 'USDT/ethereum-viction',
EthereumSwellZircuitPZETH = 'PZETH/ethereum-swell-zircuit',
- EthereumSwellZircuitPZETHStaging = 'PZETH/ethereum-swell-zircuit-staging',
EthereumBscLumiaLUMIA = 'LUMIA/bsc-ethereum-lumia',
EthereumZircuitRe7LRT = 'Re7LRT/ethereum-zircuit',
InevmInjectiveINJ = 'INJ/inevm-injective',
diff --git a/typescript/infra/config/warp.ts b/typescript/infra/config/warp.ts
index 9202b1ad2a..d87a010be1 100644
--- a/typescript/infra/config/warp.ts
+++ b/typescript/infra/config/warp.ts
@@ -41,10 +41,7 @@ import { getEthereumZircuitRe7LRTWarpConfig } from './environments/mainnet3/warp
import { getInevmInjectiveINJWarpConfig } from './environments/mainnet3/warp/configGetters/getInevmInjectiveINJWarpConfig.js';
import { getMantapacificNeutronTiaWarpConfig } from './environments/mainnet3/warp/configGetters/getMantapacificNeutronTiaWarpConfig.js';
import { getRenzoEZETHWarpConfig } from './environments/mainnet3/warp/configGetters/getRenzoEZETHWarpConfig.js';
-import {
- getRenzoPZETHWarpConfig,
- getRenzoPZETHWarpConfigStaging,
-} from './environments/mainnet3/warp/configGetters/getRenzoPZETHWarpConfig.js';
+import { getRenzoPZETHWarpConfig } from './environments/mainnet3/warp/configGetters/getRenzoPZETHWarpConfig.js';
import { WarpRouteIds } from './environments/mainnet3/warp/warpIds.js';
type WarpConfigGetter = (
@@ -70,8 +67,6 @@ export const warpConfigGetterMap: Record = {
[WarpRouteIds.EthereumVictionUSDC]: getEthereumVictionUSDCWarpConfig,
[WarpRouteIds.EthereumVictionUSDT]: getEthereumVictionUSDTWarpConfig,
[WarpRouteIds.EthereumSwellZircuitPZETH]: getRenzoPZETHWarpConfig,
- [WarpRouteIds.EthereumSwellZircuitPZETHStaging]:
- getRenzoPZETHWarpConfigStaging,
[WarpRouteIds.EthereumBscLumiaLUMIA]: getEthereumBscLUMIAWarpConfig,
[WarpRouteIds.MantapacificNeutronTIA]: getMantapacificNeutronTiaWarpConfig,
[WarpRouteIds.EclipseEthereumApxEth]: getEclipseEthereumApxEthWarpConfig,
diff --git a/typescript/infra/scripts/safes/delete-pending-txs.ts b/typescript/infra/scripts/safes/delete-pending-txs.ts
index 4534b0d64a..8fe9187a58 100644
--- a/typescript/infra/scripts/safes/delete-pending-txs.ts
+++ b/typescript/infra/scripts/safes/delete-pending-txs.ts
@@ -25,7 +25,7 @@ async function main() {
for (const chain of chains) {
try {
- await deleteAllPendingSafeTxs(chain, multiProvider, safes.prod[chain]);
+ await deleteAllPendingSafeTxs(chain, multiProvider, safes[chain]);
} catch (error) {
console.error(`Error deleting pending transactions for ${chain}:`, error);
}
diff --git a/typescript/infra/scripts/safes/delete-tx.ts b/typescript/infra/scripts/safes/delete-tx.ts
index 712d292f09..bca35efcbe 100644
--- a/typescript/infra/scripts/safes/delete-tx.ts
+++ b/typescript/infra/scripts/safes/delete-tx.ts
@@ -36,7 +36,7 @@ async function main() {
for (const chain of chains) {
try {
- await deleteSafeTx(chain, multiProvider, safes.prod[chain], tx);
+ await deleteSafeTx(chain, multiProvider, safes[chain], tx);
} catch (error) {
console.error(`Error deleting transaction ${tx} for ${chain}:`, error);
}
diff --git a/typescript/infra/scripts/safes/get-pending-txs.ts b/typescript/infra/scripts/safes/get-pending-txs.ts
index 9a1a898f7a..13d8c15d88 100644
--- a/typescript/infra/scripts/safes/get-pending-txs.ts
+++ b/typescript/infra/scripts/safes/get-pending-txs.ts
@@ -39,7 +39,7 @@ export async function getPendingTxsForChains(
const txs: SafeStatus[] = [];
await Promise.all(
chains.map(async (chain) => {
- if (!safes.prod[chain]) {
+ if (!safes[chain]) {
console.error(chalk.red.bold(`No safe found for ${chain}`));
return;
}
@@ -58,7 +58,7 @@ export async function getPendingTxsForChains(
({ safeSdk, safeService } = await getSafeAndService(
chain,
multiProvider,
- safes.prod[chain],
+ safes[chain],
));
} catch (error) {
console.warn(
@@ -70,9 +70,7 @@ export async function getPendingTxsForChains(
}
const threshold = await safeSdk.getThreshold();
- const pendingTxs = await safeService.getPendingTransactions(
- safes.prod[chain],
- );
+ const pendingTxs = await safeService.getPendingTransactions(safes[chain]);
if (pendingTxs.results.length === 0) {
return;
}
@@ -196,7 +194,7 @@ async function main() {
await executeTx(
tx.chain,
multiProvider,
- safes.prod[tx.chain],
+ safes[tx.chain],
tx.fullTxHash,
);
} catch (error) {
diff --git a/typescript/infra/src/tx/govern-transaction-reader.ts b/typescript/infra/src/tx/govern-transaction-reader.ts
index c27a8504bb..ef82ab1e1a 100644
--- a/typescript/infra/src/tx/govern-transaction-reader.ts
+++ b/typescript/infra/src/tx/govern-transaction-reader.ts
@@ -542,7 +542,7 @@ export class GovernTransactionReader {
this.chainAddresses,
this.multiProvider,
).getAccount(remoteChainName, {
- owner: safes.prod[icaOwnerChain],
+ owner: safes[icaOwnerChain],
origin: icaOwnerChain,
routerOverride: router,
ismOverride: ism,
@@ -679,7 +679,7 @@ export class GovernTransactionReader {
return this.multiSendCallOnlyAddressCache[chain];
}
- const safe = safes.prod[chain];
+ const safe = safes[chain];
if (!safe) {
return undefined;
}
From 4a378589bd07ec044cd9348c344e3f6057f3ec1d Mon Sep 17 00:00:00 2001
From: Le Yu <6251863+ltyu@users.noreply.github.com>
Date: Thu, 2 Jan 2025 15:31:01 -0500
Subject: [PATCH 3/3] Move staging safes
---
.../configGetters/getRenzoPZETHWarpConfig.ts | 148 +++++++++++++++---
1 file changed, 130 insertions(+), 18 deletions(-)
diff --git a/typescript/infra/config/environments/mainnet3/warp/configGetters/getRenzoPZETHWarpConfig.ts b/typescript/infra/config/environments/mainnet3/warp/configGetters/getRenzoPZETHWarpConfig.ts
index 6196031a8e..b24324949b 100644
--- a/typescript/infra/config/environments/mainnet3/warp/configGetters/getRenzoPZETHWarpConfig.ts
+++ b/typescript/infra/config/environments/mainnet3/warp/configGetters/getRenzoPZETHWarpConfig.ts
@@ -10,6 +10,7 @@ import { assert, symmetricDifference } from '@hyperlane-xyz/utils';
import { getEnvironmentConfig } from '../../../../../scripts/core-utils.js';
import { getRegistry as getMainnet3Registry } from '../../chains.js';
+import { safes } from '../../owners.js';
import {
ezEthSafes,
@@ -17,8 +18,6 @@ import {
getRenzoHook,
} from './getRenzoEZETHWarpConfig.js';
-const lockbox = '0xbC5511354C4A9a50DE928F56DB01DD327c4e56d5';
-const xERC20 = '0x9cb41CD74D01ae4b4f640EC40f7A60cA1bCF83E7';
const lockboxChain = 'ethereum';
// over the default 100k to account for xerc20 gas + ISM overhead over the default ISM https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/49f41d9759fd515bfd89e6e22e799c41b27b4119/typescript/sdk/src/router/GasRouterDeployer.ts#L14
const warpRouteOverheadGas = 200_000;
@@ -31,26 +30,140 @@ const pzEthValidators = {
swell: ezEthValidators.swell,
};
-const pzEthSafes: Record = {
- ethereum: ezEthSafes.ethereum,
- zircuit: ezEthSafes.zircuit,
- swell: ezEthSafes.swell,
-};
+export const getRenzoPZETHWarpConfig = async (): Promise<
+ ChainMap
+> => {
+ const lockbox = '0xbC5511354C4A9a50DE928F56DB01DD327c4e56d5';
+ const xERC20 = '0x9cb41CD74D01ae4b4f640EC40f7A60cA1bCF83E7';
+
+ const pzEthSafes: Record = {
+ ethereum: ezEthSafes.ethereum,
+ zircuit: ezEthSafes.zircuit,
+ swell: ezEthSafes.swell,
+ };
+
+ const existingProxyAdmins: ChainMap<{ address: string; owner: string }> = {
+ ethereum: {
+ address: '0x4f4671Ce69c9af15e33eB7Cf6D1358d1B39Af3bF',
+ owner: '0xD1e6626310fD54Eceb5b9a51dA2eC329D6D4B68A',
+ },
+ zircuit: {
+ address: '0x8b789B4A56675240c9f0985B467752b870c75711',
+ owner: '0x8410927C286A38883BC23721e640F31D3E3E79F8',
+ },
+ };
-const existingProxyAdmins: ChainMap<{ address: string; owner: string }> = {
- ethereum: {
- address: '0x4f4671Ce69c9af15e33eB7Cf6D1358d1B39Af3bF',
- owner: '0xD1e6626310fD54Eceb5b9a51dA2eC329D6D4B68A',
- },
- zircuit: {
- address: '0x8b789B4A56675240c9f0985B467752b870c75711',
- owner: '0x8410927C286A38883BC23721e640F31D3E3E79F8',
- },
+ const config = getEnvironmentConfig('mainnet3');
+ const multiProvider = await config.getMultiProvider();
+ const registry = await getMainnet3Registry();
+
+ const validatorDiff = symmetricDifference(
+ new Set(chainsToDeploy),
+ new Set(Object.keys(pzEthValidators)),
+ );
+ const safeDiff = symmetricDifference(
+ new Set(chainsToDeploy),
+ new Set(Object.keys(pzEthSafes)),
+ );
+ if (validatorDiff.size > 0) {
+ throw new Error(
+ `chainsToDeploy !== validatorConfig, diff is ${Array.from(
+ validatorDiff,
+ ).join(', ')}`,
+ );
+ }
+ if (safeDiff.size > 0) {
+ throw new Error(
+ `chainsToDeploy !== safeDiff, diff is ${Array.from(safeDiff).join(', ')}`,
+ );
+ }
+
+ const tokenConfig = Object.fromEntries(
+ await Promise.all(
+ chainsToDeploy.map(
+ async (chain): Promise<[string, HypTokenRouterConfig]> => {
+ const addresses = await registry.getChainAddresses(chain);
+ assert(addresses, 'No addresses in Registry');
+ const { mailbox } = addresses;
+
+ const mailboxContract = Mailbox__factory.connect(
+ mailbox,
+ multiProvider.getProvider(chain),
+ );
+ const defaultHook = await mailboxContract.defaultHook();
+ const ret: [string, HypTokenRouterConfig] = [
+ chain,
+ {
+ isNft: false,
+ type:
+ chain === lockboxChain
+ ? TokenType.XERC20Lockbox
+ : TokenType.XERC20,
+ token: chain === lockboxChain ? lockbox : xERC20,
+ owner: pzEthSafes[chain],
+ gas: warpRouteOverheadGas,
+ mailbox,
+ interchainSecurityModule: {
+ type: IsmType.AGGREGATION,
+ threshold: 2,
+ modules: [
+ {
+ type: IsmType.ROUTING,
+ owner: pzEthSafes[chain],
+ domains: buildAggregationIsmConfigs(
+ chain,
+ chainsToDeploy,
+ pzEthValidators,
+ ),
+ },
+ {
+ type: IsmType.FALLBACK_ROUTING,
+ domains: {},
+ owner: pzEthSafes[chain],
+ },
+ ],
+ },
+ hook: getRenzoHook(defaultHook, chain),
+ proxyAdmin: existingProxyAdmins[chain],
+ },
+ ];
+
+ return ret;
+ },
+ ),
+ ),
+ );
+
+ return tokenConfig;
};
-export const getRenzoPZETHWarpConfig = async (): Promise<
+export const getRenzoPZETHWarpConfigStaging = async (): Promise<
ChainMap
> => {
+ const lockbox = '0xbC5511354C4A9a50DE928F56DB01DD327c4e56d5'; // TODO
+ const xERC20 = '0x9cb41CD74D01ae4b4f640EC40f7A60cA1bCF83E7'; // TODO
+
+ // TODO DEPLOY REAL ONES
+ const stagingSafes = {
+ ethereum: '0xA9421c6F339eC414b7e77449986bE9C2Ae430C25',
+ bsc: '0xA9421c6F339eC414b7e77449986bE9C2Ae430C25',
+ arbitrum: '0xA9421c6F339eC414b7e77449986bE9C2Ae430C25',
+ optimism: '0xA9421c6F339eC414b7e77449986bE9C2Ae430C25',
+ blast: '0xA9421c6F339eC414b7e77449986bE9C2Ae430C25',
+ linea: '0xA9421c6F339eC414b7e77449986bE9C2Ae430C25',
+ base: '0xA9421c6F339eC414b7e77449986bE9C2Ae430C25',
+ mode: '0xf40b75fb85C3bEc70D75A1B45ef08FC48Db61115',
+ swell: '0xf40b75fb85C3bEc70D75A1B45ef08FC48Db61115',
+ fraxtal: '0xf40b75fb85C3bEc70D75A1B45ef08FC48Db61115',
+ zircuit: '0xf40b75fb85C3bEc70D75A1B45ef08FC48Db61115',
+ };
+
+ const pzEthSafes: Record = {
+ ethereum: stagingSafes.ethereum,
+ zircuit: stagingSafes.zircuit,
+ swell: stagingSafes.swell,
+ };
+
const config = getEnvironmentConfig('mainnet3');
const multiProvider = await config.getMultiProvider();
const registry = await getMainnet3Registry();
@@ -122,7 +235,6 @@ export const getRenzoPZETHWarpConfig = async (): Promise<
],
},
hook: getRenzoHook(defaultHook, chain),
- proxyAdmin: existingProxyAdmins[chain],
},
];