Overview
When working with Solidity smart contracts, you’ve probably encountered cryptic error messages like:0x118cdaa7) with no human-readable message. The @fhenixprotocol/cofhe-errors package provides instant, human-readable error decoding for CoFHE smart contracts.
What's Inside
- 53 custom errors from 13 smart contracts
- Complete error signatures with parameter types
- Source contract information
- Fast CLI lookup tool
- Programmatic JavaScript/TypeScript API
Quick Start
No installation required! Usenpx to decode errors immediately:
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 instantly: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
The package includes errors from the following contracts:| Contract | Error Count |
|---|---|
| TaskManager | 16 |
| ACL | 8 |
| SafeCast | 4 |
| ERC1967Utils | 4 |
| Errors | 4 |
| Ownable2StepUpgradeable | 4 |
| ECDSA | 3 |
| Strings | 3 |
| Common | 2 |
| UUPSUpgradeable | 2 |
| Address | 1 |
| FHE | 1 |
| PlaintextsStorage | 1 |
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 complete error reference with all 53 errors
- Learn about common errors and troubleshooting
- Review best practices for FHE development