-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.js
68 lines (65 loc) · 2.09 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
require('@nomiclabs/hardhat-waffle');
require('@nomiclabs/hardhat-etherscan');
require('dotenv').config();
const ETHERSCAN_API = process.env.ETHERSCAN_API || '';
const INFURA_API_KEY = process.env.INFURA_API_KEY || '';
const ALCHEMY_API_KEY_GOERLI = process.env.ALCHEMY_API_KEY_GOERLI || '';
const ALCHEMY_API_KEY_KOVAN = process.env.ALCHEMY_API_KEY_KOVAN || '';
const ALCHEMY_API_KEY_MAINNET = process.env.ALCHEMY_API_KEY_MAINNET || '';
const PRIVATE_KEY = process.env.PRIVATE_KEY || '';
const KOVAN_PRIVATE_KEY = process.env.KOVAN_PRIVATE_KEY || '';
task('env', 'Prints env', async () => {
console.log('ETHERSCAN_API', ETHERSCAN_API);
console.log('ALCHEMY_API_KEY_GOERLI', ALCHEMY_API_KEY_GOERLI);
console.log('ALCHEMY_API_KEY_KOVAN', ALCHEMY_API_KEY_KOVAN);
console.log('ALCHEMY_API_KEY_MAINNET', ALCHEMY_API_KEY_MAINNET);
console.log('INFURA_API_KEY', INFURA_API_KEY);
console.log('PRIVATE_KEY', PRIVATE_KEY);
console.log('KOVAN_PRIVATE_KEY', KOVAN_PRIVATE_KEY);
});
module.exports = {
solidity: {
version: '0.7.6',
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
networks: {
hardhat: {
chainId: 1337,
},
localhost: {
timeout: 999999999,
gasPrice: 1600000000000,
accounts: [PRIVATE_KEY].filter(item => item !== ''),
},
local: {
url: 'http://127.0.0.1:8545',
gasPrice: 50000000000,
},
goerli: {
url: `https://eth-goerli.alchemyapi.io/v2/${ALCHEMY_API_KEY_GOERLI}`,
gasPrice: 900000000000,
accounts: [PRIVATE_KEY].filter(item => item !== ''),
},
kovan: {
url: `https://eth-kovan.alchemyapi.io/v2/${ALCHEMY_API_KEY_KOVAN}`,
gasPrice: 1000000007,
accounts: [KOVAN_PRIVATE_KEY].filter(item => item !== ''),
},
mainnet: {
timeout: 999999999,
url: `https://eth-mainnet.alchemyapi.io/v2/${ALCHEMY_API_KEY_MAINNET}`,
gasPrice: 100000000000,
accounts: [PRIVATE_KEY].filter(item => item !== ''),
},
},
etherscan: {
// Your API key for Etherscan
// Obtain one at https://etherscan.io/
apiKey: ETHERSCAN_API,
},
};