-
Notifications
You must be signed in to change notification settings - Fork 77
/
hardhat.config.js
69 lines (66 loc) · 1.67 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
require("dotenv-safe").config({
example: process.env.CI ? ".env.ci.example" : ".env.example",
});
require("@nomiclabs/hardhat-truffle5");
const mochaConfig = {
timeout: 180000,
grep: "@latest-block",
};
let blockToFork = undefined;
if (process.env.KNOWN_BLOCK === "true") {
blockToFork = 12138570;
mochaConfig.grep = "@known-block";
} else if (process.env.KNOWN_BLOCK !== undefined) {
blockToFork = Number(process.env.KNOWN_BLOCK);
mochaConfig.grep = "@awesome-block";
}
/**
* @type import('hardhat/config').HardhatUserConfig
*/
module.exports = {
defaultNetwork: "hardhat",
networks: {
hardhat: {
forking: {
url: `https://eth-mainnet.alchemyapi.io/v2/${process.env.PROVIDER_ALCHEMY_KEY}`,
blockNumber: blockToFork,
},
accounts: [
{
privateKey: process.env.ACCOUNT_SECRET_VANITY,
balance: "0xFFFFFFFFFFFFFFFF",
},
{
privateKey: process.env.ACCOUNT_SECRET_OWNER,
balance: "0xFFFFFFFFFFFFFFFF",
},
],
},
mainnet: {
url: `https://eth-mainnet.alchemyapi.io/v2/${process.env.PROVIDER_ALCHEMY_KEY}`, //`https://mainnet.infura.io/v3/${process.env.PROVIDER_INFURA_ID}`,
accounts: [
process.env.ACCOUNT_SECRET_VANITY,
process.env.ACCOUNT_SECRET_DEPLOY,
process.env.ACCOUNT_SECRET_OWNER,
],
gasPrice: 40000000000,
gasMultiplier: 1.15,
timeout: 720000,
},
},
solidity: {
version: "0.8.3",
settings: {
optimizer: {
enabled: true,
runs: 1337,
},
},
},
paths: {
sources: "./contracts",
tests: "./test",
artifacts: "./build",
},
mocha: mochaConfig,
};