Errors
Both contracts use custom errors for gas-efficient reverts. This reference lists all errors, their parameters, and when they are thrown.
EnergyRegistry Errors
Solidity
error WatcherNotRegistered(uint64 watcherId);
error UnauthorizedWatcherOwner(address caller, uint64 watcherId);
error ProjectNotRegistered(uint64 projectId);
error AttesterAlreadyAuthorized(address attester, uint64 projectId);
error AttesterNotAuthorized(address attester, uint64 projectId);
error EmptyAttesterArray();
error UnauthorizedResolver(address caller);
error PeriodAlreadyAttested(uint64 projectId, uint64 fromTimestamp, uint64 toTimestamp);
error PeriodStartAlreadyAttested(uint64 projectId, uint64 fromTimestamp);
error InvalidEnergyType(uint8 energyType);
error InvalidProjectType(uint8 projectType);
error UnauthorizedEnergyTypeAdmin(address caller);
error EnergyTypeNotRegistered(uint8 id);EnergyAttestationResolver Errors
Solidity
error UnauthorizedAttester(address attester);
error ProjectNotRegistered(uint64 projectId);
error InvalidTimestamps();
error InvalidReadingCount();
error InvalidReadingInterval();
error InvalidReadingsLength(uint32 readingCount, uint256 readingsLength);
error TimestampOverflow();
error InvalidMethod();
error InvalidEnergyType(uint8 energyType);Common Causes
| Error | Common Cause |
|---|---|
| UnauthorizedAttester | The signing wallet is not whitelisted for this project or watcher |
| PeriodAlreadyAttested | This time window was already attested — revoke first to correct |
| PeriodStartAlreadyAttested | Another attestation already starts at this fromTimestamp |
| InvalidReadingsLength | readings array length does not match readingCount |
| TimestampOverflow | Derived toTimestamp exceeds uint64 max value |
| ProjectNotRegistered | The project ID does not exist or has been deregistered |
| InvalidEnergyType | Energy type ID is not registered (generators only) |