This pallet is being developed tightly coupled to both pallet_assets and pallet_uniques. These are the default Statemine pallets for fungible and non-fungible tokens.
A Frunique is a type of Non-Fungible Token (NFT)
Fruniques allow token holders to lock any set of fungible and/or non-fungible tokens into a new Frunique.
Any Frunique may be transformed to become 1..n new Fruniques or a fungible token.
The source/parent asset(s) can be unlocked if and only if all of its child fruniques are held by the same account.
To run this project you need to follow the install section on substrate documentation
To initialize the project make sure that you are running a local node of the solo-chain,
then you need to sign as Sudo the extrinsic initial_setup() and the sudo account id as the freezer, this is required to by pass some of the uniques permissions.
Then you can create a collection with the extrinsic create_collection(), and passing the name of the collection.
Onces you have a collection it's possible to invite others to create (spawn) NFTs with the invite() extrinsic.
To create NFTs you need to call the spawn() extrinsic, this extrinsic takes cares of the NFT division.
To create a Root NFT the optional parent_info_call argument needs to be a None, but feel free to pass as many attributes as you like, as this method is in charge of minting the NFT and adding the metadata and attributes to it.
To create a fraction of a given NFT, you need to call the same extrinsic but passing the parent_info_call argument where you specify the amount of the parent you want to fractionalize.
git clone https://github.com/polkadot-js/tools/
cd tools
yarn installyarn run:api tx.fruniques.create 1 1 1 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY 1 100 --seed "//Alice"yarn run:api query.uniques.class 1
yarn run:api query.uniques.asset 1 1
yarn run:api query.uniques.account 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY 1 1yarn run:api query.assets.asset 1
yarn run:api query.assets.account 1 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQYTo run the test you simply run the following command
cargo test --package pallet-fruniquesThis pallet provides functionality that allows NFT holders to mint a fungible token backed by the NFT.
The non-fungible token is created and minted using the Statemine pallet_uniques.
The fungible token is created and minted using the Statemine pallet_assets.
The NFT/Unique can be unlocked and released if and only if a single origin holds all of the corresponding fungible token.
An NFT as a trie of NFTs.
A credit is a single NFT, with an amount, state of redemption, expiration year, and other metadata. However, that owner can sell less than the amount, in which case the newly created credit NFT has all of the same associated data. The sum of the children amount values must be equal to the parent.
To support this, we'll create a AggregatedFrunique type that enforces the aggregation rules.
For the NY state cannabis compliance program, all yield from all plants must be tracked. This aligns to a very similar data structure as above. Each mother plant is an NFT, each clone as an NFT, each package of flower an NFT, etc. Auditing a specific item is fairly easy via traversing all of its ancestors and descendants through to the harvest and dispensary.
Made with ❤️ by:
Max Gravitt |
sebastianmontero |
Abel Yáñez |
Tlalocman |
Didier Mis |
This is WIP - just being spec'd out
-
Align to the
Statemintpallets and maintain compatibility. This project imports the two pallets directly from4.0.0-devinto the runtime. It will also support cross-chain communication viaXCM. -
Fruniques are designed to be fully composable. NFTs can be reserved to a fungible, some of those fungibles used in a basket to create another NFT, that NFT then divided into 5 child NFTs, and so on.
- Cross-chain messaging and parachain implementation
- Allow a basket of fungible tokens to be reserved and minted as an NFT. The basket may later be unlocked when the NFT is burned.
License: MIT