assertDefaultInitialPoolExists
func()- OID
- 0e7aa4…52b8:3
assertDefaultInitialPoolExists details
validateDistributionTarget
func(target int) .uverse.errorvalidateDistributionTarget returns an error if the given distribution target is invalid.
- OID
- 0e7aa4…52b8:5
validateDistributionTarget details
assertValidDistributionTarget
func(target int)assertValidDistributionTarget panics if the given distribution target is invalid. Kept for internal invariant checks.
- OID
- 0e7aa4…52b8:6
assertValidDistributionTarget details
assertValidDistributionPct
func(liquidityStakerPct int64, devOpsPct int64, communityPoolPct int64, govStakerPct int64)assertValidDistributionPct ensures the sum of all distribution percentages equals 10000 (100%). Panics if the sum does not equal exactly 10000 basis points.
- OID
- 0e7aa4…52b8:7
assertValidDistributionPct details
LIQUIDITY_STAKER
intValue
1
DEVOPS
intValue
2
COMMUNITY_POOL
intValue
3
GOV_STAKER
intValue
4
distributionBpsPct
map[int]int64- OID
- 0e7aa4…52b8:75
distributionBpsPct details
distributedToStaker
int64// can be cleared by staker contract
Value
1392695809969
distributedToDevOps
int64Value
371385548952
distributedToCommunityPool
int64Value
92846386778
distributedToGovStaker
int64// can be cleared by governance staker
Value
0
accuDistributedToStaker
int64Value
1392695809969
accuDistributedToDevOps
int64Value
371385548952
accuDistributedToCommunityPool
int64Value
92846386778
accuDistributedToGovStaker
int64Value
0
init.17
func()- OID
- 0e7aa4…52b8:17
init.17 details
ChangeDistributionPct
func(liquidityStakerPct int64, devOpsPct int64, communityPoolPct int64, govStakerPct int64)ChangeDistributionPct changes distribution percentages for emission targets. This function redistributes how newly minted GNS tokens are allocated across protocol components. Before applying new ratios, it distributes any accumulated emissions using the current ratios, ensuring emissions are distributed according to the ratios in effect when they were generated. This prevents retroactive application of new ratios to past emissions. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. - liquidityStakerPct: percentage for liquidity stakers in basis points (100 = 1%, 10000 = 100%). - devOpsPct: percentage for DevOps in basis points (100 = 1%, 10000 = 100%). - communityPoolPct: percentage for the community pool in basis points (100 = 1%, 10000 = 100%). - govStakerPct: percentage for governance stakers in basis points (100 = 1%, 10000 = 100%). Requirements: - Percentages must sum to exactly 10000 (100%). - Each percentage must be between 0 and 10000 inclusive. Example: ChangeDistributionPct( 7000, // 70% to liquidity stakers 2000, // 20% to devops 1000, // 10% to community pool 0, // 0% to governance stakers ) Only callable by admin or governance.
- OID
- 0e7aa4…52b8:19
ChangeDistributionPct details
changeDistributionPcts
func(liquidityStakerPct int64, devOpsPct int64, communityPoolPct int64, govStakerPct int64)changeDistributionPcts updates the distribution percentages for all targets.
- OID
- 0e7aa4…52b8:20
changeDistributionPcts details
calculateDistributableAmounts
func(amount int64) (map[int]int64, int64)- OID
- 0e7aa4…52b8:21
calculateDistributableAmounts details
calculateAmount
func(amount int64, bptPct int64) int64calculateAmount converts basis points to actual token amount.
- OID
- 0e7aa4…52b8:22
calculateAmount details
applyDistribution
func(targets map[int]int64) (map[.uverse.address]int64, .uverse.error)- OID
- 0e7aa4…52b8:23
applyDistribution details
transferToTarget
func(int, rlm .uverse.realm, targets map[.uverse.address]int64) .uverse.error- OID
- 0e7aa4…52b8:24
transferToTarget details
GetDistributionBpsPct
func(target int) (int64, .uverse.error)GetDistributionBpsPct returns the configured distribution percentage in basis points for a target. Parameters: - target: distribution target constant whose configured share is queried. Returns: - pct: configured target share in basis points (100 = 1%, 10000 = 100%). - error: nil when the target exists in the initialized map; otherwise an invalid-target error.
- OID
- 0e7aa4…52b8:25
GetDistributionBpsPct details
GetDistributedToStaker
func() int64GetDistributedToStaker returns the pending GNS amount allocated to liquidity stakers. Returns: - amount: pending liquidity-staker allocation in GNS base units since the last clear.
- OID
- 0e7aa4…52b8:26
GetDistributedToStaker details
GetDistributedToDevOps
func() int64GetDistributedToDevOps returns the GNS amount currently accumulated for DevOps. Returns: - amount: accumulated DevOps allocation in GNS base units.
- OID
- 0e7aa4…52b8:27
GetDistributedToDevOps details
GetDistributedToCommunityPool
func() int64GetDistributedToCommunityPool returns the GNS amount currently accumulated for the community pool. Returns: - amount: accumulated community-pool allocation in GNS base units.
- OID
- 0e7aa4…52b8:28
GetDistributedToCommunityPool details
GetDistributedToGovStaker
func() int64GetDistributedToGovStaker returns the pending GNS amount allocated to governance stakers. Returns: - amount: pending governance-staker allocation in GNS base units since the last clear.
- OID
- 0e7aa4…52b8:29
GetDistributedToGovStaker details
AccumulateDistributedInfo
func() (toStaker int64, toDevOps int64, toCommunityPool int64, toGovStaker int64)AccumulateDistributedInfo returns the current pending allocation for every distribution target. Returns: - toStaker: pending GNS allocation for liquidity stakers, in token base units. - toDevOps: accumulated GNS allocation for DevOps, in token base units. - toCommunityPool: accumulated GNS allocation for the community pool, in token base units. - toGovStaker: pending GNS allocation for governance stakers, in token base units.
- OID
- 0e7aa4…52b8:30
AccumulateDistributedInfo details
GetAccuDistributedToStaker
func() int64GetAccuDistributedToStaker returns the total historical GNS amount allocated to liquidity stakers. Returns: - amount: cumulative liquidity-staker allocation in GNS base units; this value is not cleared.
- OID
- 0e7aa4…52b8:31
GetAccuDistributedToStaker details
GetAccuDistributedToDevOps
func() int64GetAccuDistributedToDevOps returns the total historical GNS amount allocated to DevOps. Returns: - amount: cumulative DevOps allocation in GNS base units; this value is not cleared.
- OID
- 0e7aa4…52b8:32
GetAccuDistributedToDevOps details
GetAccuDistributedToCommunityPool
func() int64GetAccuDistributedToCommunityPool returns the total historical GNS amount allocated to the community pool. Returns: - amount: cumulative community-pool allocation in GNS base units; this value is not cleared.
- OID
- 0e7aa4…52b8:33
GetAccuDistributedToCommunityPool details
GetAccuDistributedToGovStaker
func() int64GetAccuDistributedToGovStaker returns the total historical GNS amount allocated to governance stakers. Returns: - amount: cumulative governance-staker allocation in GNS base units; this value is not cleared.
- OID
- 0e7aa4…52b8:34
GetAccuDistributedToGovStaker details
GetEmissionAmountPerSecondBy
func(timestamp int64, distributionPct int64) int64GetEmissionAmountPerSecondBy returns the GNS emission rate per second for a timestamp and target share. Parameters: - timestamp: Unix timestamp at which the base emission rate is queried. - distributionPct: target share in basis points, from 0 through 10000 inclusive. Returns: - amountPerSecond: target's GNS emission rate in token base units per second, or zero outside the schedule.
- OID
- 0e7aa4…52b8:35
GetEmissionAmountPerSecondBy details
GetStakerEmissionAmountPerSecond
func() (int64, .uverse.error)GetStakerEmissionAmountPerSecond returns the current GNS emission rate allocated to liquidity stakers. Returns: - amountPerSecond: current liquidity-staker emission rate in GNS base units per second. - error: nil when the liquidity-staker distribution share is available; otherwise the target lookup error.
- OID
- 0e7aa4…52b8:36
GetStakerEmissionAmountPerSecond details
GetStakerEmissionAmountPerSecondInRange
func(start int64, end int64) ([]int64, []int64, .uverse.error)GetStakerEmissionAmountPerSecondInRange returns liquidity-staker emission-rate change points in a time range. Parameters: - start: inclusive start Unix timestamp for the range. - end: inclusive end Unix timestamp for the range. Returns: - timestamps: ordered timestamps in the range where the base emission rate changes. - amountsPerSecond: liquidity-staker GNS rates corresponding to timestamps, in token base units per second. - error: nil when the liquidity-staker distribution share is available; otherwise the target lookup error.
- OID
- 0e7aa4…52b8:37
GetStakerEmissionAmountPerSecondInRange details
ClearDistributedToStaker
func()ClearDistributedToStaker resets the pending distribution amount for liquidity stakers. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. Only callable by staker contract.
- OID
- 0e7aa4…52b8:38
ClearDistributedToStaker details
ClearDistributedToGovStaker
func()ClearDistributedToGovStaker resets the pending distribution amount for governance stakers. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. Only callable by governance staker contract.
- OID
- 0e7aa4…52b8:39
ClearDistributedToGovStaker details
setDistributionBpsPct
func(target int, pct int64)setDistributionBpsPct changes percentage of each target for how much GNS it will get by emission. Creates new map if nil.
- OID
- 0e7aa4…52b8:40
setDistributionBpsPct details
targetToStr
func(target int) stringtargetToStr converts target constant to string representation.
- OID
- 0e7aa4…52b8:41
targetToStr details
totalDistributionDuration
untyped bigint// 12 years
Value
(378432000 <untyped> bigint)
DefaultInitialPoolTierPath
untyped stringValue
"gno.land/r/gnoland/wugnot.wugnot:gno.land/r/gnoswap/gns.GNS:3000"
leftGNSAmount
int64Value
2
lastExecutedTimestamp
int64Value
1789825066
emissionAddr
.uverse.addressValue
<gnolang.StringValue>
distributionStartTimestamp
int64Value
1789564800
onDistributionPctChangeCallback
func(emissionAmountPerSecond int64)- OID
- 0742c3…b8af:253
onDistributionPctChangeCallback details
defaultInitialPoolChecker
func(poolPath string) bool- OID
- 0fe078…3476:150
defaultInitialPoolChecker details
init.49
func()- OID
- 0e7aa4…52b8:48
init.49 details
setLeftGNSAmount
func(amount int64)setLeftGNSAmount updates the undistributed GNS token amount
- OID
- 0e7aa4…52b8:50
setLeftGNSAmount details
setLastExecutedTimestamp
func(timestamp int64)setLastExecutedTimestamp updates the timestamp of the last emission distribution execution.
- OID
- 0e7aa4…52b8:51
setLastExecutedTimestamp details
MintAndDistributeGns
func() (int64, bool)MintAndDistributeGns mints and distributes GNS tokens according to the emission schedule. This function is called automatically by protocol contracts during user interactions to trigger periodic GNS emission. It mints new tokens based on elapsed time since last distribution and distributes them to predefined targets (staker, devops, etc.). Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. Returns: - distributedAmount: total amount of GNS distributed in this call - success: false only when emission is halted; true when processing completes, even if no tokens are distributed Note: Distribution only occurs if start timestamp is set and reached. Any undistributed tokens from previous calls are carried forward.
- OID
- 0e7aa4…52b8:52
MintAndDistributeGns details
SetDistributionStartTime
func(startTimestamp int64)SetDistributionStartTime sets the timestamp when emission distribution starts. This function controls when GNS emission begins. Before the configured timestamp is reached, an admin or governance caller may reschedule it. Once the timestamp is reached, the start time is immutable. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. - startTimestamp: positive future Unix timestamp when emission should begin. Requirements: - Must be called before distribution starts. - Timestamp must be in the future and leave room for the 12-year schedule. Effects: - Sets global distribution start time. - Initializes GNS emission state if not already started. - Emission begins automatically when timestamp is reached. Only callable by admin or governance.
- OID
- 0e7aa4…52b8:53
SetDistributionStartTime details
SetOnDistributionPctChangeCallback
func(callback func(...))SetOnDistributionPctChangeCallback registers the optional callback invoked when distribution percentages change. A nil callback clears the registration. This allows external contracts (like staker) to update their internal caches when governance or admin changes emission rates. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. - callback: nil to clear the callback, or a function receiving its callback realm context and the current staker GNS emission rate per second; a nonnil callback is invoked immediately after registration.
- OID
- 0e7aa4…52b8:54
SetOnDistributionPctChangeCallback details
SetDefaultInitialPoolChecker
func(checker func(...))SetDefaultInitialPoolChecker registers the callback that verifies the canonical default initial pool exists before emission starts. The checker receives the pool path as a parameter so emission owns the canonical path policy (DefaultInitialPoolTierPath) while pool supplies only the generic "does this pool exist" capability. Parameters: - cur: Current realm context; callers use cross(cur) when crossing into this realm. - checker: nonnil function returning true when the supplied pool path exists; it is called with DefaultInitialPoolTierPath and nil causes a panic. Only callable by the pool contract.
- OID
- 0e7aa4…52b8:55
SetDefaultInitialPoolChecker details
errInvalidEmissionTarget
untyped stringValue
"[GNOSWAP-EMISSION-001] invalid emission target"
errInvalidEmissionPct
untyped stringValue
"[GNOSWAP-EMISSION-002] invalid emission percentage"
errDuplicateTarget
untyped stringValue
"[GNOSWAP-EMISSION-003] duplicate emission target"
errDistributionAddressNotFound
untyped stringValue
"[GNOSWAP-EMISSION-004] distribution address not found"
errInvalidEmissionStart
untyped stringValue
"[GNOSWAP-EMISSION-005] invalid emission start"
makeErrorWithDetails
func(message string, detail string) .uverse.errormakeErrorWithDetails creates a new error by combining a base error with additional details.
- OID
- 0e7aa4…52b8:56
makeErrorWithDetails details
GetLeftGNSAmount
func() int64GetLeftGNSAmount returns the amount of undistributed GNS tokens from previous distributions. Returns: - amount: undistributed GNS amount
- OID
- 0e7aa4…52b8:58
GetLeftGNSAmount details
GetDistributionStartTimestamp
func() int64GetDistributionStartTimestamp returns the configured emission start timestamp. The value may be in the future; it is 0 when no start timestamp is configured. Returns: - timestamp: configured distribution start timestamp, or 0 if unconfigured
- OID
- 0e7aa4…52b8:60
GetDistributionStartTimestamp details
GetLastExecutedTimestamp
func() int64GetLastExecutedTimestamp returns the timestamp of the last emission distribution execution. Returns: - timestamp: last execution timestamp
- OID
- 0e7aa4…52b8:61
GetLastExecutedTimestamp details
GetAllDistributionBpsPct
func() map[int]int64GetAllDistributionBpsPct returns all distribution percentages in basis points. Returns: - percentages: map of target to percentage in basis points
- OID
- 0e7aa4…52b8:62
GetAllDistributionBpsPct details
GetTotalAccuDistributed
func() int64GetTotalAccuDistributed returns the total accumulated distributed GNS amount. Returns: - amount: total accumulated distributed GNS
- OID
- 0e7aa4…52b8:63
GetTotalAccuDistributed details
GetTotalDistributed
func() int64GetTotalDistributed returns the total pending distributed GNS amount. Returns: - amount: total pending distributed GNS
- OID
- 0e7aa4…52b8:64
GetTotalDistributed details
GetDistributionEndTimestamp
func() int64GetDistributionEndTimestamp returns the timestamp when emission distribution ends. Returns: - timestamp: distribution end timestamp, or 0 if not started
- OID
- 0e7aa4…52b8:65
GetDistributionEndTimestamp details
GetDistributableAmount
func(amount int64, timestamp int64) (map[int]int64, int64)GetDistributableAmount returns distribution amounts by target and the remainder. If timestamp is outside the distribution window, it returns an empty map and the full amount as left. Parameters: - amount: total amount to distribute - timestamp: timestamp to check distribution window Returns: - distributions: map of target to distribution amount - remainder: undistributed amount
- OID
- 0e7aa4…52b8:66
GetDistributableAmount details
gnsDisplayScale
uint64Value
1000000
Render
func(path string) stringRender returns the current GNS emission and distribution state.
- OID
- 0e7aa4…52b8:67
Render details
formatEmissionTimestamp
func(timestamp int64, zeroLabel string) string- OID
- 0e7aa4…52b8:69
formatEmissionTimestamp details
formatGnsAmount
func(amount int64) string- OID
- 0e7aa4…52b8:70
formatGnsAmount details
formatDistributionPercent
func(bps int64) string- OID
- 0e7aa4…52b8:71
formatDistributionPercent details
zeroPadUnsigned
func(value uint64, width int) string- OID
- 0e7aa4…52b8:72