-
Notifications
You must be signed in to change notification settings - Fork 2
/
hardhat.config.ts
93 lines (87 loc) · 2.02 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
import { VECHAIN_URL_SOLO, VECHAIN_URL_MAINNET, VECHAIN_URL_TESTNET } from "@vechain/hardhat-vechain"
import { HardhatUserConfig } from "hardhat/config"
import "@nomicfoundation/hardhat-toolbox"
import "@nomiclabs/hardhat-truffle5"
import "@vechain/hardhat-vechain"
import "@vechain/hardhat-ethers"
import "hardhat-contract-sizer"
import "hardhat-ignore-warnings"
import { getConfig } from "./config"
import "solidity-coverage"
import "solidity-docgen"
import { EnvConfig } from "./config/contracts"
const config: HardhatUserConfig = {
solidity: "0.8.20",
}
const getEnvMnemonic = () => {
const mnemonic = process.env.MNEMONIC
return mnemonic ?? ""
}
const getSoloUrl = () => {
const url = process.env.NEXT_PUBLIC_APP_ENV
? getConfig(process.env.NEXT_PUBLIC_APP_ENV as EnvConfig).network.urls[0]
: VECHAIN_URL_SOLO
return url
}
module.exports = {
solidity: {
version: "0.8.20",
evmVersion: "paris",
settings: {
optimizer: {
enabled: true,
runs: 1,
},
},
},
contractSizer: {
alphaSort: true,
disambiguatePaths: false,
runOnCompile: true,
strict: true,
},
mocha: {
timeout: 18000000,
grep: process.env.SHARD || undefined,
},
defaultNetwork: process.env.IS_TEST_COVERAGE ? "hardhat" : "vechain_solo",
networks: {
hardhat: {
chainId: 1337,
},
vechain_solo: {
url: getSoloUrl(),
accounts: {
mnemonic: getEnvMnemonic(),
count: 20,
path: "m/44'/818'/0'/0",
},
restful: true,
gas: 10000000,
},
vechain_testnet: {
url: VECHAIN_URL_TESTNET,
accounts: {
mnemonic: getEnvMnemonic(),
count: 20,
path: "m/44'/818'/0'/0",
},
restful: true,
gas: 10000000,
},
vechain_mainnet: {
url: VECHAIN_URL_MAINNET,
accounts: {
mnemonic: getEnvMnemonic(),
count: 1,
path: "m/44'/818'/0'/0",
},
restful: true,
gas: 10000000,
},
},
docgen: {
pages: "files",
},
}
export default config