PathrockNetwork Gno Explorer
HomeBlocksTransactionsRealmsPackagesValidatorsAnalytics

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
  • upgrade.gnogno
    1package launchpad23import (4	"gno.land/r/gnoswap/access/v1"5)67// RegisterInitializer registers a new launchpad implementation version.8// This function is called by each version (v1, v2, etc.) during initialization

    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 ↗
    9// to register their implementation with the proxy system.
    10//
    11// The initializer function creates a new instance of the implementation
    12// using the provided launchpadStore interface.
    13//
    14// Security: Only contracts within the domain path can register initializers.
    15// Each package path can only register once to prevent duplicate registrations.
    16//
    17// Parameters:
    18// - cur: current realm context; callers use cross(cur) when crossing into this realm.
    19// - initializer: callback that receives the implementation realm context and launchpad store, then returns the version's ILaunchpad implementation; its leading integer discriminator is invoked as 0.
    20func RegisterInitializer(cur realm, initializer func(_ int, rlm realm, launchpadStore ILaunchpadStore) ILaunchpad) {
    21 initializerFunc := func(_ int, rlm realm, domainStore any) any {
    22 access.AssertIsRlmCurrent(0, rlm)
    23
    24 currentLaunchpadStore, ok := domainStore.(ILaunchpadStore)
    25 if !ok {
    26 panic("domainStore is not an ILaunchpadStore")
    27 }
    28
    29 return initializer(0, rlm, currentLaunchpadStore)
    30 }
    31
    32 err := versionManager.RegisterInitializer(0, cur, initializerFunc)
    33 if err != nil {
    34 panic(err)
    35 }
    36
    37 err = updateImplementation()
    38 if err != nil {
    39 panic(err)
    40 }
    41}
    42
    43// UpgradeImpl switches the active launchpad implementation to a different version.
    44// This function allows seamless upgrades from one version to another without
    45// data migration or downtime.
    46//
    47// Security: Only admin or governance can perform upgrades.
    48// The new implementation must have been previously registered via RegisterInitializer.
    49//
    50// Parameters:
    51// - cur: current realm context; callers use cross(cur) when crossing into this realm.
    52// - packagePath: registered package path of the launchpad implementation to activate.
    53func UpgradeImpl(cur realm, packagePath string) {
    54 // Ensure only admin or governance can perform upgrades
    55 caller := cur.Previous().Address()
    56 access.AssertIsAdminOrGovernance(caller)
    57
    58 err := versionManager.ChangeImplementation(0, cur, packagePath)
    59 if err != nil {
    60 panic(err)
    61 }
    62
    63 err = updateImplementation()
    64 if err != nil {
    65 panic(err)
    66 }
    67}
    68
    69// GetImplementationPackagePath returns the package path of the currently active implementation.
    70//
    71// Returns:
    72// - packagePath: package path of the active implementation
    73func GetImplementationPackagePath() string {
    74 return versionManager.GetCurrentPackagePath()
    75}
    76

    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.