generated from primitivefinance/hardhat-foundry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.ts
71 lines (62 loc) · 1.59 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
import '@nomiclabs/hardhat-ethers'
import '@nomiclabs/hardhat-web3'
import '@nomiclabs/hardhat-waffle'
import 'hardhat-typechain'
// deployment plugins
import 'hardhat-deploy'
import 'hardhat-deploy-ethers'
import '@openzeppelin/hardhat-upgrades'
// Tools
import 'hardhat-gas-reporter'
import 'solidity-coverage'
import '@nomiclabs/hardhat-etherscan'
import { HardhatUserConfig } from 'hardhat/types'
import dotenv from 'dotenv'
import path from 'path'
import fs from 'fs'
dotenv.config()
const PRIVATE_KEY = process.env.PRIVATE_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(path.join(__dirname, 'typechain'))) {
loadTasks()
}
const config: HardhatUserConfig = {
defaultNetwork: 'hardhat',
networks: {
gorli: {
url: 'https://goerli.infura.io/v3/79c508601e4b4b8296b921f1064220e8',
accounts: PRIVATE_KEY ? [`0x${PRIVATE_KEY}`] : undefined,
},
mumbai: {
url: 'https://polygon-mumbai.g.alchemy.com/v2/y5D9C_eB0aRhS4Sqa57ZdvD0EQ1HzLkO',
accounts: PRIVATE_KEY ? [`0x${PRIVATE_KEY}`] : undefined,
},
},
namedAccounts: {
deployer: 0,
},
etherscan: {
apiKey: {
mumbai: process.env.MUMBAISCAN as string,
arbitrumOne: process.env.ETHERSCAN as string,
},
},
solidity: {
compilers: [
{
version: '0.8.15',
settings: {
optimizer: {
runs: 200,
},
},
},
],
},
}
export default config