hardhat 2.8.4 → 2.9.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 (157) hide show
  1. package/LICENSE +3 -61
  2. package/README.md +1 -1
  3. package/builtin-tasks/compile.js +86 -51
  4. package/builtin-tasks/compile.js.map +1 -1
  5. package/builtin-tasks/node.js.map +1 -1
  6. package/builtin-tasks/test.js +30 -5
  7. package/builtin-tasks/test.js.map +1 -1
  8. package/builtin-tasks/utils/solidity-files-cache.d.ts.map +1 -1
  9. package/builtin-tasks/utils/solidity-files-cache.js.map +1 -1
  10. package/internal/cli/analytics.js +2 -2
  11. package/internal/cli/analytics.js.map +1 -1
  12. package/internal/cli/cli.js +3 -3
  13. package/internal/cli/project-creation.d.ts.map +1 -1
  14. package/internal/cli/project-creation.js +23 -0
  15. package/internal/cli/project-creation.js.map +1 -1
  16. package/internal/core/config/config-loading.d.ts.map +1 -1
  17. package/internal/core/config/config-loading.js.map +1 -1
  18. package/internal/core/config/config-validation.d.ts.map +1 -1
  19. package/internal/core/config/config-validation.js +2 -2
  20. package/internal/core/config/config-validation.js.map +1 -1
  21. package/internal/core/config/default-config.d.ts +2 -0
  22. package/internal/core/config/default-config.d.ts.map +1 -1
  23. package/internal/core/config/default-config.js +1 -0
  24. package/internal/core/config/default-config.js.map +1 -1
  25. package/internal/core/errors-list.d.ts +7 -0
  26. package/internal/core/errors-list.d.ts.map +1 -1
  27. package/internal/core/errors-list.js +13 -0
  28. package/internal/core/errors-list.js.map +1 -1
  29. package/internal/core/providers/accounts.d.ts +1 -1
  30. package/internal/core/providers/accounts.d.ts.map +1 -1
  31. package/internal/core/providers/accounts.js +2 -2
  32. package/internal/core/providers/accounts.js.map +1 -1
  33. package/internal/core/providers/construction.d.ts.map +1 -1
  34. package/internal/core/providers/construction.js +1 -1
  35. package/internal/core/providers/construction.js.map +1 -1
  36. package/internal/core/providers/http.d.ts +5 -1
  37. package/internal/core/providers/http.d.ts.map +1 -1
  38. package/internal/core/providers/http.js +35 -31
  39. package/internal/core/providers/http.js.map +1 -1
  40. package/internal/core/providers/util.d.ts +1 -1
  41. package/internal/core/providers/util.d.ts.map +1 -1
  42. package/internal/core/providers/util.js +3 -3
  43. package/internal/core/providers/util.js.map +1 -1
  44. package/internal/hardhat-network/jsonrpc/server.d.ts.map +1 -1
  45. package/internal/hardhat-network/jsonrpc/server.js +7 -2
  46. package/internal/hardhat-network/jsonrpc/server.js.map +1 -1
  47. package/internal/hardhat-network/provider/BlockchainBase.d.ts +26 -0
  48. package/internal/hardhat-network/provider/BlockchainBase.d.ts.map +1 -0
  49. package/internal/hardhat-network/provider/BlockchainBase.js +92 -0
  50. package/internal/hardhat-network/provider/BlockchainBase.js.map +1 -0
  51. package/internal/hardhat-network/provider/BlockchainData.d.ts +32 -0
  52. package/internal/hardhat-network/provider/BlockchainData.d.ts.map +1 -1
  53. package/internal/hardhat-network/provider/BlockchainData.js +78 -1
  54. package/internal/hardhat-network/provider/BlockchainData.js.map +1 -1
  55. package/internal/hardhat-network/provider/HardhatBlockchain.d.ts +9 -15
  56. package/internal/hardhat-network/provider/HardhatBlockchain.d.ts.map +1 -1
  57. package/internal/hardhat-network/provider/HardhatBlockchain.js +15 -73
  58. package/internal/hardhat-network/provider/HardhatBlockchain.js.map +1 -1
  59. package/internal/hardhat-network/provider/fork/ForkBlockchain.d.ts +6 -14
  60. package/internal/hardhat-network/provider/fork/ForkBlockchain.d.ts.map +1 -1
  61. package/internal/hardhat-network/provider/fork/ForkBlockchain.js +23 -73
  62. package/internal/hardhat-network/provider/fork/ForkBlockchain.js.map +1 -1
  63. package/internal/hardhat-network/provider/modules/eth.js +2 -2
  64. package/internal/hardhat-network/provider/modules/eth.js.map +1 -1
  65. package/internal/hardhat-network/provider/modules/hardhat.d.ts +3 -0
  66. package/internal/hardhat-network/provider/modules/hardhat.d.ts.map +1 -1
  67. package/internal/hardhat-network/provider/modules/hardhat.js +40 -5
  68. package/internal/hardhat-network/provider/modules/hardhat.js.map +1 -1
  69. package/internal/hardhat-network/provider/modules/logger.d.ts +4 -2
  70. package/internal/hardhat-network/provider/modules/logger.d.ts.map +1 -1
  71. package/internal/hardhat-network/provider/modules/logger.js +38 -12
  72. package/internal/hardhat-network/provider/modules/logger.js.map +1 -1
  73. package/internal/hardhat-network/provider/node-types.d.ts +1 -1
  74. package/internal/hardhat-network/provider/node-types.d.ts.map +1 -1
  75. package/internal/hardhat-network/provider/node.d.ts +9 -1
  76. package/internal/hardhat-network/provider/node.d.ts.map +1 -1
  77. package/internal/hardhat-network/provider/node.js +57 -8
  78. package/internal/hardhat-network/provider/node.js.map +1 -1
  79. package/internal/hardhat-network/provider/provider.d.ts +1 -1
  80. package/internal/hardhat-network/provider/provider.d.ts.map +1 -1
  81. package/internal/hardhat-network/provider/provider.js.map +1 -1
  82. package/internal/hardhat-network/provider/types/HardhatBlockchainInterface.d.ts +2 -1
  83. package/internal/hardhat-network/provider/types/HardhatBlockchainInterface.d.ts.map +1 -1
  84. package/internal/hardhat-network/provider/utils/makeForkClient.d.ts.map +1 -1
  85. package/internal/hardhat-network/provider/utils/makeForkClient.js +2 -1
  86. package/internal/hardhat-network/provider/utils/makeForkClient.js.map +1 -1
  87. package/internal/hardhat-network/provider/utils/putGenesisBlock.js +1 -1
  88. package/internal/hardhat-network/stack-traces/debug.js +1 -1
  89. package/internal/hardhat-network/stack-traces/debug.js.map +1 -1
  90. package/internal/hardhat-network/stack-traces/error-inferrer.d.ts.map +1 -1
  91. package/internal/hardhat-network/stack-traces/error-inferrer.js +21 -12
  92. package/internal/hardhat-network/stack-traces/error-inferrer.js.map +1 -1
  93. package/internal/hardhat-network/stack-traces/solidity-errors.js +2 -2
  94. package/internal/hardhat-network/stack-traces/solidity-errors.js.map +1 -1
  95. package/internal/hardhat-network/stack-traces/solidity-stack-trace.d.ts +3 -2
  96. package/internal/hardhat-network/stack-traces/solidity-stack-trace.d.ts.map +1 -1
  97. package/internal/solidity/compilation-job.d.ts.map +1 -1
  98. package/internal/solidity/compilation-job.js.map +1 -1
  99. package/internal/solidity/compiler/downloader.d.ts +2 -2
  100. package/internal/solidity/compiler/downloader.d.ts.map +1 -1
  101. package/internal/solidity/compiler/downloader.js +3 -3
  102. package/internal/solidity/compiler/downloader.js.map +1 -1
  103. package/internal/util/download.d.ts.map +1 -1
  104. package/internal/util/download.js +22 -24
  105. package/internal/util/download.js.map +1 -1
  106. package/internal/util/glob.d.ts.map +1 -1
  107. package/internal/util/glob.js.map +1 -1
  108. package/internal/util/global-dir.d.ts.map +1 -1
  109. package/internal/util/global-dir.js.map +1 -1
  110. package/internal/util/keys-derivation.d.ts +1 -1
  111. package/internal/util/keys-derivation.d.ts.map +1 -1
  112. package/internal/util/keys-derivation.js +2 -2
  113. package/internal/util/keys-derivation.js.map +1 -1
  114. package/package.json +10 -10
  115. package/sample-projects/advanced-ts/README.md +1 -1
  116. package/src/builtin-tasks/compile.ts +94 -76
  117. package/src/builtin-tasks/node.ts +2 -1
  118. package/src/builtin-tasks/test.ts +69 -11
  119. package/src/builtin-tasks/utils/solidity-files-cache.ts +3 -2
  120. package/src/internal/cli/analytics.ts +2 -2
  121. package/src/internal/cli/cli.ts +3 -3
  122. package/src/internal/cli/project-creation.ts +40 -0
  123. package/src/internal/core/config/config-loading.ts +2 -1
  124. package/src/internal/core/config/config-validation.ts +2 -0
  125. package/src/internal/core/config/default-config.ts +1 -0
  126. package/src/internal/core/errors-list.ts +13 -0
  127. package/src/internal/core/providers/accounts.ts +4 -2
  128. package/src/internal/core/providers/construction.ts +3 -1
  129. package/src/internal/core/providers/http.ts +47 -16
  130. package/src/internal/core/providers/util.ts +6 -3
  131. package/src/internal/hardhat-network/jsonrpc/server.ts +16 -3
  132. package/src/internal/hardhat-network/provider/BlockchainBase.ts +137 -0
  133. package/src/internal/hardhat-network/provider/BlockchainData.ts +144 -0
  134. package/src/internal/hardhat-network/provider/HardhatBlockchain.ts +34 -87
  135. package/src/internal/hardhat-network/provider/fork/ForkBlockchain.ts +45 -90
  136. package/src/internal/hardhat-network/provider/modules/eth.ts +2 -2
  137. package/src/internal/hardhat-network/provider/modules/hardhat.ts +51 -5
  138. package/src/internal/hardhat-network/provider/modules/logger.ts +50 -14
  139. package/src/internal/hardhat-network/provider/node-types.ts +2 -2
  140. package/src/internal/hardhat-network/provider/node.ts +81 -8
  141. package/src/internal/hardhat-network/provider/provider.ts +9 -8
  142. package/src/internal/hardhat-network/provider/types/HardhatBlockchainInterface.ts +7 -1
  143. package/src/internal/hardhat-network/provider/utils/makeForkClient.ts +2 -1
  144. package/src/internal/hardhat-network/provider/utils/putGenesisBlock.ts +1 -1
  145. package/src/internal/hardhat-network/stack-traces/debug.ts +1 -1
  146. package/src/internal/hardhat-network/stack-traces/error-inferrer.ts +21 -13
  147. package/src/internal/hardhat-network/stack-traces/solidity-errors.ts +2 -2
  148. package/src/internal/hardhat-network/stack-traces/solidity-stack-trace.ts +3 -2
  149. package/src/internal/solidity/compilation-job.ts +2 -1
  150. package/src/internal/solidity/compiler/downloader.ts +5 -3
  151. package/src/internal/util/download.ts +26 -31
  152. package/src/internal/util/glob.ts +1 -0
  153. package/src/internal/util/global-dir.ts +2 -1
  154. package/src/internal/util/keys-derivation.ts +3 -2
  155. package/src/types/config.ts +4 -0
  156. package/types/config.d.ts +4 -0
  157. package/types/config.d.ts.map +1 -1
@@ -208,7 +208,7 @@ export class HardhatNode extends EventEmitter {
208
208
  trie: stateTrie,
209
209
  });
210
210
 
211
- const hardhatBlockchain = new HardhatBlockchain();
211
+ const hardhatBlockchain = new HardhatBlockchain(common);
212
212
 
213
213
  const genesisBlockBaseFeePerGas = hardforkGte(
214
214
  hardfork,
@@ -490,6 +490,79 @@ Hardhat Network's forking functionality only works with blocks from at least spu
490
490
  return result;
491
491
  }
492
492
 
493
+ /**
494
+ * Mines `count` blocks with a difference of `interval` seconds between their
495
+ * timestamps.
496
+ *
497
+ * Returns an array with the results of the blocks that were really mined (the
498
+ * ones that were reserved are not included).
499
+ */
500
+ public async mineBlocks(
501
+ count: BN = new BN(1),
502
+ interval: BN = new BN(1)
503
+ ): Promise<MineBlockResult[]> {
504
+ if (count.eqn(0)) {
505
+ // nothing to do
506
+ return [];
507
+ }
508
+
509
+ const mineBlockResults: MineBlockResult[] = [];
510
+
511
+ // we always mine the first block, and we don't apply the interval for it
512
+ mineBlockResults.push(await this.mineBlock());
513
+
514
+ // helper function to mine a block with a timstamp that respects the
515
+ // interval
516
+ const mineBlock = async () => {
517
+ const nextTimestamp = (await this.getLatestBlock()).header.timestamp.add(
518
+ interval
519
+ );
520
+ mineBlockResults.push(await this.mineBlock(nextTimestamp));
521
+ };
522
+
523
+ // then we mine any pending transactions
524
+ while (
525
+ count.gtn(mineBlockResults.length) &&
526
+ this._txPool.hasPendingTransactions()
527
+ ) {
528
+ await mineBlock();
529
+ }
530
+
531
+ // If there is at least one remaining block, we mine one. This way, we
532
+ // guarantee that there's an empty block immediately before and after the
533
+ // reservation. This makes the logging easier to get right.
534
+ if (count.gtn(mineBlockResults.length)) {
535
+ await mineBlock();
536
+ }
537
+
538
+ const remainingBlockCount = count.subn(mineBlockResults.length);
539
+
540
+ // There should be at least 2 blocks left for the reservation to work,
541
+ // because we always mine a block after it. But here we use a bigger
542
+ // number to err on the safer side.
543
+ if (remainingBlockCount.lten(5)) {
544
+ // if there are few blocks left to mine, we just mine them
545
+ while (count.gtn(mineBlockResults.length)) {
546
+ await mineBlock();
547
+ }
548
+
549
+ return mineBlockResults;
550
+ }
551
+
552
+ // otherwise, we reserve a range and mine the last one
553
+ const latestBlock = await this.getLatestBlock();
554
+ this._blockchain.reserveBlocks(
555
+ remainingBlockCount.subn(1),
556
+ interval,
557
+ await this._stateManager.getStateRoot(),
558
+ await this.getBlockTotalDifficulty(latestBlock)
559
+ );
560
+
561
+ await mineBlock();
562
+
563
+ return mineBlockResults;
564
+ }
565
+
493
566
  public async runCall(
494
567
  call: CallParams,
495
568
  blockNumberOrPending: BN | "pending"
@@ -544,7 +617,7 @@ Hardhat Network's forking functionality only works with blocks from at least spu
544
617
  blockNumberOrPending?: BN | "pending"
545
618
  ): Promise<BN> {
546
619
  if (blockNumberOrPending === undefined) {
547
- blockNumberOrPending = await this.getLatestBlockNumber();
620
+ blockNumberOrPending = this.getLatestBlockNumber();
548
621
  }
549
622
 
550
623
  const account = await this._runInBlockContext(blockNumberOrPending, () =>
@@ -588,8 +661,8 @@ Hardhat Network's forking functionality only works with blocks from at least spu
588
661
  return this._blockchain.getLatestBlock();
589
662
  }
590
663
 
591
- public async getLatestBlockNumber(): Promise<BN> {
592
- return new BN((await this.getLatestBlock()).header.number);
664
+ public getLatestBlockNumber(): BN {
665
+ return this._blockchain.getLatestBlockNumber();
593
666
  }
594
667
 
595
668
  public async getPendingBlockAndTotalDifficulty(): Promise<[Block, BN]> {
@@ -1319,7 +1392,7 @@ Hardhat Network's forking functionality only works with blocks from at least spu
1319
1392
  newestBlock: BN | "pending",
1320
1393
  rewardPercentiles: number[]
1321
1394
  ): Promise<FeeHistory> {
1322
- const latestBlock = await this.getLatestBlockNumber();
1395
+ const latestBlock = this.getLatestBlockNumber();
1323
1396
  const pendingBlockNumber = latestBlock.addn(1);
1324
1397
 
1325
1398
  const resolvedNewestBlock =
@@ -1996,7 +2069,7 @@ Hardhat Network's forking functionality only works with blocks from at least spu
1996
2069
  return this._runInPendingBlockContext(action);
1997
2070
  }
1998
2071
 
1999
- if (blockNumberOrPending.eq(await this.getLatestBlockNumber())) {
2072
+ if (blockNumberOrPending.eq(this.getLatestBlockNumber())) {
2000
2073
  return action();
2001
2074
  }
2002
2075
 
@@ -2254,7 +2327,7 @@ Hardhat Network's forking functionality only works with blocks from at least spu
2254
2327
  filterParams: FilterParams,
2255
2328
  isFilter: boolean
2256
2329
  ): Promise<FilterParams> {
2257
- const latestBlockNumber = await this.getLatestBlockNumber();
2330
+ const latestBlockNumber = this.getLatestBlockNumber();
2258
2331
  const newFilterParams = { ...filterParams };
2259
2332
 
2260
2333
  if (newFilterParams.fromBlock === LATEST_BLOCK) {
@@ -2336,7 +2409,7 @@ Hardhat Network's forking functionality only works with blocks from at least spu
2336
2409
 
2337
2410
  private async _persistIrregularWorldState(): Promise<void> {
2338
2411
  this._irregularStatesByBlockNumber.set(
2339
- (await this.getLatestBlock()).header.number.toString(),
2412
+ this.getLatestBlockNumber().toString(),
2340
2413
  await this._stateManager.getStateRoot()
2341
2414
  );
2342
2415
  }
@@ -1,11 +1,3 @@
1
- import Common from "@ethereumjs/common";
2
- import chalk from "chalk";
3
- import debug from "debug";
4
- import { BN } from "ethereumjs-util";
5
- import { EventEmitter } from "events";
6
- import fsExtra from "fs-extra";
7
- import semver from "semver";
8
-
9
1
  import type {
10
2
  Artifacts,
11
3
  BoundExperimentalHardhatNetworkMessageTraceHook,
@@ -14,6 +6,15 @@ import type {
14
6
  HardhatNetworkChainsConfig,
15
7
  RequestArguments,
16
8
  } from "../../../types";
9
+
10
+ import Common from "@ethereumjs/common";
11
+ import chalk from "chalk";
12
+ import debug from "debug";
13
+ import { BN } from "ethereumjs-util";
14
+ import { EventEmitter } from "events";
15
+ import fsExtra from "fs-extra";
16
+ import semver from "semver";
17
+
17
18
  import {
18
19
  HARDHAT_NETWORK_RESET_EVENT,
19
20
  HARDHAT_NETWORK_REVERT_SNAPSHOT_EVENT,
@@ -7,13 +7,19 @@ import { RpcLogOutput, RpcReceiptOutput } from "../output";
7
7
 
8
8
  export interface HardhatBlockchainInterface extends BlockchainInterface {
9
9
  addTransactionReceipts(receipts: RpcReceiptOutput[]): void;
10
+ reserveBlocks(
11
+ count: BN,
12
+ interval: BN,
13
+ previousBlockStateRoot: Buffer,
14
+ previousBlockTotalDifficulty: BN
15
+ ): void;
10
16
  deleteLaterBlocks(block: Block): void;
11
17
  getBlockByTransactionHash(transactionHash: Buffer): Promise<Block | null>;
12
18
  getLatestBlock(): Promise<Block>;
19
+ getLatestBlockNumber(): BN;
13
20
  getLogs(filterParams: FilterParams): Promise<RpcLogOutput[]>;
14
21
  getTotalDifficulty(blockHash: Buffer): Promise<BN>;
15
22
  getTransactionReceipt(
16
23
  transactionHash: Buffer
17
24
  ): Promise<RpcReceiptOutput | null>;
18
- getBaseFee(): Promise<BN>;
19
25
  }
@@ -19,7 +19,8 @@ import {
19
19
  // TODO: This is a temporarily measure.
20
20
  // We must investigate why this timeouts so much. Apparently
21
21
  // node-fetch doesn't handle timeouts so well. The option was
22
- // removed in its new major version.
22
+ // removed in its new major version. UPDATE: we aren't even using node-fetch
23
+ // anymore, so this really should be revisited.
23
24
  const FORK_HTTP_TIMEOUT = 35000;
24
25
 
25
26
  export async function makeForkClient(
@@ -21,5 +21,5 @@ export async function putGenesisBlock(
21
21
  },
22
22
  { common }
23
23
  );
24
- await blockchain.addBlock(genesisBlock);
24
+ await blockchain.putBlock(genesisBlock);
25
25
  }
@@ -182,7 +182,7 @@ function flattenSourceReference(sourceReference?: SourceReference) {
182
182
 
183
183
  return {
184
184
  ...sourceReference,
185
- file: sourceReference.file.sourceName,
185
+ file: sourceReference.sourceName,
186
186
  };
187
187
  }
188
188
 
@@ -779,7 +779,8 @@ export class ErrorInferrer {
779
779
  func: ContractFunction
780
780
  ): SourceReference {
781
781
  return {
782
- file: func.location.file,
782
+ sourceName: func.location.file.sourceName,
783
+ sourceContent: func.location.file.content,
783
784
  contract: trace.bytecode.contract.name,
784
785
  function: func.name,
785
786
  line: func.location.getStartingLineNumber(),
@@ -837,7 +838,8 @@ export class ErrorInferrer {
837
838
  ): SourceReference {
838
839
  const location = trace.bytecode.contract.location;
839
840
  return {
840
- file: location.file,
841
+ sourceName: location.file.sourceName,
842
+ sourceContent: location.file.content,
841
843
  contract: trace.bytecode.contract.name,
842
844
  line: location.getStartingLineNumber(),
843
845
  range: [location.offset, location.offset + location.length],
@@ -882,7 +884,8 @@ export class ErrorInferrer {
882
884
  }
883
885
 
884
886
  return {
885
- file: func.location.file,
887
+ sourceName: func.location.file.sourceName,
888
+ sourceContent: func.location.file.content,
886
889
  contract: trace.bytecode.contract.name,
887
890
  function: FALLBACK_FUNCTION_NAME,
888
891
  line: func.location.getStartingLineNumber(),
@@ -931,7 +934,8 @@ export class ErrorInferrer {
931
934
  : contract.location.getStartingLineNumber();
932
935
 
933
936
  return {
934
- file: contract.location.file,
937
+ sourceName: contract.location.file.sourceName,
938
+ sourceContent: contract.location.file.content,
935
939
  contract: contract.name,
936
940
  function: CONSTRUCTOR_FUNCTION_NAME,
937
941
  line,
@@ -1182,7 +1186,8 @@ export class ErrorInferrer {
1182
1186
  sourceReference: {
1183
1187
  contract: trace.bytecode.contract.name,
1184
1188
  function: FALLBACK_FUNCTION_NAME,
1185
- file: location.file,
1189
+ sourceName: location.file.sourceName,
1190
+ sourceContent: location.file.content,
1186
1191
  line: location.getStartingLineNumber(),
1187
1192
  range: [location.offset, location.offset + location.length],
1188
1193
  },
@@ -1198,7 +1203,8 @@ export class ErrorInferrer {
1198
1203
  sourceReference: {
1199
1204
  contract: trace.bytecode.contract.name,
1200
1205
  function: RECEIVE_FUNCTION_NAME,
1201
- file: location.file,
1206
+ sourceName: location.file.sourceName,
1207
+ sourceContent: location.file.content,
1202
1208
  line: location.getStartingLineNumber(),
1203
1209
  range: [location.offset, location.offset + location.length],
1204
1210
  },
@@ -1326,7 +1332,8 @@ export class ErrorInferrer {
1326
1332
  const defaultSourceReference: SourceReference = {
1327
1333
  function: CONSTRUCTOR_FUNCTION_NAME,
1328
1334
  contract: trace.bytecode.contract.name,
1329
- file: location.file,
1335
+ sourceName: location.file.sourceName,
1336
+ sourceContent: location.file.content,
1330
1337
  line: location.getStartingLineNumber(),
1331
1338
  range: [location.offset, location.offset + location.length],
1332
1339
  };
@@ -1398,9 +1405,7 @@ export class ErrorInferrer {
1398
1405
  private _solidity063CorrectLineNumber(
1399
1406
  revertFrame: UnmappedSolc063RevertErrorStackTraceEntry
1400
1407
  ) {
1401
- const file = revertFrame.sourceReference.file;
1402
-
1403
- const lines = file.content.split("\n");
1408
+ const lines = revertFrame.sourceReference.sourceContent.split("\n");
1404
1409
 
1405
1410
  const currentLine = lines[revertFrame.sourceReference.line - 1];
1406
1411
 
@@ -1689,7 +1694,8 @@ export function instructionToCallstackStackTraceEntry(
1689
1694
  type: StackTraceEntryType.INTERNAL_FUNCTION_CALLSTACK_ENTRY,
1690
1695
  pc: inst.pc,
1691
1696
  sourceReference: {
1692
- file: bytecode.contract.location.file,
1697
+ sourceName: bytecode.contract.location.file.sourceName,
1698
+ sourceContent: bytecode.contract.location.file.content,
1693
1699
  contract: bytecode.contract.name,
1694
1700
  function: undefined,
1695
1701
  line: bytecode.contract.location.getStartingLineNumber(),
@@ -1716,7 +1722,8 @@ export function instructionToCallstackStackTraceEntry(
1716
1722
  sourceReference: {
1717
1723
  function: undefined,
1718
1724
  contract: bytecode.contract.name,
1719
- file: inst.location!.file,
1725
+ sourceName: inst.location!.file.sourceName,
1726
+ sourceContent: inst.location!.file.content,
1720
1727
  line: inst.location!.getStartingLineNumber(),
1721
1728
  range: [
1722
1729
  inst.location!.offset,
@@ -1757,7 +1764,8 @@ function sourceLocationToSourceReference(
1757
1764
  func.type === ContractFunctionType.FREE_FUNCTION
1758
1765
  ? undefined
1759
1766
  : bytecode.contract.name,
1760
- file: func.location.file,
1767
+ sourceName: func.location.file.sourceName,
1768
+ sourceContent: func.location.file.content,
1761
1769
  line: location.getStartingLineNumber(),
1762
1770
  range: [location.offset, location.offset + location.length],
1763
1771
  };
@@ -168,7 +168,7 @@ function encodeStackTraceEntry(
168
168
 
169
169
  case StackTraceEntryType.INTERNAL_FUNCTION_CALLSTACK_ENTRY:
170
170
  return new SolidityCallSite(
171
- stackTraceEntry.sourceReference.file.sourceName,
171
+ stackTraceEntry.sourceReference.sourceName,
172
172
  stackTraceEntry.sourceReference.contract,
173
173
  `internal@${stackTraceEntry.pc}`,
174
174
  undefined
@@ -205,7 +205,7 @@ function sourceReferenceToSolidityCallsite(
205
205
  sourceReference: SourceReference
206
206
  ): SolidityCallSite {
207
207
  return new SolidityCallSite(
208
- sourceReference.file.sourceName,
208
+ sourceReference.sourceName,
209
209
  sourceReference.contract,
210
210
  sourceReference.function !== undefined
211
211
  ? sourceReference.function
@@ -2,7 +2,7 @@ import { BN } from "ethereumjs-util";
2
2
 
3
3
  import { ReturnData } from "../provider/return-data";
4
4
 
5
- import { ContractFunctionType, SourceFile } from "./model";
5
+ import { ContractFunctionType } from "./model";
6
6
 
7
7
  export enum StackTraceEntryType {
8
8
  CALLSTACK_ENTRY,
@@ -42,7 +42,8 @@ export const PRECOMPILE_FUNCTION_NAME = "<precompile>";
42
42
  export const UNRECOGNIZED_CONTRACT_NAME = "<UnrecognizedContract>";
43
43
 
44
44
  export interface SourceReference {
45
- file: SourceFile;
45
+ sourceName: string;
46
+ sourceContent: string;
46
47
  contract?: string;
47
48
  function?: string;
48
49
  line: number;
@@ -1,5 +1,6 @@
1
- import debug from "debug";
2
1
  import type { LoDashStatic } from "lodash";
2
+
3
+ import debug from "debug";
3
4
  import semver from "semver";
4
5
 
5
6
  import { SolcConfig, SolidityConfig } from "../../types";
@@ -178,7 +178,7 @@ export class CompilerDownloader {
178
178
  }
179
179
 
180
180
  public async getCompilerBuild(version: string): Promise<CompilerBuild> {
181
- const platform = this._getCurrentPlarform();
181
+ const platform = this._getCurrentPlatform();
182
182
 
183
183
  if (await this._versionExists(version, platform)) {
184
184
  try {
@@ -191,7 +191,9 @@ export class CompilerDownloader {
191
191
  return this._getCompilerBuildByPlatform(version, CompilerPlatform.WASM);
192
192
  }
193
193
 
194
- public async downloadCompilersList(platform: CompilerPlatform) {
194
+ public async downloadCompilersList(
195
+ platform: CompilerPlatform = this._getCurrentPlatform()
196
+ ) {
195
197
  try {
196
198
  await this._download(
197
199
  getCompilerListURL(platform),
@@ -295,7 +297,7 @@ export class CompilerDownloader {
295
297
  return fsExtra.pathExists(filePath);
296
298
  }
297
299
 
298
- private _getCurrentPlarform(): CompilerPlatform {
300
+ private _getCurrentPlatform(): CompilerPlatform {
299
301
  if (this._forceSolcJs) {
300
302
  return CompilerPlatform.WASM;
301
303
  }
@@ -1,16 +1,14 @@
1
1
  import fs from "fs";
2
2
  import fsExtra from "fs-extra";
3
- import HttpsProxyAgent from "https-proxy-agent";
4
3
  import path from "path";
5
4
  import util from "util";
6
5
 
7
- interface FetchOptions {
8
- timeout: number;
9
- agent?: undefined | HttpsProxyAgent.HttpsProxyAgent;
10
- }
6
+ import { getHardhatVersion } from "./packageInfo";
11
7
 
12
8
  const TEMP_FILE_PREFIX = "tmp-";
13
9
 
10
+ const hardhatVersion = getHardhatVersion();
11
+
14
12
  function resolveTempFileName(filePath: string): string {
15
13
  const { dir, ext, name } = path.parse(filePath);
16
14
 
@@ -27,34 +25,33 @@ export async function download(
27
25
  timeoutMillis = 10000
28
26
  ) {
29
27
  const { pipeline } = await import("stream");
30
- const { default: fetch } = await import("node-fetch");
28
+ const { getGlobalDispatcher, ProxyAgent, request } = await import("undici");
31
29
  const streamPipeline = util.promisify(pipeline);
32
- const fetchOptions: FetchOptions = {
33
- timeout: timeoutMillis,
34
- agent: undefined,
35
- };
36
30
 
37
- // Check if Proxy is set https
38
- if (process.env.HTTPS_PROXY !== undefined) {
39
- // Create the proxy from the environment variables
40
- const proxy: string = process.env.HTTPS_PROXY;
41
- fetchOptions.agent = new HttpsProxyAgent.HttpsProxyAgent(proxy);
42
- }
31
+ function chooseDispatcher() {
32
+ if (process.env.HTTPS_PROXY !== undefined) {
33
+ return new ProxyAgent(process.env.HTTPS_PROXY);
34
+ }
43
35
 
44
- // Check if Proxy is set http and `fetchOptions.agent` was not already set for https
45
- if (
46
- process.env.HTTP_PROXY !== undefined &&
47
- fetchOptions.agent === undefined
48
- ) {
49
- // Create the proxy from the environment variables
50
- const proxy: string = process.env.HTTP_PROXY;
51
- fetchOptions.agent = new HttpsProxyAgent.HttpsProxyAgent(proxy);
36
+ if (process.env.HTTP_PROXY !== undefined) {
37
+ return new ProxyAgent(process.env.HTTP_PROXY);
38
+ }
39
+
40
+ return getGlobalDispatcher();
52
41
  }
53
42
 
54
43
  // Fetch the url
55
- const response = await fetch(url, fetchOptions);
44
+ const response = await request(url, {
45
+ dispatcher: chooseDispatcher(),
46
+ headersTimeout: timeoutMillis,
47
+ maxRedirections: 10,
48
+ method: "GET",
49
+ headers: {
50
+ "User-Agent": `hardhat ${hardhatVersion}`,
51
+ },
52
+ });
56
53
 
57
- if (response.ok && response.body !== null) {
54
+ if (response.statusCode >= 200 && response.statusCode <= 299) {
58
55
  const tmpFilePath = resolveTempFileName(filePath);
59
56
  await fsExtra.ensureDir(path.dirname(filePath));
60
57
 
@@ -62,12 +59,10 @@ export async function download(
62
59
  return fsExtra.move(tmpFilePath, filePath, { overwrite: true });
63
60
  }
64
61
 
65
- // Consume the response stream and discard its result
66
- // See: https://github.com/node-fetch/node-fetch/issues/83
67
- const _discarded = await response.arrayBuffer();
68
-
69
62
  // eslint-disable-next-line @nomiclabs/hardhat-internal-rules/only-hardhat-error
70
63
  throw new Error(
71
- `Failed to download ${url} - ${response.statusText} received`
64
+ `Failed to download ${url} - ${
65
+ response.statusCode
66
+ } received. ${await response.body.text()}`
72
67
  );
73
68
  }
@@ -1,4 +1,5 @@
1
1
  import type { IOptions as GlobOptions } from "glob";
2
+
2
3
  import * as path from "path";
3
4
  import util from "util";
4
5
 
@@ -1,5 +1,6 @@
1
- import debug from "debug";
2
1
  import type envPathsT from "env-paths";
2
+
3
+ import debug from "debug";
3
4
  import fs from "fs-extra";
4
5
  import os from "os";
5
6
  import path from "path";
@@ -3,14 +3,15 @@ import type { HDKey as HDKeyT } from "ethereum-cryptography/hdkey";
3
3
 
4
4
  export function deriveKeyFromMnemonicAndPath(
5
5
  mnemonic: string,
6
- hdPath: string
6
+ hdPath: string,
7
+ passphrase: string
7
8
  ): Buffer | undefined {
8
9
  const {
9
10
  mnemonicToSeedSync,
10
11
  }: {
11
12
  mnemonicToSeedSync: typeof mnemonicToSeedSyncT;
12
13
  } = require("ethereum-cryptography/bip39");
13
- const seed = mnemonicToSeedSync(mnemonic);
14
+ const seed = mnemonicToSeedSync(mnemonic, passphrase);
14
15
 
15
16
  const {
16
17
  HDKey,
@@ -75,6 +75,7 @@ export interface HardhatNetworkHDAccountsUserConfig {
75
75
  count?: number;
76
76
  path?: string;
77
77
  accountsBalance?: string;
78
+ passphrase?: string;
78
79
  }
79
80
 
80
81
  export interface HDAccountsUserConfig {
@@ -82,6 +83,7 @@ export interface HDAccountsUserConfig {
82
83
  initialIndex?: number;
83
84
  count?: number;
84
85
  path?: string;
86
+ passphrase?: string;
85
87
  }
86
88
 
87
89
  export interface HardhatNetworkForkingUserConfig {
@@ -167,6 +169,7 @@ export interface HardhatNetworkHDAccountsConfig {
167
169
  count: number;
168
170
  path: string;
169
171
  accountsBalance: string;
172
+ passphrase: string;
170
173
  }
171
174
 
172
175
  export interface HardhatNetworkForkingConfig {
@@ -197,6 +200,7 @@ export interface HttpNetworkHDAccountsConfig {
197
200
  initialIndex: number;
198
201
  count: number;
199
202
  path: string;
203
+ passphrase: string;
200
204
  }
201
205
 
202
206
  export interface HardhatNetworkMiningConfig {
package/types/config.d.ts CHANGED
@@ -46,12 +46,14 @@ export interface HardhatNetworkHDAccountsUserConfig {
46
46
  count?: number;
47
47
  path?: string;
48
48
  accountsBalance?: string;
49
+ passphrase?: string;
49
50
  }
50
51
  export interface HDAccountsUserConfig {
51
52
  mnemonic: string;
52
53
  initialIndex?: number;
53
54
  count?: number;
54
55
  path?: string;
56
+ passphrase?: string;
55
57
  }
56
58
  export interface HardhatNetworkForkingUserConfig {
57
59
  enabled?: boolean;
@@ -115,6 +117,7 @@ export interface HardhatNetworkHDAccountsConfig {
115
117
  count: number;
116
118
  path: string;
117
119
  accountsBalance: string;
120
+ passphrase: string;
118
121
  }
119
122
  export interface HardhatNetworkForkingConfig {
120
123
  enabled: boolean;
@@ -140,6 +143,7 @@ export interface HttpNetworkHDAccountsConfig {
140
143
  initialIndex: number;
141
144
  count: number;
142
145
  path: string;
146
+ passphrase: string;
143
147
  }
144
148
  export interface HardhatNetworkMiningConfig {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