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 NonSequentialAttestation(uint64 projectId, uint64 expectedFrom, uint64 actualFrom);
error InvalidEnergyType(uint8 energyType);
error UnauthorizedEnergyTypeAdmin(address caller);
error EnergyTypeNotRegistered(uint8 id);
error DirectRevocationBlocked(uint64 projectId);
error ReplacementPeriodMismatch(uint64 projectId, uint64 expectedFrom, uint64 actualFrom, uint64 expectedTo, uint64 actualTo);
error AttestationNotFound(bytes32 uid);
error AttestationAlreadyReplaced(bytes32 uid);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 ReplacementPeriodMismatch();
error ReplacementProjectMismatch();
error DirectRevocationBlocked();Common Causes
| Error | Common Cause |
|---|---|
| UnauthorizedAttester | The signing wallet is not whitelisted for this project or watcher |
| PeriodAlreadyAttested | This time window was already attested — use replacement to correct |
| PeriodStartAlreadyAttested | Another attestation already starts at this fromTimestamp |
| NonSequentialAttestation | The attestation's fromTimestamp doesn't match the project's last toTimestamp |
| 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) |
| DirectRevocationBlocked | Direct revocations are not allowed — use replacement attestations instead |
| ReplacementPeriodMismatch | Replacement attestation must cover the same time period as the original |
| ReplacementProjectMismatch | Replacement attestation must reference the same project as the original |
| AttestationNotFound | The referenced attestation UID does not exist in the registry |
| AttestationAlreadyReplaced | The attestation has already been replaced by another attestation |