-
Notifications
You must be signed in to change notification settings - Fork 4
/
hardhat.config.ts
47 lines (43 loc) · 1.07 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
import "@nomiclabs/hardhat-ethers";
import "@nomiclabs/hardhat-waffle";
import "@typechain/hardhat";
import fs from "fs";
const privateKey = fs.existsSync("../secret.txt")
? fs.readFileSync("../secret.txt", "utf-8").trim()
: "";
if (!privateKey) console.log("Missing private key");
export const infuraProjectId = fs.existsSync(".infuraprojectid")
? fs.readFileSync(".infuraprojectid", "utf-8").trim()
: "";
if (!infuraProjectId) console.log("Missing infura project id");
/**
* @type import('hardhat/config').HardhatUserConfig
*/
module.exports = {
solidity: {
version: "0.8.4",
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
networks: {
hardhat: {
chainId: 1337,
},
mainnet: {
url: `https://polygon-mainnet.infura.io/v3/${infuraProjectId}`,
chainId: 137,
gasPrice: 50000000000,
accounts: [privateKey]
},
mumbai: {
url: `https://polygon-mumbai.infura.io/v3/${infuraProjectId}`,
chainId: 80001,
gasPrice: 14000000000,
accounts: [privateKey],
},
},
};