-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathhardhat.config.ts
More file actions
59 lines (55 loc) · 1.3 KB
/
hardhat.config.ts
File metadata and controls
59 lines (55 loc) · 1.3 KB
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
require("dotenv").config();
import { HardhatUserConfig } from "hardhat/config";
import "@nomiclabs/hardhat-waffle";
import "hardhat-deploy";
import "@nomiclabs/hardhat-ethers";
import "@nomiclabs/hardhat-etherscan";
// You need to export an object to set up your config
// Go to https://hardhat.org/config/ to learn more
const mnemonic = process.env.TEST_MNEMONIC as string;
const deployerMnemonic = process.env.DEPLOYER_MNEMONIC as string;
const etherscanApi = process.env.ETHERSCAN_API_KEY as string;
const config: HardhatUserConfig = {
//@ts-ignore
namedAccounts: {
deployer: {
default: 0, // here this will by default take the first account as deployer
},
},
solidity: {
version: "0.8.6",
settings: {
optimizer: {
enabled: true,
runs: 999999,
},
},
},
paths: {
sources: "./src",
tests: "./src/test",
cache: "./cache",
artifacts: "./artifacts",
},
networks: {
hardhat: {
forking: {
url: process.env.MAINNET_API_URL as string,
},
},
mainnet: {
url: process.env.MAINNET_API_URL,
accounts: { mnemonic: deployerMnemonic },
},
rinkeby: {
url: process.env.RINKEBY_API_URL,
accounts: { mnemonic: mnemonic },
},
},
etherscan: {
// Your API key for Etherscan
// Obtain one at https://etherscan.io/
apiKey: etherscanApi,
},
};
export default config;