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

feat: Allow minting ERC20TransferableReceivables on behalf of other users #1091

Merged
merged 6 commits into from
Apr 8, 2023

Conversation

mliu
Copy link
Contributor

@mliu mliu commented Mar 23, 2023

This PR improves the ERC20TransferableReceivable feature by allowing anyone to mint an NFT on behalf of the payee. Currently, only the initial payee can mint their own NFT, logic we introduced to prevent a frontrunning attack. However, this process can be cumbersome for users who have to manually mint multiple requests at once.

The proposed solution is to modify the mint call to accept an address payee, and set the initial ERC721 owner as the payee. This change would make the minting process more flexible, allowing others to cover the minting costs, such as Request finance in the case of automatically recurring invoices.

To maintain security, the existing system of allowing multiple minted receivables for an invoice, keyed by a hash of the initialRecipient and the paymentReference, would still be used. This prevents anyone from frontrunning the call and setting themselves as the initialRecipient since the hash would still be invalid.

@MantisClone MantisClone self-requested a review April 3, 2023 17:40
@mliu mliu requested a review from MantisClone April 5, 2023 13:53
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.

None yet

2 participants