assertIsValidAmount
func(amount int64)assertIsValidAmount panics if the amount is zero.
- OID
- 04315f…d24b:3
assertIsValidAmount details
assertNotImplementYet
func()- OID
- 04315f…d24b:5
assertNotImplementYet details
projectTier30
int64Value
30
projectTier90
int64Value
90
projectTier180
int64Value
180
dayTime
int64// 86400
Value
86400
minimumDepositAmount
int64Value
1000000
stringSplitterPad
untyped stringValue
"*PAD*"
maxProjectConditionCount
untyped bigintValue
(5 <untyped> bigint)
projectMinimumStartDelayTime
int64// 3 days
Value
259200
GOV_XGNS_PATH
stringcontract paths
Value
"gno.land/r/gnoswap/gov/xgns"
GNS_TOKEN_KEY
stringcontract paths
Value
"gno.land/r/gnoswap/gns.GNS"
projectTierDurations
[]int64MUST BE IMMUTABLE, DO NOT MODIFY.
- OID
- 04315f…d24b:7
projectTierDurations details
projectTierDurationTimes
map[int64]int64MUST BE IMMUTABLE, DO NOT MODIFY.
- OID
- 04315f…d24b:9
projectTierDurationTimes details
projectTierRewardCollectableDuration
map[int64]int64MUST BE IMMUTABLE, DO NOT MODIFY.
- OID
- 04315f…d24b:11
projectTierRewardCollectableDuration details
withdrawDeposit
func(d launchpad.Deposit, currentHeight int64, currentTime int64) (launchpad.Deposit, int64)withdrawDeposit withdraws a deposit and updates the reward manager.
- OID
- 04315f…d24b:12
withdrawDeposit details
emitUpdateLaunchpadRewardAccumulation
func(projectTierID string, r *launchpad.RewardManager, totalDepositAmount int64)emitUpdateLaunchpadRewardAccumulation emits the persisted per-tier reward accumulation state so that off-chain indexers can consume the authoritative accumulator instead of re-deriving it. It must be emitted after every path that calls updateRewardPerDepositX128 (deposit/withdraw/collect/admin-reclaim), otherwise the off-chain accumulator drifts from the contract. The reward manager is keyed by projectTierId, so it is included to identify which tier's accumulator this update belongs to. totalDepositAmount is the current tier deposit total after the stake change (the divisor for the next accumulation delta), and distributeAmountPerSecondX128 lets indexers project the accumulator forward.
- OID
- 04315f…d24b:14
emitUpdateLaunchpadRewardAccumulation details
errNoLeftReward
untyped stringValue
"[GNOSWAP-LAUNCHPAD-001] no left reward"
errInvalidAddress
untyped stringValue
"[GNOSWAP-LAUNCHPAD-002] invalid address"
errDataNotFound
untyped stringValue
"[GNOSWAP-LAUNCHPAD-003] requested data not found"
errInactiveProject
untyped stringValue
"[GNOSWAP-LAUNCHPAD-004] project is inactive"
errInvalidInput
untyped stringValue
"[GNOSWAP-LAUNCHPAD-005] invalid input data"
errDuplicateProject
untyped stringValue
"[GNOSWAP-LAUNCHPAD-006] cannot create same project in same block"
errInvalidTier
untyped stringValue
"[GNOSWAP-LAUNCHPAD-007] invalid tier"
errInsufficientBalance
untyped stringValue
"[GNOSWAP-LAUNCHPAD-008] insufficient balance"
errInvalidData
untyped stringValue
"[GNOSWAP-LAUNCHPAD-009] invalid data"
errInvalidAmount
untyped stringValue
"[GNOSWAP-LAUNCHPAD-010] invalid amount"
errInvalidRewardState
untyped stringValue
"[GNOSWAP-LAUNCHPAD-011] invalid reward state"
errNotExistDeposit
untyped stringValue
"[GNOSWAP-LAUNCHPAD-012] not exist deposit"
errAlreadyCollected
untyped stringValue
"[GNOSWAP-LAUNCHPAD-013] already collected"
errInvalidOwner
untyped stringValue
"[GNOSWAP-LAUNCHPAD-014] invalid owner"
errInvalidTime
untyped stringValue
"[GNOSWAP-LAUNCHPAD-015] invalid time"
errNotYetEndedProject
untyped stringValue
"[GNOSWAP-LAUNCHPAD-016] project lock period is not over yet"
errOverflow
untyped stringValue
"[GNOSWAP-LAUNCHPAD-017] overflow"
errSpoofedRealm
untyped stringValue
"[GNOSWAP-LAUNCHPAD-018] rlm does not match the current crossing frame"
makeErrorWithDetails
func(message string, details string) .uverse.errormakeErrorWithDetails creates an error with additional context.
- OID
- 04315f…d24b:16
makeErrorWithDetails details
cloneProjectEntry
func(value interface{...}) interface{...}cloneProjectEntry is the transformation for the project tree. Project is mutable and its setters are declared in /r/gnoswap/launchpad, so an external holder of the stored pointer could write realm state through it. Project.Clone leaves the project's maps nil; see it for which lookups read them instead.
- OID
- 04315f…d24b:18
cloneProjectEntry details
cloneRewardStateEntry
func(value interface{...}) interface{...}cloneRewardStateEntry is the transformation for a project tier's reward tree. RewardState is mutable and its setters are declared in /r/gnoswap/launchpad, so an external holder of the stored pointer could write realm state through it.
- OID
- 04315f…d24b:20
cloneRewardStateEntry details
init.38
func()- OID
- 04315f…d24b:21
init.38 details
registerLaunchpadV1
func()- OID
- 04315f…d24b:23
registerLaunchpadV1 details
initStoreData
func(int, rlm .uverse.realm, launchpadStore launchpad.ILaunchpadStore) .uverse.error- OID
- 04315f…d24b:24
initStoreData details
launchpadV1
typeValue
v1.launchpadV1
NewLaunchpadV1
func(launchpadStore launchpad.ILaunchpadStore) launchpad.ILaunchpadNewLaunchpadV1 constructs a version-one launchpad implementation backed by launchpadStore. Parameters: - launchpadStore: store implementation used for all launchpad state reads and writes. Returns: - launchpad: launchpad implementation that delegates persistence to launchpadStore.
- OID
- 04315f…d24b:25
NewLaunchpadV1 details
validateRefundProject
func(project *launchpad.Project, recipient .uverse.address, currentTime int64) .uverse.errorvalidateTransferLeft validates the transfer of remaining tokens
- OID
- 04315f…d24b:27
validateRefundProject details
createProjectParams
typeValue
v1.createProjectParams
isGovernanceToken
func(tokenPath string) bool- OID
- 04315f…d24b:29
isGovernanceToken details
unStakeGovernance
func(int, rlm .uverse.realm, recipient .uverse.address, withdrawalAmount int64)unStakeGovernance removes the staked amount from governance system
- OID
- 04315f…d24b:30
unStakeGovernance details
isProjectActive
func(p *launchpad.Project, currentTime int64) bool- OID
- 04315f…d24b:32
isProjectActive details
isProjectEnded
func(p *launchpad.Project, currentTime int64) bool- OID
- 04315f…d24b:34
isProjectEnded details
getProjectRemainingAmount
func(p *launchpad.Project) int64- OID
- 04315f…d24b:35
getProjectRemainingAmount details
checkProjectConditions
func(p *launchpad.Project, caller .uverse.address, balanceOfFunc func(...)) .uverse.error- OID
- 04315f…d24b:36
checkProjectConditions details
getProjectTier
func(p *launchpad.Project, duration int64) (*launchpad.ProjectTier, .uverse.error)- OID
- 04315f…d24b:37
getProjectTier details
getStandardTier
func(p *launchpad.Project) *launchpad.ProjectTier- OID
- 04315f…d24b:38
getStandardTier details
validateRefundRemainingAmount
func(p *launchpad.Project, currentTime int64) .uverse.error- OID
- 04315f…d24b:39
validateRefundRemainingAmount details
addProjectTier
func(p *launchpad.Project, tierDuration int64, projectTier *launchpad.ProjectTier)- OID
- 04315f…d24b:40
addProjectTier details
addProjectCondition
func(p *launchpad.Project, tokenPath string, condition *launchpad.ProjectCondition)- OID
- 04315f…d24b:41
addProjectCondition details
getTierCurrentDepositCount
func(t *launchpad.ProjectTier) int64- OID
- 04315f…d24b:42
getTierCurrentDepositCount details
getTierCurrentDepositAmount
func(t *launchpad.ProjectTier) int64- OID
- 04315f…d24b:44
getTierCurrentDepositAmount details
getCalculatedLeftReward
func(t *launchpad.ProjectTier) int64- OID
- 04315f…d24b:45
getCalculatedLeftReward details
depositToTier
func(t *launchpad.ProjectTier, deposit launchpad.Deposit)- OID
- 04315f…d24b:46
depositToTier details
withdrawToTier
func(t *launchpad.ProjectTier, deposit launchpad.Deposit)- OID
- 04315f…d24b:47
withdrawToTier details
updateTierDistributeAmountPerSecond
func(t *launchpad.ProjectTier)- OID
- 04315f…d24b:48
updateTierDistributeAmountPerSecond details
newProjectTier
func(projectID string, tierDuration int64, totalDistributeAmount int64, startTime int64, endTime int64) *launchpad.ProjectTiernewProjectTier returns a pointer to a new ProjectTier with the given values.
- OID
- 04315f…d24b:49
newProjectTier details
renderLaunchpadRole
func(role v1.SystemRole) string- OID
- 04315f…d24b:50
renderLaunchpadRole details
isRewardManagerInitialized
func(r *launchpad.RewardManager) bool- OID
- 04315f…d24b:52
isRewardManagerInitialized details
getDepositRewardState
func(r *launchpad.RewardManager, depositId string) (*launchpad.RewardState, .uverse.error)- OID
- 04315f…d24b:54
getDepositRewardState details
calculateRewardPerDepositX128
func(r *launchpad.RewardManager, rewardPerSecondX128 *v1.Uint, totalStaked int64, currentTime int64) (*v1.Uint, .uverse.error)- OID
- 04315f…d24b:55
calculateRewardPerDepositX128 details
addRewardStateByDeposit
func(r *launchpad.RewardManager, deposit launchpad.Deposit) *launchpad.RewardState- OID
- 04315f…d24b:56
addRewardStateByDeposit details
addRewardState
func(r *launchpad.RewardManager, deposit launchpad.Deposit, rewardState *launchpad.RewardState) *launchpad.RewardState- OID
- 04315f…d24b:57
addRewardState details
removeRewardState
func(r *launchpad.RewardManager, depositId string) .uverse.error- OID
- 04315f…d24b:58
removeRewardState details
addActiveRewardState
func(r *launchpad.RewardManager, rewardState *launchpad.RewardState)- OID
- 04315f…d24b:59
addActiveRewardState details
removeActiveRewardState
func(r *launchpad.RewardManager, rewardState *launchpad.RewardState)- OID
- 04315f…d24b:60
removeActiveRewardState details
addRewardPerDepositX128
func(r *launchpad.RewardManager, rewardPerDepositX128 *v1.Uint, currentTime int64) .uverse.error- OID
- 04315f…d24b:61
addRewardPerDepositX128 details
updateRewardPerDepositX128
func(r *launchpad.RewardManager, totalDepositAmount int64, currentTime int64) .uverse.errorupdateRewardPerDepositX128 updates the reward per deposit state. This function calculates and updates the accumulated reward per deposit based on the current total deposit amount and time. Parameters: - totalDepositAmount (int64): Current total deposit amount - time (int64): Current timestamp Returns: - error: If the update fails
- OID
- 04315f…d24b:62
updateRewardPerDepositX128 details
updateDistributeAmountPerSecondX128
func(r *launchpad.RewardManager, totalDistributeAmount int64, distributeStartTime int64, distributeEndTime int64)- OID
- 04315f…d24b:63
updateDistributeAmountPerSecondX128 details
collectReward
func(r *launchpad.RewardManager, depositId string, currentTime int64) (int64, .uverse.error)collectReward processes the reward collection for a specific deposit. This function ensures that the reward collection is valid and updates the claimed amount accordingly. Parameters: - depositId (string): The ID of the deposit - currentTime (int64): Current timestamp Returns: - int64: The amount of reward collected - error: If the collection fails
- OID
- 04315f…d24b:64
collectReward details
newRewardManager
func(totalDistributeAmount int64, distributeStartTime int64, distributeEndTime int64, rewardCollectableDuration int64) *launchpad.RewardManagernewRewardManager returns a pointer to a new RewardManager with the given values.
- OID
- 04315f…d24b:65
newRewardManager details
calculateMaximumClaimableRewardsForActiveDeposits
func(r *launchpad.RewardManager) int64calculateMaximumClaimableRewardsForActiveDeposits reserves every active claim without traversing the attacker-controlled reward tree. Aggregating before Q128 truncation retains rounding dust but cannot under-reserve claims.
- OID
- 04315f…d24b:66
calculateMaximumClaimableRewardsForActiveDeposits details
isRewardStateClaimable
func(r *launchpad.RewardState, currentTime int64) bool- OID
- 04315f…d24b:67
isRewardStateClaimable details
calculateReward
func(r *launchpad.RewardState, accumRewardPerDepositX128 *v1.Uint) int64calculateReward calculates the total reward amount based on the accumulated reward per deposit. Returns the total reward amount.
- OID
- 04315f…d24b:69
calculateReward details
calculateClaimableReward
func(r *launchpad.RewardState, accumRewardPerDepositX128 *v1.Uint) int64calculateClaimableReward calculates the amount of reward that can be claimed based on the current accumulated reward per deposit. Returns the amount of reward that can be claimed.
- OID
- 04315f…d24b:70
calculateClaimableReward details
MAX_INT64
untyped bigintValue
(9223372036854775807 <untyped> bigint)
MIN_INT64
untyped bigintValue
(-9223372036854775808 <untyped> bigint)
buildConditionEventAttrs
func(conditionTokens string, conditionAmounts string) []string- OID
- 04315f…d24b:71
buildConditionEventAttrs details
parseProjectTierID
func(projectTierID string) (string, int64)parseProjectTierID parses a project tier ID into its project ID and duration. Returns the project ID {tokenPath}:{createdHeight} and the duration of the project tier (30, 90, 180).
- OID
- 04315f…d24b:73