-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhardhat.config.js
101 lines (95 loc) · 2.1 KB
/
hardhat.config.js
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
// hardhat.config.ts
const dotenv = require('dotenv');
const path = require('path');
dotenv.config({ path: path.resolve(__dirname, './.env') });
require('hardhat-deploy-ethers');
require('hardhat-deploy');
require('hardhat-gas-reporter');
const chainIds = {
ganache: 1337,
goerli: 5,
hardhat: 31337,
kovan: 42,
mainnet: 1,
rinkeby: 4,
ropsten: 3,
sepolia: 11155111,
};
const MNEMONIC = process.env.MNEMONIC || '';
const INFURA_KEY = process.env.INFURA || '';
const getInfuraURL = (network) => {
return `https://${network}.infura.io/v3/${INFURA_KEY}`;
};
/**
* @type import('hardhat/config').HardhatUserConfig
*/
module.exports = {
defaultNetwork: 'hardhat',
networks: {
hardhat: {
accounts: {
mnemonic: MNEMONIC,
},
chainId: chainIds.hardhat,
},
ropsten: {
url: getInfuraURL('ropsten'),
accounts: {
mnemonic: MNEMONIC,
},
chainId: chainIds.ropsten,
},
rinkeby: {
url: getInfuraURL('rinkeby'),
accounts: {
mnemonic: MNEMONIC,
},
chainId: chainIds.rinkeby,
},
sepolia: {
url: getInfuraURL('sepolia'),
accounts: {
mnemonic: MNEMONIC
},
chainId: chainIds.sepolia,
},
bsctest: {
url: 'https://data-seed-prebsc-1-s1.binance.org:8545',
chainId: 97,
gasPrice: 20000000000,
accounts: { mnemonic: MNEMONIC },
},
bscmain: {
url: 'https://bsc-dataseed.binance.org/',
chainId: 56,
gasPrice: 20000000000,
accounts: { mnemonic: MNEMONIC },
},
},
solidity: {
compilers: [
{
version: '0.7.4',
settings: { optimizer: { enabled: true, runs: 200 } },
},
],
},
gasReporter: {
currency: 'EUR',
coinmarketcap: process.env.COINMARKETCAP_API_KEY,
enabled: process.env.GAS_REPORT ? true : false,
gasPrice: 1,
showTimeSpent: true,
},
typechain: {
outDir: 'src/typechain',
},
namedAccounts: {
deployer: {
default: 0, // here this will by default take the first account as deployer
},
},
paths: {
deployments: 'src/deployments',
}
};