Skip to content
This repository was archived by the owner on Oct 10, 2023. It is now read-only.
This repository was archived by the owner on Oct 10, 2023. It is now read-only.

DrainableCurrency #145

Open
Open
@4meta5

Description

@4meta5
pub trait DrainableCurrency<AccountId, Weight> {
    fn drain_to_accounts(
        from: &AccountId,
        to_accounts: OrderedSet<AccountId>,
    ) -> DispatchResult;

    fn drain_to_accounts_weighted(
        from: &AccountId,
        to_weighted_accounts: OrderedSet<(AccountId, Weight)>,
    ) -> DispatchResult;
}

We use this logic in

  • donate (which is used in bank)
  • kickback and it is planned to be used in bounty2

donate requires a remainder_recipient input for collecting the remainder. We could add

  1. implementation that chooses an AccountId from recipient_accounts at random to send the remainder
  2. implementation that spreads the remainder among a random subset of the recipient_accounts

The remainder will exist in most cases so the question is what to do with it...

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions