Solidity REPL
VM helpers

Write a storage slot

Put a raw 32-byte value into a chosen contract slot.

Solidity 0.8.36REPL mode

Why use this example

Use this pattern to shape local EVM state directly while keeping the setup and its visible effect in the same investigation. The entry isolates write a storage slot so its input, result, and state changes stay easy to compare.

Solidity to run

bytes32 slot = bytes32(uint256(4))
vm.store(address(this), slot, bytes32(uint256(8)))
vm.load(address(this), slot)

What to expect

The raw word 8 is written to slot 4 on the active contract and vm.load reads the same word back.

Continue the investigation

Change a value, add another expression, or open Inspect after the run. Accepted entries remain available to the next entry, and the clean replay keeps the complete result reproducible.

Read about VM helpers Execution diagnosis