-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhardhat.config.ts
61 lines (56 loc) · 1.49 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
import { config as dotEnvConfig } from "dotenv";
dotEnvConfig();
import { HardhatUserConfig } from "hardhat/types";
import "@nomiclabs/hardhat-waffle";
import "@typechain/hardhat";
import "hardhat-deploy";
import "hardhat-deploy-ethers";
const DEPLOYER_PRIVATE_KEY = process.env.RINKEBY_PRIVATE_KEY!;
const INFURA_KEY = process.env.INFURA_KEY || "";
const config: HardhatUserConfig = {
defaultNetwork: "hardhat",
solidity: {
compilers: [
{
version: "0.7.6",
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
],
},
namedAccounts: {
deployer: 0,
},
networks: {
hardhat: {},
localhost: {},
development: {
url: `https://rinkeby.infura.io/v3/${INFURA_KEY}`,
accounts: [DEPLOYER_PRIVATE_KEY],
live: true,
saveDeployments: true,
},
testnet: {
url: `https://rinkeby.infura.io/v3/${INFURA_KEY}`,
accounts: [DEPLOYER_PRIVATE_KEY],
},
},
mocha: {
timeout: 2000000,
},
external: process.env.HARDHAT_FORK
? {
deployments: {
// process.env.HARDHAT_FORK will specify the network that the fork is made from.
// these lines allow it to fetch the deployments from the network being forked from both for node and deploy task
hardhat: ["deployments/" + process.env.HARDHAT_FORK],
localhost: ["deployments/" + process.env.HARDHAT_FORK],
},
}
: undefined,
};
export default config;