import * as StructLog from '@tevm/primitives/StructLog';
// Basic StructLog
const log = StructLog.from({
pc: 0,
op: "PUSH1",
gas: 1000000n,
gasCost: 3n,
depth: 0,
stack: ["0x60"],
});
// StructLog with memory
const mstoreLog = StructLog.from({
pc: 10,
op: "MSTORE",
gas: 999900n,
gasCost: 6n,
depth: 0,
stack: ["0x40", "0x60"],
memory: [
"0000000000000000000000000000000000000000000000000000000000000000",
"0000000000000000000000000000000000000000000000000000000000006040"
],
});
// StructLog with storage
const sstoreLog = StructLog.from({
pc: 20,
op: "SSTORE",
gas: 980000n,
gasCost: 20000n,
depth: 0,
stack: ["0x01", "0x64"],
storage: {
"0x0000000000000000000000000000000000000000000000000000000000000001":
"0x0000000000000000000000000000000000000000000000000000000000000064"
},
});
// StructLog with refund
const refundLog = StructLog.from({
pc: 30,
op: "SSTORE",
gas: 960000n,
gasCost: 5000n,
depth: 0,
stack: ["0x02", "0x00"],
refund: 15000n, // Clearing storage slot
});