-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathhardhat.config.zksync.ts
140 lines (132 loc) · 3.83 KB
/
hardhat.config.zksync.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
import "module-alias/register";
import "@matterlabs/hardhat-zksync";
import "@matterlabs/hardhat-zksync-solc";
import "@matterlabs/hardhat-zksync-verify";
import "@nomicfoundation/hardhat-chai-matchers";
import "hardhat-dependency-compiler";
import "hardhat-deploy";
import { HardhatUserConfig, task } from "hardhat/config";
require("dotenv").config();
const DEPLOYER_PRIVATE_KEY = process.env.DEPLOYER_PRIVATE_KEY;
task("accounts", "Prints the list of accounts", async (taskArgs, hre) => {
const accounts = await hre.ethers.getSigners();
for (const account of accounts) {
console.log(account.address);
}
});
const config: HardhatUserConfig = {
defaultNetwork: "hardhat",
zksolc: {
version: "1.5.3",
compilerSource: "binary",
settings: {
metadata: {
// do not include the metadata hash, since this is machine dependent
// and we want all generated code to be deterministic
// https://docs.soliditylang.org/en/v0.7.6/metadata.html
bytecodeHash: "none",
},
},
},
solidity: {
compilers: [
{
version: "0.5.16",
settings: {
optimizer: {
enabled: true,
runs: 200,
},
outputSelection: {
"*": {
"*": ["storageLayout"],
},
},
},
},
{
version: "0.8.25",
settings: {
optimizer: {
enabled: true,
runs: 10000,
},
evmVersion: "paris",
outputSelection: {
"*": {
"*": ["storageLayout"],
},
},
},
},
],
},
networks: {
hardhat: isFork(),
zksyncsepolia: {
url: process.env.ARCHIVE_NODE_zksyncsepolia || "https://sepolia.era.zksync.dev",
ethNetwork: "sepolia",
verifyURL: "https://explorer.sepolia.era.zksync.dev/contract_verification",
accounts: DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [],
zksync: true,
live: true,
},
zksyncmainnet: {
url: process.env.ARCHIVE_NODE_zksyncmainnet || "https://mainnet.era.zksync.io",
ethNetwork: "mainnet",
verifyURL: "https://zksync2-mainnet-explorer.zksync.io/contract_verification",
accounts: DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [],
zksync: true,
live: true,
},
},
paths: {
sources: "./contracts",
tests: "./tests",
cache: "./cache-zk",
artifacts: "./artifacts-zk",
},
mocha: {
timeout: 200000000,
},
// Hardhat deploy
namedAccounts: {
deployer: {
default: 0, // here this will by default take the first account as deployer
},
},
dependencyCompiler: {
paths: [
"@venusprotocol/venus-protocol/contracts/XVSVault/XVSStore.sol",
"@venusprotocol/venus-protocol/contracts/XVSVault/XVSVaultErrorReporter.sol",
"@venusprotocol/venus-protocol/contracts/XVSVault/XVSVaultProxy.sol",
"@venusprotocol/venus-protocol/contracts/XVSVault/XVSVaultStorage.sol",
"@venusprotocol/venus-protocol/contracts/Tokens/XVS/XVS.sol",
"hardhat-deploy/solc_0.8/proxy/OptimizedTransparentUpgradeableProxy.sol",
"hardhat-deploy/solc_0.8/openzeppelin/proxy/transparent/ProxyAdmin.sol",
],
},
};
function isFork() {
return process.env.FORK === "true"
? {
allowUnlimitedContractSize: false,
loggingEnabled: false,
forking: {
url: process.env[`ARCHIVE_NODE_${process.env.FORKED_NETWORK}`] || "https://sepolia.era.zksync.dev",
blockNumber: 21068448, // TODO: change this
},
accounts: {
accountsBalance: "1000000000000000000",
},
live: false,
zksync: true,
}
: {
allowUnlimitedContractSize: true,
loggingEnabled: false,
live: false,
zksync: true,
};
}
export default config;