load
Signature
function load(address account, bytes32 slot) external view returns (bytes32 value);Description
Loads the value from storage slot slot on account account.
Parameters
| Parameter | Type | Description |
|---|---|---|
account | address | The account whose storage will be read |
slot | bytes32 | The storage slot to read from |
Returns
| Parameter | Type | Description |
|---|---|---|
value | bytes32 | The value stored at the specified slot |
Examples
function testLoad() public {
bytes32 leet = vm.load(address(leetContract), bytes32(uint256(0)));
assertEq(uint256(leet), 1337);
}Gotchas
Related Cheatcodes
store- Stores a value in a storage slot
See Also
- Std Storage - Forge Std library for storage manipulation
Was this helpful?
