eth_revert_decode
Decode a failed call's revert data into a human-readable reason.
Instructions
Decode a failed call's revert data into a human-readable reason.
Returns {kind, ...} where kind selects the rest of the payload:
'empty' (no revert data at all) -> {reason}; 'error' (Error(string), the
require/revert message) -> {selector, signature, reason}; 'panic'
(Panic(uint256), a compiler check) -> {selector, signature, code, meaning};
'custom' (a user-declared error, needs signature) -> {selector, signature,
selector_matches, args} with args as {name, type, value} exactly as
eth_calldata reports them; 'unknown' (an unrecognized selector and no
signature given) -> {selector, reason}. A signature whose selector is not
the one in data still decodes, but selector_matches is false and reason
says so.
Example: eth_revert_decode("0x08c379a0...") -> kind="error", reason="ERC20: transfer amount exceeds balance".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | The 0x-prefixed revert data returned by a failed call: a 4-byte error selector followed by its ABI-encoded arguments. An empty '0x' is a revert that carried no reason. | |
| signature | No | A custom error's human-readable signature, e.g. 'InsufficientBalance(uint256 available, uint256 required)'. Only needed for user-declared errors — Error(string) and Panic(uint256) are recognized without it. |