-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.ts
72 lines (65 loc) · 1.89 KB
/
hardhat.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import "@matterlabs/hardhat-zksync-deploy";
import "@matterlabs/hardhat-zksync-solc";
import "@matterlabs/hardhat-zksync-upgradable";
import "@matterlabs/hardhat-zksync-verify";
import { HardhatUserConfig } from "hardhat/config";
import { config as dotenvConfig } from "dotenv";
import { resolve } from "path";
const dotenvConfigPath: string = process.env.DOTENV_CONFIG_PATH || "./.env";
dotenvConfig({ path: resolve(__dirname, dotenvConfigPath) });
if (!process.env.DEPLOY_PRIVATE_KEY) {
throw new Error("DEPLOY_PRIVATE_KEY in .env not set");
}
const zkSyncTestnet =
process.env.NODE_ENV == "test"
? {
url: "http://localhost:3050",
ethNetwork: "http://localhost:8545",
zksync: true,
accounts: [
// rich wallets from local-node https://github.com/matter-labs/local-setup/blob/main/rich-wallets.json
"0x77268...",
"0xac1e7...",
],
}
: {
url: process.env.ZKSYNC_TESTNET_URL,
ethNetwork: "goerli",
zksync: true,
accounts: [
// account PKs loaded from .env file
process.env.DEPLOY_PRIVATE_KEY || "",
process.env.USER_PRIVATE_KEY || "",
],
// contract verification endpoint
verifyURL:
"https://zksync2-testnet-explorer.zksync.dev/contract_verification",
};
const config: HardhatUserConfig = {
zksolc: {
version: "latest",
settings: {
isSystem: true,
},
},
defaultNetwork: "zkSyncTestnet",
networks: {
hardhat: {
zksync: true,
},
zkSyncTestnet,
zkSyncLocal: {
// you should run the "matter-labs/local-setup" first
url: "http://localhost:3050",
ethNetwork: "http://localhost:8545",
zksync: true,
},
},
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY //<Your API key for Etherscan>
},
solidity: {
version: "0.8.17",
},
};
export default config;