hardhat 2.13.0-dev.2 → 2.13.0-dev.4

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 (391) hide show
  1. package/builtin-tasks/compile.js +21 -7
  2. package/builtin-tasks/compile.js.map +1 -1
  3. package/builtin-tasks/console.js +5 -1
  4. package/builtin-tasks/console.js.map +1 -1
  5. package/builtin-tasks/flatten.js +1 -1
  6. package/builtin-tasks/flatten.js.map +1 -1
  7. package/builtin-tasks/help.js +2 -4
  8. package/builtin-tasks/help.js.map +1 -1
  9. package/builtin-tasks/task-names.d.ts +1 -0
  10. package/builtin-tasks/task-names.d.ts.map +1 -1
  11. package/builtin-tasks/task-names.js +3 -2
  12. package/builtin-tasks/task-names.js.map +1 -1
  13. package/builtin-tasks/test.js +27 -2
  14. package/builtin-tasks/test.js.map +1 -1
  15. package/builtin-tasks/utils/solidity-files-cache.js +5 -1
  16. package/builtin-tasks/utils/solidity-files-cache.js.map +1 -1
  17. package/builtin-tasks/utils/watch.js +5 -1
  18. package/builtin-tasks/utils/watch.js.map +1 -1
  19. package/common/index.js +5 -1
  20. package/common/index.js.map +1 -1
  21. package/config.js +5 -1
  22. package/config.js.map +1 -1
  23. package/internal/artifacts.js +5 -1
  24. package/internal/artifacts.js.map +1 -1
  25. package/internal/cli/analytics.js +5 -1
  26. package/internal/cli/analytics.js.map +1 -1
  27. package/internal/cli/autocomplete.js +5 -1
  28. package/internal/cli/autocomplete.js.map +1 -1
  29. package/internal/cli/bootstrap.d.ts +1 -0
  30. package/internal/cli/bootstrap.js +12 -20
  31. package/internal/cli/bootstrap.js.map +1 -1
  32. package/internal/cli/cli.d.ts +0 -1
  33. package/internal/cli/cli.d.ts.map +1 -1
  34. package/internal/cli/cli.js +20 -29
  35. package/internal/cli/cli.js.map +1 -1
  36. package/internal/cli/project-creation.d.ts +1 -2
  37. package/internal/cli/project-creation.d.ts.map +1 -1
  38. package/internal/cli/project-creation.js +110 -37
  39. package/internal/cli/project-creation.js.map +1 -1
  40. package/internal/cli/prompt.d.ts +2 -2
  41. package/internal/cli/prompt.d.ts.map +1 -1
  42. package/internal/cli/prompt.js +6 -3
  43. package/internal/cli/prompt.js.map +1 -1
  44. package/internal/cli/types.d.ts +1 -0
  45. package/internal/cli/types.d.ts.map +1 -1
  46. package/internal/core/config/config-env.d.ts +5 -11
  47. package/internal/core/config/config-env.d.ts.map +1 -1
  48. package/internal/core/config/config-env.js +7 -14
  49. package/internal/core/config/config-env.js.map +1 -1
  50. package/internal/core/config/config-loading.d.ts +2 -1
  51. package/internal/core/config/config-loading.d.ts.map +1 -1
  52. package/internal/core/config/config-loading.js +25 -7
  53. package/internal/core/config/config-loading.js.map +1 -1
  54. package/internal/core/config/config-validation.d.ts +2 -0
  55. package/internal/core/config/config-validation.d.ts.map +1 -1
  56. package/internal/core/config/config-validation.js +23 -2
  57. package/internal/core/config/config-validation.js.map +1 -1
  58. package/internal/core/config/extenders.d.ts +4 -7
  59. package/internal/core/config/extenders.d.ts.map +1 -1
  60. package/internal/core/config/extenders.js +5 -12
  61. package/internal/core/config/extenders.js.map +1 -1
  62. package/internal/core/errors-list.d.ts +28 -7
  63. package/internal/core/errors-list.d.ts.map +1 -1
  64. package/internal/core/errors-list.js +33 -10
  65. package/internal/core/errors-list.js.map +1 -1
  66. package/internal/core/jsonrpc/types/access-list.js +5 -1
  67. package/internal/core/jsonrpc/types/access-list.js.map +1 -1
  68. package/internal/core/jsonrpc/types/base-types.js +5 -1
  69. package/internal/core/jsonrpc/types/base-types.js.map +1 -1
  70. package/internal/core/jsonrpc/types/input/blockTag.d.ts +3 -3
  71. package/internal/core/jsonrpc/types/input/blockTag.d.ts.map +1 -1
  72. package/internal/core/jsonrpc/types/input/blockTag.js +5 -1
  73. package/internal/core/jsonrpc/types/input/blockTag.js.map +1 -1
  74. package/internal/core/jsonrpc/types/input/callRequest.js +5 -1
  75. package/internal/core/jsonrpc/types/input/callRequest.js.map +1 -1
  76. package/internal/core/jsonrpc/types/input/debugTraceTransaction.js +5 -1
  77. package/internal/core/jsonrpc/types/input/debugTraceTransaction.js.map +1 -1
  78. package/internal/core/jsonrpc/types/input/filterRequest.js +5 -1
  79. package/internal/core/jsonrpc/types/input/filterRequest.js.map +1 -1
  80. package/internal/core/jsonrpc/types/input/hardhat-network.js +5 -1
  81. package/internal/core/jsonrpc/types/input/hardhat-network.js.map +1 -1
  82. package/internal/core/jsonrpc/types/input/logAddress.js +5 -1
  83. package/internal/core/jsonrpc/types/input/logAddress.js.map +1 -1
  84. package/internal/core/jsonrpc/types/input/logTopics.js +5 -1
  85. package/internal/core/jsonrpc/types/input/logTopics.js.map +1 -1
  86. package/internal/core/jsonrpc/types/input/solc.js +5 -1
  87. package/internal/core/jsonrpc/types/input/solc.js.map +1 -1
  88. package/internal/core/jsonrpc/types/input/subscribeRequest.js +5 -1
  89. package/internal/core/jsonrpc/types/input/subscribeRequest.js.map +1 -1
  90. package/internal/core/jsonrpc/types/input/transactionRequest.js +5 -1
  91. package/internal/core/jsonrpc/types/input/transactionRequest.js.map +1 -1
  92. package/internal/core/jsonrpc/types/output/block.js +5 -1
  93. package/internal/core/jsonrpc/types/output/block.js.map +1 -1
  94. package/internal/core/jsonrpc/types/output/log.js +5 -1
  95. package/internal/core/jsonrpc/types/output/log.js.map +1 -1
  96. package/internal/core/jsonrpc/types/output/receipt.js +5 -1
  97. package/internal/core/jsonrpc/types/output/receipt.js.map +1 -1
  98. package/internal/core/jsonrpc/types/output/transaction.js +5 -1
  99. package/internal/core/jsonrpc/types/output/transaction.js.map +1 -1
  100. package/internal/core/params/argumentTypes.js +5 -1
  101. package/internal/core/params/argumentTypes.js.map +1 -1
  102. package/internal/core/params/hardhat-params.js +5 -1
  103. package/internal/core/params/hardhat-params.js.map +1 -1
  104. package/internal/core/project-structure.d.ts.map +1 -1
  105. package/internal/core/project-structure.js +6 -0
  106. package/internal/core/project-structure.js.map +1 -1
  107. package/internal/core/providers/accounts.js +5 -1
  108. package/internal/core/providers/accounts.js.map +1 -1
  109. package/internal/core/providers/construction.d.ts.map +1 -1
  110. package/internal/core/providers/construction.js +25 -5
  111. package/internal/core/providers/construction.js.map +1 -1
  112. package/internal/core/providers/http.d.ts +2 -2
  113. package/internal/core/providers/http.d.ts.map +1 -1
  114. package/internal/core/providers/http.js +45 -19
  115. package/internal/core/providers/http.js.map +1 -1
  116. package/internal/core/runtime-environment.d.ts +4 -2
  117. package/internal/core/runtime-environment.d.ts.map +1 -1
  118. package/internal/core/runtime-environment.js +57 -67
  119. package/internal/core/runtime-environment.js.map +1 -1
  120. package/internal/core/tasks/dsl.d.ts +6 -6
  121. package/internal/core/tasks/dsl.d.ts.map +1 -1
  122. package/internal/core/tasks/dsl.js.map +1 -1
  123. package/internal/core/tasks/task-definitions.d.ts +2 -2
  124. package/internal/core/tasks/task-definitions.d.ts.map +1 -1
  125. package/internal/core/tasks/task-definitions.js +5 -1
  126. package/internal/core/tasks/task-definitions.js.map +1 -1
  127. package/internal/hardhat-network/jsonrpc/client.js +5 -1
  128. package/internal/hardhat-network/jsonrpc/client.js.map +1 -1
  129. package/internal/hardhat-network/jsonrpc/handler.d.ts +1 -0
  130. package/internal/hardhat-network/jsonrpc/handler.d.ts.map +1 -1
  131. package/internal/hardhat-network/jsonrpc/handler.js +13 -18
  132. package/internal/hardhat-network/jsonrpc/handler.js.map +1 -1
  133. package/internal/hardhat-network/provider/BlockchainBase.js +5 -1
  134. package/internal/hardhat-network/provider/BlockchainBase.js.map +1 -1
  135. package/internal/hardhat-network/provider/PoolState.js +5 -1
  136. package/internal/hardhat-network/provider/PoolState.js.map +1 -1
  137. package/internal/hardhat-network/provider/RethnetState.d.ts +27 -0
  138. package/internal/hardhat-network/provider/RethnetState.d.ts.map +1 -0
  139. package/internal/hardhat-network/provider/RethnetState.js +89 -0
  140. package/internal/hardhat-network/provider/RethnetState.js.map +1 -0
  141. package/internal/hardhat-network/provider/TransactionQueue.js +5 -1
  142. package/internal/hardhat-network/provider/TransactionQueue.js.map +1 -1
  143. package/internal/hardhat-network/provider/TxPool.js +5 -1
  144. package/internal/hardhat-network/provider/TxPool.js.map +1 -1
  145. package/internal/hardhat-network/provider/modules/eth.js +5 -1
  146. package/internal/hardhat-network/provider/modules/eth.js.map +1 -1
  147. package/internal/hardhat-network/provider/modules/evm.d.ts +2 -1
  148. package/internal/hardhat-network/provider/modules/evm.d.ts.map +1 -1
  149. package/internal/hardhat-network/provider/modules/evm.js +15 -5
  150. package/internal/hardhat-network/provider/modules/evm.js.map +1 -1
  151. package/internal/hardhat-network/provider/modules/hardhat.js +5 -1
  152. package/internal/hardhat-network/provider/modules/hardhat.js.map +1 -1
  153. package/internal/hardhat-network/provider/node-types.d.ts +1 -1
  154. package/internal/hardhat-network/provider/node-types.d.ts.map +1 -1
  155. package/internal/hardhat-network/provider/node.d.ts +2 -0
  156. package/internal/hardhat-network/provider/node.d.ts.map +1 -1
  157. package/internal/hardhat-network/provider/node.js +11 -5
  158. package/internal/hardhat-network/provider/node.js.map +1 -1
  159. package/internal/hardhat-network/provider/output.js +5 -1
  160. package/internal/hardhat-network/provider/output.js.map +1 -1
  161. package/internal/hardhat-network/provider/provider.d.ts +25 -21
  162. package/internal/hardhat-network/provider/provider.d.ts.map +1 -1
  163. package/internal/hardhat-network/provider/provider.js +25 -42
  164. package/internal/hardhat-network/provider/provider.js.map +1 -1
  165. package/internal/hardhat-network/provider/return-data.js +2 -2
  166. package/internal/hardhat-network/provider/return-data.js.map +1 -1
  167. package/internal/hardhat-network/provider/transactions/FakeSenderAccessListEIP2930Transaction.d.ts.map +1 -1
  168. package/internal/hardhat-network/provider/transactions/FakeSenderAccessListEIP2930Transaction.js +9 -3
  169. package/internal/hardhat-network/provider/transactions/FakeSenderAccessListEIP2930Transaction.js.map +1 -1
  170. package/internal/hardhat-network/provider/transactions/FakeSenderEIP1559Transaction.d.ts.map +1 -1
  171. package/internal/hardhat-network/provider/transactions/FakeSenderEIP1559Transaction.js +9 -3
  172. package/internal/hardhat-network/provider/transactions/FakeSenderEIP1559Transaction.js.map +1 -1
  173. package/internal/hardhat-network/provider/transactions/FakeSenderTransaction.d.ts.map +1 -1
  174. package/internal/hardhat-network/provider/transactions/FakeSenderTransaction.js +9 -3
  175. package/internal/hardhat-network/provider/transactions/FakeSenderTransaction.js.map +1 -1
  176. package/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP1559Transaction.js +5 -1
  177. package/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP1559Transaction.js.map +1 -1
  178. package/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP2930Transaction.js +5 -1
  179. package/internal/hardhat-network/provider/transactions/ReadOnlyValidEIP2930Transaction.js.map +1 -1
  180. package/internal/hardhat-network/provider/utils/bloom.d.ts +32 -0
  181. package/internal/hardhat-network/provider/utils/bloom.d.ts.map +1 -0
  182. package/internal/hardhat-network/provider/utils/bloom.js +79 -0
  183. package/internal/hardhat-network/provider/utils/bloom.js.map +1 -0
  184. package/internal/hardhat-network/provider/utils/convertToRethnet.d.ts +12 -0
  185. package/internal/hardhat-network/provider/utils/convertToRethnet.d.ts.map +1 -0
  186. package/internal/hardhat-network/provider/utils/convertToRethnet.js +162 -0
  187. package/internal/hardhat-network/provider/utils/convertToRethnet.js.map +1 -0
  188. package/internal/hardhat-network/provider/utils/makeFakeSignature.d.ts +7 -0
  189. package/internal/hardhat-network/provider/utils/makeFakeSignature.d.ts.map +1 -0
  190. package/internal/hardhat-network/provider/utils/makeFakeSignature.js +31 -0
  191. package/internal/hardhat-network/provider/utils/makeFakeSignature.js.map +1 -0
  192. package/internal/hardhat-network/provider/utils/putGenesisBlock.d.ts +1 -1
  193. package/internal/hardhat-network/provider/utils/putGenesisBlock.d.ts.map +1 -1
  194. package/internal/hardhat-network/provider/utils/putGenesisBlock.js +2 -2
  195. package/internal/hardhat-network/provider/utils/putGenesisBlock.js.map +1 -1
  196. package/internal/hardhat-network/provider/utils/reorganizeTransactionsLists.js +5 -1
  197. package/internal/hardhat-network/provider/utils/reorganizeTransactionsLists.js.map +1 -1
  198. package/internal/hardhat-network/provider/vm/block-builder.d.ts +31 -0
  199. package/internal/hardhat-network/provider/vm/block-builder.d.ts.map +1 -0
  200. package/internal/hardhat-network/provider/vm/block-builder.js +151 -0
  201. package/internal/hardhat-network/provider/vm/block-builder.js.map +1 -0
  202. package/internal/hardhat-network/provider/vm/creation.d.ts +10 -0
  203. package/internal/hardhat-network/provider/vm/creation.d.ts.map +1 -0
  204. package/internal/hardhat-network/provider/vm/creation.js +29 -0
  205. package/internal/hardhat-network/provider/vm/creation.js.map +1 -0
  206. package/internal/hardhat-network/provider/vm/dual.d.ts +44 -0
  207. package/internal/hardhat-network/provider/vm/dual.d.ts.map +1 -0
  208. package/internal/hardhat-network/provider/vm/dual.js +501 -0
  209. package/internal/hardhat-network/provider/vm/dual.js.map +1 -0
  210. package/internal/hardhat-network/provider/vm/ethereumjs.d.ts +57 -0
  211. package/internal/hardhat-network/provider/vm/ethereumjs.d.ts.map +1 -0
  212. package/internal/hardhat-network/provider/vm/ethereumjs.js +420 -0
  213. package/internal/hardhat-network/provider/vm/ethereumjs.js.map +1 -0
  214. package/internal/hardhat-network/provider/vm/exit.d.ts +23 -0
  215. package/internal/hardhat-network/provider/vm/exit.d.ts.map +1 -0
  216. package/internal/hardhat-network/provider/vm/exit.js +130 -0
  217. package/internal/hardhat-network/provider/vm/exit.js.map +1 -0
  218. package/internal/hardhat-network/provider/vm/rethnet.d.ts +100 -0
  219. package/internal/hardhat-network/provider/vm/rethnet.d.ts.map +1 -0
  220. package/internal/hardhat-network/provider/vm/rethnet.js +287 -0
  221. package/internal/hardhat-network/provider/vm/rethnet.js.map +1 -0
  222. package/internal/hardhat-network/provider/vm/vm-adapter.d.ts +53 -0
  223. package/internal/hardhat-network/provider/vm/vm-adapter.d.ts.map +1 -0
  224. package/internal/hardhat-network/provider/vm/vm-adapter.js +3 -0
  225. package/internal/hardhat-network/provider/vm/vm-adapter.js.map +1 -0
  226. package/internal/hardhat-network/stack-traces/compiler-to-model.d.ts.map +1 -1
  227. package/internal/hardhat-network/stack-traces/compiler-to-model.js +37 -11
  228. package/internal/hardhat-network/stack-traces/compiler-to-model.js.map +1 -1
  229. package/internal/hardhat-network/stack-traces/consoleLogger.js.map +1 -1
  230. package/internal/hardhat-network/stack-traces/constants.d.ts +1 -1
  231. package/internal/hardhat-network/stack-traces/constants.js +1 -1
  232. package/internal/hardhat-network/stack-traces/debug.d.ts.map +1 -1
  233. package/internal/hardhat-network/stack-traces/debug.js +6 -2
  234. package/internal/hardhat-network/stack-traces/debug.js.map +1 -1
  235. package/internal/hardhat-network/stack-traces/error-inferrer.d.ts +1 -0
  236. package/internal/hardhat-network/stack-traces/error-inferrer.d.ts.map +1 -1
  237. package/internal/hardhat-network/stack-traces/error-inferrer.js +85 -55
  238. package/internal/hardhat-network/stack-traces/error-inferrer.js.map +1 -1
  239. package/internal/hardhat-network/stack-traces/model.d.ts +3 -1
  240. package/internal/hardhat-network/stack-traces/model.d.ts.map +1 -1
  241. package/internal/hardhat-network/stack-traces/model.js +9 -1
  242. package/internal/hardhat-network/stack-traces/model.js.map +1 -1
  243. package/internal/hardhat-network/stack-traces/solidity-errors.js +2 -2
  244. package/internal/hardhat-network/stack-traces/solidity-errors.js.map +1 -1
  245. package/internal/hardhat-network/stack-traces/solidity-stack-trace.d.ts +2 -2
  246. package/internal/hardhat-network/stack-traces/solidity-stack-trace.d.ts.map +1 -1
  247. package/internal/hardhat-network/stack-traces/solidityTracer.d.ts.map +1 -1
  248. package/internal/hardhat-network/stack-traces/solidityTracer.js +1 -0
  249. package/internal/hardhat-network/stack-traces/solidityTracer.js.map +1 -1
  250. package/internal/hardhat-network/stack-traces/vm-debug-tracer.js +5 -1
  251. package/internal/hardhat-network/stack-traces/vm-debug-tracer.js.map +1 -1
  252. package/internal/lib/hardhat-lib.d.ts.map +1 -1
  253. package/internal/lib/hardhat-lib.js +1 -4
  254. package/internal/lib/hardhat-lib.js.map +1 -1
  255. package/internal/sentry/anonymizer.js +5 -1
  256. package/internal/sentry/anonymizer.js.map +1 -1
  257. package/internal/sentry/reporter.js +5 -1
  258. package/internal/sentry/reporter.js.map +1 -1
  259. package/internal/sentry/subprocess.js +5 -1
  260. package/internal/sentry/subprocess.js.map +1 -1
  261. package/internal/sentry/transport.js +5 -1
  262. package/internal/sentry/transport.js.map +1 -1
  263. package/internal/solidity/compiler/downloader.js +7 -3
  264. package/internal/solidity/compiler/downloader.js.map +1 -1
  265. package/internal/solidity/compiler/index.js +6 -2
  266. package/internal/solidity/compiler/index.js.map +1 -1
  267. package/internal/solidity/resolver.d.ts +4 -3
  268. package/internal/solidity/resolver.d.ts.map +1 -1
  269. package/internal/solidity/resolver.js +18 -7
  270. package/internal/solidity/resolver.js.map +1 -1
  271. package/internal/util/abi-helpers.d.ts +1 -0
  272. package/internal/util/abi-helpers.d.ts.map +1 -1
  273. package/internal/util/abi-helpers.js +14 -1
  274. package/internal/util/abi-helpers.js.map +1 -1
  275. package/internal/util/download.d.ts.map +1 -1
  276. package/internal/util/download.js +17 -12
  277. package/internal/util/download.js.map +1 -1
  278. package/internal/util/glob.js +5 -1
  279. package/internal/util/glob.js.map +1 -1
  280. package/internal/util/global-dir.js +5 -1
  281. package/internal/util/global-dir.js.map +1 -1
  282. package/internal/util/io-ts.js +5 -1
  283. package/internal/util/io-ts.js.map +1 -1
  284. package/internal/util/packageInfo.d.ts +6 -1
  285. package/internal/util/packageInfo.d.ts.map +1 -1
  286. package/internal/util/packageInfo.js +14 -11
  287. package/internal/util/packageInfo.js.map +1 -1
  288. package/internal/util/proxy.d.ts +2 -0
  289. package/internal/util/proxy.d.ts.map +1 -0
  290. package/internal/util/proxy.js +19 -0
  291. package/internal/util/proxy.js.map +1 -0
  292. package/internal/util/scripts-runner.js +5 -1
  293. package/internal/util/scripts-runner.js.map +1 -1
  294. package/package.json +9 -10
  295. package/register.js +1 -4
  296. package/register.js.map +1 -1
  297. package/sample-projects/javascript/hardhat.config.js +1 -1
  298. package/sample-projects/javascript/scripts/deploy.js +5 -4
  299. package/sample-projects/javascript-esm/LICENSE.md +11 -0
  300. package/sample-projects/javascript-esm/README.md +13 -0
  301. package/sample-projects/javascript-esm/contracts/Lock.sol +34 -0
  302. package/sample-projects/javascript-esm/hardhat.config.cjs +6 -0
  303. package/sample-projects/javascript-esm/scripts/deploy.js +23 -0
  304. package/sample-projects/javascript-esm/test/Lock.js +123 -0
  305. package/sample-projects/typescript/hardhat.config.ts +1 -1
  306. package/sample-projects/typescript/scripts/deploy.ts +5 -4
  307. package/sample-projects/typescript/tsconfig.json +2 -1
  308. package/src/builtin-tasks/compile.ts +28 -7
  309. package/src/builtin-tasks/flatten.ts +4 -1
  310. package/src/builtin-tasks/help.ts +15 -16
  311. package/src/builtin-tasks/task-names.ts +2 -0
  312. package/src/builtin-tasks/test.ts +30 -2
  313. package/src/internal/artifacts.ts +947 -0
  314. package/src/internal/cli/bootstrap.ts +14 -36
  315. package/src/internal/cli/cli.ts +38 -43
  316. package/src/internal/cli/project-creation.ts +128 -47
  317. package/src/internal/cli/prompt.ts +2 -4
  318. package/src/internal/cli/types.ts +2 -0
  319. package/src/internal/core/config/config-env.ts +15 -27
  320. package/src/internal/core/config/config-loading.ts +35 -11
  321. package/src/internal/core/config/config-validation.ts +20 -0
  322. package/src/internal/core/config/extenders.ts +6 -15
  323. package/src/internal/core/errors-list.ts +36 -10
  324. package/src/internal/core/project-structure.ts +8 -0
  325. package/src/internal/core/providers/construction.ts +29 -24
  326. package/src/internal/core/providers/http.ts +38 -26
  327. package/src/internal/core/runtime-environment.ts +84 -82
  328. package/src/internal/core/tasks/dsl.ts +17 -17
  329. package/src/internal/core/tasks/task-definitions.ts +6 -2
  330. package/src/internal/hardhat-network/jsonrpc/handler.ts +31 -28
  331. package/src/internal/hardhat-network/provider/modules/evm.ts +15 -3
  332. package/src/internal/hardhat-network/provider/node-types.ts +1 -1
  333. package/src/internal/hardhat-network/provider/node.ts +5 -1
  334. package/src/internal/hardhat-network/provider/provider.ts +60 -49
  335. package/src/internal/hardhat-network/provider/return-data.ts +2 -2
  336. package/src/internal/hardhat-network/provider/transactions/FakeSenderAccessListEIP2930Transaction.ts +5 -2
  337. package/src/internal/hardhat-network/provider/transactions/FakeSenderEIP1559Transaction.ts +5 -2
  338. package/src/internal/hardhat-network/provider/transactions/FakeSenderTransaction.ts +5 -2
  339. package/src/internal/hardhat-network/provider/utils/makeFakeSignature.ts +46 -0
  340. package/src/internal/hardhat-network/provider/utils/putGenesisBlock.ts +2 -2
  341. package/src/internal/hardhat-network/stack-traces/compiler-to-model.ts +71 -9
  342. package/src/internal/hardhat-network/stack-traces/consoleLogger.ts +1 -1
  343. package/src/internal/hardhat-network/stack-traces/constants.ts +1 -1
  344. package/src/internal/hardhat-network/stack-traces/debug.ts +9 -2
  345. package/src/internal/hardhat-network/stack-traces/error-inferrer.ts +177 -89
  346. package/src/internal/hardhat-network/stack-traces/model.ts +11 -1
  347. package/src/internal/hardhat-network/stack-traces/solidity-errors.ts +2 -2
  348. package/src/internal/hardhat-network/stack-traces/solidity-stack-trace.ts +2 -2
  349. package/src/internal/hardhat-network/stack-traces/solidityTracer.ts +3 -0
  350. package/src/internal/lib/hardhat-lib.ts +1 -6
  351. package/src/internal/solidity/compiler/downloader.ts +2 -2
  352. package/src/internal/solidity/compiler/index.ts +1 -1
  353. package/src/internal/solidity/resolver.ts +28 -11
  354. package/src/internal/util/abi-helpers.ts +9 -0
  355. package/src/internal/util/download.ts +13 -15
  356. package/src/internal/util/packageInfo.ts +24 -10
  357. package/src/internal/util/proxy.ts +18 -0
  358. package/src/register.ts +1 -6
  359. package/src/types/artifacts.ts +14 -112
  360. package/src/types/config.ts +2 -0
  361. package/src/types/runtime.ts +16 -13
  362. package/types/artifacts.d.ts +10 -96
  363. package/types/artifacts.d.ts.map +1 -1
  364. package/types/builtin-tasks/index.js +5 -1
  365. package/types/builtin-tasks/index.js.map +1 -1
  366. package/types/config.d.ts +2 -0
  367. package/types/config.d.ts.map +1 -1
  368. package/types/index.js +5 -1
  369. package/types/index.js.map +1 -1
  370. package/types/runtime.d.ts +9 -10
  371. package/types/runtime.d.ts.map +1 -1
  372. package/internal/artifacts/caching.d.ts +0 -28
  373. package/internal/artifacts/caching.d.ts.map +0 -1
  374. package/internal/artifacts/caching.js +0 -178
  375. package/internal/artifacts/caching.js.map +0 -1
  376. package/internal/artifacts/index.d.ts +0 -45
  377. package/internal/artifacts/index.d.ts.map +0 -1
  378. package/internal/artifacts/index.js +0 -191
  379. package/internal/artifacts/index.js.map +0 -1
  380. package/internal/artifacts/mutable.d.ts +0 -29
  381. package/internal/artifacts/mutable.d.ts.map +0 -1
  382. package/internal/artifacts/mutable.js +0 -226
  383. package/internal/artifacts/mutable.js.map +0 -1
  384. package/internal/artifacts/readonly.d.ts +0 -94
  385. package/internal/artifacts/readonly.d.ts.map +0 -1
  386. package/internal/artifacts/readonly.js +0 -343
  387. package/internal/artifacts/readonly.js.map +0 -1
  388. package/src/internal/artifacts/caching.ts +0 -259
  389. package/src/internal/artifacts/index.ts +0 -302
  390. package/src/internal/artifacts/mutable.ts +0 -330
  391. package/src/internal/artifacts/readonly.ts +0 -470
@@ -1 +1 @@
1
- {"version":3,"file":"packageInfo.js","sourceRoot":"","sources":["../../src/internal/util/packageInfo.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA6B;AAC7B,wDAA+B;AAC/B,gDAAwB;AAExB,SAAgB,kBAAkB;IAChC,OAAO,sBAAsB,CAAC,UAAU,CAAE,CAAC;AAC7C,CAAC;AAFD,gDAEC;AAED,SAAgB,cAAc;IAC5B,MAAM,eAAe,GAAG,kBAAkB,EAAE,CAAC;IAE7C,OAAO,cAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;AACvC,CAAC;AAJD,wCAIC;AAUD,SAAgB,sBAAsB,CAAC,IAAY;IACjD,OAAO,iBAAM,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,GAAG,EAAE,cAAI,CAAC,OAAO,CAAC,IAA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eAAe,CAAC,CAAC;AAC3C,CAAC;AATD,sDASC"}
@@ -0,0 +1,2 @@
1
+ export declare function shouldUseProxy(url: string): boolean;
2
+ //# sourceMappingURL=proxy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proxy.d.ts","sourceRoot":"","sources":["../../src/internal/util/proxy.ts"],"names":[],"mappings":"AAAA,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAiBnD"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.shouldUseProxy = void 0;
4
+ function shouldUseProxy(url) {
5
+ const { hostname } = new URL(url);
6
+ const noProxy = process.env.NO_PROXY;
7
+ if (hostname === "localhost" || hostname === "127.0.0.1" || noProxy === "*") {
8
+ return false;
9
+ }
10
+ if (noProxy !== undefined && noProxy !== "") {
11
+ const noProxyList = noProxy.split(",");
12
+ if (noProxyList.includes(hostname)) {
13
+ return false;
14
+ }
15
+ }
16
+ return true;
17
+ }
18
+ exports.shouldUseProxy = shouldUseProxy;
19
+ //# sourceMappingURL=proxy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proxy.js","sourceRoot":"","sources":["../../src/internal/util/proxy.ts"],"names":[],"mappings":";;;AAAA,SAAgB,cAAc,CAAC,GAAW;IACxC,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;IAClC,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;IAErC,IAAI,QAAQ,KAAK,WAAW,IAAI,QAAQ,KAAK,WAAW,IAAI,OAAO,KAAK,GAAG,EAAE;QAC3E,OAAO,KAAK,CAAC;KACd;IAED,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,EAAE,EAAE;QAC3C,MAAM,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAEvC,IAAI,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;YAClC,OAAO,KAAK,CAAC;SACd;KACF;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAjBD,wCAiBC"}
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -1 +1 @@
1
- {"version":3,"file":"scripts-runner.js","sourceRoot":"","sources":["../../src/internal/util/scripts-runner.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,gDAAwB;AAGxB,2DAAmE;AACnE,gEAAkE;AAElE,MAAM,GAAG,GAAG,IAAA,eAAK,EAAC,6BAA6B,CAAC,CAAC;AAE1C,KAAK,UAAU,SAAS,CAC7B,UAAkB,EAClB,aAAuB,EAAE,EACzB,gBAA0B,EAAE,EAC5B,eAA2C,EAAE;IAE7C,MAAM,EAAE,IAAI,EAAE,GAAG,wDAAa,eAAe,GAAC,CAAC;IAE/C,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,eAAe,GAAG,mBAAmB,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAE9D,MAAM,QAAQ,GAAG;YACf,GAAG,eAAe;YAClB,GAAG,qBAAqB,CACtB,UAAU,EACV,YAAY,CAAC,iBAAiB,KAAK,MAAM,CAC1C;YACD,GAAG,aAAa;SACjB,CAAC;QAEF,MAAM,OAAO,GAAG,EAAE,GAAG,OAA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AAC,GAAG,CAAC,eAAe,CAAC,CAAC;AACnC,CAAC;AAED,SAAS,qBAAqB,CAC5B,UAAkB,EAClB,eAAwB;IAExB,IAAI,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE;QACjD,OAAO,EAAE,CAAC;KACX;IAED,wEAAwE;IACxE,eAAe;IACf,IAAI,IAAA,0CAAyB,GAAE,EAAE;QAC/B,OAAO,CAAC,WAAW,EAAE,iCAAiC,CAAC,CAAC;KACzD;IAED,2DAA2D;IAC3D,IAAI,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE;QAC/B,OAAO;YACL,WAAW;YACX,mBAAmB,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,iBAAiB,EAAE;SAC9D,CAAC;KACH;IAED,OAAO,EAAE,CAAC;AACZ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hardhat",
3
- "version": "2.13.0-dev.2",
3
+ "version": "2.13.0-dev.4",
4
4
  "author": "Nomic Labs LLC",
5
5
  "license": "MIT",
6
6
  "homepage": "https://hardhat.org",
@@ -20,10 +20,10 @@
20
20
  "solidity"
21
21
  ],
22
22
  "bin": {
23
- "hardhat": "internal/cli/cli.js"
23
+ "hardhat": "internal/cli/bootstrap.js"
24
24
  },
25
25
  "engines": {
26
- "node": "^14.0.0 || ^16.0.0 || ^18.0.0"
26
+ "node": ">=14.0.0"
27
27
  },
28
28
  "scripts": {
29
29
  "lint": "yarn prettier --check && yarn eslint",
@@ -68,7 +68,7 @@
68
68
  "@types/glob": "^7.1.1",
69
69
  "@types/keccak": "^3.0.1",
70
70
  "@types/lodash": "^4.14.123",
71
- "@types/mocha": "^9.1.0",
71
+ "@types/mocha": ">=9.1.0",
72
72
  "@types/node": "^14.0.0",
73
73
  "@types/qs": "^6.5.3",
74
74
  "@types/resolve": "^1.17.1",
@@ -76,8 +76,8 @@
76
76
  "@types/sinon": "^9.0.8",
77
77
  "@types/uuid": "^8.3.1",
78
78
  "@types/ws": "^7.2.1",
79
- "@typescript-eslint/eslint-plugin": "^5.30.7",
80
- "@typescript-eslint/parser": "4.29.2",
79
+ "@typescript-eslint/eslint-plugin": "5.53.0",
80
+ "@typescript-eslint/parser": "5.53.0",
81
81
  "bignumber.js": "^9.0.2",
82
82
  "bn.js": "^5.1.0",
83
83
  "chai": "^4.2.0",
@@ -90,12 +90,11 @@
90
90
  "ethers": "^5.0.0",
91
91
  "mocha": "^10.0.0",
92
92
  "prettier": "2.4.1",
93
- "proxy": "^1.0.2",
94
93
  "rimraf": "^3.0.2",
95
94
  "sinon": "^9.0.0",
96
95
  "time-require": "^0.1.2",
97
- "ts-node": "^8.1.0",
98
- "typescript": "~4.5.2"
96
+ "ts-node": "^10.8.0",
97
+ "typescript": "~4.7.4"
99
98
  },
100
99
  "dependencies": {
101
100
  "@ethersproject/abi": "^5.1.2",
@@ -145,7 +144,7 @@
145
144
  "source-map-support": "^0.5.13",
146
145
  "stacktrace-parser": "^0.1.10",
147
146
  "tsort": "0.0.1",
148
- "undici": "^5.4.0",
147
+ "undici": "^5.14.0",
149
148
  "uuid": "^8.3.2",
150
149
  "ws": "^7.4.6"
151
150
  },
package/register.js CHANGED
@@ -25,10 +25,7 @@ if (!context_1.HardhatContext.isCreated()) {
25
25
  (0, typescript_support_1.loadTsNode)(hardhatArguments.tsconfig, hardhatArguments.typecheck);
26
26
  }
27
27
  const { resolvedConfig, userConfig } = (0, config_loading_1.loadConfigAndTasks)(hardhatArguments);
28
- const artifactsExtensions = ctx.extendersManager
29
- .getArtifactsExtenders()
30
- .map((artifactsExtender) => artifactsExtender(resolvedConfig));
31
- const env = new runtime_environment_1.Environment(resolvedConfig, hardhatArguments, ctx.tasksDSL.getTaskDefinitions(), ctx.extendersManager.getEnvironmentExtenders(), artifactsExtensions, ctx.experimentalHardhatNetworkMessageTraceHooks, userConfig);
28
+ const env = new runtime_environment_1.Environment(resolvedConfig, hardhatArguments, ctx.tasksDSL.getTaskDefinitions(), ctx.extendersManager.getExtenders(), ctx.experimentalHardhatNetworkMessageTraceHooks, userConfig);
32
29
  ctx.setHardhatRuntimeEnvironment(env);
33
30
  env.injectToGlobal();
34
31
  }
package/register.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"register.js","sourceRoot":"","sources":["src/register.ts"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAE1B,gDAAoD;AACpD,0EAA2E;AAC3E,wEAA8E;AAC9E,0EAAkF;AAClF,6EAAkE;AAClE,2EAG4C;AAC5C,qDAGiC;AAEjC,IAAI,CAAC,wBAAc,CAAC,SAAS,EAAE,EAAE;IAC/B,OAAO,CAAC,6BAA6B,CAAC,CAAC;IAEvC,MAAM,GAAG,GAAG,wBAAc,CAAC,oBAAoB,EAAE,CAAC;IAElD,IAAI,IAAA,oCAA0B,GAAE,EAAE;QAChC,IAAA,oCAA0B,GAAE,CAAC;KAC9B;IAED,MAAM,gBAAgB,GAAG,IAAA,sCAAsB,EAC7C,0CAAyB,EACzB,OAAO,CAAC,GAAG,CACZ,CAAC;IAEF,IAAI,gBAAgB,CAAC,OAAO,EAAE;QAC5B,eAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;KAC1B;IAED,IAAI,IAAA,0CAAqB,EAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE;QAClD,IAAA,+BAAU,EAAC,gBAAgB,CAAC,QAAQ,EAAE,gBAAgB,CAAC,SAAS,CAAC,CAAC;KACnE;IAED,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,GAAG,IAAA,mCAAkB,EAAC,gBAAgB,CAAC,CAAC;IAE5E,MAAM,mBAAmB,GAAG,GAAG,CAAC,gBAAgB;SAC7C,qBAAqB,EAAE;SACvB,GAAG,CAAC,CAAC,iBAAiB,EAAE,EAAE,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC,CAAC;IAEjE,MAAM,GAAG,GAAG,IAAI,iCAAW,CACzB,cAAc,EACd,gBA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AAgB,CAAC,YAAY,EAAE,EACnC,GAAG,CAAC,2CAA2C,EAC/C,UAAU,CACX,CAAC;IAEF,GAAG,CAAC,4BAA4B,CAAC,GAAG,CAAC,CAAC;IAEtC,GAAG,CAAC,cAAc,EAAE,CAAC;CACtB"}
@@ -2,5 +2,5 @@ require("@nomicfoundation/hardhat-toolbox");
2
2
 
3
3
  /** @type import('hardhat/config').HardhatUserConfig */
4
4
  module.exports = {
5
- solidity: "0.8.17",
5
+ solidity: "0.8.18",
6
6
  };
@@ -8,10 +8,9 @@ const hre = require("hardhat");
8
8
 
9
9
  async function main() {
10
10
  const currentTimestampInSeconds = Math.round(Date.now() / 1000);
11
- const ONE_YEAR_IN_SECS = 365 * 24 * 60 * 60;
12
- const unlockTime = currentTimestampInSeconds + ONE_YEAR_IN_SECS;
11
+ const unlockTime = currentTimestampInSeconds + 60;
13
12
 
14
- const lockedAmount = hre.ethers.utils.parseEther("1");
13
+ const lockedAmount = hre.ethers.utils.parseEther("0.001");
15
14
 
16
15
  const Lock = await hre.ethers.getContractFactory("Lock");
17
16
  const lock = await Lock.deploy(unlockTime, { value: lockedAmount });
@@ -19,7 +18,9 @@ async function main() {
19
18
  await lock.deployed();
20
19
 
21
20
  console.log(
22
- `Lock with 1 ETH and unlock timestamp ${unlockTime} deployed to ${lock.address}`
21
+ `Lock with ${ethers.utils.formatEther(
22
+ lockedAmount
23
+ )}ETH and unlock timestamp ${unlockTime} deployed to ${lock.address}`
23
24
  );
24
25
  }
25
26
 
@@ -0,0 +1,11 @@
1
+ # License
2
+
3
+ This is free and unencumbered software released into the public domain.
4
+
5
+ Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.
6
+
7
+ In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
10
+
11
+ For more information, please refer to [https://unlicense.org](https://unlicense.org)
@@ -0,0 +1,13 @@
1
+ # Sample Hardhat Project
2
+
3
+ This project demonstrates a basic Hardhat use case. It comes with a sample contract, a test for that contract, and a script that deploys that contract.
4
+
5
+ Try running some of the following tasks:
6
+
7
+ ```shell
8
+ npx hardhat help
9
+ npx hardhat test
10
+ REPORT_GAS=true npx hardhat test
11
+ npx hardhat node
12
+ npx hardhat run scripts/deploy.js
13
+ ```
@@ -0,0 +1,34 @@
1
+ // SPDX-License-Identifier: UNLICENSED
2
+ pragma solidity ^0.8.9;
3
+
4
+ // Uncomment this line to use console.log
5
+ // import "hardhat/console.sol";
6
+
7
+ contract Lock {
8
+ uint public unlockTime;
9
+ address payable public owner;
10
+
11
+ event Withdrawal(uint amount, uint when);
12
+
13
+ constructor(uint _unlockTime) payable {
14
+ require(
15
+ block.timestamp < _unlockTime,
16
+ "Unlock time should be in the future"
17
+ );
18
+
19
+ unlockTime = _unlockTime;
20
+ owner = payable(msg.sender);
21
+ }
22
+
23
+ function withdraw() public {
24
+ // Uncomment this line, and the import of "hardhat/console.sol", to print a log in your terminal
25
+ // console.log("Unlock time is %o and block timestamp is %o", unlockTime, block.timestamp);
26
+
27
+ require(block.timestamp >= unlockTime, "You can't withdraw yet");
28
+ require(msg.sender == owner, "You aren't the owner");
29
+
30
+ emit Withdrawal(address(this).balance, block.timestamp);
31
+
32
+ owner.transfer(address(this).balance);
33
+ }
34
+ }
@@ -0,0 +1,6 @@
1
+ require("@nomicfoundation/hardhat-toolbox");
2
+
3
+ /** @type import('hardhat/config').HardhatUserConfig */
4
+ module.exports = {
5
+ solidity: "0.8.17",
6
+ };
@@ -0,0 +1,23 @@
1
+ // We require the Hardhat Runtime Environment explicitly here. This is optional
2
+ // but useful for running the script in a standalone fashion through `node <script>`.
3
+ //
4
+ // You can also run a script with `npx hardhat run <script>`. If you do that, Hardhat
5
+ // will compile your contracts, add the Hardhat Runtime Environment's members to the
6
+ // global scope, and execute the script.
7
+ import hre from "hardhat";
8
+
9
+ const currentTimestampInSeconds = Math.round(Date.now() / 1000);
10
+ const unlockTime = currentTimestampInSeconds + 60;
11
+
12
+ const lockedAmount = hre.ethers.utils.parseEther("0.001");
13
+
14
+ const Lock = await hre.ethers.getContractFactory("Lock");
15
+ const lock = await Lock.deploy(unlockTime, { value: lockedAmount });
16
+
17
+ await lock.deployed();
18
+
19
+ console.log(
20
+ `Lock with ${ethers.utils.formatEther(
21
+ lockedAmount
22
+ )}ETH and unlock timestamp ${unlockTime} deployed to ${lock.address}`
23
+ );
@@ -0,0 +1,123 @@
1
+ import { time, loadFixture } from "@nomicfoundation/hardhat-network-helpers";
2
+ import { anyValue } from "@nomicfoundation/hardhat-chai-matchers/withArgs.js";
3
+ import { expect } from "chai";
4
+
5
+ describe("Lock", function () {
6
+ // We define a fixture to reuse the same setup in every test.
7
+ // We use loadFixture to run this setup once, snapshot that state,
8
+ // and reset Hardhat Network to that snapshot in every test.
9
+ async function deployOneYearLockFixture() {
10
+ const ONE_YEAR_IN_SECS = 365 * 24 * 60 * 60;
11
+ const ONE_GWEI = 1_000_000_000;
12
+
13
+ const lockedAmount = ONE_GWEI;
14
+ const unlockTime = (await time.latest()) + ONE_YEAR_IN_SECS;
15
+
16
+ // Contracts are deployed using the first signer/account by default
17
+ const [owner, otherAccount] = await ethers.getSigners();
18
+
19
+ const Lock = await ethers.getContractFactory("Lock");
20
+ const lock = await Lock.deploy(unlockTime, { value: lockedAmount });
21
+
22
+ return { lock, unlockTime, lockedAmount, owner, otherAccount };
23
+ }
24
+
25
+ describe("Deployment", function () {
26
+ it("Should set the right unlockTime", async function () {
27
+ const { lock, unlockTime } = await loadFixture(deployOneYearLockFixture);
28
+
29
+ expect(await lock.unlockTime()).to.equal(unlockTime);
30
+ });
31
+
32
+ it("Should set the right owner", async function () {
33
+ const { lock, owner } = await loadFixture(deployOneYearLockFixture);
34
+
35
+ expect(await lock.owner()).to.equal(owner.address);
36
+ });
37
+
38
+ it("Should receive and store the funds to lock", async function () {
39
+ const { lock, lockedAmount } = await loadFixture(
40
+ deployOneYearLockFixture
41
+ );
42
+
43
+ expect(await ethers.provider.getBalance(lock.address)).to.equal(
44
+ lockedAmount
45
+ );
46
+ });
47
+
48
+ it("Should fail if the unlockTime is not in the future", async function () {
49
+ // We don't use the fixture here because we want a different deployment
50
+ const latestTime = await time.latest();
51
+ const Lock = await ethers.getContractFactory("Lock");
52
+ await expect(Lock.deploy(latestTime, { value: 1 })).to.be.revertedWith(
53
+ "Unlock time should be in the future"
54
+ );
55
+ });
56
+ });
57
+
58
+ describe("Withdrawals", function () {
59
+ describe("Validations", function () {
60
+ it("Should revert with the right error if called too soon", async function () {
61
+ const { lock } = await loadFixture(deployOneYearLockFixture);
62
+
63
+ await expect(lock.withdraw()).to.be.revertedWith(
64
+ "You can't withdraw yet"
65
+ );
66
+ });
67
+
68
+ it("Should revert with the right error if called from another account", async function () {
69
+ const { lock, unlockTime, otherAccount } = await loadFixture(
70
+ deployOneYearLockFixture
71
+ );
72
+
73
+ // We can increase the time in Hardhat Network
74
+ await time.increaseTo(unlockTime);
75
+
76
+ // We use lock.connect() to send a transaction from another account
77
+ await expect(lock.connect(otherAccount).withdraw()).to.be.revertedWith(
78
+ "You aren't the owner"
79
+ );
80
+ });
81
+
82
+ it("Shouldn't fail if the unlockTime has arrived and the owner calls it", async function () {
83
+ const { lock, unlockTime } = await loadFixture(
84
+ deployOneYearLockFixture
85
+ );
86
+
87
+ // Transactions are sent using the first signer by default
88
+ await time.increaseTo(unlockTime);
89
+
90
+ await expect(lock.withdraw()).not.to.be.reverted;
91
+ });
92
+ });
93
+
94
+ describe("Events", function () {
95
+ it("Should emit an event on withdrawals", async function () {
96
+ const { lock, unlockTime, lockedAmount } = await loadFixture(
97
+ deployOneYearLockFixture
98
+ );
99
+
100
+ await time.increaseTo(unlockTime);
101
+
102
+ await expect(lock.withdraw())
103
+ .to.emit(lock, "Withdrawal")
104
+ .withArgs(lockedAmount, anyValue); // We accept any value as `when` arg
105
+ });
106
+ });
107
+
108
+ describe("Transfers", function () {
109
+ it("Should transfer the funds to the owner", async function () {
110
+ const { lock, unlockTime, lockedAmount, owner } = await loadFixture(
111
+ deployOneYearLockFixture
112
+ );
113
+
114
+ await time.increaseTo(unlockTime);
115
+
116
+ await expect(lock.withdraw()).to.changeEtherBalances(
117
+ [owner, lock],
118
+ [lockedAmount, -lockedAmount]
119
+ );
120
+ });
121
+ });
122
+ });
123
+ });
@@ -2,7 +2,7 @@ import { HardhatUserConfig } from "hardhat/config";
2
2
  import "@nomicfoundation/hardhat-toolbox";
3
3
 
4
4
  const config: HardhatUserConfig = {
5
- solidity: "0.8.17",
5
+ solidity: "0.8.18",
6
6
  };
7
7
 
8
8
  export default config;
@@ -2,17 +2,18 @@ import { ethers } from "hardhat";
2
2
 
3
3
  async function main() {
4
4
  const currentTimestampInSeconds = Math.round(Date.now() / 1000);
5
- const ONE_YEAR_IN_SECS = 365 * 24 * 60 * 60;
6
- const unlockTime = currentTimestampInSeconds + ONE_YEAR_IN_SECS;
5
+ const unlockTime = currentTimestampInSeconds + 60;
7
6
 
8
- const lockedAmount = ethers.utils.parseEther("1");
7
+ const lockedAmount = ethers.utils.parseEther("0.001");
9
8
 
10
9
  const Lock = await ethers.getContractFactory("Lock");
11
10
  const lock = await Lock.deploy(unlockTime, { value: lockedAmount });
12
11
 
13
12
  await lock.deployed();
14
13
 
15
- console.log(`Lock with 1 ETH and unlock timestamp ${unlockTime} deployed to ${lock.address}`);
14
+ console.log(
15
+ `Lock with ${ethers.utils.formatEther(lockedAmount)}ETH and unlock timestamp ${unlockTime} deployed to ${lock.address}`
16
+ );
16
17
  }
17
18
 
18
19
  // We recommend this pattern to be able to use async/await everywhere
@@ -5,6 +5,7 @@
5
5
  "esModuleInterop": true,
6
6
  "forceConsistentCasingInFileNames": true,
7
7
  "strict": true,
8
- "skipLibCheck": true
8
+ "skipLibCheck": true,
9
+ "resolveJsonModule": true
9
10
  }
10
11
  }
@@ -73,6 +73,7 @@ import {
73
73
  TASK_COMPILE_SOLIDITY_RUN_SOLC,
74
74
  TASK_COMPILE_SOLIDITY_RUN_SOLCJS,
75
75
  TASK_COMPILE_REMOVE_OBSOLETE_ARTIFACTS,
76
+ TASK_COMPILE_TRANSFORM_IMPORT_NAME,
76
77
  } from "./task-names";
77
78
  import {
78
79
  getSolidityFilesCachePath,
@@ -90,11 +91,13 @@ type ArtifactsEmittedPerJob = Array<{
90
91
  }>;
91
92
 
92
93
  function isConsoleLogError(error: any): boolean {
94
+ const message = error.message;
95
+
93
96
  return (
94
97
  error.type === "TypeError" &&
95
- typeof error.message === "string" &&
96
- error.message.includes("log") &&
97
- error.message.includes("type(library console)")
98
+ typeof message === "string" &&
99
+ message.includes("log") &&
100
+ message.includes("type(library console)")
98
101
  );
99
102
  }
100
103
 
@@ -157,6 +160,18 @@ subtask(TASK_COMPILE_SOLIDITY_READ_FILE)
157
160
  }
158
161
  );
159
162
 
163
+ /**
164
+ * This task transform the string literal in an import directive.
165
+ * By default it does nothing, but it can be overriden by plugins.
166
+ */
167
+ subtask(TASK_COMPILE_TRANSFORM_IMPORT_NAME)
168
+ .addParam("importName", undefined, undefined, types.string)
169
+ .setAction(
170
+ async ({ importName }: { importName: string }): Promise<string> => {
171
+ return importName;
172
+ }
173
+ );
174
+
160
175
  /**
161
176
  * Receives a list of source names and returns a dependency graph. This task
162
177
  * is responsible for both resolving dependencies (like getting files from
@@ -178,7 +193,9 @@ subtask(TASK_COMPILE_SOLIDITY_GET_DEPENDENCY_GRAPH)
178
193
  config.paths.root,
179
194
  parser,
180
195
  (absolutePath: string) =>
181
- run(TASK_COMPILE_SOLIDITY_READ_FILE, { absolutePath })
196
+ run(TASK_COMPILE_SOLIDITY_READ_FILE, { absolutePath }),
197
+ (importName: string) =>
198
+ run(TASK_COMPILE_TRANSFORM_IMPORT_NAME, { importName })
182
199
  );
183
200
 
184
201
  const resolvedFiles = await Promise.all(
@@ -738,13 +755,17 @@ subtask(TASK_COMPILE_SOLIDITY_LOG_COMPILATION_ERRORS)
738
755
 
739
756
  for (const error of output.errors) {
740
757
  if (error.severity === "error") {
741
- const errorMessage =
758
+ const errorMessage: string =
742
759
  getFormattedInternalCompilerErrorMessage(error) ??
743
760
  error.formattedMessage;
744
761
 
745
- console.error(chalk.red(errorMessage));
762
+ console.error(errorMessage.replace(/^\w+:/, (t) => chalk.red.bold(t)));
746
763
  } else {
747
- console.warn(chalk.yellow(error.formattedMessage));
764
+ console.warn(
765
+ (error.formattedMessage as string).replace(/^\w+:/, (t) =>
766
+ chalk.yellow.bold(t)
767
+ )
768
+ );
748
769
  }
749
770
  }
750
771
 
@@ -124,7 +124,10 @@ subtask(TASK_FLATTEN_GET_DEPENDENCY_GRAPH)
124
124
  return dependencyGraph;
125
125
  });
126
126
 
127
- task(TASK_FLATTEN, "Flattens and prints contracts and their dependencies")
127
+ task(
128
+ TASK_FLATTEN,
129
+ "Flattens and prints contracts and their dependencies. If no file is passed, all the contracts in the project will be flattened."
130
+ )
128
131
  .addOptionalVariadicPositionalParam(
129
132
  "files",
130
133
  "The files to flatten",
@@ -2,7 +2,6 @@ import { HelpPrinter } from "../internal/cli/HelpPrinter";
2
2
  import { HARDHAT_EXECUTABLE_NAME, HARDHAT_NAME } from "../internal/constants";
3
3
  import { task } from "../internal/core/config/config-env";
4
4
  import { HARDHAT_PARAM_DEFINITIONS } from "../internal/core/params/hardhat-params";
5
- import { getPackageJson } from "../internal/util/packageInfo";
6
5
 
7
6
  import { TASK_HELP } from "./task-names";
8
7
 
@@ -11,21 +10,21 @@ task(TASK_HELP, "Prints this message")
11
10
  "task",
12
11
  "An optional task to print more info about"
13
12
  )
14
- .setAction(async ({ task: taskName }: { task?: string }, { tasks }) => {
15
- const packageJson = await getPackageJson();
13
+ .setAction(
14
+ async ({ task: taskName }: { task?: string }, { tasks, version }) => {
15
+ const helpPrinter = new HelpPrinter(
16
+ HARDHAT_NAME,
17
+ HARDHAT_EXECUTABLE_NAME,
18
+ version,
19
+ HARDHAT_PARAM_DEFINITIONS,
20
+ tasks
21
+ );
16
22
 
17
- const helpPrinter = new HelpPrinter(
18
- HARDHAT_NAME,
19
- HARDHAT_EXECUTABLE_NAME,
20
- packageJson.version,
21
- HARDHAT_PARAM_DEFINITIONS,
22
- tasks
23
- );
23
+ if (taskName !== undefined) {
24
+ helpPrinter.printTaskHelp(taskName);
25
+ return;
26
+ }
24
27
 
25
- if (taskName !== undefined) {
26
- helpPrinter.printTaskHelp(taskName);
27
- return;
28
+ helpPrinter.printGlobalHelp();
28
29
  }
29
-
30
- helpPrinter.printGlobalHelp();
31
- });
30
+ );
@@ -12,6 +12,8 @@ export const TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS =
12
12
  export const TASK_COMPILE_SOLIDITY_GET_SOURCE_NAMES =
13
13
  "compile:solidity:get-source-names";
14
14
  export const TASK_COMPILE_SOLIDITY_READ_FILE = "compile:solidity:read-file";
15
+ export const TASK_COMPILE_TRANSFORM_IMPORT_NAME =
16
+ "compile:solidity:transform-import-name";
15
17
  export const TASK_COMPILE_SOLIDITY_GET_DEPENDENCY_GRAPH =
16
18
  "compile:solidity:get-dependency-graph";
17
19
  export const TASK_COMPILE_SOLIDITY_GET_COMPILATION_JOBS =