hardhat 2.11.0-dev.0 → 2.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (406) hide show
  1. package/builtin-tasks/clean.js +2 -1
  2. package/builtin-tasks/clean.js.map +1 -1
  3. package/builtin-tasks/compile.js +52 -95
  4. package/builtin-tasks/compile.js.map +1 -1
  5. package/builtin-tasks/flatten.js +2 -21
  6. package/builtin-tasks/flatten.js.map +1 -1
  7. package/builtin-tasks/node.js +1 -1
  8. package/builtin-tasks/node.js.map +1 -1
  9. package/builtin-tasks/test.js +3 -3
  10. package/builtin-tasks/test.js.map +1 -1
  11. package/builtin-tasks/utils/solidity-files-cache.d.ts.map +1 -1
  12. package/builtin-tasks/utils/solidity-files-cache.js +5 -6
  13. package/builtin-tasks/utils/solidity-files-cache.js.map +1 -1
  14. package/internal/artifacts.d.ts +3 -11
  15. package/internal/artifacts.d.ts.map +1 -1
  16. package/internal/artifacts.js +266 -133
  17. package/internal/artifacts.js.map +1 -1
  18. package/internal/cli/cli.js +26 -12
  19. package/internal/cli/cli.js.map +1 -1
  20. package/internal/core/config/config-loading.js +2 -2
  21. package/internal/core/config/config-loading.js.map +1 -1
  22. package/internal/core/config/config-resolution.d.ts.map +1 -1
  23. package/internal/core/config/config-resolution.js +11 -31
  24. package/internal/core/config/config-resolution.js.map +1 -1
  25. package/internal/core/config/default-config.js +1 -1
  26. package/internal/core/config/default-config.js.map +1 -1
  27. package/internal/core/errors-list.d.ts +7 -0
  28. package/internal/core/errors-list.d.ts.map +1 -1
  29. package/internal/core/errors-list.js +28 -11
  30. package/internal/core/errors-list.js.map +1 -1
  31. package/internal/core/errors.d.ts +2 -1
  32. package/internal/core/errors.d.ts.map +1 -1
  33. package/internal/core/errors.js +5 -1
  34. package/internal/core/errors.js.map +1 -1
  35. package/internal/core/execution-mode.d.ts.map +1 -1
  36. package/internal/core/execution-mode.js +2 -21
  37. package/internal/core/execution-mode.js.map +1 -1
  38. package/internal/core/flamegraph.d.ts +4 -0
  39. package/internal/core/flamegraph.d.ts.map +1 -1
  40. package/internal/core/flamegraph.js +13 -3
  41. package/internal/core/flamegraph.js.map +1 -1
  42. package/internal/core/jsonrpc/types/base-types.d.ts.map +1 -1
  43. package/internal/core/jsonrpc/types/base-types.js +12 -12
  44. package/internal/core/jsonrpc/types/base-types.js.map +1 -1
  45. package/internal/core/params/hardhat-params.d.ts.map +1 -1
  46. package/internal/core/params/hardhat-params.js +18 -0
  47. package/internal/core/params/hardhat-params.js.map +1 -1
  48. package/internal/core/providers/accounts.js +9 -9
  49. package/internal/core/providers/accounts.js.map +1 -1
  50. package/internal/core/providers/construction.d.ts.map +1 -1
  51. package/internal/core/providers/construction.js +5 -6
  52. package/internal/core/providers/construction.js.map +1 -1
  53. package/internal/core/providers/gas-providers.d.ts +2 -2
  54. package/internal/core/providers/util.js +1 -1
  55. package/internal/core/providers/util.js.map +1 -1
  56. package/internal/core/runtime-environment.d.ts +6 -0
  57. package/internal/core/runtime-environment.d.ts.map +1 -1
  58. package/internal/core/runtime-environment.js +72 -6
  59. package/internal/core/runtime-environment.js.map +1 -1
  60. package/internal/core/typescript-support.d.ts +1 -1
  61. package/internal/core/typescript-support.d.ts.map +1 -1
  62. package/internal/core/typescript-support.js +6 -2
  63. package/internal/core/typescript-support.js.map +1 -1
  64. package/internal/hardhat-network/jsonrpc/client.d.ts +1 -1
  65. package/internal/hardhat-network/jsonrpc/client.d.ts.map +1 -1
  66. package/internal/hardhat-network/jsonrpc/client.js +10 -10
  67. package/internal/hardhat-network/jsonrpc/client.js.map +1 -1
  68. package/internal/hardhat-network/provider/BlockchainBase.d.ts +4 -4
  69. package/internal/hardhat-network/provider/BlockchainBase.d.ts.map +1 -1
  70. package/internal/hardhat-network/provider/BlockchainBase.js +31 -12
  71. package/internal/hardhat-network/provider/BlockchainBase.js.map +1 -1
  72. package/internal/hardhat-network/provider/BlockchainData.d.ts +3 -3
  73. package/internal/hardhat-network/provider/BlockchainData.d.ts.map +1 -1
  74. package/internal/hardhat-network/provider/BlockchainData.js +15 -15
  75. package/internal/hardhat-network/provider/BlockchainData.js.map +1 -1
  76. package/internal/hardhat-network/provider/HardhatBlockchain.d.ts +3 -3
  77. package/internal/hardhat-network/provider/HardhatBlockchain.d.ts.map +1 -1
  78. package/internal/hardhat-network/provider/HardhatBlockchain.js +2 -2
  79. package/internal/hardhat-network/provider/HardhatBlockchain.js.map +1 -1
  80. package/internal/hardhat-network/provider/PoolState.d.ts +1 -1
  81. package/internal/hardhat-network/provider/PoolState.d.ts.map +1 -1
  82. package/internal/hardhat-network/provider/PoolState.js +21 -2
  83. package/internal/hardhat-network/provider/PoolState.js.map +1 -1
  84. package/internal/hardhat-network/provider/TransactionQueue.d.ts +1 -1
  85. package/internal/hardhat-network/provider/TransactionQueue.d.ts.map +1 -1
  86. package/internal/hardhat-network/provider/TransactionQueue.js +22 -3
  87. package/internal/hardhat-network/provider/TransactionQueue.js.map +1 -1
  88. package/internal/hardhat-network/provider/TxPool.d.ts +4 -4
  89. package/internal/hardhat-network/provider/TxPool.d.ts.map +1 -1
  90. package/internal/hardhat-network/provider/TxPool.js +35 -16
  91. package/internal/hardhat-network/provider/TxPool.js.map +1 -1
  92. package/internal/hardhat-network/provider/ethereumjs-workarounds.js +4 -4
  93. package/internal/hardhat-network/provider/ethereumjs-workarounds.js.map +1 -1
  94. package/internal/hardhat-network/provider/filter.d.ts +1 -1
  95. package/internal/hardhat-network/provider/filter.d.ts.map +1 -1
  96. package/internal/hardhat-network/provider/filter.js +3 -3
  97. package/internal/hardhat-network/provider/filter.js.map +1 -1
  98. package/internal/hardhat-network/provider/fork/ForkBlockchain.d.ts +3 -3
  99. package/internal/hardhat-network/provider/fork/ForkBlockchain.d.ts.map +1 -1
  100. package/internal/hardhat-network/provider/fork/ForkBlockchain.js +13 -12
  101. package/internal/hardhat-network/provider/fork/ForkBlockchain.js.map +1 -1
  102. package/internal/hardhat-network/provider/fork/ForkStateManager.d.ts +3 -5
  103. package/internal/hardhat-network/provider/fork/ForkStateManager.d.ts.map +1 -1
  104. package/internal/hardhat-network/provider/fork/ForkStateManager.js +36 -40
  105. package/internal/hardhat-network/provider/fork/ForkStateManager.js.map +1 -1
  106. package/internal/hardhat-network/provider/fork/rpcToBlockData.d.ts +1 -1
  107. package/internal/hardhat-network/provider/fork/rpcToBlockData.d.ts.map +1 -1
  108. package/internal/hardhat-network/provider/fork/rpcToTxData.d.ts +2 -2
  109. package/internal/hardhat-network/provider/fork/rpcToTxData.d.ts.map +1 -1
  110. package/internal/hardhat-network/provider/fork/rpcToTxData.js.map +1 -1
  111. package/internal/hardhat-network/provider/modules/eth.d.ts +1 -1
  112. package/internal/hardhat-network/provider/modules/eth.d.ts.map +1 -1
  113. package/internal/hardhat-network/provider/modules/eth.js +22 -22
  114. package/internal/hardhat-network/provider/modules/eth.js.map +1 -1
  115. package/internal/hardhat-network/provider/modules/hardhat.d.ts +2 -0
  116. package/internal/hardhat-network/provider/modules/hardhat.d.ts.map +1 -1
  117. package/internal/hardhat-network/provider/modules/hardhat.js +20 -6
  118. package/internal/hardhat-network/provider/modules/hardhat.js.map +1 -1
  119. package/internal/hardhat-network/provider/modules/logger.d.ts +2 -2
  120. package/internal/hardhat-network/provider/modules/logger.d.ts.map +1 -1
  121. package/internal/hardhat-network/provider/modules/logger.js +14 -14
  122. package/internal/hardhat-network/provider/modules/logger.js.map +1 -1
  123. package/internal/hardhat-network/provider/modules/net.d.ts +1 -1
  124. package/internal/hardhat-network/provider/modules/net.d.ts.map +1 -1
  125. package/internal/hardhat-network/provider/modules/personal.js +3 -3
  126. package/internal/hardhat-network/provider/modules/personal.js.map +1 -1
  127. package/internal/hardhat-network/provider/modules/web3.d.ts.map +1 -1
  128. package/internal/hardhat-network/provider/modules/web3.js +4 -5
  129. package/internal/hardhat-network/provider/modules/web3.js.map +1 -1
  130. package/internal/hardhat-network/provider/node-types.d.ts +4 -4
  131. package/internal/hardhat-network/provider/node-types.d.ts.map +1 -1
  132. package/internal/hardhat-network/provider/node.d.ts +5 -4
  133. package/internal/hardhat-network/provider/node.d.ts.map +1 -1
  134. package/internal/hardhat-network/provider/node.js +71 -49
  135. package/internal/hardhat-network/provider/node.js.map +1 -1
  136. package/internal/hardhat-network/provider/output.d.ts +4 -4
  137. package/internal/hardhat-network/provider/output.d.ts.map +1 -1
  138. package/internal/hardhat-network/provider/output.js +24 -5
  139. package/internal/hardhat-network/provider/output.js.map +1 -1
  140. package/internal/hardhat-network/provider/provider.d.ts +2 -2
  141. package/internal/hardhat-network/provider/provider.d.ts.map +1 -1
  142. package/internal/hardhat-network/provider/provider.js +3 -3
  143. package/internal/hardhat-network/provider/provider.js.map +1 -1
  144. package/internal/hardhat-network/provider/return-data.d.ts +1 -1
  145. package/internal/hardhat-network/provider/return-data.d.ts.map +1 -1
  146. package/internal/hardhat-network/provider/return-data.js +5 -4
  147. package/internal/hardhat-network/provider/return-data.js.map +1 -1
  148. package/internal/hardhat-network/provider/transactions/FakeSenderAccessListEIP2930Transaction.d.ts +4 -4
  149. package/internal/hardhat-network/provider/transactions/FakeSenderAccessListEIP2930Transaction.d.ts.map +1 -1
  150. package/internal/hardhat-network/provider/transactions/FakeSenderAccessListEIP2930Transaction.js +8 -8
  151. package/internal/hardhat-network/provider/transactions/FakeSenderAccessListEIP2930Transaction.js.map +1 -1
  152. package/internal/hardhat-network/provider/transactions/FakeSenderEIP1559Transaction.d.ts +3 -3
  153. package/internal/hardhat-network/provider/transactions/FakeSenderEIP1559Transaction.d.ts.map +1 -1
  154. package/internal/hardhat-network/provider/transactions/FakeSenderEIP1559Transaction.js +8 -8
  155. package/internal/hardhat-network/provider/transactions/FakeSenderEIP1559Transaction.js.map +1 -1
  156. package/internal/hardhat-network/provider/transactions/FakeSenderTransaction.d.ts +3 -3
  157. package/internal/hardhat-network/provider/transactions/FakeSenderTransaction.d.ts.map +1 -1
  158. package/internal/hardhat-network/provider/transactions/FakeSenderTransaction.js +5 -5
  159. package/internal/hardhat-network/provider/transactions/FakeSenderTransaction.js.map +1 -1
  160. package/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP1559Transaction.d.ts +4 -4
  161. package/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP1559Transaction.d.ts.map +1 -1
  162. package/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP1559Transaction.js +25 -6
  163. package/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP1559Transaction.js.map +1 -1
  164. package/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP2930Transaction.d.ts +3 -3
  165. package/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP2930Transaction.d.ts.map +1 -1
  166. package/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP2930Transaction.js +25 -6
  167. package/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP2930Transaction.js.map +1 -1
  168. package/internal/hardhat-network/provider/transactions/ReadOnlyValidTransaction.d.ts +3 -3
  169. package/internal/hardhat-network/provider/transactions/ReadOnlyValidTransaction.d.ts.map +1 -1
  170. package/internal/hardhat-network/provider/transactions/ReadOnlyValidTransaction.js +2 -2
  171. package/internal/hardhat-network/provider/transactions/ReadOnlyValidTransaction.js.map +1 -1
  172. package/internal/hardhat-network/provider/types/HardhatBlockchainInterface.d.ts +2 -2
  173. package/internal/hardhat-network/provider/types/HardhatBlockchainInterface.d.ts.map +1 -1
  174. package/internal/hardhat-network/provider/utils/makeAccount.d.ts +1 -1
  175. package/internal/hardhat-network/provider/utils/makeAccount.d.ts.map +1 -1
  176. package/internal/hardhat-network/provider/utils/makeAccount.js +4 -4
  177. package/internal/hardhat-network/provider/utils/makeAccount.js.map +1 -1
  178. package/internal/hardhat-network/provider/utils/makeCommon.d.ts +1 -1
  179. package/internal/hardhat-network/provider/utils/makeCommon.d.ts.map +1 -1
  180. package/internal/hardhat-network/provider/utils/makeCommon.js +2 -2
  181. package/internal/hardhat-network/provider/utils/makeCommon.js.map +1 -1
  182. package/internal/hardhat-network/provider/utils/makeStateTrie.d.ts +1 -1
  183. package/internal/hardhat-network/provider/utils/makeStateTrie.d.ts.map +1 -1
  184. package/internal/hardhat-network/provider/utils/makeStateTrie.js +4 -4
  185. package/internal/hardhat-network/provider/utils/makeStateTrie.js.map +1 -1
  186. package/internal/hardhat-network/provider/utils/putGenesisBlock.d.ts +3 -3
  187. package/internal/hardhat-network/provider/utils/putGenesisBlock.d.ts.map +1 -1
  188. package/internal/hardhat-network/provider/utils/putGenesisBlock.js +4 -4
  189. package/internal/hardhat-network/provider/utils/putGenesisBlock.js.map +1 -1
  190. package/internal/hardhat-network/provider/utils/random.d.ts +2 -1
  191. package/internal/hardhat-network/provider/utils/random.d.ts.map +1 -1
  192. package/internal/hardhat-network/provider/utils/random.js +10 -9
  193. package/internal/hardhat-network/provider/utils/random.js.map +1 -1
  194. package/internal/hardhat-network/provider/utils/reorganizeTransactionsLists.js +21 -2
  195. package/internal/hardhat-network/provider/utils/reorganizeTransactionsLists.js.map +1 -1
  196. package/internal/hardhat-network/provider/utils/txMapToArray.d.ts +1 -1
  197. package/internal/hardhat-network/provider/utils/txMapToArray.d.ts.map +1 -1
  198. package/internal/hardhat-network/stack-traces/consoleLogger.js +45 -45
  199. package/internal/hardhat-network/stack-traces/consoleLogger.js.map +1 -1
  200. package/internal/hardhat-network/stack-traces/constants.d.ts +1 -1
  201. package/internal/hardhat-network/stack-traces/constants.d.ts.map +1 -1
  202. package/internal/hardhat-network/stack-traces/constants.js +1 -1
  203. package/internal/hardhat-network/stack-traces/constants.js.map +1 -1
  204. package/internal/hardhat-network/stack-traces/contracts-identifier.js +2 -2
  205. package/internal/hardhat-network/stack-traces/contracts-identifier.js.map +1 -1
  206. package/internal/hardhat-network/stack-traces/debug.js +13 -13
  207. package/internal/hardhat-network/stack-traces/debug.js.map +1 -1
  208. package/internal/hardhat-network/stack-traces/error-inferrer.js +2 -2
  209. package/internal/hardhat-network/stack-traces/error-inferrer.js.map +1 -1
  210. package/internal/hardhat-network/stack-traces/message-trace.d.ts +1 -1
  211. package/internal/hardhat-network/stack-traces/message-trace.d.ts.map +1 -1
  212. package/internal/hardhat-network/stack-traces/model.js +6 -6
  213. package/internal/hardhat-network/stack-traces/model.js.map +1 -1
  214. package/internal/hardhat-network/stack-traces/panic-errors.d.ts +1 -1
  215. package/internal/hardhat-network/stack-traces/panic-errors.js +9 -9
  216. package/internal/hardhat-network/stack-traces/panic-errors.js.map +1 -1
  217. package/internal/hardhat-network/stack-traces/solidity-errors.js +3 -3
  218. package/internal/hardhat-network/stack-traces/solidity-errors.js.map +1 -1
  219. package/internal/hardhat-network/stack-traces/solidity-stack-trace.d.ts +1 -1
  220. package/internal/hardhat-network/stack-traces/solidityTracer.d.ts +0 -2
  221. package/internal/hardhat-network/stack-traces/solidityTracer.d.ts.map +1 -1
  222. package/internal/hardhat-network/stack-traces/solidityTracer.js +2 -4
  223. package/internal/hardhat-network/stack-traces/solidityTracer.js.map +1 -1
  224. package/internal/hardhat-network/stack-traces/vm-debug-tracer.d.ts +1 -1
  225. package/internal/hardhat-network/stack-traces/vm-debug-tracer.d.ts.map +1 -1
  226. package/internal/hardhat-network/stack-traces/vm-debug-tracer.js +27 -25
  227. package/internal/hardhat-network/stack-traces/vm-debug-tracer.js.map +1 -1
  228. package/internal/hardhat-network/stack-traces/vm-tracer.d.ts +2 -2
  229. package/internal/hardhat-network/stack-traces/vm-tracer.d.ts.map +1 -1
  230. package/internal/hardhat-network/stack-traces/vm-tracer.js +15 -12
  231. package/internal/hardhat-network/stack-traces/vm-tracer.js.map +1 -1
  232. package/internal/lib/hardhat-lib.d.ts.map +1 -1
  233. package/internal/lib/hardhat-lib.js +0 -2
  234. package/internal/lib/hardhat-lib.js.map +1 -1
  235. package/internal/solidity/compilation-job.d.ts.map +1 -1
  236. package/internal/solidity/compilation-job.js +6 -7
  237. package/internal/solidity/compilation-job.js.map +1 -1
  238. package/internal/solidity/compiler/downloader.d.ts +66 -40
  239. package/internal/solidity/compiler/downloader.d.ts.map +1 -1
  240. package/internal/solidity/compiler/downloader.js +180 -154
  241. package/internal/solidity/compiler/downloader.js.map +1 -1
  242. package/internal/solidity/compiler/index.d.ts +8 -4
  243. package/internal/solidity/compiler/index.d.ts.map +1 -1
  244. package/internal/solidity/compiler/index.js +1 -1
  245. package/internal/solidity/compiler/index.js.map +1 -1
  246. package/internal/solidity/dependencyGraph.d.ts.map +1 -1
  247. package/internal/solidity/dependencyGraph.js +3 -5
  248. package/internal/solidity/dependencyGraph.js.map +1 -1
  249. package/internal/solidity/parse.d.ts.map +1 -1
  250. package/internal/solidity/parse.js +2 -58
  251. package/internal/solidity/parse.js.map +1 -1
  252. package/internal/solidity/resolver.d.ts +1 -0
  253. package/internal/solidity/resolver.d.ts.map +1 -1
  254. package/internal/solidity/resolver.js +33 -8
  255. package/internal/solidity/resolver.js.map +1 -1
  256. package/internal/util/bigint.d.ts +13 -24
  257. package/internal/util/bigint.d.ts.map +1 -1
  258. package/internal/util/bigint.js +22 -29
  259. package/internal/util/bigint.js.map +1 -1
  260. package/internal/util/download.d.ts.map +1 -1
  261. package/internal/util/download.js +1 -1
  262. package/internal/util/download.js.map +1 -1
  263. package/internal/util/fs-utils.d.ts +26 -9
  264. package/internal/util/fs-utils.d.ts.map +1 -1
  265. package/internal/util/fs-utils.js +111 -68
  266. package/internal/util/fs-utils.js.map +1 -1
  267. package/internal/util/glob.d.ts +13 -0
  268. package/internal/util/glob.d.ts.map +1 -1
  269. package/internal/util/glob.js +13 -0
  270. package/internal/util/glob.js.map +1 -1
  271. package/internal/util/keccak.d.ts +3 -0
  272. package/internal/util/keccak.d.ts.map +1 -0
  273. package/internal/util/keccak.js +12 -0
  274. package/internal/util/keccak.js.map +1 -0
  275. package/internal/util/scripts-runner.d.ts.map +1 -1
  276. package/internal/util/scripts-runner.js +7 -4
  277. package/internal/util/scripts-runner.js.map +1 -1
  278. package/package.json +15 -15
  279. package/register.js +1 -3
  280. package/register.js.map +1 -1
  281. package/sample-projects/javascript/contracts/Lock.sol +3 -3
  282. package/sample-projects/typescript/contracts/Lock.sol +3 -3
  283. package/src/builtin-tasks/clean.ts +9 -6
  284. package/src/builtin-tasks/compile.ts +96 -128
  285. package/src/builtin-tasks/flatten.ts +2 -3
  286. package/src/builtin-tasks/node.ts +2 -2
  287. package/src/builtin-tasks/test.ts +7 -3
  288. package/src/builtin-tasks/utils/solidity-files-cache.ts +9 -8
  289. package/src/internal/artifacts.ts +392 -182
  290. package/src/internal/cli/cli.ts +43 -17
  291. package/src/internal/core/config/config-loading.ts +1 -1
  292. package/src/internal/core/config/config-resolution.ts +12 -24
  293. package/src/internal/core/config/default-config.ts +1 -1
  294. package/src/internal/core/errors-list.ts +29 -13
  295. package/src/internal/core/errors.ts +10 -2
  296. package/src/internal/core/execution-mode.ts +2 -3
  297. package/src/internal/core/flamegraph.ts +270 -0
  298. package/src/internal/core/jsonrpc/types/base-types.ts +7 -3
  299. package/src/internal/core/params/hardhat-params.ts +18 -0
  300. package/src/internal/core/providers/accounts.ts +8 -8
  301. package/src/internal/core/providers/construction.ts +10 -8
  302. package/src/internal/core/providers/gas-providers.ts +2 -2
  303. package/src/internal/core/providers/util.ts +1 -1
  304. package/src/internal/core/runtime-environment.ts +103 -10
  305. package/src/internal/core/task-profiling.ts +56 -0
  306. package/src/internal/core/typescript-support.ts +11 -2
  307. package/src/internal/hardhat-network/jsonrpc/client.ts +1 -1
  308. package/src/internal/hardhat-network/provider/BlockchainBase.ts +6 -6
  309. package/src/internal/hardhat-network/provider/BlockchainData.ts +5 -5
  310. package/src/internal/hardhat-network/provider/HardhatBlockchain.ts +4 -4
  311. package/src/internal/hardhat-network/provider/PoolState.ts +2 -2
  312. package/src/internal/hardhat-network/provider/TransactionQueue.ts +2 -2
  313. package/src/internal/hardhat-network/provider/TxPool.ts +12 -5
  314. package/src/internal/hardhat-network/provider/ethereumjs-workarounds.ts +3 -3
  315. package/src/internal/hardhat-network/provider/filter.ts +2 -2
  316. package/src/internal/hardhat-network/provider/fork/ForkBlockchain.ts +10 -10
  317. package/src/internal/hardhat-network/provider/fork/ForkStateManager.ts +12 -18
  318. package/src/internal/hardhat-network/provider/fork/rpcToBlockData.ts +1 -1
  319. package/src/internal/hardhat-network/provider/fork/rpcToTxData.ts +5 -2
  320. package/src/internal/hardhat-network/provider/modules/eth.ts +10 -6
  321. package/src/internal/hardhat-network/provider/modules/hardhat.ts +25 -1
  322. package/src/internal/hardhat-network/provider/modules/logger.ts +3 -3
  323. package/src/internal/hardhat-network/provider/modules/net.ts +1 -1
  324. package/src/internal/hardhat-network/provider/modules/personal.ts +1 -1
  325. package/src/internal/hardhat-network/provider/modules/web3.ts +4 -6
  326. package/src/internal/hardhat-network/provider/node-types.ts +6 -6
  327. package/src/internal/hardhat-network/provider/node.ts +25 -12
  328. package/src/internal/hardhat-network/provider/output.ts +6 -6
  329. package/src/internal/hardhat-network/provider/provider.ts +7 -6
  330. package/src/internal/hardhat-network/provider/return-data.ts +9 -5
  331. package/src/internal/hardhat-network/provider/transactions/FakeSenderAccessListEIP2930Transaction.ts +9 -5
  332. package/src/internal/hardhat-network/provider/transactions/FakeSenderEIP1559Transaction.ts +8 -4
  333. package/src/internal/hardhat-network/provider/transactions/FakeSenderTransaction.ts +4 -4
  334. package/src/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP1559Transaction.ts +8 -5
  335. package/src/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP2930Transaction.ts +4 -4
  336. package/src/internal/hardhat-network/provider/transactions/ReadOnlyValidTransaction.ts +3 -3
  337. package/src/internal/hardhat-network/provider/types/HardhatBlockchainInterface.ts +2 -2
  338. package/src/internal/hardhat-network/provider/utils/makeAccount.ts +6 -1
  339. package/src/internal/hardhat-network/provider/utils/makeCommon.ts +1 -1
  340. package/src/internal/hardhat-network/provider/utils/makeStateTrie.ts +7 -3
  341. package/src/internal/hardhat-network/provider/utils/putGenesisBlock.ts +6 -6
  342. package/src/internal/hardhat-network/provider/utils/random.ts +17 -14
  343. package/src/internal/hardhat-network/provider/utils/reorganizeTransactionsLists.ts +1 -1
  344. package/src/internal/hardhat-network/stack-traces/consoleLogger.ts +1 -1
  345. package/src/internal/hardhat-network/stack-traces/constants.ts +2 -0
  346. package/src/internal/hardhat-network/stack-traces/contracts-identifier.ts +1 -1
  347. package/src/internal/hardhat-network/stack-traces/debug.ts +1 -1
  348. package/src/internal/hardhat-network/stack-traces/error-inferrer.ts +3 -3
  349. package/src/internal/hardhat-network/stack-traces/message-trace.ts +1 -1
  350. package/src/internal/hardhat-network/stack-traces/model.ts +1 -1
  351. package/src/internal/hardhat-network/stack-traces/panic-errors.ts +11 -11
  352. package/src/internal/hardhat-network/stack-traces/solidity-errors.ts +1 -1
  353. package/src/internal/hardhat-network/stack-traces/solidity-stack-trace.ts +1 -1
  354. package/src/internal/hardhat-network/stack-traces/solidityTracer.ts +1 -4
  355. package/src/internal/hardhat-network/stack-traces/vm-debug-tracer.ts +31 -17
  356. package/src/internal/hardhat-network/stack-traces/vm-tracer.ts +29 -14
  357. package/src/internal/lib/hardhat-lib.ts +0 -3
  358. package/src/internal/solidity/compilation-job.ts +11 -11
  359. package/src/internal/solidity/compiler/downloader.ts +271 -243
  360. package/src/internal/solidity/compiler/index.ts +13 -7
  361. package/src/internal/solidity/dependencyGraph.ts +12 -8
  362. package/src/internal/solidity/parse.ts +4 -70
  363. package/src/internal/solidity/resolver.ts +36 -8
  364. package/src/internal/util/bigint.ts +25 -43
  365. package/src/internal/util/download.ts +2 -2
  366. package/src/internal/util/fs-utils.ts +223 -0
  367. package/src/internal/util/glob.ts +13 -0
  368. package/src/internal/util/keccak.ts +5 -0
  369. package/src/internal/util/scripts-runner.ts +13 -4
  370. package/src/internal/util/wei-values.ts +1 -1
  371. package/src/internal/{hardhat-network/vendor → vendor}/await-semaphore/index.ts +0 -0
  372. package/src/profiling.ts +37 -0
  373. package/src/register.ts +1 -4
  374. package/src/types/artifacts.ts +21 -0
  375. package/src/types/config.ts +7 -7
  376. package/src/types/runtime.ts +2 -0
  377. package/src/utils/source-names.ts +36 -26
  378. package/types/artifacts.d.ts +19 -0
  379. package/types/artifacts.d.ts.map +1 -1
  380. package/types/config.d.ts +7 -7
  381. package/types/runtime.d.ts +2 -0
  382. package/types/runtime.d.ts.map +1 -1
  383. package/utils/source-names.d.ts.map +1 -1
  384. package/utils/source-names.js +25 -36
  385. package/utils/source-names.js.map +1 -1
  386. package/internal/hardhat-network/provider/fork/random.d.ts +0 -7
  387. package/internal/hardhat-network/provider/fork/random.d.ts.map +0 -1
  388. package/internal/hardhat-network/provider/fork/random.js +0 -32
  389. package/internal/hardhat-network/provider/fork/random.js.map +0 -1
  390. package/internal/hardhat-network/provider/utils/bnToHex.d.ts +0 -3
  391. package/internal/hardhat-network/provider/utils/bnToHex.d.ts.map +0 -1
  392. package/internal/hardhat-network/provider/utils/bnToHex.js +0 -9
  393. package/internal/hardhat-network/provider/utils/bnToHex.js.map +0 -1
  394. package/internal/hardhat-network/provider/utils/makeForkCommon.d.ts +0 -4
  395. package/internal/hardhat-network/provider/utils/makeForkCommon.d.ts.map +0 -1
  396. package/internal/hardhat-network/provider/utils/makeForkCommon.js +0 -16
  397. package/internal/hardhat-network/provider/utils/makeForkCommon.js.map +0 -1
  398. package/internal/hardhat-network/vendor/await-semaphore/index.d.ts +0 -12
  399. package/internal/hardhat-network/vendor/await-semaphore/index.d.ts.map +0 -1
  400. package/internal/hardhat-network/vendor/await-semaphore/index.js +0 -64
  401. package/internal/hardhat-network/vendor/await-semaphore/index.js.map +0 -1
  402. package/internal/util/antlr-prototype-pollution-workaround.d.ts +0 -16
  403. package/internal/util/antlr-prototype-pollution-workaround.d.ts.map +0 -1
  404. package/internal/util/antlr-prototype-pollution-workaround.js +0 -22
  405. package/internal/util/antlr-prototype-pollution-workaround.js.map +0 -1
  406. package/src/internal/util/antlr-prototype-pollution-workaround.ts +0 -17
@@ -3,7 +3,7 @@ import {
3
3
  bufferToHex,
4
4
  bufferToInt,
5
5
  fromSigned,
6
- } from "@ignored/util";
6
+ } from "@nomicfoundation/ethereumjs-util";
7
7
  import util from "util";
8
8
 
9
9
  import {
@@ -0,0 +1,2 @@
1
+ export const SUPPORTED_SOLIDITY_VERSION_RANGE = "<=0.8.16";
2
+ export const FIRST_SOLC_VERSION_SUPPORTED = "0.5.1";
@@ -1,4 +1,4 @@
1
- import { bufferToHex } from "@ignored/util";
1
+ import { bufferToHex } from "@nomicfoundation/ethereumjs-util";
2
2
 
3
3
  import {
4
4
  normalizeLibraryRuntimeBytecodeIfNecessary,
@@ -1,4 +1,4 @@
1
- import { bufferToHex } from "@ignored/util";
1
+ import { bufferToHex } from "@nomicfoundation/ethereumjs-util";
2
2
 
3
3
  import {
4
4
  CallMessageTrace,
@@ -1,4 +1,4 @@
1
- import { ERROR } from "@ignored/evm/dist/exceptions";
1
+ import { ERROR } from "@nomicfoundation/ethereumjs-evm/dist/exceptions";
2
2
  import { defaultAbiCoder as abi } from "@ethersproject/abi";
3
3
  import semver from "semver";
4
4
 
@@ -492,7 +492,7 @@ export class ErrorInferrer {
492
492
  // if the error comes from a call to a zero-initialized function,
493
493
  // we remove the last frame, which represents the call, to avoid
494
494
  // having duplicated frames
495
- if (errorCode === 0x51) {
495
+ if (errorCode === 0x51n) {
496
496
  stacktrace.splice(-1);
497
497
  }
498
498
 
@@ -1125,7 +1125,7 @@ export class ErrorInferrer {
1125
1125
  private _instructionWithinFunctionToPanicStackTraceEntry(
1126
1126
  trace: DecodedEvmMessageTrace,
1127
1127
  inst: Instruction,
1128
- errorCode: number
1128
+ errorCode: bigint
1129
1129
  ): PanicErrorStackTraceEntry {
1130
1130
  return {
1131
1131
  type: StackTraceEntryType.PANIC_ERROR,
@@ -1,4 +1,4 @@
1
- import type { EvmError } from "@ignored/evm";
1
+ import type { EvmError } from "@nomicfoundation/ethereumjs-evm";
2
2
 
3
3
  import type { Bytecode } from "./model";
4
4
 
@@ -1,4 +1,4 @@
1
- import { bufferToHex } from "@ignored/util";
1
+ import { bufferToHex } from "@nomicfoundation/ethereumjs-util";
2
2
 
3
3
  import { AbiHelpers } from "../../util/abi-helpers";
4
4
 
@@ -1,4 +1,4 @@
1
- export function panicErrorCodeToMessage(errorCode: number): string {
1
+ export function panicErrorCodeToMessage(errorCode: bigint): string {
2
2
  const reason = panicErrorCodeToReason(errorCode);
3
3
 
4
4
  if (reason !== undefined) {
@@ -8,25 +8,25 @@ export function panicErrorCodeToMessage(errorCode: number): string {
8
8
  return `reverted with unknown panic code 0x${errorCode.toString(16)}`;
9
9
  }
10
10
 
11
- function panicErrorCodeToReason(errorCode: number): string | undefined {
11
+ function panicErrorCodeToReason(errorCode: bigint): string | undefined {
12
12
  switch (errorCode) {
13
- case 0x1:
13
+ case 0x1n:
14
14
  return "Assertion error";
15
- case 0x11:
15
+ case 0x11n:
16
16
  return "Arithmetic operation underflowed or overflowed outside of an unchecked block";
17
- case 0x12:
17
+ case 0x12n:
18
18
  return "Division or modulo division by zero";
19
- case 0x21:
19
+ case 0x21n:
20
20
  return "Tried to convert a value into an enum, but the value was too big or negative";
21
- case 0x22:
21
+ case 0x22n:
22
22
  return "Incorrectly encoded storage byte array";
23
- case 0x31:
23
+ case 0x31n:
24
24
  return ".pop() was called on an empty array";
25
- case 0x32:
25
+ case 0x32n:
26
26
  return "Array accessed at an out-of-bounds or negative index";
27
- case 0x41:
27
+ case 0x41n:
28
28
  return "Too much memory was allocated, or an array was created that is too large";
29
- case 0x51:
29
+ case 0x51n:
30
30
  return "Called a zero-initialized variable of internal function type";
31
31
  }
32
32
  }
@@ -1,4 +1,4 @@
1
- import { bufferToHex } from "@ignored/util";
1
+ import { bufferToHex } from "@nomicfoundation/ethereumjs-util";
2
2
 
3
3
  import { panicErrorCodeToMessage } from "./panic-errors";
4
4
  import {
@@ -80,7 +80,7 @@ export interface RevertErrorStackTraceEntry {
80
80
 
81
81
  export interface PanicErrorStackTraceEntry {
82
82
  type: StackTraceEntryType.PANIC_ERROR;
83
- errorCode: number;
83
+ errorCode: bigint;
84
84
  sourceReference: SourceReference;
85
85
  }
86
86
 
@@ -1,4 +1,4 @@
1
- import { ERROR } from "@ignored/evm/dist/exceptions";
1
+ import { ERROR } from "@nomicfoundation/ethereumjs-evm/dist/exceptions";
2
2
  import { ReturnData } from "../provider/return-data";
3
3
 
4
4
  import {
@@ -32,9 +32,6 @@ import {
32
32
  StackTraceEntryType,
33
33
  } from "./solidity-stack-trace";
34
34
 
35
- export const SUPPORTED_SOLIDITY_VERSION_RANGE = "<=0.8.16";
36
- export const FIRST_SOLC_VERSION_SUPPORTED = "0.5.1";
37
-
38
35
  export class SolidityTracer {
39
36
  private _errorInferrer = new ErrorInferrer();
40
37
 
@@ -1,20 +1,20 @@
1
- import { TypedTransaction } from "@ignored/tx";
2
- import { AfterTxEvent, VM } from "@ignored/vm";
3
- import { EVM, EVMResult } from "@ignored/evm";
4
- import { InterpreterStep } from "@ignored/evm/dist/interpreter";
5
- import { Message } from "@ignored/evm/dist/message";
1
+ import { TypedTransaction } from "@nomicfoundation/ethereumjs-tx";
2
+ import { AfterTxEvent, VM } from "@nomicfoundation/ethereumjs-vm";
3
+ import { EVMResult } from "@nomicfoundation/ethereumjs-evm";
4
+ import { InterpreterStep } from "@nomicfoundation/ethereumjs-evm/dist/interpreter";
5
+ import { Message } from "@nomicfoundation/ethereumjs-evm/dist/message";
6
6
  import {
7
7
  Address,
8
8
  bufferToBigInt,
9
9
  setLengthLeft,
10
10
  toBuffer,
11
- } from "@ignored/util";
11
+ } from "@nomicfoundation/ethereumjs-util";
12
12
 
13
13
  import { assertHardhatInvariant } from "../../core/errors";
14
14
  import { RpcDebugTracingConfig } from "../../core/jsonrpc/types/input/debugTraceTransaction";
15
15
  import { InvalidInputError } from "../../core/providers/errors";
16
16
  import { RpcDebugTraceOutput, RpcStructLog } from "../provider/output";
17
- import { BigIntUtils } from "../../util/bigint";
17
+ import * as BigIntUtils from "../../util/bigint";
18
18
 
19
19
  /* eslint-disable @nomiclabs/hardhat-internal-rules/only-hardhat-error */
20
20
 
@@ -90,26 +90,40 @@ export class VMDebugTracer {
90
90
  }
91
91
 
92
92
  private _enableTracing(config: RpcDebugTracingConfig) {
93
- this._vm.on("beforeTx", this._beforeTxHandler);
94
- (this._vm.evm as EVM).on("beforeMessage", this._beforeMessageHandler);
95
- (this._vm.evm as EVM).on("step", this._stepHandler);
96
- (this._vm.evm as EVM).on("afterMessage", this._afterMessageHandler);
97
- this._vm.on("afterTx", this._afterTxHandler);
93
+ assertHardhatInvariant(
94
+ this._vm.evm.events !== undefined,
95
+ "EVM should have an 'events' property"
96
+ );
97
+
98
+ this._vm.events.on("beforeTx", this._beforeTxHandler);
99
+
100
+ this._vm.evm.events.on("beforeMessage", this._beforeMessageHandler);
101
+ this._vm.evm.events.on("step", this._stepHandler);
102
+ this._vm.evm.events.on("afterMessage", this._afterMessageHandler);
103
+
104
+ this._vm.events.on("afterTx", this._afterTxHandler);
105
+
98
106
  this._config = config;
99
107
  }
100
108
 
101
109
  private _disableTracing() {
102
- this._vm.removeListener("beforeTx", this._beforeTxHandler);
103
- (this._vm.evm as EVM).removeListener(
110
+ assertHardhatInvariant(
111
+ this._vm.evm.events !== undefined,
112
+ "EVM should have an 'events' property"
113
+ );
114
+
115
+ this._vm.events.removeListener("beforeTx", this._beforeTxHandler);
116
+
117
+ this._vm.evm.events.removeListener(
104
118
  "beforeMessage",
105
119
  this._beforeMessageHandler
106
120
  );
107
- (this._vm.evm as EVM).removeListener("step", this._stepHandler);
108
- (this._vm.evm as EVM).removeListener(
121
+ this._vm.evm.events.removeListener("step", this._stepHandler);
122
+ this._vm.evm.events.removeListener(
109
123
  "afterMessage",
110
124
  this._afterMessageHandler
111
125
  );
112
- this._vm.removeListener("afterTx", this._afterTxHandler);
126
+ this._vm.events.removeListener("afterTx", this._afterTxHandler);
113
127
  this._config = undefined;
114
128
  }
115
129
 
@@ -1,8 +1,12 @@
1
- import { EVM, EVMResult, getActivePrecompiles } from "@ignored/evm";
2
- import { InterpreterStep } from "@ignored/evm/dist/interpreter";
3
- import { Message } from "@ignored/evm/dist/message";
4
- import { Address, bufferToBigInt } from "@ignored/util";
5
- import { VM } from "@ignored/vm";
1
+ import {
2
+ EVMResult,
3
+ getActivePrecompiles,
4
+ } from "@nomicfoundation/ethereumjs-evm";
5
+ import { InterpreterStep } from "@nomicfoundation/ethereumjs-evm/dist/interpreter";
6
+ import { Message } from "@nomicfoundation/ethereumjs-evm/dist/message";
7
+ import { Address, bufferToBigInt } from "@nomicfoundation/ethereumjs-util";
8
+ import { VM } from "@nomicfoundation/ethereumjs-vm";
9
+ import { assertHardhatInvariant } from "../../core/errors";
6
10
 
7
11
  import {
8
12
  CallMessageTrace,
@@ -38,9 +42,14 @@ export class VMTracer {
38
42
  if (this._enabled) {
39
43
  return;
40
44
  }
41
- (this._vm.evm as EVM).on("beforeMessage", this._beforeMessageHandler);
42
- (this._vm.evm as EVM).on("step", this._stepHandler);
43
- (this._vm.evm as EVM).on("afterMessage", this._afterMessageHandler);
45
+ assertHardhatInvariant(
46
+ this._vm.evm.events !== undefined,
47
+ "EVM should have an 'events' property"
48
+ );
49
+
50
+ this._vm.evm.events.on("beforeMessage", this._beforeMessageHandler);
51
+ this._vm.evm.events.on("step", this._stepHandler);
52
+ this._vm.evm.events.on("afterMessage", this._afterMessageHandler);
44
53
  this._enabled = true;
45
54
  }
46
55
 
@@ -48,12 +57,18 @@ export class VMTracer {
48
57
  if (!this._enabled) {
49
58
  return;
50
59
  }
51
- (this._vm.evm as EVM).removeListener(
60
+
61
+ assertHardhatInvariant(
62
+ this._vm.evm.events !== undefined,
63
+ "EVM should have an 'events' property"
64
+ );
65
+
66
+ this._vm.evm.events.removeListener(
52
67
  "beforeMessage",
53
68
  this._beforeMessageHandler
54
69
  );
55
- (this._vm.evm as EVM).removeListener("step", this._stepHandler);
56
- (this._vm.evm as EVM).removeListener(
70
+ this._vm.evm.events.removeListener("step", this._stepHandler);
71
+ this._vm.evm.events.removeListener(
57
72
  "afterMessage",
58
73
  this._afterMessageHandler
59
74
  );
@@ -111,11 +126,11 @@ export class VMTracer {
111
126
 
112
127
  trace = createTrace;
113
128
  } else {
114
- const toAsNumber = bufferToBigInt(message.to.toBuffer());
129
+ const toAsBigInt = bufferToBigInt(message.to.toBuffer());
115
130
 
116
- if (toAsNumber > 0 && toAsNumber <= this._maxPrecompileNumber) {
131
+ if (toAsBigInt > 0 && toAsBigInt <= this._maxPrecompileNumber) {
117
132
  const precompileTrace: PrecompileMessageTrace = {
118
- precompile: Number(toAsNumber),
133
+ precompile: Number(toAsBigInt),
119
134
  calldata: message.data,
120
135
  value: message.value,
121
136
  returnData: DUMMY_RETURN_DATA,
@@ -8,13 +8,10 @@ import { ERRORS } from "../core/errors-list";
8
8
  import { getEnvHardhatArguments } from "../core/params/env-variables";
9
9
  import { HARDHAT_PARAM_DEFINITIONS } from "../core/params/hardhat-params";
10
10
  import { Environment } from "../core/runtime-environment";
11
- import { applyWorkaround } from "../util/antlr-prototype-pollution-workaround";
12
11
 
13
12
  let ctx: HardhatContext;
14
13
  let env: HardhatRuntimeEnvironment;
15
14
 
16
- applyWorkaround();
17
-
18
15
  if (HardhatContext.isCreated()) {
19
16
  ctx = HardhatContext.getHardhatContext();
20
17
 
@@ -17,7 +17,7 @@ import { ResolvedFile } from "./resolver";
17
17
  const log = debug("hardhat:core:compilation-job");
18
18
 
19
19
  // this should have a proper version range when it's fixed
20
- const SOLC_BUG_9573_VERSIONS = "*";
20
+ const SOLC_BUG_9573_VERSIONS = "<0.8.0";
21
21
 
22
22
  function isCompilationJobCreationError(
23
23
  x:
@@ -55,7 +55,8 @@ export class CompilationJob implements taskTypes.CompilationJob {
55
55
  }
56
56
 
57
57
  public merge(job: taskTypes.CompilationJob): CompilationJob {
58
- const { isEqual }: LoDashStatic = require("lodash");
58
+ const isEqual = require("lodash/isEqual") as LoDashStatic["isEqual"];
59
+
59
60
  assertHardhatInvariant(
60
61
  isEqual(this.solidityConfig, job.getSolcConfig()),
61
62
  "Merging jobs with different solidity configurations"
@@ -103,8 +104,6 @@ function mergeCompilationJobs(
103
104
  jobs: taskTypes.CompilationJob[],
104
105
  isMergeable: (job: taskTypes.CompilationJob) => boolean
105
106
  ): taskTypes.CompilationJob[] {
106
- const { flatten }: LoDashStatic = require("lodash");
107
-
108
107
  const jobsMap: Map<SolcConfig, taskTypes.CompilationJob[]> = new Map();
109
108
 
110
109
  for (const job of jobs) {
@@ -130,7 +129,8 @@ function mergeCompilationJobs(
130
129
  }
131
130
  }
132
131
 
133
- return flatten([...jobsMap.values()]);
132
+ // Array#flat This method defaults to depth limit 1
133
+ return [...jobsMap.values()].flat(1_000_000);
134
134
  }
135
135
 
136
136
  /**
@@ -234,15 +234,15 @@ function getCompilerConfigForFile(
234
234
  transitiveDependencies: taskTypes.TransitiveDependency[],
235
235
  solidityConfig: SolidityConfig
236
236
  ): SolcConfig | CompilationJobCreationError {
237
- const { uniq }: LoDashStatic = require("lodash");
238
-
239
237
  const transitiveDependenciesVersionPragmas = transitiveDependencies.map(
240
238
  ({ dependency }) => dependency.content.versionPragmas
241
239
  );
242
- const versionRange = uniq([
243
- ...file.content.versionPragmas,
244
- ...transitiveDependenciesVersionPragmas,
245
- ]).join(" ");
240
+ const versionRange = Array.from(
241
+ new Set([
242
+ ...file.content.versionPragmas,
243
+ ...transitiveDependenciesVersionPragmas,
244
+ ])
245
+ ).join(" ");
246
246
 
247
247
  const overrides = solidityConfig.overrides ?? {};
248
248