Skip to main content
38 votes
Accepted

What are Ethereum transaction receipts and what are they used for?

Relationship between Transaction Trie and Receipts Trie provides a good summary: Transaction Receipts record the transaction outcome Here is the Structure of a transaction receipt blockHash: ...
eth's user avatar
  • 86.5k
20 votes
Accepted

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

This was described by EIP 658 which was implemented in the Byzantium fork. The text of the EIP is here, though strangely it doesn't seem to have been formally finalised before the fork. In any case, ...
benjaminion's user avatar
  • 9,317
15 votes

How do I parse the transaction receipt log with web3.js?

You can now use the web3.eth.abi.decodeLog function (web3 1.0). Example from the documentation: web3.eth.abi.decodeLog([{ type: 'string', name: 'myString' },{ type: 'uint256', name: '...
pors's user avatar
  • 433
14 votes
Accepted

Proving the Existence of Logs to the Blockchain

Update: https://github.com/PISAresearch/event-proofs has some code. From its readme: Event proofs A POC to explore how Ethereum logs could be verified in a smart contract. Proofs are generated ...
eth's user avatar
  • 86.5k
11 votes

How do I retrieve the exact gas costs spent for a transaction with ethers.js?

After a bit of searching I figured out that the receipt should be the mined object.. I also wasn't sending any value with the transaction. const addr1Bal = await provider.getBalance(addr1....
love lain's user avatar
  • 271
8 votes

Transaction receipt has contractAddress as null

A contract is created (also called deployed) by sending the contract's byte code to Ethereum address 0x0 (that is, the to field will be 0x0). If the contract creation succeeds, then (and only then) ...
Thomas Jay Rush's user avatar
8 votes
Accepted

how to decode log event of my transaction log?

You can use function web3.eth.abi.decodeParameters, for example in your case: const Web3 = require('web3'); const web3 = new Web3(); const typesArray = [ {type: 'string', name: 'messanger'}, ...
goodvibration's user avatar
6 votes
Accepted

Why does a transaction trigger 12 or 24 confirmation events?

When a transaction is mined, the receipt is available for use, at this point confirmation number is 0, as more block are added to the blockchain, confirmation number increases. With higher ...
kherwa's user avatar
  • 724
6 votes
Accepted

Are the transaction parameters recorded on the blockchain?

Yes, transaction parameters are public once you send them in a transaction. For example, in the following transaction: https://etherscan.io/tx/...
AdrianClv's user avatar
  • 1,269
5 votes

Relationship between Transaction Trie and Receipts Trie

In https://blog.ethereum.org/2015/11/15/merkling-in-ethereum Vitalik Buterin gave an example of using the different trees (transactions, receipt, state trees). Has this transaction been included in a ...
eth's user avatar
  • 86.5k
5 votes
Accepted

How is a post-transaction state calculated?

The state trie contains the balance of each account. Even transactions that throw an exception result in a reduction in the sender's balance through gas costs, which means that the resulting state is ...
Tjaden Hess's user avatar
  • 37.3k
5 votes
Accepted

Getting Tokens Transferred from Web3.py

It searches for all events: Which have been emitted by the designated ERC20 token contract, which in your case is: To: Contract 0xc73e0383f3aff3215e6f04b0331d58cecf0ab849 This value should appear ...
goodvibration's user avatar
4 votes

How to get require() error message?

Yes you can! I made an NPM package to help with this: eth-revert-reason. You can use that package to get the revert reason from a transaction with just the hash! It is hard to decode the revert ...
Shane Fontaine's user avatar
3 votes

Why can't the return value of a transaction be included in the transaction receipt?

If you have a function which does not need the blockchain (or EVM) to get the return value, then you can get it directly. Such functions are view and pure functions. Those functions get the value from ...
Lauri Peltonen's user avatar
3 votes

What is the difference between receipts and transactions?

From the Ethereum's Yellow Paper the transaction receipt stores information that results from executing the transaction. It is a tuple with four fields Block's cumulative gas used Logs produced ...
Ismael's user avatar
  • 30.3k
3 votes
Accepted

Is there a distinguishing characteristic of a 'contract creation' transaction?

Q is to being null enough to distinguish a transaction as one that deployed a contract? Yes Q is looking at the receipt the only way to get the address of the contract? Yes, in the go-ethereum ...
BokkyPooBah's user avatar
  • 40.4k
3 votes

How do I parse the transaction receipt log with web3.js?

For web3.js 1.0 use the following: contractInstance.inputs = [{"indexed": false, "name": "_id", "type": "uint256"}]; //event abi contractInstance._decodeEventABI({data: '0x0'}); //event raw data ...
Eugene's user avatar
  • 219
3 votes

Why does a transaction trigger 12 or 24 confirmation events?

Sorry for jumping on a very old post how ever came across it looking for something else. For those interested, the 24 confirmation events are being emitted due in fact to 24 being the default ...
MrBitKoin's user avatar
2 votes

How do I parse the transaction receipt log with web3.js?

Once you have transaction receipt (tr), you know block number of the transaction (tr.blockNumber). So, you may do the following: myContract.MyEvent ( {}, {fromBlock: tr.blockNumber, toBlock: tr....
Mikhail Vladimirov's user avatar
2 votes
Accepted

Checking if transaction failed over RPC

@eth 's answer is not accurate. use eth_getTransactionReceipt to get status: QUANTITY either 1 (success) or 0 (failure) will be more precise reference: https://eth.wiki/json-rpc/API // ...
temple's user avatar
  • 136
2 votes

Proving the Existence of Logs to the Blockchain

You can easily achieve this using ProvenDB. Here is an example code written in Go to continuously prove your logs' existence and ownership on Blockchain: https://github.com/SouthbankSoftware/...
Guan Gui's user avatar
  • 129
2 votes

Proving the Existence of Logs to the Blockchain

I was trying to solve this exact problem and wrote a proof of concept that can do this: https://github.com/figs999/Ethereum/blob/master/EventStorage.sol Basically, you need two components: 1: A ...
Chance Wees's user avatar
2 votes

How to track payments to contract

For ETH, you can check the amount the smart contract received without having to call any smart contract method, using any block explorer. Programmatically, using an Ethereum node, you can call the ...
Tudor Constantin's user avatar
2 votes
Accepted

Is there a way to prove to a third party that you are the recipient of a transaction?

You could sign a message hash using the private key of the account that received the transaction. ecrecover can be used to verify the signature was generated from that account.
Howard's user avatar
  • 421
2 votes

Why is the units of gasUsed in the transaction receipt 10^11 Wei?

Gas is not ether. Gas is used to estimate the work made by the EVM. It has nothing to do with weis/ether etc... If you want to know how much ether is worth this gas, multiply it by the gasPrice value....
Itération 122442's user avatar
2 votes

I sent 1 ETH to an ICO, tx receipt failed, value (Cancelled)

If the transaction failed then you will not lose the 1 ether value, the only cost is the fee (0.00084184 Ether in this case). You should NOT use your coinbase account (or any other exchange for that ...
Harry Wright's user avatar
  • 1,171
2 votes

Does the new receipt status field report all errors all the way down the call chain?

If you call smart contract A, and it calls smart contract B, and smart contract B fails, it is up to smart contact A how to handle that. In most reasonable cases, the only sane action is for smart ...
James_pic's user avatar
  • 1,108
2 votes
Accepted

To perform getTransactionReceipt on old blocks do I need full or fast node?

Fast synced node will work. Transaction receipts are part of blocks so as long as a block is downloaded you can get all receipts from it.
medvedev1088's user avatar
2 votes

Why isn't the information in transaction receipt stored in the transaction itself?

Because transactions are identified by their hashes. Transaction hash is calculated on all the fields of the transaction. After transaction is signed, you can't modify it without changing the hash, ...
Nulik's user avatar
  • 4,116
2 votes

Sending Signed Transaction returns pending and event:undefined

the sendSignedTransaction(...) returns a Promise (the same as getTransactionCount(...) above it). One way to get its result is to do it like: web3.eth.sendSignedTransaction('0x' + serializedTx....
Tudor Constantin's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible