-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.ts
76 lines (68 loc) · 1.83 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
import { HardhatUserConfig } from "hardhat/config"
import { NetworkUserConfig } from "hardhat/types"
import "./tasks/accounts"
import "./tasks/clean"
import "./tasks/merkle"
import "@nomiclabs/hardhat-solhint"
import "@nomiclabs/hardhat-ethers"
import "@nomiclabs/hardhat-waffle"
import "@nomiclabs/hardhat-web3"
import "@typechain/hardhat"
import "solidity-coverage"
import "hardhat-gas-reporter"
import "dotenv/config"
import "hardhat-storage-layout"
const chainIds = {
hardhat: 31337,
sokol: 77,
xdai: 100,
}
// Ensure that we have all the environment variables we need.
//if (!process.env.MNEMONIC) throw new Error('Please set your MNEMONIC in a .env file');
//const mnemonic = process.env.MNEMONIC as string;
//if (!process.env.DEPLOYER_ADDRESS) throw new Error("Please set your DEPLOYER_ADDRESS in a .env file")
// Define network configurations
function createNetworkConfig(network: keyof typeof chainIds): NetworkUserConfig {
const url: string = "https://" + network + ".poa.network"
return {
accounts: {
count: 10,
initialIndex: 0,
mnemonic: "test test test test test test test test test test test junk",
path: "m/44'/60'/0'/0",
},
chainId: chainIds[network],
url,
}
}
const config: HardhatUserConfig = {
defaultNetwork: "hardhat",
networks: {
hardhat: {
chainId: chainIds.hardhat,
},
localhost: {},
sokol: createNetworkConfig("sokol"),
xdai: createNetworkConfig("xdai"),
},
solidity: {
version: "0.8.9",
settings: {
optimizer: {
enabled: false,
runs: 200,
},
outputSelection: {
"*": {
"*": ["storageLayout"],
},
},
},
},
gasReporter: {
currency: "USD",
enabled: process.env.REPORT_GAS ? true : false,
coinmarketcap: process.env.MARKET_API_KEY,
},
}
export default config