Install bytecode
Place tiny runtime bytecode at an address and call it.
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 install bytecode so its input, result, and state changes stay easy to compare.
Solidity to run
address target = address(0xCAFE)
vm.etch(target, hex"602a60005260206000f3")
(bool ok, bytes memory data) = target.staticcall("")
ok
abi.decode(data, (uint256))What to expect
The installed runtime bytecode answers the static call successfully and decodes to uint256 value 42.
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