For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

source

Methods

GetAccumulatedRewardAmount

GetAccumulatedRewardAmount returns rewards accrued but not yet claimed.

Return Values

Name
Type
Description

int64

int64

accumulated reward amount in the smallest token unit.

source

GetAccumulatedTimestamp

GetAccumulatedTimestamp returns when accumulated rewards were last updated.

Return Values

Name
Type
Description

int64

int64

Unix timestamp in seconds of the last accumulation update.

source

GetClaimedRewardAmount

GetClaimedRewardAmount returns the total rewards already claimed.

Return Values

Name
Type
Description

int64

int64

claimed reward amount in the smallest token unit.

source

GetClaimedTimestamp

GetClaimedTimestamp returns when rewards were last claimed.

Return Values

Name
Type
Description

int64

int64

Unix timestamp in seconds of the last claim.

source

GetRewardDebtX128

GetRewardDebtX128 returns the scaled reward debt used for accrual calculations.

Return Values

Name
Type
Description

*u256.Uint

*u256.Uint

current reward debt in the protocol's 128-bit fixed-point scale.

source

GetStakedAmount

GetStakedAmount returns the amount currently staked for this state.

Return Values

Name
Type
Description

int64

int64

staked token amount in the smallest token unit.

source

SetAccumulatedRewardAmount

SetAccumulatedRewardAmount replaces the unclaimed accumulated reward amount.

Parameters

Name
Type
Description

accumulatedRewardAmount

int64

accumulated reward in the smallest token unit.

source

SetAccumulatedTimestamp

SetAccumulatedTimestamp records the latest reward accumulation timestamp.

Parameters

Name
Type
Description

accumulatedTimestamp

int64

Unix timestamp in seconds for the accumulation update.

source

SetClaimedRewardAmount

SetClaimedRewardAmount replaces the total claimed reward amount.

Parameters

Name
Type
Description

claimedRewardAmount

int64

claimed reward in the smallest token unit.

source

SetClaimedTimestamp

SetClaimedTimestamp records the latest reward claim timestamp.

Parameters

Name
Type
Description

claimedTimestamp

int64

Unix timestamp in seconds for the claim.

source

SetRewardDebtX128

Setters SetRewardDebtX128 replaces the reward debt with a copied fixed-point value.

Parameters

Name
Type
Description

rewardDebtX128

*u256.Uint

reward debt in the protocol's 128-bit fixed-point scale.

source

SetStakedAmount

SetStakedAmount replaces the current staked amount.

Parameters

Name
Type
Description

stakedAmount

int64

staked token amount in the smallest token unit.

source

Constructors

  • func NewEmissionRewardState(accumulatedRewardX128PerStake *u256.Uint) *EmissionRewardState (source)

Last updated