-
Notifications
You must be signed in to change notification settings - Fork 23
/
hardhat.config.ts
80 lines (71 loc) · 2.11 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
import 'hardhat-contract-sizer';
import 'hardhat-deploy';
import 'hardhat-gas-reporter';
import '@nomiclabs/hardhat-ethers';
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 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 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}`]
}
},
namedAccounts: {
deployer: {
default: 0
}
},
solidity: {
version: '0.7.6',
settings: {
optimizer: {
enabled: true, // TODO: Maybe investigate contract size issue with optimizer off
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'
}
};
export default config;