Solidity REPL
VM helpers

Move block number

Change block.number during the run with vm.roll.

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 move block number so its input, result, and state changes stay easy to compare.

Solidity to run

vm.roll(21_000_000)
block.number

What to expect

vm.roll changes the local block number to 21,000,000 and block.number confirms it.

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