feat: add Flow <> Ethereum cbBTC warp route to infra, mild refactor to warp config getters (#4868)
### Description - Includes the Flow cbBTC warp route getter (https://github.com/hyperlane-xyz/hyperlane-registry/pull/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 -->pull/4883/head
parent
979bceb660
commit
58425a2de3
@ -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>, |
||||
routerConfig: ChainMap<RouterConfigWithoutOwner>, |
||||
_abacusWorksEnvOwnerConfig: ChainMap<OwnableConfig>, |
||||
): Promise<ChainMap<TokenRouterConfig>> => { |
||||
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<TokenRouterConfig>; |
||||
}; |
||||
|
@ -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<RouterConfigWithoutOwner>, |
||||
_abacusWorksEnvOwnerConfig: ChainMap<OwnableConfig>, |
||||
): Promise<ChainMap<TokenRouterConfig>> => { |
||||
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, |
||||
}; |
||||
}; |
Loading…
Reference in new issue