assertIsValidDelegateAmount
func(amount int64)assertIsValidDelegateAmount validates that the delegation amount meets system requirements. This function checks minimum amount and multiple requirements. Parameters: - amount: amount to validate Returns: - error: nil if valid, error describing validation failure
- OID
- 0b7b23…e234:3
assertIsValidDelegateAmount details
assertIsValidSnapshotTime
func(snapshotTime int64)- OID
- 0b7b23…e234:5
assertIsValidSnapshotTime details
assertIsAvailableCleanupSnapshotTime
func(cleanupSnapshotTime int64)assertIsAvailableCleanupSnapshotTime checks that no active proposals need
- OID
- 0b7b23…e234:6
assertIsAvailableCleanupSnapshotTime details
assertNoSameDelegatee
func(delegatee .uverse.address, newDelegatee .uverse.address)- OID
- 0b7b23…e234:7
assertNoSameDelegatee details
assertNotImplementYet
func()- OID
- 0b7b23…e234:8
assertNotImplementYet details
minimumAmount
untyped bigint// 1 GNS
Value
(1000000 <untyped> bigint)
maxAccrualBucketsPerCollect
untyped bigintValue
(256 <untyped> bigint)
maxStakeEventsPerCollect
untyped bigintValue
(256 <untyped> bigint)
errCollectAmountExceedsCollectable
untyped stringValue
"amount to collect is greater than collectable amount"
DelegationResolver
typeValue
v1.DelegationResolver
NewDelegationResolver
func(delegation *staker.Delegation) *v1.DelegationResolverNewDelegationResolver wraps a delegation in a resolver for derived amounts and withdrawals. Parameters: - delegation: delegation state to resolve Returns: - \*DelegationResolver: resolver backed by delegation
- OID
- 0b7b23…e234:9
NewDelegationResolver details
addToCollectedAmount
func(collectedAmount int64, amount int64) (int64, .uverse.error)- OID
- 0b7b23…e234:11
addToCollectedAmount details
NewDelegation
func(id int64, delegateFrom .uverse.address, delegateTo .uverse.address, delegateAmount int64, createdHeight int64, createdAt int64) *staker.DelegationNewDelegation creates a new delegation. This is a convenience wrapper around staker.NewDelegation. Parameters: - id: delegation ID - delegateFrom: delegator's address - delegateTo: delegatee's address - delegateAmount: amount to delegate - createdHeight: creation block height - createdAt: creation timestamp Returns: - \*staker.Delegation: new delegation instance
- OID
- 0b7b23…e234:12
NewDelegation details
DelegationManagerResolver
typeValue
v1.DelegationManagerResolver
NewDelegationManagerResolver
func(delegationManager *staker.DelegationManager) *v1.DelegationManagerResolverNewDelegationManagerResolver creates a resolver over an existing delegation manager. Parameters: - delegationManager: manager whose domain-owned delegation trees will be queried or updated. Returns: - \*DelegationManagerResolver: resolver exposing address-typed delegation operations.
- OID
- 0b7b23…e234:13
NewDelegationManagerResolver details
DelegationWithdrawResolver
typeValue
v1.DelegationWithdrawResolver
NewDelegationWithdrawResolver
func(withdraw *staker.DelegationWithdraw) *v1.DelegationWithdrawResolverNewDelegationWithdrawResolver wraps a delegation withdrawal for collection state and lockup calculations. Parameters: - withdraw: delegation withdrawal state to resolve Returns: - \*DelegationWithdrawResolver: resolver retaining the supplied withdrawal pointer
- OID
- 0b7b23…e234:15
NewDelegationWithdrawResolver details
NewDelegationWithdraw
func(delegationID int64, unDelegateAmount int64, createdHeight int64, createdAt int64, unDelegationLockupPeriod int64) staker.DelegationWithdrawNewDelegationWithdraw creates a new delegation withdrawal with lockup period. This is a convenience wrapper around staker.NewDelegationWithdraw. Parameters: - delegationID: unique identifier of the associated delegation - unDelegateAmount: amount being withdrawn - createdHeight: height when the withdrawal was created - createdAt: timestamp when the withdrawal was created - unDelegationLockupPeriod: duration of the lockup period in seconds Returns: - staker.DelegationWithdraw: new withdrawal instance with lockup
- OID
- 0b7b23…e234:17
NewDelegationWithdraw details
NewDelegationWithdrawWithoutLockup
func(delegationID int64, unDelegateAmount int64, createdHeight int64, createdAt int64) staker.DelegationWithdrawNewDelegationWithdrawWithoutLockup creates a new delegation withdrawal that is immediately collectable. This is a convenience wrapper around staker.NewDelegationWithdrawWithoutLockup. Parameters: - delegationID: unique identifier of the associated delegation - unDelegateAmount: amount being withdrawn - createdHeight: height when the withdrawal was created - createdAt: timestamp when the withdrawal was created Returns: - staker.DelegationWithdraw: new withdrawal instance that is immediately collectable
- OID
- 0b7b23…e234:18
NewDelegationWithdrawWithoutLockup details
EmissionRewardManagerResolver
typeValue
v1.EmissionRewardManagerResolver
NewEmissionRewardManagerResolver
func(emissionRewardManager *staker.EmissionRewardManager) *v1.EmissionRewardManagerResolverNewEmissionRewardManagerResolver wraps an emission reward manager with reward calculation and stake-accounting helpers. Parameters: - emissionRewardManager: manager state to resolve and mutate. Returns: - \*EmissionRewardManagerResolver: resolver backed by emissionRewardManager.
- OID
- 0b7b23…e234:19
NewEmissionRewardManagerResolver details
EmissionRewardStateResolver
typeValue
v1.EmissionRewardStateResolver
NewEmissionRewardStateResolver
func(emissionRewardState *staker.EmissionRewardState) *v1.EmissionRewardStateResolverNewEmissionRewardStateResolver wraps an on-chain emission reward state for reward calculation and stake/claim updates. Parameters: - emissionRewardState: persisted reward state to expose through the resolver Returns: - \*EmissionRewardStateResolver: resolver backed by emissionRewardState
- OID
- 0b7b23…e234:21
NewEmissionRewardStateResolver details
emitUpdateEmissionRewardAccumulation
func(manager *staker.EmissionRewardManager)emitUpdateEmissionRewardAccumulation emits the persisted global emission reward accumulation state so that off-chain indexers can consume the authoritative accumulator instead of re-deriving it. It must be emitted after every path that calls updateAccumulatedRewardX128PerStake (add/remove/claim), otherwise the off-chain accumulator drifts from the contract. All values are read from the manager's persisted state (post-update): - distributedAmount is GetDistributedAmount() (the stored baseline the contract will use for the next delta), not the live emission distribution snapshot. - totalStakedAmount reflects the current total after the stake change and is the divisor for the next accumulation delta.
- OID
- 0b7b23…e234:23
emitUpdateEmissionRewardAccumulation details
emitUpdateProtocolFeeStakeAccrual
func(manager *staker.ProtocolFeeRewardManager)emitUpdateProtocolFeeStakeAccrual emits the accrual epoch opened by a stake change together with the total stake in force from it, so that off-chain indexers can attribute fees bucketed under that epoch without re-deriving the stake history.
- OID
- 0b7b23…e234:25
emitUpdateProtocolFeeStakeAccrual details
emitUpdateProtocolFeeRewardAccumulation
func(manager *staker.ProtocolFeeRewardManager, tokenPaths []string)emitUpdateProtocolFeeRewardAccumulation emits the persisted accumulation state of every token that was just folded. Like the emission variant it must be emitted after every path that folds accrual buckets, otherwise the off-chain accumulator drifts from the contract.
- OID
- 0b7b23…e234:26
emitUpdateProtocolFeeRewardAccumulation details
errDataNotFound
untyped stringValue
"[GNOSWAP-GOV_STAKER-001] requested data not found"
errInvalidAmount
untyped stringValue
"[GNOSWAP-GOV_STAKER-002] invalid amount"
errNoDelegatedAmount
untyped stringValue
"[GNOSWAP-GOV_STAKER-003] zero delegated amount"
errNotEnoughDelegated
untyped stringValue
"[GNOSWAP-GOV_STAKER-004] not enough delegated"
errInvalidAddress
untyped stringValue
"[GNOSWAP-GOV_STAKER-005] invalid address"
errNotEnoughBalance
untyped stringValue
"[GNOSWAP-GOV_STAKER-006] not enough balance"
errLessThanMinimum
untyped stringValue
"[GNOSWAP-GOV_STAKER-007] cannot delegate less than minimum amount"
errInvalidSnapshotTime
untyped stringValue
"[GNOSWAP-GOV_STAKER-008] invalid snapshot time"
errSameDelegatee
untyped stringValue
"[GNOSWAP-GOV_STAKER-009] cannot redelegate to same address"
errWithdrawNotCollectable
untyped stringValue
"[GNOSWAP-GOV_STAKER-010] withdraw is not collectable"
errAmountMustBeNonNegative
untyped stringValue
"[GNOSWAP-GOV_STAKER-011] amount must be non-negative"
errTotalStakedAmountOverflow
untyped stringValue
"[GNOSWAP-GOV_STAKER-012] total staked amount would overflow"
errRemoveAmountExceedsTotalStaked
untyped stringValue
"[GNOSWAP-GOV_STAKER-013] remove amount exceeds total staked amount"
errRemoveAmountExceedsStaked
untyped stringValue
"[GNOSWAP-GOV_STAKER-014] remove amount exceeds staked amount"
errAmountMustBePositive
untyped stringValue
"[GNOSWAP-GOV_STAKER-015] amount must be positive"
errRewardDebtUpdateRequired
untyped stringValue
"[GNOSWAP-GOV_STAKER-016] must update reward debt before claiming rewards"
errDelegatedAmountNegative
untyped stringValue
"[GNOSWAP-GOV_STAKER-017] delegated amount cannot be negative"
errUndelegationAmountNegative
untyped stringValue
"[GNOSWAP-GOV_STAKER-018] undelegation amount cannot be negative"
errDelegationNotFound
untyped stringValue
"[GNOSWAP-GOV_STAKER-019] delegation not found"
errInvalidAccrualEpoch
untyped stringValue
"[GNOSWAP-GOV_STAKER-020] accrual epoch is older than the epoch in force"
errInvalidAccrualBuckets
untyped stringValue
"[GNOSWAP-GOV_STAKER-021] invalid accrual buckets"
makeErrorWithDetails
func(message string, detail string) .uverse.error- OID
- 0b7b23…e234:27
makeErrorWithDetails details
cloneDelegationEntry
func(value interface{...}) interface{...}cloneDelegationEntry is the transformation for the delegation tree. Delegation is mutable and its setters are declared in /r/gnoswap/gov/staker, so an external holder of the stored pointer could write realm state through it.
- OID
- 0b7b23…e234:29
cloneDelegationEntry details
cloneDelegationIDsEntry
func(value interface{...}) interface{...}cloneDelegationIDsEntry is the transformation for a delegator's delegation tree. The stored value is a slice, so hand out a copy rather than letting a reader write through the shared backing array.
- OID
- 0b7b23…e234:31
cloneDelegationIDsEntry details
init.50
func()- OID
- 0b7b23…e234:32
init.50 details
registerGovStakerV1
func()- OID
- 0b7b23…e234:34
registerGovStakerV1 details
initStoreData
func(int, rlm .uverse.realm, store staker.IGovStakerStore) .uverse.error- OID
- 0b7b23…e234:35
initStoreData details
govStakerV1
typeValue
v1.govStakerV1
NewGovStakerV1
func(store staker.IGovStakerStore) staker.IGovStakerNewGovStakerV1 creates the governance staker v1 implementation backed by store. Parameters: - store: governance-staker storage interface used by the implementation. Returns: - staker.IGovStaker: governance staker API backed by store.
- OID
- 0b7b23…e234:36
NewGovStakerV1 details
LaunchpadProjectDepositsResolver
typeValue
v1.LaunchpadProjectDepositsResolver
NewLaunchpadProjectDepositsResolver
func(launchpadProjectDeposits *staker.LaunchpadProjectDeposits) *v1.LaunchpadProjectDepositsResolverNewLaunchpadProjectDepositsResolver wraps launchpad project deposit state. Parameters: - launchpadProjectDeposits: project deposit state to resolve and mutate Returns: - \*LaunchpadProjectDepositsResolver: resolver retaining the supplied deposit state pointer
- OID
- 0b7b23…e234:38
NewLaunchpadProjectDepositsResolver details
ProtocolFeeRewardManagerResolver
typeProtocolFeeRewardManagerResolver drives the ProtocolFeeRewardManager. Stake changes only move the epoch, the total stake history and the staker's own event list. Fees are folded into a token's accumulator when that token is collected, each accrual bucket against the total stake in force during its epoch.
Value
v1.ProtocolFeeRewardManagerResolver
NewProtocolFeeRewardManagerResolver
func(manager *staker.ProtocolFeeRewardManager) *v1.ProtocolFeeRewardManagerResolverNewProtocolFeeRewardManagerResolver wraps the shared protocol-fee reward manager. Parameters: - manager: Protocol-fee reward state to resolve and mutate. Returns: - \*ProtocolFeeRewardManagerResolver: resolver operating on manager's accounting state.
- OID
- 0b7b23…e234:40
NewProtocolFeeRewardManagerResolver details
maxInt64
func(a int64, b int64) int64- OID
- 0b7b23…e234:42
maxInt64 details
minInt64
func(a int64, b int64) int64- OID
- 0b7b23…e234:43
minInt64 details
ProtocolFeeRewardStateResolver
typeProtocolFeeRewardStateResolver settles one staker's protocol fee rewards. A staker's reward for a token is the sum, over the segments between their stake events, of the stake held during the segment times the growth of the token's accumulated fee per stake across it. Segments are folded in event order, so the work of settling a token is proportional to the staker's own stake changes since the token was last settled, never to the number of tokens.
Value
v1.ProtocolFeeRewardStateResolver
NewProtocolFeeRewardStateResolver
func(protocolFeeRewardState *staker.ProtocolFeeRewardState) *v1.ProtocolFeeRewardStateResolverNewProtocolFeeRewardStateResolver wraps one staker's protocol fee reward state with settlement operations. Parameters: - protocolFeeRewardState: staker reward state to resolve and mutate. Returns: - \*ProtocolFeeRewardStateResolver: resolver backed by protocolFeeRewardState.
- OID
- 0b7b23…e234:44
NewProtocolFeeRewardStateResolver details
protocolFeeAccumulatorView
typeprotocolFeeAccumulatorView reads a token accumulator as it stands, optionally extended in memory with buckets that are still pending on the protocol fee realm. The extension lets a query report what a collect would pay without folding anything.
Value
v1.protocolFeeAccumulatorView
protocolFeeTokenSettlement
typeprotocolFeeTokenSettlement is the in-memory working copy of a token's settlement state. It is written back only on a collect, so queries never touch storage.
Value
v1.protocolFeeTokenSettlement
closeOpenSegment
func(settlement *v1.protocolFeeTokenSettlement, view *v1.protocolFeeAccumulatorView)closeOpenSegment folds the open segment up to the accumulator's latest value. It may only be called once every stake event is settled, so that the open segment really ends at the present.
- OID
- 0b7b23…e234:46
closeOpenSegment details
takeReward
func(settlement *v1.protocolFeeTokenSettlement) int64takeReward removes the whole-unit part of the earned reward from the settlement and returns it. The sub-unit remainder stays earned so that no fee share is lost.
- OID
- 0b7b23…e234:47
takeReward details
segmentRewardX128
func(stakedAmount int64, startX128 *v1.Uint, endX128 *v1.Uint) *v1.UintsegmentRewardX128 returns stakedAmount times the accumulator growth across a segment.
- OID
- 0b7b23…e234:48
segmentRewardX128 details
transferToken
func(int, rlm .uverse.realm, tokenPath string, from .uverse.address, to .uverse.address, amount int64) .uverse.errortransferToken transfers tokens from the staker contract to a recipient address. transferToken handles token transfers for reward distribution. Non-crossing helper: takes \`\_ int, rlm realm\` so the realm token threaded in by the public reward-collection entry points reaches the underlying GRC-20 transfer without forcing each caller to recompute it.
- OID
- 0b7b23…e234:49
transferToken details
marshal
func(data *v0.Node) stringmarshal data to json string
- OID
- 0b7b23…e234:51
marshal details
getUint64FromTree
func(tree *v0.BPTree, key string) uint64getUint64FromTree returns the uint64 value from the tree
- OID
- 0b7b23…e234:53
getUint64FromTree details
updateUint64InTree
func(tree *v0.BPTree, key string, delta uint64, add bool) uint64updateUint64InTree updates the uint64 value in the tree
- OID
- 0b7b23…e234:54
updateUint64InTree details
milliToSec
func(ms int64) int64milliToSec converts milliseconds to seconds
- OID
- 0b7b23…e234:55
milliToSec details
userHistoryKeySeparator
untyped stringuserHistoryKeySeparator is chosen to be lexicographically smaller than any
Value
"|"
userHistoryKeySeparatorNextWord
stringuserHistoryKeySeparator is chosen to be lexicographically smaller than any
Value
"}"
userHistoryTimestampWidth
untyped bigintuserHistoryTimestampWidth is the zero-padded width that fits the maximum
Value
(20 <untyped> bigint)
makeUserHistoryKey
func(addrStr string, timestamp int64) stringmakeUserHistoryKey builds the composite key "addr|paddedTimestamp" used in the user delegation history BPTree.
- OID
- 0b7b23…e234:56
makeUserHistoryKey details
userHistoryKeyRange
func(addrStr string) (lo string, hi string)userHistoryKeyRange returns the half-open prefix range that covers all composite keys belonging to addrStr.
- OID
- 0b7b23…e234:57
userHistoryKeyRange details
padTimestamp
func(timestamp int64) stringpadTimestamp left-pads timestamp with zeros to userHistoryTimestampWidth so that lexicographic ordering of the resulting strings matches numeric order.
- OID
- 0b7b23…e234:58
padTimestamp details
parseUserHistoryKey
func(key string) (addrStr string, timestamp int64, ok bool)parseUserHistoryKey splits a composite key produced by makeUserHistoryKey back into its address and timestamp components.
- OID
- 0b7b23…e234:59