diff --git a/typescript/infra/config/environments/mainnet3/misc-artifacts/velo-message-module-addresses.json b/typescript/infra/config/environments/mainnet3/misc-artifacts/velo-message-module-addresses.json index 3b9fc2fec..9e2cc555b 100644 --- a/typescript/infra/config/environments/mainnet3/misc-artifacts/velo-message-module-addresses.json +++ b/typescript/infra/config/environments/mainnet3/misc-artifacts/velo-message-module-addresses.json @@ -4,5 +4,11 @@ }, "mode": { "router": "0xF385603a12Be8b7B885222329c581FDD1C30071D" + }, + "lisk": { + "router": "0xF385603a12Be8b7B885222329c581FDD1C30071D" + }, + "fraxtal": { + "router": "0xF385603a12Be8b7B885222329c581FDD1C30071D" } } diff --git a/typescript/infra/config/environments/mainnet3/misc-artifacts/velo-token-bridge-addresses.json b/typescript/infra/config/environments/mainnet3/misc-artifacts/velo-token-bridge-addresses.json index 1988c9adb..cd9fe5114 100644 --- a/typescript/infra/config/environments/mainnet3/misc-artifacts/velo-token-bridge-addresses.json +++ b/typescript/infra/config/environments/mainnet3/misc-artifacts/velo-token-bridge-addresses.json @@ -4,5 +4,11 @@ }, "mode": { "router": "0xA7287a56C01ac8Baaf8e7B662bDB41b10889C7A6" + }, + "lisk": { + "router": "0xA7287a56C01ac8Baaf8e7B662bDB41b10889C7A6" + }, + "fraxtal": { + "router": "0xA7287a56C01ac8Baaf8e7B662bDB41b10889C7A6" } } diff --git a/typescript/infra/config/environments/mainnet3/warp/configGetters/getAncient8EthereumUSDCWarpConfig.ts b/typescript/infra/config/environments/mainnet3/warp/configGetters/getAncient8EthereumUSDCWarpConfig.ts index 939bcc1ab..58f60211d 100644 --- a/typescript/infra/config/environments/mainnet3/warp/configGetters/getAncient8EthereumUSDCWarpConfig.ts +++ b/typescript/infra/config/environments/mainnet3/warp/configGetters/getAncient8EthereumUSDCWarpConfig.ts @@ -2,17 +2,21 @@ import { ethers } from 'ethers'; import { ChainMap, - RouterConfig, + OwnableConfig, TokenRouterConfig, TokenType, buildAggregationIsmConfigs, defaultMultisigConfigs, } from '@hyperlane-xyz/sdk'; -import { tokens } from '../../../../../src/config/warp.js'; +import { + RouterConfigWithoutOwner, + tokens, +} from '../../../../../src/config/warp.js'; export const getAncient8EthereumUSDCWarpConfig = async ( - routerConfig: ChainMap, + routerConfig: ChainMap, + abacusWorksEnvOwnerConfig: ChainMap, ): Promise> => { const ismConfig = buildAggregationIsmConfigs( 'ethereum', @@ -22,6 +26,7 @@ export const getAncient8EthereumUSDCWarpConfig = async ( const ethereum: TokenRouterConfig = { ...routerConfig.ethereum, + ...abacusWorksEnvOwnerConfig.ethereum, type: TokenType.collateral, token: tokens.ethereum.USDC, interchainSecurityModule: ismConfig, @@ -31,12 +36,9 @@ export const getAncient8EthereumUSDCWarpConfig = async ( hook: '0x19b2cF952b70b217c90FC408714Fbc1acD29A6A8', }; - // @ts-ignore - The types as they stand require a synthetic to specify - // TokenMetadata, but in practice these are actually inferred from a - // collateral config. To avoid needing to specify the TokenMetadata, just - // ts-ignore for synthetic tokens. const ancient8: TokenRouterConfig = { ...routerConfig.ancient8, + ...abacusWorksEnvOwnerConfig.ancient8, type: TokenType.synthetic, // Uses the default ISM interchainSecurityModule: ethers.constants.AddressZero, diff --git a/typescript/infra/config/environments/mainnet3/warp/configGetters/getArbitrumEthereumZircuitAmphrETHWarpConfig.ts b/typescript/infra/config/environments/mainnet3/warp/configGetters/getArbitrumEthereumZircuitAmphrETHWarpConfig.ts index 1b81e8110..9633354b5 100644 --- a/typescript/infra/config/environments/mainnet3/warp/configGetters/getArbitrumEthereumZircuitAmphrETHWarpConfig.ts +++ b/typescript/infra/config/environments/mainnet3/warp/configGetters/getArbitrumEthereumZircuitAmphrETHWarpConfig.ts @@ -2,49 +2,46 @@ import { ethers } from 'ethers'; import { ChainMap, - RouterConfig, + OwnableConfig, TokenRouterConfig, TokenType, } from '@hyperlane-xyz/sdk'; -import { tokens } from '../../../../../src/config/warp.js'; +import { getOwnerConfigForAddress } from '../../../../../src/config/environment.js'; +import { + RouterConfigWithoutOwner, + tokens, +} from '../../../../../src/config/warp.js'; +// MEV Capital const arbitrumOwner = '0x008615770B588633265cB01Abd19740fAe67d0B9'; const ethereumOwner = '0x008615770B588633265cB01Abd19740fAe67d0B9'; const zircuitOwner = '0xD0673e7F3FB4037CA79F53d2d311D0e017d39963'; export const getArbitrumEthereumZircuitAmphrETHWarpConfig = async ( - routerConfig: ChainMap, + routerConfig: ChainMap, + _abacusWorksEnvOwnerConfig: ChainMap, ): Promise> => { const arbitrum: TokenRouterConfig = { ...routerConfig.arbitrum, + ...getOwnerConfigForAddress(arbitrumOwner), type: TokenType.synthetic, interchainSecurityModule: ethers.constants.AddressZero, - owner: arbitrumOwner, - ownerOverrides: { - proxyAdmin: arbitrumOwner, - }, }; const ethereum: TokenRouterConfig = { ...routerConfig.ethereum, + ...getOwnerConfigForAddress(ethereumOwner), type: TokenType.collateral, token: tokens.ethereum.amphrETH, - owner: ethereumOwner, interchainSecurityModule: ethers.constants.AddressZero, - ownerOverrides: { - proxyAdmin: ethereumOwner, - }, }; const zircuit: TokenRouterConfig = { ...routerConfig.zircuit, + ...getOwnerConfigForAddress(zircuitOwner), type: TokenType.synthetic, interchainSecurityModule: ethers.constants.AddressZero, - owner: zircuitOwner, - ownerOverrides: { - proxyAdmin: zircuitOwner, - }, }; return { diff --git a/typescript/infra/config/environments/mainnet3/warp/configGetters/getArbitrumNeutronEclipWarpConfig.ts b/typescript/infra/config/environments/mainnet3/warp/configGetters/getArbitrumNeutronEclipWarpConfig.ts index daebd6c02..2dae8e447 100644 --- a/typescript/infra/config/environments/mainnet3/warp/configGetters/getArbitrumNeutronEclipWarpConfig.ts +++ b/typescript/infra/config/environments/mainnet3/warp/configGetters/getArbitrumNeutronEclipWarpConfig.ts @@ -1,23 +1,36 @@ import { ChainMap, - RouterConfig, + OwnableConfig, TokenRouterConfig, TokenType, } from '@hyperlane-xyz/sdk'; +import { getOwnerConfigForAddress } from '../../../../../src/config/environment.js'; +import { RouterConfigWithoutOwner } from '../../../../../src/config/warp.js'; + +// Eclipse Fi team +const arbitrumOwner = '0xfF07222cb0AC905304d6586Aabf13f497C07F0C8'; +const neutronOwner = + 'neutron1aud8lty0wwmyc86ugkzqrusnrku0ckm0ym62v4ve0jjjyepjjg6spssrwj'; + export const getArbitrumNeutronEclipWarpConfig = async ( - routerConfig: ChainMap, + routerConfig: ChainMap, + _abacusWorksEnvOwnerConfig: ChainMap, ): Promise> => { const neutronRouter = '6b04c49fcfd98bc4ea9c05cd5790462a39537c00028333474aebe6ddf20b73a3'; - // @ts-ignore - foreignDeployment configs dont conform to the TokenRouterConfig const neutron: TokenRouterConfig = { + ...routerConfig.neutron, + ...getOwnerConfigForAddress(neutronOwner), + type: TokenType.collateral, + token: 'factory/neutron10sr06r3qkhn7xzpw3339wuj77hu06mzna6uht0/eclip', foreignDeployment: neutronRouter, }; const arbitrum: TokenRouterConfig = { ...routerConfig.arbitrum, + ...getOwnerConfigForAddress(arbitrumOwner), type: TokenType.synthetic, name: 'Eclipse Fi', symbol: 'ECLIP', @@ -25,7 +38,6 @@ export const getArbitrumNeutronEclipWarpConfig = async ( totalSupply: 0, gas: 600_000, interchainSecurityModule: '0x676151bFB8D29690a359F99AE764860595504689', // This has diverged from the default ism on neutron, we cannot change as it is owned by the Eclip team - owner: '0xfF07222cb0AC905304d6586Aabf13f497C07F0C8', // Eclip team }; return { diff --git a/typescript/infra/config/environments/mainnet3/warp/configGetters/getArbitrumNeutronTiaWarpConfig.ts b/typescript/infra/config/environments/mainnet3/warp/configGetters/getArbitrumNeutronTiaWarpConfig.ts index ce601ffc1..66a6d9e11 100644 --- a/typescript/infra/config/environments/mainnet3/warp/configGetters/getArbitrumNeutronTiaWarpConfig.ts +++ b/typescript/infra/config/environments/mainnet3/warp/configGetters/getArbitrumNeutronTiaWarpConfig.ts @@ -1,23 +1,31 @@ import { ChainMap, - RouterConfig, + OwnableConfig, TokenRouterConfig, TokenType, } from '@hyperlane-xyz/sdk'; +import { RouterConfigWithoutOwner } from '../../../../../src/config/warp.js'; + export const getArbitrumNeutronTiaWarpConfig = async ( - routerConfig: ChainMap, + routerConfig: ChainMap, + abacusWorksEnvOwnerConfig: ChainMap, ): Promise> => { const neutronRouter = '910926c4cf95d107237a9cf0b3305fe9c81351ebcba3d218ceb0e4935d92ceac'; - // @ts-ignore - foreignDeployment configs dont conform to the TokenRouterConfig const neutron: TokenRouterConfig = { + ...routerConfig.neutron, + ...abacusWorksEnvOwnerConfig.neutron, + type: TokenType.collateral, + token: + 'ibc/773B4D0A3CD667B2275D5A4A7A2F0909C0BA0F4059C0B9181E680DDF4965DCC7', foreignDeployment: neutronRouter, }; const arbitrum: TokenRouterConfig = { ...routerConfig.arbitrum, + ...abacusWorksEnvOwnerConfig.arbitrum, type: TokenType.synthetic, name: 'TIA', symbol: 'TIA.n', diff --git a/typescript/infra/config/environments/mainnet3/warp/configGetters/getEclipseEthereumSolanaUSDTWarpConfig.ts b/typescript/infra/config/environments/mainnet3/warp/configGetters/getEclipseEthereumSolanaUSDTWarpConfig.ts index 781b3caa9..fbece7506 100644 --- a/typescript/infra/config/environments/mainnet3/warp/configGetters/getEclipseEthereumSolanaUSDTWarpConfig.ts +++ b/typescript/infra/config/environments/mainnet3/warp/configGetters/getEclipseEthereumSolanaUSDTWarpConfig.ts @@ -2,18 +2,23 @@ import { ethers } from 'ethers'; import { ChainMap, - RouterConfig, + OwnableConfig, TokenRouterConfig, TokenType, } from '@hyperlane-xyz/sdk'; -import { tokens } from '../../../../../src/config/warp.js'; +import { + RouterConfigWithoutOwner, + tokens, +} from '../../../../../src/config/warp.js'; export const getEclipseEthereumSolanaUSDTWarpConfig = async ( - routerConfig: ChainMap, + routerConfig: ChainMap, + abacusWorksEnvOwnerConfig: ChainMap, ): Promise> => { const eclipsemainnet: TokenRouterConfig = { ...routerConfig.eclipsemainnet, + ...abacusWorksEnvOwnerConfig.eclipsemainnet, type: TokenType.synthetic, foreignDeployment: '5g5ujyYUNvdydwyDVCpZwPpgYRqH5RYJRi156cxyE3me', gas: 300_000, @@ -21,6 +26,7 @@ export const getEclipseEthereumSolanaUSDTWarpConfig = async ( }; let ethereum: TokenRouterConfig = { ...routerConfig.ethereum, + ...abacusWorksEnvOwnerConfig.ethereum, type: TokenType.collateral, token: tokens.ethereum.USDT, interchainSecurityModule: ethers.constants.AddressZero, diff --git a/typescript/infra/config/environments/mainnet3/warp/configGetters/getEclipseEthereumWBTCWarpConfig.ts b/typescript/infra/config/environments/mainnet3/warp/configGetters/getEclipseEthereumWBTCWarpConfig.ts index 03bdd55b7..4b2a4a7bb 100644 --- a/typescript/infra/config/environments/mainnet3/warp/configGetters/getEclipseEthereumWBTCWarpConfig.ts +++ b/typescript/infra/config/environments/mainnet3/warp/configGetters/getEclipseEthereumWBTCWarpConfig.ts @@ -2,18 +2,23 @@ import { ethers } from 'ethers'; import { ChainMap, - RouterConfig, + OwnableConfig, TokenRouterConfig, TokenType, } from '@hyperlane-xyz/sdk'; -import { tokens } from '../../../../../src/config/warp.js'; +import { + RouterConfigWithoutOwner, + tokens, +} from '../../../../../src/config/warp.js'; export const getEclipseEthereumWBTCWarpConfig = async ( - routerConfig: ChainMap, + routerConfig: ChainMap, + abacusWorksEnvOwnerConfig: ChainMap, ): Promise> => { const eclipsemainnet: TokenRouterConfig = { ...routerConfig.eclipsemainnet, + ...abacusWorksEnvOwnerConfig.eclipsemainnet, type: TokenType.synthetic, foreignDeployment: 'A7EGCDYFw5R7Jfm6cYtKvY8dmkrYMgwRCJFkyQwpHTYu', gas: 300_000, @@ -22,6 +27,7 @@ export const getEclipseEthereumWBTCWarpConfig = async ( let ethereum: TokenRouterConfig = { ...routerConfig.ethereum, + ...abacusWorksEnvOwnerConfig.ethereum, type: TokenType.collateral, token: tokens.ethereum.WBTC, interchainSecurityModule: ethers.constants.AddressZero, diff --git a/typescript/infra/config/environments/mainnet3/warp/configGetters/getEclipseEthereumWeETHsWarpConfig.ts b/typescript/infra/config/environments/mainnet3/warp/configGetters/getEclipseEthereumWeETHsWarpConfig.ts index 34da322ad..b4d7885f2 100644 --- a/typescript/infra/config/environments/mainnet3/warp/configGetters/getEclipseEthereumWeETHsWarpConfig.ts +++ b/typescript/infra/config/environments/mainnet3/warp/configGetters/getEclipseEthereumWeETHsWarpConfig.ts @@ -2,19 +2,30 @@ import { ethers } from 'ethers'; import { ChainMap, + OwnableConfig, RouterConfig, TokenRouterConfig, TokenType, } from '@hyperlane-xyz/sdk'; -import { tokens } from '../../../../../src/config/warp.js'; -import { DEPLOYER } from '../../owners.js'; +import { getOwnerConfigForAddress } from '../../../../../src/config/environment.js'; +import { + RouterConfigWithoutOwner, + tokens, +} from '../../../../../src/config/warp.js'; + +// Safe owned by Veda +const ethereumOwner = '0xCEA8039076E35a825854c5C2f85659430b06ec96'; +// Vault owned by Veda +const eclipseOwner = '4Cj1s2ipALjJk9foQV4oDaZYCZwSsVkAShQL1KFVJG9b'; -export const getEclipseEthereumWeEthsWarpConfig = async ( - routerConfig: ChainMap, -): Promise> => { +export async function getEclipseEthereumWeEthsWarpConfig( + routerConfig: ChainMap, + _abacusWorksEnvOwnerConfig: ChainMap, +): Promise> { const eclipsemainnet: TokenRouterConfig = { ...routerConfig.eclipsemainnet, + ...getOwnerConfigForAddress(eclipseOwner), type: TokenType.synthetic, foreignDeployment: '7Zx4wU1QAw98MfvnPFqRh1oyumek7G5VAX6TKB3U1tcn', gas: 300_000, @@ -23,14 +34,14 @@ export const getEclipseEthereumWeEthsWarpConfig = async ( let ethereum: TokenRouterConfig = { ...routerConfig.ethereum, + ...getOwnerConfigForAddress(ethereumOwner), type: TokenType.collateral, token: tokens.ethereum.weETHs, interchainSecurityModule: ethers.constants.AddressZero, - owner: DEPLOYER, }; return { eclipsemainnet, ethereum, }; -}; +} diff --git a/typescript/infra/config/environments/mainnet3/warp/configGetters/getEclipseStrideSTTIAWarpConfig.ts b/typescript/infra/config/environments/mainnet3/warp/configGetters/getEclipseStrideSTTIAWarpConfig.ts index 4d8db22a7..4d8c79a7c 100644 --- a/typescript/infra/config/environments/mainnet3/warp/configGetters/getEclipseStrideSTTIAWarpConfig.ts +++ b/typescript/infra/config/environments/mainnet3/warp/configGetters/getEclipseStrideSTTIAWarpConfig.ts @@ -1,15 +1,23 @@ import { ChainMap, - RouterConfig, + OwnableConfig, TokenRouterConfig, TokenType, } from '@hyperlane-xyz/sdk'; +import { getOwnerConfigForAddress } from '../../../../../src/config/environment.js'; +import { RouterConfigWithoutOwner } from '../../../../../src/config/warp.js'; + +// Stride team +const strideOwner = 'stride1k8c2m5cn322akk5wy8lpt87dd2f4yh9azg7jlh'; + export const getEclipseStrideTiaWarpConfig = async ( - routerConfig: ChainMap, + routerConfig: ChainMap, + abacusWorksEnvOwnerConfig: ChainMap, ): Promise> => { const eclipsemainnet: TokenRouterConfig = { ...routerConfig.eclipsemainnet, + ...abacusWorksEnvOwnerConfig.eclipsemainnet, type: TokenType.synthetic, foreignDeployment: 'BpXHAiktwjx7fN6M9ST9wr6qKAsH27wZFhdHEhReJsR6', gas: 300_000, @@ -17,6 +25,7 @@ export const getEclipseStrideTiaWarpConfig = async ( const stride: TokenRouterConfig = { ...routerConfig.stride, + ...getOwnerConfigForAddress(strideOwner), type: TokenType.collateral, foreignDeployment: 'stride1pvtesu3ve7qn7ctll2x495mrqf2ysp6fws68grvcu6f7n2ajghgsh2jdj6', diff --git a/typescript/infra/config/environments/mainnet3/warp/configGetters/getEclipseStrideTIAWarpConfig.ts b/typescript/infra/config/environments/mainnet3/warp/configGetters/getEclipseStrideTIAWarpConfig.ts index 9d5bdf578..d687138b3 100644 --- a/typescript/infra/config/environments/mainnet3/warp/configGetters/getEclipseStrideTIAWarpConfig.ts +++ b/typescript/infra/config/environments/mainnet3/warp/configGetters/getEclipseStrideTIAWarpConfig.ts @@ -1,15 +1,23 @@ import { ChainMap, - RouterConfig, + OwnableConfig, TokenRouterConfig, TokenType, } from '@hyperlane-xyz/sdk'; +import { getOwnerConfigForAddress } from '../../../../../src/config/environment.js'; +import { RouterConfigWithoutOwner } from '../../../../../src/config/warp.js'; + +// Stride team +const strideOwner = 'stride1k8c2m5cn322akk5wy8lpt87dd2f4yh9azg7jlh'; + export const getEclipseStrideStTiaWarpConfig = async ( - routerConfig: ChainMap, + routerConfig: ChainMap, + abacusWorksEnvOwnerConfig: ChainMap, ): Promise> => { const eclipsemainnet: TokenRouterConfig = { ...routerConfig.eclipsemainnet, + ...abacusWorksEnvOwnerConfig.eclipsemainnet, type: TokenType.synthetic, foreignDeployment: 'tKUHyJ5NxhnwU94JUmzh1ekukDcHHX8mZF6fqxbMwX6', gas: 300_000, @@ -17,6 +25,7 @@ export const getEclipseStrideStTiaWarpConfig = async ( const stride: TokenRouterConfig = { ...routerConfig.stride, + ...getOwnerConfigForAddress(strideOwner), type: TokenType.collateral, foreignDeployment: 'stride134axwdlam929m3mar3wv95nvkyep7mr87ravkqcpf8dfe3v0pjlqwrw6ee', diff --git a/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumBscLumiaLUMIAWarpConfig.ts b/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumBscLumiaLUMIAWarpConfig.ts index 3ce50742a..1afa97f4f 100644 --- a/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumBscLumiaLUMIAWarpConfig.ts +++ b/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumBscLumiaLUMIAWarpConfig.ts @@ -1,59 +1,50 @@ import { ChainMap, - RouterConfig, + OwnableConfig, TokenRouterConfig, TokenType, } from '@hyperlane-xyz/sdk'; -import { objMap } from '@hyperlane-xyz/utils'; + +import { getOwnerConfigForAddress } from '../../../../../src/config/environment.js'; +import { RouterConfigWithoutOwner } from '../../../../../src/config/warp.js'; // Lumia Team const owner = '0x8bBA07Ddc72455b55530C17e6f6223EF6E156863'; - -const ownerConfig = { - owner, - // The proxyAdmins are warp-route specific - ownerOverrides: { - proxyAdmin: owner, - }, -}; +const ownerConfig = getOwnerConfigForAddress(owner); export const getEthereumBscLUMIAWarpConfig = async ( - routerConfig: ChainMap, + routerConfig: ChainMap, + _abacusWorksEnvOwnerConfig: ChainMap, ): Promise> => { - const ethereum = { + const ethereum: TokenRouterConfig = { + ...routerConfig.ethereum, + ...ownerConfig, type: TokenType.collateral, token: '0xD9343a049D5DBd89CD19DC6BcA8c48fB3a0a42a7', - ownerOverrides: { - proxyAdmin: owner, - }, }; - const bsc = { + const bsc: TokenRouterConfig = { + ...routerConfig.bsc, + ...ownerConfig, type: TokenType.synthetic, - ownerOverrides: { - proxyAdmin: owner, - }, }; - const lumia = { + const lumia: TokenRouterConfig = { + ...routerConfig.lumia, + ...ownerConfig, type: TokenType.native, // As this has been removed from the registry in https://github.com/hyperlane-xyz/hyperlane-registry/pull/348, // we must specify this explicitly. mailbox: '0x3a867fCfFeC2B790970eeBDC9023E75B0a172aa7', - proxyAdmin: '0xeA87ae93Fa0019a82A727bfd3eBd1cFCa8f64f1D', + proxyAdmin: { + owner: owner, + address: '0xeA87ae93Fa0019a82A727bfd3eBd1cFCa8f64f1D', + }, }; - const configMap = { + return { ethereum, bsc, lumia, }; - - const merged = objMap(configMap, (chain, config) => ({ - ...routerConfig[chain], - ...config, - ...ownerConfig, - })); - - return merged as ChainMap; }; diff --git a/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumFlowCbBTCWarpConfig.ts b/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumFlowCbBTCWarpConfig.ts new file mode 100644 index 000000000..3a1cd937e --- /dev/null +++ b/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumFlowCbBTCWarpConfig.ts @@ -0,0 +1,44 @@ +import { ethers } from 'ethers'; + +import { + ChainMap, + OwnableConfig, + TokenRouterConfig, + TokenType, +} from '@hyperlane-xyz/sdk'; + +import { getOwnerConfigForAddress } from '../../../../../src/config/environment.js'; +import { + RouterConfigWithoutOwner, + tokens, +} from '../../../../../src/config/warp.js'; +import { DEPLOYER } from '../../owners.js'; + +// Keep on our deployer for now until we get an address from Flow +const owner = DEPLOYER; +const ownerConfig = getOwnerConfigForAddress(owner); + +export const getEthereumFlowCbBTCWarpConfig = async ( + routerConfig: ChainMap, + _abacusWorksEnvOwnerConfig: ChainMap, +): Promise> => { + const ethereum: TokenRouterConfig = { + ...routerConfig.ethereum, + ...ownerConfig, + type: TokenType.collateral, + token: tokens.ethereum.cbBTC, + interchainSecurityModule: ethers.constants.AddressZero, + }; + + const flowmainnet: TokenRouterConfig = { + ...routerConfig.flowmainnet, + ...ownerConfig, + type: TokenType.synthetic, + interchainSecurityModule: ethers.constants.AddressZero, + }; + + return { + ethereum, + flowmainnet, + }; +}; diff --git a/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumInevmUSDCWarpConfig.ts b/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumInevmUSDCWarpConfig.ts index aa4b19054..cb5ba7ada 100644 --- a/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumInevmUSDCWarpConfig.ts +++ b/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumInevmUSDCWarpConfig.ts @@ -2,18 +2,23 @@ import { ethers } from 'ethers'; import { ChainMap, - RouterConfig, + OwnableConfig, TokenRouterConfig, TokenType, } from '@hyperlane-xyz/sdk'; -import { tokens } from '../../../../../src/config/warp.js'; +import { + RouterConfigWithoutOwner, + tokens, +} from '../../../../../src/config/warp.js'; export const getEthereumInevmUSDCWarpConfig = async ( - routerConfig: ChainMap, + routerConfig: ChainMap, + abacusWorksEnvOwnerConfig: ChainMap, ): Promise> => { const ethereum: TokenRouterConfig = { ...routerConfig.ethereum, + ...abacusWorksEnvOwnerConfig.ethereum, type: TokenType.collateral, token: tokens.ethereum.USDC, hook: '0xb87AC8EA4533AE017604E44470F7c1E550AC6F10', // aggregation of IGP and Merkle, arbitrary config not supported for now, TODO: may want to move to zero address in future @@ -21,6 +26,7 @@ export const getEthereumInevmUSDCWarpConfig = async ( const inevm: TokenRouterConfig = { ...routerConfig.inevm, + ...abacusWorksEnvOwnerConfig.inevm, type: TokenType.synthetic, interchainSecurityModule: ethers.constants.AddressZero, }; diff --git a/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumInevmUSDTWarpConfig.ts b/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumInevmUSDTWarpConfig.ts index abe8fd14c..b861444f1 100644 --- a/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumInevmUSDTWarpConfig.ts +++ b/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumInevmUSDTWarpConfig.ts @@ -2,18 +2,23 @@ import { ethers } from 'ethers'; import { ChainMap, - RouterConfig, + OwnableConfig, TokenRouterConfig, TokenType, } from '@hyperlane-xyz/sdk'; -import { tokens } from '../../../../../src/config/warp.js'; +import { + RouterConfigWithoutOwner, + tokens, +} from '../../../../../src/config/warp.js'; export const getEthereumInevmUSDTWarpConfig = async ( - routerConfig: ChainMap, + routerConfig: ChainMap, + abacusWorksEnvOwnerConfig: ChainMap, ): Promise> => { const ethereum: TokenRouterConfig = { ...routerConfig.ethereum, + ...abacusWorksEnvOwnerConfig.ethereum, type: TokenType.collateral, token: tokens.ethereum.USDT, hook: '0xb87AC8EA4533AE017604E44470F7c1E550AC6F10', // aggregation of IGP and Merkle, arbitrary config not supported for now, TODO: may want to move to zero address in future @@ -21,6 +26,7 @@ export const getEthereumInevmUSDTWarpConfig = async ( const inevm: TokenRouterConfig = { ...routerConfig.inevm, + ...abacusWorksEnvOwnerConfig.inevm, type: TokenType.synthetic, interchainSecurityModule: ethers.constants.AddressZero, }; diff --git a/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumSeiFastUSDWarpConfig.ts b/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumSeiFastUSDWarpConfig.ts index 5bd4938d2..1eb7f4a58 100644 --- a/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumSeiFastUSDWarpConfig.ts +++ b/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumSeiFastUSDWarpConfig.ts @@ -2,42 +2,42 @@ import { ethers } from 'ethers'; import { ChainMap, - RouterConfig, + OwnableConfig, TokenRouterConfig, TokenType, } from '@hyperlane-xyz/sdk'; -import { tokens } from '../../../../../src/config/warp.js'; +import { getOwnerConfigForAddress } from '../../../../../src/config/environment.js'; +import { + RouterConfigWithoutOwner, + tokens, +} from '../../../../../src/config/warp.js'; // Elixir const owner = '0x00000000F51340906F767C6999Fe512b1275955C'; +const ownerConfig = getOwnerConfigForAddress(owner); export const getEthereumSeiFastUSDWarpConfig = async ( - routerConfig: ChainMap, + routerConfig: ChainMap, + _abacusWorksEnvOwnerConfig: ChainMap, ): Promise> => { const sei: TokenRouterConfig = { ...routerConfig.viction, + ...ownerConfig, type: TokenType.XERC20, name: 'fastUSD', symbol: 'fastUSD', decimals: 18, token: tokens.sei.fastUSD, interchainSecurityModule: ethers.constants.AddressZero, - owner, - ownerOverrides: { - proxyAdmin: owner, - }, }; const ethereum: TokenRouterConfig = { ...routerConfig.ethereum, + ...ownerConfig, type: TokenType.collateral, token: tokens.ethereum.deUSD, - owner, interchainSecurityModule: ethers.constants.AddressZero, - ownerOverrides: { - proxyAdmin: owner, - }, }; return { diff --git a/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumVictionETHWarpConfig.ts b/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumVictionETHWarpConfig.ts index 975483bc5..a932b181b 100644 --- a/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumVictionETHWarpConfig.ts +++ b/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumVictionETHWarpConfig.ts @@ -1,14 +1,17 @@ import { ChainMap, - RouterConfig, + OwnableConfig, TokenRouterConfig, TokenType, buildAggregationIsmConfigs, defaultMultisigConfigs, } from '@hyperlane-xyz/sdk'; +import { RouterConfigWithoutOwner } from '../../../../../src/config/warp.js'; + export const getEthereumVictionETHWarpConfig = async ( - routerConfig: ChainMap, + routerConfig: ChainMap, + abacusWorksEnvOwnerConfig: ChainMap, ): Promise> => { const ismConfig = buildAggregationIsmConfigs( 'ethereum', @@ -18,6 +21,7 @@ export const getEthereumVictionETHWarpConfig = async ( const viction: TokenRouterConfig = { ...routerConfig.viction, + ...abacusWorksEnvOwnerConfig.viction, type: TokenType.synthetic, name: 'ETH', symbol: 'ETH', @@ -28,6 +32,7 @@ export const getEthereumVictionETHWarpConfig = async ( const ethereum: TokenRouterConfig = { ...routerConfig.ethereum, + ...abacusWorksEnvOwnerConfig.ethereum, type: TokenType.native, gas: 65_000, interchainSecurityModule: ismConfig, diff --git a/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumVictionUSDCWarpConfig.ts b/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumVictionUSDCWarpConfig.ts index ae8ed5494..c046753c9 100644 --- a/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumVictionUSDCWarpConfig.ts +++ b/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumVictionUSDCWarpConfig.ts @@ -1,16 +1,20 @@ import { ChainMap, - RouterConfig, + OwnableConfig, TokenRouterConfig, TokenType, buildAggregationIsmConfigs, defaultMultisigConfigs, } from '@hyperlane-xyz/sdk'; -import { tokens } from '../../../../../src/config/warp.js'; +import { + RouterConfigWithoutOwner, + tokens, +} from '../../../../../src/config/warp.js'; export const getEthereumVictionUSDCWarpConfig = async ( - routerConfig: ChainMap, + routerConfig: ChainMap, + abacusWorksEnvOwnerConfig: ChainMap, ): Promise> => { // commit that the config was copied from https://github.com/hyperlane-xyz/hyperlane-monorepo/pull/3067/commits/7ed5b460034ea5e140c6ff86bcd6baf6ebb824c4#diff-fab5dd1a27c76e4310699c57ccf92ab6274ef0acf17e079b17270cedf4057775R109 const ismConfig = buildAggregationIsmConfigs( @@ -21,6 +25,7 @@ export const getEthereumVictionUSDCWarpConfig = async ( const viction: TokenRouterConfig = { ...routerConfig.viction, + ...abacusWorksEnvOwnerConfig.viction, type: TokenType.synthetic, name: 'USDC', symbol: 'USDC', @@ -31,6 +36,7 @@ export const getEthereumVictionUSDCWarpConfig = async ( const ethereum: TokenRouterConfig = { ...routerConfig.ethereum, + ...abacusWorksEnvOwnerConfig.ethereum, type: TokenType.collateral, token: tokens.ethereum.USDC, gas: 65_000, diff --git a/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumVictionUSDTWarpConfig.ts b/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumVictionUSDTWarpConfig.ts index 85abe405d..5835f9632 100644 --- a/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumVictionUSDTWarpConfig.ts +++ b/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumVictionUSDTWarpConfig.ts @@ -1,16 +1,20 @@ import { ChainMap, - RouterConfig, + OwnableConfig, TokenRouterConfig, TokenType, buildAggregationIsmConfigs, defaultMultisigConfigs, } from '@hyperlane-xyz/sdk'; -import { tokens } from '../../../../../src/config/warp.js'; +import { + RouterConfigWithoutOwner, + tokens, +} from '../../../../../src/config/warp.js'; export const getEthereumVictionUSDTWarpConfig = async ( - routerConfig: ChainMap, + routerConfig: ChainMap, + abacusWorksEnvOwnerConfig: ChainMap, ): Promise> => { const ismConfig = buildAggregationIsmConfigs( 'ethereum', @@ -20,6 +24,7 @@ export const getEthereumVictionUSDTWarpConfig = async ( const viction: TokenRouterConfig = { ...routerConfig.viction, + ...abacusWorksEnvOwnerConfig.viction, type: TokenType.synthetic, name: 'USDT', symbol: 'USDT', @@ -30,6 +35,7 @@ export const getEthereumVictionUSDTWarpConfig = async ( const ethereum: TokenRouterConfig = { ...routerConfig.ethereum, + ...abacusWorksEnvOwnerConfig.ethereum, type: TokenType.collateral, token: tokens.ethereum.USDT, gas: 65_000, diff --git a/typescript/infra/config/environments/mainnet3/warp/configGetters/getInevmInjectiveINJWarpConfig.ts b/typescript/infra/config/environments/mainnet3/warp/configGetters/getInevmInjectiveINJWarpConfig.ts index 438fe23e9..fd1b5c2b1 100644 --- a/typescript/infra/config/environments/mainnet3/warp/configGetters/getInevmInjectiveINJWarpConfig.ts +++ b/typescript/infra/config/environments/mainnet3/warp/configGetters/getInevmInjectiveINJWarpConfig.ts @@ -1,23 +1,28 @@ import { ChainMap, - RouterConfig, + OwnableConfig, TokenRouterConfig, TokenType, } from '@hyperlane-xyz/sdk'; +import { RouterConfigWithoutOwner } from '../../../../../src/config/warp.js'; + export const getInevmInjectiveINJWarpConfig = async ( - routerConfig: ChainMap, + routerConfig: ChainMap, + abacusWorksEnvOwnerConfig: ChainMap, ): Promise> => { const injectiveRouter = 'inj1mv9tjvkaw7x8w8y9vds8pkfq46g2vcfkjehc6k'; - // @ts-ignore - foreignDeployment configs don't conform to the TokenRouterConfig const injective: TokenRouterConfig = { + ...routerConfig.injective, + ...abacusWorksEnvOwnerConfig.injective, type: TokenType.native, foreignDeployment: injectiveRouter, }; const inevm: TokenRouterConfig = { ...routerConfig.inevm, + ...abacusWorksEnvOwnerConfig.inevm, type: TokenType.native, }; diff --git a/typescript/infra/config/environments/mainnet3/warp/configGetters/getMantapacificNeutronTiaWarpConfig.ts b/typescript/infra/config/environments/mainnet3/warp/configGetters/getMantapacificNeutronTiaWarpConfig.ts index e157552e6..a603ec139 100644 --- a/typescript/infra/config/environments/mainnet3/warp/configGetters/getMantapacificNeutronTiaWarpConfig.ts +++ b/typescript/infra/config/environments/mainnet3/warp/configGetters/getMantapacificNeutronTiaWarpConfig.ts @@ -1,12 +1,15 @@ import { ChainMap, - RouterConfig, + OwnableConfig, TokenRouterConfig, TokenType, } from '@hyperlane-xyz/sdk'; +import { RouterConfigWithoutOwner } from '../../../../../src/config/warp.js'; + export const getMantapacificNeutronTiaWarpConfig = async ( - routerConfig: ChainMap, + routerConfig: ChainMap, + abacusWorksEnvOwnerConfig: ChainMap, ): Promise> => { const neutronRouter = '0xc5fc6899019cb4a7649981d89eb7b1a0929d0a85b2d41802f3315129ad4b581a'; @@ -18,6 +21,7 @@ export const getMantapacificNeutronTiaWarpConfig = async ( const mantapacific: TokenRouterConfig = { ...routerConfig.mantapacific, + ...abacusWorksEnvOwnerConfig.mantapacific, type: TokenType.synthetic, name: 'TIA', symbol: 'TIA', diff --git a/typescript/infra/config/environments/mainnet3/warp/warpIds.ts b/typescript/infra/config/environments/mainnet3/warp/warpIds.ts index 605f0a794..70246891c 100644 --- a/typescript/infra/config/environments/mainnet3/warp/warpIds.ts +++ b/typescript/infra/config/environments/mainnet3/warp/warpIds.ts @@ -15,6 +15,7 @@ export enum WarpRouteIds { EclipseSolanaWIF = 'WIF/eclipsemainnet-solanamainnet', EclipseStrideSTTIA = 'stTIA/eclipsemainnet-stride', EclipseStrideTIA = 'TIA/eclipsemainnet-stride', + EthereumFlowCbBTC = 'CBBTC/ethereum-flowmainnet', EthereumInevmUSDC = 'USDC/ethereum-inevm', EthereumInevmUSDT = 'USDT/ethereum-inevm', EthereumSeiFastUSD = 'FASTUSD/ethereum-sei', diff --git a/typescript/infra/config/warp.ts b/typescript/infra/config/warp.ts index 3a9bf87e0..53c202db8 100644 --- a/typescript/infra/config/warp.ts +++ b/typescript/infra/config/warp.ts @@ -1,15 +1,16 @@ import { ChainMap, MultiProvider, - RouterConfig, + OwnableConfig, TokenRouterConfig, } from '@hyperlane-xyz/sdk'; +import { objMap } from '@hyperlane-xyz/utils'; -import { getHyperlaneCore } from '../scripts/core-utils.js'; import { EnvironmentConfig, getRouterConfigsForAllVms, } from '../src/config/environment.js'; +import { RouterConfigWithoutOwner } from '../src/config/warp.js'; import { getAncient8EthereumUSDCWarpConfig } from './environments/mainnet3/warp/configGetters/getAncient8EthereumUSDCWarpConfig.js'; import { getArbitrumEthereumZircuitAmphrETHWarpConfig } from './environments/mainnet3/warp/configGetters/getArbitrumEthereumZircuitAmphrETHWarpConfig.js'; @@ -21,6 +22,7 @@ import { getEclipseEthereumWeEthsWarpConfig } from './environments/mainnet3/warp import { getEclipseStrideTiaWarpConfig } from './environments/mainnet3/warp/configGetters/getEclipseStrideSTTIAWarpConfig.js'; import { getEclipseStrideStTiaWarpConfig } from './environments/mainnet3/warp/configGetters/getEclipseStrideTIAWarpConfig.js'; import { getEthereumBscLUMIAWarpConfig } from './environments/mainnet3/warp/configGetters/getEthereumBscLumiaLUMIAWarpConfig.js'; +import { getEthereumFlowCbBTCWarpConfig } from './environments/mainnet3/warp/configGetters/getEthereumFlowCbBTCWarpConfig.js'; import { getEthereumInevmUSDCWarpConfig } from './environments/mainnet3/warp/configGetters/getEthereumInevmUSDCWarpConfig.js'; import { getEthereumInevmUSDTWarpConfig } from './environments/mainnet3/warp/configGetters/getEthereumInevmUSDTWarpConfig.js'; import { getEthereumSeiFastUSDWarpConfig } from './environments/mainnet3/warp/configGetters/getEthereumSeiFastUSDWarpConfig.js'; @@ -33,16 +35,12 @@ import { getRenzoEZETHWarpConfig } from './environments/mainnet3/warp/configGett import { getRenzoPZETHWarpConfig } from './environments/mainnet3/warp/configGetters/getRenzoPZETHWarpConfig.js'; import { WarpRouteIds } from './environments/mainnet3/warp/warpIds.js'; -type WarpConfigGetterWithConfig = ( - routerConfig: ChainMap, +type WarpConfigGetter = ( + routerConfig: ChainMap, + abacusWorksEnvOwnerConfig: ChainMap, ) => Promise>; -type WarpConfigGetterWithoutConfig = () => Promise>; - -export const warpConfigGetterMap: Record< - string, - WarpConfigGetterWithConfig | WarpConfigGetterWithoutConfig -> = { +export const warpConfigGetterMap: Record = { [WarpRouteIds.Ancient8EthereumUSDC]: getAncient8EthereumUSDCWarpConfig, [WarpRouteIds.ArbitrumEthereumZircuitAMPHRETH]: getArbitrumEthereumZircuitAmphrETHWarpConfig, @@ -53,6 +51,7 @@ export const warpConfigGetterMap: Record< [WarpRouteIds.ArbitrumBaseBlastBscEthereumFraxtalLineaModeOptimismSeiTaikoZircuitEZETH]: getRenzoEZETHWarpConfig, [WarpRouteIds.InevmInjectiveINJ]: getInevmInjectiveINJWarpConfig, + [WarpRouteIds.EthereumFlowCbBTC]: getEthereumFlowCbBTCWarpConfig, [WarpRouteIds.EthereumSeiFastUSD]: getEthereumSeiFastUSDWarpConfig, [WarpRouteIds.EthereumVictionETH]: getEthereumVictionETHWarpConfig, [WarpRouteIds.EthereumVictionUSDC]: getEthereumVictionUSDCWarpConfig, @@ -77,6 +76,19 @@ export async function getWarpConfig( envConfig, multiProvider, ); + // Strip the owners from the router config + const routerConfigWithoutOwner = objMap(routerConfig, (_chain, config) => { + const { owner, ownerOverrides, ...configWithoutOwner } = config; + return configWithoutOwner; + }); + // Isolate the owners from the router config + const abacusWorksEnvOwnerConfig = objMap(routerConfig, (_chain, config) => { + const { owner, ownerOverrides } = config; + return { + owner, + ownerOverrides, + }; + }); const warpConfigGetter = warpConfigGetterMap[warpRouteId]; if (!warpConfigGetter) { @@ -87,9 +99,5 @@ export async function getWarpConfig( ); } - if (warpConfigGetter.length === 1) { - return warpConfigGetter(routerConfig); - } else { - return (warpConfigGetter as WarpConfigGetterWithoutConfig)(); - } + return warpConfigGetter(routerConfigWithoutOwner, abacusWorksEnvOwnerConfig); } diff --git a/typescript/infra/src/config/environment.ts b/typescript/infra/src/config/environment.ts index 25b17abff..ecbf1030a 100644 --- a/typescript/infra/src/config/environment.ts +++ b/typescript/infra/src/config/environment.ts @@ -104,3 +104,11 @@ export async function getRouterConfigsForAllVms( // Merge, giving evmRouterConfig precedence return objMerge(allRouterConfigs, evmRouterConfig); } + +export function getOwnerConfigForAddress(owner: string): OwnableConfig { + return { + owner, + // To ensure that any other overrides aren't applied + ownerOverrides: {}, + }; +} diff --git a/typescript/infra/src/config/warp.ts b/typescript/infra/src/config/warp.ts index 27f159079..51dfaf4d2 100644 --- a/typescript/infra/src/config/warp.ts +++ b/typescript/infra/src/config/warp.ts @@ -1,13 +1,19 @@ -import { ChainMap } from '@hyperlane-xyz/sdk'; +import { + ChainMap, + OwnableConfig, + RouterConfig, + TokenRouterConfig, +} from '@hyperlane-xyz/sdk'; import { Address } from '@hyperlane-xyz/utils'; // Common collateral tokens to be used by warp route deployments. export const tokens: ChainMap> = { ethereum: { + amphrETH: '0x5fD13359Ba15A84B76f7F87568309040176167cd', + cbBTC: '0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf', + deUSD: '0x15700B564Ca08D9439C58cA5053166E8317aa138', USDC: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', USDT: '0xdac17f958d2ee523a2206206994597c13d831ec7', - deUSD: '0x15700B564Ca08D9439C58cA5053166E8317aa138', - amphrETH: '0x5fD13359Ba15A84B76f7F87568309040176167cd', WBTC: '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599', weETHs: '0x917cee801a67f933f2e6b33fc0cd1ed2d5909d88', }, @@ -15,3 +21,5 @@ export const tokens: ChainMap> = { fastUSD: '0x37a4dD9CED2b19Cfe8FAC251cd727b5787E45269', }, }; + +export type RouterConfigWithoutOwner = Omit; diff --git a/typescript/infra/src/warp/helm.ts b/typescript/infra/src/warp/helm.ts index 2b0123c3b..fb9db10ee 100644 --- a/typescript/infra/src/warp/helm.ts +++ b/typescript/infra/src/warp/helm.ts @@ -22,7 +22,7 @@ export class WarpRouteMonitorHelmManager extends HelmManager { return { image: { repository: 'gcr.io/abacus-labs-dev/hyperlane-monorepo', - tag: '7544b99-20241119-162215', + tag: '4d0de30-20241119-171012', }, warpRouteId: this.warpRouteId, fullnameOverride: this.helmReleaseName, diff --git a/typescript/infra/test/warpIds.test.ts b/typescript/infra/test/warpIds.test.ts index ba171c5ba..11f8a2dd1 100644 --- a/typescript/infra/test/warpIds.test.ts +++ b/typescript/infra/test/warpIds.test.ts @@ -8,8 +8,10 @@ describe('Warp IDs', () => { const registry = getRegistry(); for (const warpId of Object.values(WarpRouteIds)) { // That's a long sentence! - expect(registry.getWarpRoute(warpId), `Warp ID ${warpId} not in registry`) - .to.not.be.null.and.not.be.undefined; + expect( + registry.getWarpRoute(warpId), + `Warp ID ${warpId} not in registry, the .registryrc or your local registry may be out of date`, + ).to.not.be.null.and.not.be.undefined; } }); });