-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathhardhat.config.ts
More file actions
58 lines (52 loc) · 1.4 KB
/
hardhat.config.ts
File metadata and controls
58 lines (52 loc) · 1.4 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
import dotenv from "dotenv";
dotenv.config();
import { HardhatUserConfig } from "hardhat/types";
import "@nomiclabs/hardhat-waffle";
import "hardhat-typechain";
import "@openzeppelin/hardhat-upgrades";
import "@nomiclabs/hardhat-etherscan";
const privKey = process.env.PRIVATE_KEY;
const providerRopsten = process.env.PROVIDER_ROPSTEN;
const providerMainnet = process.env.PROVIDER_MAINNET;
const needsProvider =
process.env.npm_config_argv &&
(process.env.npm_config_argv.includes("rinkeby") ||
process.env.npm_config_argv.includes("ropsten") ||
process.env.npm_config_argv.includes("mainnet"));
if ((!privKey || !providerRopsten) && needsProvider) {
console.error("Please set a private key and provider.");
process.exit(0);
}
const privKeyExists = privKey as string;
const config: HardhatUserConfig = {
solidity: {
compilers: [
{
version: "0.8.0",
},
],
},
defaultNetwork: "hardhat",
networks: {
hardhat: {},
/* ropsten: {
url: providerRopsten,
accounts: [privKeyExists],
gasPrice: 2000000000 // 2gwei
},
mainnet: {
url: providerMainnet,
accounts: [privKeyExists]
} */
},
/* etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY
} */
// defaultNetwork: "hardhat",
// networks: {
// localhost: {
// chainId: 1337,
// },
// },
};
export default config;