A CLI tool for scanning Solidity files and decoding error selectors.
npm install -g solidity-errors-decoder
npm install solidity-errors-decoder
# Using the globally installed command
sol-errors-decoder 0x82b42900
# Using npx
npx solidity-errors-decoder 0x82b42900
# Using bun
bun solidity-errors-decoder 0x82b42900
By default, the tool scans the current directory. You can specify a different directory:
sol-errors-decoder 0x82b42900 --directory /path/to/solidity/project
# OR
sol-errors-decoder 0x82b42900 -d /path/to/solidity/project
To list all errors found in the project without decoding a specific selector:
sol-errors-decoder --list
# OR
sol-errors-decoder -l
This project was created using Bun:
# Install dependencies
bun install
# Run the tool
bun index.ts
# Build for distribution
bun run build
The tool:
- Scans the specified directory for
.sol
files - Extracts all custom errors using regex pattern matching
- Calculates the selector for each error (first 4 bytes of keccak256 hash)
- When given a selector, finds and displays the matching error
MIT