forked from 0glabs/0g-storage-contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.ts
104 lines (99 loc) · 2.75 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
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
import "@nomicfoundation/hardhat-toolbox";
import "@openzeppelin/hardhat-upgrades";
import "hardhat-abi-exporter";
import "hardhat-deploy";
import "hardhat-deploy-ethers";
import "hardhat-gas-reporter";
import "hardhat-interface-generator";
import { HardhatUserConfig, HttpNetworkUserConfig } from "hardhat/types";
import "solidity-coverage";
// environment configs
import dotenv from "dotenv";
dotenv.config();
const { NODE_URL, DEPLOYER_KEY, ETHERSCAN_API_KEY } = process.env;
// 0x12cAef034a8D1548a81fd7d677640d1070a1Ec17
const DEFAULT_DEPLOYER = "36b9e861b63d3509c88b7817275a30d22d62c8cd8fa6486ddee35ef0d8e0495f";
const userConfig: HttpNetworkUserConfig = {
accounts: [DEPLOYER_KEY ? DEPLOYER_KEY : DEFAULT_DEPLOYER],
};
import "./src/tasks/codesize";
const config: HardhatUserConfig = {
paths: {
artifacts: "artifacts",
cache: "build/cache",
sources: "contracts",
deploy: "src/deploy",
},
solidity: {
compilers: [
{
version: "0.8.16",
settings: {
outputSelection: {
"*": {
"*": [
"evm.bytecode.object",
"evm.deployedBytecode.object",
"abi",
"evm.bytecode.sourceMap",
"evm.deployedBytecode.sourceMap",
"metadata",
],
"": ["ast"],
},
},
evmVersion: "istanbul",
// viaIR: true,
optimizer: {
enabled: true,
runs: 200,
},
},
},
],
},
networks: {
hardhat: {
allowUnlimitedContractSize: true,
allowBlocksWithSameTimestamp: true,
},
zg: {
...userConfig,
url: "http://0.0.0.0:8545",
},
zgTestnet: {
...userConfig,
url: "http://0.0.0.0:8545",
},
},
namedAccounts: {
deployer: 0,
},
mocha: {
timeout: 2000000,
},
verify: {
etherscan: {
apiKey: ETHERSCAN_API_KEY,
},
},
gasReporter: {
currency: "Gwei",
gasPrice: 10,
enabled: process.env.REPORT_GAS ? true : false,
},
abiExporter: {
path: "./abis",
runOnCompile: true,
clear: true,
flat: true,
format: "json",
},
};
if (NODE_URL && config.networks) {
config.networks.custom = {
...userConfig,
url: NODE_URL,
};
}
export default config;