diff options
Diffstat (limited to 'packages/sol-cov/src')
-rw-r--r-- | packages/sol-cov/src/trace.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/sol-cov/src/trace.ts b/packages/sol-cov/src/trace.ts index feebaaab5..389bd8309 100644 --- a/packages/sol-cov/src/trace.ts +++ b/packages/sol-cov/src/trace.ts @@ -27,7 +27,9 @@ export function getTracesByContractAddress(structLogs: StructLog[], startAddress const currentAddress = _.last(callStack) as string; const jumpAddressOffset = structLog.op === OpCode.DelegateCall ? 4 : 2; const newAddress = addressUtils.padZeros( - new BigNumber(addHexPrefix(structLog.stack[structLog.stack.length - jumpAddressOffset])).toString(16), + new BigNumber(addHexPrefix(structLog.stack[structLog.stack.length - jumpAddressOffset - 1])).toString( + 16, + ), ); if (structLog === _.last(structLogs)) { throw new Error('CALL-like opcode can not be the last one'); |