Solidity REPL
Math & units

Checked overflow

Trigger and inspect Solidity’s built-in overflow protection.

Solidity 0.8.36REPL modeExpected error

Why use this example

Use this pattern to confirm Solidity arithmetic and unit behavior before putting the same expression into a contract. The entry isolates checked overflow so its input, result, and state changes stay easy to compare.

Solidity to run

uint8 maximum = 255
maximum + uint8(1)

What to expect

The addition produces Solidity’s checked-arithmetic panic, and the failed attempt is kept out of accepted replay 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 writing Solidity Prototype Solidity behavior