-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhardhat.config.ts
100 lines (90 loc) · 2.38 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
// import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";
import * as dotenv from "dotenv";
dotenv.config({ path: __dirname + "/.env" });
import "@typechain/hardhat";
import "@nomicfoundation/hardhat-ethers";
import "hardhat-preprocessor";
import "hardhat-contract-sizer";
import "hardhat-gas-reporter";
import "@nomicfoundation/hardhat-verify";
import "solidity-coverage";
import { HashZero } from "@ethersproject/constants";
if (process.env.DOCKER) {
require("hardhat-ethernal");
}
import { removeConsoleLog } from "hardhat-preprocessor";
import { getHardhatConfigNetworks } from "./hardhat.config.networks";
import { getHardhatConfigScanners } from "./hardhat.config.scanners";
const PRIVATE_KEY = `${process.env.PRIVATE_KEY || HashZero.slice(2)}`;
const config = {
contractSizer: {
alphaSort: true,
disambiguatePaths: false,
runOnCompile: true,
},
etherscan: {
...getHardhatConfigScanners(),
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
customChains: [
{
chainId: 478,
network: "formmainnet",
urls: {
apiURL: "https://explorer.form.network/api",
browserURL: "https://explorer.form.network",
},
},
{
chainId: 132902,
network: "formtestnet",
urls: {
apiURL: "https://sepolia-explorer.form.network/api",
browserURL: "https://sepolia-explorer.form.network",
},
},
],
},
networks: {
...getHardhatConfigNetworks([`0x${PRIVATE_KEY}`]),
},
preprocess: {
eachLine: removeConsoleLog((hre: { network: { name: string } }) => {
return hre.network.name !== "hardhat" && hre.network.name !== "localhost";
}),
},
solidity: {
compilers: [
{
settings: {
optimizer: { enabled: true, runs: 200 },
viaIR: true, // Enable IR pipeline
},
version: "0.8.20",
},
{
settings: {
optimizer: { enabled: true, runs: 200 },
},
version: "0.8.15",
},
{
settings: {},
version: "0.5.15",
},
],
settings: {
optimizer: {
enabled: true,
runs: 1000,
},
},
},
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
typechain: {
outDir: "typechain-types",
},
};
export default config;