Skip to content

feat: Add contract interaction service for Safe integration #29

Description

@rafamiziara

Description

Create a service layer in the backend to handle smart contract interactions through the multi-sig Safe wallet for administrative functions.

Acceptance Criteria

  • Create ContractService class for Safe interactions
  • Implement Safe transaction proposal and execution
  • Add transaction status monitoring
  • Create interface for PoolFactory admin functions
  • Add error handling for failed transactions
  • Implement transaction batching capabilities
  • Add comprehensive logging and monitoring

Technical Requirements

  • Use Safe SDK for transaction management
  • Integrate with existing Firebase Functions architecture
  • Implement proper transaction encoding
  • Add multi-signature workflow support
  • Include gas estimation and optimization
  • Support for multiple contract interactions

Service Features

  • Safe transaction creation and proposal
  • Transaction status tracking and updates
  • Multi-signature collection workflow
  • Contract function call encoding
  • Batch transaction support
  • Emergency pause functionality

Integration Points

  • PoolFactory contract admin functions
  • Firebase Functions for API endpoints
  • Firestore for transaction state management
  • Safe wallet for transaction execution

Error Handling

  • Transaction failure recovery
  • Network connectivity issues
  • Safe wallet connectivity problems
  • Gas estimation failures
  • Invalid transaction parameters

Definition of Done

  • ContractService successfully integrates with Safe
  • All admin functions work through multi-sig
  • Proper error handling and recovery
  • Unit and integration tests complete
  • Service documentation and examples

Metadata

Metadata

Assignees

Labels

comp: backendIssues for the Firebase Cloud Functions in packages/backend

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions