pub struct Payroll {
    pub famine_ts: i64,
    pub last_checkpoint_ts: i64,
    pub annual_rewards_rate: u64,
    pub rewards_per_token_stored: u128,
    pub total_tokens_deposited: u64,
}
Expand description

Calculator for amount of tokens to pay out.

Fields

famine_ts: i64

Timestamp of when rewards should end.

last_checkpoint_ts: i64

Timestamp of the last update.

annual_rewards_rate: u64

Amount of tokens to issue per year.

rewards_per_token_stored: u128

Amount of tokens to issue per staked token, multiplied by u64::MAX for precision.

total_tokens_deposited: u64

Total number of tokens deposited into the Quarry.

Implementations

Creates a new Payroll.

Calculates the amount of rewards to pay for each staked token, performing safety checks.

Calculates the amount of rewards earned for the given number of staked tokens, with safety checks. https://github.com/Synthetixio/synthetix/blob/4b9b2ee09b38638de6fe1c38dbe4255a11ebed86/contracts/StakingRewards.sol#L72

Sanity check on the amount of rewards to be claimed by the miner.

Gets the latest time rewards were being distributed.

Trait Implementations

Formats the value using the given formatter. Read more

Create a Payroll from a Quarry.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.