sol-dbg 0.4.2 → 0.5.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/dist/debug/decoding/general.d.ts.map +1 -1
- package/dist/debug/decoding/general.js +3 -2
- package/dist/debug/decoding/general.js.map +1 -1
- package/dist/debug/index.d.ts +1 -1
- package/dist/debug/index.d.ts.map +1 -1
- package/dist/debug/index.js +1 -1
- package/dist/debug/index.js.map +1 -1
- package/dist/debug/tracers/base_tracer.d.ts +30 -0
- package/dist/debug/tracers/base_tracer.d.ts.map +1 -0
- package/dist/debug/tracers/base_tracer.js +108 -0
- package/dist/debug/tracers/base_tracer.js.map +1 -0
- package/dist/debug/tracers/index.d.ts +4 -0
- package/dist/debug/tracers/index.d.ts.map +1 -0
- package/dist/debug/tracers/index.js +20 -0
- package/dist/debug/tracers/index.js.map +1 -0
- package/dist/debug/tracers/sol_debugger.d.ts +9 -0
- package/dist/debug/tracers/sol_debugger.d.ts.map +1 -0
- package/dist/debug/tracers/sol_debugger.js +22 -0
- package/dist/debug/tracers/sol_debugger.js.map +1 -0
- package/dist/debug/tracers/transformers/basic_info.d.ts +23 -0
- package/dist/debug/tracers/transformers/basic_info.d.ts.map +1 -0
- package/dist/debug/tracers/transformers/basic_info.js +52 -0
- package/dist/debug/tracers/transformers/basic_info.js.map +1 -0
- package/dist/debug/tracers/transformers/events.d.ts +12 -0
- package/dist/debug/tracers/transformers/events.d.ts.map +1 -0
- package/dist/debug/tracers/transformers/events.js +30 -0
- package/dist/debug/tracers/transformers/events.js.map +1 -0
- package/dist/debug/tracers/transformers/ext_stack.d.ts +17 -0
- package/dist/debug/tracers/transformers/ext_stack.d.ts.map +1 -0
- package/dist/debug/tracers/transformers/ext_stack.js +200 -0
- package/dist/debug/tracers/transformers/ext_stack.js.map +1 -0
- package/dist/debug/tracers/transformers/index.d.ts +10 -0
- package/dist/debug/tracers/transformers/index.d.ts.map +1 -0
- package/dist/debug/tracers/transformers/index.js +23 -0
- package/dist/debug/tracers/transformers/index.js.map +1 -0
- package/dist/debug/tracers/transformers/int_stack.d.ts +13 -0
- package/dist/debug/tracers/transformers/int_stack.d.ts.map +1 -0
- package/dist/debug/tracers/transformers/int_stack.js +139 -0
- package/dist/debug/tracers/transformers/int_stack.js.map +1 -0
- package/dist/debug/tracers/transformers/op.d.ts +11 -0
- package/dist/debug/tracers/transformers/op.d.ts.map +1 -0
- package/dist/debug/tracers/transformers/op.js +11 -0
- package/dist/debug/tracers/transformers/op.js.map +1 -0
- package/dist/debug/tracers/transformers/source.d.ts +26 -0
- package/dist/debug/tracers/transformers/source.d.ts.map +1 -0
- package/dist/debug/tracers/transformers/source.js +38 -0
- package/dist/debug/tracers/transformers/source.js.map +1 -0
- package/dist/debug/types.d.ts +3 -6
- package/dist/debug/types.d.ts.map +1 -1
- package/dist/debug/types.js +8 -0
- package/dist/debug/types.js.map +1 -1
- package/dist/utils/pp.d.ts +3 -2
- package/dist/utils/pp.d.ts.map +1 -1
- package/dist/utils/pp.js +21 -9
- package/dist/utils/pp.js.map +1 -1
- package/package.json +1 -1
- package/dist/debug/sol_debugger.d.ts +0 -107
- package/dist/debug/sol_debugger.d.ts.map +0 -1
- package/dist/debug/sol_debugger.js +0 -521
- package/dist/debug/sol_debugger.js.map +0 -1
|
@@ -1,521 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SolTxDebugger = void 0;
|
|
4
|
-
exports.lastExternalFrame = lastExternalFrame;
|
|
5
|
-
exports.getContractInfo = getContractInfo;
|
|
6
|
-
const blockchain_1 = require("@ethereumjs/blockchain");
|
|
7
|
-
const common_1 = require("@ethereumjs/common");
|
|
8
|
-
const evm_1 = require("@ethereumjs/evm");
|
|
9
|
-
const rlp_1 = require("@ethereumjs/rlp");
|
|
10
|
-
const statemanager_1 = require("@ethereumjs/statemanager");
|
|
11
|
-
const util_1 = require("@ethereumjs/util");
|
|
12
|
-
const vm_1 = require("@ethereumjs/vm");
|
|
13
|
-
const utils_1 = require("ethereum-cryptography/utils");
|
|
14
|
-
const solc_typed_ast_1 = require("solc-typed-ast");
|
|
15
|
-
const __1 = require("..");
|
|
16
|
-
const artifacts_1 = require("../artifacts");
|
|
17
|
-
const utils_2 = require("../utils");
|
|
18
|
-
const abi_1 = require("./abi");
|
|
19
|
-
const artifact_manager_1 = require("./artifact_manager");
|
|
20
|
-
const decoding_1 = require("./decoding");
|
|
21
|
-
const foundry_cheatcodes_1 = require("./foundry_cheatcodes");
|
|
22
|
-
const opcode_interposing_1 = require("./opcode_interposing");
|
|
23
|
-
const opcodes_1 = require("./opcodes");
|
|
24
|
-
const types_1 = require("./types");
|
|
25
|
-
// Helper functions
|
|
26
|
-
/**
|
|
27
|
-
* Give a stack or a stack frame, find the last **external** stack frame under it (include itself).
|
|
28
|
-
*/
|
|
29
|
-
function lastExternalFrame(arg) {
|
|
30
|
-
const frame = arg instanceof Array ? arg[arg.length - 1] : arg;
|
|
31
|
-
return frame.kind === types_1.FrameKind.InternalCall ? frame.nearestExtFrame : frame;
|
|
32
|
-
}
|
|
33
|
-
function getContractInfo(arg) {
|
|
34
|
-
const frame = lastExternalFrame(arg);
|
|
35
|
-
return frame.info;
|
|
36
|
-
}
|
|
37
|
-
async function getStorage(manager, addr) {
|
|
38
|
-
const rawStorage = await manager.dumpStorage(addr);
|
|
39
|
-
const storageEntries = [];
|
|
40
|
-
for (const [keyStr, valStr] of Object.entries(rawStorage)) {
|
|
41
|
-
const decoded = rlp_1.RLP.decode((0, utils_1.hexToBytes)(valStr));
|
|
42
|
-
(0, solc_typed_ast_1.assert)(decoded instanceof Uint8Array, "");
|
|
43
|
-
const valBuf = (0, util_1.setLengthLeft)(decoded, 32);
|
|
44
|
-
storageEntries.push([BigInt(keyStr), valBuf]);
|
|
45
|
-
}
|
|
46
|
-
return __1.ImmMap.fromEntries(storageEntries);
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Private map tracking VM-to-EVM mapping, used when releasing EVMs from the
|
|
50
|
-
* global listener map for foundry cheatcodes.
|
|
51
|
-
*/
|
|
52
|
-
const vmToEVMMap = new Map();
|
|
53
|
-
/**
|
|
54
|
-
* `SolTxDebugger` is the main debugger class. It contains a VM and a
|
|
55
|
-
* corresponding Web3 provider that can be used to run transactions on that VM.
|
|
56
|
-
*
|
|
57
|
-
* Once a particular transaction `tx` has been run against the vm, you can call
|
|
58
|
-
* `debugger.loadTx(tx)` to debug that transaction.
|
|
59
|
-
*
|
|
60
|
-
* `loadTx(tx)` walks over every step of the tx and computes the following information for it:
|
|
61
|
-
*
|
|
62
|
-
* 1. What is the currently deployed contract in which we are executing?
|
|
63
|
-
* 2. Did the `ArtifactManager` have debugging info for this contract? (src map? ast?)
|
|
64
|
-
* 3. If we have source map compute the corresponding src tripple for this instruction
|
|
65
|
-
* 4. If we have an ast, see if the src tripple of this instruction matches any node in the AST
|
|
66
|
-
* 5. If this is a LOGN instruction, extract the event payload and topics
|
|
67
|
-
* 6. Maintain a stack trace, containing all external and internal calls for
|
|
68
|
-
* this step. Note that we can compute internal stack frames only for contracts
|
|
69
|
-
* with debug info.
|
|
70
|
-
*
|
|
71
|
-
* All the above information is held for each step in the `DbgState` struct.
|
|
72
|
-
*/
|
|
73
|
-
class SolTxDebugger {
|
|
74
|
-
constructor(artifactManager, opts) {
|
|
75
|
-
this.artifactManager = artifactManager;
|
|
76
|
-
this.strict = true;
|
|
77
|
-
this.foundryCheatcodes = false;
|
|
78
|
-
if (opts) {
|
|
79
|
-
this.strict = opts.strict !== undefined ? opts.strict : this.strict;
|
|
80
|
-
this.foundryCheatcodes =
|
|
81
|
-
opts.foundryCheatcodes !== undefined
|
|
82
|
-
? opts.foundryCheatcodes
|
|
83
|
-
: this.foundryCheatcodes;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Decode a *CALL* instruction. Computes:
|
|
88
|
-
* 1. The receiver address
|
|
89
|
-
* 2. The code address
|
|
90
|
-
* 3. The msg.data
|
|
91
|
-
* @param step
|
|
92
|
-
*/
|
|
93
|
-
decodeCall(step) {
|
|
94
|
-
const op = step.op;
|
|
95
|
-
(0, solc_typed_ast_1.assert)(op.opcode === opcodes_1.OPCODES.CALL ||
|
|
96
|
-
op.opcode === opcodes_1.OPCODES.CALLCODE ||
|
|
97
|
-
op.opcode === opcodes_1.OPCODES.DELEGATECALL ||
|
|
98
|
-
op.opcode === opcodes_1.OPCODES.STATICCALL, `Unexpected call instruction {0}`, op.mnemonic);
|
|
99
|
-
const stackTop = step.evmStack.length - 1;
|
|
100
|
-
const argStackOff = op.opcode === opcodes_1.OPCODES.CALL || op.opcode === opcodes_1.OPCODES.CALLCODE ? 3 : 2;
|
|
101
|
-
const argSizeStackOff = argStackOff + 1;
|
|
102
|
-
const receiverArg = (0, __1.wordToAddress)(step.evmStack[stackTop - 1]);
|
|
103
|
-
const argOff = (0, utils_2.bigEndianBufToNumber)(step.evmStack[stackTop - argStackOff]);
|
|
104
|
-
const argSize = (0, utils_2.bigEndianBufToNumber)(step.evmStack[stackTop - argSizeStackOff]);
|
|
105
|
-
const receiver = op.opcode === opcodes_1.OPCODES.DELEGATECALL ? step.address : receiverArg;
|
|
106
|
-
const codeAddr = receiverArg;
|
|
107
|
-
const msgData = step.memory.slice(argOff, argOff + argSize);
|
|
108
|
-
return [receiver, codeAddr, msgData];
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Given the VM state of a trace step adjust the stack trace accordingly. This handles the following cases:
|
|
112
|
-
*
|
|
113
|
-
* - op is CREATE or CREATE2 - push a new external frame for the creation context of the contract
|
|
114
|
-
* - op is CALL/CALLCODE/DELEGATECALL/STATICCALL - push a new external frame for the callee context
|
|
115
|
-
* - stack depth decreased and previous instruction was RETURN, REVERT or was in an error state - pop external frames from the stack
|
|
116
|
-
* - internal call - previous op is JUMPDEST and the source map of the current op is the begining of a new function - push a new internal call frame
|
|
117
|
-
* - return from internal call - pop the last frame
|
|
118
|
-
*/
|
|
119
|
-
async adjustStackFrame(vm, stack, state, trace) {
|
|
120
|
-
const lastExtFrame = lastExternalFrame(stack);
|
|
121
|
-
// First instruction - nothing to do
|
|
122
|
-
if (trace.length === 0) {
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
const lastStep = trace[trace.length - 1];
|
|
126
|
-
const lastOp = lastStep.op;
|
|
127
|
-
// Case 1: Change in external call depth - contract creation, external call, external call return or revert
|
|
128
|
-
if (lastStep.depth !== state.depth) {
|
|
129
|
-
const lastStackTop = lastStep.evmStack.length - 1;
|
|
130
|
-
if (state.depth > lastStep.depth) {
|
|
131
|
-
(0, solc_typed_ast_1.assert)((0, opcodes_1.increasesDepth)(lastOp), `Unexpected depth increase on op ${lastOp.mnemonic}`);
|
|
132
|
-
if ((0, opcodes_1.createsContract)(lastOp)) {
|
|
133
|
-
// Contract creation call
|
|
134
|
-
const off = (0, utils_2.bigEndianBufToNumber)(lastStep.evmStack[lastStackTop - 1]);
|
|
135
|
-
const size = (0, utils_2.bigEndianBufToNumber)(lastStep.evmStack[lastStackTop - 2]);
|
|
136
|
-
const creationBytecode = lastStep.memory.slice(off, off + size);
|
|
137
|
-
const curFrame = await this.makeCreationFrame(lastExtFrame.address, creationBytecode, trace.length);
|
|
138
|
-
stack.push(curFrame);
|
|
139
|
-
}
|
|
140
|
-
else {
|
|
141
|
-
const [receiver, codeAddr, msgData] = this.decodeCall(lastStep);
|
|
142
|
-
const code = await vm.stateManager.getContractCode(codeAddr);
|
|
143
|
-
const codeHash = (0, artifacts_1.getCodeHash)(code);
|
|
144
|
-
const newFrame = await this.makeCallFrame(lastExtFrame.address, receiver, codeAddr, msgData, code, codeHash, trace.length);
|
|
145
|
-
stack.push(newFrame);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
else {
|
|
149
|
-
// External return or exception
|
|
150
|
-
let nFramesPopped = lastStep.depth - state.depth;
|
|
151
|
-
// Pop as many external frames as neccessary to match the decrease in
|
|
152
|
-
// depth reported by web3. We need the loop since we don't count the internal frames as decreasing depth
|
|
153
|
-
while (nFramesPopped > 0 && stack.length > 0) {
|
|
154
|
-
const topFrame = stack[stack.length - 1];
|
|
155
|
-
if (topFrame.kind === types_1.FrameKind.Creation || topFrame.kind === types_1.FrameKind.Call) {
|
|
156
|
-
nFramesPopped--;
|
|
157
|
-
}
|
|
158
|
-
stack.pop();
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
return;
|
|
162
|
-
}
|
|
163
|
-
// Case 2: No change in external depth - check if there is an internal call or return happening
|
|
164
|
-
const curExtFrame = lastExternalFrame(stack);
|
|
165
|
-
const [src, ast] = this.decodeSourceLoc(state.pc, curExtFrame);
|
|
166
|
-
// If there is no debug info for the current contract nothing we can do
|
|
167
|
-
if (src === undefined) {
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
170
|
-
// There are 2 ways to enter an internal function:
|
|
171
|
-
let enteringInternalFun = false;
|
|
172
|
-
// 1. Jumping into an internal function (the previous instruction is a JUMP with source map jump index i)
|
|
173
|
-
if (state.op.mnemonic === "JUMPDEST" &&
|
|
174
|
-
lastStep.op.mnemonic === "JUMP" &&
|
|
175
|
-
lastStep.src &&
|
|
176
|
-
lastStep.src.jump === "i") {
|
|
177
|
-
enteringInternalFun = true;
|
|
178
|
-
}
|
|
179
|
-
// 2. Fall-through (the previous instruction is literally the pervious instruction in the contract body,
|
|
180
|
-
// AND the current JUMPDEST corresponds to a whole function, AND the pervious instructions' callee is different
|
|
181
|
-
// from the current instruction's function.
|
|
182
|
-
if (!enteringInternalFun &&
|
|
183
|
-
state.op.mnemonic === "JUMPDEST" &&
|
|
184
|
-
(ast instanceof solc_typed_ast_1.FunctionDefinition ||
|
|
185
|
-
(ast instanceof solc_typed_ast_1.VariableDeclaration && ast.stateVariable)) &&
|
|
186
|
-
lastStep.stack[lastStep.stack.length - 1].callee !== ast) {
|
|
187
|
-
enteringInternalFun = true;
|
|
188
|
-
}
|
|
189
|
-
if (enteringInternalFun) {
|
|
190
|
-
let args;
|
|
191
|
-
if (ast instanceof solc_typed_ast_1.FunctionDefinition ||
|
|
192
|
-
(ast instanceof solc_typed_ast_1.VariableDeclaration && ast.stateVariable)) {
|
|
193
|
-
(0, solc_typed_ast_1.assert)(curExtFrame.info !== undefined, ``);
|
|
194
|
-
args = this.decodeFunArgs(ast, state.evmStack, curExtFrame.info);
|
|
195
|
-
}
|
|
196
|
-
const newFrame = {
|
|
197
|
-
kind: types_1.FrameKind.InternalCall,
|
|
198
|
-
nearestExtFrame: lastExtFrame,
|
|
199
|
-
callee: ast,
|
|
200
|
-
offset: state.pc,
|
|
201
|
-
startStep: trace.length,
|
|
202
|
-
arguments: args
|
|
203
|
-
};
|
|
204
|
-
stack.push(newFrame);
|
|
205
|
-
return;
|
|
206
|
-
}
|
|
207
|
-
// Returning from an internal function call
|
|
208
|
-
if (state.op.mnemonic === "JUMP" && src.jump === "o") {
|
|
209
|
-
const topFrame = stack[stack.length - 1];
|
|
210
|
-
if (this.strict) {
|
|
211
|
-
(0, solc_typed_ast_1.assert)(topFrame.kind === types_1.FrameKind.InternalCall, `Mismatched internal return from frame `, topFrame.kind);
|
|
212
|
-
stack.pop();
|
|
213
|
-
}
|
|
214
|
-
else {
|
|
215
|
-
if (topFrame.kind === types_1.FrameKind.InternalCall) {
|
|
216
|
-
stack.pop();
|
|
217
|
-
}
|
|
218
|
-
// @todo log an error somewhere
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
async processRawTraceStep(vm, stateManager, step, trace, stack) {
|
|
223
|
-
const evmStack = step.stack.map((word) => (0, utils_2.bigIntToBuf)(word, 32, "big"));
|
|
224
|
-
const lastStep = trace.length > 0 ? trace[trace.length - 1] : undefined;
|
|
225
|
-
const memory = lastStep === undefined || (0, opcodes_1.changesMemory)(lastStep.op)
|
|
226
|
-
? new Uint8Array(step.memory)
|
|
227
|
-
: lastStep.memory;
|
|
228
|
-
const op = (0, opcodes_1.getOpInfo)(step.opcode.name);
|
|
229
|
-
let storage;
|
|
230
|
-
if (lastStep === undefined || lastStep.op.opcode === opcodes_1.OPCODES.SSTORE) {
|
|
231
|
-
storage = await getStorage(stateManager, step.address);
|
|
232
|
-
}
|
|
233
|
-
else {
|
|
234
|
-
storage = lastStep.storage;
|
|
235
|
-
}
|
|
236
|
-
const gasCost = BigInt(step.opcode.fee);
|
|
237
|
-
const dynamicGasCost = step.opcode.dynamicFee === undefined ? gasCost : step.opcode.dynamicFee;
|
|
238
|
-
// First translate the basic VM state
|
|
239
|
-
const vmState = {
|
|
240
|
-
evmStack,
|
|
241
|
-
memory,
|
|
242
|
-
storage,
|
|
243
|
-
op,
|
|
244
|
-
pc: step.pc,
|
|
245
|
-
gasCost,
|
|
246
|
-
dynamicGasCost,
|
|
247
|
-
gas: step.gasLeft,
|
|
248
|
-
depth: step.depth + 1, // Match geth's depth starting at 1
|
|
249
|
-
address: step.address,
|
|
250
|
-
codeAddress: step.codeAddress
|
|
251
|
-
};
|
|
252
|
-
await this.adjustStackFrame(vm, stack, vmState, trace);
|
|
253
|
-
const curExtFrame = lastExternalFrame(stack);
|
|
254
|
-
let src;
|
|
255
|
-
let astNode;
|
|
256
|
-
try {
|
|
257
|
-
[src, astNode] = this.decodeSourceLoc(step.pc, curExtFrame);
|
|
258
|
-
}
|
|
259
|
-
catch (e) {
|
|
260
|
-
// Nothing to do
|
|
261
|
-
}
|
|
262
|
-
let emittedEvent = undefined;
|
|
263
|
-
// Finally check if an event is being emitted for this step
|
|
264
|
-
if (step.opcode.name.startsWith("LOG")) {
|
|
265
|
-
const off = (0, utils_2.bigEndianBufToNumber)(evmStack[evmStack.length - 1]);
|
|
266
|
-
const size = (0, utils_2.bigEndianBufToNumber)(evmStack[evmStack.length - 2]);
|
|
267
|
-
const nTopics = step.opcode.name[3] - "0";
|
|
268
|
-
const payload = memory.slice(off, off + size);
|
|
269
|
-
emittedEvent = {
|
|
270
|
-
payload,
|
|
271
|
-
topics: evmStack
|
|
272
|
-
.slice(evmStack.length - 2 - nTopics, evmStack.length - 2)
|
|
273
|
-
.reverse()
|
|
274
|
-
.map(__1.bigEndianBufToBigint)
|
|
275
|
-
};
|
|
276
|
-
}
|
|
277
|
-
return {
|
|
278
|
-
...vmState,
|
|
279
|
-
stack: [...stack],
|
|
280
|
-
src,
|
|
281
|
-
astNode,
|
|
282
|
-
emittedEvent,
|
|
283
|
-
contractInfo: curExtFrame.info
|
|
284
|
-
};
|
|
285
|
-
}
|
|
286
|
-
static async getEVM(opts, foundryCheatcodes) {
|
|
287
|
-
const tmpEvm = await evm_1.EVM.create(opts);
|
|
288
|
-
if (!foundryCheatcodes) {
|
|
289
|
-
return tmpEvm;
|
|
290
|
-
}
|
|
291
|
-
const opcodes = (0, evm_1.getOpcodesForHF)(tmpEvm.common);
|
|
292
|
-
const [precompile, foundryCtx] = (0, foundry_cheatcodes_1.makeFoundryCheatcodePrecompile)();
|
|
293
|
-
const optsCopy = {
|
|
294
|
-
...opts,
|
|
295
|
-
customOpcodes: [
|
|
296
|
-
...(opts.customOpcodes ? opts.customOpcodes : []),
|
|
297
|
-
...(0, opcode_interposing_1.foundryInterposedOps)(opcodes, foundryCtx)
|
|
298
|
-
],
|
|
299
|
-
customPrecompiles: [
|
|
300
|
-
...(opts.customPrecompiles ? opts.customPrecompiles : []),
|
|
301
|
-
{
|
|
302
|
-
address: foundry_cheatcodes_1.FoundryCheatcodesAddress,
|
|
303
|
-
function: precompile
|
|
304
|
-
}
|
|
305
|
-
]
|
|
306
|
-
};
|
|
307
|
-
const res = await evm_1.EVM.create(optsCopy);
|
|
308
|
-
foundry_cheatcodes_1.foundryCtxMap.set(res, foundryCtx);
|
|
309
|
-
return res;
|
|
310
|
-
}
|
|
311
|
-
/**
|
|
312
|
-
* Releases references to the EVM stored inside VM from the
|
|
313
|
-
* `interpRunListeners` map. This avoids memory leaks when repeatedly
|
|
314
|
-
* calling the debugger on different transactions. Should be called once
|
|
315
|
-
* for every vm created by `SolTxDebugger.createVm` after its done being
|
|
316
|
-
* used.
|
|
317
|
-
*/
|
|
318
|
-
static releaseVM(vm) {
|
|
319
|
-
const evm = vmToEVMMap.get(vm);
|
|
320
|
-
if (evm) {
|
|
321
|
-
foundry_cheatcodes_1.foundryCtxMap.delete(evm);
|
|
322
|
-
}
|
|
323
|
-
vmToEVMMap.delete(vm);
|
|
324
|
-
}
|
|
325
|
-
static async createVm(stateManager, foundryCheatcodes) {
|
|
326
|
-
const common = new common_1.Common({ chain: common_1.Chain.Mainnet, hardfork: common_1.Hardfork.Shanghai });
|
|
327
|
-
const blockchain = await blockchain_1.Blockchain.create({ common });
|
|
328
|
-
if (!stateManager) {
|
|
329
|
-
stateManager = new statemanager_1.DefaultStateManager();
|
|
330
|
-
}
|
|
331
|
-
const evm = await SolTxDebugger.getEVM({ common, blockchain, stateManager, allowUnlimitedContractSize: true }, foundryCheatcodes);
|
|
332
|
-
const vm = await vm_1.VM.create({
|
|
333
|
-
common,
|
|
334
|
-
blockchain,
|
|
335
|
-
stateManager,
|
|
336
|
-
evm,
|
|
337
|
-
activatePrecompiles: true
|
|
338
|
-
});
|
|
339
|
-
vmToEVMMap.set(vm, evm);
|
|
340
|
-
return vm;
|
|
341
|
-
}
|
|
342
|
-
async debugTx(tx, block, stateManager) {
|
|
343
|
-
const vm = await SolTxDebugger.createVm(stateManager.shallowCopy(true), this.foundryCheatcodes);
|
|
344
|
-
const sender = tx.getSenderAddress();
|
|
345
|
-
const receiver = tx.to === undefined ? __1.ZERO_ADDRESS_STRING : tx.to.toString();
|
|
346
|
-
const isCreation = receiver === __1.ZERO_ADDRESS_STRING;
|
|
347
|
-
const stack = [];
|
|
348
|
-
let curFrame;
|
|
349
|
-
if (isCreation) {
|
|
350
|
-
curFrame = await this.makeCreationFrame(sender, tx.data, 0);
|
|
351
|
-
}
|
|
352
|
-
else {
|
|
353
|
-
(0, solc_typed_ast_1.assert)(tx.to !== undefined, 'Expected "to" of tx {0} to be defined, got undefined instead', (0, utils_1.bytesToHex)(tx.hash()));
|
|
354
|
-
const code = await vm.stateManager.getContractCode(tx.to);
|
|
355
|
-
/// @todo remove - arbitrary restriction, only good for debugging
|
|
356
|
-
(0, solc_typed_ast_1.assert)(code.length > 0, "Missing code for address {0}", tx.to.toString());
|
|
357
|
-
const codeHash = (0, artifacts_1.getCodeHash)(code);
|
|
358
|
-
curFrame = await this.makeCallFrame(sender, tx.to, tx.to, tx.data, code, codeHash, 0);
|
|
359
|
-
}
|
|
360
|
-
stack.push(curFrame);
|
|
361
|
-
const trace = [];
|
|
362
|
-
(0, solc_typed_ast_1.assert)(vm.evm.events !== undefined, "Unable to access EVM events at this point");
|
|
363
|
-
vm.evm.events.on("step", async (step, next) => {
|
|
364
|
-
const curStep = await this.processRawTraceStep(vm, vm.stateManager, step, trace, stack);
|
|
365
|
-
trace.push(curStep);
|
|
366
|
-
next();
|
|
367
|
-
});
|
|
368
|
-
const txRes = await vm.runTx({
|
|
369
|
-
tx,
|
|
370
|
-
block,
|
|
371
|
-
skipBalance: true,
|
|
372
|
-
skipNonce: true,
|
|
373
|
-
skipBlockGasLimitValidation: true
|
|
374
|
-
});
|
|
375
|
-
SolTxDebugger.releaseVM(vm);
|
|
376
|
-
return [trace, txRes];
|
|
377
|
-
}
|
|
378
|
-
/**
|
|
379
|
-
* Build a `CreationFrame` from the given `sender` address, `data` `Uint8Array`(msg.data) and the current trace step number.
|
|
380
|
-
*/
|
|
381
|
-
async makeCreationFrame(sender, data, step) {
|
|
382
|
-
const contractInfo = await this.artifactManager.getContractFromCreationBytecode(data);
|
|
383
|
-
let args;
|
|
384
|
-
const callee = contractInfo && contractInfo.ast ? contractInfo.ast.vConstructor : undefined;
|
|
385
|
-
if (contractInfo && callee instanceof solc_typed_ast_1.FunctionDefinition) {
|
|
386
|
-
// TODO: Try and find the arguments inside the creation code and decode them
|
|
387
|
-
}
|
|
388
|
-
return {
|
|
389
|
-
kind: types_1.FrameKind.Creation,
|
|
390
|
-
sender,
|
|
391
|
-
msgData: data,
|
|
392
|
-
code: data,
|
|
393
|
-
info: contractInfo,
|
|
394
|
-
callee,
|
|
395
|
-
address: __1.ZERO_ADDRESS,
|
|
396
|
-
startStep: step,
|
|
397
|
-
arguments: args,
|
|
398
|
-
codeMdHash: (0, artifacts_1.getCreationCodeHash)(data)
|
|
399
|
-
};
|
|
400
|
-
}
|
|
401
|
-
/**
|
|
402
|
-
* Given a contract info and a function selector find the (potentially inherited) entry point (function or public var getter).
|
|
403
|
-
* @param info
|
|
404
|
-
* @param selector
|
|
405
|
-
* @returns
|
|
406
|
-
*/
|
|
407
|
-
findEntryPoint(info, selector) {
|
|
408
|
-
if (info.ast === undefined) {
|
|
409
|
-
return undefined;
|
|
410
|
-
}
|
|
411
|
-
const contract = info.ast;
|
|
412
|
-
const infer = this.artifactManager.infer(info.artifact.compilerVersion);
|
|
413
|
-
return (0, abi_1.findMethodBySelector)(selector, contract, infer);
|
|
414
|
-
}
|
|
415
|
-
/**
|
|
416
|
-
* Build a `CallFrame` from the given `sender` address, `receiver` address, `data` `Uint8Array`, (msg.data) and the current trace step number.
|
|
417
|
-
*/
|
|
418
|
-
async makeCallFrame(sender, receiver, codeAddress, data, receiverCode, codeHash, step) {
|
|
419
|
-
const contractInfo = codeHash === undefined
|
|
420
|
-
? codeHash
|
|
421
|
-
: this.artifactManager.getContractFromMDHash(codeHash);
|
|
422
|
-
const selector = (0, utils_1.bytesToHex)(data.slice(0, 4));
|
|
423
|
-
let callee;
|
|
424
|
-
let args;
|
|
425
|
-
if (contractInfo && contractInfo.ast) {
|
|
426
|
-
const abiVersion = contractInfo.artifact.abiEncoderVersion;
|
|
427
|
-
const infer = this.artifactManager.infer(contractInfo.artifact.compilerVersion);
|
|
428
|
-
callee = this.findEntryPoint(contractInfo, selector);
|
|
429
|
-
if (callee !== undefined) {
|
|
430
|
-
try {
|
|
431
|
-
args = (0, abi_1.buildMsgDataViews)(callee, data, types_1.DataLocationKind.CallData, infer, abiVersion);
|
|
432
|
-
}
|
|
433
|
-
catch (e) {
|
|
434
|
-
args = undefined;
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
return {
|
|
439
|
-
kind: types_1.FrameKind.Call,
|
|
440
|
-
sender, // TODO: This should be Address
|
|
441
|
-
msgData: data,
|
|
442
|
-
receiver: receiver, // TODO: This should be Address
|
|
443
|
-
code: receiverCode,
|
|
444
|
-
info: contractInfo,
|
|
445
|
-
callee,
|
|
446
|
-
address: receiver,
|
|
447
|
-
startStep: step,
|
|
448
|
-
arguments: args,
|
|
449
|
-
codeMdHash: codeHash,
|
|
450
|
-
codeAddress
|
|
451
|
-
};
|
|
452
|
-
}
|
|
453
|
-
/**
|
|
454
|
-
* Helper function to get the source information for the instruction at a given `instrOffset`,
|
|
455
|
-
* in the context of the external call `ctx`.
|
|
456
|
-
*
|
|
457
|
-
* There are several cases this handles:
|
|
458
|
-
*
|
|
459
|
-
* 1. If there is no debug info for the contract executing in `ctx` return undefined
|
|
460
|
-
* 2. If there is debug info, but no AST return only the decoded bytecode sourcemap entry
|
|
461
|
-
* 3. If there is both debug info and an AST return the decoded source location and any AST nodes that match this location
|
|
462
|
-
*/
|
|
463
|
-
decodeSourceLoc(instrOffset, ctx) {
|
|
464
|
-
if (!ctx.info) {
|
|
465
|
-
return [undefined, undefined];
|
|
466
|
-
}
|
|
467
|
-
const bytecodeInfo = ctx.kind === types_1.FrameKind.Creation ? ctx.info.bytecode : ctx.info.deployedBytecode;
|
|
468
|
-
const src = (0, artifact_manager_1.getOffsetSrc)(instrOffset, bytecodeInfo);
|
|
469
|
-
const astNode = ctx.info.artifact.srcMap.get(`${src.start}:${src.length}:${src.sourceIndex}`);
|
|
470
|
-
return [src, astNode];
|
|
471
|
-
}
|
|
472
|
-
/**
|
|
473
|
-
* WIP: TODO document
|
|
474
|
-
* TODO: Rename - this function doesn't do any actual decoding - just building up DataView for the arguments
|
|
475
|
-
* of a function
|
|
476
|
-
*/
|
|
477
|
-
decodeFunArgs(callee, stack, contractInfo) {
|
|
478
|
-
const res = [];
|
|
479
|
-
let formals;
|
|
480
|
-
const infer = this.artifactManager.infer(contractInfo.artifact.compilerVersion);
|
|
481
|
-
try {
|
|
482
|
-
formals =
|
|
483
|
-
callee instanceof solc_typed_ast_1.FunctionDefinition
|
|
484
|
-
? callee.vParameters.vParameters.map((argDef) => [
|
|
485
|
-
argDef.name,
|
|
486
|
-
infer.variableDeclarationToTypeNode(argDef)
|
|
487
|
-
])
|
|
488
|
-
: infer
|
|
489
|
-
.getterArgsAndReturn(callee)[0]
|
|
490
|
-
.map((typ, i) => [`ARG_${i}`, typ]);
|
|
491
|
-
}
|
|
492
|
-
catch (e) {
|
|
493
|
-
// `variableDeclarationToTypeNode` may fail when referencing structs/contracts that are defined
|
|
494
|
-
// in SourceUnits that are missing
|
|
495
|
-
return undefined;
|
|
496
|
-
}
|
|
497
|
-
let offsetFromTop = -1;
|
|
498
|
-
for (let i = formals.length - 1; i >= 0; i--) {
|
|
499
|
-
const [name, typ] = formals[i];
|
|
500
|
-
const stackSize = (0, decoding_1.isCalldataType2Slots)(typ) ? 2 : 1;
|
|
501
|
-
offsetFromTop += stackSize;
|
|
502
|
-
if (offsetFromTop > stack.length) {
|
|
503
|
-
// Stack underflow. Could be due to optimized code?
|
|
504
|
-
return undefined;
|
|
505
|
-
}
|
|
506
|
-
res.unshift([
|
|
507
|
-
name,
|
|
508
|
-
{
|
|
509
|
-
type: typ,
|
|
510
|
-
loc: {
|
|
511
|
-
kind: types_1.DataLocationKind.Stack,
|
|
512
|
-
offsetFromTop
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
]);
|
|
516
|
-
}
|
|
517
|
-
return res;
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
exports.SolTxDebugger = SolTxDebugger;
|
|
521
|
-
//# sourceMappingURL=sol_debugger.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sol_debugger.js","sourceRoot":"","sources":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