From e7114622780d55c0939a6b4035de9ace8f86ae9b Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 12 May 2020 14:35:55 +0200 Subject: [PATCH] Return a default source map if deployedBytecode not defined (Yul contract) --- remix-lib/src/sourceLocationTracker.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/remix-lib/src/sourceLocationTracker.js b/remix-lib/src/sourceLocationTracker.js index f8ee6c49e6..9161b68a42 100644 --- a/remix-lib/src/sourceLocationTracker.js +++ b/remix-lib/src/sourceLocationTracker.js @@ -65,9 +65,13 @@ function getSourceMap (address, code, contracts) { let bytes for (let file in contracts) { for (let contract in contracts[file]) { - bytes = isCreation ? contracts[file][contract].evm.bytecode.object : contracts[file][contract].evm.deployedBytecode.object + const bytecode = contracts[file][contract].evm.bytecode + const deployedBytecode = contracts[file][contract].evm.deployedBytecode + if (!deployedBytecode) return bytecode.sourceMap + + bytes = isCreation ? bytecode.object : deployedBytecode.object if (util.compareByteCode(code, '0x' + bytes)) { - return isCreation ? contracts[file][contract].evm.bytecode.sourceMap : contracts[file][contract].evm.deployedBytecode.sourceMap + return isCreation ? bytecode.sourceMap : deployedBytecode.sourceMap } } }