In this track: Read logs and failures
advanced · 4 MIN READ

Read arithmetic panic codes

Different runtime failures can use different numeric categories.

LET’S PICTURE IT

A fault catalog distinguishes a broken calculation from an invalid table position.

SEE IT FOR YOURSELF
Follow a revert and decode its error dataStep 1 / 4
Follow a revert and decode its error dataRequested actionTransfer 100 raw unitsExample inputsAvailable balance40 raw unitsCheck the ruleA deliberately failing local scenario, not a live transactionCondition fails100 > 40Request rejectedRollbackNo successful transferConsumed gas still mattersTop-level failure and a caught nested failure have different contextsError selector0x08c379a04 bytesMessage tailNot enough tokensDynamic string encodingCustom errors and Panic use different selectors and schemasDecoded messageNot enough tokensA diagnostic clueFurther evidenceCaller and code pathRelevant stateError bytes can be constructed by code; decoding is not authentication

This fictional call requests a transfer of one hundred raw units while the relevant balance is forty.

Animated local teaching model. No wallet, RPC or live blockchain data. Some labels and hashes are abbreviated for readability.

Read the hexadecimal notation

Panic code 0x11 identifies checked arithmetic overflow or underflow. The 0x prefix matters: this value is decimal seventeen, not decimal eleven.

Distinguish division by zero

Division or modulo by zero uses code 0x12. An unchecked arithmetic block does not make division by zero a valid successful calculation.

Avoid overclaiming the exact operation

Code 0x11 alone does not tell you which addition, subtraction or multiplication caused the failure. Find the relevant executed operation in its call context.

Test boundaries deliberately

A local test can exercise maximum integers, zero divisors and values just inside a valid range. Use the chosen compiler and execution settings when reproducing behavior.

Inspect the example

Panic(uint256)
0x11: checked arithmetic overflow / underflow
0x12: division or modulo by zero

These are selected categories, not the complete panic table.

Check the complete documented panic list when a different code appears.

TURN UNDERSTANDING INTO PRACTICEOpen the Revert decoder →
QUICK CHECK · NO PRESSURE

Which code is associated with division by zero?

Your progress stays in this browser.
Keep exploring the original referenceSolidity documentation ↗

Original explanations by EtherTools. Examples are educational and source-linked; this site is independent of the Ethereum Foundation. Our approach.