Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

staker state

Back to all declarations

Counter

type

Value

staker.Counter

NewCounter

func() *staker.Counter

NewCounter creates a counter initialized before the first allocated identifier. Returns: - \*Counter: counter whose current identifier is zero.

Open
OID
083f77…1fdf:3
NewCounter details

Inspect func

DelegationType

type

DelegationType represents the type of delegation operation

Value

staker.DelegationType

DelegateType

staker.DelegationType

Value

<gnolang.StringValue>

UnDelegateType

staker.DelegationType

Value

<gnolang.StringValue>

Delegation

type

Delegation represents a delegation between two addresses

Value

staker.Delegation

NewDelegation

func(id int64, delegateFrom .uverse.address, delegateTo .uverse.address, delegateAmount int64, createdHeight int64, createdAt int64) *staker.Delegation

NewDelegation creates a delegation record with no undelegated or collected amount. Parameters: - id: unique identifier assigned to this delegation record. - delegateFrom: address whose tokens are delegated. - delegateTo: address receiving the delegated voting power. - delegateAmount: initial delegated token amount in the smallest token unit. - createdHeight: block height at which the delegation was created. - createdAt: Unix timestamp at which the delegation was created. Returns: - \*Delegation: initialized delegation with empty withdrawal history.

Open
OID
083f77…1fdf:5
NewDelegation details

Inspect func

NewDelegationTree

func() *v0.BPTree

NewDelegationTree creates an empty tree for delegatee-to-delegation-ID mappings. Returns: - \*bptree.BPTree: empty tree configured for delegation lookup entries.

Open
OID
083f77…1fdf:7
NewDelegationTree details

Inspect func

NewUserDelegationTree

func() *v0.BPTree

NewUserDelegationTree creates an empty tree for user delegation mappings. Returns: - \*bptree.BPTree: empty tree configured for user delegation entries.

Open
OID
083f77…1fdf:8
NewUserDelegationTree details

Inspect func

DelegationManager

type

DelegationManager manages the mapping between users and their delegation IDs. It provides efficient lookup and management of user delegations organized by delegator and delegatee addresses.

Value

staker.DelegationManager

NewDelegationManager

func() *staker.DelegationManager

NewDelegationManager creates a new instance of DelegationManager. This factory function initializes the BPTree structure for tracking user delegations. Returns: - \*DelegationManager: manager ready to track delegator/delegatee ID lists.

Open
OID
083f77…1fdf:9
NewDelegationManager details

Inspect func

DelegationWithdraw

type

DelegationWithdraw represents a pending withdrawal from a delegation. This struct tracks undelegated amounts that are subject to lockup periods and manages the collection process once the lockup period expires.

Value

staker.DelegationWithdraw

NewDelegationWithdraw

func(delegationID int64, unDelegateAmount int64, createdHeight int64, createdAt int64, unDelegationLockupPeriod int64) staker.DelegationWithdraw

NewDelegationWithdraw creates a new delegation withdrawal with lockup period. The withdrawal becomes collectable after the lockup period expires. Parameters: - delegationID: Unique identifier of the associated delegation. - unDelegateAmount: Amount being withdrawn. - createdHeight: Block height at which the undelegation was created. - createdAt: Unix timestamp at which the withdrawal was created. - unDelegationLockupPeriod: Lockup duration in seconds. Returns: - DelegationWithdraw: new withdrawal instance with its collectable time set after the lockup.

Open
OID
083f77…1fdf:11
NewDelegationWithdraw details

Inspect func

NewDelegationWithdrawWithoutLockup

func(delegationID int64, unDelegateAmount int64, createdHeight int64, createdAt int64) staker.DelegationWithdraw

NewDelegationWithdrawWithoutLockup creates a withdrawal that is immediately collectable. This is used for special cases such as redelegation where no lockup is required. Parameters: - delegationID: Unique identifier of the associated delegation. - unDelegateAmount: Amount being withdrawn. - createdHeight: Block height at which the undelegation was created. - createdAt: Unix timestamp at which the withdrawal was created. Returns: - DelegationWithdraw: new withdrawal instance marked collected with collectable time equal to createdAt.

Open
OID
083f77…1fdf:13
NewDelegationWithdrawWithoutLockup details

Inspect func

errFailedToCastRewardState

untyped string

Value

"failed to cast rewardStates's element to *EmissionRewardState: %T"

EmissionRewardManager

type

EmissionRewardManager manages the distribution of emission rewards to stakers.

Value

staker.EmissionRewardManager

NewEmissionRewardManager

func() *staker.EmissionRewardManager

NewEmissionRewardManager creates and initializes an EmissionRewardManager with empty reward states and zero accounting totals. Returns: - \*EmissionRewardManager: initialized manager with empty reward states, zero totals, and a zero Q128 accumulator.

Open
OID
083f77…1fdf:14
NewEmissionRewardManager details

Inspect func

EmissionRewardState

type

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.

Value

staker.EmissionRewardState

NewEmissionRewardState

func(accumulatedRewardX128PerStake *v1.Uint) *staker.EmissionRewardState

NewEmissionRewardState creates a new emission reward state for a staker. This factory function initializes the state with the current system reward debt. Parameters: - accumulatedRewardX128PerStake: current system-wide accumulated reward per stake Returns: - \*EmissionRewardState: new emission reward state instance

Open
OID
083f77…1fdf:16
NewEmissionRewardState details

Inspect func

ErrSpoofedRealm

untyped string

ErrSpoofedRealm is returned by store Set\* methods when the supplied realm token does not match the current crossing frame (rlm.IsCurrent() is false), rejecting spoofed or stale realm tokens before any write is performed.

Value

"rlm does not match the current crossing frame"

cloneInt64Slice

func(src []int64) []int64
Open
OID
083f77…1fdf:18
cloneInt64Slice details

Inspect func

cloneStringInt64Map

func(src map[string]int64) map[string]int64
Open
OID
083f77…1fdf:20
cloneStringInt64Map details

Inspect func

cloneDelegationWithdraws

func(src []staker.DelegationWithdraw) []staker.DelegationWithdraw
Open
OID
083f77…1fdf:21
cloneDelegationWithdraws details

Inspect func

GetTotalxGnsSupply

func() int64

GetTotalxGnsSupply returns total xGNS supply, including launchpad-held xGNS. Returns: - int64: total xGNS supply, including xGNS held by launchpad projects.

Open
OID
083f77…1fdf:22
GetTotalxGnsSupply details

Inspect func

GetTotalDelegated

func() int64

GetTotalDelegated returns the total amount of GNS delegated. Returns: - int64: total GNS amount delegated across all delegators.

Open
OID
083f77…1fdf:24
GetTotalDelegated details

Inspect func

GetTotalLockedAmount

func() int64

GetTotalLockedAmount returns the total amount locked in undelegation withdrawals. Returns: - int64: aggregate locked amount; panics if the stored value is unavailable or not int64.

Open
OID
083f77…1fdf:25
GetTotalLockedAmount details

Inspect func

GetUnDelegationLockupPeriod

func() int64

GetUnDelegationLockupPeriod returns the configured undelegation lockup period in seconds. Returns: - int64: lockup duration in seconds; panics if the stored value is unavailable or not int64.

Open
OID
083f77…1fdf:26
GetUnDelegationLockupPeriod details

Inspect func

GetDelegations

func() *v0.ReadOnlyTree

GetDelegations returns a read-only view of every delegation, keyed by the decimal string form of the delegation ID. Callers paginate it themselves through IterateByOffset. Reading an entry yields a clone, so the view cannot mutate realm state. Returns: - \*rotree.ReadOnlyTree: read-only delegation view keyed by decimal delegation ID; entry reads return clones.

Open
OID
083f77…1fdf:27
GetDelegations details

Inspect func

ExistsDelegation

func(delegationID int64) bool

ExistsDelegation checks if a delegation exists. Parameters: - delegationID: Numeric identifier of the delegation to look up. Returns: - bool: true when a delegation with delegationID exists, false otherwise.

Open
OID
083f77…1fdf:28
ExistsDelegation details

Inspect func

GetDelegatorDelegations

func(delegator .uverse.address) *v0.ReadOnlyTree

GetDelegatorDelegations returns the delegatee tree for one delegator. Parameters: - delegator: delegator address string used as the root-tree key. Returns: - \*bptree.BPTree: delegatee-to-delegation-ID tree when present and correctly typed. - bool: true when the delegator entry exists with the expected tree type.

Open
OID
083f77…1fdf:29
GetDelegatorDelegations details

Inspect func

GetUserDelegationIDs

func(delegator .uverse.address, delegatee .uverse.address) []int64

GetUserDelegationIDs returns a list of delegation IDs for a specific delegator-delegatee pair. Parameters: - delegator: Address that supplied the delegation. - delegatee: Address receiving that delegation. Returns: - \[]int64: delegation IDs for the delegator-delegatee pair; the returned slice is independent of realm state.

Open
OID
083f77…1fdf:30
GetUserDelegationIDs details

Inspect func

HasDelegationSnapshotsKey

func() bool

HasDelegationSnapshotsKey returns true if delegation history exists. Returns: - bool: true when delegation history has been initialized in storage.

Open
OID
083f77…1fdf:31
HasDelegationSnapshotsKey details

Inspect func

GetTotalDelegationAmountAtSnapshot

func(snapshotTime int64) (int64, bool)

GetTotalDelegationAmountAtSnapshot returns total delegation at a Unix timestamp, using the latest history entry at or before that timestamp. The lookup is timestamp-based rather than a block-height snapshot. Parameters: - snapshotTime: Unix timestamp at or before which to select the latest aggregate delegation history entry. Returns: - int64: aggregate delegated amount recorded at or before snapshotTime. - bool: true when a qualifying history entry exists; false when no entry is available.

Open
OID
083f77…1fdf:32
GetTotalDelegationAmountAtSnapshot details

Inspect func

GetUserDelegationAmountAtSnapshot

func(userAddr .uverse.address, snapshotTime int64) (int64, bool)

GetUserDelegationAmountAtSnapshot returns one user's delegation at a Unix timestamp, using that user's latest history entry at or before the timestamp. The bool is false when no qualifying history entry exists. Parameters: - userAddr: Delegator address whose historical delegation is queried. - snapshotTime: Unix timestamp at or before which to select the user's latest history entry. Returns: - int64: user's delegated amount recorded at or before snapshotTime. - bool: true when a qualifying user-history entry exists; false otherwise.

Open
OID
083f77…1fdf:33
GetUserDelegationAmountAtSnapshot details

Inspect func

GetClaimableRewardByAddress

func(addr .uverse.address) (int64, map[string]int64, .uverse.error)

GetClaimableRewardByAddress returns claimable rewards for an address. Parameters: - addr: Address whose emission and protocol-fee rewards are queried. Returns: - int64: emission reward amount available to addr. - map\[string]int64: protocol-fee reward amounts keyed by token path. - error: nil on success; non-nil when reward state cannot be resolved for addr.

Open
OID
083f77…1fdf:34
GetClaimableRewardByAddress details

Inspect func

GetClaimableRewardByLaunchpad

func(addr .uverse.address) (int64, map[string]int64, .uverse.error)

GetClaimableRewardByLaunchpad returns claimable launchpad rewards for an address. Parameters: - addr: Address whose launchpad and protocol-fee rewards are queried. Returns: - int64: emission reward amount available to addr. - map\[string]int64: protocol-fee reward amounts keyed by token path. - error: nil on success; non-nil when reward state cannot be resolved for addr.

Open
OID
083f77…1fdf:35
GetClaimableRewardByLaunchpad details

Inspect func

GetClaimableRewardByRewardID

func(rewardID string) (int64, map[string]int64, .uverse.error)

GetClaimableRewardByRewardID returns claimable reward details by reward ID. Parameters: - rewardID: Reward-state identifier whose claimable rewards are queried. Returns: - int64: emission reward amount associated with rewardID. - map\[string]int64: protocol-fee reward amounts keyed by token path. - error: nil on success; non-nil when rewardID cannot be resolved.

Open
OID
083f77…1fdf:36
GetClaimableRewardByRewardID details

Inspect func

GetLaunchpadProjectDeposit

func(projectAddr string) (int64, bool)

GetLaunchpadProjectDeposit returns the deposit amount for a launchpad project. Parameters: - projectAddr: Launchpad project address whose deposited amount is queried. Returns: - int64: recorded launchpad project deposit amount. - bool: true when a deposit record exists for projectAddr; false otherwise.

Open
OID
083f77…1fdf:37
GetLaunchpadProjectDeposit details

Inspect func

GetDelegationWithdrawCount

func(delegationID int64) int

GetDelegationWithdrawCount returns the total number of delegation withdraws for a specific delegation. Parameters: - delegationID: Identifier of the delegation whose withdrawals are counted. Returns: - int: number of withdrawal records associated with delegationID.

Open
OID
083f77…1fdf:38
GetDelegationWithdrawCount details

Inspect func

GetDelegationWithdraws

func(delegationID int64, offset int, count int) ([]staker.DelegationWithdraw, .uverse.error)

GetDelegationWithdraws returns a paginated list of delegation withdraws for a specific delegation. Parameters: - delegationID: Identifier of the delegation whose withdrawals are requested. - offset: Number of matching withdrawal records to skip before collecting results. - count: Maximum number of withdrawal records to return. Returns: - \[]DelegationWithdraw: requested page of withdrawal records, copied before returning. - error: nil on success; non-nil when the requested delegation or page cannot be read.

Open
OID
083f77…1fdf:39
GetDelegationWithdraws details

Inspect func

GetCollectableWithdrawAmount

func(delegationID int64) int64

GetCollectableWithdrawAmount returns the collectable withdraw amount for a specific delegation. Parameters: - delegationID: Identifier of the delegation whose collectable amount is queried. Returns: - int64: amount currently available to collect from delegationID.

Open
OID
083f77…1fdf:40
GetCollectableWithdrawAmount details

Inspect func

GetProtocolFeeAccumulatedX128PerStake

func(tokenPath string) *v1.Uint

GetProtocolFeeAccumulatedX128PerStake returns the accumulated protocol fee per stake (Q128) for a token path. Parameters: - tokenPath: Registered token path whose protocol-fee accumulator is queried. Returns: - \*u256.Uint: accumulated protocol-fee amount per unit stake in Q128 fixed-point form.

Open
OID
083f77…1fdf:41
GetProtocolFeeAccumulatedX128PerStake details

Inspect func

GetProtocolFeeAmount

func(tokenPath string) int64

GetProtocolFeeAmount returns the total protocol fee amount folded into the accumulator. Returns: - int64: total fee amount folded for this token.

Open
OID
083f77…1fdf:42
GetProtocolFeeAmount details

Inspect func

GetProtocolFeeAccumulatedTimestamp

func() int64

GetProtocolFeeAccumulatedTimestamp returns the accumulated timestamp for protocol fee rewards. Returns: - int64: Unix timestamp at which protocol-fee accumulation was last updated.

Open
OID
083f77…1fdf:43
GetProtocolFeeAccumulatedTimestamp details

Inspect func

GetEmissionAccumulatedX128PerStake

func() *v1.Uint

GetEmissionAccumulatedX128PerStake returns the accumulated emission per stake (Q128). Returns: - \*u256.Uint: accumulated emission reward per unit stake in Q128 fixed-point form.

Open
OID
083f77…1fdf:44
GetEmissionAccumulatedX128PerStake details

Inspect func

GetEmissionDistributedAmount

func() int64

GetEmissionDistributedAmount returns the total distributed emission amount. Returns: - int64: total emission amount distributed to stakers.

Open
OID
083f77…1fdf:45
GetEmissionDistributedAmount details

Inspect func

GetEmissionAccumulatedTimestamp

func() int64

GetEmissionAccumulatedTimestamp returns the accumulated timestamp for emission rewards. Returns: - int64: Unix timestamp at which emission accumulation was last updated.

Open
OID
083f77…1fdf:46
GetEmissionAccumulatedTimestamp details

Inspect func

LaunchpadProjectDeposits

type

LaunchpadProjectDeposits manages deposit amounts for launchpad projects. It tracks the total staked amount for each project identified by owner address.

Value

staker.LaunchpadProjectDeposits

NewLaunchpadProjectDeposits

func() *staker.LaunchpadProjectDeposits

NewLaunchpadProjectDeposits creates an empty owner-to-deposit tree. Returns: - \*LaunchpadProjectDeposits: deposit manager initialized with an empty tree.

Open
OID
083f77…1fdf:47
NewLaunchpadProjectDeposits details

Inspect func

ProtocolFeeRewardManager

type

ProtocolFeeRewardManager distributes protocol fees to stakers. Protocol fees arrive in many tokens, so the manager keeps one accumulator per token instead of a single one. A stake change never touches those accumulators: it advances the accrual epoch, records the total stake in force from that epoch, and appends one event for an ordinary add/remove. Redelegate performs a remove plus an add and therefore appends two events. The per-token work happens when a token is collected, so stake-change cost does not depend on how many tokens ever collected a fee.

Value

staker.ProtocolFeeRewardManager

NewProtocolFeeRewardManager

func() *staker.ProtocolFeeRewardManager

NewProtocolFeeRewardManager creates a new instance of ProtocolFeeRewardManager. Returns: - \*ProtocolFeeRewardManager: new protocol fee reward manager instance

Open
OID
083f77…1fdf:49
NewProtocolFeeRewardManager details

Inspect func

ProtocolFeeRewardState

type

ProtocolFeeRewardState tracks the protocol fee rewards of one staker. Ordinary stake changes append one ProtocolFeeStakeEvent; Redelegate performs a remove plus an add and appends two events. Each token is settled on its own from those events, so the state keeps a per-token cursor into the event history rather than a reward debt for every token at once.

Value

staker.ProtocolFeeRewardState

ProtocolFeeStakeEvent

type

ProtocolFeeStakeEvent is one stake change: from epoch on, stakedAmount was staked.

Value

staker.ProtocolFeeStakeEvent

ProtocolFeeTokenRewardState

type

ProtocolFeeTokenRewardState is the settlement state of one token for one staker. Stake events up to eventCursor are folded into earnedX128. The open segment starts where the last folded event left the accumulator (segmentStartX128) with segmentStakedAmount staked.

Value

staker.ProtocolFeeTokenRewardState

NewProtocolFeeRewardState

func() *staker.ProtocolFeeRewardState

NewProtocolFeeRewardState creates an empty state for a staker with no stake. Returns: - \*ProtocolFeeRewardState: initialized reward state with empty event and token trees

Open
OID
083f77…1fdf:51
NewProtocolFeeRewardState details

Inspect func

NewProtocolFeeTokenRewardState

func(eventCursor int64, segmentStakedAmount int64, segmentStartX128 *v1.Uint) *staker.ProtocolFeeTokenRewardState

NewProtocolFeeTokenRewardState creates the settlement state of a token whose open segment starts at the given cursor, stake and accumulator value. Parameters: - eventCursor: number of stake events already folded into this token state - segmentStakedAmount: stake amount in force during the open segment - segmentStartX128: accumulated fee-per-stake value at the open segment start, scaled by 2^128 Returns: - \*ProtocolFeeTokenRewardState: token settlement state with zero closed-segment earnings and claimed reward

Open
OID
083f77…1fdf:53
NewProtocolFeeTokenRewardState details

Inspect func

ProtocolFeeTokenAccumulator

type

ProtocolFeeTokenAccumulator tracks the accumulated protocol fee per stake of one token. Fees are folded in per accrual epoch, each against the total stake in force during that epoch. The value after folding each epoch is kept in history so that a staker's reward can be settled later against the accumulator as it stood at any epoch.

Value

staker.ProtocolFeeTokenAccumulator

NewProtocolFeeTokenAccumulator

func() *staker.ProtocolFeeTokenAccumulator

NewProtocolFeeTokenAccumulator creates an empty accumulator with no folded epochs or protocol fees recorded. Returns: - \*ProtocolFeeTokenAccumulator: accumulator initialized with zero values and empty epoch history.

Open
OID
083f77…1fdf:54
NewProtocolFeeTokenAccumulator details

Inspect func

Delegate

func(to .uverse.address, amount int64, referrer string) int64

Delegate delegates GNS to a delegate. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. - to: delegatee address that receives voting power - amount: positive GNS amount to delegate and convert to xGNS voting power - referrer: optional referral identifier to register for reward tracking Returns: - delegatedAmount: The amount of GNS delegated and mirrored as xGNS. Halt check: reverts while the GovStaker halt scope is active.

Open
OID
083f77…1fdf:56
Delegate details

Inspect func

Undelegate

func(from .uverse.address, amount int64) int64

Undelegate undelegates xGNS from the existing delegate. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. - from: delegatee address from which the caller removes delegation - amount: positive xGNS amount to move into undelegation lockup Returns: - amount: The amount of GNS moved into undelegation lockup. Halt check: reverts while the Withdraw halt scope is active.

Open
OID
083f77…1fdf:58
Undelegate details

Inspect func

Redelegate

func(delegatee .uverse.address, newDelegatee .uverse.address, amount int64) int64

Redelegate redelegates xGNS from the existing delegate to another. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. - delegatee: current delegatee address whose voting power is reduced - newDelegatee: destination address that receives the redelegated voting power - amount: positive xGNS amount to move without a user-facing lockup Returns: - redelegatedAmount: The amount moved from the current delegatee to the new delegatee. Halt check: reverts while the GovStaker halt scope is active.

Open
OID
083f77…1fdf:59
Redelegate details

Inspect func

CollectUndelegatedGns

func() int64

CollectUndelegatedGns collects the amount of the undelegated GNS. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. Returns: - amount: GNS amount released to the caller after eligible undelegation withdrawals are collected Halt check: reverts while the Withdraw halt scope is active.

Open
OID
083f77…1fdf:60
CollectUndelegatedGns details

Inspect func

CollectReward

func()

CollectReward claims the caller's GNS emission reward and all known protocol-fee token rewards. The all-token path folds and settles every known token. It is not a single-current-xGNS-balance formula. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. Halt check: reverts while the Withdraw halt scope is active.

Open
OID
083f77…1fdf:61
CollectReward details

Inspect func

CollectEmissionReward

func()

CollectEmissionReward claims the caller's accumulated GNS emission reward. The call is subject to the withdrawal halt and transfers GNS when a reward is available. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. Halt check: reverts while the Withdraw halt scope is active.

Open
OID
083f77…1fdf:62
CollectEmissionReward details

Inspect func

CollectProtocolFeeReward

func(tokenPath string)

CollectProtocolFeeReward claims accumulated protocol-fee rewards for one registered token path. Folding and settlement are bounded per call; any remaining buckets or stake events are collected by a later call. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. - tokenPath: registered token path whose accumulated protocol-fee reward is claimed Halt check: reverts while the Withdraw halt scope is active.

Open
OID
083f77…1fdf:63
CollectProtocolFeeReward details

Inspect func

CollectRewardFromLaunchPad

func(to .uverse.address)

CollectRewardFromLaunchPad claims both GNS emission and protocol-fee rewards for a registered launchpad project wallet. Only the launchpad contract may call this entry point. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. - to: registered launchpad project wallet that receives both reward streams Halt check: reverts while the Withdraw halt scope is active.

Open
OID
083f77…1fdf:64
CollectRewardFromLaunchPad details

Inspect func

CollectEmissionRewardFromLaunchPad

func(to .uverse.address)

CollectEmissionRewardFromLaunchPad claims only accumulated GNS emission rewards for a registered launchpad project wallet. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. - to: registered launchpad project wallet whose emission reward is claimed Halt check: reverts while the Withdraw halt scope is active.

Open
OID
083f77…1fdf:65
CollectEmissionRewardFromLaunchPad details

Inspect func

CollectProtocolFeeRewardFromLaunchPad

func(to .uverse.address, tokenPath string)

CollectProtocolFeeRewardFromLaunchPad claims one token path of accumulated protocol-fee rewards for a registered launchpad project wallet. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. - to: registered launchpad project wallet whose protocol-fee reward is claimed - tokenPath: registered token path whose accumulated protocol-fee reward is claimed Halt check: reverts while the Withdraw halt scope is active.

Open
OID
083f77…1fdf:66
CollectProtocolFeeRewardFromLaunchPad details

Inspect func

SetAmountByProjectWallet

func(addr .uverse.address, amount int64, add bool)

SetAmountByProjectWallet adjusts launchpad-backed stake and xGNS accounting for a project wallet. Only callable by launchpad contract. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. - addr: registered project wallet whose launchpad-backed stake is adjusted - amount: stake amount delta passed to the launchpad reward accounting - add: true to add stake and mint xGNS; false to remove stake and burn xGNS Halt check: reverts while the GovStaker halt scope is active when add is true, or while the Withdraw halt scope is active when add is false.

Open
OID
083f77…1fdf:67
SetAmountByProjectWallet details

Inspect func

CleanStakerDelegationSnapshotByAdmin

func(threshold int64, target .uverse.address)

CleanStakerDelegationSnapshotByAdmin removes old delegation snapshots for the total history and the user history of a single target address. Only callable by admin. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. - threshold: Unix timestamp cutoff for removing eligible old delegation history - target: user address whose delegation history to clean Halt check: reverts while the GovStaker halt scope is active.

Open
OID
083f77…1fdf:68
CleanStakerDelegationSnapshotByAdmin details

Inspect func

SetUnDelegationLockupPeriodByAdmin

func(period int64)

SetUnDelegationLockupPeriodByAdmin sets the undelegation lockup period. Only callable by admin. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. - period: non-negative undelegation lockup duration in seconds Halt check: reverts while the GovStaker halt scope is active.

Open
OID
083f77…1fdf:69
SetUnDelegationLockupPeriodByAdmin details

Inspect func

Render

func(path string) string

Render delegates web rendering to the active implementation.

Open
OID
083f77…1fdf:70
Render details

Inspect func

currentAddress

.uverse.address

Value

<gnolang.StringValue>

domainPath

string

Value

"gno.land/r/gnoswap/gov/staker"

initializeDomainStore

func(int, rlm .uverse.realm, kvStore v1.KVStore) interface{...}
Open
OID
083f77…1fdf:79
initializeDomainStore details

Inspect func

getImplementation

func() staker.IGovStaker

getImplementation returns the current active implementation

Open
OID
083f77…1fdf:80
getImplementation details

Inspect func

updateImplementation

func() .uverse.error
Open
OID
083f77…1fdf:81
updateImplementation details

Inspect func

StoreKeyUnDelegationLockupPeriod

untyped string

Storage key constants

Value

"unDelegationLockupPeriod"

StoreKeyTotalDelegatedAmount

untyped string

Storage key constants

Value

"totalDelegatedAmount"

StoreKeyTotalLockedAmount

untyped string

Storage key constants

Value

"totalLockedAmount"

StoreKeyDelegationNextID

untyped string

Storage key constants

Value

"delegationNextID"

StoreKeyDelegations

untyped string

// BPTree of delegations

Value

"delegations"

StoreKeyTotalDelegationHistory

untyped string

// UintTree: timestamp -> int64 (cumulative total)

Value

"totalDelegationHistory"

StoreKeyUserDelegationHistory

untyped string

// BPTree: address -> \*UintTree\[timestamp -> int64]

Value

"userDelegationHistory"

StoreKeyEmissionRewardManager

untyped string

Storage key constants

Value

"emissionRewardManager"

StoreKeyProtocolFeeRewardManager

untyped string

Storage key constants

Value

"protocolFeeRewardManager"

StoreKeyDelegationManager

untyped string

Storage key constants

Value

"delegationManager"

StoreKeyLaunchpadProjectDeposits

untyped string

Storage key constants

Value

"launchpadProjectDeposits"

govStakerStore

type

govStakerStore is the concrete implementation of IGovStakerStore

Value

staker.govStakerStore

NewGovStakerStore

func(kvStore v1.KVStore) staker.IGovStakerStore

NewGovStakerStore creates a new governance staker store instance backed by kvStore. Parameters: - kvStore: Key-value store used to persist governance staker state. Returns: - IGovStakerStore: store implementation that reads and writes the supplied KV store.

Open
OID
083f77…1fdf:82
NewGovStakerStore details

Inspect func

UintTree

type

UintTree is a wrapper around a BPTree for storing non-negative int64 keys as ordered strings. Depending on the caller, keys represent Unix timestamps, accrual epochs, or stake-event indexes. Since keys are int64 values, they are converted to uint64-compatible strings. Methods: - Get: Retrieves a value associated with a non-negative int64 key. - set: Stores a value with a non-negative int64 key. - Has: Checks if a non-negative int64 key exists in the tree. - remove: Removes a non-negative int64 key and its associated value. - Iterate: Iterates over keys and values in a range. - ReverseIterate: Iterates in reverse order over keys and values in a range.

Value

staker.UintTree

NewUintTree

func() *staker.UintTree

NewUintTree creates a new UintTree instance. Returns: - \*UintTree: new tree backed by an empty ordered BPTree

Open
OID
083f77…1fdf:84
NewUintTree details

Inspect func

encodeInt64

func(num int64) string
Open
OID
083f77…1fdf:86
encodeInt64 details

Inspect func

decodeInt64

func(s string) int64
Open
OID
083f77…1fdf:87
decodeInt64 details

Inspect func

IGovStaker

type

Main interface that combines all sub-interfaces

Value

staker.IGovStaker

IGovStakerDelegation

type

Delegation operations interface Mutating methods take \`\_ int, rlm realm\` so the realm token is threaded from the proxy entry points down to the cross-realm token transfers and store writes performed inside each implementation. The \`\_ int\` sentinel surfaces at every call site as a literal \`0\`, making the realm threading visible to readers.

Value

staker.IGovStakerDelegation

IGovStakerReward

type

Reward management interface

Value

staker.IGovStakerReward

IGovStakerGetter

type

Getter interface for read operations

Value

staker.IGovStakerGetter

IGovStakerAdmin

type

Admin interface for administrative functions

Value

staker.IGovStakerAdmin

IGovStakerStore

type

IGovStakerStore mirrors the mutating-method realm-threading convention used by the public IGovStaker\* interfaces above. Setters take \`\_ int, rlm realm\` so KV-store writes execute under the proxy realm — the only address with write access to the shared store.

Value

staker.IGovStakerStore

RegisterInitializer

func(initializer func(...))

RegisterInitializer registers an implementation initializer for this realm. Each implementation version calls it during initialization. The callback receives the current realm context and shared gov/staker store so it can construct the versioned implementation. Parameters: - cur: current realm context; callers use cross(cur) when crossing into this realm - initializer: callback invoked with discriminator 0, validated propagated realm context, and IGovStakerStore, returning the implementation

Open
OID
083f77…1fdf:88
RegisterInitializer details

Inspect func

UpgradeImpl

func(packagePath string)

UpgradeImpl upgrades the active implementation to packagePath. Only admin or governance can call this function. Parameters: - cur: current realm context; callers use cross(cur) when crossing into this realm - packagePath: package path of the implementation version to activate

Open
OID
083f77…1fdf:90
UpgradeImpl details

Inspect func

GetImplementationPackagePath

func() string

GetImplementationPackagePath returns the package path of the currently active implementation. Returns: - packagePath: package path of the active implementation

Open
OID
083f77…1fdf:91
GetImplementationPackagePath details

Inspect func
Counter : type =staker.Counter
NewCounter : func() *staker.Counter Inspect
DelegationType : type =staker.DelegationType
DelegateType : staker.DelegationType =<gnolang.StringValue>
UnDelegateType : staker.DelegationType =<gnolang.StringValue>
Delegation : type =staker.Delegation
NewDelegation : func(id int64, delegateFrom .uverse.address, delegateTo .uverse.address, delegateAmount int64, createdHeight int64, createdAt int64) *staker.Delegation Inspect
NewDelegationTree : func() *v0.BPTree Inspect
NewUserDelegationTree : func() *v0.BPTree Inspect
DelegationManager : type =staker.DelegationManager
NewDelegationManager : func() *staker.DelegationManager Inspect
DelegationWithdraw : type =staker.DelegationWithdraw
NewDelegationWithdraw : func(delegationID int64, unDelegateAmount int64, createdHeight int64, createdAt int64, unDelegationLockupPeriod int64) staker.DelegationWithdraw Inspect
NewDelegationWithdrawWithoutLockup : func(delegationID int64, unDelegateAmount int64, createdHeight int64, createdAt int64) staker.DelegationWithdraw Inspect
errFailedToCastRewardState : untyped string ="failed to cast rewardStates's element to *EmissionRewardState: %T"
EmissionRewardManager : type =staker.EmissionRewardManager
NewEmissionRewardManager : func() *staker.EmissionRewardManager Inspect
EmissionRewardState : type =staker.EmissionRewardState
NewEmissionRewardState : func(accumulatedRewardX128PerStake *v1.Uint) *staker.EmissionRewardState Inspect
ErrSpoofedRealm : untyped string ="rlm does not match the current crossing frame"
cloneInt64Slice : func(src []int64) []int64 Inspect
cloneStringInt64Map : func(src map[string]int64) map[string]int64 Inspect
cloneDelegationWithdraws : func(src []staker.DelegationWithdraw) []staker.DelegationWithdraw Inspect
GetTotalxGnsSupply : func() int64 Inspect
GetTotalDelegated : func() int64 Inspect
GetTotalLockedAmount : func() int64 Inspect
GetUnDelegationLockupPeriod : func() int64 Inspect
GetDelegations : func() *v0.ReadOnlyTree Inspect
ExistsDelegation : func(delegationID int64) bool Inspect
GetDelegatorDelegations : func(delegator .uverse.address) *v0.ReadOnlyTree Inspect
GetUserDelegationIDs : func(delegator .uverse.address, delegatee .uverse.address) []int64 Inspect
HasDelegationSnapshotsKey : func() bool Inspect
GetTotalDelegationAmountAtSnapshot : func(snapshotTime int64) (int64, bool) Inspect
GetUserDelegationAmountAtSnapshot : func(userAddr .uverse.address, snapshotTime int64) (int64, bool) Inspect
GetClaimableRewardByAddress : func(addr .uverse.address) (int64, map[string]int64, .uverse.error) Inspect
GetClaimableRewardByLaunchpad : func(addr .uverse.address) (int64, map[string]int64, .uverse.error) Inspect
GetClaimableRewardByRewardID : func(rewardID string) (int64, map[string]int64, .uverse.error) Inspect
GetLaunchpadProjectDeposit : func(projectAddr string) (int64, bool) Inspect
GetDelegationWithdrawCount : func(delegationID int64) int Inspect
GetDelegationWithdraws : func(delegationID int64, offset int, count int) ([]staker.DelegationWithdraw, .uverse.error) Inspect
GetCollectableWithdrawAmount : func(delegationID int64) int64 Inspect
GetProtocolFeeAccumulatedX128PerStake : func(tokenPath string) *v1.Uint Inspect
GetProtocolFeeAmount : func(tokenPath string) int64 Inspect
GetProtocolFeeAccumulatedTimestamp : func() int64 Inspect
GetEmissionAccumulatedX128PerStake : func() *v1.Uint Inspect
GetEmissionDistributedAmount : func() int64 Inspect
GetEmissionAccumulatedTimestamp : func() int64 Inspect
LaunchpadProjectDeposits : type =staker.LaunchpadProjectDeposits
NewLaunchpadProjectDeposits : func() *staker.LaunchpadProjectDeposits Inspect
ProtocolFeeRewardManager : type =staker.ProtocolFeeRewardManager
NewProtocolFeeRewardManager : func() *staker.ProtocolFeeRewardManager Inspect
ProtocolFeeRewardState : type =staker.ProtocolFeeRewardState
ProtocolFeeStakeEvent : type =staker.ProtocolFeeStakeEvent
ProtocolFeeTokenRewardState : type =staker.ProtocolFeeTokenRewardState
NewProtocolFeeRewardState : func() *staker.ProtocolFeeRewardState Inspect
NewProtocolFeeTokenRewardState : func(eventCursor int64, segmentStakedAmount int64, segmentStartX128 *v1.Uint) *staker.ProtocolFeeTokenRewardState Inspect
ProtocolFeeTokenAccumulator : type =staker.ProtocolFeeTokenAccumulator
NewProtocolFeeTokenAccumulator : func() *staker.ProtocolFeeTokenAccumulator Inspect
Delegate : func(to .uverse.address, amount int64, referrer string) int64 Inspect
Undelegate : func(from .uverse.address, amount int64) int64 Inspect
Redelegate : func(delegatee .uverse.address, newDelegatee .uverse.address, amount int64) int64 Inspect
CollectUndelegatedGns : func() int64 Inspect
CollectReward : func() Inspect
CollectEmissionReward : func() Inspect
CollectProtocolFeeReward : func(tokenPath string) Inspect
CollectRewardFromLaunchPad : func(to .uverse.address) Inspect
CollectEmissionRewardFromLaunchPad : func(to .uverse.address) Inspect
CollectProtocolFeeRewardFromLaunchPad : func(to .uverse.address, tokenPath string) Inspect
SetAmountByProjectWallet : func(addr .uverse.address, amount int64, add bool) Inspect
CleanStakerDelegationSnapshotByAdmin : func(threshold int64, target .uverse.address) Inspect
SetUnDelegationLockupPeriodByAdmin : func(period int64) Inspect
Render : func(path string) string Inspect
currentAddress : .uverse.address =<gnolang.StringValue>
domainPath : string ="gno.land/r/gnoswap/gov/staker"
kvStore : *v1.kvStore Inspect
versionManager : *v1.versionManager Inspect
implementation : *v1.govStakerV1 Inspect
init.77 : func() Inspect
initializeDomainStore : func(int, rlm .uverse.realm, kvStore v1.KVStore) interface{...} Inspect
getImplementation : func() staker.IGovStaker Inspect
updateImplementation : func() .uverse.error Inspect
StoreKeyUnDelegationLockupPeriod : untyped string ="unDelegationLockupPeriod"
StoreKeyTotalDelegatedAmount : untyped string ="totalDelegatedAmount"
StoreKeyTotalLockedAmount : untyped string ="totalLockedAmount"
StoreKeyDelegationNextID : untyped string ="delegationNextID"
StoreKeyDelegations : untyped string ="delegations"
StoreKeyTotalDelegationHistory : untyped string ="totalDelegationHistory"
StoreKeyUserDelegationHistory : untyped string ="userDelegationHistory"
StoreKeyEmissionRewardManager : untyped string ="emissionRewardManager"
StoreKeyProtocolFeeRewardManager : untyped string ="protocolFeeRewardManager"
StoreKeyDelegationManager : untyped string ="delegationManager"
StoreKeyLaunchpadProjectDeposits : untyped string ="launchpadProjectDeposits"
govStakerStore : type =staker.govStakerStore
NewGovStakerStore : func(kvStore v1.KVStore) staker.IGovStakerStore Inspect
UintTree : type =staker.UintTree
NewUintTree : func() *staker.UintTree Inspect
encodeInt64 : func(num int64) string Inspect
decodeInt64 : func(s string) int64 Inspect
IGovStaker : type =staker.IGovStaker
IGovStakerDelegation : type =staker.IGovStakerDelegation
IGovStakerReward : type =staker.IGovStakerReward
IGovStakerGetter : type =staker.IGovStakerGetter
IGovStakerAdmin : type =staker.IGovStakerAdmin
IGovStakerStore : type =staker.IGovStakerStore
RegisterInitializer : func(initializer func(...)) Inspect
UpgradeImpl : func(packagePath string) Inspect
GetImplementationPackagePath : func() string Inspect