-
Notifications
You must be signed in to change notification settings - Fork 79
/
hardhat.config.ts
222 lines (218 loc) · 8.71 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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
import {
DETERMINISTIC_DEPLOYMENT,
DETERMINISTIC_FACTORIES,
ETHERSCAN_KEY,
getCommonNetworkConfig,
hardhatNetworkSettings,
loadTasks,
} from "./helpers/hardhat-config-helpers";
import {
eArbitrumNetwork,
eAvalancheNetwork,
eEthereumNetwork,
eFantomNetwork,
eHarmonyNetwork,
eOptimismNetwork,
ePolygonNetwork,
eBaseNetwork,
} from "./helpers/types";
import { DEFAULT_NAMED_ACCOUNTS } from "./helpers/constants";
import "@nomicfoundation/hardhat-toolbox";
import "hardhat-deploy";
import "hardhat-contract-sizer";
import "hardhat-dependency-compiler";
import "@nomicfoundation/hardhat-chai-matchers";
import "@nomiclabs/hardhat-etherscan";
const SKIP_LOAD = process.env.SKIP_LOAD === "true";
const TASK_FOLDERS = ["misc", "market-registry"];
// Prevent to load tasks before compilation and typechain
if (!SKIP_LOAD) {
loadTasks(TASK_FOLDERS);
}
export default {
contractSizer: {
alphaSort: true,
runOnCompile: false,
disambiguatePaths: false,
},
solidity: {
compilers: [
{
version: "0.8.10",
settings: {
optimizer: { enabled: true, runs: 100_000 },
evmVersion: "berlin",
},
},
{
version: "0.7.5",
settings: {
optimizer: { enabled: true, runs: 100_000 },
},
},
],
},
typechain: {
outDir: "typechain",
target: "ethers-v5",
},
networks: {
hardhat: hardhatNetworkSettings,
localhost: {
url: "http://127.0.0.1:8545",
...hardhatNetworkSettings,
},
tenderly: getCommonNetworkConfig("tenderly", 1),
main: getCommonNetworkConfig(eEthereumNetwork.main, 1),
kovan: getCommonNetworkConfig(eEthereumNetwork.kovan, 42),
rinkeby: getCommonNetworkConfig(eEthereumNetwork.rinkeby, 4),
ropsten: getCommonNetworkConfig(eEthereumNetwork.ropsten, 3),
[ePolygonNetwork.polygon]: getCommonNetworkConfig(
ePolygonNetwork.polygon,
137
),
[ePolygonNetwork.mumbai]: getCommonNetworkConfig(
ePolygonNetwork.mumbai,
80001
),
arbitrum: getCommonNetworkConfig(eArbitrumNetwork.arbitrum, 42161),
[eArbitrumNetwork.arbitrumTestnet]: getCommonNetworkConfig(
eArbitrumNetwork.arbitrumTestnet,
421611
),
[eHarmonyNetwork.main]: getCommonNetworkConfig(
eHarmonyNetwork.main,
1666600000
),
[eHarmonyNetwork.testnet]: getCommonNetworkConfig(
eHarmonyNetwork.testnet,
1666700000
),
[eAvalancheNetwork.avalanche]: getCommonNetworkConfig(
eAvalancheNetwork.avalanche,
43114
),
[eAvalancheNetwork.fuji]: getCommonNetworkConfig(
eAvalancheNetwork.fuji,
43113
),
[eFantomNetwork.main]: getCommonNetworkConfig(eFantomNetwork.main, 250),
[eFantomNetwork.testnet]: getCommonNetworkConfig(
eFantomNetwork.testnet,
4002
),
[eOptimismNetwork.testnet]: getCommonNetworkConfig(
eOptimismNetwork.testnet,
420
),
[eOptimismNetwork.main]: getCommonNetworkConfig(eOptimismNetwork.main, 10),
[eEthereumNetwork.goerli]: getCommonNetworkConfig(
eEthereumNetwork.goerli,
5
),
[eEthereumNetwork.sepolia]: getCommonNetworkConfig(
eEthereumNetwork.sepolia,
11155111
),
[eArbitrumNetwork.goerliNitro]: getCommonNetworkConfig(
eArbitrumNetwork.goerliNitro,
421613
),
[eBaseNetwork.base]: getCommonNetworkConfig(eBaseNetwork.base, 8453),
[eBaseNetwork.baseGoerli]: getCommonNetworkConfig(
eBaseNetwork.baseGoerli,
84531
),
},
namedAccounts: {
...DEFAULT_NAMED_ACCOUNTS,
},
mocha: {
timeout: 0,
},
dependencyCompiler: {
paths: [
"@aave/core-v3/contracts/protocol/configuration/PoolAddressesProviderRegistry.sol",
"@aave/core-v3/contracts/protocol/configuration/PoolAddressesProvider.sol",
"@aave/core-v3/contracts/misc/AaveOracle.sol",
"@aave/core-v3/contracts/protocol/tokenization/AToken.sol",
"@aave/core-v3/contracts/protocol/tokenization/DelegationAwareAToken.sol",
"@aave/core-v3/contracts/protocol/tokenization/StableDebtToken.sol",
"@aave/core-v3/contracts/protocol/tokenization/VariableDebtToken.sol",
"@aave/core-v3/contracts/protocol/libraries/logic/GenericLogic.sol",
"@aave/core-v3/contracts/protocol/libraries/logic/ValidationLogic.sol",
"@aave/core-v3/contracts/protocol/libraries/logic/ReserveLogic.sol",
"@aave/core-v3/contracts/protocol/libraries/logic/SupplyLogic.sol",
"@aave/core-v3/contracts/protocol/libraries/logic/EModeLogic.sol",
"@aave/core-v3/contracts/protocol/libraries/logic/BorrowLogic.sol",
"@aave/core-v3/contracts/protocol/libraries/logic/BridgeLogic.sol",
"@aave/core-v3/contracts/protocol/libraries/logic/FlashLoanLogic.sol",
"@aave/core-v3/contracts/protocol/libraries/logic/CalldataLogic.sol",
"@aave/core-v3/contracts/protocol/pool/Pool.sol",
"@aave/core-v3/contracts/protocol/pool/L2Pool.sol",
"@aave/core-v3/contracts/protocol/pool/PoolConfigurator.sol",
"@aave/core-v3/contracts/protocol/pool/DefaultReserveInterestRateStrategy.sol",
"@aave/core-v3/contracts/protocol/libraries/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol",
"@aave/core-v3/contracts/dependencies/openzeppelin/upgradeability/InitializableAdminUpgradeabilityProxy.sol",
"@aave/core-v3/contracts/deployments/ReservesSetupHelper.sol",
"@aave/core-v3/contracts/misc/AaveProtocolDataProvider.sol",
"@aave/core-v3/contracts/misc/L2Encoder.sol",
"@aave/core-v3/contracts/protocol/configuration/ACLManager.sol",
"@aave/core-v3/contracts/dependencies/weth/WETH9.sol",
"@aave/core-v3/contracts/mocks/helpers/MockIncentivesController.sol",
"@aave/core-v3/contracts/mocks/helpers/MockReserveConfiguration.sol",
"@aave/core-v3/contracts/mocks/oracle/CLAggregators/MockAggregator.sol",
"@aave/core-v3/contracts/mocks/tokens/MintableERC20.sol",
"@aave/core-v3/contracts/mocks/flashloan/MockFlashLoanReceiver.sol",
"@aave/core-v3/contracts/mocks/tokens/WETH9Mocked.sol",
"@aave/core-v3/contracts/mocks/upgradeability/MockVariableDebtToken.sol",
"@aave/core-v3/contracts/mocks/upgradeability/MockAToken.sol",
"@aave/core-v3/contracts/mocks/upgradeability/MockStableDebtToken.sol",
"@aave/core-v3/contracts/mocks/upgradeability/MockInitializableImplementation.sol",
"@aave/core-v3/contracts/mocks/helpers/MockPool.sol",
"@aave/core-v3/contracts/mocks/helpers/MockL2Pool.sol",
"@aave/core-v3/contracts/dependencies/openzeppelin/contracts/IERC20Detailed.sol",
"@aave/core-v3/contracts/dependencies/openzeppelin/contracts/IERC20.sol",
"@aave/core-v3/contracts/mocks/oracle/PriceOracle.sol",
"@aave/core-v3/contracts/mocks/tokens/MintableDelegationERC20.sol",
"@aave/periphery-v3/contracts/misc/UiPoolDataProviderV3.sol",
"@aave/periphery-v3/contracts/misc/WalletBalanceProvider.sol",
"@aave/periphery-v3/contracts/misc/WrappedTokenGatewayV3.sol",
"@aave/periphery-v3/contracts/misc/interfaces/IWETH.sol",
"@aave/periphery-v3/contracts/misc/UiIncentiveDataProviderV3.sol",
"@aave/periphery-v3/contracts/rewards/RewardsController.sol",
"@aave/periphery-v3/contracts/rewards/transfer-strategies/StakedTokenTransferStrategy.sol",
"@aave/periphery-v3/contracts/rewards/transfer-strategies/PullRewardsTransferStrategy.sol",
"@aave/periphery-v3/contracts/rewards/EmissionManager.sol",
"@aave/periphery-v3/contracts/mocks/WETH9Mock.sol",
"@aave/periphery-v3/contracts/mocks/testnet-helpers/Faucet.sol",
"@aave/periphery-v3/contracts/mocks/testnet-helpers/TestnetERC20.sol",
"@aave/periphery-v3/contracts/treasury/Collector.sol",
"@aave/periphery-v3/contracts/treasury/CollectorController.sol",
"@aave/periphery-v3/contracts/treasury/AaveEcosystemReserveV2.sol",
"@aave/periphery-v3/contracts/treasury/AaveEcosystemReserveController.sol",
"@aave/periphery-v3/contracts/adapters/paraswap/ParaSwapLiquiditySwapAdapter.sol",
"@aave/periphery-v3/contracts/adapters/paraswap/ParaSwapRepayAdapter.sol",
"@aave/periphery-v3/contracts/adapters/paraswap/ParaSwapWithdrawSwapAdapter.sol",
"@aave/safety-module/contracts/stake/StakedAave.sol",
"@aave/safety-module/contracts/stake/StakedAaveV2.sol",
"@aave/safety-module/contracts/proposals/extend-stkaave-distribution/StakedTokenV2Rev3.sol",
],
},
deterministicDeployment: DETERMINISTIC_DEPLOYMENT
? DETERMINISTIC_FACTORIES
: undefined,
etherscan: {
apiKey: ETHERSCAN_KEY,
customChains: [
{
network: eBaseNetwork.base,
chainId: 8453,
urls: {
apiURL: "https://api.basescan.org/api",
browserURL: "https://basescan.org/",
},
},
],
},
};