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 MarketplaceHooks and MarketFee which will hold the standard market fee percentage constant in the MarketFee trait and the MarketplaceHooks will implement 3 functions called calculate_market_fee(amount)calculate_royalty_fee(amount, royalty_fee) and can_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
[x] add new traits MarketFee and MarketplaceHooks
[x] implement Default for the traits in runtime
[x] access control function in MarketplaceHooks trait
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
MarketplaceHooks
andMarketFee
which will hold the standard market fee percentage constant in theMarketFee
trait and theMarketplaceHooks
will 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
MarketFee
andMarketplaceHooks
Default
for the traits in runtimeMarketplaceHooks
trait