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.
- package/CHANGELOG.md +37 -2
- package/dist/src/internal/builtin-plugins/artifacts/artifact-manager.js.map +1 -1
- package/dist/src/internal/builtin-plugins/artifacts/hook-handlers/hre.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/artifacts/hook-handlers/hre.js +2 -1
- package/dist/src/internal/builtin-plugins/artifacts/hook-handlers/hre.js.map +1 -1
- package/dist/src/internal/builtin-plugins/coverage/hook-handlers/hre.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/coverage/hook-handlers/hre.js +2 -1
- package/dist/src/internal/builtin-plugins/coverage/hook-handlers/hre.js.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/function-gas-snapshots.js +3 -3
- package/dist/src/internal/builtin-plugins/gas-analytics/function-gas-snapshots.js.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/hook-handlers/hre.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/hook-handlers/hre.js +2 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/hook-handlers/hre.js.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/snapshot-cheatcodes.js +3 -3
- package/dist/src/internal/builtin-plugins/gas-analytics/snapshot-cheatcodes.js.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/tasks/solidity-test/task-action.d.ts +17 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/tasks/solidity-test/task-action.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/tasks/solidity-test/task-action.js +18 -4
- package/dist/src/internal/builtin-plugins/gas-analytics/tasks/solidity-test/task-action.js.map +1 -1
- package/dist/src/internal/builtin-plugins/hhu/types.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/accounts/derive-private-keys.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/edr-constants.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/edr-constants.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/edr-provider.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/edr-provider.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/hook-handlers/hre.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/network-connection.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/network-connection.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/network-manager.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/network-manager.js +9 -1
- package/dist/src/internal/builtin-plugins/network-manager/network-manager.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/request-handlers/handlers/accounts/local-accounts.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/request-handlers/handlers/accounts/local-accounts.js +10 -5
- package/dist/src/internal/builtin-plugins/network-manager/request-handlers/handlers/accounts/local-accounts.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/type-extensions/config.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-results.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-results.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/build-system.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/build-system.js +13 -8
- package/dist/src/internal/builtin-plugins/solidity/build-system/build-system.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/compilation-job.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/compilation-job.js +2 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/compilation-job.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/remapped-npm-packages-graph.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/remapped-npm-packages-graph.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/types.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/config.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/config.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/hook-handlers/hre.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/hook-handlers/hre.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/type-extensions.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/helpers.d.ts +2 -1
- package/dist/src/internal/builtin-plugins/solidity-test/helpers.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/helpers.js +3 -2
- package/dist/src/internal/builtin-plugins/solidity-test/helpers.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/index.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/index.js +6 -0
- package/dist/src/internal/builtin-plugins/solidity-test/index.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/inline-config/index.js +4 -2
- package/dist/src/internal/builtin-plugins/solidity-test/inline-config/index.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/inline-config/parsing.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/inline-config/parsing.js +2 -1
- package/dist/src/internal/builtin-plugins/solidity-test/inline-config/parsing.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/inline-config/validation.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/inline-config/validation.js +2 -1
- package/dist/src/internal/builtin-plugins/solidity-test/inline-config/validation.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/reporter.js +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/reporter.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/runner.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/runner.js +2 -1
- package/dist/src/internal/builtin-plugins/solidity-test/runner.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/task-action.d.ts +1 -0
- package/dist/src/internal/builtin-plugins/solidity-test/task-action.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/task-action.js +6 -3
- package/dist/src/internal/builtin-plugins/solidity-test/task-action.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/type-extensions.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/test/index.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/test/index.js +6 -0
- package/dist/src/internal/builtin-plugins/test/index.js.map +1 -1
- package/dist/src/internal/builtin-plugins/test/task-action.d.ts +1 -0
- package/dist/src/internal/builtin-plugins/test/task-action.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/test/task-action.js +7 -2
- package/dist/src/internal/builtin-plugins/test/task-action.js.map +1 -1
- package/dist/src/internal/cli/error-handler.js +2 -1
- package/dist/src/internal/cli/error-handler.js.map +1 -1
- package/dist/src/internal/cli/init/init.d.ts +3 -8
- package/dist/src/internal/cli/init/init.d.ts.map +1 -1
- package/dist/src/internal/cli/init/init.js +9 -27
- package/dist/src/internal/cli/init/init.js.map +1 -1
- package/dist/src/internal/cli/init/prompt.d.ts +0 -1
- package/dist/src/internal/cli/init/prompt.d.ts.map +1 -1
- package/dist/src/internal/cli/init/prompt.js +0 -24
- package/dist/src/internal/cli/init/prompt.js.map +1 -1
- package/dist/src/internal/cli/init/template.d.ts +1 -1
- package/dist/src/internal/cli/init/template.d.ts.map +1 -1
- package/dist/src/internal/cli/init/template.js +17 -3
- package/dist/src/internal/cli/init/template.js.map +1 -1
- package/dist/src/internal/cli/main.d.ts.map +1 -1
- package/dist/src/internal/cli/main.js +3 -2
- package/dist/src/internal/cli/main.js.map +1 -1
- package/dist/src/internal/cli/telemetry/analytics/analytics.d.ts +2 -1
- package/dist/src/internal/cli/telemetry/analytics/analytics.d.ts.map +1 -1
- package/dist/src/internal/cli/telemetry/analytics/analytics.js +11 -2
- package/dist/src/internal/cli/telemetry/analytics/analytics.js.map +1 -1
- package/dist/src/internal/cli/telemetry/analytics/types.d.ts +6 -1
- package/dist/src/internal/cli/telemetry/analytics/types.d.ts.map +1 -1
- package/dist/src/internal/cli/telemetry/error-reporter/global-error-handlers.js.map +1 -1
- package/dist/src/internal/cli/telemetry/sentry/anonymizer.d.ts.map +1 -1
- package/dist/src/internal/cli/telemetry/sentry/anonymizer.js.map +1 -1
- package/dist/src/internal/core/config.d.ts.map +1 -1
- package/dist/src/internal/core/config.js +2 -1
- package/dist/src/internal/core/config.js.map +1 -1
- package/dist/src/internal/core/configuration-variables.d.ts.map +1 -1
- package/dist/src/internal/core/configuration-variables.js +7 -0
- package/dist/src/internal/core/configuration-variables.js.map +1 -1
- package/dist/src/internal/core/hook-manager.d.ts.map +1 -1
- package/dist/src/internal/core/hook-manager.js.map +1 -1
- package/dist/src/internal/core/hre.d.ts.map +1 -1
- package/dist/src/internal/core/hre.js.map +1 -1
- package/dist/src/internal/core/lazy-user-interruptions.d.ts.map +1 -1
- package/dist/src/internal/core/lazy-user-interruptions.js +2 -1
- package/dist/src/internal/core/lazy-user-interruptions.js.map +1 -1
- package/dist/src/internal/core/tasks/builders.d.ts.map +1 -1
- package/dist/src/internal/core/tasks/builders.js.map +1 -1
- package/dist/src/internal/core/tasks/resolved-task.d.ts.map +1 -1
- package/dist/src/internal/core/tasks/resolved-task.js +2 -1
- package/dist/src/internal/core/tasks/resolved-task.js.map +1 -1
- package/dist/src/internal/core/tasks/task-manager.d.ts.map +1 -1
- package/dist/src/internal/core/tasks/task-manager.js +2 -1
- package/dist/src/internal/core/tasks/task-manager.js.map +1 -1
- package/dist/src/internal/core/tasks/validations.d.ts.map +1 -1
- package/dist/src/internal/core/tasks/validations.js +2 -1
- package/dist/src/internal/core/tasks/validations.js.map +1 -1
- package/dist/src/internal/core/user-interruptions.d.ts.map +1 -1
- package/dist/src/internal/core/user-interruptions.js.map +1 -1
- package/dist/src/internal/global-hre-instance.d.ts.map +1 -1
- package/dist/src/internal/global-hre-instance.js.map +1 -1
- package/dist/src/types/artifacts.d.ts.map +1 -1
- package/dist/src/types/solidity/build-system.d.ts.map +1 -1
- package/dist/src/types/solidity/build-system.js.map +1 -1
- package/dist/src/types/solidity/errors.d.ts.map +1 -1
- package/dist/src/types/solidity/errors.js.map +1 -1
- package/dist/src/types/tasks.d.ts.map +1 -1
- package/package.json +14 -14
- package/src/internal/builtin-plugins/artifacts/artifact-manager.ts +2 -2
- package/src/internal/builtin-plugins/artifacts/hook-handlers/hre.ts +3 -5
- package/src/internal/builtin-plugins/coverage/hook-handlers/hre.ts +3 -5
- package/src/internal/builtin-plugins/gas-analytics/function-gas-snapshots.ts +3 -3
- package/src/internal/builtin-plugins/gas-analytics/hook-handlers/hre.ts +3 -5
- package/src/internal/builtin-plugins/gas-analytics/snapshot-cheatcodes.ts +3 -3
- package/src/internal/builtin-plugins/gas-analytics/tasks/solidity-test/task-action.ts +32 -5
- package/src/internal/builtin-plugins/hhu/types.ts +1 -2
- package/src/internal/builtin-plugins/network-manager/accounts/derive-private-keys.ts +4 -6
- package/src/internal/builtin-plugins/network-manager/edr/edr-constants.ts +1 -2
- package/src/internal/builtin-plugins/network-manager/edr/edr-provider.ts +2 -3
- package/src/internal/builtin-plugins/network-manager/hook-handlers/hre.ts +2 -3
- package/src/internal/builtin-plugins/network-manager/network-connection.ts +1 -2
- package/src/internal/builtin-plugins/network-manager/network-manager.ts +11 -1
- package/src/internal/builtin-plugins/network-manager/request-handlers/handlers/accounts/local-accounts.ts +10 -9
- package/src/internal/builtin-plugins/network-manager/type-extensions/config.ts +6 -14
- package/src/internal/builtin-plugins/solidity/build-results.ts +1 -2
- package/src/internal/builtin-plugins/solidity/build-system/build-system.ts +15 -7
- package/src/internal/builtin-plugins/solidity/build-system/compilation-job.ts +2 -1
- package/src/internal/builtin-plugins/solidity/build-system/resolver/remapped-npm-packages-graph.ts +1 -3
- package/src/internal/builtin-plugins/solidity/build-system/resolver/types.ts +1 -2
- package/src/internal/builtin-plugins/solidity/config.ts +2 -4
- package/src/internal/builtin-plugins/solidity/hook-handlers/hre.ts +1 -2
- package/src/internal/builtin-plugins/solidity/type-extensions.ts +16 -14
- package/src/internal/builtin-plugins/solidity-test/helpers.ts +5 -1
- package/src/internal/builtin-plugins/solidity-test/index.ts +6 -0
- package/src/internal/builtin-plugins/solidity-test/inline-config/index.ts +4 -2
- package/src/internal/builtin-plugins/solidity-test/inline-config/parsing.ts +2 -1
- package/src/internal/builtin-plugins/solidity-test/inline-config/validation.ts +2 -1
- package/src/internal/builtin-plugins/solidity-test/reporter.ts +1 -1
- package/src/internal/builtin-plugins/solidity-test/runner.ts +2 -1
- package/src/internal/builtin-plugins/solidity-test/task-action.ts +7 -3
- package/src/internal/builtin-plugins/solidity-test/type-extensions.ts +1 -2
- package/src/internal/builtin-plugins/test/index.ts +6 -0
- package/src/internal/builtin-plugins/test/task-action.ts +10 -2
- package/src/internal/cli/error-handler.ts +2 -3
- package/src/internal/cli/init/init.ts +4 -38
- package/src/internal/cli/init/prompt.ts +0 -31
- package/src/internal/cli/init/template.ts +18 -5
- package/src/internal/cli/main.ts +6 -5
- package/src/internal/cli/telemetry/analytics/analytics.ts +14 -2
- package/src/internal/cli/telemetry/analytics/types.ts +7 -1
- package/src/internal/cli/telemetry/error-reporter/global-error-handlers.ts +2 -2
- package/src/internal/cli/telemetry/sentry/anonymizer.ts +2 -4
- package/src/internal/core/config.ts +2 -1
- package/src/internal/core/configuration-variables.ts +9 -3
- package/src/internal/core/hook-manager.ts +2 -4
- package/src/internal/core/hre.ts +1 -3
- package/src/internal/core/lazy-user-interruptions.ts +3 -5
- package/src/internal/core/tasks/builders.ts +8 -17
- package/src/internal/core/tasks/resolved-task.ts +2 -1
- package/src/internal/core/tasks/task-manager.ts +2 -1
- package/src/internal/core/tasks/validations.ts +2 -1
- package/src/internal/core/user-interruptions.ts +1 -3
- package/src/internal/global-hre-instance.ts +1 -2
- package/src/types/artifacts.ts +1 -2
- package/src/types/solidity/build-system.ts +8 -17
- package/src/types/solidity/errors.ts +3 -6
- package/src/types/tasks.ts +5 -11
- package/templates/{hardhat-3/01-node-test-runner-viem → 01-node-test-runner-viem}/package.json +1 -1
- package/templates/{hardhat-3/02-mocha-ethers → 02-mocha-ethers}/package.json +1 -1
- package/templates/{hardhat-3/03-minimal → 03-minimal}/package.json +1 -1
- package/templates/hardhat-2/01-mocha-ethers-js/README.md +0 -13
- package/templates/hardhat-2/01-mocha-ethers-js/contracts/Lock.sol +0 -34
- package/templates/hardhat-2/01-mocha-ethers-js/gitignore +0 -17
- package/templates/hardhat-2/01-mocha-ethers-js/hardhat.config.js +0 -6
- package/templates/hardhat-2/01-mocha-ethers-js/ignition/modules/Lock.js +0 -18
- package/templates/hardhat-2/01-mocha-ethers-js/package.json +0 -23
- package/templates/hardhat-2/01-mocha-ethers-js/test/Lock.js +0 -126
- package/templates/hardhat-2/02-mocha-ethers-js-esm/README.md +0 -13
- package/templates/hardhat-2/02-mocha-ethers-js-esm/contracts/Lock.sol +0 -34
- package/templates/hardhat-2/02-mocha-ethers-js-esm/gitignore +0 -17
- package/templates/hardhat-2/02-mocha-ethers-js-esm/hardhat.config.cjs +0 -6
- package/templates/hardhat-2/02-mocha-ethers-js-esm/ignition/modules/Lock.js +0 -18
- package/templates/hardhat-2/02-mocha-ethers-js-esm/package.json +0 -24
- package/templates/hardhat-2/02-mocha-ethers-js-esm/test/Lock.js +0 -128
- package/templates/hardhat-2/03-mocha-ethers-ts/README.md +0 -13
- package/templates/hardhat-2/03-mocha-ethers-ts/contracts/Lock.sol +0 -34
- package/templates/hardhat-2/03-mocha-ethers-ts/gitignore +0 -17
- package/templates/hardhat-2/03-mocha-ethers-ts/hardhat.config.ts +0 -8
- package/templates/hardhat-2/03-mocha-ethers-ts/ignition/modules/Lock.ts +0 -20
- package/templates/hardhat-2/03-mocha-ethers-ts/package.json +0 -28
- package/templates/hardhat-2/03-mocha-ethers-ts/test/Lock.ts +0 -127
- package/templates/hardhat-2/03-mocha-ethers-ts/tsconfig.json +0 -11
- package/templates/hardhat-2/04-mocha-viem-ts/README.md +0 -13
- package/templates/hardhat-2/04-mocha-viem-ts/contracts/Lock.sol +0 -34
- package/templates/hardhat-2/04-mocha-viem-ts/gitignore +0 -17
- package/templates/hardhat-2/04-mocha-viem-ts/hardhat.config.ts +0 -8
- package/templates/hardhat-2/04-mocha-viem-ts/ignition/modules/Lock.ts +0 -21
- package/templates/hardhat-2/04-mocha-viem-ts/package.json +0 -25
- package/templates/hardhat-2/04-mocha-viem-ts/test/Lock.ts +0 -134
- package/templates/hardhat-2/04-mocha-viem-ts/tsconfig.json +0 -11
- package/templates/hardhat-2/05-empty-hardhat-config-js/hardhat.config.js +0 -4
- package/templates/hardhat-2/05-empty-hardhat-config-js/package.json +0 -9
- /package/templates/{hardhat-3/01-node-test-runner-viem → 01-node-test-runner-viem}/AGENTS.md +0 -0
- /package/templates/{hardhat-3/01-node-test-runner-viem → 01-node-test-runner-viem}/README.md +0 -0
- /package/templates/{hardhat-3/01-node-test-runner-viem → 01-node-test-runner-viem}/contracts/Counter.sol +0 -0
- /package/templates/{hardhat-3/01-node-test-runner-viem → 01-node-test-runner-viem}/contracts/Counter.t.sol +0 -0
- /package/templates/{hardhat-3/01-node-test-runner-viem → 01-node-test-runner-viem}/gitignore +0 -0
- /package/templates/{hardhat-3/01-node-test-runner-viem → 01-node-test-runner-viem}/hardhat.config.ts +0 -0
- /package/templates/{hardhat-3/01-node-test-runner-viem → 01-node-test-runner-viem}/ignition/modules/Counter.ts +0 -0
- /package/templates/{hardhat-3/01-node-test-runner-viem → 01-node-test-runner-viem}/scripts/send-op-tx.ts +0 -0
- /package/templates/{hardhat-3/01-node-test-runner-viem → 01-node-test-runner-viem}/test/Counter.ts +0 -0
- /package/templates/{hardhat-3/01-node-test-runner-viem → 01-node-test-runner-viem}/tsconfig.json +0 -0
- /package/templates/{hardhat-3/02-mocha-ethers → 02-mocha-ethers}/AGENTS.md +0 -0
- /package/templates/{hardhat-3/02-mocha-ethers → 02-mocha-ethers}/README.md +0 -0
- /package/templates/{hardhat-3/02-mocha-ethers → 02-mocha-ethers}/contracts/Counter.sol +0 -0
- /package/templates/{hardhat-3/02-mocha-ethers → 02-mocha-ethers}/contracts/Counter.t.sol +0 -0
- /package/templates/{hardhat-3/02-mocha-ethers → 02-mocha-ethers}/gitignore +0 -0
- /package/templates/{hardhat-3/02-mocha-ethers → 02-mocha-ethers}/hardhat.config.ts +0 -0
- /package/templates/{hardhat-3/02-mocha-ethers → 02-mocha-ethers}/ignition/modules/Counter.ts +0 -0
- /package/templates/{hardhat-3/02-mocha-ethers → 02-mocha-ethers}/scripts/send-op-tx.ts +0 -0
- /package/templates/{hardhat-3/02-mocha-ethers → 02-mocha-ethers}/test/Counter.ts +0 -0
- /package/templates/{hardhat-3/02-mocha-ethers → 02-mocha-ethers}/tsconfig.json +0 -0
- /package/templates/{hardhat-3/03-minimal → 03-minimal}/README.md +0 -0
- /package/templates/{hardhat-3/03-minimal → 03-minimal}/gitignore +0 -0
- /package/templates/{hardhat-3/03-minimal → 03-minimal}/hardhat.config.ts +0 -0
- /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"
|
|
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)
|
|
93
|
+
(dir) => !IGNORED_TEMPLATE_DIRS.has(path.basename(dir)),
|
|
81
94
|
);
|
|
82
95
|
|
|
83
96
|
const files = matchingFiles.map((f) => path.relative(pathToTemplate, f));
|
package/src/internal/cli/main.ts
CHANGED
|
@@ -123,7 +123,8 @@ export async function main(
|
|
|
123
123
|
|
|
124
124
|
if (listTemplates) {
|
|
125
125
|
throw new HardhatError(
|
|
126
|
-
HardhatError.ERRORS.CORE.ARGUMENTS
|
|
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(
|
|
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
|
-
|
|
310
|
-
|
|
311
|
-
|
|
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-
|
|
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
|
-
|
|
26
|
-
|
|
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
|
-
|
|
34
|
-
| { success: false; error: string };
|
|
33
|
+
{ success: true; envelope: Envelope } | { success: false; error: string };
|
|
35
34
|
|
|
36
35
|
export type AnonymizeEventResult =
|
|
37
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
409
|
-
| undefined;
|
|
407
|
+
Array<Partial<HardhatHooks[HookCategoryNameT]>> | undefined;
|
|
410
408
|
|
|
411
409
|
if (recheck !== undefined) {
|
|
412
410
|
return recheck;
|
package/src/internal/core/hre.ts
CHANGED
|
@@ -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
|
-
|
|
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 } =
|
|
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
|
-
|
|
61
|
-
|
|
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
|
-
|
|
335
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
|
16
|
-
| undefined {
|
|
15
|
+
HardhatRuntimeEnvironment | undefined {
|
|
17
16
|
return hre;
|
|
18
17
|
}
|
|
19
18
|
|
package/src/types/artifacts.ts
CHANGED
|
@@ -48,8 +48,7 @@ export type ArtifactContractNames = keyof ArtifactMap extends never
|
|
|
48
48
|
* @see {@link ArtifactContractNames}
|
|
49
49
|
*/
|
|
50
50
|
export type StringWithArtifactContractNamesAutocompletion =
|
|
51
|
-
|
|
|
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
|
-
|
|
|
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
|
-
|
|
|
145
|
-
| NpmRootResolutionError;
|
|
142
|
+
ProjectRootResolutionError | NpmRootResolutionError;
|
|
146
143
|
|
|
147
144
|
/**
|
|
148
145
|
* The different types of errors that can happen when resolving an import.
|
package/src/types/tasks.ts
CHANGED
|
@@ -149,9 +149,7 @@ export type TaskOverrideDefinition = BaseTaskOverrideDefinition &
|
|
|
149
149
|
* actual `Task`s.
|
|
150
150
|
*/
|
|
151
151
|
export type TaskDefinition =
|
|
152
|
-
|
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
package/templates/{hardhat-3/01-node-test-runner-viem → 01-node-test-runner-viem}/package.json
RENAMED
|
@@ -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.
|
|
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.
|
|
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",
|
|
@@ -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
|