-
Notifications
You must be signed in to change notification settings - Fork 21
/
hardhat.config.ts
124 lines (122 loc) · 2.66 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
import {HardhatUserConfig} from 'hardhat/config';
import {BigNumber} from 'ethers';
import '@nomiclabs/hardhat-waffle';
import 'hardhat-deploy';
import 'hardhat-contract-sizer';
import '@openzeppelin/hardhat-upgrades';
import '@typechain/hardhat';
import 'hardhat-gas-reporter';
import 'solidity-coverage';
import '@nomiclabs/hardhat-etherscan';
import dotenv from 'dotenv';
import './tasks';
dotenv.config();
const privateKey = process.env.PRIVATE_KEY;
const gasPrice = process.env.GAS_PRICE || 1;
const mnemonic = 'test test test test test test test test test test test junk';
let accounts;
if (privateKey) {
accounts = [privateKey];
} else {
accounts = {
mnemonic,
};
}
const config: HardhatUserConfig = {
solidity: {
compilers: [
{
version: '0.6.6',
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
{
version: "0.5.16",
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
],
},
networks: {
hardhat: {
accounts: {
mnemonic,
accountsBalance: '100000000000000000000000000',
},
blockGasLimit: 60000000,
initialBaseFeePerGas: 0,
},
localhost: {
url: 'http://localhost:8545',
accounts,
timeout: 60000,
blockGasLimit: 60000000,
gasPrice: BigNumber.from(gasPrice)
.mul(10 ** 9)
.toNumber(),
},
1: {
url: `https://mainnet.infura.io/v3/${process.env.MAINNET_INFURA}`,
accounts,
timeout: 60000,
gasPrice: BigNumber.from(gasPrice)
.mul(10 ** 9)
.toNumber(),
},
4: {
url: `https://rinkeby.infura.io/v3/${process.env.RINKEBY_INFURA}`,
accounts,
timeout: 60000,
gasPrice: BigNumber.from(gasPrice)
.mul(10 ** 9)
.toNumber(),
},
56: {
url: `https://bsc-dataseed1.binance.org/`,
accounts,
timeout: 60000,
gasPrice: BigNumber.from(gasPrice)
.mul(10 ** 9)
.toNumber(),
},
97: {
url: `https://data-seed-prebsc-1-s1.binance.org:8545`,
accounts,
timeout: 60000,
gasPrice: BigNumber.from(gasPrice)
.mul(10 ** 9)
.toNumber(),
},
},
namedAccounts: {
deployer: 0,
accountA: 1,
accountB: 2,
accountC: 3,
},
contractSizer: {
alphaSort: true,
runOnCompile: true,
disambiguatePaths: false,
},
gasReporter: {
currency: 'CHF',
gasPrice: 1,
},
typechain: {
outDir: './sdk/src/typechain',
target: 'ethers-v5',
},
etherscan: {
apiKey: process.env.APIKEY,
},
};
export default config;