You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my solidity contract, there is a private string parameter (value already defined). I used "forge inspect" and found out that it is stored in Slot 9. I used vm.load to get the value of Slot 9 and it was 0x000000000000000000000000000000000000000000000000000000000000006d. This turned out to be a pointer, pointing to actual storage location.
Then I used vm.load to load value stored in 0x000000000000000000000000000000000000000000000000000000000000006d, it turned out to be 0x0000000000000000000000000000000000000000000000000000000000000000.
Why is this so? Isn't it supposed to be the pre-assigned string value?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
In my solidity contract, there is a private string parameter (value already defined). I used "forge inspect" and found out that it is stored in Slot 9. I used vm.load to get the value of Slot 9 and it was 0x000000000000000000000000000000000000000000000000000000000000006d. This turned out to be a pointer, pointing to actual storage location.
Then I used vm.load to load value stored in 0x000000000000000000000000000000000000000000000000000000000000006d, it turned out to be 0x0000000000000000000000000000000000000000000000000000000000000000.
Why is this so? Isn't it supposed to be the pre-assigned string value?
Beta Was this translation helpful? Give feedback.
All reactions