feat: Add pzEth Config Generator (#4624)

### Description
Adds pzEth Config Generator files to deploy to ethereum and zircuit
- new lockbox and xerc20 addresses 
  - supplied via this message: https://t.me/c/2192542084/925
- Reusing ezEth validators config for both chains
- Reusing Safe addresses. 
  - confirmed via this message: https://t.me/c/2192542084/948 

### Drive-by changes
Rename to differentiate between ezEth and pzEth

### Related issues
#4623 

### Backward compatibility
Yes

### Testing
Manual
pull/3899/merge
Lee 2 months ago committed by GitHub
parent 6b57467267
commit dc9adf3b55
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      typescript/infra/config/environments/mainnet3/warp/configGetters/getRenzoEZETHWarpConfig.ts
  2. 104
      typescript/infra/config/environments/mainnet3/warp/configGetters/getRenzoPZETHWarpConfig.ts
  3. 2
      typescript/infra/config/warp.ts
  4. 4
      typescript/infra/scripts/generate-renzo-ezeth-warp-route-config.ts
  5. 23
      typescript/infra/scripts/generate-renzo-pzeth-warp-route-config.ts

@ -28,7 +28,7 @@ const chainsToDeploy = [
'zircuit',
];
const ezEthValidators = {
export const ezEthValidators = {
arbitrum: {
threshold: 1,
validators: [
@ -101,7 +101,7 @@ const ezEthValidators = {
},
};
const ezEthSafes: Record<string, string> = {
export const ezEthSafes: Record<string, string> = {
arbitrum: '0x0e60fd361fF5b90088e1782e6b21A7D177d462C5',
optimism: '0x8410927C286A38883BC23721e640F31D3E3E79F8',
base: '0x8410927C286A38883BC23721e640F31D3E3E79F8',

@ -0,0 +1,104 @@
import {
ChainMap,
IsmType,
TokenRouterConfig,
TokenType,
buildAggregationIsmConfigs,
} from '@hyperlane-xyz/sdk';
import { symmetricDifference } from '@hyperlane-xyz/utils';
import { getRegistry as getMainnet3Registry } from '../../chains.js';
import { ezEthSafes, ezEthValidators } 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;
const chainsToDeploy = ['ethereum', 'zircuit'];
const pzEthValidators = {
ethereum: ezEthValidators.ethereum,
zircuit: ezEthValidators.zircuit,
};
const pzEthSafes: Record<string, string> = {
ethereum: ezEthSafes.ethereum,
zircuit: ezEthSafes.zircuit,
};
export const getRenzoPZETHWarpConfig = async (): Promise<
ChainMap<TokenRouterConfig>
> => {
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<TokenRouterConfig>(
await Promise.all(
chainsToDeploy.map(
async (chain): Promise<[string, TokenRouterConfig]> => {
const ret: [string, TokenRouterConfig] = [
chain,
{
isNft: false,
type:
chain === lockboxChain
? TokenType.XERC20Lockbox
: TokenType.XERC20,
token: chain === lockboxChain ? lockbox : xERC20,
owner: pzEthSafes[chain],
gas: warpRouteOverheadGas,
mailbox: (await registry.getChainAddresses(chain))!.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],
},
],
},
},
];
return ret;
},
),
),
);
return tokenConfig;
};

@ -20,7 +20,7 @@ import { getEthereumVictionUSDCWarpConfig } from './environments/mainnet3/warp/c
import { getEthereumVictionUSDTWarpConfig } from './environments/mainnet3/warp/configGetters/getEthereumVictionUSDTWarpConfig.js';
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/getRenzoEZETHWarpConifg.js';
import { getRenzoEZETHWarpConfig } from './environments/mainnet3/warp/configGetters/getRenzoEZETHWarpConfig.js';
import { WarpRouteIds } from './environments/mainnet3/warp/warpIds.js';
type WarpConfigGetterWithConfig = (

@ -3,7 +3,7 @@ import { stringify as yamlStringify } from 'yaml';
import { WarpRouteDeployConfigSchema } from '@hyperlane-xyz/sdk';
import { getRenzoEZETHWarpConfig } from '../config/environments/mainnet3/warp/configGetters/getRenzoEZETHWarpConifg.js';
import { getRenzoEZETHWarpConfig } from '../config/environments/mainnet3/warp/configGetters/getRenzoEZETHWarpConfig.js';
async function main() {
const tokenConfig = await getRenzoEZETHWarpConfig();
@ -15,7 +15,7 @@ async function main() {
}
writeFileSync(
'renzo-warp-route-config.yaml',
'renzo-ezeth-warp-route-config.yaml',
yamlStringify(parsed.data, null, 2),
);
}

@ -0,0 +1,23 @@
import { writeFileSync } from 'fs';
import { stringify as yamlStringify } from 'yaml';
import { WarpRouteDeployConfigSchema } from '@hyperlane-xyz/sdk';
import { getRenzoPZETHWarpConfig } from '../config/environments/mainnet3/warp/configGetters/getRenzoPZETHWarpConfig.js';
async function main() {
const tokenConfig = await getRenzoPZETHWarpConfig();
const parsed = WarpRouteDeployConfigSchema.safeParse(tokenConfig);
if (!parsed.success) {
console.dir(parsed.error.format(), { depth: null });
return;
}
writeFileSync(
'renzo-pzeth-warp-route-config.yaml',
yamlStringify(parsed.data, null, 2),
);
}
main().catch(console.error).then(console.log);
Loading…
Cancel
Save