-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhardhat.config.ts
More file actions
76 lines (72 loc) · 1.48 KB
/
hardhat.config.ts
File metadata and controls
76 lines (72 loc) · 1.48 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import '@nomiclabs/hardhat-ethers'
import '@nomiclabs/hardhat-waffle'
// import '@nomiclabs/hardhat-etherscan'
import '@typechain/hardhat'
import 'hardhat-tracer'
import 'hardhat-gas-reporter'
import 'hardhat-log-remover'
import * as Mocha from 'mocha'
import * as fs from 'fs'
import './utils/tasks'
import '@nomicfoundation/hardhat-verify'
const loadSecret = () => {
const secretPath = './secret.json'
if (fs.existsSync(secretPath)) {
return JSON.parse(fs.readFileSync(secretPath, 'utf8'))
} else {
return {
POLYGON_ALCHEMY_API: '',
POLYGON_SEED: '',
POLYGON_SCAN_API_KEY: '',
MUMBAI_ALCHEMY_API: '',
MUMBAI_SEED: ''
}
}
}
const secret = loadSecret()
const config = {
solidity: {
version: '0.8.18',
settings: {
optimizer: {
enabled: true,
runs: 200
}
}
},
networks: {
docker: {
url: 'http://host.docker.internal:8545'
},
polygon: {
url: `https://polygon-mainnet.g.alchemy.com/v2/${secret?.POLYGON_ALCHEMY_API}`,
accounts: {
mnemonic: secret?.POLYGON_SEED
},
gasPrice: 50000000000
},
mumbai: {
url: `https://polygon-mumbai.g.alchemy.com/v2/${secret?.MUMBAI_ALCHEMY_API}`,
accounts: {
mnemonic: secret?.MUMBAI_SEED
}
},
local: {
url: 'http://127.0.0.1:8545',
accounts: {
mnemonic: secret?.LOCAL_SEED
}
}
},
etherscan: {
apiKey: secret?.POLYGON_SCAN_API_KEY
},
typechain: {
outDir: 'typechain',
target: 'ethers-v5'
},
mocha: {
reporter: Mocha.reporters.Spec
}
}
export default config