-
Notifications
You must be signed in to change notification settings - Fork 3
/
hardhat.base.ts
111 lines (107 loc) · 2.54 KB
/
hardhat.base.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
/* eslint-disable camelcase */
import { Networks } from "./network.config"
import { HardhatUserConfig } from "hardhat/config"
import "@nomiclabs/hardhat-ethers"
import "@nomiclabs/hardhat-waffle"
import "hardhat-deploy"
import "hardhat-deploy-ethers"
import "@typechain/hardhat"
import "solidity-coverage"
import "@nomiclabs/hardhat-etherscan"
let isMainnetFork = process.env.FORK === "mainnet"
let localChainId = isMainnetFork ? 1 : 31337
// You have to export an object to set up your config
// This object can have the following optional entries:
// defaultNetwork, networks, solc, and paths.
// Go to https://buidler.dev/config/ to learn more
const hardhatConfig: HardhatUserConfig = {
etherscan: {
apiKey: process.env.ETHERSCAN_APIKEY,
},
typechain: {
outDir: "typechain/vanilla_v1.1",
target: "ethers-v5",
},
solidity: {
version: "0.8.4",
settings: {
optimizer: {
enabled: true,
},
},
},
defaultNetwork: "hardhat",
networks: {
mainnet: {
url: Networks.mainnet.providerURL,
accounts: Networks.mainnet.privateKeys,
live: true,
gasPrice: 200 * 1_000_000_000,
chainId: 1,
},
ropsten: {
url: Networks.ropsten.providerURL,
accounts: Networks.ropsten.privateKeys,
live: true,
saveDeployments: true,
chainId: 3,
},
goerli: {
url: Networks.goerli.providerURL,
accounts: Networks.goerli.privateKeys,
live: true,
saveDeployments: true,
chainId: 5,
},
rinkeby: {
url: Networks.rinkeby.providerURL,
accounts: Networks.rinkeby.privateKeys,
live: true,
saveDeployments: true,
chainId: 4,
},
localhost: {
chainId: localChainId,
live: false,
saveDeployments: true,
tags: ["local"],
},
hardhat: {
hardfork: "london",
gasPrice: "auto",
forking: {
enabled: isMainnetFork,
url: Networks.mainnet.providerURL,
},
chainId: localChainId,
live: false,
saveDeployments: true,
tags: ["test", "local"],
},
},
namedAccounts: {
deployer: {
default: 0, // the first account for mnemonic/specific private key
},
team: {
default: 1, // the second account for mnemonic
},
dev: {
default: 2,
},
},
external: {
contracts: [
{
artifacts: "node_modules/@uniswap/v2-periphery/build/",
},
{
artifacts: "node_modules/@uniswap/v2-core/build/",
},
],
},
mocha: {
timeout: 0,
},
}
export default hardhatConfig