-
Notifications
You must be signed in to change notification settings - Fork 1
/
hardhat.config.ts
98 lines (95 loc) · 2.43 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
import dotenv from "dotenv";
dotenv.config();
// import { HardhatUserConfig } from "hardhat/config";
import "@typechain/hardhat";
import "@nomiclabs/hardhat-etherscan";
import "@nomiclabs/hardhat-ethers";
import "@nomicfoundation/hardhat-toolbox";
import "hardhat-contract-sizer";
import "@cronos-labs/hardhat-cronoscan";
const privateKey: string | undefined = process.env.PRIVATE_KEY;
const config = {
solidity: {
version: "0.8.16",
settings: {
optimizer: {
enabled: true,
runs: 9999,
},
},
},
networks: {
main: {
url: `${process.env.API_NODE_ETH}`,
accounts: privateKey !== undefined ? [privateKey] : [],
chainId: 1,
},
goerli: {
url: `${process.env.API_NODE_GOERLI}`,
accounts: privateKey !== undefined ? [privateKey] : [],
chainId: 5,
},
// Polygon networks
polygon: {
url: `${process.env.API_NODE_POLYGON}`,
accounts: privateKey !== undefined ? [privateKey] : [],
chainId: 137,
},
mumbai: {
url: `${process.env.API_NODE_POLYGON_MUMBAI}`,
accounts: privateKey !== undefined ? [privateKey] : [],
chainId: 80001,
},
// BNB Chain networks
bnb_chain: {
url: `${process.env.API_NODE_BSC}`,
accounts: privateKey !== undefined ? [privateKey] : [],
chainId: 56,
},
bnb_testnet: {
url: `${process.env.API_NODE_BSC_TEST}`,
accounts: privateKey !== undefined ? [privateKey] : [],
chainId: 97,
},
// CRONOS networks
cronos: {
url: `${process.env.API_NODE_CRONOS}`,
chainId: 25,
accounts: privateKey !== undefined ? [privateKey] : [],
},
cronos_testnet: {
url: `${process.env.API_NODE_CRONOS_TEST}`,
chainId: 338,
accounts: privateKey !== undefined ? [privateKey] : [],
},
},
gasReporter: {
enabled: process.env.REPORT_GAS ? true : false,
},
contractSizer: {
runOnCompile: true,
strict: true,
},
etherscan: {
apiKey: process.env.CRONOSSCAN_API_KEY,
customChains: [
{
network: "cosmos",
chainId: 25,
urls: {
apiURL: "https://api.cronoscan.com/api",
browserURL: "https://cronoscan.com/",
},
},
{
network: "cosmos_test",
chainId: 338,
urls: {
apiURL: "https://api.cronoscan.com/api",
browserURL: "https://testnet.cronoscan.com/",
},
},
],
},
};
export default config;