-
Notifications
You must be signed in to change notification settings - Fork 1
/
hardhat.config.ts
98 lines (89 loc) · 2.46 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 "@nomicfoundation/hardhat-chai-matchers";
import "@nomicfoundation/hardhat-toolbox";
import { config as dotenvConfig } from "dotenv";
import type { HardhatUserConfig } from "hardhat/config";
import { resolve } from "path";
import "./tasks/deploy";
import "./tasks/upgrade";
const dotenvConfigPath: string = process.env.DOTENV_CONFIG_PATH || "./.env";
dotenvConfig({ path: resolve(__dirname, dotenvConfigPath) });
// Ensure that we have all the environment variables we need.
const privateKey: string | undefined = process.env.PRIVATE_KEY;
if (!privateKey) {
throw new Error("Please set your PRIVATE_KEY in a .env file");
}
const fantomRpcURL: string | undefined = process.env.FANTOM_RPC_URL;
if (!fantomRpcURL) {
throw new Error("Please set your fantomRpcURL in a .env file");
}
const ftmscanAPIKey: string | undefined = process.env.FTMSCAN_API_KEY;
if (!ftmscanAPIKey) {
throw new Error("Please set your ftmscanAPIKey in a .env file");
}
const arbitrumRpcURL: string | undefined = process.env.ARBITRUM_RPC_URL;
if (!arbitrumRpcURL) {
throw new Error("Please set your arbitrumRpcURL in a .env file");
}
const arbiscanAPIKey: string | undefined = process.env.ARBISCAN_API_KEY;
if (!arbiscanAPIKey) {
throw new Error("Please set your arbiscanAPIKey in a .env file");
}
const config: HardhatUserConfig = {
defaultNetwork: "hardhat",
gasReporter: {
currency: "USD",
enabled: true,
excludeContracts: [],
src: "./contracts",
},
networks: {
hardhat: {
forking: {
url: fantomRpcURL,
},
allowUnlimitedContractSize: false,
},
fantom: {
url: fantomRpcURL,
accounts: [privateKey],
},
arbitrum: {
url: arbitrumRpcURL,
accounts: [privateKey],
},
},
etherscan: {
apiKey: {
opera: ftmscanAPIKey,
arbitrumOne: arbiscanAPIKey,
},
},
paths: {
artifacts: "./artifacts",
cache: "./cache",
sources: "./contracts",
tests: "./test",
},
solidity: {
version: "0.8.16",
settings: {
metadata: {
// Not including the metadata hash
// https://github.com/paulrberg/hardhat-template/issues/31
bytecodeHash: "none",
},
// Disable the optimizer when debugging
// https://hardhat.org/hardhat-network/#solidity-optimizer-support
optimizer: {
enabled: true,
runs: 200,
},
viaIR: true,
},
},
typechain: {
outDir: "src/types",
target: "ethers-v5",
},
};
export default config;