6

In the solidity documentation, it is written

Everything that is inside a contract is visible to all external observers. Making something private only prevents other contracts from accessing and modifying the information, but it will still be visible to the whole world outside of the blockchain.

I also read this answer. Can anyone suggest a step to step process of inspecting private variables of a smart contract using the Ethereum data I stored on my system?

1 Answer 1

5

Assuming you have the source code for the contract in question, it's a two-step process:

  1. Determine, from the source code, the location(s) in storage that you're interested in.
  2. Call the eth_getStorageAt JSON-RPC method (perhaps multiple times) to retrieve the data.

Two of my blog posts might help:

If you do not have the source code, there are still a few things you can do. You can try to read the bytecode directly, you can use a disassembler to try to reconstruct the original source, or you can debug transactions to see where data is being written.

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.