Skip to content
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: Add FeeHook and Swell to pzEth #4974

Merged
merged 23 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { parseEther } from 'ethers/lib/utils.js';

import {
ChainMap,
HookType,
IsmType,
MultisigConfig,
TokenRouterConfig,
Expand All @@ -9,7 +12,9 @@ import {
import { symmetricDifference } from '@hyperlane-xyz/utils';

import { getRegistry as getMainnet3Registry } from '../../chains.js';
import rawTokenPrices from '../../tokenPrices.json';

const tokenPrices: ChainMap<string> = rawTokenPrices;
const chainsToDeploy = [
'arbitrum',
'optimism',
Expand All @@ -23,7 +28,14 @@ const chainsToDeploy = [
'zircuit',
'taiko',
'sei',
'swell',
];

export const MAX_PROTOCOL_FEE = parseEther('100').toString(); // Changing this will redeploy the PROTOCOL_FEE hook

export const protocolFee = (0.5 / Number(tokenPrices.ethereum))
ltyu marked this conversation as resolved.
Show resolved Hide resolved
.toFixed(10)
.toString(); // ~$0.50 USD
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;
Expand All @@ -41,6 +53,7 @@ const xERC20: Record<(typeof chainsToDeploy)[number], string> = {
zircuit: '0x2416092f143378750bb29b79eD961ab195CcEea5',
taiko: '0x2416092f143378750bb29b79eD961ab195CcEea5',
sei: '0x6DCfbF4729890043DFd34A93A2694E5303BA2703', // redEth
swell: '0x2416092f143378750bb29b79eD961ab195CcEea5',
};

export const ezEthValidators: ChainMap<MultisigConfig> = {
Expand Down Expand Up @@ -164,6 +177,16 @@ export const ezEthValidators: ChainMap<MultisigConfig> = {
{ address: '0x952df7f0cb8611573a53dd7cbf29768871d9f8b0', alias: 'Renzo' },
],
},
swell: {
threshold: 1,
validators: [
{
address: '0x9eadf9217be22d9878e0e464727a2176d5c69ff8',
alias: 'Luganodes',
},
{ address: '0xb6b9b4bd4eb6eb3aef5e9826e7f8b8455947f67c', alias: 'Renzo' },
],
},
};

export const ezEthSafes: Record<string, string> = {
Expand All @@ -179,6 +202,7 @@ export const ezEthSafes: Record<string, string> = {
zircuit: '0x8410927C286A38883BC23721e640F31D3E3E79F8',
taiko: '0x8410927C286A38883BC23721e640F31D3E3E79F8',
sei: '0x0e60fd361fF5b90088e1782e6b21A7D177d462C5',
swell: '0x435E8c9652Da151292F3981bbf663EBEB6668501',
};

export const getRenzoEZETHWarpConfig = async (): Promise<
Expand Down Expand Up @@ -254,6 +278,13 @@ export const getRenzoEZETHWarpConfig = async (): Promise<
},
],
},
hook: {
type: HookType.PROTOCOL_FEE,
owner: ezEthSafes[chain],
beneficiary: ezEthSafes[chain],
protocolFee: parseEther(protocolFee).toString(),
maxProtocolFee: MAX_PROTOCOL_FEE,
},
},
];

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { parseEther } from 'ethers/lib/utils.js';

import {
ChainMap,
HookType,
IsmType,
TokenRouterConfig,
TokenType,
Expand All @@ -9,24 +12,42 @@ import { symmetricDifference } from '@hyperlane-xyz/utils';

import { getRegistry as getMainnet3Registry } from '../../chains.js';

import { ezEthSafes, ezEthValidators } from './getRenzoEZETHWarpConfig.js';
import {
MAX_PROTOCOL_FEE,
ezEthSafes,
ezEthValidators,
protocolFee,
} 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 chainsToDeploy = ['ethereum', 'swell', 'zircuit'];

const pzEthValidators = {
ethereum: ezEthValidators.ethereum,
zircuit: ezEthValidators.zircuit,
swell: ezEthValidators.swell,
};

const pzEthSafes: Record<string, string> = {
ethereum: ezEthSafes.ethereum,
zircuit: ezEthSafes.zircuit,
swell: ezEthSafes.swell,
};

const existingProxyAdmins: ChainMap<{ address: string; owner: string }> = {
ltyu marked this conversation as resolved.
Show resolved Hide resolved
ltyu marked this conversation as resolved.
Show resolved Hide resolved
ethereum: {
address: '0x4f4671Ce69c9af15e33eB7Cf6D1358d1B39Af3bF',
owner: '0xD1e6626310fD54Eceb5b9a51dA2eC329D6D4B68A',
ltyu marked this conversation as resolved.
Show resolved Hide resolved
},
zircuit: {
address: '0x8b789B4A56675240c9f0985B467752b870c75711',
owner: '0x8410927C286A38883BC23721e640F31D3E3E79F8',
},
};

export const getRenzoPZETHWarpConfig = async (): Promise<
Expand Down Expand Up @@ -91,6 +112,14 @@ export const getRenzoPZETHWarpConfig = async (): Promise<
},
],
},
hook: {
ltyu marked this conversation as resolved.
Show resolved Hide resolved
type: HookType.PROTOCOL_FEE,
owner: ezEthSafes[chain],
beneficiary: ezEthSafes[chain],
protocolFee: parseEther(protocolFee).toString(),
maxProtocolFee: MAX_PROTOCOL_FEE,
},
proxyAdmin: existingProxyAdmins[chain],
},
];

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export enum WarpRouteIds {
Ancient8EthereumUSDC = 'USDC/ancient8-ethereum',
ArbitrumBaseBlastBscEthereumFraxtalLineaModeOptimismSeiTaikoZircuitEZETH = 'EZETH/arbitrum-base-blast-bsc-ethereum-fraxtal-linea-mode-optimism-sei-taiko-zircuit',
ArbitrumBaseBlastBscEthereumFraxtalLineaModeOptimismSeiSwellTaikoZircuitEZETH = 'EZETH/arbitrum-base-blast-bsc-ethereum-fraxtal-linea-mode-optimism-sei-swell-taiko-zircuit',
ArbitrumBaseEnduranceUSDC = 'USDC/arbitrum-base-endurance',
ArbitrumEthereumZircuitAMPHRETH = 'AMPHRETH/arbitrum-ethereum-zircuit',
ArbitrumNeutronEclip = 'ECLIP/arbitrum-neutron',
Expand All @@ -24,7 +24,7 @@ export enum WarpRouteIds {
EthereumVictionETH = 'ETH/ethereum-viction',
EthereumVictionUSDC = 'USDC/ethereum-viction',
EthereumVictionUSDT = 'USDT/ethereum-viction',
EthereumZircuitPZETH = 'PZETH/ethereum-zircuit',
EthereumSwellZircuitPZETH = 'PZETH/ethereum-swell-zircuit',
EthereumBscLumiaLUMIA = 'LUMIA/bsc-ethereum-lumia',
InevmInjectiveINJ = 'INJ/inevm-injective',
MantapacificNeutronTIA = 'TIA/mantapacific-neutron',
Expand Down
4 changes: 2 additions & 2 deletions typescript/infra/config/warp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ export const warpConfigGetterMap: Record<string, WarpConfigGetter> = {
[WarpRouteIds.EthereumInevmUSDT]: getEthereumInevmUSDTWarpConfig,
[WarpRouteIds.ArbitrumNeutronEclip]: getArbitrumNeutronEclipWarpConfig,
[WarpRouteIds.ArbitrumNeutronTIA]: getArbitrumNeutronTiaWarpConfig,
[WarpRouteIds.ArbitrumBaseBlastBscEthereumFraxtalLineaModeOptimismSeiTaikoZircuitEZETH]:
[WarpRouteIds.ArbitrumBaseBlastBscEthereumFraxtalLineaModeOptimismSeiSwellTaikoZircuitEZETH]:
getRenzoEZETHWarpConfig,
[WarpRouteIds.InevmInjectiveINJ]: getInevmInjectiveINJWarpConfig,
[WarpRouteIds.EthereumFlowCbBTC]: getEthereumFlowCbBTCWarpConfig,
[WarpRouteIds.EthereumSeiFastUSD]: getEthereumSeiFastUSDWarpConfig,
[WarpRouteIds.EthereumVictionETH]: getEthereumVictionETHWarpConfig,
[WarpRouteIds.EthereumVictionUSDC]: getEthereumVictionUSDCWarpConfig,
[WarpRouteIds.EthereumVictionUSDT]: getEthereumVictionUSDTWarpConfig,
[WarpRouteIds.EthereumZircuitPZETH]: getRenzoPZETHWarpConfig,
[WarpRouteIds.EthereumSwellZircuitPZETH]: getRenzoPZETHWarpConfig,
[WarpRouteIds.EthereumBscLumiaLUMIA]: getEthereumBscLUMIAWarpConfig,
[WarpRouteIds.MantapacificNeutronTIA]: getMantapacificNeutronTiaWarpConfig,
[WarpRouteIds.EclipseEthereumApxEth]: getEclipseEthereumApxEthWarpConfig,
Expand Down
Loading