kodadot / nft-gallery

Generative Art Marketplace
https://kodadot.xyz
MIT License
608 stars 350 forks source link

Royalties are not paid on AssetHub #8511

Open vikiival opened 6 months ago

vikiival commented 6 months ago

What happened?

I wanted to test if royalties work on AssetHub. Confirmation modal shows that I will pay 11.3 dot

Screenshot 2023-12-10 at 13 34 23

However when I check the transactions I will pay only: 10.3 DOT

Screenshot 2023-12-10 at 13 35 53

Please reproduce in steps

  1. Open any NFT with royalty like: https://kodadot.xyz/ahp/collection/49
  2. Buy It
  3. No royalty is paid to the user.

Expected Behavior

I expect that royalty is paid to the user.

To implement

Example

https://kodadot.xyz/ahp/gallery/49-37

type Tip = {
  collection: string,
  item: string,
  receiver: string,
  amount: bigint | string
}

const tips: Tips[] = [
   {
      collection: "49",
      item: "37",
      receiver: "5FFG7GHAR2F2xCb5bqaLQrdgNGdtEL64tYgZimRBHDjuxVuA",
      amount: "10000000000"
    }
]

// TODO: check royalty validity
// If it is valid add to batch when user is paying
const call = api.tx.nfts.payTips(tips)

Code of Conduct

vikiival commented 6 months ago

Preferably someone from @kodadot/internal-dev ?

JustLuuuu commented 6 months ago
roiLeo commented 6 months ago

👋

roiLeo commented 6 months ago

we need to handle tips on indexer side

link https://github.com/paritytech/polkadot-sdk/blob/f6ae145813b2e213b39f09f713d3ccbdd9376f6b/substrate/frame/nfts/src/lib.rs#L1747

No need to add unecessary data

type Tip = {
  collection: string,
  item: string,
  receiver: string,
  amount: bigint | string
}

const tips: Tips[] = [
   {
      collection: "49",
      item: "37",
      receiver: "5FFG7GHAR2F2xCb5bqaLQrdgNGdtEL64tYgZimRBHDjuxVuA",
      amount: "10000000000"
    }
]

// TODO: check royalty validity
// If it is valid add to batch when user is paying
const call = api.tx.nfts.payTips(tips)
vikiival commented 6 months ago

we need to handle tips on indexer side

Pay_tips is never called on KodaDot, see images above :)

roiLeo commented 6 months ago

Pay_tips is never called on KodaDot, see images above :)

yup but that doesn't stop it from having it on indexer since user may be confused of losing found (in short we need to display it in activity)

vikiival commented 6 months ago

yup but that doesn't stop it from having it on indexer since user may be confused of losing found (in short we need to display it in activity)

agree that's why you opened issue - https://github.com/kodadot/stick/issues/158

daiagi commented 6 months ago

why isn't this working?

https://github.com/kodadot/nft-gallery/commit/b6f31df20367df5ff8329fac9d044460b62d9361

https://github.com/kodadot/nft-gallery/pull/7816#issuecomment-1779539355

roiLeo commented 6 months ago

why isn't this working?

because royalties has been set at the collection level

vikiival commented 6 months ago

because royalties has been set at the collection level

But still the data are replicated to nft entity.

Maybe the reason is that i was trying to buy single nft instead of using shopping menu?

JustLuuuu commented 6 months ago

Tomorrow's drop is also supposed to have royalties. Will you be guys able to fix it before? ❤️

vikiival commented 6 months ago

cc @daiagi can you please check ? 🥺 🙏

daiagi commented 6 months ago

image

image

https://assethub-polkadot.subscan.io/extrinsic/5225078-2

not seeing the problem

JustLuuuu commented 6 months ago

oh yes, it looks like royalties are in his account; he did not see them because Encrypt Wallet is not showing funds on Assethub. he already managed to teleport them. This issue is still on: