-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhardhat.config.ts
More file actions
120 lines (115 loc) · 2.88 KB
/
hardhat.config.ts
File metadata and controls
120 lines (115 loc) · 2.88 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
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
109
110
111
112
113
114
115
116
117
118
119
120
import type { HardhatUserConfig } from "hardhat/config";
import { vars } from "hardhat/config";
import "@nomicfoundation/hardhat-ignition-viem";
import "@nomicfoundation/hardhat-toolbox-viem";
import "./tasks"
const deployer_mnemonic = vars.get("DEPLOYER_MNEMONIC")
const config: HardhatUserConfig = {
solidity: {
version: "0.8.28",
settings: {
optimizer: {
enabled: true,
runs: 200, // Optimize for average number of contract calls
},
viaIR: false, // if Enabled IR-based code generation the tests will fail (TODO: fix)
metadata: {
bytecodeHash: "none", // Remove metadata hash from bytecode to ensure consistent deployments
},
outputSelection: {
"*": {
"*": ["storageLayout"], // Enable storage layout for all contracts
},
},
},
},
defaultNetwork: "hardhat",
paths: {
sources: "./contracts",
tests: "./test",
cache: "./cache",
artifacts: "./artifacts",
},
etherscan: {
apiKey: {
confluxESpaceTestnet: "<api-key>",
confluxESpace: "<api-key>",
},
customChains: [
{
network: "confluxESpace",
chainId: 1030,
urls: {
apiURL: "https://evmapi.confluxscan.net/api",
browserURL: "https://evm.confluxscan.io",
},
},
{
network: "confluxESpaceTestnet",
chainId: 71,
urls: {
apiURL: "https://evmapi-testnet.confluxscan.io/api",
browserURL: "https://evmtestnet.confluxscan.io",
},
},
],
},
networks: {
hardhat: {
chainId: 31337,
mining: {
auto: true,
interval: 1000,
},
gasPrice: "auto",
gas: "auto",
allowUnlimitedContractSize: false, // Enforce contract size limits
},
confluxESpaceLocal: {
url: "http://localhost:8545",
chainId: 2030,
accounts: {
mnemonic: deployer_mnemonic,
path: "m/44'/60'/0'/0",
initialIndex: 0,
count: 10,
passphrase: "",
},
timeout: 20000, // 20 seconds
gasMultiplier: 1.2, // Add 20% to gas estimation
},
confluxESpaceTestnet: {
url: "https://evmtestnet.confluxrpc.com",
accounts: {
mnemonic: deployer_mnemonic,
path: "m/44'/60'/0'/0",
initialIndex: 0,
count: 10,
passphrase: "",
},
timeout: 20000,
gasMultiplier: 1.2,
},
confluxESpace: {
url: "https://evm.confluxrpc.com",
accounts: {
mnemonic: deployer_mnemonic,
path: "m/44'/60'/0'/0",
initialIndex: 0,
count: 10,
passphrase: "",
},
timeout: 20000,
gasMultiplier: 1.2,
},
},
mocha: {
timeout: 40000, // 40 seconds for test timeout
},
gasReporter: {
enabled: true,
currency: 'USD',
excludeContracts: ['contracts/mocks/'],
},
};
export default config;