Documentation

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

ErrorCommon Cause
UnauthorizedAttesterThe signing wallet is not whitelisted for this project or watcher
PeriodAlreadyAttestedThis time window was already attested — revoke first to correct
PeriodStartAlreadyAttestedAnother attestation already starts at this fromTimestamp
InvalidReadingsLengthreadings array length does not match readingCount
TimestampOverflowDerived toTimestamp exceeds uint64 max value
ProjectNotRegisteredThe project ID does not exist or has been deregistered
InvalidEnergyTypeEnergy type ID is not registered (generators only)