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

fixNFTokenBrokerAccept #8

Closed
wants to merge 1 commit into from
Closed

fixNFTokenBrokerAccept #8

wants to merge 1 commit into from

Conversation

dangell7
Copy link
Member

@dangell7 dangell7 commented Jan 25, 2023

High Level Overview of Change

Currently with NFTs using broker mode if the sell offer contains a destination and that destination is the buyer account, anyone can broker the transaction.

It is also true that if a buy offer contains a destination and that destination is the seller account, anyone can broker the transaction.

Imo this is not ideal and is misleading to everyone.

The comments in the code are;

// If the buyer specified a destination, that destination must be
// the seller or the broker.

This is misleading because the broker is the account submitting the transaction. Its anyone. Again, if the buyer specified a destination and that destination is the seller, anyone can settle the tx. I don't think that makes sense. Why even have that? If anyone can settle the tx then there is no point in having this arithmetic I think.

I believe the point was; If you set a destination, that destination needs to be the person settling the transaction.

Context of Change

The changes made now force the broker to be the destination if they want to settle. If the buyer is the destination, then the buyer must accept the sell offer, as you cannot broker your own offers.

If users want their offers open to the public then not setting a destination would be the recommended way. Inversely, if users want to limit who can settle the offers, then they would set a destination.

There is also a discussion issue here:

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Tests (You added tests for code that already exists, or your new feature included in this PR)
  • Documentation Updates
  • Release

Test Plan

I also added a test function to show one of the more recent issues. There are 2 things tested.

  1. The broker cannot broker a destination offer to the buyer/seller and the buyer must accept the sell offer. (0 transfer)
  2. If the broker is the destination, the broker will take the difference. (broker mode)

@dangell7 dangell7 force-pushed the xls20brokerfix branch 7 times, most recently from 61888ec to 2664f83 Compare February 1, 2023 19:33
@dangell7 dangell7 force-pushed the xls20brokerfix branch 2 times, most recently from a256a49 to 4141563 Compare February 6, 2023 21:25
update: error response

fixup test error

[FOLD] fix failing tests

nit: comments

clang-format

clang-format

refactor tests

update comment

rename xrpl fix

fixup
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.

1 participant