-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Integration of the NFT pallet in XCM #14349
Comments
I dont understand this sentence. Is the problem that XCM cannot increment the collection id? Maybe it would help to configure the |
The main problem is that the derivates can come from different origins. So we can have three calls to create a collection with the following CollectionIds:
In the current flow, after the creation of a collection with collectionId 1 we set the Id for the next collection. However, we do have no way to know what the next Id should be as the order is arbitrary. |
Is this accurate? It sounds like you mean it should be possible to represent a |
@gavofyork I think you are right! Just to make it more clear, I want the CollectionIds of the nfts pallet to be a MultiLocation. This is btw currently not possible because MultiLocation does not implement the Incrementable trait, so in this draft I introduced a wrapper for MultiLocation. Do you think the solution described in this issue is the right approach? |
I see. So it seems that the NFT pallet is rather overzealous in its trait bounds to the point where it's not really fit for this purpose. In particular it has determined that the key type must be self-generating when under certain usage situations (which the original designer was apparently ignorant of) it need not be, and may not even be practical. If we were doing it right, the collection creation logic which uses this autokey functionality (the Right now it seems there's two |
I've removed the duplicate from the nfts pallet here #14367 |
Problem
While working on integrating the
pallet-nfts
with XCM, I ran into a problem with the CollectionId. The NFTs pallet works with aNextCollectionId
storage, where theCollectionId
for the next collection is stored. Each time a collection is created, the Id for the next collection is calculated and stored. We require the collectionId to implement theIncrementable
trait, so that it's easy to calculate the next value.To enable derivative NFTs in the NFTs pallet, we should be able to represent a CollectionId as a MultiLocation. For Example, the CollectionId of a derivative of a NFT on the relay chain could be represented as
Parent/GeneralIndex(x)
. However, the current flow of theNextCollectionId
does not allow for this structure, as there is no incremental flow for these MultiLocations.Solution
We add an additional extrinsic that takes a collectionId and bypasses the whole NextCollectionId flow.
The NFT pallet should add on top of the
CreateOrigin
andForceOrigin
config types, also aCreateCollectionIdOrigin
(other names are welcome) that gates the Origins that can create collections with custom CollectionIds.The text was updated successfully, but these errors were encountered: