Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor InvoiceModule to rely on external PaymentModule #31

Merged
merged 13 commits into from
Nov 19, 2024

Conversation

gabrielstoica
Copy link
Collaborator

@gabrielstoica gabrielstoica commented Nov 7, 2024

Breaking changes

  • InvoiceModule has been refactored to PaymentModule and some of its methods (related to the ERC-721 compliance) have been removed; Also, Invoice struct has been renamed to `PaymentRequest, method names were updated to createRequest, payRequest, cancelRequest, withdrawRequestStream;
  • There's a new approach on how we're retrieving the status of a request, by relying on a dynamic method called statusOf. This method relies on two new booleans added to the PaymentRequest struct, wasCanceled and wasAccepted. Depending on the payment method, either stream or transfer, it first checks the status of the stream on the Sablier protocol to see if the payment amount was fully streamed or not.
  • A part of the InvoiceModule has been refactored as a periphery contract, called InvoiceCollection. This contract allows an EOA/multisig to mint ERC-721 tokens for any off-chain invoice, based on the payment recipient, invoice metadata URI and payment request ID;

Copy link
Contributor

@V1d0r V1d0r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aligns with the latest flow!
With the PaymentRequest and InvoiceCollection structure we will need to rely on the external worker to generate the invoices based on the events.

@gabrielstoica gabrielstoica merged commit 2c8c872 into main Nov 19, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants