referrerpolicy=no-referrer-when-downgrade

VestedPayout

Trait VestedPayout 

Source
pub trait VestedPayout<AccountId, Balance> {
    type BlockNumber;

    // Required method
    fn vested_transfer(
        source: &AccountId,
        dest: &AccountId,
        amount: Balance,
        duration: Self::BlockNumber,
        start_at: Option<Self::BlockNumber>,
    ) -> DispatchResult;
}
Expand description

Transfer amount from source to dest and apply a linear vesting schedule that completes within at most duration blocks starting from the current block.

The per-block unlock rate is rounded up so that vesting never exceeds duration blocks.

The implementor handles per-block unlock computation, block-number provider selection, and the actual fund transfer internally. Callers only specify the total amount and duration.

Unlike VestedTransfer, this trait is agnostic to both the old Currency trait and the new fungible::Mutate trait. The implementor (e.g. pallet_vesting) chooses which currency mechanism to use internally, and callers do not need to provide per_block or starting_block — only the total amount and vesting duration.

Required Associated Types§

Source

type BlockNumber

The block number type used to express vesting duration.

Required Methods§

Source

fn vested_transfer( source: &AccountId, dest: &AccountId, amount: Balance, duration: Self::BlockNumber, start_at: Option<Self::BlockNumber>, ) -> DispatchResult

Transfer amount from source to dest, locked under a linear vesting schedule that completes within at most duration blocks.

If start_at is Some, the vesting schedule begins at that block number; otherwise it begins at the current block.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§