Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

chore: normalise file path #18

Merged
merged 2 commits into from
Nov 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions scripts/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as hre from "hardhat";

import { ethers } from "ethers";
import { existsSync, mkdirSync, writeFileSync } from "fs";
import { join } from "path";
import { renderFile } from "template-file";
import { utils } from "zksync-web3";
import { SYSTEM_CONTRACTS, getRevertSelector, getTransactionUtils } from "./constants";
Expand All @@ -14,6 +15,10 @@ const SYSTEM_PARAMS = require("../SystemConfig.json");

const OUTPUT_DIR = "bootloader/build";

function path(...args: string[]): string {
return join(__dirname, ...args);
}

function getSelector(contractName: string, method: string): string {
const artifact = hre.artifacts.readArtifactSync(contractName);
const contractInterface = new ethers.utils.Interface(artifact.abi);
Expand Down Expand Up @@ -239,11 +244,11 @@ async function main() {
mkdirSync(OUTPUT_DIR);
}

writeFileSync(`${OUTPUT_DIR}/bootloader_test.yul`, provedBootloaderWithTests);
writeFileSync(`${OUTPUT_DIR}/proved_batch.yul`, provedBatchBootloader);
writeFileSync(`${OUTPUT_DIR}/playground_batch.yul`, playgroundBatchBootloader);
writeFileSync(`${OUTPUT_DIR}/gas_test.yul`, gasTestBootloader);
writeFileSync(`${OUTPUT_DIR}/fee_estimate.yul`, feeEstimationBootloader);
writeFileSync(path(`../${OUTPUT_DIR}/bootloader_test.yul`), provedBootloaderWithTests);
writeFileSync(path(`../${OUTPUT_DIR}/proved_batch.yul`), provedBatchBootloader);
writeFileSync(path(`../${OUTPUT_DIR}/playground_batch.yul`), playgroundBatchBootloader);
writeFileSync(path(`../${OUTPUT_DIR}/gas_test.yul`), gasTestBootloader);
writeFileSync(path(`../${OUTPUT_DIR}/fee_estimate.yul`), feeEstimationBootloader);

console.log("Preprocessing done!");
}
Expand Down
Loading