A CLI tool for scanning Solidity files and decoding error selectors.
npm install -g solidity-errors-decodernpm 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 0x82b42900By 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/projectTo list all errors found in the project without decoding a specific selector:
sol-errors-decoder --list
# OR
sol-errors-decoder -lThis project was created using Bun:
# Install dependencies
bun install
# Run the tool
bun index.ts
# Build for distribution
bun run buildThe tool:
- Scans the specified directory for
.solfiles - 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