rmrk-team / rmrk-substrate

[WIP] RMRK Substrate pallets
https://rmrk.app
Other
74 stars 36 forks source link

Add a Constant Marketplace Fee Trait For Downstream #268

Open HashWarlock opened 1 year ago

HashWarlock commented 1 year ago

Description

RMRK design has Royalties as a configurable parameter when minting an NFT. However, there is not a mechanism to implement royalties when using the RMRK Market pallet. This will cause marketplace implementations downstream to either fork or tightly couple their own marketplace pallet to RMRK market pallet to enforce royalties and tx fees for the marketplace.

A potential solution would be adding a trait that can be implemented downstream that can allow downstream implementations to set their marketplace royalties and fees while using the same user facing calls in the RMRK market pallet.

Example (WIP)

// Add to RMRK Market Config
type MarketFee: PerBill

trait MarketFeesHandler {
    fn market_fee(collection, nft, amount, T::MarketFee) -> Balance;
    fn royalty_fee(collection, nft, amount, Option<RoyaltyInfo>) -> Balance;
}

More info to come.