diff --git a/infrastructure/zk/src/contract.ts b/infrastructure/zk/src/contract.ts index ba9fe08041d..943248cdd5a 100644 --- a/infrastructure/zk/src/contract.ts +++ b/infrastructure/zk/src/contract.ts @@ -216,10 +216,12 @@ export async function erc20BridgeFinish(args: any[] = []): Promise { export async function registerHyperchain({ baseTokenName, - deploymentMode + deploymentMode, + allowEvmEmulator }: { baseTokenName?: string; deploymentMode?: DeploymentMode; + allowEvmEmulator?: boolean; }): Promise { await utils.confirmAction(); @@ -241,7 +243,8 @@ export async function registerHyperchain({ privateKey ? `--private-key ${privateKey}` : '', baseTokenName ? `--base-token-name ${baseTokenName}` : '', deploymentMode == DeploymentMode.Validium ? '--validium-mode' : '', - tokenMultiplierSetterAddress ? `--token-multiplier-setter-address ${tokenMultiplierSetterAddress}` : '' + tokenMultiplierSetterAddress ? `--token-multiplier-setter-address ${tokenMultiplierSetterAddress}` : '', + allowEvmEmulator ? '--allow-evm-emulation' : '' ]; await utils.spawn(`yarn l1-contracts register-hyperchain ${args.join(' ')} | tee registerHyperchain.log`); const deployLog = fs.readFileSync('registerHyperchain.log').toString(); diff --git a/infrastructure/zk/src/init.ts b/infrastructure/zk/src/init.ts index 6dbad67b489..fc0e550dd84 100644 --- a/infrastructure/zk/src/init.ts +++ b/infrastructure/zk/src/init.ts @@ -106,14 +106,19 @@ type InitHyperchainOptions = { baseTokenName?: string; localLegacyBridgeTesting?: boolean; deploymentMode: DeploymentMode; + allowEvmEmulator?: boolean; }; const initHyperchain = async ({ includePaymaster, baseTokenName, localLegacyBridgeTesting, - deploymentMode + deploymentMode, + allowEvmEmulator }: InitHyperchainOptions): Promise => { - await announced('Registering Hyperchain', contract.registerHyperchain({ baseTokenName, deploymentMode })); + await announced( + 'Registering Hyperchain', + contract.registerHyperchain({ baseTokenName, deploymentMode, allowEvmEmulator }) + ); await announced('Reloading env', env.reload()); await announced('Running server genesis setup', server.genesisFromSources()); await announced( @@ -146,6 +151,7 @@ type InitDevCmdActionOptions = InitSetupOptions & { validiumMode?: boolean; localLegacyBridgeTesting?: boolean; shouldCheckPostgres: boolean; // Whether to perform `cargo sqlx prepare --check` + allowEvmEmulator?: boolean; }; export const initDevCmdAction = async ({ skipEnvSetup, @@ -157,7 +163,8 @@ export const initDevCmdAction = async ({ runObservability, validiumMode, localLegacyBridgeTesting, - shouldCheckPostgres + shouldCheckPostgres, + allowEvmEmulator }: InitDevCmdActionOptions): Promise => { if (localLegacyBridgeTesting) { await makeEraChainIdSameAsCurrent(); @@ -181,7 +188,8 @@ export const initDevCmdAction = async ({ includePaymaster: true, baseTokenName, localLegacyBridgeTesting, - deploymentMode + deploymentMode, + allowEvmEmulator }); if (localLegacyBridgeTesting) { await makeEraAddressSameAsCurrent(); @@ -214,13 +222,15 @@ type InitHyperCmdActionOptions = { baseTokenName?: string; runObservability: boolean; deploymentMode: DeploymentMode; + allowEvmEmulator?: boolean; }; export const initHyperCmdAction = async ({ skipSetupCompletely, bumpChainId, baseTokenName, runObservability, - deploymentMode + deploymentMode, + allowEvmEmulator }: InitHyperCmdActionOptions): Promise => { if (bumpChainId) { config.bumpChainId(); @@ -237,7 +247,8 @@ export const initHyperCmdAction = async ({ await initHyperchain({ includePaymaster: true, baseTokenName, - deploymentMode + deploymentMode, + allowEvmEmulator }); }; @@ -254,6 +265,7 @@ export const initCommand = new Command('init') 'used to test LegacyBridge compatibily. The chain will have the same id as the era chain id, while eraChainId in L2SharedBridge will be 0' ) .option('--should-check-postgres', 'Whether to perform cargo sqlx prepare --check during database setup', true) + .option('--allow-evm-emulator', 'allow deployment of EVM contracts') .description('Deploys the shared bridge and registers a hyperchain locally, as quickly as possible.') .action(initDevCmdAction); @@ -278,4 +290,5 @@ initCommand .option('--base-token-name ', 'base token name') .option('--validium-mode', 'deploy contracts in Validium mode') .option('--run-observability', 'run observability suite') + .option('--allow-evm-emulator', 'allow deployment of EVM contracts') .action(initHyperCmdAction);