17 releases (11 major breaking)

new 14.0.0 Apr 9, 2024
13.0.0 Mar 18, 2024
12.0.0 Feb 26, 2024
11.0.0 Feb 13, 2024
0.1.0-dev.2 Jul 27, 2023

#537 in Magic Beans

Download history 19/week @ 2023-12-22 413/week @ 2023-12-29 448/week @ 2024-01-05 216/week @ 2024-01-12 182/week @ 2024-01-19 215/week @ 2024-01-26 74/week @ 2024-02-02 265/week @ 2024-02-09 640/week @ 2024-02-16 855/week @ 2024-02-23 509/week @ 2024-03-01 115/week @ 2024-03-08 477/week @ 2024-03-15 463/week @ 2024-03-22 254/week @ 2024-03-29 420/week @ 2024-04-05

1,634 downloads per month
Used in 4 crates (3 directly)

Apache-2.0

2.5MB
49K SLoC

Lock NFT

Lock an NFT from pallet-nfts and mint fungible assets from pallet-assets.

The NFT gets locked by putting a system-level attribute named Locked. This prevents the NFT from being transferred further. The NFT becomes unlocked when the Locked attribute is removed. In order to unify the fungible asset and unlock the NFT, an account must hold the full issuance of the asset the NFT was fractionalised into. Holding less of the fungible asset will not allow the unlocking of the NFT.


lib.rs:

NFT Fractionalization Pallet

This pallet provides the basic functionality that should allow users to leverage partial ownership, transfers, and sales, of illiquid assets, whether real-world assets represented by their digital twins, or NFTs, or original NFTs.

The functionality allows a user to lock an NFT they own, create a new fungible asset, and mint a set amount of tokens (fractions).

It also allows the user to burn 100% of the asset and to unlock the NFT into their account.

Functions

  • fractionalize: Lock the NFT and create and mint a new fungible asset.
  • unify: Return 100% of the asset and unlock the NFT.

Dependencies

~17–31MB
~505K SLoC