hardhat 2.12.3 → 2.12.5
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/builtin-tasks/compile.js +1 -1
- package/builtin-tasks/compile.js.map +1 -1
- package/builtin-tasks/flatten.js +9 -3
- package/builtin-tasks/flatten.js.map +1 -1
- package/internal/artifacts.d.ts.map +1 -1
- package/internal/artifacts.js +6 -10
- package/internal/artifacts.js.map +1 -1
- package/internal/cli/cli.js +10 -1
- package/internal/cli/cli.js.map +1 -1
- package/internal/cli/project-creation.d.ts +1 -0
- package/internal/cli/project-creation.d.ts.map +1 -1
- package/internal/cli/project-creation.js +13 -2
- package/internal/cli/project-creation.js.map +1 -1
- package/internal/core/config/config-resolution.d.ts.map +1 -1
- package/internal/core/config/config-resolution.js +2 -1
- package/internal/core/config/config-resolution.js.map +1 -1
- package/internal/core/errors-list.js +75 -75
- package/internal/core/flamegraph.js +10 -10
- package/internal/core/providers/backwards-compatibility.d.ts.map +1 -1
- package/internal/core/providers/backwards-compatibility.js +3 -0
- package/internal/core/providers/backwards-compatibility.js.map +1 -1
- package/internal/core/providers/gas-providers.d.ts +1 -1
- package/internal/core/providers/gas-providers.d.ts.map +1 -1
- package/internal/core/providers/gas-providers.js +1 -1
- package/internal/core/providers/gas-providers.js.map +1 -1
- package/internal/hardhat-network/jsonrpc/client.d.ts.map +1 -1
- package/internal/hardhat-network/jsonrpc/client.js +5 -3
- package/internal/hardhat-network/jsonrpc/client.js.map +1 -1
- package/internal/hardhat-network/provider/modules/eth.js +4 -4
- package/internal/hardhat-network/stack-traces/error-inferrer.d.ts.map +1 -1
- package/internal/hardhat-network/stack-traces/error-inferrer.js +2 -5
- package/internal/hardhat-network/stack-traces/error-inferrer.js.map +1 -1
- package/internal/hardhat-network/stack-traces/solidity-errors.d.ts.map +1 -1
- package/internal/hardhat-network/stack-traces/solidity-errors.js +2 -1
- package/internal/hardhat-network/stack-traces/solidity-errors.js.map +1 -1
- package/internal/solidity/compiler/index.d.ts.map +1 -1
- package/internal/solidity/compiler/index.js +6 -0
- package/internal/solidity/compiler/index.js.map +1 -1
- package/internal/solidity/dependencyGraph.d.ts.map +1 -1
- package/internal/solidity/dependencyGraph.js +2 -0
- package/internal/solidity/dependencyGraph.js.map +1 -1
- package/internal/util/console.d.ts.map +1 -1
- package/internal/util/console.js +1 -1
- package/internal/util/console.js.map +1 -1
- package/internal/util/download.d.ts +3 -1
- package/internal/util/download.d.ts.map +1 -1
- package/internal/util/download.js +2 -1
- package/internal/util/download.js.map +1 -1
- package/package.json +1 -1
- package/src/builtin-tasks/compile.ts +2 -4
- package/src/builtin-tasks/flatten.ts +14 -3
- package/src/internal/artifacts.ts +6 -15
- package/src/internal/cli/cli.ts +16 -2
- package/src/internal/cli/project-creation.ts +17 -1
- package/src/internal/core/config/config-resolution.ts +4 -3
- package/src/internal/core/errors-list.ts +75 -75
- package/src/internal/core/flamegraph.ts +10 -10
- package/src/internal/core/jsonrpc/types/output/metadata.ts +3 -3
- package/src/internal/core/providers/backwards-compatibility.ts +3 -0
- package/src/internal/core/providers/gas-providers.ts +1 -1
- package/src/internal/hardhat-network/jsonrpc/client.ts +7 -4
- package/src/internal/hardhat-network/provider/modules/eth.ts +4 -4
- package/src/internal/hardhat-network/stack-traces/compiler-to-model.ts +2 -2
- package/src/internal/hardhat-network/stack-traces/error-inferrer.ts +2 -6
- package/src/internal/hardhat-network/stack-traces/solidity-errors.ts +3 -1
- package/src/internal/solidity/compiler/downloader.ts +1 -1
- package/src/internal/solidity/compiler/index.ts +8 -0
- package/src/internal/solidity/dependencyGraph.ts +2 -0
- package/src/internal/util/console.ts +4 -2
- package/src/internal/util/download.ts +3 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"download.js","sourceRoot":"","sources":["../../src/internal/util/download.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAAoB;AACpB,wDAA+B;AAC/B,gDAAwB;AACxB,gDAA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I,EAAE,EAAE,CAC3C,CAAC;AACJ,CAAC;AAlDD,4BAkDC"}
|
package/package.json
CHANGED
|
@@ -748,7 +748,7 @@ subtask(TASK_COMPILE_SOLIDITY_LOG_COMPILATION_ERRORS)
|
|
|
748
748
|
}
|
|
749
749
|
}
|
|
750
750
|
|
|
751
|
-
const hasConsoleErrors = output.errors.some(isConsoleLogError);
|
|
751
|
+
const hasConsoleErrors: boolean = output.errors.some(isConsoleLogError);
|
|
752
752
|
if (hasConsoleErrors) {
|
|
753
753
|
console.error(
|
|
754
754
|
chalk.red(
|
|
@@ -1478,9 +1478,7 @@ function needsCompilation(
|
|
|
1478
1478
|
}
|
|
1479
1479
|
|
|
1480
1480
|
function hasCompilationErrors(output: any): boolean {
|
|
1481
|
-
return (
|
|
1482
|
-
output.errors && output.errors.some((x: any) => x.severity === "error")
|
|
1483
|
-
);
|
|
1481
|
+
return output.errors?.some((x: any) => x.severity === "error");
|
|
1484
1482
|
}
|
|
1485
1483
|
|
|
1486
1484
|
/**
|
|
@@ -19,12 +19,23 @@ function getSortedFiles(dependenciesGraph: DependencyGraph) {
|
|
|
19
19
|
const tsort = require("tsort");
|
|
20
20
|
const graph = tsort();
|
|
21
21
|
|
|
22
|
+
// sort the graph entries to make the results deterministic
|
|
23
|
+
const dependencies = dependenciesGraph
|
|
24
|
+
.entries()
|
|
25
|
+
.sort(([a], [b]) => a.sourceName.localeCompare(b.sourceName));
|
|
26
|
+
|
|
22
27
|
const filesMap: ResolvedFilesMap = {};
|
|
23
|
-
const resolvedFiles =
|
|
28
|
+
const resolvedFiles = dependencies.map(([file, _deps]) => file);
|
|
29
|
+
|
|
24
30
|
resolvedFiles.forEach((f) => (filesMap[f.sourceName] = f));
|
|
25
31
|
|
|
26
|
-
for (const [from, deps] of
|
|
27
|
-
|
|
32
|
+
for (const [from, deps] of dependencies) {
|
|
33
|
+
// sort the dependencies to make the results deterministic
|
|
34
|
+
const sortedDeps = [...deps].sort((a, b) =>
|
|
35
|
+
a.sourceName.localeCompare(b.sourceName)
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
for (const to of sortedDeps) {
|
|
28
39
|
graph.add(to.sourceName, from.sourceName);
|
|
29
40
|
}
|
|
30
41
|
}
|
|
@@ -917,31 +917,22 @@ export function getArtifactFromContractOutput(
|
|
|
917
917
|
contractName: string,
|
|
918
918
|
contractOutput: any
|
|
919
919
|
): Artifact {
|
|
920
|
-
const evmBytecode = contractOutput.evm
|
|
921
|
-
let bytecode: string =
|
|
922
|
-
evmBytecode && evmBytecode.object ? evmBytecode.object : "";
|
|
920
|
+
const evmBytecode = contractOutput.evm?.bytecode;
|
|
921
|
+
let bytecode: string = evmBytecode?.object ?? "";
|
|
923
922
|
|
|
924
923
|
if (bytecode.slice(0, 2).toLowerCase() !== "0x") {
|
|
925
924
|
bytecode = `0x${bytecode}`;
|
|
926
925
|
}
|
|
927
926
|
|
|
928
|
-
const evmDeployedBytecode =
|
|
929
|
-
|
|
930
|
-
let deployedBytecode: string =
|
|
931
|
-
evmDeployedBytecode && evmDeployedBytecode.object
|
|
932
|
-
? evmDeployedBytecode.object
|
|
933
|
-
: "";
|
|
927
|
+
const evmDeployedBytecode = contractOutput.evm?.deployedBytecode;
|
|
928
|
+
let deployedBytecode: string = evmDeployedBytecode?.object ?? "";
|
|
934
929
|
|
|
935
930
|
if (deployedBytecode.slice(0, 2).toLowerCase() !== "0x") {
|
|
936
931
|
deployedBytecode = `0x${deployedBytecode}`;
|
|
937
932
|
}
|
|
938
933
|
|
|
939
|
-
const linkReferences =
|
|
940
|
-
|
|
941
|
-
const deployedLinkReferences =
|
|
942
|
-
evmDeployedBytecode && evmDeployedBytecode.linkReferences
|
|
943
|
-
? evmDeployedBytecode.linkReferences
|
|
944
|
-
: {};
|
|
934
|
+
const linkReferences = evmBytecode?.linkReferences ?? {};
|
|
935
|
+
const deployedLinkReferences = evmDeployedBytecode?.linkReferences ?? {};
|
|
945
936
|
|
|
946
937
|
return {
|
|
947
938
|
_format: ARTIFACT_FORMAT_VERSION,
|
package/src/internal/cli/cli.ts
CHANGED
|
@@ -39,7 +39,7 @@ import { saveFlamegraph } from "../core/flamegraph";
|
|
|
39
39
|
import { Analytics } from "./analytics";
|
|
40
40
|
import { ArgumentsParser } from "./ArgumentsParser";
|
|
41
41
|
import { enableEmoji } from "./emoji";
|
|
42
|
-
import { createProject } from "./project-creation";
|
|
42
|
+
import { createProject, showSoliditySurveyMessage } from "./project-creation";
|
|
43
43
|
import { confirmHHVSCodeInstallation, confirmTelemetryConsent } from "./prompt";
|
|
44
44
|
import {
|
|
45
45
|
InstallationState,
|
|
@@ -171,7 +171,11 @@ async function main() {
|
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
if (
|
|
174
|
+
if (
|
|
175
|
+
process.env.HARDHAT_EXPERIMENTAL_ALLOW_NON_LOCAL_INSTALLATION !==
|
|
176
|
+
"true" &&
|
|
177
|
+
!isHardhatInstalledLocallyOrLinked()
|
|
178
|
+
) {
|
|
175
179
|
throw new HardhatError(ERRORS.GENERAL.NON_LOCAL_INSTALLATION);
|
|
176
180
|
}
|
|
177
181
|
|
|
@@ -301,6 +305,16 @@ async function main() {
|
|
|
301
305
|
process.stdout.isTTY === true
|
|
302
306
|
) {
|
|
303
307
|
await suggestInstallingHardhatVscode();
|
|
308
|
+
|
|
309
|
+
// we show the solidity survey message if the tests failed and only
|
|
310
|
+
// 1/3 of the time
|
|
311
|
+
if (
|
|
312
|
+
process.exitCode !== 0 &&
|
|
313
|
+
Math.random() < 0.3333 &&
|
|
314
|
+
process.env.HARDHAT_HIDE_SOLIDITY_SURVEY_MESSAGE !== "true"
|
|
315
|
+
) {
|
|
316
|
+
showSoliditySurveyMessage();
|
|
317
|
+
}
|
|
304
318
|
}
|
|
305
319
|
|
|
306
320
|
log(`Killing Hardhat after successfully running task ${taskName}`);
|
|
@@ -138,7 +138,7 @@ async function copySampleProject(
|
|
|
138
138
|
"this file already exists",
|
|
139
139
|
"these files already exist"
|
|
140
140
|
)}: ${existingFiles.join(", ")}
|
|
141
|
-
|
|
141
|
+
|
|
142
142
|
Please delete or move them and try again.`;
|
|
143
143
|
console.log(chalk.red(errorMsg));
|
|
144
144
|
process.exit(1);
|
|
@@ -252,6 +252,20 @@ function showStarOnGitHubMessage() {
|
|
|
252
252
|
console.log(chalk.cyan(" https://github.com/NomicFoundation/hardhat"));
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
+
export function showSoliditySurveyMessage() {
|
|
256
|
+
if (new Date() > new Date("2023-07-01 23:39")) {
|
|
257
|
+
// the survey has finished
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
console.log();
|
|
262
|
+
console.log(
|
|
263
|
+
chalk.cyan(
|
|
264
|
+
"Please take a moment to complete the 2022 Solidity Survey: https://hardhat.org/solidity-survey-2022"
|
|
265
|
+
)
|
|
266
|
+
);
|
|
267
|
+
}
|
|
268
|
+
|
|
255
269
|
export async function createProject() {
|
|
256
270
|
printAsciiLogo();
|
|
257
271
|
|
|
@@ -287,6 +301,7 @@ export async function createProject() {
|
|
|
287
301
|
|
|
288
302
|
console.log();
|
|
289
303
|
showStarOnGitHubMessage();
|
|
304
|
+
showSoliditySurveyMessage();
|
|
290
305
|
|
|
291
306
|
return;
|
|
292
307
|
}
|
|
@@ -387,6 +402,7 @@ export async function createProject() {
|
|
|
387
402
|
console.log("See the README.md file for some example tasks you can run");
|
|
388
403
|
console.log();
|
|
389
404
|
showStarOnGitHubMessage();
|
|
405
|
+
showSoliditySurveyMessage();
|
|
390
406
|
}
|
|
391
407
|
|
|
392
408
|
async function canInstallRecommendedDeps() {
|
|
@@ -408,9 +408,10 @@ function resolveCompiler(compiler: SolcUserConfig): SolcConfig {
|
|
|
408
408
|
}
|
|
409
409
|
|
|
410
410
|
for (const output of outputs) {
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
411
|
+
const includesOutput: boolean =
|
|
412
|
+
resolved.settings.outputSelection[file][contract].includes(output);
|
|
413
|
+
|
|
414
|
+
if (!includesOutput) {
|
|
414
415
|
resolved.settings.outputSelection[file][contract].push(output);
|
|
415
416
|
}
|
|
416
417
|
}
|