@AlexD10S and I have been building a pallet for NFT royalties. This pallet couples with the already existing NFTs pallet that is live on Asset Hub.
You can find our work here:
We would like to get feedback from the community on what they would like to see as nice-to-have features around the concept of NFT royalties that could be added into this pallet.
Features that are already included:
- Setting a royalty percentage
- Allowing for multiple royalty recipients
- Setting a royalty percentage per recipient
An example of setting the NFT royalty in the Royalties pallet code:
NftsRoyalty::set_item_royalty(
RuntimeOrigin::signed(account(1)),
0,
mint_id,
Permill::from_percent(5),
vec![
RoyaltyDetails {
royalty_recipient: account(1),
royalty_recipient_percentage: Permill::from_percent(25),
},
RoyaltyDetails {
royalty_recipient: account(2),
royalty_recipient_percentage: Permill::from_percent(25),
},
RoyaltyDetails {
royalty_recipient: account(3),
royalty_recipient_percentage: Permill::from_percent(25),
}
]
)
In order to prevent bypassing of royalties, the NFT is locked once the royalty is set, the Royalty pallet has a buy
extrinsic that handles all the royalty logic within.
Looking forward to feedback from the community.