This is my transaction hash: https://mumbai.polygonscan.com/tx/0x79ed502a8d319ab3b278781042898115d9d6bece15d3d91626a7a6a39c0873b3#eventlog The event logs of the event DataCredentialized is not human readable. I am not sure how to decode these logs. It would be helpful if someone could help me with a javascript code to decode these logs. Thanks in Advance!!
2 Answers
It seems you cannot decode these logs. The hex values are hashed with the keccak256
function which makes it nearly impossible to get the original values.
In your case you have two indexed topics:
- 0xa73d61b387464bf2a657f753d27d72552be88c48d7b0e3adc6a3413fb0b01e2d
- 0x93896ac593a0be8d1921c503fdc75208d8b9d573d83b479b03916c5a6b5781db
Where the 1. value was hashed in the contract with keccak256
The 2. value is also a Keccak-256 hash. Since you wanted to emit a reference type (memory string). You can read more here about Events.
The transaction you linked emits the event DataCredentialized:
event DataCredentialized(bytes32 indexed viewToken, string indexed ipfsUrl);
Taking a closer look at the contract, you will find a viewer function called viewCredentializedData()
that allows you to decode the data by passing the argument retrieved from the event log.
-
at left of of
Topics 1
chooseHex
then copy that data and paste in.https://mumbai.polygonscan.com/address/0xc47d9b99fcf7c3d71630f6987a29002183902e43#readContract
atviewCredentializedData
first argument thenQuery
May 28 at 14:23