Return a default source map if deployedBytecode not defined (Yul contract)

pull/5370/head
yann300 5 years ago committed by Aniket
parent 3de632734f
commit e711462278
  1. 8
      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
}
}
}

Loading…
Cancel
Save