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 projectType
);

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

Solidity
event AttesterAdded(
    uint64 indexed projectId,  // 0 = watcher-wide scope
    address indexed attester
);

event AttesterRemoved(
    uint64 indexed projectId,  // 0 = watcher-wide scope
    address indexed attester
);

When projectId is 0, the event indicates a watcher-wide attester addition or removal.

Energy Events

Solidity
event EnergyAttested(
    uint64 indexed projectId,
    uint64 fromTimestamp,
    uint64 toTimestamp,
    uint256 energyWh,
    address indexed attester,
    uint8 energyType,
    uint8 projectType,
    string metadataURI
);

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

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
);