Overview
The ZKScore Protocol Registry emits events for protocol registration, updates, data provider changes, and user integrations. These events enable real-time monitoring of the protocol ecosystem.
Monitor protocol events to stay updated on new integrations and ecosystem growth.
Protocol Events
ProtocolRegistered
Emitted when a new protocol is registered.
event ProtocolRegistered(
uint256 indexed protocolId,
string name,
ProtocolType protocolType
);
Parameters:
protocolId (uint256 indexed): Protocol identifier
name (string): Protocol name
protocolType (ProtocolType): Protocol type
Example Usage:
contract.on('ProtocolRegistered', (protocolId, name, protocolType, event) => {
const types = ['DeFi', 'NFT', 'Social', 'Trading', 'Governance', 'Gaming', 'Identity', 'Infrastructure'];
console.log(`New protocol: ${name} (${types[protocolType]}) - ID: ${protocolId.toString()}`);
});
ProtocolUpdated
Emitted when protocol configuration is updated.
event ProtocolUpdated(
uint256 indexed protocolId,
bytes updateData
);
DataProviderAdded
Emitted when a data provider is added.
event DataProviderAdded(
uint256 indexed protocolId,
address indexed provider
);
UserIntegrated
Emitted when a user integrates with a protocol.
event UserIntegrated(
address indexed user,
uint256 indexed protocolId,
uint256 timestamp
);
Best Practices
- Monitor Registrations: Track new protocol additions
- Cache Data: Cache protocol metadata
- Filter Events: Use indexed parameters for filtering
- Analytics: Build analytics from event data