4

I use web3.getStorageAt to access historical information. I can specify a block to see the content of a variable in a given block. But one block can contain several transactions, each modifying this variable.

  1. Which value is retrieved by getStorageAt? The last one?
  2. How to retrieve the values of the storage in each transaction?
3
  • Related: 1405, 2856, 4564 or 6107
    – q9f
    Jun 28, 2016 at 9:29
  • Not really related. My question was about how to access all the data, not about the EVM execution model.
    – bortzmeyer
    Jun 29, 2016 at 12:53
  • Not saying it's the same, but related.
    – q9f
    Jun 29, 2016 at 14:30

1 Answer 1

3

web3.eth.getStorageAt will retrieve the value after all transactions in the block are executed in order: effectively the last transaction (but that transaction could set the value based on earlier transactions in the block).

To retrieve the values of the storage in each transaction, you can start with the state from the previous block, and then execute each transaction through the EVM, a little similar to How to get contract internal transactions. There is no web3.js API for this.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.