I receive a transaction event in my log of my Ethereum transaction.
.on('receipt', function(receipt){
console.log("address: " + receipt.logs[0].address);
console.log("receipt.logs[0].args " + receipt.logs[0].data );
})
My transaction receipt object is :
{
"blockHash": "0x2de8d9ff07b91523359c08a0004131d5839a7d4ff5aa1bd00843777a5e096ca1",
"blockNumber": 8726746,
"contractAddress": null,
"cumulativeGasUsed": 5151494,
"from": "0xf73875991f5fe4ffaf32380e25e185f4f9a3b245",
"gasUsed": 93895,
"logs": [
{
"address": "0x75508672C8C155b06a0Bc82e8CA9aB967c9a17d8",
"blockHash": "0x2de8d9ff07b91523359c08a0004131d5839a7d4ff5aa1bd00843777a5e096ca1",
"blockNumber": 8726746,
"data": "0x00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000000c496c2056696e6369746f7265000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000047177716500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000477657771000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003717765000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000047177657100000000000000000000000000000000000000000000000000000000",
"logIndex": 16,
"removed": false,
"topics": [
"0x8cdd8faf489944941fc651bffdc4a404b57bddc1c35eccf8531de89a4422d777"
],
"transactionHash": "0xf29b396e697713937dcf56e3f0c0dd2577beeac48c67a8168ebc084f75daf7b2",
"transactionIndex": 12,
"id": "log_a7c1ba91"
}
],
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000400000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000",
"status": true,
"to": "0x75508672c8c155b06a0bc82e8ca9ab967c9a17d8",
"transactionHash": "0xf29b396e697713937dcf56e3f0c0dd2577beeac48c67a8168ebc084f75daf7b2",
"transactionIndex": 12
}
receipt.logs[0].data is
0x00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000000c496c2056696e6369746f72650000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b3535353535353535353536000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000336363600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001360000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000013600000000000000000000000000000000000000000000000000000000000000
UPDATE In my smart contract the Event is
event Winner(
string messanger,
string username,
string nome,
string cognome,
string email
);
emit Winner ("Il Vincitore", "111111", "2222" , "3333","4444");
END UPDATE
I tried to decode this hexadecimal code with
const temp = web3.eth.abi.decodeLog(receipt, receipt.logs[0].data, receipt.logs[0].topics[0]);
without success.
I tried
const temp = web3.utils.toAscii(receipt.logs[0].data);
console.log("toAscii " + temp);
but I get no alphabetic character in a single string that need manual parsing.
à ` Il Vincitore111111222233334444
any suggestion?
I receive a transaction event in my log
- do you happen to know the prototype of the event (i.e., the type of each parameter, and whether or not it is indexed)?