1

I am trying to decode transactions from a block, and I noticed that failed transactions are included in a block. Is there any specific information within failed transaction data or within block that contains this failed transaction, that can tell me that this transaction is failed?

Or maybe that information is stored in one of next blocks?

eth
  • 85,679
  • 53
  • 285
  • 406

1 Answers1

0

The information you are looking for is stored in the transaction receipts.

eth.getTransactionReceipt(...) will return a status field. status 0 means failed.

References: How do I detect a failed transaction after the Byzantium fork as the REVERT opcode does not consume all gas?

What is the exact meaning of a transaction's new receipt 'status' field?

eth
  • 85,679
  • 53
  • 285
  • 406
  • Yes, that is the way, but using this method I can't check all transactions at once, for example in 100 blocks. API is limited to 5 calls in 1 second.

    For example this transaction : 0xea643e4f24b30e90585da76644adc8ed59b9630fb79cddce25292c64c36c9906

    is in this block:
    https://api.etherscan.io/api?module=proxy&action=eth_getBlockByNumber&tag=0xBE99B6&boolean=true&apikey=YourApiKeyToken

    I am trying to find is there any information within this transaction data in this block, that will tell me that this transaction is failed.

    – Stefan Jankovic May 23 '21 at 15:09
  • I checked, if I can find this information using gas information within transaction data, but still no luck. In transaction I see only gas limit and gas price, nothing else that can tell me that transaction if failed, as I read that Post Byzantium works in the way that much lower gas is used if transaction is failed. – Stefan Jankovic May 23 '21 at 15:39