From 5ed55357d3e92da92a5766b95769d56e7a994f69 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 15 Apr 2024 12:29:44 +0200 Subject: [PATCH] fix extracting CALLDATA --- libs/remix-debug/src/trace/traceAnalyser.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/remix-debug/src/trace/traceAnalyser.ts b/libs/remix-debug/src/trace/traceAnalyser.ts index e4183f9942..ba41085d19 100644 --- a/libs/remix-debug/src/trace/traceAnalyser.ts +++ b/libs/remix-debug/src/trace/traceAnalyser.ts @@ -1,5 +1,6 @@ 'use strict' import { util } from '@remix-project/remix-lib' +import { bytesToHex } from '@ethereumjs/util' const { toHexPaddedString } = util import * as traceHelper from './traceHelper' @@ -85,7 +86,7 @@ export class TraceAnalyser { offset = 2 * parseInt(toHexPaddedString(stack[stack.length - 4]), 16) size = 2 * parseInt(toHexPaddedString(stack[stack.length - 5]), 16) } - calldata = '0x' + memory.join('').substr(offset, size) + calldata = bytesToHex(memory).replace('0x', '').substring(offset, offset + size) this.traceCache.pushCallDataChanges(index + 1, calldata) } }