The event logs can be obtain via getReceipt for specific transaction. However, the data is not friendly.
How can i parse those topics , data and the event name ?
the receipt of a specific transaction can be that
>eth.getTransactionReceipt("0xd177dfaa34ac9292d16b550515be05ab1e4b3cdd12f9857e8842fbfc8f8d6794")
{
blockHash: "0x036ab39edba5a130f6fbb2354ddc1708894eb1e3a607567f58a400a2f09cac5b",
blockNumber: 550864,
contractAddress: null,
cumulativeGasUsed: 35838,
from: "0x8bae48f227d978d084b009b775222baaf61ed9fe",
gasUsed: 35838,
logs: [{
address: "0xbf35faa9c265baf50c9cff8c389c363b05753275",
blockHash: "0x036ab39edba5a130f6fbb2354ddc1708894eb1e3a607567f58a400a2f09cac5b",
blockNumber: 550864,
data: "0x0000000000000000000000008bae48f227d978d084b009b775222baaf61ed9feaf036571d10c371233bfad0aa6eb1d38671b893d819d5fba2be2df2854ad92c8",
logIndex: 0,
topics: ["0xe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda"],
transactionHash: "0xd177dfaa34ac9292d16b550515be05ab1e4b3cdd12f9857e8842fbfc8f8d6794",
transactionIndex: 0
}, {
address: "0xbf35faa9c265baf50c9cff8c389c363b05753275",
blockHash: "0x036ab39edba5a130f6fbb2354ddc1708894eb1e3a607567f58a400a2f09cac5b",
blockNumber: 550864,
data: "0x0000000000000000000000008bae48f227d978d084b009b775222baaf61ed9feaf036571d10c371233bfad0aa6eb1d38671b893d819d5fba2be2df2854ad92c800000000000000000000000000000000000000000000000000000000000111110000000000000000000000009e9e3b33bc71aea932a956d0f9dd790d2b3dffa300000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000",
logIndex: 1,
topics: ["0xe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a"],
transactionHash: "0xd177dfaa34ac9292d16b550515be05ab1e4b3cdd12f9857e8842fbfc8f8d6794",
transactionIndex: 0
}],
root: "9dd86cc7eeed5996c1e66e91735017e0a35f6937c41faa98606d7fa98d739b1b",
to: "0xbf35faa9c265baf50c9cff8c389c363b05753275",
transactionHash: "0xd177dfaa34ac9292d16b550515be05ab1e4b3cdd12f9857e8842fbfc8f8d6794",
transactionIndex: 0
}
the topic field and data field is all in hex encode. It not friendly. How can i parse those hex string to get semantics value?
Besides, it is same to input field when an account sends a tx to contract. The input field like that
input:"0x797af627af036571d10c371233bfad0aa6eb1d38671b893d819d5fba2be2df2854ad92c8"
the first 4 bytes is the signature of the function and the rest of the data is the parameters of function. How can i make it more semantic