forked from soli80sol/soul-wallet-contract
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.ts
156 lines (150 loc) · 4.91 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
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
/*
* @Description:
* @Version: 1.0
* @Autor: daivd.ding
* @Date: 2022-10-21 11:06:42
* @LastEditors: cejay
* @LastEditTime: 2023-03-01 11:15:03
*/
import * as dotenv from 'dotenv'
dotenv.config()
import 'solidity-coverage';
import "@nomicfoundation/hardhat-toolbox";
import { HardhatUserConfig } from "hardhat/config";
const GOERLI_PRIVATE_KEY =
process.env.GOERLI_PRIVATE_KEY! ||
"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"; // test private key
const MAINNET_PRIVATE_KEY =
process.env.MAINNET_PRIVATE_KEY! ||
"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"; // test private key
const ARBGOERLI_ONE_PRIVATE_KEY =
process.env.ARBGOERLI_ONE_PRIVATE_KEY! ||
"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80";
const ARBGOERLI_GOERLI_PRIVATE_KEY =
process.env.ARBGOERLI_GOERLI_PRIVATE_KEY! ||
"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80";
const OPGOERLI_PRIVATE_KEY =
process.env.OPGOERLI_PRIVATE_KEY! ||
"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80";
const OPTIMISM_PRIVATE_KEY =
process.env.OPTIMISM_PRIVATE_KEY! ||
"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80";
const optimizedComilerSettings = {
version: '0.8.17',
settings: {
optimizer: { enabled: true, runs: 1000000 },
viaIR: true
}
}
const entrypointRelatedComilerSettings = {
version: '0.8.15',
settings: {
optimizer: { enabled: true, runs: 1000000 },
viaIR: true
}
}
/** @type import('hardhat/config').HardhatUserConfig */
const config: HardhatUserConfig = {
solidity: {
compilers: [
{
version: "0.8.17",
settings: {
optimizer: {
enabled: true,
runs: 50000
},
viaIR: true
}
}
],
overrides: {
"contracts/entrypoint/EntryPoint.sol": optimizedComilerSettings,
"contracts/utils/Exec.sol": entrypointRelatedComilerSettings,
"contracts/entrypoint/StakeManager.sol": entrypointRelatedComilerSettings,
"contracts/entrypoint/SenderCreator.sol": entrypointRelatedComilerSettings,
"contracts/entrypoint/Helpers.sol": entrypointRelatedComilerSettings,
}
},
typechain: {
outDir: 'src/types',
target: 'ethers-v5',
alwaysGenerateOverloads: false, // should overloads with full signatures like deposit(uint256) be generated always, even if there are no overloads?
externalArtifacts: ['externalArtifacts/*.json'], // optional array of glob patterns with external artifacts to process (for example external libs from node_modules)
dontOverrideCompile: false // defaults to false
},
defaultNetwork: "hardhat",
networks: {
hardhat: {
allowUnlimitedContractSize: true,
accounts: {
mnemonic: 'test test test test test test test test test test test junk',
initialIndex: 0,
accountsBalance: '10000000000000000000000000' // 10,000,000 ETH
},
},
localhost: {
allowUnlimitedContractSize: true,
},
goerli: {
url: process.env.ETH_GOERLI_PROVIDER || "",
accounts: [GOERLI_PRIVATE_KEY],
gasPrice: "auto",
timeout: 1000000
},
mainnet: {
url: process.env.ETH_MAINNET_PROVIDER || "",
accounts: [MAINNET_PRIVATE_KEY],
gasPrice: "auto",
timeout: 1000000
},
arbitrum: {
url: process.env.ARBITRUM_ONE_PROVIDER || "https://arb1.arbitrum.io/rpc",
accounts: [ARBGOERLI_ONE_PRIVATE_KEY],
gasPrice: "auto",
timeout: 1000000
},
arbitrumGoerli: {
url: process.env.ARBITRUM_GOERLI_PROVIDER || "https://goerli-rollup.arbitrum.io/rpc",
accounts: [ARBGOERLI_GOERLI_PRIVATE_KEY],
gasPrice: "auto",
timeout: 1000000
},
optimisticGoerli:{
url: process.env.OPTIMISM_GOERLI_PROVIDER || "https://endpoints.omniatech.io/v1/op/goerli/public",
accounts: [OPGOERLI_PRIVATE_KEY],
gasPrice: "auto",
timeout: 1000000
},
optimistic:{
url: process.env.OPTIMISM_MAINNET_PROVIDER || "https://mainnet.optimism.io",
accounts: [OPTIMISM_PRIVATE_KEY],
gasPrice: "auto",
timeout: 1000000
}
},
etherscan: {
apiKey: {
optimisticEthereum: process.env.OPTIMISM_API_KEY || process.env.ETHERSCAN_API_KEY || "",
optimisticGoerli: process.env.OPTIMISM_API_KEY || process.env.ETHERSCAN_API_KEY || "",
arbitrumOne: process.env.ARBGOERLI_API_KEY || process.env.ETHERSCAN_API_KEY || "",
arbitrumGoerli: process.env.ARBGOERLI_API_KEY || process.env.ETHERSCAN_API_KEY || "",
goerli: process.env.GOERLI_API_KEY || process.env.ETHERSCAN_API_KEY || ""
}
},
paths: {
sources: "./contracts",
tests: "./test",
cache: "./cache",
artifacts: "./artifacts"
},
gasReporter: {
currency: 'USD',
coinmarketcap: process.env.COINMARKETCAP_API_KEY || "",
enabled: true
},
mocha: {
timeout: 100000000
}
};
export default config;