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

PoolAccessor

type

Value

staker.PoolAccessor

poolAccessor

type

Value

staker.poolAccessor

newPoolAccessor

func() staker.PoolAccessor
Open
OID
0742c3…b8af:3
newPoolAccessor details

Inspect func

EmissionAccessor

type

Value

staker.EmissionAccessor

emissionAccessor

type

Value

staker.emissionAccessor

newEmissionAccessor

func() staker.EmissionAccessor
Open
OID
0742c3…b8af:5
newEmissionAccessor details

Inspect func

NFTAccessor

type

Value

staker.NFTAccessor

gnftAccessor

type

Value

staker.gnftAccessor

newNFTAccessor

func() staker.NFTAccessor
Open
OID
0742c3…b8af:6
newNFTAccessor details

Inspect func

Counter

type

Value

staker.Counter

NewCounter

func() *staker.Counter
Open
OID
0742c3…b8af:7
NewCounter details

Inspect func

Deposit

type

Value

staker.Deposit

NewDeposit

func(owner .uverse.address, targetPoolPath string, liquidity *uint256.Uint, currentTime int64, tickLower int32, tickUpper int32, warmups []staker.Warmup) *staker.Deposit
Open
OID
0742c3…b8af:9
NewDeposit details

Inspect func

Warmup

type

Value

staker.Warmup

NewWarmup

func(timeDuration int64, nextWarmupTime int64, warmupRatio uint64) staker.Warmup
Open
OID
0742c3…b8af:11
NewWarmup details

Inspect func

DefaultWarmupTemplate

func() []staker.Warmup
Open
OID
0742c3…b8af:12
DefaultWarmupTemplate details

Inspect func

GNS_PATH

string

Value

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

WUGNOT_PATH

string

Value

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

DefaultAllowedTokens

func() []string
Open
OID
0742c3…b8af:13
DefaultAllowedTokens details

Inspect func

GetPool

func(poolPath string) *staker.Pool

GetPool returns a copy of the pool for the given path.

Open
OID
0742c3…b8af:14
GetPool details

Inspect func

GetIncentive

func(poolPath string, incentiveId string) *staker.ExternalIncentive

GetIncentive returns a copy of the incentive for the given pool and ID.

Open
OID
0742c3…b8af:16
GetIncentive details

Inspect func

GetDeposit

func(lpTokenId uint64) *staker.Deposit

GetDeposit returns a copy of the deposit for the given position ID.

Open
OID
0742c3…b8af:17
GetDeposit details

Inspect func

CollectableEmissionReward

func(positionId uint64) int64

CollectableEmissionReward returns the claimable internal reward amount.

Open
OID
0742c3…b8af:18
CollectableEmissionReward details

Inspect func

CollectableExternalIncentiveReward

func(positionId uint64, incentiveId string) int64

CollectableExternalIncentiveReward returns the claimable external reward amount.

Open
OID
0742c3…b8af:19
CollectableExternalIncentiveReward details

Inspect func

GetCreatedHeightOfIncentive

func(poolPath string, incentiveId string) int64

GetCreatedHeightOfIncentive returns the block height when an incentive was created.

Open
OID
0742c3…b8af:20
GetCreatedHeightOfIncentive details

Inspect func

GetIncentiveCreatedTimestamp

func(poolPath string, incentiveId string) int64

GetIncentiveCreatedTimestamp returns the creation timestamp of an incentive.

Open
OID
0742c3…b8af:21
GetIncentiveCreatedTimestamp details

Inspect func

GetIncentiveTotalRewardAmount

func(poolPath string, incentiveId string) int64

GetIncentiveTotalRewardAmount returns the total reward amount of an incentive.

Open
OID
0742c3…b8af:22
GetIncentiveTotalRewardAmount details

Inspect func

GetIncentiveDistributedRewardAmount

func(poolPath string, incentiveId string) int64

GetIncentiveDistributedRewardAmount returns the distributed reward amount of an incentive.

Open
OID
0742c3…b8af:23
GetIncentiveDistributedRewardAmount details

Inspect func

GetIncentiveRemainingRewardAmount

func(poolPath string, incentiveId string) int64

GetIncentiveRemainingRewardAmount returns the remaining reward amount of an incentive.

Open
OID
0742c3…b8af:24
GetIncentiveRemainingRewardAmount details

Inspect func

GetIncentiveAccumulatedPenaltyAmount

func(poolPath string, incentiveId string) int64

GetIncentiveAccumulatedPenaltyAmount returns the accumulated warmup penalty amount of an incentive.

Open
OID
0742c3…b8af:25
GetIncentiveAccumulatedPenaltyAmount details

Inspect func

GetIncentiveDepositGnsAmount

func(poolPath string, incentiveId string) int64

GetIncentiveDepositGnsAmount returns the deposited GNS amount of an incentive.

Open
OID
0742c3…b8af:26
GetIncentiveDepositGnsAmount details

Inspect func

GetIncentiveRefunded

func(poolPath string, incentiveId string) bool

GetIncentiveRefunded returns whether an incentive has been refunded.

Open
OID
0742c3…b8af:27
GetIncentiveRefunded details

Inspect func

IsIncentiveActive

func(poolPath string, incentiveId string) bool

IsIncentiveActive returns whether an incentive is active.

Open
OID
0742c3…b8af:28
IsIncentiveActive details

Inspect func

GetDepositExternalRewardLastCollectTimestamp

func(lpTokenId uint64, incentiveId string) int64

GetDepositExternalRewardLastCollectTimestamp returns the last external reward collection time for a position.

Open
OID
0742c3…b8af:29
GetDepositExternalRewardLastCollectTimestamp details

Inspect func

GetDepositGnsAmount

func() int64

GetDepositGnsAmount returns the required GNS deposit amount for staking.

Open
OID
0742c3…b8af:30
GetDepositGnsAmount details

Inspect func

GetDepositInternalRewardLastCollectTimestamp

func(lpTokenId uint64) int64

GetDepositInternalRewardLastCollectTimestamp returns the last internal reward collection time for a position.

Open
OID
0742c3…b8af:31
GetDepositInternalRewardLastCollectTimestamp details

Inspect func

GetDepositCollectedInternalReward

func(lpTokenId uint64) int64

GetDepositCollectedInternalReward returns the collected internal reward amount of a position.

Open
OID
0742c3…b8af:32
GetDepositCollectedInternalReward details

Inspect func

GetDepositCollectedExternalReward

func(lpTokenId uint64, incentiveId string) int64

GetDepositCollectedExternalReward returns the collected external reward amount of a position.

Open
OID
0742c3…b8af:33
GetDepositCollectedExternalReward details

Inspect func

GetDepositLiquidity

func(lpTokenId uint64) *uint256.Uint

GetDepositLiquidity returns the liquidity amount of a staked position.

Open
OID
0742c3…b8af:34
GetDepositLiquidity details

Inspect func

GetDepositLiquidityAsString

func(lpTokenId uint64) string

GetDepositLiquidityAsString returns the liquidity amount of a staked position as string.

Open
OID
0742c3…b8af:35
GetDepositLiquidityAsString details

Inspect func

GetDepositOwner

func(lpTokenId uint64) .uverse.address
Open
OID
0742c3…b8af:36
GetDepositOwner details

Inspect func

GetDepositStakeTime

func(lpTokenId uint64) int64

GetDepositStakeTime returns the staking duration of a position.

Open
OID
0742c3…b8af:37
GetDepositStakeTime details

Inspect func

GetDepositTargetPoolPath

func(lpTokenId uint64) string

GetDepositTargetPoolPath returns the pool path of a staked position.

Open
OID
0742c3…b8af:38
GetDepositTargetPoolPath details

Inspect func

GetDepositTickLower

func(lpTokenId uint64) int32

GetDepositTickLower returns the lower tick of a staked position.

Open
OID
0742c3…b8af:39
GetDepositTickLower details

Inspect func

GetDepositTickUpper

func(lpTokenId uint64) int32

GetDepositTickUpper returns the upper tick of a staked position.

Open
OID
0742c3…b8af:40
GetDepositTickUpper details

Inspect func

GetDepositWarmUp

func(lpTokenId uint64) []staker.Warmup

GetDepositWarmUp returns the warmup records of a staked position.

Open
OID
0742c3…b8af:41
GetDepositWarmUp details

Inspect func

GetDepositExternalIncentiveIdList

func(lpTokenId uint64) []string

GetDepositExternalIncentiveIdList returns external incentive IDs for a deposit.

Open
OID
0742c3…b8af:42
GetDepositExternalIncentiveIdList details

Inspect func

GetExternalIncentiveByPoolPath

func(poolPath string) []staker.ExternalIncentive

GetExternalIncentiveByPoolPath returns all external incentives for a pool.

Open
OID
0742c3…b8af:43
GetExternalIncentiveByPoolPath details

Inspect func

GetIncentiveEndTimestamp

func(poolPath string, incentiveId string) int64

GetIncentiveEndTimestamp returns the end timestamp of an incentive.

Open
OID
0742c3…b8af:44
GetIncentiveEndTimestamp details

Inspect func

GetIncentiveCreator

func(poolPath string, incentiveId string) .uverse.address
Open
OID
0742c3…b8af:45
GetIncentiveCreator details

Inspect func

GetIncentiveRewardAmount

func(poolPath string, incentiveId string) *uint256.Uint

GetIncentiveRewardAmount returns the total reward amount of an incentive.

Open
OID
0742c3…b8af:46
GetIncentiveRewardAmount details

Inspect func

GetIncentiveRewardAmountAsString

func(poolPath string, incentiveId string) string

GetIncentiveRewardAmountAsString returns the total reward amount of an incentive as string.

Open
OID
0742c3…b8af:47
GetIncentiveRewardAmountAsString details

Inspect func

GetIncentiveRewardPerSecondX128

func(poolPath string, incentiveId string) *uint256.Uint

GetIncentiveRewardPerSecondX128 returns the reward rate per second of an incentive, expressed as a Q128 fixed-point number (i.e. actual rate = value / 2^128). Callers needing an integer rate can right-shift the result by 128.

Open
OID
0742c3…b8af:48
GetIncentiveRewardPerSecondX128 details

Inspect func

GetIncentiveRewardToken

func(poolPath string, incentiveId string) string

GetIncentiveRewardToken returns the reward token of an incentive.

Open
OID
0742c3…b8af:49
GetIncentiveRewardToken details

Inspect func

GetIncentiveStartTimestamp

func(poolPath string, incentiveId string) int64

GetIncentiveStartTimestamp returns the start timestamp of an incentive.

Open
OID
0742c3…b8af:50
GetIncentiveStartTimestamp details

Inspect func

GetMinimumRewardAmount

func() int64

GetMinimumRewardAmount returns the minimum reward amount to distribute.

Open
OID
0742c3…b8af:51
GetMinimumRewardAmount details

Inspect func

GetMinimumRewardAmountForToken

func(tokenPath string) int64

GetMinimumRewardAmountForToken returns the minimum reward amount for a specific token.

Open
OID
0742c3…b8af:52
GetMinimumRewardAmountForToken details

Inspect func

GetPoolIncentiveIdList

func(poolPath string) []string

GetPoolIncentiveIdList returns all incentive IDs for a pool.

Open
OID
0742c3…b8af:53
GetPoolIncentiveIdList details

Inspect func

GetPoolStakedLiquidity

func(poolPath string) string

GetPoolStakedLiquidity returns the current total staked liquidity of a pool.

Open
OID
0742c3…b8af:54
GetPoolStakedLiquidity details

Inspect func

GetPoolsByTier

func(tier uint64) []string

GetPoolsByTier returns the pool list for a tier.

Open
OID
0742c3…b8af:55
GetPoolsByTier details

Inspect func

GetPoolReward

func(tier uint64) int64

GetPoolReward returns the reward amount for a tier.

Open
OID
0742c3…b8af:56
GetPoolReward details

Inspect func

GetPoolTier

func(poolPath string) uint64

GetPoolTier returns the tier of a pool.

Open
OID
0742c3…b8af:57
GetPoolTier details

Inspect func

GetPoolTierCount

func(tier uint64) uint64

GetPoolTierCount returns the number of pools in a tier.

Open
OID
0742c3…b8af:58
GetPoolTierCount details

Inspect func

GetPoolTierRatio

func(poolPath string) uint64

GetPoolTierRatio returns the reward ratio of a pool.

Open
OID
0742c3…b8af:59
GetPoolTierRatio details

Inspect func

GetSpecificTokenMinimumRewardAmount

func(tokenPath string) (int64, bool)

GetSpecificTokenMinimumRewardAmount returns the minimum reward amount for a specific token.

Open
OID
0742c3…b8af:60
GetSpecificTokenMinimumRewardAmount details

Inspect func

GetTargetPoolPathByIncentiveId

func(poolPath string, incentiveId string) string

GetTargetPoolPathByIncentiveId returns the pool path for an incentive ID.

Open
OID
0742c3…b8af:61
GetTargetPoolPathByIncentiveId details

Inspect func

GetUnstakingFee

func() uint64

GetUnstakingFee returns the unstaking fee percentage.

Open
OID
0742c3…b8af:62
GetUnstakingFee details

Inspect func

IsStaked

func(positionId uint64) bool

IsStaked returns whether a position is staked.

Open
OID
0742c3…b8af:63
IsStaked details

Inspect func

GetTotalEmissionSent

func() int64

GetTotalEmissionSent returns the total GNS emission sent.

Open
OID
0742c3…b8af:64
GetTotalEmissionSent details

Inspect func

GetAllowedTokens

func() []string

GetAllowedTokens returns the allowed external incentive tokens.

Open
OID
0742c3…b8af:65
GetAllowedTokens details

Inspect func

GetWarmupTemplate

func() []staker.Warmup

GetWarmupTemplate returns the current warmup template.

Open
OID
0742c3…b8af:66
GetWarmupTemplate details

Inspect func

GetPoolRewardCacheCount

func(poolPath string) uint64

GetPoolRewardCacheCount returns the number of reward cache entries for a pool.

Open
OID
0742c3…b8af:67
GetPoolRewardCacheCount details

Inspect func

GetPoolRewardCacheIDs

func(poolPath string, offset int, count int) []int64

GetPoolRewardCacheIDs returns a paginated list of reward cache timestamps for a pool.

Open
OID
0742c3…b8af:68
GetPoolRewardCacheIDs details

Inspect func

GetPoolRewardCache

func(poolPath string, timestamp uint64) int64

GetPoolRewardCache returns the reward cache value at a specific timestamp for a pool.

Open
OID
0742c3…b8af:69
GetPoolRewardCache details

Inspect func

GetPoolIncentiveCount

func(poolPath string) uint64

GetPoolIncentiveCount returns the number of incentives for a pool.

Open
OID
0742c3…b8af:70
GetPoolIncentiveCount details

Inspect func

GetPoolIncentiveIDs

func(poolPath string, offset int, count int) []string

GetPoolIncentiveIDs returns a paginated list of incentive IDs for a pool.

Open
OID
0742c3…b8af:71
GetPoolIncentiveIDs details

Inspect func

GetPoolGlobalRewardRatioAccumulationCount

func(poolPath string) uint64

GetPoolGlobalRewardRatioAccumulationCount returns the number of global reward ratio accumulation entries for a pool.

Open
OID
0742c3…b8af:72
GetPoolGlobalRewardRatioAccumulationCount details

Inspect func

GetPoolGlobalRewardRatioAccumulationIDs

func(poolPath string, offset int, count int) []uint64

GetPoolGlobalRewardRatioAccumulationIDs returns a paginated list of timestamps for global reward ratio accumulation entries.

Open
OID
0742c3…b8af:73
GetPoolGlobalRewardRatioAccumulationIDs details

Inspect func

GetPoolGlobalRewardRatioAccumulation

func(poolPath string, timestamp uint64) string

GetPoolGlobalRewardRatioAccumulation returns the global reward ratio accumulation at a specific timestamp for a pool.

Open
OID
0742c3…b8af:74
GetPoolGlobalRewardRatioAccumulation details

Inspect func

GetPoolHistoricalTickCount

func(poolPath string) uint64

GetPoolHistoricalTickCount returns the number of historical tick entries for a pool.

Open
OID
0742c3…b8af:75
GetPoolHistoricalTickCount details

Inspect func

GetPoolHistoricalTickIDs

func(poolPath string, offset int, count int) []int32

GetPoolHistoricalTickIDs returns a paginated list of historical tick values for a pool.

Open
OID
0742c3…b8af:76
GetPoolHistoricalTickIDs details

Inspect func

GetPoolHistoricalTick

func(poolPath string, tick uint64) int32

GetPoolHistoricalTick returns the historical tick at a specific timestamp for a pool.

Open
OID
0742c3…b8af:77
GetPoolHistoricalTick details

Inspect func

cloneStringSlice

func(src []string) []string
Open
OID
0742c3…b8af:78
cloneStringSlice details

Inspect func

cloneUint64Slice

func(src []uint64) []uint64
Open
OID
0742c3…b8af:80
cloneUint64Slice details

Inspect func

cloneInt64Slice

func(src []int64) []int64
Open
OID
0742c3…b8af:81
cloneInt64Slice details

Inspect func

cloneInt32Slice

func(src []int32) []int32
Open
OID
0742c3…b8af:82
cloneInt32Slice details

Inspect func

cloneStringInt64Map

func(src map[string]int64) map[string]int64
Open
OID
0742c3…b8af:83
cloneStringInt64Map details

Inspect func

cloneStringBoolMap

func(src map[string]bool) map[string]bool
Open
OID
0742c3…b8af:84
cloneStringBoolMap details

Inspect func

cloneExternalIncentives

func(src []staker.ExternalIncentive) []staker.ExternalIncentive
Open
OID
0742c3…b8af:85
cloneExternalIncentives details

Inspect func

cloneWarmups

func(warmups []staker.Warmup) []staker.Warmup
Open
OID
0742c3…b8af:86
cloneWarmups details

Inspect func

AllTierCount

untyped bigint

// 0, 1, 2, 3

Value

(4 <untyped> bigint)

Pool

type

Pool is a struct for storing an incentivized pool information Each pool stores Incentives and Ticks associated with it. Fields: - poolPath: The path of the pool. - currentStakedLiquidity: The current total staked liquidity of the in-range positions for the pool. Updated when tick cross happens or stake/unstake happens. Used to calculate the global reward ratio accumulation or decide whether to enter/exit unclaimable period. - lastUnclaimableTime: The time at which the unclaimable period started. Set to 0 when the pool is not in an unclaimable period. - unclaimableAcc: The accumulated undisributed unclaimable reward. Reset to 0 when processUnclaimableReward is called and sent to community pool. - rewardCache: The cached per-second reward emitted for this pool. Stores new entry only when the reward is changed. PoolTier.cacheReward() updates this. \- incentives: The external incentives associated with the pool. \- ticks: The Ticks associated with the pool. - globalRewardRatioAccumulation: Global ratio of Time / TotalStake accumulation(since the pool creation) Stores new entry only when tick cross or stake/unstake happens. It is used to calculate the reward for a staked position at certain time. - historicalTick: The historical tick for the pool at a given time. It does not reflect the exact tick at the timestamp, but it provides correct ordering for the staked position's ticks. Therefore, you should not compare it for equality, only for ordering. Set when tick cross happens or a new position is created.

Value

staker.Pool

NewPool

func(poolPath string, currentTime int64) *staker.Pool

NewPool creates a new pool with the given poolPath and currentHeight.

Open
OID
0742c3…b8af:87
NewPool details

Inspect func

Incentives

type

Incentives represents a collection of external incentives for a specific pool. Fields: - incentives: BPTree storing ExternalIncentive objects indexed by incentiveId The incentiveId serves as the key to efficiently lookup incentive details - targetPoolPath: String identifier for the pool this incentive collection belongs to Used to associate incentives with their corresponding liquidity pool - unclaimablePeriods: Tree storing periods when rewards cannot be claimed Maps start timestamp (key) to end timestamp (value) An end timestamp of 0 indicates an ongoing unclaimable period Used to track intervals when staking rewards are not claimable

Value

staker.Incentives

NewIncentives

func(targetPoolPath string) *staker.Incentives
Open
OID
0742c3…b8af:89
NewIncentives details

Inspect func

ExternalIncentive

type

Value

staker.ExternalIncentive

NewExternalIncentive

func(incentiveId string, targetPoolPath string, rewardToken string, rewardAmount int64, startTimestamp int64, endTimestamp int64, creator .uverse.address, depositGnsAmount int64, createdHeight int64, currentTime int64) *staker.ExternalIncentive

NewExternalIncentive creates a new external incentive

Open
OID
0742c3…b8af:90
NewExternalIncentive details

Inspect func

Ticks

type

Tick mapping for each pool

Value

staker.Ticks

Tick

type

Tick represents the state of a specific tick in a pool. Fields: - id (int32): The ID of the tick. - stakedLiquidityGross (\*u256.Uint): Total gross staked liquidity at this tick. - stakedLiquidityDelta (\*i256.Int): Net change in staked liquidity at this tick. - outsideAccumulation (\*UintTree): RewardRatioAccumulation outside the tick.

Value

staker.Tick

NewTick

func(tickId int32) *staker.Tick
Open
OID
0742c3…b8af:92
NewTick details

Inspect func

TierRatio

type

100%, 0%, 0% if no tier2 and tier3 80%, 0%, 20% if no tier2 70%, 30%, 0% if no tier3 50%, 30%, 20% if has tier2 and tier3

Value

staker.TierRatio

NewTierRatio

func(tier1 uint64, tier2 uint64, tier3 uint64) staker.TierRatio
Open
OID
0742c3…b8af:93
NewTierRatio details

Inspect func

SwapBatchProcessor

type

SwapBatchProcessor processes tick crosses in batch for a swap This processor accumulates all tick crosses that occur during a single swap and processes them together at the end, reducing redundant calculations and state updates that would occur with individual tick processing

Value

staker.SwapBatchProcessor

NewSwapBatchProcessor

func(poolPath string, pool *staker.Pool, timestamp int64) *staker.SwapBatchProcessor
Open
OID
0742c3…b8af:94
NewSwapBatchProcessor details

Inspect func

SwapTickCross

type

SwapTickCross stores information about a tick cross during a swap This struct is used to accumulate tick cross events during a single swap transaction for batch processing to optimize gas usage and computational efficiency

Value

staker.SwapTickCross

NewSwapTickCross

func(tickID int32, zeroForOne bool, delta *int256.Int) *staker.SwapTickCross
Open
OID
0742c3…b8af:95
NewSwapTickCross details

Inspect func

StakeToken

func(positionId uint64, referrer string) string

StakeToken stakes a position NFT to earn rewards. Parameters: - positionId: ID of the position to stake - referrer: referrer address for reward tracking Returns: - string: deposit ID

Open
OID
0742c3…b8af:96
StakeToken details

Inspect func

UnStakeToken

func(positionId uint64) string

UnStakeToken unstakes a position NFT and collects rewards. Parameters: - positionId: ID of the position to unstake Returns: - string: collected reward details

Open
OID
0742c3…b8af:98
UnStakeToken details

Inspect func

CollectReward

func(positionId uint64) (string, string, map[string]int64, map[string]int64)

CollectReward collects accumulated rewards from a staked position. Parameters: - positionId: ID of the staked position Returns: - string: pool path - string: staking details - map\[string]int64: internal rewards - map\[string]int64: external rewards

Open
OID
0742c3…b8af:99
CollectReward details

Inspect func

SetPoolTier

func(poolPath string, tier uint64)

SetPoolTier sets the reward tier for a pool.

Open
OID
0742c3…b8af:100
SetPoolTier details

Inspect func

ChangePoolTier

func(poolPath string, tier uint64)

ChangePoolTier changes the reward tier of a pool.

Open
OID
0742c3…b8af:101
ChangePoolTier details

Inspect func

RemovePoolTier

func(poolPath string)

RemovePoolTier removes a pool from the tier system.

Open
OID
0742c3…b8af:102
RemovePoolTier details

Inspect func

CreateExternalIncentive

func(targetPoolPath string, rewardToken string, rewardAmount int64, startTimestamp int64, endTimestamp int64)

CreateExternalIncentive creates an external reward incentive for a pool. Parameters: - targetPoolPath: pool to incentivize - rewardToken: token to use as reward - rewardAmount: total reward amount - startTimestamp: incentive start time - endTimestamp: incentive end time

Open
OID
0742c3…b8af:103
CreateExternalIncentive details

Inspect func

EndExternalIncentive

func(targetPoolPath string, incentiveId string, refundAddress .uverse.address)

EndExternalIncentive terminates an external incentive early.

Open
OID
0742c3…b8af:104
EndExternalIncentive details

Inspect func

CollectExternalIncentivePenalty

func(targetPoolPath string, incentiveId string, refundAddress .uverse.address) int64

CollectExternalIncentivePenalty collects accumulated warmup penalties for an ended incentive.

Open
OID
0742c3…b8af:105
CollectExternalIncentivePenalty details

Inspect func

AddToken

func(tokenPath string)

AddToken adds a token to the reward token whitelist.

Open
OID
0742c3…b8af:106
AddToken details

Inspect func

RemoveToken

func(tokenPath string)

RemoveToken removes a token from the reward token whitelist.

Open
OID
0742c3…b8af:107
RemoveToken details

Inspect func

SetWarmUp

func(pct int64, timeDuration int64)

SetWarmUp sets the warm-up period parameters for staking.

Open
OID
0742c3…b8af:108
SetWarmUp details

Inspect func

SetDepositGnsAmount

func(amount int64)

SetDepositGnsAmount sets the deposit GNS amount

Open
OID
0742c3…b8af:109
SetDepositGnsAmount details

Inspect func

SetMinimumRewardAmount

func(amount int64)

SetMinimumRewardAmount sets the minimum reward amount to distribute.

Open
OID
0742c3…b8af:110
SetMinimumRewardAmount details

Inspect func

SetTokenMinimumRewardAmount

func(paramsStr string)

SetTokenMinimumRewardAmount sets minimum reward amounts per token.

Open
OID
0742c3…b8af:111
SetTokenMinimumRewardAmount details

Inspect func

SetUnStakingFee

func(fee uint64)

SetUnStakingFee sets the unstaking fee percentage.

Open
OID
0742c3…b8af:112
SetUnStakingFee details

Inspect func

ErrSpoofedRealm

untyped string

Value

"rlm does not match the current crossing frame"

versionManager

*version_manager.versionManager
Open
OID
0742c3…b8af:145
versionManager details

Inspect pointer

initRegisterWritableContract

func()
Open
OID
0742c3…b8af:118
initRegisterWritableContract details

Inspect func

initializeDomainStore

func(int, rlm .uverse.realm, kvStore store.KVStore) interface{...}
Open
OID
0742c3…b8af:119
initializeDomainStore details

Inspect func

getImplementation

func() staker.IStaker
Open
OID
0742c3…b8af:120
getImplementation details

Inspect func

updateImplementation

func() .uverse.error
Open
OID
0742c3…b8af:121
updateImplementation details

Inspect func

StoreKey

type

Value

staker.StoreKey

StoreKeyDepositGnsAmount

staker.StoreKey

Value

<gnolang.StringValue>

StoreKeyMinimumRewardAmount

staker.StoreKey

Value

<gnolang.StringValue>

StoreKeyDeposits

staker.StoreKey

Value

<gnolang.StringValue>

StoreKeyExternalIncentives

staker.StoreKey

Value

<gnolang.StringValue>

StoreKeyTotalEmissionSent

staker.StoreKey

Value

<gnolang.StringValue>

StoreKeyAllowedTokens

staker.StoreKey

Value

<gnolang.StringValue>

StoreKeyIncentiveCounter

staker.StoreKey

Value

<gnolang.StringValue>

StoreKeyTokenSpecificMinimumRewards

staker.StoreKey

Value

<gnolang.StringValue>

StoreKeyUnstakingFee

staker.StoreKey

Value

<gnolang.StringValue>

StoreKeyPendingProtocolFees

staker.StoreKey

Value

<gnolang.StringValue>

StoreKeyPools

staker.StoreKey

Value

<gnolang.StringValue>

StoreKeyPoolTierMemberships

staker.StoreKey

Value

<gnolang.StringValue>

StoreKeyPoolTierRatio

staker.StoreKey

Value

<gnolang.StringValue>

StoreKeyPoolTierCounts

staker.StoreKey

Value

<gnolang.StringValue>

StoreKeyPoolTierLastRewardCacheTimestamp

staker.StoreKey

Value

<gnolang.StringValue>

StoreKeyPoolTierCurrentEmission

staker.StoreKey

Value

<gnolang.StringValue>

StoreKeyPoolTierGetEmission

staker.StoreKey

Value

<gnolang.StringValue>

StoreKeyPoolTierGetHalvingBlocksInRange

staker.StoreKey

Value

<gnolang.StringValue>

StoreKeyWarmupTemplate

staker.StoreKey

Value

<gnolang.StringValue>

StoreKeyCurrentSwapBatch

staker.StoreKey

Value

<gnolang.StringValue>

StoreKeyExternalIncentivesByCreationTime

staker.StoreKey

Value

<gnolang.StringValue>

stakerStore

type

Value

staker.stakerStore

NewStakerStore

func(kvStore store.KVStore) staker.IStakerStore

NewStakerStore creates a new staker store instance with the provided KV store. This function is used by the upgrade system to create storage instances for each implementation.

Open
OID
0742c3…b8af:122
NewStakerStore details

Inspect func

makeIncentiveID

func(creator .uverse.address, timestamp int64, index int64) string
Open
OID
0742c3…b8af:124
makeIncentiveID details

Inspect func

contains

func(items []string, item string) bool
Open
OID
0742c3…b8af:125
contains details

Inspect func

UintTree

type

UintTree is a wrapper around a B+ tree for storing block timestamps as strings. Since block timestamps are defined as int64, we take int64 and convert it to uint64 for the tree. Methods: - Get: Retrieves a value associated with a uint64 key. - Set: Stores a value with a uint64 key. - Has: Checks if a uint64 key exists in the tree. - Remove: Removes a uint64 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

NewBPTreeN

func(fanout int) *v0.BPTree

NewBPTreeN allocates a raw BP-tree under /r/gnoswap/staker's realm context (the realm that declares Pool/Deposit/ExternalIncentive). The tree's PkgID is therefore /r/gnoswap/staker, matching the domain values it stores, so tree.Set leaf-slot writes clear the readonly-taint gate regardless of which realm (staker/v1, mock) calls Set (borrow rule #2 borrows m.Realm to the tree's owning realm). Implementations and mocks must allocate trees that hold /r/gnoswap/staker-declared values through here rather than calling bptree.NewBPTreeN directly in their own realm.

Open
OID
0742c3…b8af:126
NewBPTreeN details

Inspect func

NewUintTree

func() *staker.UintTree

NewUintTree creates a new UintTree instance with default fanout 64.

Open
OID
0742c3…b8af:128
NewUintTree details

Inspect func

NewUintTreeN

func(fanout int) *staker.UintTree

NewUintTreeN creates a new UintTree instance with the specified fanout.

Open
OID
0742c3…b8af:129
NewUintTreeN details

Inspect func

EncodeUint

func(num uint64) string

EncodeUint converts a uint64 number into a zero-padded 20-character string. Parameters: - num (uint64): The number to encode. Returns: - string: A zero-padded string representation of the number. Example: Input: 12345 Output: "00000000000000012345"

Open
OID
0742c3…b8af:130
EncodeUint details

Inspect func

EncodeInt64

func(num int64) string
Open
OID
0742c3…b8af:131
EncodeInt64 details

Inspect func

DecodeUint

func(s string) uint64

DecodeUint converts a zero-padded string back into a uint64 number. Parameters: - s (string): The zero-padded string. Returns: - uint64: The decoded number. Panics: - If the string cannot be parsed into a uint64. Example: Input: "00000000000000012345" Output: 12345

Open
OID
0742c3…b8af:132
DecodeUint details

Inspect func

DecodeInt64

func(s string) int64
Open
OID
0742c3…b8af:133
DecodeInt64 details

Inspect func

EncodeInt

func(num int32) string

EncodeInt takes an int32 and returns a zero-padded decimal string with up to 10 digits for the absolute value. If the number is negative, the '-' sign comes first, followed by zeros, then digits.

Open
OID
0742c3…b8af:134
EncodeInt details

Inspect func

IStaker

type

Value

staker.IStaker

IStakerManager

type

Value

staker.IStakerManager

IStakerGetter

type

Value

staker.IStakerGetter

IStakerStore

type

Value

staker.IStakerStore

RegisterInitializer

func(initializer func(...))

RegisterInitializer registers a new staker implementation version. This function is called by each version (v1, v2, etc.) during initialization to register their implementation with the proxy system. The initializer function creates a new instance of the implementation using the provided stakerStore interface. Security: Only contracts within the domain path can register initializers. Each package path can only register once to prevent duplicate registrations.

Open
OID
0742c3…b8af:135
RegisterInitializer details

Inspect func

UpgradeImpl

func(packagePath string)

UpgradeImpl switches the active staker implementation to a different version. This function allows seamless upgrades from one version to another without data migration or downtime. Security: Only admin or governance can perform upgrades. The new implementation must have been previously registered via RegisterInitializer.

Open
OID
0742c3…b8af:137
UpgradeImpl details

Inspect func

GetImplementationPackagePath

func() string

GetImplementationPackagePath returns the package path of the currently active implementation.

Open
OID
0742c3…b8af:138
GetImplementationPackagePath details

Inspect func
PoolAccessor : type =staker.PoolAccessor
poolAccessor : type =staker.poolAccessor
newPoolAccessor : func() staker.PoolAccessor Inspect
EmissionAccessor : type =staker.EmissionAccessor
emissionAccessor : type =staker.emissionAccessor
newEmissionAccessor : func() staker.EmissionAccessor Inspect
NFTAccessor : type =staker.NFTAccessor
gnftAccessor : type =staker.gnftAccessor
newNFTAccessor : func() staker.NFTAccessor Inspect
Counter : type =staker.Counter
NewCounter : func() *staker.Counter Inspect
Deposit : type =staker.Deposit
NewDeposit : func(owner .uverse.address, targetPoolPath string, liquidity *uint256.Uint, currentTime int64, tickLower int32, tickUpper int32, warmups []staker.Warmup) *staker.Deposit Inspect
Warmup : type =staker.Warmup
NewWarmup : func(timeDuration int64, nextWarmupTime int64, warmupRatio uint64) staker.Warmup Inspect
DefaultWarmupTemplate : func() []staker.Warmup Inspect
GNS_PATH : string ="gno.land/r/gnoswap/gns.GNS"
WUGNOT_PATH : string ="gno.land/r/gnoland/wugnot.wugnot"
DefaultAllowedTokens : func() []string Inspect
GetPool : func(poolPath string) *staker.Pool Inspect
GetIncentive : func(poolPath string, incentiveId string) *staker.ExternalIncentive Inspect
GetDeposit : func(lpTokenId uint64) *staker.Deposit Inspect
CollectableEmissionReward : func(positionId uint64) int64 Inspect
CollectableExternalIncentiveReward : func(positionId uint64, incentiveId string) int64 Inspect
GetCreatedHeightOfIncentive : func(poolPath string, incentiveId string) int64 Inspect
GetIncentiveCreatedTimestamp : func(poolPath string, incentiveId string) int64 Inspect
GetIncentiveTotalRewardAmount : func(poolPath string, incentiveId string) int64 Inspect
GetIncentiveDistributedRewardAmount : func(poolPath string, incentiveId string) int64 Inspect
GetIncentiveRemainingRewardAmount : func(poolPath string, incentiveId string) int64 Inspect
GetIncentiveAccumulatedPenaltyAmount : func(poolPath string, incentiveId string) int64 Inspect
GetIncentiveDepositGnsAmount : func(poolPath string, incentiveId string) int64 Inspect
GetIncentiveRefunded : func(poolPath string, incentiveId string) bool Inspect
IsIncentiveActive : func(poolPath string, incentiveId string) bool Inspect
GetDepositExternalRewardLastCollectTimestamp : func(lpTokenId uint64, incentiveId string) int64 Inspect
GetDepositGnsAmount : func() int64 Inspect
GetDepositInternalRewardLastCollectTimestamp : func(lpTokenId uint64) int64 Inspect
GetDepositCollectedInternalReward : func(lpTokenId uint64) int64 Inspect
GetDepositCollectedExternalReward : func(lpTokenId uint64, incentiveId string) int64 Inspect
GetDepositLiquidity : func(lpTokenId uint64) *uint256.Uint Inspect
GetDepositLiquidityAsString : func(lpTokenId uint64) string Inspect
GetDepositOwner : func(lpTokenId uint64) .uverse.address Inspect
GetDepositStakeTime : func(lpTokenId uint64) int64 Inspect
GetDepositTargetPoolPath : func(lpTokenId uint64) string Inspect
GetDepositTickLower : func(lpTokenId uint64) int32 Inspect
GetDepositTickUpper : func(lpTokenId uint64) int32 Inspect
GetDepositWarmUp : func(lpTokenId uint64) []staker.Warmup Inspect
GetDepositExternalIncentiveIdList : func(lpTokenId uint64) []string Inspect
GetExternalIncentiveByPoolPath : func(poolPath string) []staker.ExternalIncentive Inspect
GetIncentiveEndTimestamp : func(poolPath string, incentiveId string) int64 Inspect
GetIncentiveCreator : func(poolPath string, incentiveId string) .uverse.address Inspect
GetIncentiveRewardAmount : func(poolPath string, incentiveId string) *uint256.Uint Inspect
GetIncentiveRewardAmountAsString : func(poolPath string, incentiveId string) string Inspect
GetIncentiveRewardPerSecondX128 : func(poolPath string, incentiveId string) *uint256.Uint Inspect
GetIncentiveRewardToken : func(poolPath string, incentiveId string) string Inspect
GetIncentiveStartTimestamp : func(poolPath string, incentiveId string) int64 Inspect
GetMinimumRewardAmount : func() int64 Inspect
GetMinimumRewardAmountForToken : func(tokenPath string) int64 Inspect
GetPoolIncentiveIdList : func(poolPath string) []string Inspect
GetPoolStakedLiquidity : func(poolPath string) string Inspect
GetPoolsByTier : func(tier uint64) []string Inspect
GetPoolReward : func(tier uint64) int64 Inspect
GetPoolTier : func(poolPath string) uint64 Inspect
GetPoolTierCount : func(tier uint64) uint64 Inspect
GetPoolTierRatio : func(poolPath string) uint64 Inspect
GetSpecificTokenMinimumRewardAmount : func(tokenPath string) (int64, bool) Inspect
GetTargetPoolPathByIncentiveId : func(poolPath string, incentiveId string) string Inspect
GetUnstakingFee : func() uint64 Inspect
IsStaked : func(positionId uint64) bool Inspect
GetTotalEmissionSent : func() int64 Inspect
GetAllowedTokens : func() []string Inspect
GetWarmupTemplate : func() []staker.Warmup Inspect
GetPoolRewardCacheCount : func(poolPath string) uint64 Inspect
GetPoolRewardCacheIDs : func(poolPath string, offset int, count int) []int64 Inspect
GetPoolRewardCache : func(poolPath string, timestamp uint64) int64 Inspect
GetPoolIncentiveCount : func(poolPath string) uint64 Inspect
GetPoolIncentiveIDs : func(poolPath string, offset int, count int) []string Inspect
GetPoolGlobalRewardRatioAccumulationCount : func(poolPath string) uint64 Inspect
GetPoolGlobalRewardRatioAccumulationIDs : func(poolPath string, offset int, count int) []uint64 Inspect
GetPoolGlobalRewardRatioAccumulation : func(poolPath string, timestamp uint64) string Inspect
GetPoolHistoricalTickCount : func(poolPath string) uint64 Inspect
GetPoolHistoricalTickIDs : func(poolPath string, offset int, count int) []int32 Inspect
GetPoolHistoricalTick : func(poolPath string, tick uint64) int32 Inspect
cloneStringSlice : func(src []string) []string Inspect
cloneUint64Slice : func(src []uint64) []uint64 Inspect
cloneInt64Slice : func(src []int64) []int64 Inspect
cloneInt32Slice : func(src []int32) []int32 Inspect
cloneStringInt64Map : func(src map[string]int64) map[string]int64 Inspect
cloneStringBoolMap : func(src map[string]bool) map[string]bool Inspect
cloneExternalIncentives : func(src []staker.ExternalIncentive) []staker.ExternalIncentive Inspect
cloneWarmups : func(warmups []staker.Warmup) []staker.Warmup Inspect
AllTierCount : untyped bigint =(4 <untyped> bigint)
Pool : type =staker.Pool
NewPool : func(poolPath string, currentTime int64) *staker.Pool Inspect
Incentives : type =staker.Incentives
NewIncentives : func(targetPoolPath string) *staker.Incentives Inspect
ExternalIncentive : type =staker.ExternalIncentive
NewExternalIncentive : func(incentiveId string, targetPoolPath string, rewardToken string, rewardAmount int64, startTimestamp int64, endTimestamp int64, creator .uverse.address, depositGnsAmount int64, createdHeight int64, currentTime int64) *staker.ExternalIncentive Inspect
Ticks : type =staker.Ticks
NewTicks : func() staker.Ticks Inspect
Tick : type =staker.Tick
NewTick : func(tickId int32) *staker.Tick Inspect
TierRatio : type =staker.TierRatio
NewTierRatio : func(tier1 uint64, tier2 uint64, tier3 uint64) staker.TierRatio Inspect
SwapBatchProcessor : type =staker.SwapBatchProcessor
NewSwapBatchProcessor : func(poolPath string, pool *staker.Pool, timestamp int64) *staker.SwapBatchProcessor Inspect
SwapTickCross : type =staker.SwapTickCross
NewSwapTickCross : func(tickID int32, zeroForOne bool, delta *int256.Int) *staker.SwapTickCross Inspect
StakeToken : func(positionId uint64, referrer string) string Inspect
UnStakeToken : func(positionId uint64) string Inspect
CollectReward : func(positionId uint64) (string, string, map[string]int64, map[string]int64) Inspect
SetPoolTier : func(poolPath string, tier uint64) Inspect
ChangePoolTier : func(poolPath string, tier uint64) Inspect
RemovePoolTier : func(poolPath string) Inspect
CreateExternalIncentive : func(targetPoolPath string, rewardToken string, rewardAmount int64, startTimestamp int64, endTimestamp int64) Inspect
EndExternalIncentive : func(targetPoolPath string, incentiveId string, refundAddress .uverse.address) Inspect
CollectExternalIncentivePenalty : func(targetPoolPath string, incentiveId string, refundAddress .uverse.address) int64 Inspect
AddToken : func(tokenPath string) Inspect
RemoveToken : func(tokenPath string) Inspect
SetWarmUp : func(pct int64, timeDuration int64) Inspect
SetDepositGnsAmount : func(amount int64) Inspect
SetMinimumRewardAmount : func(amount int64) Inspect
SetTokenMinimumRewardAmount : func(paramsStr string) Inspect
SetUnStakingFee : func(fee uint64) Inspect
ErrSpoofedRealm : untyped string ="rlm does not match the current crossing frame"
kvStore : *store.kvStore Inspect
versionManager : *version_manager.versionManager Inspect
implementation : *v1.stakerV1 Inspect
init.127 : func() Inspect
initRegisterWritableContract : func() Inspect
initializeDomainStore : func(int, rlm .uverse.realm, kvStore store.KVStore) interface{...} Inspect
getImplementation : func() staker.IStaker Inspect
updateImplementation : func() .uverse.error Inspect
StoreKey : type =staker.StoreKey
StoreKeyDepositGnsAmount : staker.StoreKey =<gnolang.StringValue>
StoreKeyMinimumRewardAmount : staker.StoreKey =<gnolang.StringValue>
StoreKeyDeposits : staker.StoreKey =<gnolang.StringValue>
StoreKeyExternalIncentives : staker.StoreKey =<gnolang.StringValue>
StoreKeyTotalEmissionSent : staker.StoreKey =<gnolang.StringValue>
StoreKeyAllowedTokens : staker.StoreKey =<gnolang.StringValue>
StoreKeyIncentiveCounter : staker.StoreKey =<gnolang.StringValue>
StoreKeyTokenSpecificMinimumRewards : staker.StoreKey =<gnolang.StringValue>
StoreKeyUnstakingFee : staker.StoreKey =<gnolang.StringValue>
StoreKeyPendingProtocolFees : staker.StoreKey =<gnolang.StringValue>
StoreKeyPools : staker.StoreKey =<gnolang.StringValue>
StoreKeyPoolTierMemberships : staker.StoreKey =<gnolang.StringValue>
StoreKeyPoolTierRatio : staker.StoreKey =<gnolang.StringValue>
StoreKeyPoolTierCounts : staker.StoreKey =<gnolang.StringValue>
StoreKeyPoolTierLastRewardCacheTimestamp : staker.StoreKey =<gnolang.StringValue>
StoreKeyPoolTierCurrentEmission : staker.StoreKey =<gnolang.StringValue>
StoreKeyPoolTierGetEmission : staker.StoreKey =<gnolang.StringValue>
StoreKeyPoolTierGetHalvingBlocksInRange : staker.StoreKey =<gnolang.StringValue>
StoreKeyWarmupTemplate : staker.StoreKey =<gnolang.StringValue>
StoreKeyCurrentSwapBatch : staker.StoreKey =<gnolang.StringValue>
StoreKeyExternalIncentivesByCreationTime : staker.StoreKey =<gnolang.StringValue>
stakerStore : type =staker.stakerStore
NewStakerStore : func(kvStore store.KVStore) staker.IStakerStore Inspect
makeIncentiveID : func(creator .uverse.address, timestamp int64, index int64) string Inspect
contains : func(items []string, item string) bool Inspect
UintTree : type =staker.UintTree
NewBPTreeN : func(fanout int) *v0.BPTree Inspect
NewUintTree : func() *staker.UintTree Inspect
NewUintTreeN : func(fanout int) *staker.UintTree Inspect
EncodeUint : func(num uint64) string Inspect
EncodeInt64 : func(num int64) string Inspect
DecodeUint : func(s string) uint64 Inspect
DecodeInt64 : func(s string) int64 Inspect
EncodeInt : func(num int32) string Inspect
IStaker : type =staker.IStaker
IStakerManager : type =staker.IStakerManager
IStakerGetter : type =staker.IStakerGetter
IStakerStore : type =staker.IStakerStore
RegisterInitializer : func(initializer func(...)) Inspect
UpgradeImpl : func(packagePath string) Inspect
GetImplementationPackagePath : func() string Inspect