PathrockNetwork Gno Explorer
HomeBlocksTransactionsTokensRealmsPackagesValidatorsAnalytics

PathrockNetwork Gno Explorer — an independent explorer for Gno.land Mainnet (gnoland-1), operated by PathrockNetwork. Not an official Gno.land service.

gnowebarchive RPC

gno.land/r/gnoswap/launchpad

Realm
Open in gnoweb ↗

Overview

Kind
Realm (renderable)
Name
launchpad
Namespace
gnoswap
Files
19 (README)(gnomod.toml)
Exported functions
71
Module
gno.land/r/gnoswap/launchpad
gno
0.9

Files (19)

  • README.mdmarkdown
  • gnomod.tomltoml
  • counter.gnogno
  • deposit.gnogno
  • doc.gnogno
  • errors.gnogno
  • getter_utils.gnogno
  • getter.gnogno
  • project_condition.gnogno
  • project_tier.gnogno
  • project.gnogno
  • proxy.gnogno
  • render.gnogno
  • reward_manager.gnogno
  • reward_state.gnogno
  • state.gnogno
  • store.gnogno
  • types.gnogno
  • upgrade.gnogno
  • reward_state.gnogno
    1package launchpad23import (4	u256 "gno.land/p/gnoswap/uint256/v1"5)67// RewardState represents the state of a reward for a deposit.8

    Functions

    • CollectDepositGns(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, depositID string) (int64, interface {Error func() string})

    • CollectEmissionReward(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string})

    • CollectProtocolFee(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string})

    • CollectProtocolFeeReward(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, tokenPath string)

    • CollectRewardByDepositId(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, depositID string) int64

    • CreateProject(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, name string, tokenPath string, recipient string, depositAmount int64, conditionTokens string, conditionAmounts string, tier30Ratio int64, tier90Ratio int64, tier180Ratio int64, startTime int64) string

    • DefaultDeposit() struct{depositor .uverse.address; id string; projectID string; tier int64; depositAmount int64; withdrawnHeight int64; withdrawnTime int64; createdHeight int64; createdAt int64; endTime int64}

    • DepositGns(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, targetProjectTierID string, depositAmount int64, referrer string) string

    • GetCurrentDepositId() int64

    • GetDeposit(depositId string) (struct{depositor .uverse.address; id string; projectID string; tier int64; depositAmount int64; withdrawnHeight int64; withdrawnTime int64; createdHeight int64; createdAt int64; endTime int64}, interface {Error func() string})

    • GetDepositAmount(depositId string) (int64, interface {Error func() string})

    • GetDepositCount() int

    • GetDepositCreatedAt(depositId string) (int64, interface {Error func() string})

    • GetDepositCreatedHeight(depositId string) (int64, interface {Error func() string})

    • GetDepositEndTime(depositId string) (int64, interface {Error func() string})

    • GetDepositProjectID(depositId string) (string, interface {Error func() string})

    • GetDepositProjectTierID(depositId string) (string, interface {Error func() string})

    • GetDepositTier(depositId string) (int64, interface {Error func() string})

    • GetDepositWithdrawnHeight(depositId string) (int64, interface {Error func() string})

    • GetDepositWithdrawnTime(depositId string) (int64, interface {Error func() string})

    • GetImplementationPackagePath() string

    • GetProjectActiveStatus(projectId string) (bool, interface {Error func() string})

    • GetProjectCondition(projectId string, tokenPath string) (*gno.land/r/gnoswap/launchpad.ProjectCondition, interface {Error func() string})

    • GetProjectCreatedAt(projectId string) (int64, interface {Error func() string})

    • GetProjectCreatedHeight(projectId string) (int64, interface {Error func() string})

    • GetProjectDepositAmount(projectId string) (int64, interface {Error func() string})

    • GetProjectName(projectId string) (string, interface {Error func() string})

    • GetProjectRecipient(projectId string) (string, interface {Error func() string})

    • GetProjects() *gno.land/p/nt/bptree/rotree/v0.ReadOnlyTree

    • GetProjectTier(projectId string, tier int64) (*gno.land/r/gnoswap/launchpad.ProjectTier, interface {Error func() string})

    • GetProjectTierDistributeAmountPerSecondX128(projectId string, tier int64) (*gno.land/p/gnoswap/uint256/v1.Uint, interface {Error func() string})

    • GetProjectTierEndTime(projectId string, tier int64) (int64, interface {Error func() string})

    • GetProjectTierRewardAccumulatedDistributeAmount(projectTierId string) (int64, interface {Error func() string})

    • GetProjectTierRewardAccumulatedRewardPerDepositX128(projectTierId string) (*gno.land/p/gnoswap/uint256/v1.Uint, interface {Error func() string})

    • GetProjectTierRewardAccumulatedTime(projectTierId string) (int64, interface {Error func() string})

    • GetProjectTierRewardClaimableDuration(projectTierId string) (int64, interface {Error func() string})

    • GetProjectTierRewardDistributeAmountPerSecondX128(projectTierId string) (*gno.land/p/gnoswap/uint256/v1.Uint, interface {Error func() string})

    • GetProjectTierRewardDistributeEndTime(projectTierId string) (int64, interface {Error func() string})

    • GetProjectTierRewardDistributeStartTime(projectTierId string) (int64, interface {Error func() string})

    • GetProjectTierRewardManager(projectTierId string) (*gno.land/r/gnoswap/launchpad.RewardManager, interface {Error func() string})

    • GetProjectTierRewardManagerCount() int

    • GetProjectTierRewards(projectId string, tier int64) *gno.land/p/nt/bptree/rotree/v0.ReadOnlyTree

    • GetProjectTierRewardTotalClaimedAmount(projectTierId string) (int64, interface {Error func() string})

    • GetProjectTierRewardTotalDistributeAmount(projectTierId string) (int64, interface {Error func() string})

    • GetProjectTiersRatios(projectId string) (map[int64]int64, interface {Error func() string})

    • GetProjectTierStartTime(projectId string, tier int64) (int64, interface {Error func() string})

    • GetProjectTierTotalCollectedAmount(projectId string, tier int64) (int64, interface {Error func() string})

    • GetProjectTierTotalDepositAmount(projectId string, tier int64) (int64, interface {Error func() string})

    • GetProjectTierTotalDepositCount(projectId string, tier int64) (int64, interface {Error func() string})

    • GetProjectTierTotalDistributeAmount(projectId string, tier int64) (int64, interface {Error func() string})

    • GetProjectTierTotalWithdrawAmount(projectId string, tier int64) (int64, interface {Error func() string})

    • GetProjectTierTotalWithdrawCount(projectId string, tier int64) (int64, interface {Error func() string})

    • GetProjectTokenPath(projectId string) (string, interface {Error func() string})

    • GetRewardState(projectTierId string, depositId string) (*gno.land/r/gnoswap/launchpad.RewardState, interface {Error func() string})

    • GetTotalGNSStakedAmount() int64

    • MakeDeposit(depositID string, projectID string, tier int64, depositor string, depositAmount int64, createdHeight int64, createdTime int64, endTime int64) struct{depositor .uverse.address; id string; projectID string; tier int64; depositAmount int64; withdrawnHeight int64; withdrawnTime int64; createdHeight int64; createdAt int64; endTime int64}

    • MakeProjectID(tokenPath string, createdHeight int64) string

    • MakeProjectTierID(projectID string, duration int64) string

    • NewBPTreeN(fanout int) *gno.land/p/nt/bptree/v0.BPTree

    • NewCounter() *gno.land/r/gnoswap/launchpad.Counter

    • NewLaunchpadStore(kvStore interface {AddAuthorizedCaller func(int, .uverse.realm, .uverse.address, gno.land/p/gnoswap/store/v1.Permission) .uverse.error; Delete func(int, .uverse.realm, string) .uverse.error; Get func(string) (interface {}, .uverse.error); GetAddress func(string) (.uverse.address, .uverse.error); GetAllKeys func() ([]string, .uverse.error); GetAuthorizedCallers func() (map[.uverse.address]gno.land/p/gnoswap/store/v1.Permission, .uverse.error); GetBPTree func(string) (*gno.land/p/nt/bptree/v0.BPTree, .uverse.error); GetBool func(string) (bool, .uverse.error); GetDomainAddress func() .uverse.address; GetInt64 func(string) (int64, .uverse.error); GetString func(string) (string, .uverse.error); GetUint64 func(string) (uint64, .uverse.error); Has func(string) bool; IsWriteAuthorized func(.uverse.address) bool; RemoveAuthorizedCaller func(int, .uverse.realm, .uverse.address) .uverse.error; Set func(int, .uverse.realm, string, interface {}) .uverse.error; UpdateAuthorizedCaller func(int, .uverse.realm, .uverse.address, gno.land/p/gnoswap/store/v1.Permission) .uverse.error}) interface {GetDepositCounter func() *gno.land/r/gnoswap/launchpad.Counter; GetDeposits func() *gno.land/p/nt/bptree/v0.BPTree; GetProjectRecipients func() *gno.land/p/nt/bptree/v0.BPTree; GetProjectTierRewardManagers func() *gno.land/p/nt/bptree/v0.BPTree; GetProjects func() *gno.land/p/nt/bptree/v0.BPTree; GetTotalGNSStakedAmount func() int64; HasDepositCounterStoreKey func() bool; HasDepositsKey func() bool; HasProjectRecipientsKey func() bool; HasProjectTierRewardManagersKey func() bool; HasProjectsKey func() bool; HasTotalGNSStakedAmountKey func() bool; NextDepositID func() string; SetDepositCounter func(int, .uverse.realm, *gno.land/r/gnoswap/launchpad.Counter) .uverse.error; SetDeposits func(int, .uverse.realm, *gno.land/p/nt/bptree/v0.BPTree) .uverse.error; SetProjectRecipients func(int, .uverse.realm, *gno.land/p/nt/bptree/v0.BPTree) .uverse.error; SetProjectTierRewardManagers func(int, .uverse.realm, *gno.land/p/nt/bptree/v0.BPTree) .uverse.error; SetProjects func(int, .uverse.realm, *gno.land/p/nt/bptree/v0.BPTree) .uverse.error; SetTotalGNSStakedAmount func(int, .uverse.realm, int64) .uverse.error}

    • NewProject(name string, tokenPath string, depositAmount int64, recipient string, createdHeight int64, createdAt int64) *gno.land/r/gnoswap/launchpad.Project

    • NewProjectCondition(tokenPath string, minimumAmount int64) *gno.land/r/gnoswap/launchpad.ProjectCondition

    • NewProjectConditionsWithError(conditionTokens string, conditionAmounts string) ([]*gno.land/r/gnoswap/launchpad.ProjectCondition, interface {Error func() string})

    • NewProjectTier(projectID string, tierDuration int64, totalDistributeAmount int64, startTime int64, endTime int64) *gno.land/r/gnoswap/launchpad.ProjectTier

    • NewRewardManager(totalDistributeAmount int64, distributeStartTime int64, distributeEndTime int64, rewardCollectableDuration int64) *gno.land/r/gnoswap/launchpad.RewardManager

    • NewRewardState(accumulatedRewardPerDepositX128 *gno.land/p/gnoswap/uint256/v1.Uint, depositAmount int64, distributeStartTime int64, distributeEndTime int64, claimableTime int64) *gno.land/r/gnoswap/launchpad.RewardState

    • RegisterInitializer(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, initializer func(int, .uverse.realm, gno.land/r/gnoswap/launchpad.ILaunchpadStore) gno.land/r/gnoswap/launchpad.ILaunchpad)

    • Render(path string) string

    • TransferLeftFromProjectByAdmin(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, projectID string, recipient string) int64

    • UpgradeImpl(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, packagePath string)

    Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.

    Rendered

    RenderedRawgnoweb ↗
    // It contains the necessary data to manage and distribute rewards for a specific deposit.
    9type RewardState struct {
    10 priceDebtX128 *u256.Uint // price debt per GNS stake, Q128
    11 claimableTime int64 // time when reward can be claimed
    12
    13 depositAmount int64 // amount of GNS staked
    14 distributeStartTime int64 // time when launchpad started staking
    15 distributeEndTime int64 // end time of reward calculation
    16 accumulatedRewardAmount int64 // legacy field; v1 reward accounting does not populate it
    17 accumulatedTime int64 // last time when reward was calculated
    18 claimedAmount int64 // amount of reward claimed so far
    19}
    20
    21// NewRewardState creates a reward state initialized from a reward-per-deposit index.
    22//
    23// Parameters:
    24// - accumulatedRewardPerDepositX128: current accumulated reward-per-deposit index in Q128 fixed-point units; it becomes this deposit's initial price debt.
    25// - depositAmount: GNS amount staked by the deposit, in base units.
    26// - distributeStartTime: Unix timestamp in seconds when this deposit begins accruing rewards.
    27// - distributeEndTime: Unix timestamp in seconds when this deposit stops accruing rewards.
    28// - claimableTime: Unix timestamp in seconds after which the accrued reward can be claimed.
    29//
    30// Returns:
    31// - rewardState: newly allocated state with claimed and legacy accumulation fields initialized to zero.
    32func NewRewardState(
    33 accumulatedRewardPerDepositX128 *u256.Uint,
    34 depositAmount,
    35 distributeStartTime,
    36 distributeEndTime int64,
    37 claimableTime int64,
    38) *RewardState {
    39 return &RewardState{
    40 priceDebtX128: accumulatedRewardPerDepositX128,
    41 depositAmount: depositAmount,
    42 distributeStartTime: distributeStartTime,
    43 distributeEndTime: distributeEndTime,
    44 claimableTime: claimableTime,
    45 accumulatedRewardAmount: 0,
    46 claimedAmount: 0,
    47 }
    48}
    49
    50// PriceDebtX128 returns the deposit's initial reward index debt in Q128 fixed-point units.
    51//
    52// Returns:
    53// - debt: stored price debt used to subtract rewards accrued before this deposit joined.
    54func (rs *RewardState) PriceDebtX128() *u256.Uint {
    55 return rs.priceDebtX128
    56}
    57
    58// SetPriceDebtX128 replaces the deposit's initial reward index debt.
    59//
    60// Parameters:
    61// - debt: new price debt in Q128 fixed-point units; the value is copied into the state.
    62func (rs *RewardState) SetPriceDebtX128(debt *u256.Uint) {
    63 rs.priceDebtX128 = u256.Zero().Set(debt)
    64}
    65
    66// ClaimableTime returns the earliest Unix timestamp at which this reward may be claimed.
    67//
    68// Returns:
    69// - claimableTime: claimability timestamp in Unix seconds.
    70func (rs *RewardState) ClaimableTime() int64 {
    71 return rs.claimableTime
    72}
    73
    74// SetClaimableTime sets the earliest Unix timestamp at which this reward may be claimed.
    75//
    76// Parameters:
    77// - time: claimability timestamp in Unix seconds.
    78func (rs *RewardState) SetClaimableTime(time int64) {
    79 rs.claimableTime = time
    80}
    81
    82// DepositAmount returns the GNS principal represented by this reward state.
    83//
    84// Returns:
    85// - amount: staked GNS amount in base units used for reward allocation.
    86func (rs *RewardState) DepositAmount() int64 {
    87 return rs.depositAmount
    88}
    89
    90// SetDepositAmount replaces the GNS principal represented by this reward state.
    91//
    92// Parameters:
    93// - amount: staked GNS amount in base units used for reward allocation.
    94func (rs *RewardState) SetDepositAmount(amount int64) {
    95 rs.depositAmount = amount
    96}
    97
    98// DistributeStartTime returns the Unix timestamp when this deposit starts accruing rewards.
    99//
    100// Returns:
    101// - startTime: reward accrual start timestamp in Unix seconds.
    102func (rs *RewardState) DistributeStartTime() int64 {
    103 return rs.distributeStartTime
    104}
    105
    106// SetDistributeStartTime sets the Unix timestamp when this deposit starts accruing rewards.
    107//
    108// Parameters:
    109// - time: reward accrual start timestamp in Unix seconds.
    110func (rs *RewardState) SetDistributeStartTime(time int64) {
    111 rs.distributeStartTime = time
    112}
    113
    114// DistributeEndTime returns the Unix timestamp when this deposit stops accruing rewards.
    115//
    116// Returns:
    117// - endTime: reward accrual end timestamp in Unix seconds.
    118func (rs *RewardState) DistributeEndTime() int64 {
    119 return rs.distributeEndTime
    120}
    121
    122// SetDistributeEndTime sets the Unix timestamp when this deposit stops accruing rewards.
    123//
    124// Parameters:
    125// - time: reward accrual end timestamp in Unix seconds.
    126func (rs *RewardState) SetDistributeEndTime(time int64) {
    127 rs.distributeEndTime = time
    128}
    129
    130// AccumulatedRewardAmount returns the legacy accumulated reward field.
    131//
    132// Returns:
    133// - amount: legacy reward amount in token base units; v1 accounting normally leaves it at zero unless explicitly set.
    134func (rs *RewardState) AccumulatedRewardAmount() int64 {
    135 return rs.accumulatedRewardAmount
    136}
    137
    138// SetAccumulatedRewardAmount sets the legacy accumulated reward field.
    139//
    140// Parameters:
    141// - amount: legacy reward amount in token base units; v1 accounting does not update this field.
    142func (rs *RewardState) SetAccumulatedRewardAmount(amount int64) {
    143 rs.accumulatedRewardAmount = amount
    144}
    145
    146// AccumulatedTime returns the last timestamp recorded for reward accumulation.
    147//
    148// Returns:
    149// - time: last accumulated timestamp in Unix seconds, or zero before one is recorded.
    150func (rs *RewardState) AccumulatedTime() int64 {
    151 return rs.accumulatedTime
    152}
    153
    154// SetAccumulatedTime sets the last timestamp recorded for reward accumulation.
    155//
    156// Parameters:
    157// - time: last accumulated timestamp in Unix seconds.
    158func (rs *RewardState) SetAccumulatedTime(time int64) {
    159 rs.accumulatedTime = time
    160}
    161
    162// ClaimedAmount returns the reward amount already claimed for this deposit.
    163//
    164// Returns:
    165// - amount: claimed reward amount in token base units.
    166func (rs *RewardState) ClaimedAmount() int64 {
    167 return rs.claimedAmount
    168}
    169
    170// SetClaimedAmount replaces the reward amount already claimed for this deposit.
    171//
    172// Parameters:
    173// - amount: claimed reward amount in token base units.
    174func (rs *RewardState) SetClaimedAmount(amount int64) {
    175 rs.claimedAmount = amount
    176}
    177
    178// Clone returns an independent copy of this reward state, including a cloned Q128 price debt value.
    179//
    180// Returns:
    181// - rewardState: deep copy of the reward state that can be modified without changing the source.
    182func (rs RewardState) Clone() *RewardState {
    183 return &RewardState{
    184 priceDebtX128: rs.priceDebtX128.Clone(),
    185 claimableTime: rs.claimableTime,
    186 depositAmount: rs.depositAmount,
    187 distributeStartTime: rs.distributeStartTime,
    188 distributeEndTime: rs.distributeEndTime,
    189 accumulatedRewardAmount: rs.accumulatedRewardAmount,
    190 accumulatedTime: rs.accumulatedTime,
    191 claimedAmount: rs.claimedAmount,
    192 }
    193}
    194

    vm/qrender output, sanitized (docs/render-security.md) and displayed in an empty-sandbox iframe — scripts, forms and popups cannot run. Links stay inert in-preview; right-click to open.