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

refactor: NFT #283

Merged
merged 149 commits into from
Feb 11, 2022
Merged

refactor: NFT #283

merged 149 commits into from
Feb 11, 2022

Conversation

green-jay
Copy link
Contributor

@green-jay green-jay commented Dec 7, 2021

NFT pallet that provides basic generic interface to manipulate with NFTs

  • create class
  • mint instance
  • transfer instance
  • burn instance
  • destroy class

It is possible to directly call extrinsics from this pallet but also provides public interface (do_method) for pallets that are built on top of it.

tech spec: https://www.notion.so/NFT-Technical-specification-f387682d6ef34b6091f5607bfa912a19

REVIEW OF PALLET-UNIQUES IS NOT NEEDED

Note: NFT pallet has been migrated to wrap FRAME Uniques instead of ORML. Because there is a couple of slight customizations to Uniques, it was necessary to fork the pallet. There is a PR open already, hopefully it will get to substrate codebase soon enough so we can use the Uniques pallet natively.
paritytech/substrate#10529
Update 20211231: PR merged, waiting for release

Update 20220118: Can be used natively from v0.9.15
Update 20220204: Uniques fork removed and is used natively

Copy link
Member

@mrq1911 mrq1911 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

runtime/basilisk/src/lib.rs Outdated Show resolved Hide resolved
runtime/basilisk/src/lib.rs Outdated Show resolved Hide resolved
runtime/basilisk/src/lib.rs Outdated Show resolved Hide resolved
runtime/basilisk/src/weights/nft.rs Outdated Show resolved Hide resolved
pallets/nft/src/types.rs Outdated Show resolved Hide resolved
runtime/basilisk/src/lib.rs Outdated Show resolved Hide resolved
primitives/src/lib.rs Outdated Show resolved Hide resolved
pallets/nft/src/lib.rs Outdated Show resolved Hide resolved
pallets/nft/src/lib.rs Show resolved Hide resolved
pallets/nft/src/lib.rs Show resolved Hide resolved
@martinfridrich
Copy link
Contributor

Please move events to do_...() functions. FE need events about minting/burning NFTs called from liq. mining pallet

@green-jay
Copy link
Contributor Author

Please move events to do_...() functions. FE need events about minting/burning NFTs called from liq. mining pallet

done

verify {
assert_eq!(orml_nft::Pallet::<T>::classes(class_id).iter().count(), 1);
assert_eq!(UNQ::Pallet::<T>::class_owner(&T::NftClassId::from(CLASS_ID_0).into()), Some(caller));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is adding to a map, not to a vec. Testing adding stuff to a nearly full map might be an overkill. There should be another incentives to keep the map size reasonable, in this case there is a configurable bond to create a class that exists until the class is destroyed.

@mrq1911 mrq1911 merged commit 8adb815 into master Feb 11, 2022
@jak-pan jak-pan deleted the feat/nft branch February 22, 2024 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants