Skip to content

Commit

Permalink
Fix: early exit in onlyVerifier branch
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bogatyy authored Feb 5, 2024
1 parent 583cb67 commit ebfac9e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions l1-contracts/scripts/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand All @@ -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) {
Expand Down

0 comments on commit ebfac9e

Please sign in to comment.