3

In pallet NFTs, I see a concept of tips:

/// The max number of tips a user could send.
#[pallet::constant]
type MaxTips: Get<u32>;
/// Allows to pay the tips.
///
/// Origin must be Signed.
///
/// - `tips`: Tips array.
///
/// Emits `TipSent` on every tip transfer.
#[pallet::call_index(33)]
#[pallet::weight(T::WeightInfo::pay_tips(tips.len() as u32))]
pub fn pay_tips(
    origin: OriginFor<T>,
    tips: BoundedVec<ItemTipOf<T, I>, T::MaxTips>,
) -> DispatchResult {
    let origin = ensure_signed(origin)?;
    Self::do_pay_tips(origin, tips)
}

What is the purpose of tips? When would a user want to tip?

1 Answer 1

1

From the docs of the pallet:

pay_tips: Pay tips, could be used for paying the creator royalties.

And if you see the code of the do_pay_tips is basically paying a tip to an Account related to an Item (NFT).

let ItemTip { collection, item, receiver, amount } = tip;
T::Currency::transfer(&sender, &receiver, amount, KeepAlive)?;

So basically it looks like a system that allows a way to voluntarily pay royalties to a creator.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.