Skip to content

Commit

Permalink
fix(scripts): moved hardhat to be the first import (#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
benceharomi authored Feb 23, 2024
1 parent 340884d commit 25e84e0
Show file tree
Hide file tree
Showing 16 changed files with 36 additions and 8 deletions.
2 changes: 2 additions & 0 deletions l1-contracts/scripts/deploy-erc20.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// hardhat import should be the first import in the file
import * as hardhat from "hardhat";

import "@nomiclabs/hardhat-ethers";
import { Command } from "commander";
import { Wallet } from "ethers";
Expand Down
2 changes: 2 additions & 0 deletions l1-contracts/scripts/deploy-testkit.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// hardhat import should be the first import in the file
import * as hardhat from "hardhat";

import "@nomiclabs/hardhat-ethers";
import { Command } from "commander";
import { ethers, Wallet } from "ethers";
Expand Down
4 changes: 3 additions & 1 deletion l1-contracts/scripts/deploy-testnet-token.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// hardhat import should be the first import in the file
import * as hardhat from "hardhat";

import "@nomiclabs/hardhat-ethers";
import { ArgumentParser } from "argparse";
import { Wallet } from "ethers";
import * as fs from "fs";
import * as hardhat from "hardhat";
import * as path from "path";
import { web3Provider } from "./utils";

Expand Down
2 changes: 2 additions & 0 deletions l1-contracts/scripts/deploy-withdrawal-helpers.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// This script deploys the contracts required both for production and
// for testing of the contracts required for the `withdrawal-helpers` library

// hardhat import should be the first import in the file
import * as hardhat from "hardhat";

import "@nomiclabs/hardhat-ethers";
import { ethers } from "ethers";
import * as fs from "fs";
Expand Down
4 changes: 3 additions & 1 deletion l1-contracts/scripts/migrate-governance.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
/// Temporary script that generated the needed calldata for the migration of the governance.

// hardhat import should be the first import in the file
import * as hre from "hardhat";

import { Command } from "commander";
import { BigNumber, ethers, Wallet } from "ethers";
import { formatUnits, parseUnits } from "ethers/lib/utils";
import * as fs from "fs";
import * as hre from "hardhat";
import { Deployer } from "../src.ts/deploy";
import { applyL1ToL2Alias, getAddressFromEnv, getNumberFromEnv, web3Provider } from "./utils";

Expand Down
4 changes: 3 additions & 1 deletion l1-contracts/scripts/read-variable.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// hardhat import should be the first import in the file
import * as hre from "hardhat";

import { Command } from "commander";
import { BigNumber, ethers } from "ethers";
import * as hre from "hardhat";
import { web3Provider } from "./utils";

const provider = web3Provider();
Expand Down
4 changes: 3 additions & 1 deletion l1-contracts/scripts/revert-reason.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// hardhat import should be the first import in the file
import * as hardhat from "hardhat";

import * as chalk from "chalk";
import { ethers } from "ethers";
import { Interface } from "ethers/lib/utils";
import * as hardhat from "hardhat";
import { web3Url } from "./utils";

const erc20BridgeInterface = new Interface(hardhat.artifacts.readArtifactSync("L1ERC20Bridge").abi);
Expand Down
2 changes: 2 additions & 0 deletions l1-contracts/scripts/verify.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// hardhat import should be the first import in the file
import * as hardhat from "hardhat";

import { deployedAddressesFromEnv } from "../scripts/utils";

// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down
4 changes: 3 additions & 1 deletion l2-contracts/src/deployForceDeployUpgrader.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
// hardhat import should be the first import in the file
import * as hre from "hardhat";

import { Command } from "commander";
import { ethers, Wallet } from "ethers";
import { computeL2Create2Address, create2DeployFromL1, getNumberFromEnv } from "./utils";
import { web3Provider } from "../../l1-contracts/scripts/utils";
import * as fs from "fs";
import * as path from "path";
import * as hre from "hardhat";

const provider = web3Provider();
const testConfigPath = path.join(process.env.ZKSYNC_HOME as string, "etc/test_config/constant");
Expand Down
4 changes: 3 additions & 1 deletion l2-contracts/src/deployTestnetPaymaster.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
// hardhat import should be the first import in the file
import * as hre from "hardhat";

import { Command } from "commander";
import { ethers, Wallet } from "ethers";
import { computeL2Create2Address, create2DeployFromL1, getNumberFromEnv } from "./utils";
import { web3Provider } from "../../l1-contracts/scripts/utils";
import * as fs from "fs";
import * as path from "path";
import * as hre from "hardhat";

const provider = web3Provider();
const testConfigPath = path.join(process.env.ZKSYNC_HOME as string, "etc/test_config/constant");
Expand Down
4 changes: 3 additions & 1 deletion l2-contracts/src/publish-bridge-preimages.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
// hardhat import should be the first import in the file
import * as hre from "hardhat";

import { Command } from "commander";
import { Wallet, ethers } from "ethers";
import * as fs from "fs";
import { Deployer } from "../../l1-contracts/src.ts/deploy";
import * as path from "path";
import { getNumberFromEnv, web3Provider } from "../../l1-contracts/scripts/utils";
import * as hre from "hardhat";
import { REQUIRED_L2_GAS_PRICE_PER_PUBDATA } from "./utils";

const PRIORITY_TX_MAX_GAS_LIMIT = getNumberFromEnv("CONTRACTS_PRIORITY_TX_MAX_GAS_LIMIT");
Expand Down
4 changes: 3 additions & 1 deletion l2-contracts/src/upgradeBridgeImpl.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// hardhat import should be the first import in the file
import * as hre from "hardhat";

import "@nomiclabs/hardhat-ethers";
import { Command } from "commander";
import { Wallet, ethers, BigNumber } from "ethers";
import * as fs from "fs";
import * as hre from "hardhat";
import * as path from "path";
import { Provider } from "zksync-web3";
import { REQUIRED_L1_TO_L2_GAS_PER_PUBDATA_LIMIT } from "zksync-web3/build/src/utils";
Expand Down
1 change: 1 addition & 0 deletions l2-contracts/src/verify.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// hardhat import should be the first import in the file
import * as hardhat from "hardhat";

// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down
1 change: 1 addition & 0 deletions system-contracts/scripts/deploy-preimages.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// hardhat import should be the first import in the file
import * as hre from "hardhat";

import { Deployer } from "@matterlabs/hardhat-zksync-deploy";
Expand Down
1 change: 1 addition & 0 deletions system-contracts/scripts/preprocess-bootloader.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// hardhat import should be the first import in the file
import * as hre from "hardhat";

import { ethers } from "ethers";
Expand Down
1 change: 1 addition & 0 deletions system-contracts/scripts/utils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// hardhat import should be the first import in the file
import * as hre from "hardhat";

import type { Deployer } from "@matterlabs/hardhat-zksync-deploy";
Expand Down

0 comments on commit 25e84e0

Please sign in to comment.