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

FRAME: Introduce shelve/restore to nonfungible/nonfungibles #224

Open
Tracked by #327
gavofyork opened this issue Jan 27, 2023 · 6 comments
Open
Tracked by #327

FRAME: Introduce shelve/restore to nonfungible/nonfungibles #224

gavofyork opened this issue Jan 27, 2023 · 6 comments
Labels
T1-FRAME This PR/Issue is related to core FRAME, the framework.

Comments

@gavofyork
Copy link
Member

fungible API has deactivate and reactivate functions, which is useful for making teleport usages a bit safer. Similar functions should be introduced to the nonfungible and nonfungibles API and in a companion PR utilised during teleports.

@gavofyork gavofyork mentioned this issue Aug 24, 2023
20 tasks
@ruseinov
Copy link
Contributor

I assume this is actionable, will take this on.

@ruseinov ruseinov assigned ruseinov and unassigned ruseinov Feb 13, 2023
@ruseinov
Copy link
Contributor

Not that I think about it - it would be nice to understand how this should work. I'm currently investigating the code to figure out what would be a good approach to this.
Once I have more overview - will likely ask more questions.

@ruseinov
Copy link
Contributor

@jsidorenko I guess it's easier to ask you since you've touched this a lot.

I assume that this has to affect can_transfer. So basically in concrete implementations we'd have some sort of flag that's going to be set on shelve and restore and checked in can_transfer.

From what I have seen there are only 3 pallets currently using any of these traits (v1 and v2): nis, uniques and nft.

Please let me know if my assumptions are correct.

@jsidorenko
Copy link
Contributor

jsidorenko commented Feb 13, 2023

For nfts fractionalization pallet we've added a new trait called LockableNonfungible that has two methods: lock and unlock. You can see the code here.
Then, on a runtime level, you can provide the custom implementation as shown here in addition to the Locker implementation that allows to check whether the nft is locked or not.

@ruseinov
Copy link
Contributor

@gavofyork I wonder what the vision is for these methods.
For example, in case of fungible(s) API activate and deactivate methods are in the Transfer trait that has to be implemented by the pallet.

In case of this PR locking functionality is done by simply passing the NftLocker to the pallet and calling it's methods directly.

As far as I understand the idea here is to have those shelve/restore methods call the underlying locker (or whatever) implementation, exposing this API to whoever needs to use from outside the pallet itself.

@jsidorenko
Copy link
Contributor

Solved in the NFT fractionalization PR; feel free to close this issue if happy with the solution: https://github.com/paritytech/substrate/pull/12565/files#diff-6eb7941669d2217ef2902ce147d26330e444322ef640e990be2929565ddd1f34

@juangirini juangirini transferred this issue from paritytech/substrate Aug 24, 2023
@the-right-joyce the-right-joyce added T1-FRAME This PR/Issue is related to core FRAME, the framework. and removed T1-runtime labels Aug 25, 2023
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 8, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 8, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 10, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 10, 2024
jonathanudd pushed a commit to jonathanudd/polkadot-sdk that referenced this issue Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T1-FRAME This PR/Issue is related to core FRAME, the framework.
Projects
Status: To Do
Development

No branches or pull requests

6 participants
@gavofyork @ruseinov @juangirini @jsidorenko @the-right-joyce and others