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

emission_reward_manager.gno

Types

EmissionRewardManager

EmissionRewardManager manages the distribution of emission rewards to stakers.

source

Methods

GetAccumulatedRewardX128PerStake

GetAccumulatedRewardX128PerStake returns the accumulated reward per stake with 128-bit precision.

Return Values

Name
Type
Description

*u256.Uint

*u256.Uint

accumulated emission reward per unit of stake in Q128 fixed-point form.

source

GetAccumulatedTimestamp

GetAccumulatedTimestamp returns the last timestamp when rewards were accumulated.

Return Values

Name
Type
Description

int64

int64

Unix timestamp of the latest emission-reward accumulation.

source

GetDistributedAmount

GetDistributedAmount returns the total amount of rewards distributed.

Return Values

Name
Type
Description

int64

int64

total emission reward amount marked as distributed.

source

GetRewardState

GetRewardState retrieves the reward state for addr.

Parameters

Name
Type
Description

addr

string

Address key identifying the staker's emission reward state.

Return Values

Name
Type
Description

*EmissionRewardState

*EmissionRewardState

stored state, or nil when addr has no state.

bool

bool

true when a reward state exists for addr; false when absent.

error

error

nil on success or absence; non-nil when the stored value has the wrong type.

source

GetTotalStakedAmount

GetTotalStakedAmount returns the total amount of tokens staked in the system.

Return Values

Name
Type
Description

int64

int64

total staked token amount tracked by the manager.

source

SetAccumulatedRewardX128PerStake

SetAccumulatedRewardX128PerStake stores the accumulated emission reward per stake.

Parameters

Name
Type
Description

accumulatedRewardX128PerStake

*u256.Uint

Q128 fixed-point reward-per-stake accumulator to copy into the manager.

source

SetAccumulatedTimestamp

SetAccumulatedTimestamp stores the latest emission-reward accumulation timestamp.

Parameters

Name
Type
Description

accumulatedTimestamp

int64

Unix timestamp associated with the current accumulator.

source

SetDistributedAmount

SetDistributedAmount stores the total emission amount marked as distributed.

Parameters

Name
Type
Description

distributedAmount

int64

Total emission reward amount distributed so far.

source

SetRewardState

SetRewardState sets the reward state for a specific address SetRewardState stores one staker's emission reward state under address.

Parameters

Name
Type
Description

address

string

Address key for the staker's reward state.

rewardState

*EmissionRewardState

Emission reward state to store for address.

source

SetRewardStates

SetRewardStates replaces the tree containing per-address emission reward states.

Parameters

Name
Type
Description

rewardStates

*bptree.BPTree

BPTree mapping staker addresses to emission reward states.

source

SetTotalStakedAmount

SetTotalStakedAmount stores the total amount currently staked.

Parameters

Name
Type
Description

totalStakedAmount

int64

Aggregate token amount participating in emission rewards.

source

Constructors

  • func NewEmissionRewardManager() *EmissionRewardManager (source)

Last updated