-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathhardhat.config.ts
158 lines (137 loc) · 5.04 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
import 'hardhat-contract-sizer';
import 'hardhat-deploy';
import 'hardhat-gas-reporter';
import '@nomiclabs/hardhat-ethers';
import '@nomiclabs/hardhat-etherscan';
import '@nomiclabs/hardhat-waffle';
import '@typechain/hardhat';
import * as dotenv from 'dotenv';
import { HardhatUserConfig } from 'hardhat/types';
dotenv.config();
const DEFAULT_ENDPOINT = 'http://localhost:8545';
const DEFAULT_PRIVATE_KEY = 'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff';
const DEFAULT_ETHERSCAN_API_KEY = '';
const kovanEndpoint = process.env.KOVAN_ENDPOINT || DEFAULT_ENDPOINT;
const kovanPrivateKey = process.env.KOVAN_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const ropstenEndpoint = process.env.ROPSTEN_ENDPOINT || DEFAULT_ENDPOINT;
const ropstenPrivateKey = process.env.ROPSTEN_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const goerliEndpoint = process.env.GOERLI_ENDPOINT || DEFAULT_ENDPOINT;
const goerliPrivateKey = process.env.GOERLI_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const mainnetEndpoint = process.env.MAINNET_ENDPOINT || DEFAULT_ENDPOINT;
const mainnetPrivateKey = process.env.MAINNET_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const bscMainnetEndpoint = process.env.BSC_MAINNET_ENDPOINT || DEFAULT_ENDPOINT;
const bscMainnetPrivateKey = process.env.BSC_MAINNET_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const arbitrumMainnetEndpoint = process.env.ARBITRUM_MAINNET_ENDPOINT || DEFAULT_ENDPOINT;
const arbitrumMainnetPrivateKey = process.env.ARBITRUM_MAINNET_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const polygonMainnetEndpoint = process.env.POLYGON_MAINNET_ENDPOINT || DEFAULT_ENDPOINT;
const polygonMainnetPrivateKey = process.env.POLYGON_MAINNET_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const xDaiEndpoint = process.env.XDAI_ENDPOINT || DEFAULT_ENDPOINT;
const xDaiPrivateKey = process.env.XDAI_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const okexMainnetEndpoint = process.env.OKEX_MAINNET_ENDPOINT || DEFAULT_ENDPOINT;
const okexMainnetPrivateKey = process.env.OKEX_MAINNET_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const fantomMainnetEndpoint = process.env.FANTOM_MAINNET_ENDPOINT || DEFAULT_ENDPOINT;
const fantomMainnetPrivateKey = process.env.FANTOM_MAINNET_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const avalancheMainnetEndpoint = process.env.AVALANCHE_MAINNET_ENDPOINT || DEFAULT_ENDPOINT;
const avalancheMainnetPrivateKey = process.env.AVALANCHE_MAINNET_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const harmonyMainnetEndpoint = process.env.HARMONY_MAINNET_ENDPOINT || DEFAULT_ENDPOINT;
const harmonyMainnetPrivateKey = process.env.HARMONY_MAINNET_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const hecoMainnetEndpoint = process.env.HECO_MAINNET_ENDPOINT || DEFAULT_ENDPOINT;
const hecoMainnetPrivateKey = process.env.HECO_MAINNET_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const celoMainnetEndpoint = process.env.CELO_MAINNET_ENDPOINT || DEFAULT_ENDPOINT;
const celoMainnetPrivateKey = process.env.CELO_MAINNET_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const etherscanApiKey = process.env.ETHERSCAN_API_KEY || DEFAULT_ETHERSCAN_API_KEY;
const config: HardhatUserConfig = {
defaultNetwork: 'hardhat',
networks: {
hardhat: {},
localhost: { timeout: 300000 },
kovan: {
url: kovanEndpoint,
accounts: [`0x${kovanPrivateKey}`]
},
ropsten: {
url: ropstenEndpoint,
accounts: [`0x${ropstenPrivateKey}`]
},
goerli: {
url: goerliEndpoint,
accounts: [`0x${goerliPrivateKey}`]
},
mainnet: {
url: mainnetEndpoint,
accounts: [`0x${mainnetPrivateKey}`]
},
bscMainnet: {
url: bscMainnetEndpoint,
accounts: [`0x${bscMainnetPrivateKey}`]
},
arbitrumMainnet: {
url: arbitrumMainnetEndpoint,
accounts: [`0x${arbitrumMainnetPrivateKey}`]
},
polygonMainnet: {
url: polygonMainnetEndpoint,
accounts: [`0x${polygonMainnetPrivateKey}`]
},
xDai: {
url: xDaiEndpoint,
accounts: [`0x${xDaiPrivateKey}`]
},
okexMainnet: {
url: okexMainnetEndpoint,
accounts: [`0x${okexMainnetPrivateKey}`]
},
fantomMainnet: {
url: fantomMainnetEndpoint,
accounts: [`0x${fantomMainnetPrivateKey}`]
},
avalancheMainnet: {
url: avalancheMainnetEndpoint,
accounts: [`0x${avalancheMainnetPrivateKey}`]
},
harmonyMainnet: {
url: harmonyMainnetEndpoint,
accounts: [`0x${harmonyMainnetPrivateKey}`]
},
heco: {
url: hecoMainnetEndpoint,
accounts: [`0x${hecoMainnetPrivateKey}`]
},
celo: {
url: celoMainnetEndpoint,
accounts: [`0x${celoMainnetPrivateKey}`]
}
},
namedAccounts: {
deployer: {
default: 0
}
},
solidity: {
version: '0.8.4',
settings: {
optimizer: {
enabled: true,
runs: 800
}
}
},
contractSizer: {
alphaSort: true,
runOnCompile: false,
disambiguatePaths: false
},
gasReporter: {
enabled: process.env.REPORT_GAS === 'true' ? true : false,
noColors: true,
outputFile: 'reports/gas_usage/summary.txt'
},
typechain: {
outDir: 'typechain',
target: 'ethers-v5'
},
etherscan: {
apiKey: etherscanApiKey
}
};
export default config;