4

I wondered how to create multiple instances of the pallet Treasury and couldn't find any examples so far. One example is pallet Membership, which doesn't have any dependencies, while the Treasury pallet has: Balances and Bounties. Looking into the compilation errors and trying different ways to do it, I assume that I should create one Balances instance and one Bounties instance per each Treasury, which is weird. Also, it seems Bounties pallet doesn't have the possibility of creating instances.

Is it possible to create multiple instances of Treasury pallet, and if yes, how to deal with dependencies? Examples?

2
  • 3
    Indeed, it seems the issue here is that the bounties pallet is not instantiate, which is blocking having multiple treasuries with bounties. Otherwise, if you dont have bounties for the second instance, it should work fine, even with just one balance.
    – Shawn Tabrizi
    May 16, 2022 at 3:24
  • 2
    Tracking issue here: github.com/paritytech/substrate/issues/11421
    – Shawn Tabrizi
    May 16, 2022 at 3:27

1 Answer 1

2

Darwinia is running with two treasury instances now.

Check https://github.com/darwinia-network/darwinia/blob/main/runtime/darwinia/src/pallets/treasury.rs.

But we only have tips and bounty for the main currency.

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.