Skip to main content

Overview

This page documents critical limitations and important considerations when working with CoFHE. Understanding these common issues and error messages will help you troubleshoot problems and build more robust FHE-enabled smart contracts.
Always verify you’re using compatible component versions. Many errors can be resolved by ensuring you’re using the latest versions of all CoFHE components.

Quick Error Decoding

Encountering cryptic execution reverted: 0x... errors? Use the @fhenixprotocol/cofhe-errors package to decode them instantly:
See the CoFHE Errors Package documentation for full usage instructions and the Error Reference for a complete list of all 53 errors.

Common Issues

Missing Revert Data

If you encounter a Missing revert data error, verify that you’re using the latest cofhe-contracts version.
1

Check your version

Verify the version of cofhe-contracts in your project:
2

Compare with compatibility guide

Check the Compatibility page to ensure you’re using a supported version.
3

Update if necessary

If your version is outdated, update to the latest compatible version:
This section will be expanded over time as new issues arise. If you encounter an issue not documented here, please report it to the Fhenix team.

Possible Errors from Solidity

The following table lists common Solidity errors you may encounter when working with CoFHE contracts. Each error includes a description to help you understand what went wrong and how to fix it.

Understanding Error Types

Input Validation Errors:
  • InvalidInputsAmount, InvalidOperationInputs, TooManyInputs, InvalidBytesLength
  • These errors indicate problems with how data is passed to FHE operations
  • Solution: Verify that you’re passing the correct number and type of arguments
Type and Security Zone Errors:
  • InvalidTypeOrSecurityZone, InvalidInputType, InvalidInputForFunction, InvalidSecurityZone
  • These errors occur when encrypted types don’t match expected types or security zones
  • Solution: Ensure encrypted values use compatible types (e.g., euint32 matches euint32) and are in the correct security zone
Authentication Errors:
  • InvalidSignature, InvalidSigner, InvalidAddress
  • These errors relate to cryptographic verification and address validation
  • Solution: Verify signatures are valid and addresses are properly formatted
Authorization Errors:
  • OnlyOwnerAllowed, OnlyAggregatorAllowed, SenderNotAllowed, DirectAllowForbidden
  • These errors indicate permission or access control violations
  • Solution: Ensure the correct account is calling the function and that proper permissions are set
Delegation Errors:
  • AlreadyDelegated, SenderCannotBeDelegateeAddress
  • These errors occur when delegation operations are invalid
  • Solution: Check that delegation hasn’t already occurred and that sender and delegatee addresses are different

Troubleshooting Tips

When encountering errors:
  1. Check error messages carefully: The error name and description provide clues about what went wrong
  2. Verify input types: Ensure encrypted values match expected types
  3. Check permissions: Verify that FHE.allowThis() or FHE.allowSender() have been called where necessary
  4. Review component versions: Ensure all CoFHE components are up to date
  5. Test in mock environment: Use the mock environment to debug issues without network delays
Many errors can be prevented by following best practices and ensuring proper access control management.

Next Steps