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

v1 state

Back to all declarations

assertIsValidAmount

func(amount int64)

assertIsValidAmount panics if the amount is zero.

Open
OID
04315f…d24b:3
assertIsValidAmount details

Inspect func

assertNotImplementYet

func()
Open
OID
04315f…d24b:5
assertNotImplementYet details

Inspect func

projectTier30

int64

Value

30

projectTier90

int64

Value

90

projectTier180

int64

Value

180

dayTime

int64

// 86400

Value

86400

minimumDepositAmount

int64

Value

1000000

stringSplitterPad

untyped string

Value

"*PAD*"

maxProjectConditionCount

untyped bigint

Value

(5 <untyped> bigint)

projectMinimumStartDelayTime

int64

// 3 days

Value

259200

GOV_XGNS_PATH

string

contract paths

Value

"gno.land/r/gnoswap/gov/xgns"

GNS_TOKEN_KEY

string

contract paths

Value

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

projectTierDurations

[]int64 (len=3)

MUST BE IMMUTABLE, DO NOT MODIFY.

Open
OID
04315f…d24b:7
projectTierDurations details (len=3)

+3 more Inspect slice

projectTierDurationTimes

map[int64]int64

MUST BE IMMUTABLE, DO NOT MODIFY.

Open
OID
04315f…d24b:9
projectTierDurationTimes details

Inspect map

projectTierRewardCollectableDuration

map[int64]int64

MUST BE IMMUTABLE, DO NOT MODIFY.

Open
OID
04315f…d24b:11
projectTierRewardCollectableDuration details

Inspect map

withdrawDeposit

func(d *launchpad.Deposit, currentHeight int64, currentTime int64) int64

withdrawDeposit withdraws a deposit and updates the reward manager.

Open
OID
04315f…d24b:12
withdrawDeposit details

Inspect func

newDeposit

func(depositID string, projectID string, tier int64, depositor .uverse.address, depositAmount int64, createdHeight int64, createdTime int64, endTime int64) *launchpad.Deposit
Open
OID
04315f…d24b:14
newDeposit details

Inspect func

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.

Open
OID
04315f…d24b:15
emitUpdateLaunchpadRewardAccumulation details

Inspect func

errNoLeftReward

untyped string

Value

"[GNOSWAP-LAUNCHPAD-001] no left reward"

errInvalidAddress

untyped string

Value

"[GNOSWAP-LAUNCHPAD-002] invalid address"

errDataNotFound

untyped string

Value

"[GNOSWAP-LAUNCHPAD-003] requested data not found"

errInactiveProject

untyped string

Value

"[GNOSWAP-LAUNCHPAD-004] project is inactive"

errInvalidInput

untyped string

Value

"[GNOSWAP-LAUNCHPAD-005] invalid input data"

errDuplicateProject

untyped string

Value

"[GNOSWAP-LAUNCHPAD-006] cannot create same project in same block"

errInvalidTier

untyped string

Value

"[GNOSWAP-LAUNCHPAD-007] invalid tier"

errInsufficientBalance

untyped string

Value

"[GNOSWAP-LAUNCHPAD-008] insufficient balance"

errInvalidData

untyped string

Value

"[GNOSWAP-LAUNCHPAD-009] invalid data"

errInvalidAmount

untyped string

Value

"[GNOSWAP-LAUNCHPAD-010] invalid amount"

errInvalidRewardState

untyped string

Value

"[GNOSWAP-LAUNCHPAD-011] invalid reward state"

errNotExistDeposit

untyped string

Value

"[GNOSWAP-LAUNCHPAD-012] not exist deposit"

errAlreadyCollected

untyped string

Value

"[GNOSWAP-LAUNCHPAD-013] already collected"

errInvalidOwner

untyped string

Value

"[GNOSWAP-LAUNCHPAD-014] invalid owner"

errInvalidTime

untyped string

Value

"[GNOSWAP-LAUNCHPAD-015] invalid time"

errNotYetEndedProject

untyped string

Value

"[GNOSWAP-LAUNCHPAD-016] project lock period is not over yet"

errOverflow

untyped string

Value

"[GNOSWAP-LAUNCHPAD-017] overflow"

errSpoofedRealm

untyped string

Value

"[GNOSWAP-LAUNCHPAD-018] rlm does not match the current crossing frame"

makeErrorWithDetails

func(message string, details string) .uverse.error

makeErrorWithDetails creates an error with additional context.

Open
OID
04315f…d24b:17
makeErrorWithDetails details

Inspect func

registerLaunchpadV1

func()
Open
OID
04315f…d24b:21
registerLaunchpadV1 details

Inspect func

initStoreData

func(int, rlm .uverse.realm, launchpadStore launchpad.ILaunchpadStore) .uverse.error
Open
OID
04315f…d24b:22
initStoreData details

Inspect func

launchpadV1

type

Value

v1.launchpadV1

NewLaunchpadV1

func(launchpadStore launchpad.ILaunchpadStore) launchpad.ILaunchpad
Open
OID
04315f…d24b:23
NewLaunchpadV1 details

Inspect func

validateRefundProject

func(project *launchpad.Project, recipient .uverse.address, currentTime int64) .uverse.error

validateTransferLeft validates the transfer of remaining tokens

Open
OID
04315f…d24b:25
validateRefundProject details

Inspect func

createProjectParams

type

Value

v1.createProjectParams

isGovernanceToken

func(tokenPath string) bool
Open
OID
04315f…d24b:27
isGovernanceToken details

Inspect func

unStakeGovernance

func(int, rlm .uverse.realm, recipient .uverse.address, withdrawalAmount int64)

unStakeGovernance removes the staked amount from governance system

Open
OID
04315f…d24b:28
unStakeGovernance details

Inspect func

isProjectActive

func(p *launchpad.Project, currentTime int64) bool
Open
OID
04315f…d24b:30
isProjectActive details

Inspect func

isProjectEnded

func(p *launchpad.Project, currentTime int64) bool
Open
OID
04315f…d24b:32
isProjectEnded details

Inspect func

getProjectRemainingAmount

func(p *launchpad.Project) int64
Open
OID
04315f…d24b:33
getProjectRemainingAmount details

Inspect func

checkProjectConditions

func(p *launchpad.Project, caller .uverse.address, balanceOfFunc func(...)) .uverse.error
Open
OID
04315f…d24b:34
checkProjectConditions details

Inspect func

getProjectTier

func(p *launchpad.Project, duration int64) (*launchpad.ProjectTier, .uverse.error)
Open
OID
04315f…d24b:35
getProjectTier details

Inspect func

getStandardTier

func(p *launchpad.Project) *launchpad.ProjectTier
Open
OID
04315f…d24b:36
getStandardTier details

Inspect func

validateRefundRemainingAmount

func(p *launchpad.Project, currentTime int64) .uverse.error
Open
OID
04315f…d24b:37
validateRefundRemainingAmount details

Inspect func

addProjectTier

func(p *launchpad.Project, tierDuration int64, projectTier *launchpad.ProjectTier)
Open
OID
04315f…d24b:38
addProjectTier details

Inspect func

addProjectCondition

func(p *launchpad.Project, tokenPath string, condition *launchpad.ProjectCondition)
Open
OID
04315f…d24b:39
addProjectCondition details

Inspect func

getTierCurrentDepositCount

func(t *launchpad.ProjectTier) int64
Open
OID
04315f…d24b:40
getTierCurrentDepositCount details

Inspect func

getTierCurrentDepositAmount

func(t *launchpad.ProjectTier) int64
Open
OID
04315f…d24b:42
getTierCurrentDepositAmount details

Inspect func

getCalculatedLeftReward

func(t *launchpad.ProjectTier) int64
Open
OID
04315f…d24b:43
getCalculatedLeftReward details

Inspect func

depositToTier

func(t *launchpad.ProjectTier, deposit *launchpad.Deposit)
Open
OID
04315f…d24b:44
depositToTier details

Inspect func

withdrawToTier

func(t *launchpad.ProjectTier, deposit *launchpad.Deposit)
Open
OID
04315f…d24b:45
withdrawToTier details

Inspect func

updateTierDistributeAmountPerSecond

func(t *launchpad.ProjectTier)
Open
OID
04315f…d24b:46
updateTierDistributeAmountPerSecond details

Inspect func

newProjectTier

func(projectID string, tierDuration int64, totalDistributeAmount int64, startTime int64, endTime int64) *launchpad.ProjectTier

newProjectTier returns a pointer to a new ProjectTier with the given values.

Open
OID
04315f…d24b:47
newProjectTier details

Inspect func

isRewardManagerInitialized

func(r *launchpad.RewardManager) bool
Open
OID
04315f…d24b:48
isRewardManagerInitialized details

Inspect func

getDepositRewardState

func(r *launchpad.RewardManager, depositId string) (*launchpad.RewardState, .uverse.error)
Open
OID
04315f…d24b:50
getDepositRewardState details

Inspect func

calculateRewardPerDepositX128

func(r *launchpad.RewardManager, rewardPerSecondX128 *uint256.Uint, totalStaked int64, currentTime int64) (*uint256.Uint, .uverse.error)
Open
OID
04315f…d24b:51
calculateRewardPerDepositX128 details

Inspect func

addRewardStateByDeposit

func(r *launchpad.RewardManager, deposit *launchpad.Deposit) *launchpad.RewardState
Open
OID
04315f…d24b:52
addRewardStateByDeposit details

Inspect func

addRewardState

func(r *launchpad.RewardManager, deposit *launchpad.Deposit, rewardState *launchpad.RewardState) *launchpad.RewardState
Open
OID
04315f…d24b:53
addRewardState details

Inspect func

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.

Open
OID
04315f…d24b:54
removeRewardState details

Inspect func

addRewardPerDepositX128

func(r *launchpad.RewardManager, rewardPerDepositX128 *uint256.Uint, currentTime int64) .uverse.error
Open
OID
04315f…d24b:55
addRewardPerDepositX128 details

Inspect func

updateRewardPerDepositX128

func(r *launchpad.RewardManager, totalDepositAmount int64, currentTime int64) .uverse.error

updateRewardPerDepositX128 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

Open
OID
04315f…d24b:56
updateRewardPerDepositX128 details

Inspect func

updateDistributeAmountPerSecondX128

func(r *launchpad.RewardManager, totalDistributeAmount int64, distributeStartTime int64, distributeEndTime int64)
Open
OID
04315f…d24b:57
updateDistributeAmountPerSecondX128 details

Inspect func

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

Open
OID
04315f…d24b:58
collectReward details

Inspect func

newRewardManager

func(totalDistributeAmount int64, distributeStartTime int64, distributeEndTime int64, rewardCollectableDuration int64) *launchpad.RewardManager

newRewardManager returns a pointer to a new RewardManager with the given values.

Open
OID
04315f…d24b:59
newRewardManager details

Inspect func

calculateClaimableRewardsForActiveDeposits

func(r *launchpad.RewardManager) int64

calculateClaimableRewardsForActiveDeposits 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.

Open
OID
04315f…d24b:60
calculateClaimableRewardsForActiveDeposits details

Inspect func

isRewardStateClaimable

func(r *launchpad.RewardState, currentTime int64) bool
Open
OID
04315f…d24b:61
isRewardStateClaimable details

Inspect func

calculateReward

func(r *launchpad.RewardState, accumRewardPerDepositX128 *uint256.Uint) int64

calculateReward calculates the total reward amount based on the accumulated reward per deposit. Returns the total reward amount.

Open
OID
04315f…d24b:63
calculateReward details

Inspect func

calculateClaimableReward

func(r *launchpad.RewardState, accumRewardPerDepositX128 *uint256.Uint) int64

calculateClaimableReward 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.

Open
OID
04315f…d24b:64
calculateClaimableReward details

Inspect func

MAX_INT64

untyped bigint

Value

(9223372036854775807 <untyped> bigint)

MIN_INT64

untyped bigint

Value

(-9223372036854775808 <untyped> bigint)

buildConditionEventAttrs

func(conditionTokens string, conditionAmounts string) []string
Open
OID
04315f…d24b:65
buildConditionEventAttrs details

Inspect func

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).

Open
OID
04315f…d24b:67
parseProjectTierID details

Inspect func
assertIsValidAmount : func(amount int64) Inspect
assertNotImplementYet : func() Inspect
projectTier30 : int64 =30
projectTier90 : int64 =90
projectTier180 : int64 =180
dayTime : int64 =86400
minimumDepositAmount : int64 =1000000
stringSplitterPad : untyped string ="*PAD*"
maxProjectConditionCount : untyped bigint =(5 <untyped> bigint)
projectMinimumStartDelayTime : int64 =259200
GOV_XGNS_PATH : string ="gno.land/r/gnoswap/gov/xgns"
GNS_TOKEN_KEY : string ="gno.land/r/gnoswap/gns.GNS"
projectTierDurations : []int64 (len=3) Inspect
projectTierDurationTimes : map[int64]int64 Inspect
projectTierRewardCollectableDuration : map[int64]int64 Inspect
withdrawDeposit : func(d *launchpad.Deposit, currentHeight int64, currentTime int64) int64 Inspect
newDeposit : func(depositID string, projectID string, tier int64, depositor .uverse.address, depositAmount int64, createdHeight int64, createdTime int64, endTime int64) *launchpad.Deposit Inspect
emitUpdateLaunchpadRewardAccumulation : func(projectTierID string, r *launchpad.RewardManager, totalDepositAmount int64) Inspect
errNoLeftReward : untyped string ="[GNOSWAP-LAUNCHPAD-001] no left reward"
errInvalidAddress : untyped string ="[GNOSWAP-LAUNCHPAD-002] invalid address"
errDataNotFound : untyped string ="[GNOSWAP-LAUNCHPAD-003] requested data not found"
errInactiveProject : untyped string ="[GNOSWAP-LAUNCHPAD-004] project is inactive"
errInvalidInput : untyped string ="[GNOSWAP-LAUNCHPAD-005] invalid input data"
errDuplicateProject : untyped string ="[GNOSWAP-LAUNCHPAD-006] cannot create same project in same block"
errInvalidTier : untyped string ="[GNOSWAP-LAUNCHPAD-007] invalid tier"
errInsufficientBalance : untyped string ="[GNOSWAP-LAUNCHPAD-008] insufficient balance"
errInvalidData : untyped string ="[GNOSWAP-LAUNCHPAD-009] invalid data"
errInvalidAmount : untyped string ="[GNOSWAP-LAUNCHPAD-010] invalid amount"
errInvalidRewardState : untyped string ="[GNOSWAP-LAUNCHPAD-011] invalid reward state"
errNotExistDeposit : untyped string ="[GNOSWAP-LAUNCHPAD-012] not exist deposit"
errAlreadyCollected : untyped string ="[GNOSWAP-LAUNCHPAD-013] already collected"
errInvalidOwner : untyped string ="[GNOSWAP-LAUNCHPAD-014] invalid owner"
errInvalidTime : untyped string ="[GNOSWAP-LAUNCHPAD-015] invalid time"
errNotYetEndedProject : untyped string ="[GNOSWAP-LAUNCHPAD-016] project lock period is not over yet"
errOverflow : untyped string ="[GNOSWAP-LAUNCHPAD-017] overflow"
errSpoofedRealm : untyped string ="[GNOSWAP-LAUNCHPAD-018] rlm does not match the current crossing frame"
makeErrorWithDetails : func(message string, details string) .uverse.error Inspect
init.37 : func() Inspect
registerLaunchpadV1 : func() Inspect
initStoreData : func(int, rlm .uverse.realm, launchpadStore launchpad.ILaunchpadStore) .uverse.error Inspect
launchpadV1 : type =v1.launchpadV1
NewLaunchpadV1 : func(launchpadStore launchpad.ILaunchpadStore) launchpad.ILaunchpad Inspect
validateRefundProject : func(project *launchpad.Project, recipient .uverse.address, currentTime int64) .uverse.error Inspect
createProjectParams : type =v1.createProjectParams
isGovernanceToken : func(tokenPath string) bool Inspect
unStakeGovernance : func(int, rlm .uverse.realm, recipient .uverse.address, withdrawalAmount int64) Inspect
isProjectActive : func(p *launchpad.Project, currentTime int64) bool Inspect
isProjectEnded : func(p *launchpad.Project, currentTime int64) bool Inspect
getProjectRemainingAmount : func(p *launchpad.Project) int64 Inspect
checkProjectConditions : func(p *launchpad.Project, caller .uverse.address, balanceOfFunc func(...)) .uverse.error Inspect
getProjectTier : func(p *launchpad.Project, duration int64) (*launchpad.ProjectTier, .uverse.error) Inspect
getStandardTier : func(p *launchpad.Project) *launchpad.ProjectTier Inspect
validateRefundRemainingAmount : func(p *launchpad.Project, currentTime int64) .uverse.error Inspect
addProjectTier : func(p *launchpad.Project, tierDuration int64, projectTier *launchpad.ProjectTier) Inspect
addProjectCondition : func(p *launchpad.Project, tokenPath string, condition *launchpad.ProjectCondition) Inspect
getTierCurrentDepositCount : func(t *launchpad.ProjectTier) int64 Inspect
getTierCurrentDepositAmount : func(t *launchpad.ProjectTier) int64 Inspect
getCalculatedLeftReward : func(t *launchpad.ProjectTier) int64 Inspect
depositToTier : func(t *launchpad.ProjectTier, deposit *launchpad.Deposit) Inspect
withdrawToTier : func(t *launchpad.ProjectTier, deposit *launchpad.Deposit) Inspect
updateTierDistributeAmountPerSecond : func(t *launchpad.ProjectTier) Inspect
newProjectTier : func(projectID string, tierDuration int64, totalDistributeAmount int64, startTime int64, endTime int64) *launchpad.ProjectTier Inspect
isRewardManagerInitialized : func(r *launchpad.RewardManager) bool Inspect
getDepositRewardState : func(r *launchpad.RewardManager, depositId string) (*launchpad.RewardState, .uverse.error) Inspect
calculateRewardPerDepositX128 : func(r *launchpad.RewardManager, rewardPerSecondX128 *uint256.Uint, totalStaked int64, currentTime int64) (*uint256.Uint, .uverse.error) Inspect
addRewardStateByDeposit : func(r *launchpad.RewardManager, deposit *launchpad.Deposit) *launchpad.RewardState Inspect
addRewardState : func(r *launchpad.RewardManager, deposit *launchpad.Deposit, rewardState *launchpad.RewardState) *launchpad.RewardState Inspect
removeRewardState : func(r *launchpad.RewardManager, depositId string) Inspect
addRewardPerDepositX128 : func(r *launchpad.RewardManager, rewardPerDepositX128 *uint256.Uint, currentTime int64) .uverse.error Inspect
updateRewardPerDepositX128 : func(r *launchpad.RewardManager, totalDepositAmount int64, currentTime int64) .uverse.error Inspect
updateDistributeAmountPerSecondX128 : func(r *launchpad.RewardManager, totalDistributeAmount int64, distributeStartTime int64, distributeEndTime int64) Inspect
collectReward : func(r *launchpad.RewardManager, depositId string, currentTime int64) (int64, .uverse.error) Inspect
newRewardManager : func(totalDistributeAmount int64, distributeStartTime int64, distributeEndTime int64, rewardCollectableDuration int64) *launchpad.RewardManager Inspect
calculateClaimableRewardsForActiveDeposits : func(r *launchpad.RewardManager) int64 Inspect
isRewardStateClaimable : func(r *launchpad.RewardState, currentTime int64) bool Inspect
calculateReward : func(r *launchpad.RewardState, accumRewardPerDepositX128 *uint256.Uint) int64 Inspect
calculateClaimableReward : func(r *launchpad.RewardState, accumRewardPerDepositX128 *uint256.Uint) int64 Inspect
MAX_INT64 : untyped bigint =(9223372036854775807 <untyped> bigint)
MIN_INT64 : untyped bigint =(-9223372036854775808 <untyped> bigint)
buildConditionEventAttrs : func(conditionTokens string, conditionAmounts string) []string Inspect
parseProjectTierID : func(projectTierID string) (string, int64) Inspect