Tac
Tac
eth_getTransactionReceipt
The eth_getTransactionReceipt method returns the receipt of a transaction, which contains critical information about transaction execution results, including success or failure, gas used, generated events (logs), and deployed contract addresses. The receipt is only available for transactions that have been included in a block.
Use Cases
- Verifying transaction success or failure
- Monitoring gas consumption
- Contract deployment verification
- Event/log extraction
- Transfer confirmation
- Smart contract state change verification
- Transaction fee calculation
- Transaction finality confirmation
Method Details
This method returns the transaction receipt object using the transaction's unique hash.
Response Example
Understanding Status Codes
0x1: Transaction succeeded0x0: Transaction failed (reverted)
Key Fields in Transaction Receipts
- status: Indicates transaction success or failure
- contractAddress: Contains the address of a newly deployed contract (null for regular transactions)
- gasUsed: Amount of gas actually consumed by the transaction
- logs: Events emitted during transaction execution
- effectiveGasPrice: The actual price paid per unit of gas
Common Event Signatures
- ERC20 Transfer:
0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef - ERC20 Approval:
0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925 - ERC721 Transfer:
0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef(same as ERC20)
Important Notes
- Transaction receipts are only available for transactions that have been included in a block
- The receipt provides the definitive status of a transaction (success or failure)
- For contract deployments, the new contract address is included in the receipt
- Event logs can be used to track state changes triggered by the transaction
- Gas used in the receipt provides the actual gas consumption (useful for fee calculation)
See also
- eth_getTransactionByHash - Get the complete transaction data using its unique hash
- eth_getLogs - Search for event logs based on address and topic filters
Parameters
The hash of the transaction