I have an event defined like this:
event Created(
address indexed target,
string indexed name
);
I do
emit Created(..., _name); // called function with _name = "comment"
which gives
0xd69ce70c72e2e7191b71ef82881773fbf30510f24a3450f02d555b5f04ac9702
or
0x2361458367e696363fbcc70777d07ebbd2394e89fd0adcaf147faccd1d294d60
in the Ganache event explorer:
How can I convert this back to comment
? web3.toAscii()
just returns garbage.
const x = web3.fromAscii("comment");
. What you get inx
, is what you should see in Ganache explorer. My guess is that you're looking at the wrong thing, sincex
should end with something like 50 zeros (while the first 14 characters are gonna be your "comment").string
tobytes32
, then run again and tell us what you see.keccak256(value)
.