-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathhardhat.config.js
More file actions
84 lines (74 loc) · 1.89 KB
/
hardhat.config.js
File metadata and controls
84 lines (74 loc) · 1.89 KB
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
require('dotenv').config()
const { EthersProviderWrapper } = require('@nomiclabs/hardhat-ethers/internal/ethers-provider-wrapper')
if (process.argv.indexOf('--network') === -1) {
// No sensible way to override the polling interval, and hardhat-ethers waits for a full polling interval after manually mining a block with transactions
Object.defineProperty(EthersProviderWrapper.prototype, 'pollingInterval', {
get () {
return 50
}
})
}
require('@nomiclabs/hardhat-waffle')
require('@nomiclabs/hardhat-solhint')
require('hardhat-gas-reporter')
require('hardhat-ethernal')
task('accounts', 'Prints the list of accounts', async () => {
const accounts = await ethers.getSigners()
for (const account of accounts) {
console.log(account.address)
}
})
if (process.env.ETHERAL_WORKSPACE) {
extendEnvironment((hre) => {
hre.ethernalSync = true
hre.ethernalWorkspace = `${process.env.ETHERAL_WORKSPACE}`
})
}
module.exports = {
solidity: {
compilers: [
{
version: '0.8.4',
settings: {
optimizer: {
enabled: true,
runs: 1000
}
}
}
]
},
networks: {
hardhat: {
mining: {
auto: true
}
}
}
}
if (process.argv.indexOf('node') >= 1) {
module.exports.networks.hardhat.mining = {
auto: false,
interval: 2 * 1000
}
}
if (process.env.POLYGON_MUMBAI_PRIVATE_KEY) {
module.exports.networks.polygon_mumbai = {
url: `${process.env.POLYGON_MUMBAI_URL}`,
chainId: 80001,
gas: 'auto',
gasPrice: 'auto',
accounts: [`0x${process.env.POLYGON_MUMBAI_PRIVATE_KEY}`],
timeout: 20000
}
}
if (process.env.GNOSIS_SOKOL_PRIVATE_KEY) {
module.exports.networks.gnosis_sokol = {
url: `${process.env.GNOSIS_SOKOL_URL}`,
chainId: 77,
gas: 'auto',
gasPrice: 'auto',
accounts: [`0x${process.env.GNOSIS_SOKOL_PRIVATE_KEY}`],
timeout: 20000
}
}