forked from vhurryharry/EthPool_Fibonacci
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhardhat.config.ts
91 lines (85 loc) · 2.22 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
import { HardhatUserConfig } from "hardhat/config"
import { HttpNetworkUserConfig } from "hardhat/types"
import "@nomiclabs/hardhat-ethers"
import "@nomiclabs/hardhat-waffle"
import "solidity-coverage"
import "hardhat-typechain"
import "hardhat-deploy"
import "hardhat-gas-reporter"
import "@tenderly/hardhat-tenderly"
import "@nomiclabs/hardhat-etherscan"
// read MNEMONIC from env variable
let mnemonic = process.env.MNEMONIC
let privateKey = process.env.PRIVATE_KEY
let etherscanKey = process.env.ETHERSCAN_KEY
const accounts = mnemonic
? { mnemonic }
: privateKey
? [`0x${privateKey}`]
: undefined
const infuraNetwork = (
network: string,
chainId?: number,
gas?: number
): HttpNetworkUserConfig => {
return {
url: `https://${network}.infura.io/v3/${process.env.PROJECT_ID}`,
chainId,
gas,
accounts,
}
}
const config: HardhatUserConfig = {
networks: {
hardhat: mnemonic ? { accounts: { mnemonic } } : {},
localhost: {
url: "http://localhost:8545",
accounts,
},
mainnet: infuraNetwork("mainnet", 1, 6283185),
ropsten: infuraNetwork("ropsten", 3, 6283185),
rinkeby: infuraNetwork("rinkeby", 4, 6283185),
kovan: infuraNetwork("kovan", 42, 6283185),
goerli: infuraNetwork("goerli", 5, 6283185),
matic_testnet: {
url: "https://rpc-mumbai.matic.today",
chainId: 80001,
accounts,
},
bsc_testnet: {
url: "https://data-seed-prebsc-1-s1.binance.org:8545",
chainId: 97,
accounts,
},
},
etherscan: {
apiKey: etherscanKey,
},
solidity: {
compilers: [
{
version: "0.7.6",
settings: {
optimizer: {
enabled: true,
},
},
},
],
},
paths: {
artifacts: "artifacts",
deploy: "deploy",
deployments: "deployments",
},
typechain: {
outDir: "src/types",
target: "ethers-v5",
},
namedAccounts: {
deployer: {
default: 0,
},
},
}
export default config