-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathhardhat.config.ts
118 lines (111 loc) · 2.84 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
import "@nomiclabs/hardhat-ethers"
import "@nomiclabs/hardhat-waffle"
import "@nomiclabs/hardhat-web3"
import "@nomiclabs/hardhat-etherscan"
import "@typechain/hardhat"
import "hardhat-gas-reporter"
import "solidity-coverage"
import "hardhat-deploy"
import "hardhat-spdx-license-identifier"
import { HardhatUserConfig } from "hardhat/config"
import dotenv from "dotenv"
dotenv.config()
let config: HardhatUserConfig = {
defaultNetwork: "hardhat",
networks: {
coverage: {
url: "http://127.0.0.1:8555",
},
mainnet: {
url: process.env.ALCHEMY_API,
gasPrice: 140 * 1000000000,
},
fuji: {
url: "https://api.avax-test.network/ext/bc/C/rpc",
gasPrice: 470 * 1000000000,
},
ava_mainnet: {
url: "https://api.avax.network/ext/bc/C/rpc",
gasPrice: 225 * 1000000000,
},
bsc_mainnet: {
url: "https://bsc-dataseed.binance.org/",
chainId: 56,
gasPrice: 5000000000,
}
},
solidity: {
compilers: [
{
version: "0.6.12",
settings: {
optimizer: {
enabled: true,
runs: 10000,
},
},
},
{
version: "0.5.16",
},
],
},
typechain: {
outDir: "./build/typechain/",
target: "ethers-v5",
},
gasReporter: {
currency: "USD",
gasPrice: 21,
},
mocha: {
timeout: 200000,
},
namedAccounts: {
deployer: {
default: 0, // here this will by default take the first account as deployer
1: 0, // similarly on mainnet it will take the first account as deployer. Note though that depending on how hardhat network are configured, the account 0 on one network can be different than on another
},
libraryDeployer: {
default: 0, // use a different account for deploying libraries on the hardhat network
1: 1, // use the same address as the main deployer on mainnet
},
},
spdxLicenseIdentifier: {
overwrite: false,
runOnCompile: true,
},
}
if (process.env.ETHERSCAN_API) {
config = { ...config, etherscan: { apiKey: process.env.ETHERSCAN_API } }
}
if (process.env.ACCOUNT_PRIVATE_KEYS) {
config.networks = {
...config.networks,
mainnet: {
...config.networks?.mainnet,
accounts: JSON.parse(process.env.ACCOUNT_PRIVATE_KEYS),
},
fuji: {
...config.networks?.fuji,
accounts: JSON.parse(process.env.ACCOUNT_PRIVATE_KEYS),
},
ava_mainnet: {
...config.networks?.ava_mainnet,
accounts: JSON.parse(process.env.ACCOUNT_PRIVATE_KEYS),
},
bsc_mainnet: {
...config.networks?.bsc_mainnet,
accounts: JSON.parse(process.env.ACCOUNT_PRIVATE_KEYS),
},
}
}
if (process.env.FORK_MAINNET && config.networks) {
config.networks.hardhat = {
forking: {
url: process.env.ALCHEMY_API ? process.env.ALCHEMY_API : "",
},
chainId: 1,
}
}
export default config