|
|
|
@ -21,6 +21,8 @@ import { |
|
|
|
|
promiseObjAll, |
|
|
|
|
} from '@hyperlane-xyz/utils'; |
|
|
|
|
|
|
|
|
|
import { DEFAULT_STRATEGY_CONFIG_PATH } from '../commands/options.js'; |
|
|
|
|
import { MultiProtocolSignerManager } from '../context/strategies/signer/MultiProtocolSignerManager.js'; |
|
|
|
|
import { CommandContext } from '../context/types.js'; |
|
|
|
|
import { errorRed, log, logBlue, logGreen } from '../logger.js'; |
|
|
|
|
import { runMultiChainSelectionStep } from '../utils/chains.js'; |
|
|
|
@ -35,6 +37,7 @@ import { |
|
|
|
|
} from '../utils/input.js'; |
|
|
|
|
|
|
|
|
|
import { createAdvancedIsmConfig } from './ism.js'; |
|
|
|
|
import { readChainSubmissionStrategyConfig } from './strategy.js'; |
|
|
|
|
|
|
|
|
|
const TYPE_DESCRIPTIONS: Record<TokenType, string> = { |
|
|
|
|
[TokenType.synthetic]: 'A new ERC20 with remote transfer functionality', |
|
|
|
@ -122,13 +125,6 @@ export async function createWarpRouteDeployConfig({ |
|
|
|
|
}) { |
|
|
|
|
logBlue('Creating a new warp route deployment config...'); |
|
|
|
|
|
|
|
|
|
const owner = await detectAndConfirmOrPrompt( |
|
|
|
|
async () => context.signer?.getAddress(), |
|
|
|
|
'Enter the desired', |
|
|
|
|
'owner address', |
|
|
|
|
'signer', |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
const warpChains = await runMultiChainSelectionStep({ |
|
|
|
|
chainMetadata: context.chainMetadata, |
|
|
|
|
message: 'Select chains to connect', |
|
|
|
@ -138,11 +134,32 @@ export async function createWarpRouteDeployConfig({ |
|
|
|
|
requiresConfirmation: !context.skipConfirmation, |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
const strategyConfig = await readChainSubmissionStrategyConfig( |
|
|
|
|
context.strategyPath ?? DEFAULT_STRATEGY_CONFIG_PATH, |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
const multiProtocolSigner = new MultiProtocolSignerManager( |
|
|
|
|
strategyConfig, |
|
|
|
|
warpChains, |
|
|
|
|
context.multiProvider, |
|
|
|
|
{ key: context.key }, |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
const multiProviderWithSigners = |
|
|
|
|
await multiProtocolSigner.setupMultiProvider(); |
|
|
|
|
|
|
|
|
|
const result: WarpRouteDeployConfig = {}; |
|
|
|
|
let typeChoices = TYPE_CHOICES; |
|
|
|
|
for (const chain of warpChains) { |
|
|
|
|
logBlue(`${chain}: Configuring warp route...`); |
|
|
|
|
|
|
|
|
|
const owner = await detectAndConfirmOrPrompt( |
|
|
|
|
async () => await multiProviderWithSigners.getSigner(chain).getAddress(), |
|
|
|
|
'Enter the desired', |
|
|
|
|
'owner address', |
|
|
|
|
'signer', |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
// default to the mailbox from the registry and if not found ask to the user to submit one
|
|
|
|
|
const chainAddresses = await context.registry.getChainAddresses(chain); |
|
|
|
|
|
|
|
|
|