Description
Implement Firebase Cloud Functions to listen for PoolCreated events from the PoolFactory contract and sync data to Firestore for off-chain queries.
Acceptance Criteria
Technical Requirements
- Use ethers.js event listening capabilities
- Integrate with existing Firebase architecture
- Implement reliable event processing
- Add proper error recovery mechanisms
- Include event deduplication logic
- Support for historical event processing
Event Processing
- Listen for PoolCreated events from PoolFactory
- Extract pool data from event logs
- Validate and sanitize event data
- Store pool information in Firestore
- Update pool indexes and metadata
Data Structure (Firestore)
- pools collection with pool documents
- Pool metadata (name, description, creator, address)
- Creation timestamp and transaction details
- Pool status and configuration
- Searchable indexes for pool discovery
Error Recovery
- Handle network connectivity issues
- Retry failed event processing
- Detect and handle missed events
- Maintain event processing state
- Alert on critical failures
Definition of Done
- Event listeners successfully capture PoolCreated events
- Pool data is accurately synced to Firestore
- Robust error handling and recovery
- Event processing monitoring in place
- Documentation for event system architecture
Description
Implement Firebase Cloud Functions to listen for PoolCreated events from the PoolFactory contract and sync data to Firestore for off-chain queries.
Acceptance Criteria
Technical Requirements
Event Processing
Data Structure (Firestore)
Error Recovery
Definition of Done