0

We are building a pallet that uses the SpendFunds variable to withdraw funds from Treasuries on chains that implement it. However, with the current implementation of the SpendFunds callback, only 1 pallet can use this technique. Since all of the Relay Chains implement the Bounties pallet, this means that Relay chains will not be able to implement our pallet (this pallet is being developed for use by all chains, including Relay Chains).

Can we extend the SpendFunds type to be an Array of pallets that implement the SpendFunds trait?

1 Answer 1

1

The SpendFunds trait supports a tuple of up to 30 pallets:

#[impl_trait_for_tuples::impl_for_tuples(30)]
pub trait SpendFunds<T: Config<I>, I: 'static = ()> {
    fn spend_funds( ... );
}

This means you can configure the SpendFunds associated type something like:

type SpendFunds = (PalletA, PalletB, PalletC);

Assuming Pallet A, B, and C all implement the SpendFunds trait. The pallets will be called in that order, each with the opportunity to spend some of the treasury funds.

Your Answer

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

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