Skip to content
Logo

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

ParameterTypeDescription
accountaddressThe account whose storage will be read
slotbytes32The storage slot to read from

Returns

ParameterTypeDescription
valuebytes32The value stored at the specified slot

Examples

function testLoad() public {
    bytes32 leet = vm.load(address(leetContract), bytes32(uint256(0)));
    assertEq(uint256(leet), 1337);
}

Gotchas

  • store - Stores a value in a storage slot

See Also

  • Std Storage - Forge Std library for storage manipulation