Description
Develop a Firebase Cloud Function that interfaces with the PoolFactory smart contract to handle pool creation requests from the mobile application.
Acceptance Criteria
Technical Requirements
- Use existing Firebase Functions architecture
- Integrate with ethers.js for contract interaction
- Implement proper gas estimation and management
- Add transaction receipt verification
- Include retry logic for failed transactions
- Support both POL and ERC20 pool creation
Function Endpoints
- POST /createPool - Create new lending pool
- GET /poolStatus/:txHash - Check pool creation status
- GET /pools - List created pools
Input Validation
- Pool parameters validation (name, description, terms)
- Token address validation (for ERC20 pools)
- Creator authorization checks
- Duplicate pool name prevention
Integration Features
- PoolFactory contract interaction
- Safe wallet integration for admin functions
- Firestore integration for off-chain data
- Event listening for PoolCreated events
Definition of Done
- Cloud Function successfully creates pools via PoolFactory
- Proper error handling and user feedback
- Unit test coverage > 90%
- Integration tests with contract on Amoy
- API documentation complete
Description
Develop a Firebase Cloud Function that interfaces with the PoolFactory smart contract to handle pool creation requests from the mobile application.
Acceptance Criteria
Technical Requirements
Function Endpoints
Input Validation
Integration Features
Definition of Done