Add MarketplaceHooks and MarketFee traits & upgrade to Polkadot v0.9.37#276
Open
HashWarlock wants to merge 15 commits into
Open
Add MarketplaceHooks and MarketFee traits & upgrade to Polkadot v0.9.37#276HashWarlock wants to merge 15 commits into
HashWarlock wants to merge 15 commits into
Conversation
…FT can be sold in marketplace
… and upgrad rust toolchain
Add MarketplaceHooks and MarketFee traits
Szegoo
approved these changes
Mar 18, 2023
Szegoo
left a comment
Contributor
There was a problem hiding this comment.
LGTM; Sorry for the late review.
| let sender = ensure_signed(origin)?; | ||
| let owner = pallet_uniques::Pallet::<T>::owner(collection_id.into(), nft_id) | ||
| .ok_or(Error::<T>::TokenDoesNotExist)?; | ||
| // Check MarketplaceHooks function if the can NFT be listed |
Contributor
There was a problem hiding this comment.
Suggested change
| // Check MarketplaceHooks function if the can NFT be listed | |
| // Check MarketplaceHooks function to see whether the NFT can be listed |
| /// trait. | ||
| /// - royalty_info: Royalty account and royalty fee to be calculated in the `MarketplaceHooks` | ||
| /// trait. | ||
| fn calculate_and_finalize_purchase_and_fees( |
Contributor
There was a problem hiding this comment.
IMO the name of this function has too many details. We should probably use something a bit more abstract. But keep in mind that this is just a suggestion, so do whatever you feel is right.
Suggested change
| fn calculate_and_finalize_purchase_and_fees( | |
| fn finalize_purchase( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Currently the Market pallet has no way to check if the type of NFT can be sold (i.e. Stakepool v2 NFTs vs PhalaWorld Shell NFTs). To resolve this, there are an introduction to 2 new traits called
MarketplaceHooksandMarketFeewhich will hold the standard market fee percentage constant in theMarketFeetrait and theMarketplaceHookswill implement 3 functions calledcalculate_market_fee(amount)calculate_royalty_fee(amount, royalty_fee)andcan_list_or_buy_in_market(collections_id, nft_id)that will help prevent NFTs from being listed that are not eligible for the marketplace.Targets
MarketFeeandMarketplaceHooksDefaultfor the traits in runtimeMarketplaceHookstrait