-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.ts
82 lines (78 loc) · 1.93 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
import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";
require("dotenv").config();
import "hardhat-abi-exporter";
const MAINNET_RPC_URL = process.env.MAINNET_RPC_URL as string;
const GOERLI_RPC_URL = process.env.MAINNET_RPC_URL as string;
const BINANCE_MAINNET_RPC_URL = process.env.BINANCE_MAINNET_RPC_URL as string;
const POLYGON_MAINNET_RPC_URL = process.env.POLYGON_MAINNET_RPC_URL as string;
const PRIVATE_KEY = (process.env.PRIVATE_KEY as string) || "0x";
interface Config extends HardhatUserConfig {
abiExporter: {
path: string;
runOnCompile: boolean;
format: string;
};
}
const config: Config = {
solidity: {
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
compilers: [
{
version: "0.8.17",
},
{
version: "0.6.6",
},
{
version: "0.5.16",
},
],
},
defaultNetwork: "hardhat",
abiExporter: {
path: "./packages/sdk/src/abi",
runOnCompile: true,
format: "json",
},
networks: {
// ganache: {
// url: MAINNET_RPC_URL,
// chainId: 1337,
// },
hardhat: {
gas: 30000000,
chainId: 31337,
// comment out forking to run tests on a local chain
// forking: {
// url: BINANCE_RPC_URL,
// },
},
// mainnet: {
// url: MAINNET_RPC_URL,
// accounts: PRIVATE_KEY !== undefined ? [PRIVATE_KEY] : [],
// chainId: 1,
// },
// goerli: {
// url: GOERLI_RPC_URL,
// accounts: PRIVATE_KEY !== undefined ? [PRIVATE_KEY] : [],
// chainId: 5,
// },
// polygon: {
// url: POLYGON_MAINNET_RPC_URL,
// accounts: PRIVATE_KEY !== undefined ? [PRIVATE_KEY] : [],
// chainId: 137,
// },
// binance: {
// url: BINANCE_MAINNET_RPC_URL,
// accounts: PRIVATE_KEY !== undefined ? [PRIVATE_KEY] : [],
// chainId: 56,
// },
},
};
export default config;