Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Contract.prototype._decodeEventABI = function (data) {
var event = this;
data.data = data.data || '';
data.topics = data.topics || [];
var result = formatters.outputLogFormatter(data);
// if allEvents get the right event
if(event.name === 'ALLEVENTS') {
event = event.jsonInterface.find(function (intf) {
return (intf.signature === data.topics[0]);
}) || {anonymous: true};
}
// create empty inputs if none are present (e.g. anonymous events on allEvents)
event.inputs = event.inputs || [];
var argTopics = event.anonymous ? data.topics : data.topics.slice(1);
result.returnValues = abi.decodeLog(event.inputs, data.data, argTopics);
delete result.returnValues.__length__;