-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathhardhat.config.ts
108 lines (104 loc) · 2.67 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
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
import { task } from 'hardhat/config'
import '@nomiclabs/hardhat-waffle'
import '@nomiclabs/hardhat-truffle5'
import '@openzeppelin/hardhat-upgrades'
import '@openzeppelin/hardhat-defender'
import '@nomiclabs/hardhat-web3'
import '@nomiclabs/hardhat-etherscan'
// This is a sample Buidler task. To learn how to create your own go to
// https://buidler.dev/guides/create-task.html
task('accounts', 'Prints the list of accounts', async (args, hre) => {
const accounts = await hre.ethers.getSigners()
for (const account of accounts) {
console.log(await account.getAddress())
}
})
// store your secrets in a secure (cyphered) directory.
// uses defaults when secrets vault locked (for local developement)
let secrets = {
mnemonic: 'test',
etherscanKey: 'none',
alchemyKey: 'none',
infuraKey: 'none',
defenderApiKey: 'none',
defenderApiSecret: 'none',
}
try {
secrets = require('/Volumes/Secrets/dev/ah-token/Ah-mnemonic.js')
} catch {
console.log('Hardhat.config: No secrets provided (local developement mode)')
}
export default {
defaultNetwork: 'localhost',
defender: {
apiKey: secrets.defenderApiKey, //todo think of moving secrets to env process.env.API_KEY
apiSecret: secrets.defenderApiSecret,
},
networks: {
localhost: {
url: 'http://localhost:8545',
},
kovan: {
url: 'https://kovan.infura.io/v3/' + secrets.infuraKey,
accounts: {
mnemonic: secrets.mnemonic,
},
timeout: 60000,
},
rinkeby: {
url: 'https://eth-rinkeby.alchemyapi.io/v2/' + secrets.alchemyKey,
accounts: {
mnemonic: secrets.mnemonic,
},
timeout: 60000,
},
bnbTestnet: {
url: 'https://data-seed-prebsc-1-s1.binance.org:8545',
chainId: 97,
gasPrice: 20000000000,
accounts: {
mnemonic: secrets.mnemonic,
},
},
mumbai: {
//provider: () => new HDWalletProvider(mnemonic, `https://rpc-mumbai.matic.today`),
network_id: 80001,
url: `https://rpc-mumbai.matic.today`,
confirmations: 2,
timeoutBlocks: 200,
skipDryRun: true,
accounts: {
mnemonic: secrets.mnemonic,
},
},
gnosis: {
network_id: 100,
url: 'https://rpc.gnosischain.com',
accounts: {
mnemonic: secrets.mnemonic,
},
gasPrice: 2500000000, //2.5 gwei
timeout: 120000,
},
},
etherscan: {
// Your API key for Etherscan
// Obtain one at https://etherscan.io/
apiKey: secrets.etherscanKey,
},
solidity: {
compilers: [
{
version: '0.8.0',
},
{
version: '0.8.2',
},
],
settings: {
optimizer: {
enabled: true,
},
},
},
}