Documentation

Events

All events are emitted by the EnergyRegistry contract. They form a complete on-chain audit trail that indexers and dashboards can consume.

Watcher Events

Solidity
event WatcherRegistered(
    uint64 indexed watcherId,
    string name,
    address indexed owner
);

event WatcherOwnershipTransferred(
    uint64 indexed watcherId,
    address indexed previousOwner,
    address indexed newOwner
);

Project Events

Solidity
event ProjectRegistered(
    uint64 indexed projectId,
    uint64 indexed watcherId,
    string name,
    uint8 energyType
);

event ProjectDeregistered(uint64 indexed projectId);

event ProjectTransferred(
    uint64 indexed projectId,
    uint64 indexed fromWatcherId,
    uint64 indexed toWatcherId
);

event ProjectMetadataURISet(
    uint64 indexed projectId,
    string uri
);  // EIP-4906 compatible

Attester Events

Per-Project Attesters

Solidity
event AttesterAdded(
    uint64 indexed projectId,
    address indexed attester
);

event AttesterRemoved(
    uint64 indexed projectId,
    address indexed attester
);

Watcher-Wide Attesters

Solidity
event WatcherAttesterAdded(
    uint64 indexed watcherId,
    address indexed attester
);

event WatcherAttesterRemoved(
    uint64 indexed watcherId,
    address indexed attester
);
Note

Per-project and watcher-wide attester events are separate. AttesterAdded/AttesterRemoved always refer to per-project scope. WatcherAttesterAdded/WatcherAttesterRemoved refer to watcher-wide scope.

Energy Events

Solidity
event EnergyAttested(
    uint64 indexed projectId,
    bytes32 indexed uid,
    uint64 fromTimestamp,
    uint64 toTimestamp,
    uint256 energyWh,
    address indexed attester,
    uint8 energyType,
    string metadataURI,
    uint256[] readings
);

event EnergyRevoked(
    uint64 indexed projectId,
    uint256 energyWh,
    address indexed attester,
    uint8 energyType
);

event EnergyReplaced(
    uint64 indexed projectId,
    bytes32 indexed oldUid,
    bytes32 newUid,
    uint64 fromTimestamp,
    uint64 toTimestamp,
    uint256 oldEnergyWh,
    uint256 newEnergyWh,
    address indexed attester,
    string metadataURI
);
Note

EnergyReplaced is emitted when a replacement attestation corrects a previous one. The registry adjusts energy accumulators by the delta between newEnergyWh and oldEnergyWh. The replacement chain is tracked on-chain via the _replacedBy mapping.

Admin Events

Solidity
event ResolverAuthorized(address indexed resolver);
event ResolverDeauthorized(address indexed resolver);

event EnergyTypeRegistered(uint8 indexed id, string name);
event EnergyTypeRemoved(uint8 indexed id, string name);
event EnergyTypeAdminTransferred(
    address indexed previousAdmin,
    address indexed newAdmin
);