-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.js
83 lines (80 loc) · 1.62 KB
/
hardhat.config.js
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
require('@nomiclabs/hardhat-waffle')
require('hardhat-abi-exporter')
require("@nomiclabs/hardhat-etherscan")
const fs = require('fs')
require('dotenv').config(
{ path: `${__dirname}/.env` }
)
task(
'accounts',
'Prints the list of accounts',
async (_args, hre) => {
const accounts = await hre.ethers.getSigners()
const { provider } = hre.waffle
await Promise.all(
accounts.map(async ({ address: addr }) => {
const balance = (
hre.ethers.utils.formatUnits(
await provider.getBalance(addr),
"ether",
)
)
console.info(`${addr}: ${balance}`)
})
)
},
)
const mnemonic = (
fs.readFileSync('private.mnemonic')
.toString()
.trim()
)
/**
* @type import('hardhat/config').HardhatUserConfig
*/
module.exports = {
// defaultNetwork: 'matic-mumbai',
defaultNetwork: 'rinkeby',
networks: {
hardhat: {
},
matic: {
url: 'https://rpc-mainnet.matic.network',
accounts: { mnemonic },
},
'matic-mumbai': {
url: 'https://rpc-mumbai.maticvigil.com',
accounts: { mnemonic },
},
rinkeby: {
url: process.env.RINKEBY_RPC_URL,
accounts: { mnemonic },
},
},
solidity: {
version: '0.8.4',
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
paths: {
sources: './contracts',
tests: './test',
cache: './cache',
artifacts: './artifacts',
},
mocha: {
timeout: 20000,
},
abiExporter: {
path: './src/contract/abi',
spacing: 2,
flat: true,
},
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY,
},
}