-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.ts
127 lines (120 loc) · 2.71 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
115
116
117
118
119
120
121
122
123
124
125
126
127
import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-ethers";
import "@nomicfoundation/hardhat-toolbox";
import "@nomicfoundation/hardhat-chai-matchers";
import "@nomicfoundation/hardhat-network-helpers";
import "@typechain/hardhat";
import "hardhat-deploy";
import "hardhat-gas-reporter";
import "hardhat-contract-sizer";
import "solidity-coverage";
import "./tasks/tasks.index";
import dotenv from "dotenv";
dotenv.config();
/**
* @type import('hardhat/config').HardhatUserConfig
*/
const config: HardhatUserConfig = {
solidity: {
compilers: [
{
version: "0.8.21",
settings: {
optimizer: {
enabled: true,
runs: 99999,
},
},
},
{
version: "0.7.6",
settings: {
optimizer: {
enabled: true,
runs: 99999,
},
},
},
{
version: "0.6.12",
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
],
},
paths: {
sources: "./contracts",
tests: "./tests",
cache: "./cache",
artifacts: "./artifacts",
},
contractSizer: {
alphaSort: false,
disambiguatePaths: false,
runOnCompile: false,
strict: true,
},
namedAccounts: {
deployer: {
default: 0,
},
},
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY,
},
networks: {
mainnet: {
url: process.env.ALCHEMY_API || "",
gasPrice: 140 * 1000000000,
},
fuji: {
url: "https://api.avax-test.network/ext/bc/C/rpc",
gas: 5000000,
gasPrice: 180 * 1000000000,
chainId: 43113,
},
ava_mainnet: {
url: "https://api.avax.network/ext/bc/C/rpc",
gasPrice: 28 * 1000000000,
chainId: 43114,
},
bsc_mainnet: {
url: "https://bsc-dataseed.binance.org/",
chainId: 56,
gasPrice: 5000000000,
},
sepolia: {
url: "https://ethereum-sepolia.blockpi.network/v1/rpc/public",
chainId: 11155111,
},
},
};
if (process.env.ACCOUNT_PRIVATE_KEYS) {
config.networks = {
...config.networks,
fuji: {
...config.networks?.fuji,
accounts: JSON.parse(process.env.ACCOUNT_PRIVATE_KEYS),
},
ava_mainnet: {
...config.networks?.ava_mainnet,
accounts: JSON.parse(process.env.ACCOUNT_PRIVATE_KEYS),
},
bsc_mainnet: {
...config.networks?.bsc_mainnet,
accounts: JSON.parse(process.env.ACCOUNT_PRIVATE_KEYS),
},
sepolia: {
...config.networks?.sepolia,
accounts: JSON.parse(process.env.ACCOUNT_PRIVATE_KEYS),
},
};
}
config.gasReporter = {
enabled: process.env.REPORT_GAS ? true : false,
};
export default config;