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)
errCollectAmountExceedsCollectable
untyped stringValue
"amount to collect is greater than collectable amount"
DelegationResolver
typeValue
v1.DelegationResolver
NewDelegationResolver
func(delegation *staker.Delegation) *v1.DelegationResolver- 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.DelegationManagerResolver- OID
- 0b7b23…e234:13
NewDelegationManagerResolver details
DelegationWithdrawResolver
typeValue
v1.DelegationWithdrawResolver
NewDelegationWithdrawResolver
func(withdraw *staker.DelegationWithdraw) *v1.DelegationWithdrawResolver- 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 collected
- OID
- 0b7b23…e234:18
NewDelegationWithdrawWithoutLockup details
EmissionRewardManagerResolver
typeValue
v1.EmissionRewardManagerResolver
NewEmissionRewardManagerResolver
func(emissionRewardManager *staker.EmissionRewardManager) *v1.EmissionRewardManagerResolver- OID
- 0b7b23…e234:19
NewEmissionRewardManagerResolver details
EmissionRewardStateResolver
typeValue
v1.EmissionRewardStateResolver
NewEmissionRewardStateResolver
func(emissionRewardState *staker.EmissionRewardState) *v1.EmissionRewardStateResolver- 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
emitUpdateProtocolFeeRewardAccumulation
func(manager *staker.ProtocolFeeRewardManager, distributedAmounts map[string]int64)emitUpdateProtocolFeeRewardAccumulation emits the persisted per-token protocol fee reward accumulation state for every distributed token. Like the emission variant it must be emitted after every path that calls updateAccumulatedProtocolFeeX128PerStake (add/remove/claim). protocolFeeAmount and the accumulator are read from the manager's persisted state so the emitted tuple stays internally consistent.
- OID
- 0b7b23…e234:25
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"
errSpoofedRealm
untyped stringValue
"[GNOSWAP-GOV_STAKER-011] rlm does not match the current crossing frame"
makeErrorWithDetails
func(message string, detail string) .uverse.error- OID
- 0b7b23…e234:26
makeErrorWithDetails details
init.35
func()- OID
- 0b7b23…e234:28
init.35 details
registerGovStakerV1
func()- OID
- 0b7b23…e234:30
registerGovStakerV1 details
initStoreData
func(int, rlm .uverse.realm, store staker.IGovStakerStore) .uverse.error- OID
- 0b7b23…e234:31
initStoreData details
govStakerV1
typeValue
v1.govStakerV1
NewGovStakerV1
func(store staker.IGovStakerStore) staker.IGovStaker- OID
- 0b7b23…e234:32
NewGovStakerV1 details
LaunchpadProjectDepositsResolver
typeValue
v1.LaunchpadProjectDepositsResolver
NewLaunchpadProjectDepositsResolver
func(launchpadProjectDeposits *staker.LaunchpadProjectDeposits) *v1.LaunchpadProjectDepositsResolver- OID
- 0b7b23…e234:34
NewLaunchpadProjectDepositsResolver details
ProtocolFeeRewardManagerResolver
typeValue
v1.ProtocolFeeRewardManagerResolver
NewProtocolFeeRewardManagerResolver
func(manager *staker.ProtocolFeeRewardManager) *v1.ProtocolFeeRewardManagerResolver- OID
- 0b7b23…e234:36
NewProtocolFeeRewardManagerResolver details
ProtocolFeeRewardStateResolver
typeValue
v1.ProtocolFeeRewardStateResolver
NewProtocolFeeRewardStateResolver
func(protocolFeeRewardState *staker.ProtocolFeeRewardState) *v1.ProtocolFeeRewardStateResolver- OID
- 0b7b23…e234:38
NewProtocolFeeRewardStateResolver 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:40
transferToken details
marshal
func(data *json.Node) stringmarshal data to json string
- OID
- 0b7b23…e234:42
marshal details
getUint64FromTree
func(tree *v0.BPTree, key string) uint64getUint64FromTree returns the uint64 value from the tree
- OID
- 0b7b23…e234:44
getUint64FromTree details
updateUint64InTree
func(tree *v0.BPTree, key string, delta uint64, add bool) uint64updateUint64InTree updates the uint64 value in the tree
- OID
- 0b7b23…e234:45
updateUint64InTree details
milliToSec
func(ms int64) int64milliToSec converts milliseconds to seconds
- OID
- 0b7b23…e234:46
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:47
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:48
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:49
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:50