pull/3897/head
yann300 1 year ago committed by Aniket
parent bd44310708
commit a34c6b71f3
  1. 3
      libs/remix-debug/src/trace/traceCache.ts
  2. 4
      libs/remix-lib/src/util.ts
  3. 7
      libs/remix-lib/test/util.ts

@ -102,11 +102,12 @@ export class TraceCache {
}
pushContractCreationFromMemory (index, token, trace, lastMemoryChange) {
const toHexString = arr => Array.from(arr, i => (i as any).toString(16).padStart(2, "0")).join("")
const memory = trace[lastMemoryChange].memory
const stack = trace[index].stack
const offset = 2 * parseInt(toHexPaddedString(stack[stack.length - 2]), 16)
const size = 2 * parseInt(toHexPaddedString(stack[stack.length - 3]), 16)
const memoryHex = Buffer.from(memory).toString('hex')
const memoryHex = toHexString(memory)
this.contractCreation[token] = '0x' + memoryHex.substr(offset, size)
}

@ -190,7 +190,7 @@ export function swarmHashExtractionPOC32 () {
* @return {RegEx}
*/
export function cborEncodedValueExtraction () {
return /64697066735822[0-9a-f]{68}64736f6c6343([0-9a-f]{6})0033$/
return /64697066735822([0-9a-f]{68})64736f6c6343([0-9a-f]{6})0033$/
}
/**
@ -204,7 +204,7 @@ export function inputParametersExtraction () {
export function extractcborMetadata (value) {
const cbor = value.match(cborEncodedValueExtraction())
if (cbor && cbor[1]) value = value.replace(cbor[1], '')
if (cbor && cbor[0]) value = value.replace(cbor[0], '')
return value
}

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save