Introduce fixNFTokenNegOffer amendment #4215
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
High Level Overview of Change
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 aDestination
.If an NFToken buy offer includes a
Destination
field, the account ID in that field may only be one of two accounts: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
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.