Overview
When working with Solidity smart contracts, you’ve probably encountered cryptic error messages like:0x118cdaa7 here) with no readable message. The @fhenixprotocol/cofhe-errors package maps a selector back to the error name, signature, and source contract.
What's inside
- 53 custom errors from 13 contracts, as of package version 1.0.2
- Complete error signatures with parameter types
- Source contract information
- CLI lookup tool
- JavaScript/TypeScript API
Quick start
No installation is required. Usenpx to decode an error:
Installation (optional)
Only install if you need to import the error database programmatically in your code:CLI usage
Decode an error selector
When you see “execution reverted: 0x…”, decode it:Search errors by name
Find errors when you know part of the error name:List all known errors
Browse the complete error database:JSON output
Get JSON output for scripting and automation:Programmatic API
JavaScript/TypeScript usage
TypeScript with types
Error monitoring example
Error coverage
Package version 1.0.2 includes errors from the following contracts. The counts reflect the contracts at the time of that release, not the contracts deployed today.How error selectors work
Solidity custom errors use a 4-byte selector computed as:- Signature:
OwnableUnauthorizedAccount(address) - Selector:
keccak256("OwnableUnauthorizedAccount(address)") = 0x118cdaa7... - First 4 bytes:
0x118cdaa7
Next steps
- View the error reference, generated from the deployed contracts
- Learn about common errors and troubleshooting
- Review best practices for FHE development