Revert Reason Decoder
Decode Ethereum transaction revert reasons and error messages
Input Method
Common Error Selectors
0x08c379a0Error
Error(string)
0x4e487b71Panic
Panic(uint256)
Panic Codes Reference
0x00Generic panic
0x01Assert failed
0x11Arithmetic overflow/underflow
0x12Division or modulo by zero
0x21Invalid enum value
0x22Invalid storage byte array access
0x31Pop on empty array
0x32Array index out of bounds
0x41Out of memory
0x51Invalid internal function call
Error Types: Solidity has three main error types:
- require(): Returns Error(string) with custom message
- revert CustomError(): Custom errors with parameters (more gas efficient)
- Panic: System errors like overflow, divide by zero, array bounds
1. What are Revert Reasons?
When a transaction fails on Ethereum, it reverts with an error message. This error is encoded as hex data. Common error types include require() messages, custom errors, and panic codes from system failures.
2. How does it work?
Error Types
require() errors return Error(string) with a message. Custom errors are more gas-efficient but need the ABI to decode. Panic errors indicate system failures like overflow, division by zero, or array bounds violations.
3. Examples
Require Message - Insufficient Balance
0x08c379a000000000000000000000000000000000000000000000000000000000
→ 'Insufficient token balance' (Uniswap router revert)Panic Code 0x11 - Arithmetic Overflow
0x4e487b710000000000000000000000000000000000000000000000000000000000
→ Arithmetic overflow/underflow (Compound example)Custom Error - InsufficientLiquidity
0x0901f85f → Custom error selector (Uniswap V3)
Requires contract ABI to decode parametersActual Failed TX Example
TX: 0x123abc...
→ Extract revert data from block explorer and decode