From c8f76b8cdc53f1bfa75c952a5abf8723dca9144c Mon Sep 17 00:00:00 2001 From: Vasiliy Olekhov Date: Thu, 5 Oct 2023 13:42:50 +0300 Subject: [PATCH] added exists check for gate_libs_list.json #77 --- deploy/modular-verifier.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/deploy/modular-verifier.js b/deploy/modular-verifier.js index 1195bf4..81ae548 100644 --- a/deploy/modular-verifier.js +++ b/deploy/modular-verifier.js @@ -56,13 +56,15 @@ module.exports = async function() { }); let deployedLib = {} - let libs = losslessJSON.parse(fs.readFileSync("./contracts/zkllvm/"+circuits[k]+"/gate_libs_list.json", 'utf8')); - for (let lib of libs){ - await deploy(lib, { - from: deployer, - log: true, - }); - deployedLib[lib] = (await hre.deployments.get(lib)).address + if( fs.existsSync("./contracts/zkllvm/"+circuits[k]+"/gate_libs_list.json")) { + let libs = losslessJSON.parse(fs.readFileSync("./contracts/zkllvm/"+circuits[k]+"/gate_libs_list.json", 'utf8')); + for (let lib of libs){ + await deploy(lib, { + from: deployer, + log: true, + }); + deployedLib[lib] = (await hre.deployments.get(lib)).address + } } gate_argument_contract = await deploy("modular_gate_argument_" + circuits[k], { from: deployer,