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

Decode Panic(uint256)

A panic carries a numeric code instead of a free-form string.

LET’S PICTURE IT

A machine can report a numbered fault category rather than a written explanation.

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.

Recognize a different schema

Panic(uint256) uses selector 0x4e487b71 and one static uint256 argument. Treating its payload as Error(string) would apply the wrong schema.

Read the code word

The integer after the selector identifies a panic category. Hexadecimal 11 is decimal seventeen; its meaning comes from the documented panic-code table.

Separate language checks from explicit messages

Modern Solidity uses panics for certain runtime checks. A user-facing require message and an arithmetic panic are different error forms even when both cause failure.

Preserve the surrounding execution evidence

A code category narrows the investigation but does not identify a source line by itself. Compiler output, call frames and relevant inputs help locate the operation.

Inspect the example

0x4e487b710000000000000000000000000000000000000000000000000000000000000011

The code word is 0x11, commonly associated with checked arithmetic overflow or underflow.

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

Is a Panic payload decoded as a dynamic string?

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.