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

Understand why a call reverted

Separate error bytes from the underlying reason execution failed.

LET’S PICTURE IT

An error receipt tells you where to begin investigating. It does not explain every step that led to the problem.

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.

A rollback, with a cost

A reverted call undoes its state changes. Gas already spent on execution is not returned merely because the result was unsuccessful. A top-level transaction can fail, or an outer contract can catch a failed inner call and continue.

Common error shapes

Error(string) has selector 0x08c379a0 and carries a readable message. Panic(uint256) has selector 0x4e487b71 and carries a numeric code for certain runtime failures. Solidity custom errors use their own selectors and ABI-encoded arguments. Revert data may also be empty.

Decode with context

Our revert decoder handles Error(string), Panic(uint256), and custom error declarations you supply. A selector collision is possible, and error bytes can be constructed by any contract. The decoded name is evidence about byte shape, not an authenticated statement of origin.

Then investigate execution

Check which contract returned the data, what inputs it received, and what state or permission caused the condition. A full trace needs execution context; an offline decoder cannot fetch it. Use our calldata lesson to inspect the requested action first.

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

Can an offline error decoder explain every failed transaction?

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.