diff --git a/remix-lib/src/execution/eventsDecoder.js b/remix-lib/src/execution/eventsDecoder.js index c7abdb9d8b..1cd79ac72d 100644 --- a/remix-lib/src/execution/eventsDecoder.js +++ b/remix-lib/src/execution/eventsDecoder.js @@ -73,10 +73,7 @@ class EventsDecoder { var topicId = log.topics[0] var abi = this._event(topicId.replace('0x', ''), eventsABI) if (abi) { - var topics = log.topics.map((value) => { - return value.indexOf('0x') === 0 ? value : '0x' + value - }) - events.push({ from: log.address, topic: topicId, event: abi.event, args: abi.object.parse(topics, '0x' + log.data) }) + events.push({ from: log.address, topic: topicId, event: abi.event, args: abi.object.parse(log.topics, log.data) }) } else { events.push({ from: log.address, data: log.data, topics: log.topics }) } diff --git a/remix-lib/src/web3Provider/web3VmProvider.js b/remix-lib/src/web3Provider/web3VmProvider.js index de9d40b73b..b7dec2cb21 100644 --- a/remix-lib/src/web3Provider/web3VmProvider.js +++ b/remix-lib/src/web3Provider/web3VmProvider.js @@ -108,14 +108,14 @@ web3VmProvider.prototype.txProcessed = function (self, data) { var topics = [] if (log[1].length > 0) { for (var k in log[1]) { - topics.push(log[1][k].toString('hex')) + topics.push('0x' + log[1][k].toString('hex')) } } else { topics.push('0x') } logs.push({ - address: log[0].toString('hex'), - data: log[2].toString('hex'), + address: '0x' + log[0].toString('hex'), + data: '0x' + log[2].toString('hex'), topics: topics, rawVMResponse: log })