From 2b54930026cf35de315ff3dc342a2b28ee27003a Mon Sep 17 00:00:00 2001 From: Danil Date: Mon, 25 Nov 2024 17:10:21 +0700 Subject: [PATCH] Fix system contracts Signed-off-by: Danil --- system-contracts/scripts/calculate-hashes.ts | 2 +- system-contracts/scripts/preprocess-bootloader.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/system-contracts/scripts/calculate-hashes.ts b/system-contracts/scripts/calculate-hashes.ts index 7ecb66723..654280c37 100644 --- a/system-contracts/scripts/calculate-hashes.ts +++ b/system-contracts/scripts/calculate-hashes.ts @@ -106,7 +106,7 @@ const readBytecode = (details: ContractDetails): string => { try { if (details.bytecodePath.endsWith(".json")) { const jsonFile = fs.readFileSync(absolutePath, "utf8"); - return ethers.utils.hexlify("0x" + JSON.parse(jsonFile).bytecode.object); + return ethers.utils.hexlify(JSON.parse(jsonFile).bytecode.object); } else { return ethers.utils.hexlify(fs.readFileSync(absolutePath).toString(), { allowMissingPrefix: true }); } diff --git a/system-contracts/scripts/preprocess-bootloader.ts b/system-contracts/scripts/preprocess-bootloader.ts index e3dc18aaf..ba4605b70 100644 --- a/system-contracts/scripts/preprocess-bootloader.ts +++ b/system-contracts/scripts/preprocess-bootloader.ts @@ -53,7 +53,7 @@ function getSystemContextCodeHash() { let bytecode; try { const artifact = JSON.parse(fs.readFileSync("zkout/SystemContext.sol/SystemContext.json", { encoding: "utf-8" })); - bytecode = "0x" + artifact.bytecode.object; + bytecode = artifact.bytecode.object; } catch (e) { bytecode = hre.artifacts.readArtifactSync("SystemContext").bytecode; }