Solidity REPL
Debugging & errors

Assert panic

Trigger the panic reserved for a failed internal invariant.

Solidity 0.8.36REPL modeExpected error

Why use this example

Use this pattern to reproduce a failure or follow an execution from Solidity source into calls and EVM opcodes. The entry isolates assert panic so its input, result, and state changes stay easy to compare.

Solidity to run

uint256 total = 2 + 2
assert(total == 5)

Official Solidity reference

Compare this focused investigation with the complete language definition in the Solidity documentation.

Assert and panic

What to expect

The false internal invariant triggers Solidity panic code 0x01 and the failed entry is not accepted into history.

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 debugging Execution diagnosis