[SOLVED] Decode transfer event log

I managed to filter out transfer events by comparing to the hash value of the transfer event signature. But now I want to decode the values I have in the logs (topic0, topic1, topic2 and data) is what I need decoded and can not manage to do it correctly.

This is an example of the log data I have that needs to be decoded so I can read the values
topic0 = from
topic1 = to
topic2 = value


I tried this which throws an error inside the log area of the dashboard

Failed to decode output: Error: data out-of-bounds (length=0, offset=32, code=BUFFER_OVERRUN, version=abi/5.0.7)

 let decoded = web3.eth.abi.decodeLog(
          type: "address",
          name: "from"
          type: "address",
          name: "to"
          type: "uint256",
          name: "value"
      [log.topic0, log.topic1, log.topic2]

in this particular case, it is: from=topic1, to=topic2, value=data

1 Like