From ebfac9e385be7b881c6eb8ac297eab0a8bf22741 Mon Sep 17 00:00:00 2001 From: Ivan Bogatyy Date: Sun, 4 Feb 2024 21:08:31 -0500 Subject: [PATCH] Fix: early exit in `onlyVerifier` branch Right now `--only-verifier' still deploys CREATE2 Factory and Multicall3. In other words, every `zk init` run deploys two copies of the same contracts. This commit fixes the issue. --- l1-contracts/scripts/deploy.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/l1-contracts/scripts/deploy.ts b/l1-contracts/scripts/deploy.ts index d6af12d5501..efedfc07c50 100644 --- a/l1-contracts/scripts/deploy.ts +++ b/l1-contracts/scripts/deploy.ts @@ -49,6 +49,11 @@ async function main() { verbose: true, }); + if (cmd.onlyVerifier) { + await deployer.deployVerifier(create2Salt, { gasPrice, nonce }); + return; + } + // Create2 factory already deployed on the public networks, only deploy it on local node if (process.env.CHAIN_ETH_NETWORK === "localhost") { await deployer.deployCreate2Factory({ gasPrice, nonce }); @@ -58,11 +63,6 @@ async function main() { nonce++; } - if (cmd.onlyVerifier) { - await deployer.deployVerifier(create2Salt, { gasPrice, nonce }); - return; - } - // Deploy diamond upgrade init contract if needed const diamondUpgradeContractVersion = cmd.diamondUpgradeInit || 1; if (diamondUpgradeContractVersion) {