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?
  • Related: 1405, 2856, 4564 or 6107 – Waqar Lim Jun 28 '16 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 '16 at 12:53
  • Not saying it's the same, but related. – Waqar Lim Jun 29 '16 at 14:30
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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