assertValidDistributionTarget
func(target int)assertValidDistributionTarget panics if the given distribution target is invalid.
- OID
- 0e7aa4…52b8:3
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:5
assertValidDistributionPct details
LIQUIDITY_STAKER
intValue
1
DEVOPS
intValue
2
COMMUNITY_POOL
intValue
3
GOV_STAKER
intValue
4
distributionBpsPct
map[int]int64- OID
- 0e7aa4…52b8:65
distributionBpsPct details
distributedToStaker
int64// can be cleared by staker contract
Value
172410098073
distributedToDevOps
int64Value
45976026114
distributedToCommunityPool
int64Value
11494006472
distributedToGovStaker
int64// can be cleared by governance staker
Value
0
accuDistributedToStaker
int64Value
172410098073
accuDistributedToDevOps
int64Value
45976026114
accuDistributedToCommunityPool
int64Value
11494006472
accuDistributedToGovStaker
int64Value
0
init.15
func()- OID
- 0e7aa4…52b8:15
init.15 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: - liquidityStakerPct: Percentage for liquidity stakers in basis points (100 = 1%, 10000 = 100%) - devOpsPct: Percentage for devops in basis points - communityPoolPct: Percentage for community pool in basis points - govStakerPct: Percentage for governance stakers in basis points Requirements: - Percentages must sum to exactly 10000 (100%) - Each percentage must be 0-10000 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:17
ChangeDistributionPct details
changeDistributionPcts
func(liquidityStakerPct int64, devOpsPct int64, communityPoolPct int64, govStakerPct int64)changeDistributionPcts updates the distribution percentages for all targets.
- OID
- 0e7aa4…52b8:18
changeDistributionPcts details
calculateDistributableAmounts
func(amount int64) (map[int]int64, int64)- OID
- 0e7aa4…52b8:19
calculateDistributableAmounts details
calculateAmount
func(amount int64, bptPct int64) int64calculateAmount converts basis points to actual token amount.
- OID
- 0e7aa4…52b8:20
calculateAmount details
applyDistribution
func(targets map[int]int64) (map[.uverse.address]int64, .uverse.error)- OID
- 0e7aa4…52b8:21
applyDistribution details
transferToTarget
func(int, rlm .uverse.realm, targets map[.uverse.address]int64) .uverse.error- OID
- 0e7aa4…52b8:22
transferToTarget details
GetDistributionBpsPct
func(target int) int64GetDistributionBpsPct returns the distribution percentage in basis points for a specific target.
- OID
- 0e7aa4…52b8:23
GetDistributionBpsPct details
GetDistributedToStaker
func() int64GetDistributedToStaker returns pending GNS for liquidity stakers.
- OID
- 0e7aa4…52b8:24
GetDistributedToStaker details
GetDistributedToDevOps
func() int64GetDistributedToDevOps returns accumulated GNS for DevOps.
- OID
- 0e7aa4…52b8:25
GetDistributedToDevOps details
GetDistributedToCommunityPool
func() int64GetDistributedToCommunityPool returns the amount of GNS distributed to Community Pool.
- OID
- 0e7aa4…52b8:26
GetDistributedToCommunityPool details
GetDistributedToGovStaker
func() int64GetDistributedToGovStaker returns the amount of GNS distributed to governance stakers since last clear.
- OID
- 0e7aa4…52b8:27
GetDistributedToGovStaker details
AccumulateDistributedInfo
func() (toStaker int64, toDevOps int64, toCommunityPool int64, toGovStaker int64)- OID
- 0e7aa4…52b8:28
AccumulateDistributedInfo details
GetAccuDistributedToStaker
func() int64GetAccuDistributedToStaker returns the total historical GNS distributed to liquidity stakers.
- OID
- 0e7aa4…52b8:29
GetAccuDistributedToStaker details
GetAccuDistributedToDevOps
func() int64GetAccuDistributedToDevOps returns the total historical GNS distributed to DevOps.
- OID
- 0e7aa4…52b8:30
GetAccuDistributedToDevOps details
GetAccuDistributedToCommunityPool
func() int64GetAccuDistributedToCommunityPool returns the total historical GNS distributed to Community Pool.
- OID
- 0e7aa4…52b8:31
GetAccuDistributedToCommunityPool details
GetAccuDistributedToGovStaker
func() int64GetAccuDistributedToGovStaker returns the total historical GNS distributed to governance stakers.
- OID
- 0e7aa4…52b8:32
GetAccuDistributedToGovStaker details
GetEmissionAmountPerSecondBy
func(timestamp int64, distributionPct int64) int64GetEmissionAmountPerSecondBy returns the emission amount per second for a given timestamp and distribution percentage.
- OID
- 0e7aa4…52b8:33
GetEmissionAmountPerSecondBy details
GetStakerEmissionAmountPerSecond
func() int64GetStakerEmissionAmountPerSecond returns the current per-second emission amount allocated to liquidity stakers.
- OID
- 0e7aa4…52b8:34
GetStakerEmissionAmountPerSecond details
GetStakerEmissionAmountPerSecondInRange
func(start int64, end int64) ([]int64, []int64)GetStakerEmissionAmountPerSecondInRange returns emission amounts allocated to liquidity stakers for a time range.
- OID
- 0e7aa4…52b8:35
GetStakerEmissionAmountPerSecondInRange details
ClearDistributedToStaker
func()ClearDistributedToStaker resets the pending distribution amount for liquidity stakers. Only callable by staker contract.
- OID
- 0e7aa4…52b8:36
ClearDistributedToStaker details
ClearDistributedToGovStaker
func()ClearDistributedToGovStaker resets the pending distribution amount for governance stakers. Only callable by governance staker contract.
- OID
- 0e7aa4…52b8:37
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:38
setDistributionBpsPct details
targetToStr
func(target int) stringtargetToStr converts target constant to string representation.
- OID
- 0e7aa4…52b8:39
targetToStr details
totalDistributionDuration
untyped bigint// 12 years
Value
(378432000 <untyped> bigint)
leftGNSAmount
int64Value
1
lastExecutedTimestamp
int64Value
1784987157
emissionAddr
.uverse.addressValue
<gnolang.StringValue>
distributionStartTimestamp
int64Value
1784954938
onDistributionPctChangeCallback
func(emissionAmountPerSecond int64)- OID
- 0742c3…b8af:250
onDistributionPctChangeCallback details
init.45
func()- OID
- 0e7aa4…52b8:45
init.45 details
setLeftGNSAmount
func(amount int64)setLeftGNSAmount updates the undistributed GNS token amount
- OID
- 0e7aa4…52b8:47
setLeftGNSAmount details
setLastExecutedTimestamp
func(timestamp int64)setLastExecutedTimestamp updates the timestamp of the last emission distribution execution.
- OID
- 0e7aa4…52b8:48
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.). Returns: - int64: Total amount of GNS distributed in this call Note: Distribution only occurs if start timestamp is set and reached. Any undistributed tokens from previous calls are carried forward.
- OID
- 0e7aa4…52b8:49
MintAndDistributeGns details
SetDistributionStartTime
func(startTimestamp int64)SetDistributionStartTime sets the timestamp when emission distribution starts. This function controls when GNS emission begins. Once set and reached, the protocol starts minting GNS tokens according to the emission schedule. The timestamp can only be set before distribution starts - it becomes immutable once active. Parameters: - startTimestamp: Unix timestamp when emission should begin Requirements: - Must be called before distribution starts (one-time setup) - Timestamp must be in the future - Cannot be negative 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:50
SetDistributionStartTime details
SetOnDistributionPctChangeCallback
func(callback func(...))SetOnDistributionPctChangeCallback sets a callback function to be called when distribution percentages change. This allows external contracts (like staker) to update their internal caches when governance changes emission rates. Only callable by the staker contract.
- OID
- 0e7aa4…52b8:51
SetOnDistributionPctChangeCallback 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"
makeErrorWithDetails
func(message string, detail string) .uverse.errormakeErrorWithDetails creates a new error by combining a base error with additional details.
- OID
- 0e7aa4…52b8:52
makeErrorWithDetails details
GetLeftGNSAmount
func() int64GetLeftGNSAmount returns the amount of undistributed GNS tokens from previous distributions.
- OID
- 0e7aa4…52b8:54
GetLeftGNSAmount details
GetDistributionStartTimestamp
func() int64GetDistributionStartTimestamp returns the timestamp when emission distribution started. Returns 0 if distribution has not been started yet.
- OID
- 0e7aa4…52b8:56
GetDistributionStartTimestamp details
GetLastExecutedTimestamp
func() int64GetLastExecutedTimestamp returns the timestamp of the last emission distribution execution.
- OID
- 0e7aa4…52b8:57
GetLastExecutedTimestamp details
GetAllDistributionBpsPct
func() map[int]int64GetAllDistributionBpsPct returns all distribution percentages in basis points.
- OID
- 0e7aa4…52b8:58
GetAllDistributionBpsPct details
GetTotalAccuDistributed
func() int64GetTotalAccuDistributed returns the total accumulated distributed GNS amount.
- OID
- 0e7aa4…52b8:59
GetTotalAccuDistributed details
GetTotalDistributed
func() int64GetTotalDistributed returns the total pending distributed GNS amount.
- OID
- 0e7aa4…52b8:60
GetTotalDistributed details
GetDistributionEndTimestamp
func() int64GetDistributionEndTimestamp returns the timestamp when emission distribution ends. Returns 0 if distribution has not been started yet.
- OID
- 0e7aa4…52b8:61
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.
- OID
- 0e7aa4…52b8:62