-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathhardhat.config.ts
138 lines (136 loc) · 3.08 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
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 fs from 'fs';
if (fs.existsSync('./sdk/src/typechain')) {
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: {
version: '0.8.12',
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(),
},
3: {
url: `https://ropsten.infura.io/v3/${process.env.ROPSTEN_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(),
},
137: {
url: `https://polygon-rpc.com/`,
accounts,
timeout: 60000,
gasPrice: BigNumber.from(gasPrice)
.mul(10 ** 9)
.toNumber(),
},
8001: {
url: `https://matic-mumbai.chainstacklabs.com/`,
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;