-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhardhat.config.mainnet-fork.js
77 lines (74 loc) · 2.12 KB
/
hardhat.config.mainnet-fork.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
require("@nomiclabs/hardhat-truffle5");
require("@nomiclabs/hardhat-ethers");
require("solidity-coverage");
require("hardhat-gas-reporter");
const accounts = require("./hardhatAccountsList2k.js");
const accountsList = accounts.accountsList
const fs = require('fs')
const alchemyUrl = () => {
const SECRETS_FILE = "./secrets.js"
let alchemyAPIKey = ""
if (fs.existsSync(SECRETS_FILE)) {
const { secrets } = require(SECRETS_FILE);
alchemyAPIKey = secrets.alchemyAPIKey
}
return `https://eth-mainnet.alchemyapi.io/v2/${alchemyAPIKey}`
}
module.exports = {
paths: {
// contracts: "./contracts",
// artifacts: "./artifacts"
},
solidity: {
compilers: [
{
version: "0.4.23",
settings: {
optimizer: {
enabled: true,
runs: 100
}
}
},
{
version: "0.5.17",
settings: {
optimizer: {
enabled: true,
runs: 100
}
}
},
{
version: "0.6.11",
settings: {
optimizer: {
enabled: true,
runs: 100
}
}
},
]
},
networks: {
hardhat: {
// https://github.com/NomicFoundation/hardhat/issues/1226#issuecomment-774492503
//accounts: accountsList,
gas: 10000000, // tx gas limit
blockGasLimit: 12500000,
gasPrice: process.env.GAS_PRICE ? parseInt(process.env.GAS_PRICE) : 20000000000,
forking: {
url: alchemyUrl(),
blockNumber: process.env.BLOCK_NUMBER ? parseInt(process.env.BLOCK_NUMBER) : 12152522
}
}
},
mocha: { timeout: 12000000 },
rpc: {
host: "localhost",
port: 8545
},
gasReporter: {
enabled: (process.env.REPORT_GAS) ? true : false
}
};