emission_reward_state.gno
Types
EmissionRewardState
EmissionRewardState tracks emission reward information for an individual staker. This struct maintains reward debt, accumulated rewards, and claiming history to ensure accurate reward calculations and prevent double-claiming.
Methods
GetAccumulatedRewardAmount
GetAccumulatedRewardAmount returns rewards accrued but not yet claimed.
Return Values
int64
int64
accumulated reward amount in the smallest token unit.
GetAccumulatedTimestamp
GetAccumulatedTimestamp returns when accumulated rewards were last updated.
Return Values
int64
int64
Unix timestamp in seconds of the last accumulation update.
GetClaimedRewardAmount
GetClaimedRewardAmount returns the total rewards already claimed.
Return Values
int64
int64
claimed reward amount in the smallest token unit.
GetClaimedTimestamp
GetClaimedTimestamp returns when rewards were last claimed.
Return Values
int64
int64
Unix timestamp in seconds of the last claim.
GetRewardDebtX128
GetRewardDebtX128 returns the scaled reward debt used for accrual calculations.
Return Values
*u256.Uint
*u256.Uint
current reward debt in the protocol's 128-bit fixed-point scale.
GetStakedAmount
GetStakedAmount returns the amount currently staked for this state.
Return Values
int64
int64
staked token amount in the smallest token unit.
SetAccumulatedRewardAmount
SetAccumulatedRewardAmount replaces the unclaimed accumulated reward amount.
Parameters
accumulatedRewardAmount
int64
accumulated reward in the smallest token unit.
SetAccumulatedTimestamp
SetAccumulatedTimestamp records the latest reward accumulation timestamp.
Parameters
accumulatedTimestamp
int64
Unix timestamp in seconds for the accumulation update.
SetClaimedRewardAmount
SetClaimedRewardAmount replaces the total claimed reward amount.
Parameters
claimedRewardAmount
int64
claimed reward in the smallest token unit.
SetClaimedTimestamp
SetClaimedTimestamp records the latest reward claim timestamp.
Parameters
claimedTimestamp
int64
Unix timestamp in seconds for the claim.
SetRewardDebtX128
Setters SetRewardDebtX128 replaces the reward debt with a copied fixed-point value.
Parameters
rewardDebtX128
*u256.Uint
reward debt in the protocol's 128-bit fixed-point scale.
SetStakedAmount
SetStakedAmount replaces the current staked amount.
Parameters
stakedAmount
int64
staked token amount in the smallest token unit.
Constructors
func NewEmissionRewardState(accumulatedRewardX128PerStake *u256.Uint) *EmissionRewardState(source)
Last updated