Skip to content

Commit

Permalink
feat: add Flow <> Ethereum cbBTC warp route to infra, mild refactor t…
Browse files Browse the repository at this point in the history
…o warp config getters (#4868)

### Description

- Includes the Flow cbBTC warp route getter
(hyperlane-xyz/hyperlane-registry#380)
- Includes the ownership transfer for the weETHs warp route
- Forces config getters to be more explicit about ownership by having
the router config no longer implicitly set owner configs. See
https://discord.com/channels/935678348330434570/1306554055895683113 for
some context. Now you need to explicitly opt into transferring ownership
to our colder setup

### Drive-by changes

- Removes a bunch of ts-ignores that aren't needed in the config getters

### Related issues

<!--
- Fixes #[issue number here]
-->

### Backward compatibility

<!--
Are these changes backward compatible? Are there any infrastructure
implications, e.g. changes that would prohibit deploying older commits
using this infra tooling?

Yes/No
-->

### Testing

<!--
What kind of testing have these changes undergone?

None/Manual/Unit Tests
-->
  • Loading branch information
tkporter authored Nov 20, 2024
1 parent 979bceb commit 58425a2
Show file tree
Hide file tree
Showing 27 changed files with 299 additions and 127 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,11 @@
},
"mode": {
"router": "0xF385603a12Be8b7B885222329c581FDD1C30071D"
},
"lisk": {
"router": "0xF385603a12Be8b7B885222329c581FDD1C30071D"
},
"fraxtal": {
"router": "0xF385603a12Be8b7B885222329c581FDD1C30071D"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,11 @@
},
"mode": {
"router": "0xA7287a56C01ac8Baaf8e7B662bDB41b10889C7A6"
},
"lisk": {
"router": "0xA7287a56C01ac8Baaf8e7B662bDB41b10889C7A6"
},
"fraxtal": {
"router": "0xA7287a56C01ac8Baaf8e7B662bDB41b10889C7A6"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
routerConfig: ChainMap<RouterConfigWithoutOwner>,
abacusWorksEnvOwnerConfig: ChainMap<OwnableConfig>,
): Promise<ChainMap<TokenRouterConfig>> => {
const ismConfig = buildAggregationIsmConfigs(
'ethereum',
Expand All @@ -22,6 +26,7 @@ export const getAncient8EthereumUSDCWarpConfig = async (

const ethereum: TokenRouterConfig = {
...routerConfig.ethereum,
...abacusWorksEnvOwnerConfig.ethereum,
type: TokenType.collateral,
token: tokens.ethereum.USDC,
interchainSecurityModule: ismConfig,
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
routerConfig: ChainMap<RouterConfigWithoutOwner>,
_abacusWorksEnvOwnerConfig: ChainMap<OwnableConfig>,
): Promise<ChainMap<TokenRouterConfig>> => {
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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,43 @@
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>,
routerConfig: ChainMap<RouterConfigWithoutOwner>,
_abacusWorksEnvOwnerConfig: ChainMap<OwnableConfig>,
): Promise<ChainMap<TokenRouterConfig>> => {
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',
decimals: 6,
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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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>,
routerConfig: ChainMap<RouterConfigWithoutOwner>,
abacusWorksEnvOwnerConfig: ChainMap<OwnableConfig>,
): Promise<ChainMap<TokenRouterConfig>> => {
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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,31 @@ 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>,
routerConfig: ChainMap<RouterConfigWithoutOwner>,
abacusWorksEnvOwnerConfig: ChainMap<OwnableConfig>,
): Promise<ChainMap<TokenRouterConfig>> => {
const eclipsemainnet: TokenRouterConfig = {
...routerConfig.eclipsemainnet,
...abacusWorksEnvOwnerConfig.eclipsemainnet,
type: TokenType.synthetic,
foreignDeployment: '5g5ujyYUNvdydwyDVCpZwPpgYRqH5RYJRi156cxyE3me',
gas: 300_000,
interchainSecurityModule: ethers.constants.AddressZero,
};
let ethereum: TokenRouterConfig = {
...routerConfig.ethereum,
...abacusWorksEnvOwnerConfig.ethereum,
type: TokenType.collateral,
token: tokens.ethereum.USDT,
interchainSecurityModule: ethers.constants.AddressZero,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
routerConfig: ChainMap<RouterConfigWithoutOwner>,
abacusWorksEnvOwnerConfig: ChainMap<OwnableConfig>,
): Promise<ChainMap<TokenRouterConfig>> => {
const eclipsemainnet: TokenRouterConfig = {
...routerConfig.eclipsemainnet,
...abacusWorksEnvOwnerConfig.eclipsemainnet,
type: TokenType.synthetic,
foreignDeployment: 'A7EGCDYFw5R7Jfm6cYtKvY8dmkrYMgwRCJFkyQwpHTYu',
gas: 300_000,
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<RouterConfig>,
): Promise<ChainMap<TokenRouterConfig>> => {
export async function getEclipseEthereumWeEthsWarpConfig(
routerConfig: ChainMap<RouterConfigWithoutOwner>,
_abacusWorksEnvOwnerConfig: ChainMap<OwnableConfig>,
): Promise<ChainMap<TokenRouterConfig>> {
const eclipsemainnet: TokenRouterConfig = {
...routerConfig.eclipsemainnet,
...getOwnerConfigForAddress(eclipseOwner),
type: TokenType.synthetic,
foreignDeployment: '7Zx4wU1QAw98MfvnPFqRh1oyumek7G5VAX6TKB3U1tcn',
gas: 300_000,
Expand All @@ -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,
};
};
}
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
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>,
routerConfig: ChainMap<RouterConfigWithoutOwner>,
abacusWorksEnvOwnerConfig: ChainMap<OwnableConfig>,
): Promise<ChainMap<TokenRouterConfig>> => {
const eclipsemainnet: TokenRouterConfig = {
...routerConfig.eclipsemainnet,
...abacusWorksEnvOwnerConfig.eclipsemainnet,
type: TokenType.synthetic,
foreignDeployment: 'BpXHAiktwjx7fN6M9ST9wr6qKAsH27wZFhdHEhReJsR6',
gas: 300_000,
};

const stride: TokenRouterConfig = {
...routerConfig.stride,
...getOwnerConfigForAddress(strideOwner),
type: TokenType.collateral,
foreignDeployment:
'stride1pvtesu3ve7qn7ctll2x495mrqf2ysp6fws68grvcu6f7n2ajghgsh2jdj6',
Expand Down
Loading

0 comments on commit 58425a2

Please sign in to comment.