-
Notifications
You must be signed in to change notification settings - Fork 1
/
hardhat.config.ts
106 lines (95 loc) · 2.57 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
105
106
import "@nomiclabs/hardhat-waffle";
import "@nomiclabs/hardhat-etherscan";
import "@nomiclabs/hardhat-ethers";
import "@typechain/hardhat";
import "hardhat-gas-reporter";
import "hardhat-abi-exporter";
import "hardhat-contract-sizer";
import { LOCAL_NETWORK, MAINNET_NETWORK } from "@gearbox-protocol/sdk";
import { config as dotEnvConfig } from "dotenv";
import { HardhatUserConfig } from "hardhat/types";
// gets data from .env file
dotEnvConfig();
const GOERLI_PRIVATE_KEY =
process.env.GOERLI_PRIVATE_KEY! ||
"0xc87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3"; // well known private key
const GOERLI_PRIVATE_KEY2 =
process.env.KOVAN2_PRIVATE_KEY! ||
"0xc87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3"; // well known private key
const BOXCODE_PRIVATE_KEY =
process.env.BOXCODE_PRIVATE_KEY! ||
"0xc87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3"; // well known private key
const BVI_PRIVATE_KEY =
process.env.BVI_PRIVATE_KEY! ||
"0xc87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3"; // well known private key
const config: HardhatUserConfig = {
defaultNetwork: "hardhat",
solidity: {
compilers: [
{
version: "0.8.10",
settings: {
optimizer: {
enabled: true,
runs: 1000000,
},
},
},
],
},
networks: {
hardhat: {
chainId: LOCAL_NETWORK,
initialBaseFeePerGas: 0,
allowUnlimitedContractSize: true,
},
localhost: {
timeout: 0,
},
mainnet: {
url: process.env.ETH_MAINNET_PROVIDER || "",
accounts: [BOXCODE_PRIVATE_KEY, BVI_PRIVATE_KEY],
chainId: MAINNET_NETWORK,
timeout: 0,
gasMultiplier: 1.15,
minGasPrice: 1e9,
allowUnlimitedContractSize: false,
},
goerli: {
url: process.env.ETH_GOERLI_PROVIDER || "",
accounts: [GOERLI_PRIVATE_KEY, GOERLI_PRIVATE_KEY2],
gasMultiplier: 1.8,
timeout: 0,
allowUnlimitedContractSize: false,
},
},
gasReporter: {
enabled: false,
currency: "USD",
gasPrice: 21,
},
typechain: {
outDir: "types",
target: "ethers-v5",
},
abiExporter: {
path: "./abi",
clear: true,
flat: true,
spacing: 2,
},
contractSizer: {
alphaSort: false,
disambiguatePaths: false,
runOnCompile: true,
except: ["Test", "Mock"],
},
};
if (process.env.ETHERSCAN_API_KEY) {
config.etherscan = {
// Your API key for Etherscan
// Obtain one at https://etherscan.io/
apiKey: process.env.ETHERSCAN_API_KEY,
};
}
export default config;