hardhat 3.11.0 → 3.12.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 (262) hide show
  1. package/CHANGELOG.md +37 -2
  2. package/dist/src/internal/builtin-plugins/artifacts/artifact-manager.js.map +1 -1
  3. package/dist/src/internal/builtin-plugins/artifacts/hook-handlers/hre.d.ts.map +1 -1
  4. package/dist/src/internal/builtin-plugins/artifacts/hook-handlers/hre.js +2 -1
  5. package/dist/src/internal/builtin-plugins/artifacts/hook-handlers/hre.js.map +1 -1
  6. package/dist/src/internal/builtin-plugins/coverage/hook-handlers/hre.d.ts.map +1 -1
  7. package/dist/src/internal/builtin-plugins/coverage/hook-handlers/hre.js +2 -1
  8. package/dist/src/internal/builtin-plugins/coverage/hook-handlers/hre.js.map +1 -1
  9. package/dist/src/internal/builtin-plugins/gas-analytics/function-gas-snapshots.js +3 -3
  10. package/dist/src/internal/builtin-plugins/gas-analytics/function-gas-snapshots.js.map +1 -1
  11. package/dist/src/internal/builtin-plugins/gas-analytics/hook-handlers/hre.d.ts.map +1 -1
  12. package/dist/src/internal/builtin-plugins/gas-analytics/hook-handlers/hre.js +2 -1
  13. package/dist/src/internal/builtin-plugins/gas-analytics/hook-handlers/hre.js.map +1 -1
  14. package/dist/src/internal/builtin-plugins/gas-analytics/snapshot-cheatcodes.js +3 -3
  15. package/dist/src/internal/builtin-plugins/gas-analytics/snapshot-cheatcodes.js.map +1 -1
  16. package/dist/src/internal/builtin-plugins/gas-analytics/tasks/solidity-test/task-action.d.ts +17 -0
  17. package/dist/src/internal/builtin-plugins/gas-analytics/tasks/solidity-test/task-action.d.ts.map +1 -1
  18. package/dist/src/internal/builtin-plugins/gas-analytics/tasks/solidity-test/task-action.js +18 -4
  19. package/dist/src/internal/builtin-plugins/gas-analytics/tasks/solidity-test/task-action.js.map +1 -1
  20. package/dist/src/internal/builtin-plugins/hhu/types.d.ts.map +1 -1
  21. package/dist/src/internal/builtin-plugins/network-manager/accounts/derive-private-keys.js.map +1 -1
  22. package/dist/src/internal/builtin-plugins/network-manager/edr/edr-constants.d.ts.map +1 -1
  23. package/dist/src/internal/builtin-plugins/network-manager/edr/edr-constants.js.map +1 -1
  24. package/dist/src/internal/builtin-plugins/network-manager/edr/edr-provider.d.ts.map +1 -1
  25. package/dist/src/internal/builtin-plugins/network-manager/edr/edr-provider.js.map +1 -1
  26. package/dist/src/internal/builtin-plugins/network-manager/hook-handlers/hre.js.map +1 -1
  27. package/dist/src/internal/builtin-plugins/network-manager/network-connection.d.ts.map +1 -1
  28. package/dist/src/internal/builtin-plugins/network-manager/network-connection.js.map +1 -1
  29. package/dist/src/internal/builtin-plugins/network-manager/network-manager.d.ts.map +1 -1
  30. package/dist/src/internal/builtin-plugins/network-manager/network-manager.js +9 -1
  31. package/dist/src/internal/builtin-plugins/network-manager/network-manager.js.map +1 -1
  32. package/dist/src/internal/builtin-plugins/network-manager/request-handlers/handlers/accounts/local-accounts.d.ts.map +1 -1
  33. package/dist/src/internal/builtin-plugins/network-manager/request-handlers/handlers/accounts/local-accounts.js +10 -5
  34. package/dist/src/internal/builtin-plugins/network-manager/request-handlers/handlers/accounts/local-accounts.js.map +1 -1
  35. package/dist/src/internal/builtin-plugins/network-manager/type-extensions/config.d.ts.map +1 -1
  36. package/dist/src/internal/builtin-plugins/solidity/build-results.d.ts.map +1 -1
  37. package/dist/src/internal/builtin-plugins/solidity/build-results.js.map +1 -1
  38. package/dist/src/internal/builtin-plugins/solidity/build-system/build-system.d.ts.map +1 -1
  39. package/dist/src/internal/builtin-plugins/solidity/build-system/build-system.js +13 -8
  40. package/dist/src/internal/builtin-plugins/solidity/build-system/build-system.js.map +1 -1
  41. package/dist/src/internal/builtin-plugins/solidity/build-system/compilation-job.d.ts.map +1 -1
  42. package/dist/src/internal/builtin-plugins/solidity/build-system/compilation-job.js +2 -1
  43. package/dist/src/internal/builtin-plugins/solidity/build-system/compilation-job.js.map +1 -1
  44. package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/remapped-npm-packages-graph.d.ts.map +1 -1
  45. package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/remapped-npm-packages-graph.js.map +1 -1
  46. package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/types.d.ts.map +1 -1
  47. package/dist/src/internal/builtin-plugins/solidity/config.d.ts.map +1 -1
  48. package/dist/src/internal/builtin-plugins/solidity/config.js.map +1 -1
  49. package/dist/src/internal/builtin-plugins/solidity/hook-handlers/hre.d.ts.map +1 -1
  50. package/dist/src/internal/builtin-plugins/solidity/hook-handlers/hre.js.map +1 -1
  51. package/dist/src/internal/builtin-plugins/solidity/type-extensions.d.ts.map +1 -1
  52. package/dist/src/internal/builtin-plugins/solidity-test/helpers.d.ts +2 -1
  53. package/dist/src/internal/builtin-plugins/solidity-test/helpers.d.ts.map +1 -1
  54. package/dist/src/internal/builtin-plugins/solidity-test/helpers.js +3 -2
  55. package/dist/src/internal/builtin-plugins/solidity-test/helpers.js.map +1 -1
  56. package/dist/src/internal/builtin-plugins/solidity-test/index.d.ts.map +1 -1
  57. package/dist/src/internal/builtin-plugins/solidity-test/index.js +6 -0
  58. package/dist/src/internal/builtin-plugins/solidity-test/index.js.map +1 -1
  59. package/dist/src/internal/builtin-plugins/solidity-test/inline-config/index.js +4 -2
  60. package/dist/src/internal/builtin-plugins/solidity-test/inline-config/index.js.map +1 -1
  61. package/dist/src/internal/builtin-plugins/solidity-test/inline-config/parsing.d.ts.map +1 -1
  62. package/dist/src/internal/builtin-plugins/solidity-test/inline-config/parsing.js +2 -1
  63. package/dist/src/internal/builtin-plugins/solidity-test/inline-config/parsing.js.map +1 -1
  64. package/dist/src/internal/builtin-plugins/solidity-test/inline-config/validation.d.ts.map +1 -1
  65. package/dist/src/internal/builtin-plugins/solidity-test/inline-config/validation.js +2 -1
  66. package/dist/src/internal/builtin-plugins/solidity-test/inline-config/validation.js.map +1 -1
  67. package/dist/src/internal/builtin-plugins/solidity-test/reporter.js +1 -1
  68. package/dist/src/internal/builtin-plugins/solidity-test/reporter.js.map +1 -1
  69. package/dist/src/internal/builtin-plugins/solidity-test/runner.d.ts.map +1 -1
  70. package/dist/src/internal/builtin-plugins/solidity-test/runner.js +2 -1
  71. package/dist/src/internal/builtin-plugins/solidity-test/runner.js.map +1 -1
  72. package/dist/src/internal/builtin-plugins/solidity-test/task-action.d.ts +1 -0
  73. package/dist/src/internal/builtin-plugins/solidity-test/task-action.d.ts.map +1 -1
  74. package/dist/src/internal/builtin-plugins/solidity-test/task-action.js +6 -3
  75. package/dist/src/internal/builtin-plugins/solidity-test/task-action.js.map +1 -1
  76. package/dist/src/internal/builtin-plugins/solidity-test/type-extensions.d.ts.map +1 -1
  77. package/dist/src/internal/builtin-plugins/test/index.d.ts.map +1 -1
  78. package/dist/src/internal/builtin-plugins/test/index.js +6 -0
  79. package/dist/src/internal/builtin-plugins/test/index.js.map +1 -1
  80. package/dist/src/internal/builtin-plugins/test/task-action.d.ts +1 -0
  81. package/dist/src/internal/builtin-plugins/test/task-action.d.ts.map +1 -1
  82. package/dist/src/internal/builtin-plugins/test/task-action.js +7 -2
  83. package/dist/src/internal/builtin-plugins/test/task-action.js.map +1 -1
  84. package/dist/src/internal/cli/error-handler.js +2 -1
  85. package/dist/src/internal/cli/error-handler.js.map +1 -1
  86. package/dist/src/internal/cli/init/init.d.ts +3 -8
  87. package/dist/src/internal/cli/init/init.d.ts.map +1 -1
  88. package/dist/src/internal/cli/init/init.js +9 -27
  89. package/dist/src/internal/cli/init/init.js.map +1 -1
  90. package/dist/src/internal/cli/init/prompt.d.ts +0 -1
  91. package/dist/src/internal/cli/init/prompt.d.ts.map +1 -1
  92. package/dist/src/internal/cli/init/prompt.js +0 -24
  93. package/dist/src/internal/cli/init/prompt.js.map +1 -1
  94. package/dist/src/internal/cli/init/template.d.ts +1 -1
  95. package/dist/src/internal/cli/init/template.d.ts.map +1 -1
  96. package/dist/src/internal/cli/init/template.js +17 -3
  97. package/dist/src/internal/cli/init/template.js.map +1 -1
  98. package/dist/src/internal/cli/main.d.ts.map +1 -1
  99. package/dist/src/internal/cli/main.js +3 -2
  100. package/dist/src/internal/cli/main.js.map +1 -1
  101. package/dist/src/internal/cli/telemetry/analytics/analytics.d.ts +2 -1
  102. package/dist/src/internal/cli/telemetry/analytics/analytics.d.ts.map +1 -1
  103. package/dist/src/internal/cli/telemetry/analytics/analytics.js +11 -2
  104. package/dist/src/internal/cli/telemetry/analytics/analytics.js.map +1 -1
  105. package/dist/src/internal/cli/telemetry/analytics/types.d.ts +6 -1
  106. package/dist/src/internal/cli/telemetry/analytics/types.d.ts.map +1 -1
  107. package/dist/src/internal/cli/telemetry/error-reporter/global-error-handlers.js.map +1 -1
  108. package/dist/src/internal/cli/telemetry/sentry/anonymizer.d.ts.map +1 -1
  109. package/dist/src/internal/cli/telemetry/sentry/anonymizer.js.map +1 -1
  110. package/dist/src/internal/core/config.d.ts.map +1 -1
  111. package/dist/src/internal/core/config.js +2 -1
  112. package/dist/src/internal/core/config.js.map +1 -1
  113. package/dist/src/internal/core/configuration-variables.d.ts.map +1 -1
  114. package/dist/src/internal/core/configuration-variables.js +7 -0
  115. package/dist/src/internal/core/configuration-variables.js.map +1 -1
  116. package/dist/src/internal/core/hook-manager.d.ts.map +1 -1
  117. package/dist/src/internal/core/hook-manager.js.map +1 -1
  118. package/dist/src/internal/core/hre.d.ts.map +1 -1
  119. package/dist/src/internal/core/hre.js.map +1 -1
  120. package/dist/src/internal/core/lazy-user-interruptions.d.ts.map +1 -1
  121. package/dist/src/internal/core/lazy-user-interruptions.js +2 -1
  122. package/dist/src/internal/core/lazy-user-interruptions.js.map +1 -1
  123. package/dist/src/internal/core/tasks/builders.d.ts.map +1 -1
  124. package/dist/src/internal/core/tasks/builders.js.map +1 -1
  125. package/dist/src/internal/core/tasks/resolved-task.d.ts.map +1 -1
  126. package/dist/src/internal/core/tasks/resolved-task.js +2 -1
  127. package/dist/src/internal/core/tasks/resolved-task.js.map +1 -1
  128. package/dist/src/internal/core/tasks/task-manager.d.ts.map +1 -1
  129. package/dist/src/internal/core/tasks/task-manager.js +2 -1
  130. package/dist/src/internal/core/tasks/task-manager.js.map +1 -1
  131. package/dist/src/internal/core/tasks/validations.d.ts.map +1 -1
  132. package/dist/src/internal/core/tasks/validations.js +2 -1
  133. package/dist/src/internal/core/tasks/validations.js.map +1 -1
  134. package/dist/src/internal/core/user-interruptions.d.ts.map +1 -1
  135. package/dist/src/internal/core/user-interruptions.js.map +1 -1
  136. package/dist/src/internal/global-hre-instance.d.ts.map +1 -1
  137. package/dist/src/internal/global-hre-instance.js.map +1 -1
  138. package/dist/src/types/artifacts.d.ts.map +1 -1
  139. package/dist/src/types/solidity/build-system.d.ts.map +1 -1
  140. package/dist/src/types/solidity/build-system.js.map +1 -1
  141. package/dist/src/types/solidity/errors.d.ts.map +1 -1
  142. package/dist/src/types/solidity/errors.js.map +1 -1
  143. package/dist/src/types/tasks.d.ts.map +1 -1
  144. package/package.json +14 -14
  145. package/src/internal/builtin-plugins/artifacts/artifact-manager.ts +2 -2
  146. package/src/internal/builtin-plugins/artifacts/hook-handlers/hre.ts +3 -5
  147. package/src/internal/builtin-plugins/coverage/hook-handlers/hre.ts +3 -5
  148. package/src/internal/builtin-plugins/gas-analytics/function-gas-snapshots.ts +3 -3
  149. package/src/internal/builtin-plugins/gas-analytics/hook-handlers/hre.ts +3 -5
  150. package/src/internal/builtin-plugins/gas-analytics/snapshot-cheatcodes.ts +3 -3
  151. package/src/internal/builtin-plugins/gas-analytics/tasks/solidity-test/task-action.ts +32 -5
  152. package/src/internal/builtin-plugins/hhu/types.ts +1 -2
  153. package/src/internal/builtin-plugins/network-manager/accounts/derive-private-keys.ts +4 -6
  154. package/src/internal/builtin-plugins/network-manager/edr/edr-constants.ts +1 -2
  155. package/src/internal/builtin-plugins/network-manager/edr/edr-provider.ts +2 -3
  156. package/src/internal/builtin-plugins/network-manager/hook-handlers/hre.ts +2 -3
  157. package/src/internal/builtin-plugins/network-manager/network-connection.ts +1 -2
  158. package/src/internal/builtin-plugins/network-manager/network-manager.ts +11 -1
  159. package/src/internal/builtin-plugins/network-manager/request-handlers/handlers/accounts/local-accounts.ts +10 -9
  160. package/src/internal/builtin-plugins/network-manager/type-extensions/config.ts +6 -14
  161. package/src/internal/builtin-plugins/solidity/build-results.ts +1 -2
  162. package/src/internal/builtin-plugins/solidity/build-system/build-system.ts +15 -7
  163. package/src/internal/builtin-plugins/solidity/build-system/compilation-job.ts +2 -1
  164. package/src/internal/builtin-plugins/solidity/build-system/resolver/remapped-npm-packages-graph.ts +1 -3
  165. package/src/internal/builtin-plugins/solidity/build-system/resolver/types.ts +1 -2
  166. package/src/internal/builtin-plugins/solidity/config.ts +2 -4
  167. package/src/internal/builtin-plugins/solidity/hook-handlers/hre.ts +1 -2
  168. package/src/internal/builtin-plugins/solidity/type-extensions.ts +16 -14
  169. package/src/internal/builtin-plugins/solidity-test/helpers.ts +5 -1
  170. package/src/internal/builtin-plugins/solidity-test/index.ts +6 -0
  171. package/src/internal/builtin-plugins/solidity-test/inline-config/index.ts +4 -2
  172. package/src/internal/builtin-plugins/solidity-test/inline-config/parsing.ts +2 -1
  173. package/src/internal/builtin-plugins/solidity-test/inline-config/validation.ts +2 -1
  174. package/src/internal/builtin-plugins/solidity-test/reporter.ts +1 -1
  175. package/src/internal/builtin-plugins/solidity-test/runner.ts +2 -1
  176. package/src/internal/builtin-plugins/solidity-test/task-action.ts +7 -3
  177. package/src/internal/builtin-plugins/solidity-test/type-extensions.ts +1 -2
  178. package/src/internal/builtin-plugins/test/index.ts +6 -0
  179. package/src/internal/builtin-plugins/test/task-action.ts +10 -2
  180. package/src/internal/cli/error-handler.ts +2 -3
  181. package/src/internal/cli/init/init.ts +4 -38
  182. package/src/internal/cli/init/prompt.ts +0 -31
  183. package/src/internal/cli/init/template.ts +18 -5
  184. package/src/internal/cli/main.ts +6 -5
  185. package/src/internal/cli/telemetry/analytics/analytics.ts +14 -2
  186. package/src/internal/cli/telemetry/analytics/types.ts +7 -1
  187. package/src/internal/cli/telemetry/error-reporter/global-error-handlers.ts +2 -2
  188. package/src/internal/cli/telemetry/sentry/anonymizer.ts +2 -4
  189. package/src/internal/core/config.ts +2 -1
  190. package/src/internal/core/configuration-variables.ts +9 -3
  191. package/src/internal/core/hook-manager.ts +2 -4
  192. package/src/internal/core/hre.ts +1 -3
  193. package/src/internal/core/lazy-user-interruptions.ts +3 -5
  194. package/src/internal/core/tasks/builders.ts +8 -17
  195. package/src/internal/core/tasks/resolved-task.ts +2 -1
  196. package/src/internal/core/tasks/task-manager.ts +2 -1
  197. package/src/internal/core/tasks/validations.ts +2 -1
  198. package/src/internal/core/user-interruptions.ts +1 -3
  199. package/src/internal/global-hre-instance.ts +1 -2
  200. package/src/types/artifacts.ts +1 -2
  201. package/src/types/solidity/build-system.ts +8 -17
  202. package/src/types/solidity/errors.ts +3 -6
  203. package/src/types/tasks.ts +5 -11
  204. package/templates/{hardhat-3/01-node-test-runner-viem → 01-node-test-runner-viem}/package.json +1 -1
  205. package/templates/{hardhat-3/02-mocha-ethers → 02-mocha-ethers}/package.json +1 -1
  206. package/templates/{hardhat-3/03-minimal → 03-minimal}/package.json +1 -1
  207. package/templates/hardhat-2/01-mocha-ethers-js/README.md +0 -13
  208. package/templates/hardhat-2/01-mocha-ethers-js/contracts/Lock.sol +0 -34
  209. package/templates/hardhat-2/01-mocha-ethers-js/gitignore +0 -17
  210. package/templates/hardhat-2/01-mocha-ethers-js/hardhat.config.js +0 -6
  211. package/templates/hardhat-2/01-mocha-ethers-js/ignition/modules/Lock.js +0 -18
  212. package/templates/hardhat-2/01-mocha-ethers-js/package.json +0 -23
  213. package/templates/hardhat-2/01-mocha-ethers-js/test/Lock.js +0 -126
  214. package/templates/hardhat-2/02-mocha-ethers-js-esm/README.md +0 -13
  215. package/templates/hardhat-2/02-mocha-ethers-js-esm/contracts/Lock.sol +0 -34
  216. package/templates/hardhat-2/02-mocha-ethers-js-esm/gitignore +0 -17
  217. package/templates/hardhat-2/02-mocha-ethers-js-esm/hardhat.config.cjs +0 -6
  218. package/templates/hardhat-2/02-mocha-ethers-js-esm/ignition/modules/Lock.js +0 -18
  219. package/templates/hardhat-2/02-mocha-ethers-js-esm/package.json +0 -24
  220. package/templates/hardhat-2/02-mocha-ethers-js-esm/test/Lock.js +0 -128
  221. package/templates/hardhat-2/03-mocha-ethers-ts/README.md +0 -13
  222. package/templates/hardhat-2/03-mocha-ethers-ts/contracts/Lock.sol +0 -34
  223. package/templates/hardhat-2/03-mocha-ethers-ts/gitignore +0 -17
  224. package/templates/hardhat-2/03-mocha-ethers-ts/hardhat.config.ts +0 -8
  225. package/templates/hardhat-2/03-mocha-ethers-ts/ignition/modules/Lock.ts +0 -20
  226. package/templates/hardhat-2/03-mocha-ethers-ts/package.json +0 -28
  227. package/templates/hardhat-2/03-mocha-ethers-ts/test/Lock.ts +0 -127
  228. package/templates/hardhat-2/03-mocha-ethers-ts/tsconfig.json +0 -11
  229. package/templates/hardhat-2/04-mocha-viem-ts/README.md +0 -13
  230. package/templates/hardhat-2/04-mocha-viem-ts/contracts/Lock.sol +0 -34
  231. package/templates/hardhat-2/04-mocha-viem-ts/gitignore +0 -17
  232. package/templates/hardhat-2/04-mocha-viem-ts/hardhat.config.ts +0 -8
  233. package/templates/hardhat-2/04-mocha-viem-ts/ignition/modules/Lock.ts +0 -21
  234. package/templates/hardhat-2/04-mocha-viem-ts/package.json +0 -25
  235. package/templates/hardhat-2/04-mocha-viem-ts/test/Lock.ts +0 -134
  236. package/templates/hardhat-2/04-mocha-viem-ts/tsconfig.json +0 -11
  237. package/templates/hardhat-2/05-empty-hardhat-config-js/hardhat.config.js +0 -4
  238. package/templates/hardhat-2/05-empty-hardhat-config-js/package.json +0 -9
  239. /package/templates/{hardhat-3/01-node-test-runner-viem → 01-node-test-runner-viem}/AGENTS.md +0 -0
  240. /package/templates/{hardhat-3/01-node-test-runner-viem → 01-node-test-runner-viem}/README.md +0 -0
  241. /package/templates/{hardhat-3/01-node-test-runner-viem → 01-node-test-runner-viem}/contracts/Counter.sol +0 -0
  242. /package/templates/{hardhat-3/01-node-test-runner-viem → 01-node-test-runner-viem}/contracts/Counter.t.sol +0 -0
  243. /package/templates/{hardhat-3/01-node-test-runner-viem → 01-node-test-runner-viem}/gitignore +0 -0
  244. /package/templates/{hardhat-3/01-node-test-runner-viem → 01-node-test-runner-viem}/hardhat.config.ts +0 -0
  245. /package/templates/{hardhat-3/01-node-test-runner-viem → 01-node-test-runner-viem}/ignition/modules/Counter.ts +0 -0
  246. /package/templates/{hardhat-3/01-node-test-runner-viem → 01-node-test-runner-viem}/scripts/send-op-tx.ts +0 -0
  247. /package/templates/{hardhat-3/01-node-test-runner-viem → 01-node-test-runner-viem}/test/Counter.ts +0 -0
  248. /package/templates/{hardhat-3/01-node-test-runner-viem → 01-node-test-runner-viem}/tsconfig.json +0 -0
  249. /package/templates/{hardhat-3/02-mocha-ethers → 02-mocha-ethers}/AGENTS.md +0 -0
  250. /package/templates/{hardhat-3/02-mocha-ethers → 02-mocha-ethers}/README.md +0 -0
  251. /package/templates/{hardhat-3/02-mocha-ethers → 02-mocha-ethers}/contracts/Counter.sol +0 -0
  252. /package/templates/{hardhat-3/02-mocha-ethers → 02-mocha-ethers}/contracts/Counter.t.sol +0 -0
  253. /package/templates/{hardhat-3/02-mocha-ethers → 02-mocha-ethers}/gitignore +0 -0
  254. /package/templates/{hardhat-3/02-mocha-ethers → 02-mocha-ethers}/hardhat.config.ts +0 -0
  255. /package/templates/{hardhat-3/02-mocha-ethers → 02-mocha-ethers}/ignition/modules/Counter.ts +0 -0
  256. /package/templates/{hardhat-3/02-mocha-ethers → 02-mocha-ethers}/scripts/send-op-tx.ts +0 -0
  257. /package/templates/{hardhat-3/02-mocha-ethers → 02-mocha-ethers}/test/Counter.ts +0 -0
  258. /package/templates/{hardhat-3/02-mocha-ethers → 02-mocha-ethers}/tsconfig.json +0 -0
  259. /package/templates/{hardhat-3/03-minimal → 03-minimal}/README.md +0 -0
  260. /package/templates/{hardhat-3/03-minimal → 03-minimal}/gitignore +0 -0
  261. /package/templates/{hardhat-3/03-minimal → 03-minimal}/hardhat.config.ts +0 -0
  262. /package/templates/{hardhat-3/03-minimal → 03-minimal}/tsconfig.json +0 -0
@@ -6,37 +6,6 @@ import { HardhatError } from "@nomicfoundation/hardhat-errors";
6
6
  import { shortenPath } from "@nomicfoundation/hardhat-utils/path";
7
7
  import enquirer from "enquirer";
8
8
 
9
- export async function promptForHardhatVersion(): Promise<
10
- "hardhat-2" | "hardhat-3"
11
- > {
12
- ensureTTY();
13
-
14
- const hardhatVersionResponse = await enquirer.prompt<{
15
- hardhatVersion: "hardhat-2" | "hardhat-3";
16
- }>([
17
- {
18
- name: "hardhatVersion",
19
- type: "select",
20
- message: "Which version of Hardhat would you like to use?",
21
- initial: 0,
22
- choices: [
23
- {
24
- name: "hardhat-3",
25
- message: "Hardhat 3 (recommended for new projects)",
26
- value: "hardhat-3",
27
- },
28
- {
29
- name: "hardhat-2",
30
- message: "Hardhat 2 (older version)",
31
- value: "hardhat-2",
32
- },
33
- ],
34
- },
35
- ]);
36
-
37
- return hardhatVersionResponse.hardhatVersion;
38
- }
39
-
40
9
  export async function promptForWorkspace(): Promise<string> {
41
10
  ensureTTY();
42
11
 
@@ -13,6 +13,21 @@ import {
13
13
  type PackageJson,
14
14
  } from "@nomicfoundation/hardhat-utils/package";
15
15
 
16
+ // Directories that may exist inside a template dir (build/tooling output,
17
+ // dependencies) but are never part of the template itself. They are all
18
+ // gitignored in the templates, but `getAllFilesMatching` does not honor
19
+ // .gitignore, so we must exclude them explicitly.
20
+ const IGNORED_TEMPLATE_DIRS = new Set([
21
+ "node_modules",
22
+ "artifacts",
23
+ "cache",
24
+ "types",
25
+ "dist",
26
+ "bundle",
27
+ "coverage",
28
+ "snapshots",
29
+ ]);
30
+
16
31
  /**
17
32
  * This type describes a hardhat project template. It consists of:
18
33
  * - name: The name of the template;
@@ -34,11 +49,9 @@ export interface Template {
34
49
  *
35
50
  * @returns The list of available templates.
36
51
  */
37
- export async function getTemplates(
38
- templatesDir: "hardhat-2" | "hardhat-3",
39
- ): Promise<Template[]> {
52
+ export async function getTemplates(): Promise<Template[]> {
40
53
  const packageRoot = await findClosestPackageRoot(import.meta.url);
41
- const pathToTemplates = path.join(packageRoot, "templates", templatesDir);
54
+ const pathToTemplates = path.join(packageRoot, "templates");
42
55
 
43
56
  const pathsToTemplates = await readdirOrEmpty(pathToTemplates);
44
57
  pathsToTemplates.sort();
@@ -77,7 +90,7 @@ export async function getTemplates(
77
90
  }
78
91
  return true;
79
92
  },
80
- (dir) => path.basename(dir) !== "node_modules",
93
+ (dir) => !IGNORED_TEMPLATE_DIRS.has(path.basename(dir)),
81
94
  );
82
95
 
83
96
  const files = matchingFiles.map((f) => path.relative(pathToTemplate, f));
@@ -123,7 +123,8 @@ export async function main(
123
123
 
124
124
  if (listTemplates) {
125
125
  throw new HardhatError(
126
- HardhatError.ERRORS.CORE.ARGUMENTS.CANNOT_COMBINE_TEMPLATE_AND_TEMPLATES,
126
+ HardhatError.ERRORS.CORE.ARGUMENTS
127
+ .CANNOT_COMBINE_TEMPLATE_AND_TEMPLATES,
127
128
  );
128
129
  }
129
130
 
@@ -146,7 +147,7 @@ export async function main(
146
147
  }
147
148
 
148
149
  if (listTemplates) {
149
- return await printTemplatesList("hardhat-3", print);
150
+ return await printTemplatesList(print);
150
151
  }
151
152
 
152
153
  if (templateName !== undefined) {
@@ -306,9 +307,9 @@ export async function main(
306
307
 
307
308
  const deprecatedConnectWasCalled = Boolean(
308
309
  "wasConnectCalled" in hre.network &&
309
- hre.network.wasConnectCalled !== undefined &&
310
- typeof hre.network.wasConnectCalled === "function" &&
311
- hre.network.wasConnectCalled(),
310
+ hre.network.wasConnectCalled !== undefined &&
311
+ typeof hre.network.wasConnectCalled === "function" &&
312
+ hre.network.wasConnectCalled(),
312
313
  );
313
314
 
314
315
  if (deprecatedConnectWasCalled) {
@@ -68,13 +68,12 @@ export async function sendTaskAnalytics(
68
68
  }
69
69
 
70
70
  export async function sendProjectTypeAnalytics(
71
- hardhatVersion: "hardhat-2" | "hardhat-3",
72
71
  template: string,
73
72
  ): Promise<boolean> {
74
73
  const initAnalyticsEvent: AnalyticsEvent = {
75
74
  name: "init",
76
75
  params: {
77
- hardhatVersion,
76
+ hardhatVersion: "hardhat-3",
78
77
  template,
79
78
  },
80
79
  };
@@ -82,6 +81,19 @@ export async function sendProjectTypeAnalytics(
82
81
  return await sendAnalytics(initAnalyticsEvent);
83
82
  }
84
83
 
84
+ export async function sendNetworkAnalytics(
85
+ chainType: string,
86
+ ): Promise<boolean> {
87
+ const networkAnalyticsEvent: AnalyticsEvent = {
88
+ name: "network",
89
+ params: {
90
+ chainType,
91
+ },
92
+ };
93
+
94
+ return await sendAnalytics(networkAnalyticsEvent);
95
+ }
96
+
85
97
  // Return a boolean for testing purposes to confirm whether analytics were sent based on the consent value and not in CI environments
86
98
  async function sendAnalytics(analyticsEvent: AnalyticsEvent): Promise<boolean> {
87
99
  if (!(await isTelemetryAllowed())) {
@@ -45,9 +45,15 @@ export type AnalyticsEvent =
45
45
  | {
46
46
  name: "init";
47
47
  params: {
48
- hardhatVersion: "hardhat-2" | "hardhat-3";
48
+ hardhatVersion: "hardhat-3";
49
49
  template: string;
50
50
  };
51
+ }
52
+ | {
53
+ name: "network";
54
+ params: {
55
+ chainType: string;
56
+ };
51
57
  };
52
58
 
53
59
  export interface Payload extends BasePayload {
@@ -22,8 +22,8 @@ function createUnhandledErrorListener(isPromiseRejection: boolean) {
22
22
  ? error
23
23
  : new Error(
24
24
  isObject(error) &&
25
- "message" in error &&
26
- typeof error.message === "string"
25
+ "message" in error &&
26
+ typeof error.message === "string"
27
27
  ? error.message
28
28
  : "Unknown error",
29
29
  { cause: error },
@@ -30,12 +30,10 @@ interface WordMatch {
30
30
  }
31
31
 
32
32
  export type AnonymizeEnvelopeResult =
33
- | { success: true; envelope: Envelope }
34
- | { success: false; error: string };
33
+ { success: true; envelope: Envelope } | { success: false; error: string };
35
34
 
36
35
  export type AnonymizeEventResult =
37
- | { success: true; event: Event }
38
- | { success: false; error: string };
36
+ { success: true; event: Event } | { success: false; error: string };
39
37
 
40
38
  const ANONYMIZED_MNEMONIC = "<mnemonic>";
41
39
  const MNEMONIC_PHRASE_LENGTH_THRESHOLD = 7;
@@ -30,7 +30,8 @@ export function configVariable(
30
30
  ): ConfigurationVariable {
31
31
  if (!format.includes(CONFIGURATION_VARIABLE_MARKER)) {
32
32
  throw new HardhatError(
33
- HardhatError.ERRORS.CORE.GENERAL.CONFIG_VARIABLE_FORMAT_MUST_INCLUDE_VARIABLE,
33
+ HardhatError.ERRORS.CORE.GENERAL
34
+ .CONFIG_VARIABLE_FORMAT_MUST_INCLUDE_VARIABLE,
34
35
  { format, marker: CONFIGURATION_VARIABLE_MARKER },
35
36
  );
36
37
  }
@@ -24,9 +24,7 @@ export function resolveConfigurationVariable(
24
24
  return new LazyResolvedConfigurationVariable(hooks, variable);
25
25
  }
26
26
 
27
- abstract class BaseResolvedConfigurationVariable
28
- implements ResolvedConfigurationVariable
29
- {
27
+ abstract class BaseResolvedConfigurationVariable implements ResolvedConfigurationVariable {
30
28
  public _type: "ResolvedConfigurationVariable" =
31
29
  "ResolvedConfigurationVariable";
32
30
 
@@ -115,6 +113,14 @@ export class LazyResolvedConfigurationVariable extends BaseResolvedConfiguration
115
113
  }
116
114
 
117
115
  protected async _getRawValue(): Promise<string> {
116
+ // Env vars take precedence over every configurationVariables plugin hook
117
+ // (e.g. keystore). Skip the hook chain entirely when the env var is set so
118
+ // plugins are not consulted and cannot override the env value.
119
+ const envValue = process.env[this.#variable.name];
120
+ if (typeof envValue === "string") {
121
+ return envValue;
122
+ }
123
+
118
124
  const mutex = LazyResolvedConfigurationVariable.#mutexes.get(this.#hooks);
119
125
  assertHardhatInvariant(mutex !== undefined, "Mutex must be defined");
120
126
 
@@ -386,8 +386,7 @@ export class HookManagerImplementation implements HookManager {
386
386
  hookCategoryName: HookCategoryNameT,
387
387
  ): Promise<Array<Partial<HardhatHooks[HookCategoryNameT]>>> {
388
388
  const cached = this.#resolvedStaticCategories.get(hookCategoryName) as
389
- | Array<Partial<HardhatHooks[HookCategoryNameT]>>
390
- | undefined;
389
+ Array<Partial<HardhatHooks[HookCategoryNameT]>> | undefined;
391
390
 
392
391
  if (cached !== undefined) {
393
392
  return cached;
@@ -405,8 +404,7 @@ export class HookManagerImplementation implements HookManager {
405
404
  return await this.#mutex.exclusiveRun(async () => {
406
405
  // Re-check under the mutex in case another caller just populated it.
407
406
  const recheck = this.#resolvedStaticCategories.get(hookCategoryName) as
408
- | Array<Partial<HardhatHooks[HookCategoryNameT]>>
409
- | undefined;
407
+ Array<Partial<HardhatHooks[HookCategoryNameT]>> | undefined;
410
408
 
411
409
  if (recheck !== undefined) {
412
410
  return recheck;
@@ -44,9 +44,7 @@ import { LazyUserInterruptionManager } from "./lazy-user-interruptions.js";
44
44
  import { resolvePluginList } from "./plugins/resolve-plugin-list.js";
45
45
  import { TaskManagerImplementation } from "./tasks/task-manager.js";
46
46
 
47
- export class HardhatRuntimeEnvironmentImplementation
48
- implements HardhatRuntimeEnvironment
49
- {
47
+ export class HardhatRuntimeEnvironmentImplementation implements HardhatRuntimeEnvironment {
50
48
  // NOTE: This is a small architectural violation, as these shouldn't be needed
51
49
  // here, because they are added by plugins. But as those plugins are builtin,
52
50
  // their type extensions also affect this module.
@@ -3,8 +3,7 @@ import type { HookManager } from "../../types/hooks.js";
3
3
  import type { UserInterruptionManager } from "../../types/user-interruptions.js";
4
4
 
5
5
  let UserInterruptionManagerImplementation:
6
- | typeof UserInterruptionManagerImplementationT
7
- | undefined;
6
+ typeof UserInterruptionManagerImplementationT | undefined;
8
7
 
9
8
  export class LazyUserInterruptionManager implements UserInterruptionManager {
10
9
  readonly #hooks: HookManager;
@@ -59,9 +58,8 @@ export class LazyUserInterruptionManager implements UserInterruptionManager {
59
58
  // impl, so callers end up holding different impl instances and state,
60
59
  // which can cause concurrency issues.
61
60
  if (UserInterruptionManagerImplementation === undefined) {
62
- ({ UserInterruptionManagerImplementation } = await import(
63
- "./user-interruptions.js"
64
- ));
61
+ ({ UserInterruptionManagerImplementation } =
62
+ await import("./user-interruptions.js"));
65
63
  }
66
64
 
67
65
  if (this.#userInterruptionManager === undefined) {
@@ -31,9 +31,7 @@ import {
31
31
  validatePositionalArgument,
32
32
  } from "./validations.js";
33
33
 
34
- export class EmptyTaskDefinitionBuilderImplementation
35
- implements EmptyTaskDefinitionBuilder
36
- {
34
+ export class EmptyTaskDefinitionBuilderImplementation implements EmptyTaskDefinitionBuilder {
37
35
  readonly #id: string[];
38
36
 
39
37
  readonly #description: string;
@@ -56,12 +54,9 @@ export class EmptyTaskDefinitionBuilderImplementation
56
54
 
57
55
  export class NewTaskDefinitionBuilderImplementation<
58
56
  TaskArgumentsT extends TaskArguments = TaskArguments,
59
- ActionTypeT extends
60
- | "LAZY_ACTION"
61
- | "INLINE_ACTION"
62
- | "MISSING_ACTION" = "MISSING_ACTION",
63
- > implements NewTaskDefinitionBuilder<TaskArgumentsT, ActionTypeT>
64
- {
57
+ ActionTypeT extends "LAZY_ACTION" | "INLINE_ACTION" | "MISSING_ACTION" =
58
+ "MISSING_ACTION",
59
+ > implements NewTaskDefinitionBuilder<TaskArgumentsT, ActionTypeT> {
65
60
  readonly #id: string[];
66
61
  readonly #usedNames: Set<string> = new Set();
67
62
 
@@ -280,8 +275,7 @@ export class NewTaskDefinitionBuilderImplementation<
280
275
  description?: string;
281
276
  type?: TypeT;
282
277
  defaultValue?:
283
- | ArgumentTypeToValueType<TypeT>
284
- | Array<ArgumentTypeToValueType<TypeT>>;
278
+ ArgumentTypeToValueType<TypeT> | Array<ArgumentTypeToValueType<TypeT>>;
285
279
  isVariadic: boolean;
286
280
  }): NewTaskDefinitionBuilder<
287
281
  ExtendTaskArguments<NameT, TypeT, TaskArgumentsT>,
@@ -330,12 +324,9 @@ export class NewTaskDefinitionBuilderImplementation<
330
324
 
331
325
  export class TaskOverrideDefinitionBuilderImplementation<
332
326
  TaskArgumentsT extends TaskArguments = TaskArguments,
333
- ActionTypeT extends
334
- | "LAZY_ACTION"
335
- | "INLINE_ACTION"
336
- | "MISSING_ACTION" = "MISSING_ACTION",
337
- > implements TaskOverrideDefinitionBuilder<TaskArgumentsT, ActionTypeT>
338
- {
327
+ ActionTypeT extends "LAZY_ACTION" | "INLINE_ACTION" | "MISSING_ACTION" =
328
+ "MISSING_ACTION",
329
+ > implements TaskOverrideDefinitionBuilder<TaskArgumentsT, ActionTypeT> {
339
330
  readonly #id: string[];
340
331
 
341
332
  readonly #options: Record<string, OptionDefinition> = {};
@@ -208,7 +208,8 @@ export class ResolvedTask implements Task {
208
208
  value === undefined
209
209
  ) {
210
210
  throw new HardhatError(
211
- HardhatError.ERRORS.CORE.TASK_DEFINITIONS.MISSING_VALUE_FOR_TASK_ARGUMENT,
211
+ HardhatError.ERRORS.CORE.TASK_DEFINITIONS
212
+ .MISSING_VALUE_FOR_TASK_ARGUMENT,
212
213
  {
213
214
  argument: argument.name,
214
215
  task: formatTaskId(this.id),
@@ -265,7 +265,8 @@ export class TaskManagerImplementation implements TaskManager {
265
265
  task.positionalArguments.some((p) => p.name === optionName);
266
266
  if (hasArgument) {
267
267
  throw new HardhatError(
268
- HardhatError.ERRORS.CORE.TASK_DEFINITIONS.TASK_OVERRIDE_OPTION_ALREADY_DEFINED,
268
+ HardhatError.ERRORS.CORE.TASK_DEFINITIONS
269
+ .TASK_OVERRIDE_OPTION_ALREADY_DEFINED,
269
270
  {
270
271
  actorFragment: getActorFragment(pluginId),
271
272
  option: optionName,
@@ -43,7 +43,8 @@ export function validateAction(
43
43
  ): void {
44
44
  if (isPlugin && inlineAction !== undefined) {
45
45
  throw new HardhatError(
46
- HardhatError.ERRORS.CORE.TASK_DEFINITIONS.INLINE_ACTION_CANNOT_BE_USED_IN_PLUGINS,
46
+ HardhatError.ERRORS.CORE.TASK_DEFINITIONS
47
+ .INLINE_ACTION_CANNOT_BE_USED_IN_PLUGINS,
47
48
  { task: formatTaskId(taskId) },
48
49
  );
49
50
  }
@@ -7,9 +7,7 @@ import { styleText } from "node:util";
7
7
  import { assertHardhatInvariant } from "@nomicfoundation/hardhat-errors";
8
8
  import { AsyncMutex } from "@nomicfoundation/hardhat-utils/synchronization";
9
9
 
10
- export class UserInterruptionManagerImplementation
11
- implements UserInterruptionManager
12
- {
10
+ export class UserInterruptionManagerImplementation implements UserInterruptionManager {
13
11
  readonly #hooks;
14
12
  readonly #mutex = new AsyncMutex();
15
13
 
@@ -12,8 +12,7 @@ let hre: HardhatRuntimeEnvironment | undefined;
12
12
  * are always using the same HRE instance.
13
13
  */
14
14
  export function getGlobalHardhatRuntimeEnvironment():
15
- | HardhatRuntimeEnvironment
16
- | undefined {
15
+ HardhatRuntimeEnvironment | undefined {
17
16
  return hre;
18
17
  }
19
18
 
@@ -48,8 +48,7 @@ export type ArtifactContractNames = keyof ArtifactMap extends never
48
48
  * @see {@link ArtifactContractNames}
49
49
  */
50
50
  export type StringWithArtifactContractNamesAutocompletion =
51
- | ArtifactContractNames
52
- | (string & {});
51
+ ArtifactContractNames | (string & {});
53
52
 
54
53
  /**
55
54
  * The ArtifactManager is responsible for reading and writing artifacts from
@@ -151,42 +151,35 @@ export interface BaseCompilationJobCreationError {
151
151
  formattedReason: string;
152
152
  }
153
153
 
154
- export interface CompilationJobCreationErrorNoCompatibleSolcVersionWithRoot
155
- extends BaseCompilationJobCreationError {
154
+ export interface CompilationJobCreationErrorNoCompatibleSolcVersionWithRoot extends BaseCompilationJobCreationError {
156
155
  reason: CompilationJobCreationErrorReason.NO_COMPATIBLE_SOLC_VERSION_WITH_ROOT;
157
156
  }
158
157
 
159
- export interface CompilationJobCreationErrorNoCompatibleSolcVersionWithDependency
160
- extends BaseCompilationJobCreationError {
158
+ export interface CompilationJobCreationErrorNoCompatibleSolcVersionWithDependency extends BaseCompilationJobCreationError {
161
159
  reason: CompilationJobCreationErrorReason.NO_COMPATIBLE_SOLC_VERSION_WITH_DEPENDENCY;
162
160
  incompatibleImportPath: string[];
163
161
  }
164
162
 
165
- export interface CompilationJobCreationErrorImportOfIncompatibleFile
166
- extends BaseCompilationJobCreationError {
163
+ export interface CompilationJobCreationErrorImportOfIncompatibleFile extends BaseCompilationJobCreationError {
167
164
  reason: CompilationJobCreationErrorReason.IMPORT_OF_INCOMPATIBLE_FILE;
168
165
  incompatibleImportPath: string[];
169
166
  }
170
167
 
171
- export interface CompilationJobCreationErrorNoCompatibleSolcVersionForTransitiveImportPath
172
- extends BaseCompilationJobCreationError {
168
+ export interface CompilationJobCreationErrorNoCompatibleSolcVersionForTransitiveImportPath extends BaseCompilationJobCreationError {
173
169
  reason: CompilationJobCreationErrorReason.NO_COMPATIBLE_SOLC_VERSION_FOR_TRANSITIVE_IMPORT_PATH;
174
170
  incompatibleImportPath: string[];
175
171
  }
176
172
 
177
- export interface CompilationJobCreationErrorIncompatibleOverriddenSolcVersion
178
- extends BaseCompilationJobCreationError {
173
+ export interface CompilationJobCreationErrorIncompatibleOverriddenSolcVersion extends BaseCompilationJobCreationError {
179
174
  reason: CompilationJobCreationErrorReason.INCOMPATIBLE_OVERRIDDEN_SOLC_VERSION;
180
175
  }
181
176
 
182
- export interface CompilationJobCreationErrorOverriddenSolcVersionIncompatibleWithDependency
183
- extends BaseCompilationJobCreationError {
177
+ export interface CompilationJobCreationErrorOverriddenSolcVersionIncompatibleWithDependency extends BaseCompilationJobCreationError {
184
178
  reason: CompilationJobCreationErrorReason.OVERRIDDEN_SOLC_VERSION_INCOMPATIBLE_WITH_DEPENDENCY;
185
179
  incompatibleImportPath: string[];
186
180
  }
187
181
 
188
- export interface CompilationJobCreationErrorNoCompatibleSolcVersionFound
189
- extends BaseCompilationJobCreationError {
182
+ export interface CompilationJobCreationErrorNoCompatibleSolcVersionFound extends BaseCompilationJobCreationError {
190
183
  reason: CompilationJobCreationErrorReason.NO_COMPATIBLE_SOLC_VERSION_FOUND;
191
184
  }
192
185
 
@@ -209,9 +202,7 @@ export enum FileBuildResultType {
209
202
  }
210
203
 
211
204
  export type FileBuildResult =
212
- | CacheHitFileBuildResult
213
- | SuccessfulFileBuildResult
214
- | FailedFileBuildResult;
205
+ CacheHitFileBuildResult | SuccessfulFileBuildResult | FailedFileBuildResult;
215
206
 
216
207
  export interface CacheHitFileBuildResult {
217
208
  type: FileBuildResultType.CACHE_HIT;
@@ -104,14 +104,12 @@ export interface NpmRootResolutionWithRemappingErrors {
104
104
  remappingErrors: UserRemappingError[];
105
105
  }
106
106
 
107
- export interface NpmRootFileDoesNotExistWithinPackageError
108
- extends ResolvedFileReference {
107
+ export interface NpmRootFileDoesNotExistWithinPackageError extends ResolvedFileReference {
109
108
  type: RootResolutionErrorType.NPM_ROOT_FILE_DOES_NOT_EXIST_WITHIN_ITS_PACKAGE;
110
109
  npmModule: string;
111
110
  }
112
111
 
113
- export interface NpmRootFileWithIncorrectCasingError
114
- extends ResolvedFileReference {
112
+ export interface NpmRootFileWithIncorrectCasingError extends ResolvedFileReference {
115
113
  type: RootResolutionErrorType.NPM_ROOT_FILE_WITH_INCORRECT_CASING;
116
114
  npmModule: string;
117
115
  /**
@@ -141,8 +139,7 @@ export type NpmRootResolutionError =
141
139
  | NpmRootFileNonExportedFileError;
142
140
 
143
141
  export type RootResolutionError =
144
- | ProjectRootResolutionError
145
- | NpmRootResolutionError;
142
+ ProjectRootResolutionError | NpmRootResolutionError;
146
143
 
147
144
  /**
148
145
  * The different types of errors that can happen when resolving an import.
@@ -149,9 +149,7 @@ export type TaskOverrideDefinition = BaseTaskOverrideDefinition &
149
149
  * actual `Task`s.
150
150
  */
151
151
  export type TaskDefinition =
152
- | EmptyTaskDefinition
153
- | NewTaskDefinition
154
- | TaskOverrideDefinition;
152
+ EmptyTaskDefinition | NewTaskDefinition | TaskOverrideDefinition;
155
153
 
156
154
  /**
157
155
  * This helper type adds an argument to an existing TaskArgumentsT.
@@ -188,10 +186,8 @@ export interface EmptyTaskDefinitionBuilder {
188
186
  */
189
187
  export interface NewTaskDefinitionBuilder<
190
188
  TaskArgumentsT extends TaskArguments = TaskArguments,
191
- ActionTypeT extends
192
- | "LAZY_ACTION"
193
- | "INLINE_ACTION"
194
- | "MISSING_ACTION" = "MISSING_ACTION",
189
+ ActionTypeT extends "LAZY_ACTION" | "INLINE_ACTION" | "MISSING_ACTION" =
190
+ "MISSING_ACTION",
195
191
  > {
196
192
  /**
197
193
  * Sets the description of the task.
@@ -369,10 +365,8 @@ export interface NewTaskDefinitionBuilder<
369
365
  */
370
366
  export interface TaskOverrideDefinitionBuilder<
371
367
  TaskArgumentsT extends TaskArguments = TaskArguments,
372
- ActionTypeT extends
373
- | "LAZY_ACTION"
374
- | "INLINE_ACTION"
375
- | "MISSING_ACTION" = "MISSING_ACTION",
368
+ ActionTypeT extends "LAZY_ACTION" | "INLINE_ACTION" | "MISSING_ACTION" =
369
+ "MISSING_ACTION",
376
370
  > {
377
371
  /**
378
372
  * Sets a new description for the task.
@@ -5,7 +5,7 @@
5
5
  "description": "A TypeScript Hardhat project using Node Test Runner and Viem",
6
6
  "type": "module",
7
7
  "devDependencies": {
8
- "hardhat": "workspace:^3.11.0",
8
+ "hardhat": "workspace:^3.12.0",
9
9
  "@nomicfoundation/hardhat-toolbox-viem": "workspace:^5.0.7",
10
10
  "@nomicfoundation/hardhat-ignition": "workspace:^3.1.8",
11
11
  "@types/node": "^22.8.5",
@@ -5,7 +5,7 @@
5
5
  "description": "A TypeScript Hardhat project using Mocha and Ethers.js",
6
6
  "type": "module",
7
7
  "devDependencies": {
8
- "hardhat": "workspace:^3.11.0",
8
+ "hardhat": "workspace:^3.12.0",
9
9
  "@nomicfoundation/hardhat-toolbox-mocha-ethers": "workspace:^3.0.7",
10
10
  "@nomicfoundation/hardhat-ethers": "workspace:^4.0.15",
11
11
  "@nomicfoundation/hardhat-ignition": "workspace:^3.1.8",
@@ -5,7 +5,7 @@
5
5
  "description": "A minimal Hardhat project",
6
6
  "type": "module",
7
7
  "devDependencies": {
8
- "hardhat": "workspace:^3.11.0",
8
+ "hardhat": "workspace:^3.12.0",
9
9
  "@types/node": "^22.8.5",
10
10
  "typescript": "~6.0.3"
11
11
  }
@@ -1,13 +0,0 @@
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 Hardhat Ignition module 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 ignition deploy ./ignition/modules/Lock.js
13
- ```
@@ -1,34 +0,0 @@
1
- // SPDX-License-Identifier: UNLICENSED
2
- pragma solidity ^0.8.28;
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
- }
@@ -1,17 +0,0 @@
1
- node_modules
2
- .env
3
-
4
- # Hardhat files
5
- /cache
6
- /artifacts
7
-
8
- # TypeChain files
9
- /typechain
10
- /typechain-types
11
-
12
- # solidity-coverage files
13
- /coverage
14
- /coverage.json
15
-
16
- # Hardhat Ignition default folder for deployments against a local node
17
- ignition/deployments/chain-31337
@@ -1,6 +0,0 @@
1
- require("@nomicfoundation/hardhat-toolbox");
2
-
3
- /** @type import('hardhat/config').HardhatUserConfig */
4
- module.exports = {
5
- solidity: "0.8.28",
6
- };