hardhat 2.22.10 → 2.22.12

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 (129) hide show
  1. package/console.sol +1 -1
  2. package/internal/cli/project-creation.d.ts +1 -1
  3. package/internal/cli/project-creation.js +1 -1
  4. package/internal/core/providers/lazy-initialization.d.ts.map +1 -1
  5. package/internal/core/providers/lazy-initialization.js +10 -10
  6. package/internal/core/providers/lazy-initialization.js.map +1 -1
  7. package/internal/hardhat-network/jsonrpc/handler.d.ts.map +1 -1
  8. package/internal/hardhat-network/jsonrpc/handler.js +2 -1
  9. package/internal/hardhat-network/jsonrpc/handler.js.map +1 -1
  10. package/internal/hardhat-network/provider/provider.d.ts +2 -3
  11. package/internal/hardhat-network/provider/provider.d.ts.map +1 -1
  12. package/internal/hardhat-network/provider/provider.js +5 -19
  13. package/internal/hardhat-network/provider/provider.js.map +1 -1
  14. package/internal/hardhat-network/provider/return-data.d.ts +2 -15
  15. package/internal/hardhat-network/provider/return-data.d.ts.map +1 -1
  16. package/internal/hardhat-network/provider/return-data.js +2 -50
  17. package/internal/hardhat-network/provider/return-data.js.map +1 -1
  18. package/internal/hardhat-network/provider/vm/exit.d.ts +2 -20
  19. package/internal/hardhat-network/provider/vm/exit.d.ts.map +1 -1
  20. package/internal/hardhat-network/provider/vm/exit.js +3 -78
  21. package/internal/hardhat-network/provider/vm/exit.js.map +1 -1
  22. package/internal/hardhat-network/stack-traces/compiler-to-model.d.ts +2 -3
  23. package/internal/hardhat-network/stack-traces/compiler-to-model.d.ts.map +1 -1
  24. package/internal/hardhat-network/stack-traces/compiler-to-model.js +2 -351
  25. package/internal/hardhat-network/stack-traces/compiler-to-model.js.map +1 -1
  26. package/internal/hardhat-network/stack-traces/consoleLogger.d.ts +2 -1
  27. package/internal/hardhat-network/stack-traces/consoleLogger.d.ts.map +1 -1
  28. package/internal/hardhat-network/stack-traces/consoleLogger.js +2 -1
  29. package/internal/hardhat-network/stack-traces/consoleLogger.js.map +1 -1
  30. package/internal/hardhat-network/stack-traces/constants.d.ts +1 -1
  31. package/internal/hardhat-network/stack-traces/constants.js +1 -1
  32. package/internal/hardhat-network/stack-traces/debug.d.ts +2 -7
  33. package/internal/hardhat-network/stack-traces/debug.d.ts.map +1 -1
  34. package/internal/hardhat-network/stack-traces/debug.js +3 -143
  35. package/internal/hardhat-network/stack-traces/debug.js.map +1 -1
  36. package/internal/hardhat-network/stack-traces/library-utils.d.ts +2 -11
  37. package/internal/hardhat-network/stack-traces/library-utils.d.ts.map +1 -1
  38. package/internal/hardhat-network/stack-traces/library-utils.js +3 -61
  39. package/internal/hardhat-network/stack-traces/library-utils.js.map +1 -1
  40. package/internal/hardhat-network/stack-traces/logger.js +596 -596
  41. package/internal/hardhat-network/stack-traces/logger.js.map +1 -1
  42. package/internal/hardhat-network/stack-traces/message-trace.d.ts +2 -51
  43. package/internal/hardhat-network/stack-traces/message-trace.d.ts.map +1 -1
  44. package/internal/hardhat-network/stack-traces/message-trace.js +0 -46
  45. package/internal/hardhat-network/stack-traces/message-trace.js.map +1 -1
  46. package/internal/hardhat-network/stack-traces/solidity-errors.d.ts.map +1 -1
  47. package/internal/hardhat-network/stack-traces/solidity-errors.js +58 -53
  48. package/internal/hardhat-network/stack-traces/solidity-errors.js.map +1 -1
  49. package/internal/hardhat-network/stack-traces/solidity-stack-trace.d.ts +4 -155
  50. package/internal/hardhat-network/stack-traces/solidity-stack-trace.d.ts.map +1 -1
  51. package/internal/hardhat-network/stack-traces/solidity-stack-trace.js +12 -37
  52. package/internal/hardhat-network/stack-traces/solidity-stack-trace.js.map +1 -1
  53. package/internal/hardhat-network/stack-traces/solidityTracer.d.ts +2 -13
  54. package/internal/hardhat-network/stack-traces/solidityTracer.d.ts.map +1 -1
  55. package/internal/hardhat-network/stack-traces/solidityTracer.js +2 -162
  56. package/internal/hardhat-network/stack-traces/solidityTracer.js.map +1 -1
  57. package/internal/hardhat-network/stack-traces/vm-trace-decoder.d.ts +4 -15
  58. package/internal/hardhat-network/stack-traces/vm-trace-decoder.d.ts.map +1 -1
  59. package/internal/hardhat-network/stack-traces/vm-trace-decoder.js +6 -70
  60. package/internal/hardhat-network/stack-traces/vm-trace-decoder.js.map +1 -1
  61. package/internal/hardhat-network/stack-traces/vm-tracer.d.ts +2 -19
  62. package/internal/hardhat-network/stack-traces/vm-tracer.d.ts.map +1 -1
  63. package/internal/hardhat-network/stack-traces/vm-tracer.js +3 -150
  64. package/internal/hardhat-network/stack-traces/vm-tracer.js.map +1 -1
  65. package/internal/solidity/compiler/solc-info.d.ts.map +1 -1
  66. package/internal/solidity/compiler/solc-info.js +3 -0
  67. package/internal/solidity/compiler/solc-info.js.map +1 -1
  68. package/package.json +6 -5
  69. package/sample-projects/javascript/contracts/Lock.sol +1 -1
  70. package/sample-projects/javascript/hardhat.config.js +1 -1
  71. package/sample-projects/javascript/ignition/modules/Lock.js +3 -0
  72. package/sample-projects/javascript-esm/contracts/Lock.sol +1 -1
  73. package/sample-projects/javascript-esm/hardhat.config.cjs +1 -1
  74. package/sample-projects/javascript-esm/ignition/modules/Lock.js +3 -0
  75. package/sample-projects/typescript/contracts/Lock.sol +1 -1
  76. package/sample-projects/typescript/hardhat.config.ts +1 -1
  77. package/sample-projects/typescript/ignition/modules/Lock.ts +3 -0
  78. package/sample-projects/typescript-viem/contracts/Lock.sol +1 -1
  79. package/sample-projects/typescript-viem/hardhat.config.ts +1 -1
  80. package/sample-projects/typescript-viem/ignition/modules/Lock.ts +3 -0
  81. package/src/internal/cli/project-creation.ts +1 -1
  82. package/src/internal/core/providers/lazy-initialization.ts +13 -13
  83. package/src/internal/hardhat-network/jsonrpc/handler.ts +2 -1
  84. package/src/internal/hardhat-network/provider/provider.ts +11 -24
  85. package/src/internal/hardhat-network/provider/return-data.ts +5 -73
  86. package/src/internal/hardhat-network/provider/vm/exit.ts +4 -92
  87. package/src/internal/hardhat-network/stack-traces/compiler-to-model.ts +5 -697
  88. package/src/internal/hardhat-network/stack-traces/consoleLogger.ts +2 -1
  89. package/src/internal/hardhat-network/stack-traces/constants.ts +1 -1
  90. package/src/internal/hardhat-network/stack-traces/debug.ts +5 -218
  91. package/src/internal/hardhat-network/stack-traces/library-utils.ts +5 -90
  92. package/src/internal/hardhat-network/stack-traces/logger.ts +596 -596
  93. package/src/internal/hardhat-network/stack-traces/message-trace.ts +5 -122
  94. package/src/internal/hardhat-network/stack-traces/solidity-errors.ts +16 -15
  95. package/src/internal/hardhat-network/stack-traces/solidity-stack-trace.ts +83 -186
  96. package/src/internal/hardhat-network/stack-traces/solidityTracer.ts +5 -253
  97. package/src/internal/hardhat-network/stack-traces/vm-trace-decoder.ts +15 -108
  98. package/src/internal/hardhat-network/stack-traces/vm-tracer.ts +5 -206
  99. package/src/internal/solidity/compiler/solc-info.ts +3 -0
  100. package/internal/hardhat-network/stack-traces/contracts-identifier.d.ts +0 -15
  101. package/internal/hardhat-network/stack-traces/contracts-identifier.d.ts.map +0 -1
  102. package/internal/hardhat-network/stack-traces/contracts-identifier.js +0 -166
  103. package/internal/hardhat-network/stack-traces/contracts-identifier.js.map +0 -1
  104. package/internal/hardhat-network/stack-traces/error-inferrer.d.ts +0 -85
  105. package/internal/hardhat-network/stack-traces/error-inferrer.d.ts.map +0 -1
  106. package/internal/hardhat-network/stack-traces/error-inferrer.js +0 -1168
  107. package/internal/hardhat-network/stack-traces/error-inferrer.js.map +0 -1
  108. package/internal/hardhat-network/stack-traces/mapped-inlined-internal-functions-heuristics.d.ts +0 -24
  109. package/internal/hardhat-network/stack-traces/mapped-inlined-internal-functions-heuristics.d.ts.map +0 -1
  110. package/internal/hardhat-network/stack-traces/mapped-inlined-internal-functions-heuristics.js +0 -116
  111. package/internal/hardhat-network/stack-traces/mapped-inlined-internal-functions-heuristics.js.map +0 -1
  112. package/internal/hardhat-network/stack-traces/model.d.ts +0 -140
  113. package/internal/hardhat-network/stack-traces/model.d.ts.map +0 -1
  114. package/internal/hardhat-network/stack-traces/model.js +0 -328
  115. package/internal/hardhat-network/stack-traces/model.js.map +0 -1
  116. package/internal/hardhat-network/stack-traces/opcodes.d.ts +0 -266
  117. package/internal/hardhat-network/stack-traces/opcodes.d.ts.map +0 -1
  118. package/internal/hardhat-network/stack-traces/opcodes.js +0 -320
  119. package/internal/hardhat-network/stack-traces/opcodes.js.map +0 -1
  120. package/internal/hardhat-network/stack-traces/source-maps.d.ts +0 -13
  121. package/internal/hardhat-network/stack-traces/source-maps.d.ts.map +0 -1
  122. package/internal/hardhat-network/stack-traces/source-maps.js +0 -106
  123. package/internal/hardhat-network/stack-traces/source-maps.js.map +0 -1
  124. package/src/internal/hardhat-network/stack-traces/contracts-identifier.ts +0 -235
  125. package/src/internal/hardhat-network/stack-traces/error-inferrer.ts +0 -1845
  126. package/src/internal/hardhat-network/stack-traces/mapped-inlined-internal-functions-heuristics.ts +0 -163
  127. package/src/internal/hardhat-network/stack-traces/model.ts +0 -409
  128. package/src/internal/hardhat-network/stack-traces/opcodes.ts +0 -344
  129. package/src/internal/hardhat-network/stack-traces/source-maps.ts +0 -167
@@ -1,129 +1,12 @@
1
- import type { Bytecode } from "./model";
2
- import type { Exit } from "../provider/vm/exit";
3
1
  import type {
4
- CallOutput,
5
- CreateOutput,
6
- HaltResult,
7
- RevertResult,
8
- SuccessResult,
2
+ PrecompileMessageTrace,
3
+ CreateMessageTrace,
4
+ CallMessageTrace,
9
5
  } from "@nomicfoundation/edr";
10
6
 
7
+ export type { PrecompileMessageTrace, CreateMessageTrace, CallMessageTrace };
8
+
11
9
  export type MessageTrace =
12
10
  | CreateMessageTrace
13
11
  | CallMessageTrace
14
12
  | PrecompileMessageTrace;
15
-
16
- export type EvmMessageTrace = CreateMessageTrace | CallMessageTrace;
17
-
18
- export type DecodedEvmMessageTrace =
19
- | DecodedCreateMessageTrace
20
- | DecodedCallMessageTrace;
21
-
22
- export interface BaseMessageTrace {
23
- value: bigint;
24
- returnData: Uint8Array;
25
- exit: Exit;
26
- gasUsed: bigint;
27
- depth: number;
28
- }
29
-
30
- export interface PrecompileMessageTrace extends BaseMessageTrace {
31
- precompile: number;
32
- calldata: Uint8Array;
33
- }
34
-
35
- export interface BaseEvmMessageTrace extends BaseMessageTrace {
36
- code: Uint8Array;
37
- steps: MessageTraceStep[];
38
- bytecode?: Bytecode;
39
- // The following is just an optimization: When processing this traces it's useful to know ahead of
40
- // time how many subtraces there are.
41
- numberOfSubtraces: number;
42
- }
43
-
44
- export interface CreateMessageTrace extends BaseEvmMessageTrace {
45
- deployedContract: Uint8Array | undefined;
46
- }
47
-
48
- export interface CallMessageTrace extends BaseEvmMessageTrace {
49
- calldata: Uint8Array;
50
- address: Uint8Array;
51
- codeAddress: Uint8Array;
52
- }
53
-
54
- export interface DecodedCreateMessageTrace extends CreateMessageTrace {
55
- bytecode: Bytecode;
56
- }
57
-
58
- export interface DecodedCallMessageTrace extends CallMessageTrace {
59
- bytecode: Bytecode;
60
- }
61
-
62
- export function isPrecompileTrace(
63
- trace: MessageTrace
64
- ): trace is PrecompileMessageTrace {
65
- return "precompile" in trace;
66
- }
67
-
68
- export function isCreateTrace(
69
- trace: MessageTrace
70
- ): trace is CreateMessageTrace {
71
- return "code" in trace && !isCallTrace(trace);
72
- }
73
-
74
- export function isDecodedCreateTrace(
75
- trace: MessageTrace
76
- ): trace is DecodedCreateMessageTrace {
77
- return isCreateTrace(trace) && trace.bytecode !== undefined;
78
- }
79
-
80
- export function isCallTrace(trace: MessageTrace): trace is CallMessageTrace {
81
- return "code" in trace && "calldata" in trace;
82
- }
83
-
84
- export function isDecodedCallTrace(
85
- trace: MessageTrace
86
- ): trace is DecodedCallMessageTrace {
87
- return isCallTrace(trace) && trace.bytecode !== undefined;
88
- }
89
-
90
- export function isEvmStep(step: MessageTraceStep): step is EvmStep {
91
- return "pc" in step && step.pc !== undefined;
92
- }
93
-
94
- export type MessageTraceStep = MessageTrace | EvmStep;
95
-
96
- export interface EvmStep {
97
- pc: number;
98
- }
99
-
100
- export function isCallOutput(
101
- output: CallOutput | CreateOutput
102
- ): output is CallOutput {
103
- return !isCreateOutput(output);
104
- }
105
-
106
- export function isCreateOutput(
107
- output: CallOutput | CreateOutput
108
- ): output is CreateOutput {
109
- return "address" in output;
110
- }
111
-
112
- export function isSuccessResult(
113
- result: SuccessResult | RevertResult | HaltResult
114
- ): result is SuccessResult {
115
- // Only need to check for one unique field
116
- return "gasRefunded" in result;
117
- }
118
-
119
- export function isRevertResult(
120
- result: SuccessResult | RevertResult | HaltResult
121
- ): result is RevertResult {
122
- return !("reason" in result);
123
- }
124
-
125
- export function isHaltResult(
126
- result: SuccessResult | RevertResult | HaltResult
127
- ): result is HaltResult {
128
- return !("output" in result);
129
- }
@@ -1,5 +1,6 @@
1
1
  import { bytesToHex as bufferToHex } from "@nomicfoundation/ethereumjs-util";
2
2
 
3
+ import { ReturnData } from "../provider/return-data";
3
4
  import { panicErrorCodeToMessage } from "./panic-errors";
4
5
  import {
5
6
  CONSTRUCTOR_FUNCTION_NAME,
@@ -258,24 +259,21 @@ function getMessageFromLastStackTraceEntry(
258
259
  return `Transaction reverted: library was called directly`;
259
260
 
260
261
  case StackTraceEntryType.UNRECOGNIZED_CREATE_ERROR:
261
- case StackTraceEntryType.UNRECOGNIZED_CONTRACT_ERROR:
262
- if (stackTraceEntry.message.isErrorReturnData()) {
263
- return `VM Exception while processing transaction: reverted with reason string '${stackTraceEntry.message.decodeError()}'`;
262
+ case StackTraceEntryType.UNRECOGNIZED_CONTRACT_ERROR: {
263
+ const returnData = new ReturnData(stackTraceEntry.returnData);
264
+ if (returnData.isErrorReturnData()) {
265
+ return `VM Exception while processing transaction: reverted with reason string '${returnData.decodeError()}'`;
264
266
  }
265
267
 
266
- if (stackTraceEntry.message.isPanicReturnData()) {
267
- const message = panicErrorCodeToMessage(
268
- stackTraceEntry.message.decodePanic()
269
- );
268
+ if (returnData.isPanicReturnData()) {
269
+ const message = panicErrorCodeToMessage(returnData.decodePanic());
270
270
  return `VM Exception while processing transaction: ${message}`;
271
271
  }
272
272
 
273
- if (!stackTraceEntry.message.isEmpty()) {
274
- const returnData = Buffer.from(stackTraceEntry.message.value).toString(
275
- "hex"
276
- );
273
+ if (!returnData.isEmpty()) {
274
+ const buffer = Buffer.from(returnData.value).toString("hex");
277
275
 
278
- return `VM Exception while processing transaction: reverted with an unrecognized custom error (return data: 0x${returnData})`;
276
+ return `VM Exception while processing transaction: reverted with an unrecognized custom error (return data: 0x${buffer})`;
279
277
  }
280
278
 
281
279
  if (stackTraceEntry.isInvalidOpcodeError) {
@@ -283,10 +281,12 @@ function getMessageFromLastStackTraceEntry(
283
281
  }
284
282
 
285
283
  return "Transaction reverted without a reason string";
284
+ }
286
285
 
287
- case StackTraceEntryType.REVERT_ERROR:
288
- if (stackTraceEntry.message.isErrorReturnData()) {
289
- return `VM Exception while processing transaction: reverted with reason string '${stackTraceEntry.message.decodeError()}'`;
286
+ case StackTraceEntryType.REVERT_ERROR: {
287
+ const returnData = new ReturnData(stackTraceEntry.returnData);
288
+ if (returnData.isErrorReturnData()) {
289
+ return `VM Exception while processing transaction: reverted with reason string '${returnData.decodeError()}'`;
290
290
  }
291
291
 
292
292
  if (stackTraceEntry.isInvalidOpcodeError) {
@@ -294,6 +294,7 @@ function getMessageFromLastStackTraceEntry(
294
294
  }
295
295
 
296
296
  return "Transaction reverted without a reason string";
297
+ }
297
298
 
298
299
  case StackTraceEntryType.PANIC_ERROR:
299
300
  const panicMessage = panicErrorCodeToMessage(stackTraceEntry.errorCode);
@@ -1,189 +1,86 @@
1
- import { ReturnData } from "../provider/return-data";
2
-
3
- import { ContractFunctionType } from "./model";
4
-
5
- export enum StackTraceEntryType {
6
- CALLSTACK_ENTRY,
7
- UNRECOGNIZED_CREATE_CALLSTACK_ENTRY,
8
- UNRECOGNIZED_CONTRACT_CALLSTACK_ENTRY,
9
- PRECOMPILE_ERROR,
10
- REVERT_ERROR,
11
- PANIC_ERROR,
12
- CUSTOM_ERROR,
13
- FUNCTION_NOT_PAYABLE_ERROR,
14
- INVALID_PARAMS_ERROR,
15
- FALLBACK_NOT_PAYABLE_ERROR,
16
- FALLBACK_NOT_PAYABLE_AND_NO_RECEIVE_ERROR,
17
- UNRECOGNIZED_FUNCTION_WITHOUT_FALLBACK_ERROR, // TODO: Should trying to call a private/internal be a special case of this?
18
- MISSING_FALLBACK_OR_RECEIVE_ERROR,
19
- RETURNDATA_SIZE_ERROR,
20
- NONCONTRACT_ACCOUNT_CALLED_ERROR,
21
- CALL_FAILED_ERROR,
22
- DIRECT_LIBRARY_CALL_ERROR,
23
- UNRECOGNIZED_CREATE_ERROR,
24
- UNRECOGNIZED_CONTRACT_ERROR,
25
- OTHER_EXECUTION_ERROR,
26
- // This is a special case to handle a regression introduced in solc 0.6.3
27
- // For more info: https://github.com/ethereum/solidity/issues/9006
28
- UNMAPPED_SOLC_0_6_3_REVERT_ERROR,
29
- CONTRACT_TOO_LARGE_ERROR,
30
- INTERNAL_FUNCTION_CALLSTACK_ENTRY,
31
- CONTRACT_CALL_RUN_OUT_OF_GAS_ERROR,
32
- }
33
-
34
- export const FALLBACK_FUNCTION_NAME = "<fallback>";
35
- export const RECEIVE_FUNCTION_NAME = "<receive>";
36
- export const CONSTRUCTOR_FUNCTION_NAME = "constructor";
37
- export const UNRECOGNIZED_FUNCTION_NAME = "<unrecognized-selector>";
38
- export const UNKNOWN_FUNCTION_NAME = "<unknown>";
39
- export const PRECOMPILE_FUNCTION_NAME = "<precompile>";
40
- export const UNRECOGNIZED_CONTRACT_NAME = "<UnrecognizedContract>";
41
-
42
- export interface SourceReference {
43
- sourceName: string;
44
- sourceContent: string;
45
- contract?: string;
46
- function?: string;
47
- line: number;
48
- range: [number, number];
49
- }
50
-
51
- export interface CallstackEntryStackTraceEntry {
52
- type: StackTraceEntryType.CALLSTACK_ENTRY;
53
- sourceReference: SourceReference;
54
- functionType: ContractFunctionType;
55
- }
56
-
57
- export interface UnrecognizedCreateCallstackEntryStackTraceEntry {
58
- type: StackTraceEntryType.UNRECOGNIZED_CREATE_CALLSTACK_ENTRY;
59
- sourceReference?: undefined;
60
- }
61
-
62
- export interface UnrecognizedContractCallstackEntryStackTraceEntry {
63
- type: StackTraceEntryType.UNRECOGNIZED_CONTRACT_CALLSTACK_ENTRY;
64
- address: Uint8Array;
65
- sourceReference?: undefined;
66
- }
67
-
68
- export interface PrecompileErrorStackTraceEntry {
69
- type: StackTraceEntryType.PRECOMPILE_ERROR;
70
- precompile: number;
71
- sourceReference?: undefined;
72
- }
73
-
74
- export interface RevertErrorStackTraceEntry {
75
- type: StackTraceEntryType.REVERT_ERROR;
76
- message: ReturnData;
77
- sourceReference: SourceReference;
78
- isInvalidOpcodeError: boolean;
79
- }
80
-
81
- export interface PanicErrorStackTraceEntry {
82
- type: StackTraceEntryType.PANIC_ERROR;
83
- errorCode: bigint;
84
- sourceReference?: SourceReference;
85
- }
86
-
87
- export interface CustomErrorStackTraceEntry {
88
- type: StackTraceEntryType.CUSTOM_ERROR;
89
- // unlike RevertErrorStackTraceEntry, this includes the message already parsed
90
- message: string;
91
- sourceReference: SourceReference;
92
- }
93
-
94
- export interface UnmappedSolc063RevertErrorStackTraceEntry {
95
- type: StackTraceEntryType.UNMAPPED_SOLC_0_6_3_REVERT_ERROR;
96
- sourceReference?: SourceReference;
97
- }
98
-
99
- export interface FunctionNotPayableErrorStackTraceEntry {
100
- type: StackTraceEntryType.FUNCTION_NOT_PAYABLE_ERROR;
101
- value: bigint;
102
- sourceReference: SourceReference;
103
- }
104
-
105
- export interface InvalidParamsErrorStackTraceEntry {
106
- type: StackTraceEntryType.INVALID_PARAMS_ERROR;
107
- sourceReference: SourceReference;
108
- }
109
-
110
- export interface FallbackNotPayableErrorStackTraceEntry {
111
- type: StackTraceEntryType.FALLBACK_NOT_PAYABLE_ERROR;
112
- value: bigint;
113
- sourceReference: SourceReference;
114
- }
115
-
116
- export interface FallbackNotPayableAndNoReceiveErrorStackTraceEntry {
117
- type: StackTraceEntryType.FALLBACK_NOT_PAYABLE_AND_NO_RECEIVE_ERROR;
118
- value: bigint;
119
- sourceReference: SourceReference;
120
- }
121
-
122
- export interface UnrecognizedFunctionWithoutFallbackErrorStackTraceEntry {
123
- type: StackTraceEntryType.UNRECOGNIZED_FUNCTION_WITHOUT_FALLBACK_ERROR;
124
- sourceReference: SourceReference;
125
- }
126
-
127
- export interface MissingFallbackOrReceiveErrorStackTraceEntry {
128
- type: StackTraceEntryType.MISSING_FALLBACK_OR_RECEIVE_ERROR;
129
- sourceReference: SourceReference;
130
- }
131
-
132
- export interface ReturndataSizeErrorStackTraceEntry {
133
- type: StackTraceEntryType.RETURNDATA_SIZE_ERROR;
134
- sourceReference: SourceReference;
135
- }
136
-
137
- export interface NonContractAccountCalledErrorStackTraceEntry {
138
- type: StackTraceEntryType.NONCONTRACT_ACCOUNT_CALLED_ERROR;
139
- sourceReference: SourceReference;
140
- }
141
-
142
- export interface CallFailedErrorStackTraceEntry {
143
- type: StackTraceEntryType.CALL_FAILED_ERROR;
144
- sourceReference: SourceReference;
145
- }
146
-
147
- export interface DirectLibraryCallErrorStackTraceEntry {
148
- type: StackTraceEntryType.DIRECT_LIBRARY_CALL_ERROR;
149
- sourceReference: SourceReference;
150
- }
151
-
152
- export interface UnrecognizedCreateErrorStackTraceEntry {
153
- type: StackTraceEntryType.UNRECOGNIZED_CREATE_ERROR;
154
- message: ReturnData;
155
- sourceReference?: undefined;
156
- isInvalidOpcodeError: boolean;
157
- }
158
-
159
- export interface UnrecognizedContractErrorStackTraceEntry {
160
- type: StackTraceEntryType.UNRECOGNIZED_CONTRACT_ERROR;
161
- address: Uint8Array;
162
- message: ReturnData;
163
- sourceReference?: undefined;
164
- isInvalidOpcodeError: boolean;
165
- }
166
-
167
- export interface OtherExecutionErrorStackTraceEntry {
168
- type: StackTraceEntryType.OTHER_EXECUTION_ERROR;
169
- sourceReference?: SourceReference;
170
- }
171
-
172
- export interface ContractTooLargeErrorStackTraceEntry {
173
- type: StackTraceEntryType.CONTRACT_TOO_LARGE_ERROR;
174
- sourceReference?: SourceReference;
175
- }
176
-
177
- export interface InternalFunctionCallStackEntry {
178
- type: StackTraceEntryType.INTERNAL_FUNCTION_CALLSTACK_ENTRY;
179
- pc: number;
180
- sourceReference: SourceReference;
181
- }
182
-
183
- export interface ContractCallRunOutOfGasError {
184
- type: StackTraceEntryType.CONTRACT_CALL_RUN_OUT_OF_GAS_ERROR;
185
- sourceReference?: SourceReference;
186
- }
1
+ import type {
2
+ SourceReference,
3
+ CallstackEntryStackTraceEntry,
4
+ UnrecognizedCreateCallstackEntryStackTraceEntry,
5
+ UnrecognizedContractCallstackEntryStackTraceEntry,
6
+ PrecompileErrorStackTraceEntry,
7
+ RevertErrorStackTraceEntry,
8
+ PanicErrorStackTraceEntry,
9
+ CustomErrorStackTraceEntry,
10
+ FunctionNotPayableErrorStackTraceEntry,
11
+ InvalidParamsErrorStackTraceEntry,
12
+ FallbackNotPayableErrorStackTraceEntry,
13
+ FallbackNotPayableAndNoReceiveErrorStackTraceEntry,
14
+ UnrecognizedFunctionWithoutFallbackErrorStackTraceEntry,
15
+ MissingFallbackOrReceiveErrorStackTraceEntry,
16
+ ReturndataSizeErrorStackTraceEntry,
17
+ NonContractAccountCalledErrorStackTraceEntry,
18
+ CallFailedErrorStackTraceEntry,
19
+ DirectLibraryCallErrorStackTraceEntry,
20
+ UnrecognizedCreateErrorStackTraceEntry,
21
+ UnrecognizedContractErrorStackTraceEntry,
22
+ OtherExecutionErrorStackTraceEntry,
23
+ UnmappedSolc063RevertErrorStackTraceEntry,
24
+ ContractTooLargeErrorStackTraceEntry,
25
+ InternalFunctionCallStackEntry,
26
+ ContractCallRunOutOfGasError,
27
+ } from "@nomicfoundation/edr";
28
+
29
+ import { requireNapiRsModule } from "../../../common/napi-rs";
30
+
31
+ const {
32
+ StackTraceEntryType,
33
+ stackTraceEntryTypeToString,
34
+ FALLBACK_FUNCTION_NAME,
35
+ RECEIVE_FUNCTION_NAME,
36
+ CONSTRUCTOR_FUNCTION_NAME,
37
+ UNRECOGNIZED_FUNCTION_NAME,
38
+ UNKNOWN_FUNCTION_NAME,
39
+ PRECOMPILE_FUNCTION_NAME,
40
+ UNRECOGNIZED_CONTRACT_NAME,
41
+ } = requireNapiRsModule(
42
+ "@nomicfoundation/edr"
43
+ ) as typeof import("@nomicfoundation/edr");
44
+
45
+ export {
46
+ SourceReference,
47
+ StackTraceEntryType,
48
+ stackTraceEntryTypeToString,
49
+ FALLBACK_FUNCTION_NAME,
50
+ RECEIVE_FUNCTION_NAME,
51
+ CONSTRUCTOR_FUNCTION_NAME,
52
+ UNRECOGNIZED_FUNCTION_NAME,
53
+ UNKNOWN_FUNCTION_NAME,
54
+ PRECOMPILE_FUNCTION_NAME,
55
+ UNRECOGNIZED_CONTRACT_NAME,
56
+ };
57
+
58
+ export type {
59
+ CallstackEntryStackTraceEntry,
60
+ UnrecognizedCreateCallstackEntryStackTraceEntry,
61
+ UnrecognizedContractCallstackEntryStackTraceEntry,
62
+ PrecompileErrorStackTraceEntry,
63
+ RevertErrorStackTraceEntry,
64
+ PanicErrorStackTraceEntry,
65
+ CustomErrorStackTraceEntry,
66
+ FunctionNotPayableErrorStackTraceEntry,
67
+ InvalidParamsErrorStackTraceEntry,
68
+ FallbackNotPayableErrorStackTraceEntry,
69
+ FallbackNotPayableAndNoReceiveErrorStackTraceEntry,
70
+ UnrecognizedFunctionWithoutFallbackErrorStackTraceEntry,
71
+ MissingFallbackOrReceiveErrorStackTraceEntry,
72
+ ReturndataSizeErrorStackTraceEntry,
73
+ NonContractAccountCalledErrorStackTraceEntry,
74
+ CallFailedErrorStackTraceEntry,
75
+ DirectLibraryCallErrorStackTraceEntry,
76
+ UnrecognizedCreateErrorStackTraceEntry,
77
+ UnrecognizedContractErrorStackTraceEntry,
78
+ OtherExecutionErrorStackTraceEntry,
79
+ UnmappedSolc063RevertErrorStackTraceEntry,
80
+ ContractTooLargeErrorStackTraceEntry,
81
+ InternalFunctionCallStackEntry,
82
+ ContractCallRunOutOfGasError,
83
+ };
187
84
 
188
85
  export type SolidityStackTraceEntry =
189
86
  | CallstackEntryStackTraceEntry