Summary
There is no mechanism to cancel an invoice that was registered in error or needs to be withdrawn before funding completes. A cancel_invoice function that transitions the invoice to Cancelled status and enables investor refunds should be added.
Scope
- Add cancel_invoice(invoice_id: BytesN<32>) callable only by the protocol admin
- Allow cancellation only when status is Open
- Transition the invoice status to Cancelled
- Panic with InvalidInvoiceStatus if the invoice is already Funded or Settled
- Emit an invoice_cancelled event with invoice_id and the cancelling admin address
Acceptance Criteria
ETA: 24 hours
Coordinate on Telegram
Summary
There is no mechanism to cancel an invoice that was registered in error or needs to be withdrawn before funding completes. A cancel_invoice function that transitions the invoice to Cancelled status and enables investor refunds should be added.
Scope
Acceptance Criteria
ETA: 24 hours
Coordinate on Telegram