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

TIMESTAMP_90DAYS

int64

Value

7776000

TIMESTAMP_180DAYS

int64

Value

15552000

TIMESTAMP_365DAYS

int64

Value

31536000

maxIncentiveStartDelay

time.Duration

Value

<zero>

MAX_UNIX_EPOCH_TIME

untyped bigint

// 9999-12-31 23:59:59

Value

(253402300799 <untyped> bigint)

maxUnstakingFee

uint64

// 10%

Value

1000

assertIsValidAmount

func(amount int64)

assertIsValidAmount ensures the amount is non-negative.

Open
OID
02d577…ffec:3
assertIsValidAmount details

Inspect func

assertIsValidRewardAmountFormat

func(rewardAmountStr string)

assertIsValidRewardAmountFormat ensures the reward amount string is formatted as "tokenPath:amount".

Open
OID
02d577…ffec:5
assertIsValidRewardAmountFormat details

Inspect func

assertIsDepositor

func(s *v1.stakerV1, caller .uverse.address, positionId uint64)

assertIsDepositor ensures the caller is the owner of the deposit.

Open
OID
02d577…ffec:6
assertIsDepositor details

Inspect func

assertIsIncentiveOfPool

func(s *v1.stakerV1, poolPath string, positionId uint64, incentiveId string)

assertIsIncentiveOfDeposit ensures the incentive exists and targets the pool the position is staked in, so a caller cannot ask a deposit to collect an incentive that can never pay it. assertIsIncentiveOfPool ensures the incentive targets the pool the position is staked in.

Open
OID
02d577…ffec:7
assertIsIncentiveOfPool details

Inspect func

assertHasNoExitCheckpoint

func(s *v1.stakerV1, positionId uint64)

assertHasNoExitCheckpoint ensures the position carries no reward from a previous stake. Collecting it here would smuggle an unbounded calculation into staking, and leaving it would let the next unstake overwrite the checkpoint.

Open
OID
02d577…ffec:8
assertHasNoExitCheckpoint details

Inspect func

assertHasNoUncollectedIncentive

func(s *v1.stakerV1, incentiveId string)

assertHasNoUncollectedIncentive ensures no unstaked position still owes a reward from this incentive, which has not been drawn down from it yet.

Open
OID
02d577…ffec:9
assertHasNoUncollectedIncentive details

Inspect func

assertIsNotStaked

func(s *v1.stakerV1, positionId uint64)

assertIsNotStaked ensures the position is not already staked.

Open
OID
02d577…ffec:10
assertIsNotStaked details

Inspect func

assertIsPoolExists

func(s *v1.stakerV1, poolPath string)

assertIsPoolExists ensures the pool exists.

Open
OID
02d577…ffec:11
assertIsPoolExists details

Inspect func

assertIsValidPoolTier

func(tier uint64)

assertIsValidPoolTier ensures the tier is within valid range.

Open
OID
02d577…ffec:12
assertIsValidPoolTier details

Inspect func

assertTier1HasSparePool

func(currentTier uint64, tier1Count uint64)

assertTier1HasSparePool ensures tier 1 keeps at least one pool after a tier change.

Open
OID
02d577…ffec:13
assertTier1HasSparePool details

Inspect func

assertIsGreaterThanMinimumRewardAmount

func(s *v1.stakerV1, rewardToken string, rewardAmount int64)

assertIsGreaterThanMinimumRewardAmount ensures the reward amount meets minimum requirements.

Open
OID
02d577…ffec:14
assertIsGreaterThanMinimumRewardAmount details

Inspect func

assertIsAllowedForExternalReward

func(s *v1.stakerV1, poolPath string, tokenPath string)

assertIsAllowedForExternalReward ensures the token is allowed for external rewards.

Open
OID
02d577…ffec:15
assertIsAllowedForExternalReward details

Inspect func

assertIsExternalRewardTokenAvailable

func(s *v1.stakerV1, poolPath string, tokenPath string, currentTime int64)

assertIsExternalRewardTokenAvailable ensures a pool has no unfinished incentive for the token.

Open
OID
02d577…ffec:16
assertIsExternalRewardTokenAvailable details

Inspect func

assertIsValidFeeRate

func(fee uint64)

assertIsValidFeeRate ensures the fee rate is within valid range (0-1000 basis points).

Open
OID
02d577…ffec:17
assertIsValidFeeRate details

Inspect func

assertIsValidIncentiveStartTime

func(startTimestamp int64)

assertIsValidIncentiveStartTime ensures the incentive starts at midnight no earlier than 24 hours after creation and no later than 7 days after the first eligible midnight.

Open
OID
02d577…ffec:18
assertIsValidIncentiveStartTime details

Inspect func

assertIsAdminGovernanceOrCreator

func(caller .uverse.address, creator .uverse.address)

assertIsAdminGovernanceOrCreator ensures the caller may act on an incentive: admin and governance are the protocol-level operators, and the creator is the address that funded the incentive in CreateExternalIncentive.

Open
OID
02d577…ffec:19
assertIsAdminGovernanceOrCreator details

Inspect func

assertIsNotStartedIncentive

func(incentiveResolver *v1.ExternalIncentiveResolver, currentTime int64)

assertIsNotStartedIncentive ensures the incentive can still be cancelled, i.e. it has not started and nothing has been distributed from it. Only such an incentive may be removed outright; anything that already emitted rewards has to be finalized through EndExternalIncentive so the refund accounting and the penalty balance stay reachable.

Open
OID
02d577…ffec:20
assertIsNotStartedIncentive details

Inspect func

getMinimumIncentiveStartTimestamp

func() int64

getMinimumIncentiveStartTimestamp returns after 24 hours from now.

Open
OID
02d577…ffec:21
getMinimumIncentiveStartTimestamp details

Inspect func

getMaximumIncentiveStartTimestamp

func() int64

getMaximumIncentiveStartTimestamp returns 7 days after the first midnight that satisfies the minimum 24-hour delay.

Open
OID
02d577…ffec:22
getMaximumIncentiveStartTimestamp details

Inspect func

assertIsValidIncentiveEndTime

func(endTimestamp int64)

assertIsValidIncentiveEndTime ensures the end timestamp is within valid epoch range.

Open
OID
02d577…ffec:23
assertIsValidIncentiveEndTime details

Inspect func

assertIsValidIncentiveDuration

func(externalDuration int64)

assertIsValidIncentiveDuration ensures the duration is 90, 180, or 365 days.

Open
OID
02d577…ffec:24
assertIsValidIncentiveDuration details

Inspect func

assertIsValidAddress

func(addr .uverse.address)

AssertIsValidAddress panics if the provided address is invalid.

Open
OID
02d577…ffec:25
assertIsValidAddress details

Inspect func

isMidnight

func(startTime time.Time) bool

isMidnight checks if a time represents midnight (00:00:00).

Open
OID
02d577…ffec:26
isMidnight details

Inspect func

assertIsPositionOwner

func(owner .uverse.address, caller .uverse.address)

assertIsPositionOwner validates that the caller has permission to operate the token.

Open
OID
02d577…ffec:27
assertIsPositionOwner details

Inspect func

Reward

type

Reward is a struct for storing reward for a position. Internal reward is the GNS reward, external reward is the reward for other incentives. Penalties are the amount that is deducted from the reward due to the position's warmup.

Value

v1.Reward

aggregateRewards

func(rewards []v1.Reward) v1.Reward

aggregateRewards sums the per-warmup rewards/penalties into a single Reward.

Open
OID
02d577…ffec:28
aggregateRewards details

Inspect func

calculatePositionRewardParam

type

calculatePositionRewardParam is a struct for calculating position reward

Value

v1.calculatePositionRewardParam

positionRewardUpdate

type

positionRewardUpdate carries the persisted-state changes produced (but not applied) by a calculation. They are applied by the update\* functions, so that only the collect path mutates state while the calculation stays pure.

Value

v1.positionRewardUpdate

positionRewardContext

type

positionRewardContext carries the per-position state that both the internal (GNS emission) and the external (incentive) reward calculations need. Resolving it once lets each path be calculated on its own without duplicating the deposit/pool/reward-state setup.

Value

v1.positionRewardContext

internalRewardSegment

type

internalRewardSegment is a \[start, end) span over which the per-second emission reward rate is constant.

Value

v1.internalRewardSegment

appendInternalRewardTailSegments

func(segments []v1.internalRewardSegment, poolTier *v1.PoolTier, poolPath string, startTime int64, endTime int64, baseReward int64, exit *staker.UnstakedPosition) ([]v1.internalRewardSegment, .uverse.error)

appendInternalRewardTailSegments appends the schedule for the tail \[startTime, endTime], where no persisted cache entry exists beyond startTime. Over this span tier/count are constant, so the rate changes only at halving boundaries.

Open
OID
02d577…ffec:30
appendInternalRewardTailSegments details

Inspect func

getInitialCollectTime

func(deposit *staker.Deposit, incentive *staker.ExternalIncentive) int64

getInitialCollectTime determines the initial collection time for an incentive by taking the maximum of the deposit's stake time and the incentive's start time. This ensures rewards are only calculated from when both conditions are met: - The position must be staked (deposit.stakeTime) - The incentive must be active (incentive.startTimestamp) This function is used for lazy initialization when a position collects from an incentive for the first time, avoiding the need to iterate through all deposits when a new incentive is created.

Open
OID
02d577…ffec:31
getInitialCollectTime details

Inspect func

GNS_TOKEN_KEY

string

Value

"gno.land/r/gnoswap/gns.GNS"

WUGNOT_TOKEN_KEY

string

Value

"gno.land/r/gnoland/wugnot.wugnot"

emitSetPoolTier

func(prevAddr string, prevRealm string, poolPath string, tier uint64, rewardPerSecond int64, tierRewards map[uint64]int64, counts [4]uint64, currentTime int64)
Open
OID
02d577…ffec:32
emitSetPoolTier details

Inspect func

errNoPermission

untyped string

Value

"[GNOSWAP-STAKER-001] caller has no permission"

errPoolNotFound

untyped string

Value

"[GNOSWAP-STAKER-002] pool not found"

errNotAvailableUpdateCollectTime

untyped string

Value

"[GNOSWAP-STAKER-003] not available to update collect time"

errInvalidInput

untyped string

Value

"[GNOSWAP-STAKER-004] invalid input data"

errInvalidUnstakingFee

untyped string

Value

"[GNOSWAP-STAKER-005] invalid unstaking fee"

errAlreadyStaked

untyped string

Value

"[GNOSWAP-STAKER-006] already staked position"

errNonIncentivizedPool

untyped string

Value

"[GNOSWAP-STAKER-007] pool is not incentivized"

errCannotEndIncentive

untyped string

Value

"[GNOSWAP-STAKER-008] cannot end incentive"

errInvalidIncentiveStartTime

untyped string

Value

"[GNOSWAP-STAKER-009] invalid incentive start time"

errDefaultExternalToken

untyped string

Value

"[GNOSWAP-STAKER-010] cannot delete default external token"

errInvalidPoolPath

untyped string

Value

"[GNOSWAP-STAKER-011] invalid pool path"

errInvalidPoolTier

untyped string

Value

"[GNOSWAP-STAKER-012] invalid pool tier"

errDataNotFound

untyped string

Value

"[GNOSWAP-STAKER-013] requested data not found"

errCalculationError

untyped string

Value

"[GNOSWAP-STAKER-014] unexpected calculation error"

errZeroLiquidity

untyped string

Value

"[GNOSWAP-STAKER-015] zero liquidity"

errInvalidIncentiveDuration

untyped string

Value

"[GNOSWAP-STAKER-016] invalid incentive duration"

errNotAllowedForExternalReward

untyped string

Value

"[GNOSWAP-STAKER-017] not allowed for external reward"

errIncentiveAlreadyExists

untyped string

Value

"[GNOSWAP-STAKER-018] incentive already exists"

errOverflow

untyped string

Value

"[GNOSWAP-STAKER-019] overflow"

errAddExistingToken

untyped string

Value

"[GNOSWAP-STAKER-020] cannot add existing token"

errInvalidAddress

untyped string

Value

"[GNOSWAP-STAKER-021] invalid address"

errIsNotEndedIncentive

untyped string

Value

"[GNOSWAP-STAKER-022] incentive is not ended yet"

errCannotCancelIncentive

untyped string

Value

"[GNOSWAP-STAKER-023] cannot cancel incentive"

errUncollectedPosition

untyped string

Value

"[GNOSWAP-STAKER-024] position has uncollected rewards"

errDeniedRewardToken

untyped string

Value

"[GNOSWAP-STAKER-025] denied reward token"

errCannotDenyDefaultToken

untyped string

Value

"[GNOSWAP-STAKER-026] cannot deny default token"

errInsufficientRewardTokenBalance

untyped string

Value

"[GNOSWAP-STAKER-027] insufficient reward token balance"

makeErrorWithDetails

func(message string, details string) .uverse.error
Open
OID
02d577…ffec:34
makeErrorWithDetails details

Inspect func

tickCrossEventInfo

type

Value

v1.tickCrossEventInfo

NewTickCrossEventInfo

func(tickID int32, stakedLiquidityGross *v1.Uint, stakedLiquidityDelta *v1.Int, outsideAccumulation *v1.Uint) *v1.tickCrossEventInfo

NewTickCrossEventInfo captures the values emitted when a swap crosses a tick. Parameters: - tickID: Tick index crossed during the swap. - stakedLiquidityGross: Total staked liquidity at the crossed tick. - stakedLiquidityDelta: Net staked liquidity change applied at the crossed tick. - outsideAccumulation: Reward-ratio accumulation outside the crossed tick. Returns: - info: Event payload containing the supplied tick-cross values.

Open
OID
02d577…ffec:36
NewTickCrossEventInfo details

Inspect func

checkCannotAddDefaultToken

func(tokenPath string) .uverse.error
Open
OID
02d577…ffec:38
checkCannotAddDefaultToken details

Inspect func

checkCannotRemoveDefaultToken

func(tokenPath string) .uverse.error
Open
OID
02d577…ffec:40
checkCannotRemoveDefaultToken details

Inspect func

checkCannotDenyDefaultToken

func(tokenPath string) .uverse.error
Open
OID
02d577…ffec:41
checkCannotDenyDefaultToken details

Inspect func

cloneExternalIncentiveEntry

func(value interface{...}) interface{...}

cloneExternalIncentiveEntry is the transformation for a pool's incentive tree. ExternalIncentive is mutable and its setters are declared in /r/gnoswap/staker, so an external holder of the stored pointer could write realm state through it.

Open
OID
02d577…ffec:42
cloneExternalIncentiveEntry details

Inspect func

rewardCacheEntry

func(value interface{...}) interface{...}

rewardCacheEntry, accumulationEntry, and historicalTickEntry are the transformations for the UintTree-backed views. Their values are immutable scalars, so nothing needs copying; they type-check instead, which keeps the filtering the replaced slice getters did when an entry failed its cast.

Open
OID
02d577…ffec:44
rewardCacheEntry details

Inspect func

accumulationEntry

func(value interface{...}) interface{...}
Open
OID
02d577…ffec:45
accumulationEntry details

Inspect func

historicalTickEntry

func(value interface{...}) interface{...}
Open
OID
02d577…ffec:46
historicalTickEntry details

Inspect func

defaultDepositGnsAmount

int64

Value

100000000000

defaultMinimumRewardAmount

int64

Value

1000000000

defaultUnstakingFee

uint64

// 1%

Value

100

initStoreData

func(int, rlm .uverse.realm, stakerStore staker.IStakerStore, emissionAccessor staker.EmissionAccessor) .uverse.error
Open
OID
02d577…ffec:50
initStoreData details

Inspect func

initializePoolTier

func(stakerStore staker.IStakerStore) (*v1.PoolTier, *v1.Pools, int64, map[uint64]int64)

initializePoolTier seeds the staker's pool tiering state on first init. The default pool is the canonical WUGNOT:GNS:3000 pool, sourced from the emission realm's DefaultInitialPoolTierPath constant so that the staker's tier-1 base pool is guaranteed to match the pool emission distributes to. When SetDistributionStartTime executes, emission distributes to this default pool and the staker uses the same path as the base tier-1 pool for reward accrual. Keeping both sides on emission's single constant structurally enforces that invariant and removes any risk of the two realms drifting apart on the canonical default pool identity.

Open
OID
02d577…ffec:51
initializePoolTier details

Inspect func

stakerV1

type

Value

v1.stakerV1

NewStakerV1

func(stakerStore staker.IStakerStore, poolAccessor staker.PoolAccessor, emissionAccessor staker.EmissionAccessor, nftAccessor staker.NFTAccessor) *v1.stakerV1

NewStakerV1 constructs a version 1 staker implementation backed by the supplied accessors. Parameters: - stakerStore: Persistent storage accessor for pools, deposits, incentives, tier state, and reward bookkeeping. - poolAccessor: Accessor for pool state used while updating and resolving staked positions. - emissionAccessor: Accessor for GNS emission data used to calculate rewards. - nftAccessor: Accessor for the position NFT ownership and token operations. Returns: - staker: New stakerV1 implementation wired to the supplied store and accessors.

Open
OID
02d577…ffec:52
NewStakerV1 details

Inspect func

NOT_EMISSION_TARGET_TIER

uint64

Value

0

pctToIndex

func(pct int64) int

pctToIndex converts percentage to warmup index.

Open
OID
02d577…ffec:54
pctToIndex details

Inspect func

IncentivesResolver

type

IncentivesResolver returns a resolver over the pool's external-incentive state. Returns: - resolver: Incentives resolver backed by this pool's incentive tree and unclaimable periods.

Value

v1.IncentivesResolver

NewIncentivesResolver

func(incentives *staker.Incentives) *v1.IncentivesResolver

NewIncentivesResolver wraps the persisted external-incentive state for lookup and mutation. Parameters: - incentives: External incentive state containing the incentive tree and unclaimable periods. Returns: - resolver: Resolver backed by incentives.

Open
OID
02d577…ffec:56
NewIncentivesResolver details

Inspect func

retrieveIncentive

func(tree *v0.BPTree, id string) (*staker.ExternalIncentive, bool)
Open
OID
02d577…ffec:58
retrieveIncentive details

Inspect func

calculateUnClaimableDuration

func(unclaimableStart int64, unclaimableEnd int64, incentiveStartTimestamp int64, incentiveEndTimestamp int64) int64

calculateUnClaimableDuration calculates the duration of overlap between an unclaimable period and incentive period

Open
OID
02d577…ffec:59
calculateUnClaimableDuration details

Inspect func

Pools

type

Pools represents the global pool storage

Value

v1.Pools

NewPools

func() *v1.Pools

NewPools creates an empty resolver for global pool storage. Returns: - pools: Pools resolver backed by a new B+ tree keyed by pool path.

Open
OID
02d577…ffec:63
NewPools details

Inspect func

PoolResolver

type

Value

v1.PoolResolver

NewPoolResolver

func(pool *staker.Pool) *v1.PoolResolver

NewPoolResolver wraps a pool's persisted reward, liquidity, tick, and incentive state for calculations. Parameters: - pool: Pool state to resolve. Returns: - resolver: Pool resolver backed by pool.

Open
OID
02d577…ffec:65
NewPoolResolver details

Inspect func

newPoolResolverWithExit

func(pool *staker.Pool, exit *staker.UnstakedPosition) *v1.PoolResolver

newPoolResolverWithExit builds a resolver that reads the pool through an exit checkpoint.

Open
OID
02d577…ffec:66
newPoolResolverWithExit details

Inspect func

RewardState

type

RewardState is a struct for storing the intermediate state for reward calculation.

Value

v1.RewardState

AllTierCount

untyped bigint

// 0, 1, 2, 3

Value

(4 <untyped> bigint)

Tier1

untyped bigint

Value

(1 <untyped> bigint)

Tier2

untyped bigint

Value

(2 <untyped> bigint)

Tier3

untyped bigint

Value

(3 <untyped> bigint)

TierRatioFromCounts

func(tier1Count uint64, tier2Count uint64, tier3Count uint64) staker.TierRatio

TierRatioFromCounts calculates the ratio distribution for each tier based on pool counts. Parameters: - tier1Count (uint64): Number of pools in tier 1. - tier2Count (uint64): Number of pools in tier 2. - tier3Count (uint64): Number of pools in tier 3. Returns: - TierRatio: The ratio distribution across tier 1, 2, and 3, scaled up by 100.

Open
OID
02d577…ffec:67
TierRatioFromCounts details

Inspect func

PoolTier

type

PoolTier manages pool counts, ratios, and rewards for different tiers. Fields: - membership: Tracks which tier a pool belongs to (poolPath -> blockNumber -> tier). Methods: - CurrentCount: Returns the current count of pools in a tier at a specific timestamp. - CurrentRatio: Returns the current ratio for a tier at a specific timestamp. - CurrentTier: Returns the tier of a specific pool at a given timestamp. - CurrentReward: Retrieves the reward for a tier at a specific timestamp. - changeTier: Updates the tier of a pool and recalculates ratios.

Value

v1.PoolTier

NewPoolTier

func(pools *v1.Pools, currentTime int64, initialPoolPath string, getEmission func(...), getHalvingBlocksInRange func(...)) *v1.PoolTier

NewPoolTier creates a new PoolTier instance with single initial 1 tier pool. Parameters: - pools: The pool collection. - currentTime: The current block time. - initialPoolPath: The path of the initial pool. - getEmission: A function that returns the current emission to the staker contract. - getHalvingBlocksInRange: A function that returns a list of halving blocks within the interval \[start, end) in ascending order. Returns: - \*PoolTier: The new PoolTier instance.

Open
OID
02d577…ffec:69
NewPoolTier details

Inspect func

NewPoolTierBy

func(membership *v0.BPTree, tierRatio staker.TierRatio, counts [4]uint64, lastRewardCacheTimestamp int64, currentEmission int64, getEmission func(...), getHalvingBlocksInRange func(...)) *v1.PoolTier

NewPoolTierBy reconstructs a PoolTier from persisted membership, ratios, counts, and callbacks. Parameters: - membership: Persisted pool-path-to-tier mapping. - tierRatio: Persisted reward-share ratio for each tier. - counts: Persisted number of pools in each tier index. - lastRewardCacheTimestamp: Timestamp through which reward caches have been materialized. - currentEmission: Emission rate currently used for reward accrual. - getEmission: Callback returning the current staker emission rate or an error. - getHalvingBlocksInRange: Callback returning halving timestamps and corresponding emissions in \[start, end). Returns: - \*PoolTier: Reconstructed tier manager using the supplied persisted state and callbacks.

Open
OID
02d577…ffec:70
NewPoolTierBy details

Inspect func

calculatePoolReward

func(emission int64, tierRatio int64, tierCount int64) (int64, .uverse.error)

calculatePoolReward calculates the reward for a pool based on the emission, tier ratio, and tier count. Parameters: - emission: The emission for the pool. - tierRatio: The tier ratio for the pool. - tierCount: The tier count for the pool. Returns: - int64: The reward for the pool. - error: An invalid calculation input.

Open
OID
02d577…ffec:71
calculatePoolReward details

Inspect func

TickResolver

type

Value

v1.TickResolver

NewTickResolver

func(tick *staker.Tick) *v1.TickResolver

NewTickResolver wraps a staker tick to expose reward-accumulation updates. Parameters: - tick: Staker tick whose state is resolved. Returns: - \*TickResolver: Resolver backed by tick.

Open
OID
02d577…ffec:72
NewTickResolver details

Inspect func

maxDurationOneYear

int64

// 31,536,000 seconds

Value

31536000

modifyWarmup

func(warmupTemplate []staker.Warmup, index int, timeDuration int64) []staker.Warmup

expected to be called by governance

Open
OID
02d577…ffec:74
modifyWarmup details

Inspect func

instantiateWarmup

func(warmupTemplate []staker.Warmup, currentTime int64) []staker.Warmup
Open
OID
02d577…ffec:76
instantiateWarmup details

Inspect func

applyWarmup

func(warmup staker.Warmup, poolReward int64, positionLiquidity *v1.Uint, stakedLiquidity *v1.Uint) (int64, int64)

applyWarmup applies the warmup to the rewards and calculate penalties.

Open
OID
02d577…ffec:77
applyWarmup details

Inspect func

safeAddTime

func(currentTime int64, duration int64) int64

safeAddTime performs safe addition with overflow protection

Open
OID
02d577…ffec:78
safeAddTime details

Inspect func

ZERO_ADDRESS

.uverse.address

Value

<gnolang.StringValue>

Deposits

type

Deposits manages all staked positions.

Value

v1.Deposits

NewDeposits

func() *v1.Deposits

NewDeposits creates a new Deposits instance. Returns: - deposits: Empty deposit collection backed by a position-ID tree.

Open
OID
02d577…ffec:79
NewDeposits details

Inspect func

retrieveDeposit

func(data interface{...}) *staker.Deposit

retrieveDeposit safely casts data to Deposit type.

Open
OID
02d577…ffec:81
retrieveDeposit details

Inspect func

ExternalIncentives

type

ExternalIncentives manages external incentive programs.

Value

v1.ExternalIncentives

NewExternalIncentives

func() *v1.ExternalIncentives

NewExternalIncentives creates a new ExternalIncentives instance. Returns: - incentives: Empty external-incentive collection backed by an incentive-ID tree.

Open
OID
02d577…ffec:82
NewExternalIncentives details

Inspect func

stakeScanLowerBound

func(currentTime int64) int64

stakeScanLowerBound returns the lower bound of the stake-time incentive scan window, clamped to 0. The start-time index encodes keys as unsigned, so a negative bound aborts when the chain time is under TIMESTAMP\_365DAYS.

Open
OID
02d577…ffec:83
stakeScanLowerBound details

Inspect func

collectContext

type

collectContext carries the values every reward delivery of one collect call shares: the deposit being collected, the collect timestamp and height, the caller identity used in events, and the accumulator snapshot emitted with every collect event. Resolving it once is what keeps a collect-everything call at a single snapshot: the emission delivery and each incentive delivery all read the same context.

Value

v1.collectContext

externalDeliveryOutcome

type

externalDeliveryOutcome is what deliverExternalIncentiveReward did with one incentive. The checkpoint bookkeeping keys off it instead of re-deriving the decision from incentive state, which a permissionless re-entering collect may already have changed.

Value

v1.externalDeliveryOutcome

externalDeliveryPaid

v1.externalDeliveryOutcome

Value

<zero>

externalDeliveryNothingOwed

v1.externalDeliveryOutcome

Value

<zero>

externalDeliveryAlreadyDelivered

v1.externalDeliveryOutcome

Value

<zero>

externalDeliveryDeferred

v1.externalDeliveryOutcome

Value

<zero>

externalDeliveryUnpayable

v1.externalDeliveryOutcome

Value

<zero>

collectTarget

type

collectTarget is the record a collect runs against: the live deposit while staked, or the exit checkpoint an unstake left behind.

Value

v1.collectTarget

tokenHasLiquidity

func(positionId uint64) .uverse.error

tokenHasLiquidity checks if the target positionId has non-zero liquidity

Open
OID
02d577…ffec:84
tokenHasLiquidity details

Inspect func

getLiquidity

func(positionId uint64) *v1.Uint
Open
OID
02d577…ffec:85
getLiquidity details

Inspect func

getTickOf

func(positionId uint64) (int32, int32)
Open
OID
02d577…ffec:86
getTickOf details

Inspect func

ExternalIncentiveResolver

type

Value

v1.ExternalIncentiveResolver

NewExternalIncentiveResolver

func(externalIncentive *staker.ExternalIncentive) *v1.ExternalIncentiveResolver

NewExternalIncentiveResolver wraps an external incentive with resolver operations. Parameters: - externalIncentive: External incentive whose timestamps and accounting state the resolver exposes. Returns: - resolver: Resolver backed by externalIncentive.

Open
OID
02d577…ffec:87
NewExternalIncentiveResolver details

Inspect func

DepositResolver

type

Value

v1.DepositResolver

NewDepositResolver

func(deposit *staker.Deposit) *v1.DepositResolver

NewDepositResolver wraps a deposit with reward-cursor and warmup resolution helpers. Parameters: - deposit: Deposit whose persisted reward state should be resolved. Returns: - resolver: Resolver backed by deposit.

Open
OID
02d577…ffec:89
NewDepositResolver details

Inspect func

UnstakedPositions

type

UnstakedPositions manages exit checkpoints.

Value

v1.UnstakedPositions

NewUnstakedPositions

func() *v1.UnstakedPositions

NewUnstakedPositions creates a new UnstakedPositions instance. Returns: - \*UnstakedPositions: Empty exit-checkpoint manager backed by a new B+ tree.

Open
OID
02d577…ffec:90
NewUnstakedPositions details

Inspect func

addUncollectedIncentiveCountTo

func(counts *v0.BPTree, incentiveId string, delta int64)
Open
OID
02d577…ffec:92
addUncollectedIncentiveCountTo details

Inspect func

poolPathDivide

func(poolPath string) (string, string, string)

poolPathDivide splits a pool path into token addresses and fee tier.

Open
OID
02d577…ffec:93
poolPathDivide details

Inspect func

positionIdFrom

func(positionId uint64) v0.TokenID

positionIdFrom converts a uint64 position ID to grc721.TokenID.

Open
OID
02d577…ffec:95
positionIdFrom details

Inspect func

contains

func(slice []string, item string) bool

contains checks if a string exists in a slice.

Open
OID
02d577…ffec:96
contains details

Inspect func
TIMESTAMP_90DAYS : int64 =7776000
TIMESTAMP_180DAYS : int64 =15552000
TIMESTAMP_365DAYS : int64 =31536000
maxIncentiveStartDelay : time.Duration =<zero>
MAX_UNIX_EPOCH_TIME : untyped bigint =(253402300799 <untyped> bigint)
maxUnstakingFee : uint64 =1000
assertIsValidAmount : func(amount int64) Inspect
assertIsValidRewardAmountFormat : func(rewardAmountStr string) Inspect
assertIsDepositor : func(s *v1.stakerV1, caller .uverse.address, positionId uint64) Inspect
assertIsIncentiveOfPool : func(s *v1.stakerV1, poolPath string, positionId uint64, incentiveId string) Inspect
assertHasNoExitCheckpoint : func(s *v1.stakerV1, positionId uint64) Inspect
assertHasNoUncollectedIncentive : func(s *v1.stakerV1, incentiveId string) Inspect
assertIsNotStaked : func(s *v1.stakerV1, positionId uint64) Inspect
assertIsPoolExists : func(s *v1.stakerV1, poolPath string) Inspect
assertIsValidPoolTier : func(tier uint64) Inspect
assertTier1HasSparePool : func(currentTier uint64, tier1Count uint64) Inspect
assertIsGreaterThanMinimumRewardAmount : func(s *v1.stakerV1, rewardToken string, rewardAmount int64) Inspect
assertIsAllowedForExternalReward : func(s *v1.stakerV1, poolPath string, tokenPath string) Inspect
assertIsExternalRewardTokenAvailable : func(s *v1.stakerV1, poolPath string, tokenPath string, currentTime int64) Inspect
assertIsValidFeeRate : func(fee uint64) Inspect
assertIsValidIncentiveStartTime : func(startTimestamp int64) Inspect
assertIsAdminGovernanceOrCreator : func(caller .uverse.address, creator .uverse.address) Inspect
assertIsNotStartedIncentive : func(incentiveResolver *v1.ExternalIncentiveResolver, currentTime int64) Inspect
getMinimumIncentiveStartTimestamp : func() int64 Inspect
getMaximumIncentiveStartTimestamp : func() int64 Inspect
assertIsValidIncentiveEndTime : func(endTimestamp int64) Inspect
assertIsValidIncentiveDuration : func(externalDuration int64) Inspect
assertIsValidAddress : func(addr .uverse.address) Inspect
isMidnight : func(startTime time.Time) bool Inspect
assertIsPositionOwner : func(owner .uverse.address, caller .uverse.address) Inspect
Reward : type =v1.Reward
aggregateRewards : func(rewards []v1.Reward) v1.Reward Inspect
calculatePositionRewardParam : type =v1.calculatePositionRewardParam
positionRewardUpdate : type =v1.positionRewardUpdate
positionRewardContext : type =v1.positionRewardContext
internalRewardSegment : type =v1.internalRewardSegment
appendInternalRewardTailSegments : func(segments []v1.internalRewardSegment, poolTier *v1.PoolTier, poolPath string, startTime int64, endTime int64, baseReward int64, exit *staker.UnstakedPosition) ([]v1.internalRewardSegment, .uverse.error) Inspect
getInitialCollectTime : func(deposit *staker.Deposit, incentive *staker.ExternalIncentive) int64 Inspect
GNS_TOKEN_KEY : string ="gno.land/r/gnoswap/gns.GNS"
WUGNOT_TOKEN_KEY : string ="gno.land/r/gnoland/wugnot.wugnot"
emitSetPoolTier : func(prevAddr string, prevRealm string, poolPath string, tier uint64, rewardPerSecond int64, tierRewards map[uint64]int64, counts [4]uint64, currentTime int64) Inspect
errNoPermission : untyped string ="[GNOSWAP-STAKER-001] caller has no permission"
errPoolNotFound : untyped string ="[GNOSWAP-STAKER-002] pool not found"
errNotAvailableUpdateCollectTime : untyped string ="[GNOSWAP-STAKER-003] not available to update collect time"
errInvalidInput : untyped string ="[GNOSWAP-STAKER-004] invalid input data"
errInvalidUnstakingFee : untyped string ="[GNOSWAP-STAKER-005] invalid unstaking fee"
errAlreadyStaked : untyped string ="[GNOSWAP-STAKER-006] already staked position"
errNonIncentivizedPool : untyped string ="[GNOSWAP-STAKER-007] pool is not incentivized"
errCannotEndIncentive : untyped string ="[GNOSWAP-STAKER-008] cannot end incentive"
errInvalidIncentiveStartTime : untyped string ="[GNOSWAP-STAKER-009] invalid incentive start time"
errDefaultExternalToken : untyped string ="[GNOSWAP-STAKER-010] cannot delete default external token"
errInvalidPoolPath : untyped string ="[GNOSWAP-STAKER-011] invalid pool path"
errInvalidPoolTier : untyped string ="[GNOSWAP-STAKER-012] invalid pool tier"
errDataNotFound : untyped string ="[GNOSWAP-STAKER-013] requested data not found"
errCalculationError : untyped string ="[GNOSWAP-STAKER-014] unexpected calculation error"
errZeroLiquidity : untyped string ="[GNOSWAP-STAKER-015] zero liquidity"
errInvalidIncentiveDuration : untyped string ="[GNOSWAP-STAKER-016] invalid incentive duration"
errNotAllowedForExternalReward : untyped string ="[GNOSWAP-STAKER-017] not allowed for external reward"
errIncentiveAlreadyExists : untyped string ="[GNOSWAP-STAKER-018] incentive already exists"
errOverflow : untyped string ="[GNOSWAP-STAKER-019] overflow"
errAddExistingToken : untyped string ="[GNOSWAP-STAKER-020] cannot add existing token"
errInvalidAddress : untyped string ="[GNOSWAP-STAKER-021] invalid address"
errIsNotEndedIncentive : untyped string ="[GNOSWAP-STAKER-022] incentive is not ended yet"
errCannotCancelIncentive : untyped string ="[GNOSWAP-STAKER-023] cannot cancel incentive"
errUncollectedPosition : untyped string ="[GNOSWAP-STAKER-024] position has uncollected rewards"
errDeniedRewardToken : untyped string ="[GNOSWAP-STAKER-025] denied reward token"
errCannotDenyDefaultToken : untyped string ="[GNOSWAP-STAKER-026] cannot deny default token"
errInsufficientRewardTokenBalance : untyped string ="[GNOSWAP-STAKER-027] insufficient reward token balance"
makeErrorWithDetails : func(message string, details string) .uverse.error Inspect
tickCrossEventInfo : type =v1.tickCrossEventInfo
NewTickCrossEventInfo : func(tickID int32, stakedLiquidityGross *v1.Uint, stakedLiquidityDelta *v1.Int, outsideAccumulation *v1.Uint) *v1.tickCrossEventInfo Inspect
checkCannotAddDefaultToken : func(tokenPath string) .uverse.error Inspect
checkCannotRemoveDefaultToken : func(tokenPath string) .uverse.error Inspect
checkCannotDenyDefaultToken : func(tokenPath string) .uverse.error Inspect
cloneExternalIncentiveEntry : func(value interface{...}) interface{...} Inspect
rewardCacheEntry : func(value interface{...}) interface{...} Inspect
accumulationEntry : func(value interface{...}) interface{...} Inspect
historicalTickEntry : func(value interface{...}) interface{...} Inspect
defaultDepositGnsAmount : int64 =100000000000
defaultMinimumRewardAmount : int64 =1000000000
defaultUnstakingFee : uint64 =100
init.81 : func() Inspect
registerStakerV1 : func() Inspect
initStoreData : func(int, rlm .uverse.realm, stakerStore staker.IStakerStore, emissionAccessor staker.EmissionAccessor) .uverse.error Inspect
initializePoolTier : func(stakerStore staker.IStakerStore) (*v1.PoolTier, *v1.Pools, int64, map[uint64]int64) Inspect
stakerV1 : type =v1.stakerV1
NewStakerV1 : func(stakerStore staker.IStakerStore, poolAccessor staker.PoolAccessor, emissionAccessor staker.EmissionAccessor, nftAccessor staker.NFTAccessor) *v1.stakerV1 Inspect
NOT_EMISSION_TARGET_TIER : uint64 =0
pctToIndex : func(pct int64) int Inspect
IncentivesResolver : type =v1.IncentivesResolver
NewIncentivesResolver : func(incentives *staker.Incentives) *v1.IncentivesResolver Inspect
retrieveIncentive : func(tree *v0.BPTree, id string) (*staker.ExternalIncentive, bool) Inspect
calculateUnClaimableDuration : func(unclaimableStart int64, unclaimableEnd int64, incentiveStartTimestamp int64, incentiveEndTimestamp int64) int64 Inspect
q128 : *v1.Uint Inspect
Pools : type =v1.Pools
NewPools : func() *v1.Pools Inspect
PoolResolver : type =v1.PoolResolver
NewPoolResolver : func(pool *staker.Pool) *v1.PoolResolver Inspect
newPoolResolverWithExit : func(pool *staker.Pool, exit *staker.UnstakedPosition) *v1.PoolResolver Inspect
RewardState : type =v1.RewardState
AllTierCount : untyped bigint =(4 <untyped> bigint)
Tier1 : untyped bigint =(1 <untyped> bigint)
Tier2 : untyped bigint =(2 <untyped> bigint)
Tier3 : untyped bigint =(3 <untyped> bigint)
TierRatioFromCounts : func(tier1Count uint64, tier2Count uint64, tier3Count uint64) staker.TierRatio Inspect
PoolTier : type =v1.PoolTier
NewPoolTier : func(pools *v1.Pools, currentTime int64, initialPoolPath string, getEmission func(...), getHalvingBlocksInRange func(...)) *v1.PoolTier Inspect
NewPoolTierBy : func(membership *v0.BPTree, tierRatio staker.TierRatio, counts [4]uint64, lastRewardCacheTimestamp int64, currentEmission int64, getEmission func(...), getHalvingBlocksInRange func(...)) *v1.PoolTier Inspect
calculatePoolReward : func(emission int64, tierRatio int64, tierCount int64) (int64, .uverse.error) Inspect
TickResolver : type =v1.TickResolver
NewTickResolver : func(tick *staker.Tick) *v1.TickResolver Inspect
maxDurationOneYear : int64 =31536000
modifyWarmup : func(warmupTemplate []staker.Warmup, index int, timeDuration int64) []staker.Warmup Inspect
instantiateWarmup : func(warmupTemplate []staker.Warmup, currentTime int64) []staker.Warmup Inspect
applyWarmup : func(warmup staker.Warmup, poolReward int64, positionLiquidity *v1.Uint, stakedLiquidity *v1.Uint) (int64, int64) Inspect
safeAddTime : func(currentTime int64, duration int64) int64 Inspect
ZERO_ADDRESS : .uverse.address =<gnolang.StringValue>
Deposits : type =v1.Deposits
NewDeposits : func() *v1.Deposits Inspect
retrieveDeposit : func(data interface{...}) *staker.Deposit Inspect
ExternalIncentives : type =v1.ExternalIncentives
NewExternalIncentives : func() *v1.ExternalIncentives Inspect
stakeScanLowerBound : func(currentTime int64) int64 Inspect
collectContext : type =v1.collectContext
externalDeliveryOutcome : type =v1.externalDeliveryOutcome
externalDeliveryPaid : v1.externalDeliveryOutcome =<zero>
externalDeliveryNothingOwed : v1.externalDeliveryOutcome =<zero>
externalDeliveryAlreadyDelivered : v1.externalDeliveryOutcome =<zero>
externalDeliveryDeferred : v1.externalDeliveryOutcome =<zero>
externalDeliveryUnpayable : v1.externalDeliveryOutcome =<zero>
collectTarget : type =v1.collectTarget
tokenHasLiquidity : func(positionId uint64) .uverse.error Inspect
getLiquidity : func(positionId uint64) *v1.Uint Inspect
getTickOf : func(positionId uint64) (int32, int32) Inspect
ExternalIncentiveResolver : type =v1.ExternalIncentiveResolver
NewExternalIncentiveResolver : func(externalIncentive *staker.ExternalIncentive) *v1.ExternalIncentiveResolver Inspect
DepositResolver : type =v1.DepositResolver
NewDepositResolver : func(deposit *staker.Deposit) *v1.DepositResolver Inspect
UnstakedPositions : type =v1.UnstakedPositions
NewUnstakedPositions : func() *v1.UnstakedPositions Inspect
addUncollectedIncentiveCountTo : func(counts *v0.BPTree, incentiveId string, delta int64) Inspect
poolPathDivide : func(poolPath string) (string, string, string) Inspect
positionIdFrom : func(positionId uint64) v0.TokenID Inspect
contains : func(slice []string, item string) bool Inspect