-
Notifications
You must be signed in to change notification settings - Fork 45
/
hardhat.config.ts
112 lines (104 loc) · 2.96 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
import * as dotenv from "dotenv"
dotenv.config()
import "@nomiclabs/hardhat-ethers"
import "@nomiclabs/hardhat-web3"
import "@typechain/hardhat"
import "@nomiclabs/hardhat-waffle"
import "hardhat-gas-reporter"
import "@nomicfoundation/hardhat-verify"
import "hardhat-abi-exporter"
// deployment plugins
import "hardhat-deploy"
import "@nomiclabs/hardhat-ethers"
import "solidity-coverage"
import path from "path"
import fs from "fs"
import {HardhatUserConfig} from "hardhat/types/config"
const PRIVATE_KEY = process.env.PRIVATE_KEY
const INFURA_KEY = process.env.INFURA_KEY
function loadTasks() {
const tasksPath = path.join(__dirname, "tasks")
fs.readdirSync(tasksPath).forEach(task => {
require(`${tasksPath}/${task}`)
})
}
if (
fs.existsSync(path.join(__dirname, "artifacts")) &&
fs.existsSync("./typechain")
) {
loadTasks()
}
const config: HardhatUserConfig = {
solidity: {
compilers: [
{
version: "0.8.9",
settings: {
optimizer: {
enabled: true,
runs: 200
}
}
}
]
},
namedAccounts: {
deployer: 0
},
defaultNetwork: "hardhat",
networks: {
hardhat: {
gas: 12000000,
allowUnlimitedContractSize: true,
blockGasLimit: 12000000,
accounts: {
count: 250
}
},
mainnet: {
url: `https://mainnet.infura.io/v3/${INFURA_KEY}`,
accounts: PRIVATE_KEY ? [`0x${PRIVATE_KEY}`] : undefined
},
rinkeby: {
url: `https://rinkeby.infura.io/v3/${INFURA_KEY}`,
accounts: PRIVATE_KEY ? [`0x${PRIVATE_KEY}`] : undefined,
blockGasLimit: 12000000
},
rinkebyDevnet: {
url: `https://rinkeby.infura.io/v3/${INFURA_KEY}`,
accounts: PRIVATE_KEY ? [`0x${PRIVATE_KEY}`] : undefined
},
arbitrumMainnet: {
url: `https://arbitrum-mainnet.infura.io/v3/${INFURA_KEY}`,
accounts: PRIVATE_KEY ? [`0x${PRIVATE_KEY}`] : undefined
},
arbitrumRinkeby: {
url: `https://arbitrum-rinkeby.infura.io/v3/${INFURA_KEY}`,
accounts: PRIVATE_KEY ? [`0x${PRIVATE_KEY}`] : undefined
},
arbitrumRinkebyDevnet: {
url: `https://arbitrum-rinkeby.infura.io/v3/${INFURA_KEY}`,
accounts: PRIVATE_KEY ? [`0x${PRIVATE_KEY}`] : undefined
},
localhost: {
url: "http://127.0.0.1:8545"
},
gethDev: {
url: "http://127.0.0.1:8545",
chainId: 54321
}
},
gasReporter: {
enabled: process.env.REPORT_GAS ? true : false
},
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY,
customChains: []
},
abiExporter: {
path: "./abi",
clear: true,
flat: true
}
}
export default config