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) int64withdrawDeposit withdraws a deposit and updates the reward manager.
- OID
- 04315f…d24b:12
withdrawDeposit details
newDeposit
func(depositID string, projectID string, tier int64, depositor .uverse.address, depositAmount int64, createdHeight int64, createdTime int64, endTime int64) *launchpad.Deposit- OID
- 04315f…d24b:14
newDeposit 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:15
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:17
makeErrorWithDetails details
init.37
func()- OID
- 04315f…d24b:19
init.37 details
registerLaunchpadV1
func()- OID
- 04315f…d24b:21
registerLaunchpadV1 details
initStoreData
func(int, rlm .uverse.realm, launchpadStore launchpad.ILaunchpadStore) .uverse.error- OID
- 04315f…d24b:22
initStoreData details
launchpadV1
typeValue
v1.launchpadV1
NewLaunchpadV1
func(launchpadStore launchpad.ILaunchpadStore) launchpad.ILaunchpad- OID
- 04315f…d24b:23
NewLaunchpadV1 details
validateRefundProject
func(project *launchpad.Project, recipient .uverse.address, currentTime int64) .uverse.errorvalidateTransferLeft validates the transfer of remaining tokens
- OID
- 04315f…d24b:25
validateRefundProject details
createProjectParams
typeValue
v1.createProjectParams
isGovernanceToken
func(tokenPath string) bool- OID
- 04315f…d24b:27
isGovernanceToken details
unStakeGovernance
func(int, rlm .uverse.realm, recipient .uverse.address, withdrawalAmount int64)unStakeGovernance removes the staked amount from governance system
- OID
- 04315f…d24b:28
unStakeGovernance details
isProjectActive
func(p *launchpad.Project, currentTime int64) bool- OID
- 04315f…d24b:30
isProjectActive details
isProjectEnded
func(p *launchpad.Project, currentTime int64) bool- OID
- 04315f…d24b:32
isProjectEnded details
getProjectRemainingAmount
func(p *launchpad.Project) int64- OID
- 04315f…d24b:33
getProjectRemainingAmount details
checkProjectConditions
func(p *launchpad.Project, caller .uverse.address, balanceOfFunc func(...)) .uverse.error- OID
- 04315f…d24b:34
checkProjectConditions details
getProjectTier
func(p *launchpad.Project, duration int64) (*launchpad.ProjectTier, .uverse.error)- OID
- 04315f…d24b:35
getProjectTier details
getStandardTier
func(p *launchpad.Project) *launchpad.ProjectTier- OID
- 04315f…d24b:36
getStandardTier details
validateRefundRemainingAmount
func(p *launchpad.Project, currentTime int64) .uverse.error- OID
- 04315f…d24b:37
validateRefundRemainingAmount details
addProjectTier
func(p *launchpad.Project, tierDuration int64, projectTier *launchpad.ProjectTier)- OID
- 04315f…d24b:38
addProjectTier details
addProjectCondition
func(p *launchpad.Project, tokenPath string, condition *launchpad.ProjectCondition)- OID
- 04315f…d24b:39
addProjectCondition details
getTierCurrentDepositCount
func(t *launchpad.ProjectTier) int64- OID
- 04315f…d24b:40
getTierCurrentDepositCount details
getTierCurrentDepositAmount
func(t *launchpad.ProjectTier) int64- OID
- 04315f…d24b:42
getTierCurrentDepositAmount details
getCalculatedLeftReward
func(t *launchpad.ProjectTier) int64- OID
- 04315f…d24b:43
getCalculatedLeftReward details
depositToTier
func(t *launchpad.ProjectTier, deposit *launchpad.Deposit)- OID
- 04315f…d24b:44
depositToTier details
withdrawToTier
func(t *launchpad.ProjectTier, deposit *launchpad.Deposit)- OID
- 04315f…d24b:45
withdrawToTier details
updateTierDistributeAmountPerSecond
func(t *launchpad.ProjectTier)- OID
- 04315f…d24b:46
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:47
newProjectTier details
isRewardManagerInitialized
func(r *launchpad.RewardManager) bool- OID
- 04315f…d24b:48
isRewardManagerInitialized details
getDepositRewardState
func(r *launchpad.RewardManager, depositId string) (*launchpad.RewardState, .uverse.error)- OID
- 04315f…d24b:50
getDepositRewardState details
calculateRewardPerDepositX128
func(r *launchpad.RewardManager, rewardPerSecondX128 *uint256.Uint, totalStaked int64, currentTime int64) (*uint256.Uint, .uverse.error)- OID
- 04315f…d24b:51
calculateRewardPerDepositX128 details
addRewardStateByDeposit
func(r *launchpad.RewardManager, deposit *launchpad.Deposit) *launchpad.RewardState- OID
- 04315f…d24b:52
addRewardStateByDeposit details
addRewardState
func(r *launchpad.RewardManager, deposit *launchpad.Deposit, rewardState *launchpad.RewardState) *launchpad.RewardState- OID
- 04315f…d24b:53
addRewardState details
removeRewardState
func(r *launchpad.RewardManager, depositId string)removeRewardState removes a reward state from the reward manager when a deposit is withdrawn. This improves iteration performance and ensures accurate pending reward calculations.
- OID
- 04315f…d24b:54
removeRewardState details
addRewardPerDepositX128
func(r *launchpad.RewardManager, rewardPerDepositX128 *uint256.Uint, currentTime int64) .uverse.error- OID
- 04315f…d24b:55
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:56
updateRewardPerDepositX128 details
updateDistributeAmountPerSecondX128
func(r *launchpad.RewardManager, totalDistributeAmount int64, distributeStartTime int64, distributeEndTime int64)- OID
- 04315f…d24b:57
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:58
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:59
newRewardManager details
calculateClaimableRewardsForActiveDeposits
func(r *launchpad.RewardManager) int64calculateClaimableRewardsForActiveDeposits calculates the total claimable rewards for all active deposits in the reward manager. This is used when admin wants to reclaim undistributed rewards while some deposits remain.
- OID
- 04315f…d24b:60
calculateClaimableRewardsForActiveDeposits details
isRewardStateClaimable
func(r *launchpad.RewardState, currentTime int64) bool- OID
- 04315f…d24b:61
isRewardStateClaimable details
calculateReward
func(r *launchpad.RewardState, accumRewardPerDepositX128 *uint256.Uint) int64calculateReward calculates the total reward amount based on the accumulated reward per deposit. Returns the total reward amount.
- OID
- 04315f…d24b:63
calculateReward details
calculateClaimableReward
func(r *launchpad.RewardState, accumRewardPerDepositX128 *uint256.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:64
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:65
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:67