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

v1 state

Back to all declarations

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

Open
OID
0b7b23…e234:3
assertIsValidDelegateAmount details

Inspect func

assertIsValidSnapshotTime

func(snapshotTime int64)
Open
OID
0b7b23…e234:5
assertIsValidSnapshotTime details

Inspect func

assertIsAvailableCleanupSnapshotTime

func(cleanupSnapshotTime int64)

assertIsAvailableCleanupSnapshotTime checks that no active proposals need

Open
OID
0b7b23…e234:6
assertIsAvailableCleanupSnapshotTime details

Inspect func

assertNoSameDelegatee

func(delegatee .uverse.address, newDelegatee .uverse.address)
Open
OID
0b7b23…e234:7
assertNoSameDelegatee details

Inspect func

assertNotImplementYet

func()
Open
OID
0b7b23…e234:8
assertNotImplementYet details

Inspect func

minimumAmount

untyped bigint

// 1 GNS

Value

(1000000 <untyped> bigint)

errCollectAmountExceedsCollectable

untyped string

Value

"amount to collect is greater than collectable amount"

DelegationResolver

type

Value

v1.DelegationResolver

NewDelegationResolver

func(delegation *staker.Delegation) *v1.DelegationResolver
Open
OID
0b7b23…e234:9
NewDelegationResolver details

Inspect func

addToCollectedAmount

func(collectedAmount int64, amount int64) (int64, .uverse.error)
Open
OID
0b7b23…e234:11
addToCollectedAmount details

Inspect func

NewDelegation

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

NewDelegation 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

Open
OID
0b7b23…e234:12
NewDelegation details

Inspect func

DelegationManagerResolver

type

Value

v1.DelegationManagerResolver

NewDelegationManagerResolver

func(delegationManager *staker.DelegationManager) *v1.DelegationManagerResolver
Open
OID
0b7b23…e234:13
NewDelegationManagerResolver details

Inspect func

DelegationWithdrawResolver

type

Value

v1.DelegationWithdrawResolver

NewDelegationWithdrawResolver

func(withdraw *staker.DelegationWithdraw) *v1.DelegationWithdrawResolver
Open
OID
0b7b23…e234:15
NewDelegationWithdrawResolver details

Inspect func

NewDelegationWithdraw

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

NewDelegationWithdraw 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

Open
OID
0b7b23…e234:17
NewDelegationWithdraw details

Inspect func

NewDelegationWithdrawWithoutLockup

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

NewDelegationWithdrawWithoutLockup 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

Open
OID
0b7b23…e234:18
NewDelegationWithdrawWithoutLockup details

Inspect func

EmissionRewardManagerResolver

type

Value

v1.EmissionRewardManagerResolver

NewEmissionRewardManagerResolver

func(emissionRewardManager *staker.EmissionRewardManager) *v1.EmissionRewardManagerResolver
Open
OID
0b7b23…e234:19
NewEmissionRewardManagerResolver details

Inspect func

EmissionRewardStateResolver

type

Value

v1.EmissionRewardStateResolver

NewEmissionRewardStateResolver

func(emissionRewardState *staker.EmissionRewardState) *v1.EmissionRewardStateResolver
Open
OID
0b7b23…e234:21
NewEmissionRewardStateResolver details

Inspect func

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.

Open
OID
0b7b23…e234:23
emitUpdateEmissionRewardAccumulation details

Inspect func

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.

Open
OID
0b7b23…e234:25
emitUpdateProtocolFeeRewardAccumulation details

Inspect func

errDataNotFound

untyped string

Value

"[GNOSWAP-GOV_STAKER-001] requested data not found"

errInvalidAmount

untyped string

Value

"[GNOSWAP-GOV_STAKER-002] invalid amount"

errNoDelegatedAmount

untyped string

Value

"[GNOSWAP-GOV_STAKER-003] zero delegated amount"

errNotEnoughDelegated

untyped string

Value

"[GNOSWAP-GOV_STAKER-004] not enough delegated"

errInvalidAddress

untyped string

Value

"[GNOSWAP-GOV_STAKER-005] invalid address"

errNotEnoughBalance

untyped string

Value

"[GNOSWAP-GOV_STAKER-006] not enough balance"

errLessThanMinimum

untyped string

Value

"[GNOSWAP-GOV_STAKER-007] cannot delegate less than minimum amount"

errInvalidSnapshotTime

untyped string

Value

"[GNOSWAP-GOV_STAKER-008] invalid snapshot time"

errSameDelegatee

untyped string

Value

"[GNOSWAP-GOV_STAKER-009] cannot redelegate to same address"

errWithdrawNotCollectable

untyped string

Value

"[GNOSWAP-GOV_STAKER-010] withdraw is not collectable"

errSpoofedRealm

untyped string

Value

"[GNOSWAP-GOV_STAKER-011] rlm does not match the current crossing frame"

makeErrorWithDetails

func(message string, detail string) .uverse.error
Open
OID
0b7b23…e234:26
makeErrorWithDetails details

Inspect func

registerGovStakerV1

func()
Open
OID
0b7b23…e234:30
registerGovStakerV1 details

Inspect func

initStoreData

func(int, rlm .uverse.realm, store staker.IGovStakerStore) .uverse.error
Open
OID
0b7b23…e234:31
initStoreData details

Inspect func

govStakerV1

type

Value

v1.govStakerV1

NewGovStakerV1

func(store staker.IGovStakerStore) staker.IGovStaker
Open
OID
0b7b23…e234:32
NewGovStakerV1 details

Inspect func

LaunchpadProjectDepositsResolver

type

Value

v1.LaunchpadProjectDepositsResolver

NewLaunchpadProjectDepositsResolver

func(launchpadProjectDeposits *staker.LaunchpadProjectDeposits) *v1.LaunchpadProjectDepositsResolver
Open
OID
0b7b23…e234:34
NewLaunchpadProjectDepositsResolver details

Inspect func

ProtocolFeeRewardManagerResolver

type

Value

v1.ProtocolFeeRewardManagerResolver

NewProtocolFeeRewardManagerResolver

func(manager *staker.ProtocolFeeRewardManager) *v1.ProtocolFeeRewardManagerResolver
Open
OID
0b7b23…e234:36
NewProtocolFeeRewardManagerResolver details

Inspect func

ProtocolFeeRewardStateResolver

type

Value

v1.ProtocolFeeRewardStateResolver

NewProtocolFeeRewardStateResolver

func(protocolFeeRewardState *staker.ProtocolFeeRewardState) *v1.ProtocolFeeRewardStateResolver
Open
OID
0b7b23…e234:38
NewProtocolFeeRewardStateResolver details

Inspect func

transferToken

func(int, rlm .uverse.realm, tokenPath string, from .uverse.address, to .uverse.address, amount int64) .uverse.error

transferToken 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.

Open
OID
0b7b23…e234:40
transferToken details

Inspect func

marshal

func(data *json.Node) string

marshal data to json string

Open
OID
0b7b23…e234:42
marshal details

Inspect func

getUint64FromTree

func(tree *v0.BPTree, key string) uint64

getUint64FromTree returns the uint64 value from the tree

Open
OID
0b7b23…e234:44
getUint64FromTree details

Inspect func

updateUint64InTree

func(tree *v0.BPTree, key string, delta uint64, add bool) uint64

updateUint64InTree updates the uint64 value in the tree

Open
OID
0b7b23…e234:45
updateUint64InTree details

Inspect func

milliToSec

func(ms int64) int64

milliToSec converts milliseconds to seconds

Open
OID
0b7b23…e234:46
milliToSec details

Inspect func

userHistoryKeySeparator

untyped string

userHistoryKeySeparator is chosen to be lexicographically smaller than any

Value

"|"

userHistoryKeySeparatorNextWord

string

userHistoryKeySeparator is chosen to be lexicographically smaller than any

Value

"}"

userHistoryTimestampWidth

untyped bigint

userHistoryTimestampWidth is the zero-padded width that fits the maximum

Value

(20 <untyped> bigint)

makeUserHistoryKey

func(addrStr string, timestamp int64) string

makeUserHistoryKey builds the composite key "addr|paddedTimestamp" used in the user delegation history BPTree.

Open
OID
0b7b23…e234:47
makeUserHistoryKey details

Inspect func

userHistoryKeyRange

func(addrStr string) (lo string, hi string)

userHistoryKeyRange returns the half-open prefix range that covers all composite keys belonging to addrStr.

Open
OID
0b7b23…e234:48
userHistoryKeyRange details

Inspect func

padTimestamp

func(timestamp int64) string

padTimestamp left-pads timestamp with zeros to userHistoryTimestampWidth so that lexicographic ordering of the resulting strings matches numeric order.

Open
OID
0b7b23…e234:49
padTimestamp details

Inspect func

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.

Open
OID
0b7b23…e234:50
parseUserHistoryKey details

Inspect func
assertIsValidDelegateAmount : func(amount int64) Inspect
assertIsValidSnapshotTime : func(snapshotTime int64) Inspect
assertIsAvailableCleanupSnapshotTime : func(cleanupSnapshotTime int64) Inspect
assertNoSameDelegatee : func(delegatee .uverse.address, newDelegatee .uverse.address) Inspect
assertNotImplementYet : func() Inspect
minimumAmount : untyped bigint =(1000000 <untyped> bigint)
errCollectAmountExceedsCollectable : untyped string ="amount to collect is greater than collectable amount"
DelegationResolver : type =v1.DelegationResolver
NewDelegationResolver : func(delegation *staker.Delegation) *v1.DelegationResolver Inspect
addToCollectedAmount : func(collectedAmount int64, amount int64) (int64, .uverse.error) Inspect
NewDelegation : func(id int64, delegateFrom .uverse.address, delegateTo .uverse.address, delegateAmount int64, createdHeight int64, createdAt int64) *staker.Delegation Inspect
DelegationManagerResolver : type =v1.DelegationManagerResolver
NewDelegationManagerResolver : func(delegationManager *staker.DelegationManager) *v1.DelegationManagerResolver Inspect
DelegationWithdrawResolver : type =v1.DelegationWithdrawResolver
NewDelegationWithdrawResolver : func(withdraw *staker.DelegationWithdraw) *v1.DelegationWithdrawResolver Inspect
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
EmissionRewardManagerResolver : type =v1.EmissionRewardManagerResolver
NewEmissionRewardManagerResolver : func(emissionRewardManager *staker.EmissionRewardManager) *v1.EmissionRewardManagerResolver Inspect
EmissionRewardStateResolver : type =v1.EmissionRewardStateResolver
NewEmissionRewardStateResolver : func(emissionRewardState *staker.EmissionRewardState) *v1.EmissionRewardStateResolver Inspect
emitUpdateEmissionRewardAccumulation : func(manager *staker.EmissionRewardManager) Inspect
emitUpdateProtocolFeeRewardAccumulation : func(manager *staker.ProtocolFeeRewardManager, distributedAmounts map[string]int64) Inspect
errDataNotFound : untyped string ="[GNOSWAP-GOV_STAKER-001] requested data not found"
errInvalidAmount : untyped string ="[GNOSWAP-GOV_STAKER-002] invalid amount"
errNoDelegatedAmount : untyped string ="[GNOSWAP-GOV_STAKER-003] zero delegated amount"
errNotEnoughDelegated : untyped string ="[GNOSWAP-GOV_STAKER-004] not enough delegated"
errInvalidAddress : untyped string ="[GNOSWAP-GOV_STAKER-005] invalid address"
errNotEnoughBalance : untyped string ="[GNOSWAP-GOV_STAKER-006] not enough balance"
errLessThanMinimum : untyped string ="[GNOSWAP-GOV_STAKER-007] cannot delegate less than minimum amount"
errInvalidSnapshotTime : untyped string ="[GNOSWAP-GOV_STAKER-008] invalid snapshot time"
errSameDelegatee : untyped string ="[GNOSWAP-GOV_STAKER-009] cannot redelegate to same address"
errWithdrawNotCollectable : untyped string ="[GNOSWAP-GOV_STAKER-010] withdraw is not collectable"
errSpoofedRealm : untyped string ="[GNOSWAP-GOV_STAKER-011] rlm does not match the current crossing frame"
makeErrorWithDetails : func(message string, detail string) .uverse.error Inspect
init.35 : func() Inspect
registerGovStakerV1 : func() Inspect
initStoreData : func(int, rlm .uverse.realm, store staker.IGovStakerStore) .uverse.error Inspect
govStakerV1 : type =v1.govStakerV1
NewGovStakerV1 : func(store staker.IGovStakerStore) staker.IGovStaker Inspect
LaunchpadProjectDepositsResolver : type =v1.LaunchpadProjectDepositsResolver
NewLaunchpadProjectDepositsResolver : func(launchpadProjectDeposits *staker.LaunchpadProjectDeposits) *v1.LaunchpadProjectDepositsResolver Inspect
ProtocolFeeRewardManagerResolver : type =v1.ProtocolFeeRewardManagerResolver
NewProtocolFeeRewardManagerResolver : func(manager *staker.ProtocolFeeRewardManager) *v1.ProtocolFeeRewardManagerResolver Inspect
ProtocolFeeRewardStateResolver : type =v1.ProtocolFeeRewardStateResolver
NewProtocolFeeRewardStateResolver : func(protocolFeeRewardState *staker.ProtocolFeeRewardState) *v1.ProtocolFeeRewardStateResolver Inspect
transferToken : func(int, rlm .uverse.realm, tokenPath string, from .uverse.address, to .uverse.address, amount int64) .uverse.error Inspect
marshal : func(data *json.Node) string Inspect
getUint64FromTree : func(tree *v0.BPTree, key string) uint64 Inspect
updateUint64InTree : func(tree *v0.BPTree, key string, delta uint64, add bool) uint64 Inspect
milliToSec : func(ms int64) int64 Inspect
userHistoryKeySeparator : untyped string ="|"
userHistoryKeySeparatorNextWord : string ="}"
userHistoryTimestampWidth : untyped bigint =(20 <untyped> bigint)
makeUserHistoryKey : func(addrStr string, timestamp int64) string Inspect
userHistoryKeyRange : func(addrStr string) (lo string, hi string) Inspect
padTimestamp : func(timestamp int64) string Inspect
parseUserHistoryKey : func(key string) (addrStr string, timestamp int64, ok bool) Inspect