-
Notifications
You must be signed in to change notification settings - Fork 24
/
hardhat.config.js
53 lines (51 loc) · 1.58 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
require("@nomicfoundation/hardhat-verify")
const settings = require("./settings")
const utils = require("./src/utils")
const [, target] = utils.getRealmNetworkFromArgs()
module.exports = {
paths: {
sources: "./contracts",
},
networks: Object.fromEntries(
Object.entries(settings.getNetworks())
.map(([network, config]) => {
return [network, {
chainId: config.network_id,
gas: config?.gas,
gasPrice: config?.gasPrice,
url: `http://${config?.host || "localhost"}:${config?.port || 8545}`,
}]
})
),
solidity: settings.getCompilers(target),
sourcify: {
enabled: true,
apiUrl: "https://sourcify.dev/server",
browserUrl: "https://repo.sourcify.dev",
},
etherscan: {
apiKey: Object.fromEntries(
Object.entries(settings.getNetworks())
.filter(([, config]) => config?.verify !== undefined)
.map(([network, config]) => {
const [ecosystem] = utils.getRealmNetworkFromString(network)
const envar = `ETHERSCAN_${ecosystem.toUpperCase()}_API_KEY`
return [network,
config?.verify?.apiKey || process.env[envar] || process.env.ETHERSCAN_API_KEY || "MY_API_KEY",
]
}),
),
customChains: Object.entries(settings.getNetworks())
.filter(([, config]) => config?.verify !== undefined)
.map(([network, config]) => {
return {
network,
chainId: config.network_id,
urls: {
apiURL: config?.apiUrl,
browserURL: config?.browserUrl,
},
}
}),
},
}