When an event is triggered, you get something like this:
{
"address": "0x0a7a177321f3b3b6e2299e621eb32e892b141b4b",
"topics": [
"0x0d332ed5c7d6f1999116748c0eb99c740f276d879d025a5be6435fcf177785de"
],
"data": "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000568616c6c6f000000000000000000000000000000000000000000000000000000",
"blockNumber": "0x2f6d30",
"transactionHash": "0x4aaf274a399ee315dc351b30b2e6ff9525996d4700c4843ec0a625512cd21fd1",
"transactionIndex": "0x4",
"blockHash": "0xbfad930ed694aae9fc660951ac4a309701a17e75f02087c72c3ea78431c3005e",
"logIndex": "0x2",
"removed": false
}
I need to know if the event has been confirmed and it won't be "reverted" (at least with a high confidence level).
What I was thinking on doing was to wait for the block referenced in blockHash
to have 12 confirmations to considered the event confirmed.
In order to check the 12 confirmations, my guess is that I need to check the block by calling eth_getBlockByHash
, verify the response is not null
(which I guess would mean the block was discarded) and make sure that eth_blockNumber - block.number
is equals or bigger than 12.
Does this process to confirm an event sounds correct?