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 mapping parameter (address => uint256). I used "forge inspect" and found out that it is stored in Slot 8.
I tried below command to retrieve a mapping value of a given mapping address:
bytes32 amount = vm.load(
contractAddress,
keccak256(abi.encode(mappingAddress, uint256(8)))
);
but the result was 0x0000000000000000000000000000000000000000000000000000000000000000.
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 mapping parameter (address => uint256). I used "forge inspect" and found out that it is stored in Slot 8.
I tried below command to retrieve a mapping value of a given mapping address:
bytes32 amount = vm.load(
contractAddress,
keccak256(abi.encode(mappingAddress, uint256(8)))
);
but the result was 0x0000000000000000000000000000000000000000000000000000000000000000.
Why is this so?
Beta Was this translation helpful? Give feedback.
All reactions