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

Introduce fixNFTokenNegOffer amendment #4215

Closed
wants to merge 1 commit into from

Conversation

scottschurr
Copy link
Collaborator

High Level Overview of Change

  • Fix a bug that allowed an offer for an NFToken to hold a negative amount.
  • Allow a Destination field on an NFToken buy offer.

Context of Change

Testing revealed a bug in the NFTokenCreateOffer implementation. The implementation allows a negative Amount to be specified in an offer for an NFToken. Since the implementation already explicitly disallows offers with an amount of 0 for IOUs, allowing negative amounts makes no sense. This amendment fixes the bug.

Additionally, there was a request by folks who want to use the broker feature. Currently the implementation does not allow a buy offer to specify a Destination. This prevents a buy offer from specifying a desired broker for that offer. So this amendment adds the capability for a buy offer to specify a Destination.

If an NFToken buy offer includes a Destination field, the account ID in that field may only be one of two accounts:

  1. The account that owns the NFToken. The consequence is that the offer may only be accepted directly by the NFToken owner. This will prevent the offer from ever being completed by a broker.
  2. An account that will act as the broker for that offer. In this case the owner of the NFToken cannot directly accept the buy offer; the offer can only be completed by the specified broker.

This second capability was not considered important enough to justify its own amendment. So it is piggybacking on the amendment that fixes the negative amount problem.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Tests (unit tests were added to verify the new code)
  • Documentation (docs will need to change to describe the new behaviors)

Preventing an NFToken offer from containing a negative amount is a bug fix.

Allowing an NFToken buy offer to provide a Destination is a feature add.

The champion for Destination for a buy offer has been @ledhed2222. I'm hoping to get a review from them as well. Also heads up to @DennisDawson that this change is in the winds.

- The primary point is to forbid negative amounts in NFTokenOffers.
- The secondary point is to allow a Destination field in an NFToken
buy offer so a specific broker can be specified.
@@ -431,7 +431,7 @@ REGISTER_FEATURE(RequireFullyCanonicalSig, Supported::yes, DefaultVote::yes
REGISTER_FIX (fix1781, Supported::yes, DefaultVote::yes);
REGISTER_FEATURE(HardenedValidations, Supported::yes, DefaultVote::yes);
REGISTER_FIX (fixAmendmentMajorityCalc, Supported::yes, DefaultVote::yes);
REGISTER_FEATURE(NegativeUNL, Supported::yes, DefaultVote::no);
REGISTER_FEATURE(NegativeUNL, Supported::yes, DefaultVote::yes);
Copy link
Contributor

Choose a reason for hiding this comment

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

when is it safe to change the default vote like this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Well, I figured it was particularly safe since the NegativeUNL amendment is already live on the main net. So this specific change should be very safe.

In general the guidance has been that an amendment/fix should be votable on the network for one full release cycle before we DefaultVote::yes it. Since NegativeUNL was introduced in 1.7.3, that means anyone running 1.8.X (or 1.9.X for that matter) would not be amendment blocked if the amendment went live... And it already has gone live.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants