Skip to content

Commit

Permalink
add getRenzoHook()
Browse files Browse the repository at this point in the history
  • Loading branch information
ltyu committed Dec 11, 2024
1 parent c390f4d commit b13b4b6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
TokenType,
buildAggregationIsmConfigs,
} from '@hyperlane-xyz/sdk';
import { symmetricDifference } from '@hyperlane-xyz/utils';
import { Address, symmetricDifference } from '@hyperlane-xyz/utils';

import { getEnvironmentConfig } from '../../../../../scripts/core-utils.js';
import { getRegistry as getMainnet3Registry } from '../../chains.js';
Expand Down Expand Up @@ -39,6 +39,22 @@ export function getProtocolFee(chain: ChainName) {
return (0.5 / Number(tokenPrices[chain])).toFixed(10).toString(); // ~$0.50 USD
}

export function getRenzoHook(defaultHook: Address, chain: ChainName) {
return {
type: HookType.AGGREGATION,
hooks: [
defaultHook,
{
type: HookType.PROTOCOL_FEE,
owner: ezEthSafes[chain],
beneficiary: ezEthSafes[chain],
protocolFee: parseEther(getProtocolFee(chain)).toString(),
maxProtocolFee: MAX_PROTOCOL_FEE,
},
],
};
}

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 Down Expand Up @@ -290,20 +306,7 @@ export const getRenzoEZETHWarpConfig = async (): Promise<
},
],
},
hook: {
type: HookType.AGGREGATION,
hooks: [
defaultHook,
{
type: HookType.PROTOCOL_FEE,
owner: ezEthSafes[chain],
beneficiary: ezEthSafes[chain],
protocolFee: parseEther(getProtocolFee(chain)).toString(),
maxProtocolFee: MAX_PROTOCOL_FEE,
},
],
},
// proxyAdmin: existingProxyAdmins[chain],
hook: getRenzoHook(defaultHook, chain),
},
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
ezEthSafes,
ezEthValidators,
getProtocolFee,
getRenzoHook,
} from './getRenzoEZETHWarpConfig.js';

const lockbox = '0xbC5511354C4A9a50DE928F56DB01DD327c4e56d5';
Expand Down Expand Up @@ -112,19 +113,7 @@ export const getRenzoPZETHWarpConfig = async (): Promise<
},
],
},
hook: {
type: HookType.AGGREGATION,
hooks: [
defaultHook,
{
type: HookType.PROTOCOL_FEE,
owner: ezEthSafes[chain],
beneficiary: ezEthSafes[chain],
protocolFee: parseEther(getProtocolFee(chain)).toString(),
maxProtocolFee: MAX_PROTOCOL_FEE,
},
],
},
hook: getRenzoHook(defaultHook, chain),
},
];

Expand Down

0 comments on commit b13b4b6

Please sign in to comment.