API Reference

eth_getTransactionReceipt - Scroll

Returns the receipt of a transaction by transaction hash.

This can also be used to track the status of a transaction, since result will be null until the transaction is mined. However, unlike eth_getTransactionByHash , which returns null for unknown transactions, and a non-null response with 3 null fields for a pending transaction, eth_getTransactionReceipt returns null for both pending and unknown transactions.

This call is also commonly used to get the contract address for a contract creation tx.

Note: the receipt is not available for pending transactions.

Parameters

DATA, 32 Bytes - hash of a transaction

params: ["0x964f00fbe2883098c7f4f552f954f9f9a9d20e1ba7ca397706d07a74202f1796"];

Returns

Object - A transaction receipt object, or null when no receipt was found:

  • transactionHash: DATA, 32 Bytes - Hash of the transaction.
  • transactionIndex: QUANTITY - Integer of the transactions index position in the block.
  • blockHash: DATA, 32 Bytes - Hash of the block where this transaction was in.
  • blockNumber: QUANTITY - Block number where this transaction was in.
  • from: DATA, 20 Bytes - Address of the sender.
  • to: DATA, 20 Bytes - Address of the receiver. Null when its a contract creation transaction.
  • cumulativeGasUsed: QUANTITY - The total amount of gas used when this transaction was executed in the block.
  • gasUsed: QUANTITY - The amount of gas used by this specific transaction alone.
  • contractAddress: DATA, 20 Bytes - The contract address created, if the transaction was a contract creation, otherwise null.
  • logs: Array - Array of log objects, which this transaction generated.
  • logsBloom: DATA, 256 Bytes - Bloom filter for light clients to quickly retrieve related logs.

It also returns either:

  • root : DATA 32 bytes of post-transaction stateroot (pre Byzantium)
  • status: QUANTITY either 1 (success) or 0 (failure)

Example

Request

curl --location --request POST 'https://scroll-testnet.unifra.io/v1/your-api-key' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc":"2.0",
    "method":"eth_getTransactionReceipt",
    "params":["0x1a1ae6848d226b7429e7866162824123eff8e7bad0d3be779295c7d01a1f75a2"],
    "id":0
}'

Result

{
    "jsonrpc": "2.0",
    "id": 0,
    "result": {
        "blockHash": "0xdecf7d1109c108ec3c01cd71e9bff4bd5b8790b86654f95e495012eb66524e25",
        "blockNumber": "0x2f",
        "contractAddress": null,
        "cumulativeGasUsed": "0x20f2b",
        "effectiveGasPrice": "0x4a167ca6e",
        "from": "0x000070300830ffc8501cf42402015bad12699d71",
        "gasUsed": "0x20f2b",
        "logs": [
            {
                "address": "0x704da9bc96a89b98f7a3890aba3deebb8b69b043",
                "topics": [
                    "0x9e86c356e14e24e26e3ce769bf8b87de38e0faa0ed0ca946fa09659aa606bd2d",
                    "0x0000000000000000000000003ba3b56f992bb8fdb946b8f5e33310f86560359b",
                    "0x0000000000000000000000003ba3b56f992bb8fdb946b8f5e33310f86560359b"
                ],
                "data": "0x00000000000000000000000000000000000000000000000006f05b59d3b2000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000",
                "blockNumber": "0x2f",
                "transactionHash": "0xcfbb1d0539edf78d869e35099f28e105f08ac270117e64d589c88f00180cef85",
                "transactionIndex": "0x0",
                "blockHash": "0xdecf7d1109c108ec3c01cd71e9bff4bd5b8790b86654f95e495012eb66524e25",
                "logIndex": "0x0",
                "removed": false
            },
            {
                "address": "0xcb4567f103a6ba4cc348547a5094be0d93e88835",
                "topics": [
                    "0x4641df4a962071e12719d8c8c8e5ac7fc4d97b927346a3d7a335b1f7517e133c",
                    "0x6aa1cc505e5e4c0f7b0f441e8d8153e32eb9c20b2cd608d14d28465f2be5357c"
                ],
                "data": "0x",
                "blockNumber": "0x2f",
                "transactionHash": "0xcfbb1d0539edf78d869e35099f28e105f08ac270117e64d589c88f00180cef85",
                "transactionIndex": "0x0",
                "blockHash": "0xdecf7d1109c108ec3c01cd71e9bff4bd5b8790b86654f95e495012eb66524e25",
                "logIndex": "0x1",
                "removed": false
            }
        ],
        "logsBloom": "0x00000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000004200000000000000000000000000000000000000000000040000400000000000000000000000000000000000000009000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000200000000000000000000000000000000000800000000000000000000000000000000000000000000000080000000000000000000004000002000000000000000000010000000000000000000001000008001000",
        "status": "0x1",
        "to": "0xcb4567f103a6ba4cc348547a5094be0d93e88835",
        "transactionHash": "0xcfbb1d0539edf78d869e35099f28e105f08ac270117e64d589c88f00180cef85",
        "transactionIndex": "0x0",
        "type": "0x1"
    }
}
Language
Click Try It! to start a request and see the response here!