-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhardhat.config.ts
114 lines (108 loc) · 2.54 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
import { task } from "hardhat/config";
import "solidity-coverage";
import "hardhat-docgen";
import "@nomiclabs/hardhat-waffle";
import "hardhat-deploy";
import "@nomiclabs/hardhat-ethers";
import "hardhat-gas-reporter";
import "@nomiclabs/hardhat-etherscan";
task("accounts", "Prints the list of accounts", async (args, hre) => {
const accounts = await hre.ethers.getSigners();
for (const account of accounts) {
console.log(await account.address);
}
});
const ETH_DERIVATION_PATH = "m/44'/52752'/0'/0/";
function getCoinMarketCapAPIKey(network:string): string {
require("dotenv").config({ path: `.env.${network}` });
return process.env.COINMARKETCAP_API || '';
}
function getMnemonic(network:string) : string {
require("dotenv").config({ path: `.env.${network}` });
return process.env.MNEMONIC || '';
};
export default {
networks: {
hardhat: {
hardfork: "london",
allowUnlimitedContractSize: true,
gasPrice: "auto",
gas: "auto",
blockGasLimit: 99999999999
},
mainnet: {
url: "https://mainnet.infura.io/v3/e41faa24301e41d2a67002d07c758c2f",
accounts: {
mnemonic: getMnemonic("mainnet")
},
allowUnlimitedContractSize: true,
gas: "auto",
gasPrice: "auto",
},
goerli: {
url: "https://goerli.infura.io/v3/e41faa24301e41d2a67002d07c758c2f",
accounts: {
mnemonic: getMnemonic("goerli")
},
allowUnlimitedContractSize: true,
gas: "auto",
gasPrice: "auto",
},
ropsten: {
url: "https://ropsten.infura.io/v3/e41faa24301e41d2a67002d07c758c2f",
accounts: {
mnemonic: getMnemonic("ropsten")
},
allowUnlimitedContractSize: true,
gas: "auto",
gasPrice: "auto",
},
rinkeby: {
url: "https://rinkeby.infura.io/v3/e41faa24301e41d2a67002d07c758c2f",
accounts: {
mnemonic: getMnemonic("rinkeby")
},
allowUnlimitedContractSize: true,
gas: "auto",
gasPrice: "auto",
timeout: 600000
}
},
solidity: {
version: "0.8.4",
settings: {
optimizer: {
enabled: true,
runs: 200
}
}
},
namedAccounts: {
deployer: {
default: 0
},
user1: {
default: 1
},
user2: {
default: 2
},
user3: {
default: 3
}
},
docgen: {
path: './docs',
clear: true,
runOnCompile: true,
},
gasReporter: {
currency: 'EUR',
coinmarketcap: getCoinMarketCapAPIKey("rinkeby")
},
etherscan: {
apiKey: {
mainnet: process.env.ETHERSCAN_KEY
}
}
};