-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathhardhat.config.ts
59 lines (50 loc) · 1.2 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
import * as dotenv from 'dotenv'
dotenv.config();
import "@nomiclabs/hardhat-truffle5";
import "@nomiclabs/hardhat-etherscan";
import "@nomiclabs/hardhat-ethers";
require("@nomiclabs/hardhat-web3");
/**
* @type import('hardhat/config').HardhatUserConfig
*/
const {
INFURA_KEY,
MNEMONIC,
ETHERSCAN_API_KEY,
PRIVATE_KEY,
PRIVATE_KEY_TESTNET
} = process.env;
const accountsTestnet = PRIVATE_KEY_TESTNET
? [PRIVATE_KEY_TESTNET]
: {mnemonic: MNEMONIC};
const accountsMainnet = PRIVATE_KEY
? [PRIVATE_KEY]
: {mnemonic: MNEMONIC};
module.exports = {
solidity: "0.8.10",
networks: {
hardhat: {
forking: {
url: `https://mainnet.infura.io/v3/${INFURA_KEY}`,
accounts: accountsTestnet
}
},
mainnet: {
url: `https://mainnet.infura.io/v3/${INFURA_KEY}`,
// accounts: accountsMainnet,
},
rinkeby: {
url: `https://rinkeby.infura.io/v3/${INFURA_KEY}`,
accounts: accountsTestnet,
},
ropsten: {
url: `https://ropsten.infura.io/v3/${INFURA_KEY}`,
accounts: accountsTestnet,
}
},
etherscan: {
// Your API key for Etherscan
// Obtain one at https://etherscan.io/
apiKey: ETHERSCAN_API_KEY
}
};