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

If same account issues an IOU asset and an NFToken, that account's IOU cannot be used to pay the fee for that account's NFTs #4941

Open
scottschurr opened this issue Mar 6, 2024 · 0 comments · May be fixed by #4946

Comments

@scottschurr
Copy link
Collaborator

scottschurr commented Mar 6, 2024

Issue Description

If an NFToken has a transfer fee then, when an offer is accepted, a portion of the sale price goes to the issuer.

It is possible for an issuer to issue both an IOU (for remittances) and NFTokens. If the issuer's IOU is used to pay for the transfer of one of the issuer's NFTokens, that transfer will fail.

The problem occurs because the NFT code looks for a trust line. However the issuer of an IOU does not need a trust line to accept their own issuance and, in fact, is not allowed to have a trust line to themselves.

Steps to Reproduce

  1. Issuer issues an IOU (e.g, USD).
  2. Becky and Cheri get trust lines for Issuer's USD and acquire some.
  3. Issuer mints NFToken with transfer fee.
  4. Becky acquires the NFToken, paying with XRP.
  5. Becky attempts to create an offer to sell the NFToken for Issuer's USD. The attempt fails with tecNO_LINE.

Expected Result

Becky should be able to create the offer and Cheri should be able to accept the offer, paying with Issuer's USD.

Actual Result

Becky's NFTokenOfferCreate transaction fails with tecNO_LINE.

Environment

rippled 2.1.0

scottschurr added a commit to scottschurr/rippled that referenced this issue Mar 7, 2024
Fix bugs in interactions between NFTokenOffers and trust lines.

Since the NFTokenAcceptOffer does not check the trust line that
the issuer receives as a transfer fee in the NFTokenAcceptOffer,
if the issuer deletes the trust line after NFTokenCreateOffer,
the trust line is created for the issuer by the
NFTokenAcceptOffer.  That's fixed.

Also if Alice issues an IOU and also mints NFTokens with a
transfer fee, Alice's IOU cannot be used to pay for transfers
of those NFTokens.  That's fixed.

Resolves XRPLF#4925.
Resolves XRPLF#4941.
scottschurr added a commit to scottschurr/rippled that referenced this issue Mar 7, 2024
Fix bugs in interactions between NFTokenOffers and trust lines.

Since the NFTokenAcceptOffer does not check the trust line that
the issuer receives as a transfer fee in the NFTokenAcceptOffer,
if the issuer deletes the trust line after NFTokenCreateOffer,
the trust line is created for the issuer by the
NFTokenAcceptOffer.  That's fixed.

Also if Alice issues an IOU and also mints NFTokens with a
transfer fee, Alice's IOU cannot be used to pay for transfers
of those NFTokens.  That's fixed.

Resolves XRPLF#4925.
Resolves XRPLF#4941.
scottschurr added a commit to scottschurr/rippled that referenced this issue Mar 8, 2024
Fix bugs in interactions between NFTokenOffers and trust lines.

Since the NFTokenAcceptOffer does not check the trust line that
the issuer receives as a transfer fee in the NFTokenAcceptOffer,
if the issuer deletes the trust line after NFTokenCreateOffer,
the trust line is created for the issuer by the
NFTokenAcceptOffer.  That's fixed.

Also if Alice issues an IOU and also mints NFTokens with a
transfer fee, Alice's IOU cannot be used to pay for transfers
of those NFTokens.  That's fixed.

Resolves XRPLF#4925.
Resolves XRPLF#4941.
@scottschurr scottschurr linked a pull request Mar 9, 2024 that will close this issue
2 tasks
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 a pull request may close this issue.

1 participant