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♦
- 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, ...
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: '...
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♦
- 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....
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) ...
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'},
...
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 ...
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/...
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♦
- 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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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
...
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 ...
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....
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
// ...
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/...
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 ...
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 ...
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.
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....
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 ...
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 ...
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.
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, ...
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....
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
receipts × 86transactions × 46
web3js × 15
solidity × 10
logs × 10
go-ethereum × 8
events × 7
blocks × 7
blockchain × 6
gas × 6
yellow-paper × 6
web3.py × 5
contract-development × 4
addresses × 4
json-rpc × 4
ganache × 4
merkle-patricia-tries × 4
byzantium × 4
truffle × 3
javascript × 3
txpool × 3
ether × 2
contract-deployment × 2
mining × 2
etherscan × 2