-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.ts
52 lines (46 loc) · 1.11 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
import * as dotenv from "dotenv";
import "@nomiclabs/hardhat-ethers";
import "@nomiclabs/hardhat-waffle";
import "@typechain/hardhat";
import { NetworksUserConfig } from "hardhat/types";
import { HardhatUserConfig } from "hardhat/config";
dotenv.config();
const config: HardhatUserConfig = {
solidity: {
version: '0.8.4',
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
networks: {
// https://hardhat.org/metamask-issue.html
hardhat: {
chainId: 1337
},
},
// etherscan: {},
};
const {
MUMBAI_NETWORK_RPC_URL,
MUMBAI_PRIVATE_KEY,
OPT_GOERLI_NETWORK_RPC_URL,
OPT_GOERLI_PRIVATE_KEY,
} = process.env;
if (MUMBAI_NETWORK_RPC_URL && MUMBAI_PRIVATE_KEY) {
(config.networks as NetworksUserConfig).mumbai = {
chainId: 80001,
url: MUMBAI_NETWORK_RPC_URL,
accounts: [MUMBAI_PRIVATE_KEY],
};
}
if (OPT_GOERLI_NETWORK_RPC_URL && OPT_GOERLI_PRIVATE_KEY) {
(config.networks as NetworksUserConfig).optgoerli = {
chainId: 420,
url: OPT_GOERLI_NETWORK_RPC_URL,
accounts: [OPT_GOERLI_PRIVATE_KEY],
};
}
export default config;