An unsuccessful action can return a labeled explanation envelope.
SEE IT FOR YOURSELF
Follow a revert and decode its error dataStep 1 / 4
This fictional call requests a transfer of one hundred raw units while the relevant balance is forty.
This fictional call requests a transfer of one hundred raw units while the relevant balance is forty.The contract rejects this request. State changes in the reverted call are rolled back, while work already consumed can still cost gas.A common Error(string) begins with selector 08c379a0. This example then encodes the message Not enough tokens.A decoder can recognize the supplied error shape. Identifying the true cause and source still needs the call context, code and state.
Animated local teaching model. No wallet, RPC or live blockchain data. Some labels and hashes are abbreviated for readability.
Recognize the selector
The standard Error(string) selector is 0x08c379a0. It prefixes ABI-encoded error arguments, much like a function selector prefixes ordinary function arguments.
Follow the string offset
The argument tuple starts after the four-byte selector. Its first word points thirty-two bytes forward to the string length word.
Read the length and content
Use the declared UTF-8 byte length, then read that many message bytes. Padding completes the content word but is not part of the message.
Keep the message in context
A decoded explanation is diagnostic data supplied by code. It does not authenticate the emitting source or establish that the stated explanation is truthful.