Closed ckoopmann closed 1 month ago
Hi @ckoopmann thanks for your suggestion!
I feel this is better suited for a decompilation tool like Heimdall or Dedaub as it has a more sophisticated understanding of the storage layout based on advanced heuristics. cast
simply operates on the ABI which does not included private variables.
For now marking this as not planned
Component
Cast
Describe the feature you would like
I use
cast storage
to get the value of a private storage variable on a smart contract. Currently this requires me to calculate the storage slot separately which can be quite complex. It'd be great if there was a way to automate this and query a variables value by name.For example for the following contract
It would be nice to be able to query
cast storage <ADDRESS> "myUint"
In addition it would be nice to query also more complex nested expressions such as:myArray[0]
myMapping[0][1]
myMapping[myUint][myArray[0]]
Alternatively one could introduce a new command
cast storage-slot
that just calculate the slot for such an expression which the user could then chain with thecast storage
command to get the value. For this to work, the contract source code needs to be available, for example for verified contracts on etherscan.Additional context
No response