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
README.mdPreviewRaw
# Launchpad

Token distribution platform for launching projects with time-locked GNS
deposits and project-token rewards.

## Overview

The launchpad supports projects with three lock tiers: 30, 90, and 180 days.
Project creators configure the project-token reward allocation for each tier,
and depositors receive rewards according to the selected tier.

## Gnoweb

The root `Render("")` delegates to the active implementation and shows realm identity, halt flags, project-creation roles, stored record counts, the deposit ID counter, total staked GNS, and timing and deposit requirements. Deposit records include withdrawn deposits.

GNS amounts use six-decimal base units; project rewards use their token's base units. Rendering reads stored counts and fixed configuration without traversing projects or deposits. Unsupported paths return `404`.

## Configuration

- **Pool Tiers**: 30 days, 90 days, and 180 days
- **Minimum Start Delay**: 3 days from project creation
- **Minimum Deposit**: 1 GNS (1,000,000 base units) and integer multiples of that amount
- **Reward Claim Delay**: 1 day after each deposit, capped at the selected tier's end time
- **Condition Delimiter**: Use `*PAD*` between condition expressions
- **Auto-Delegation**: Project deposits can be reflected in governance-staker accounting

## Core Features

- **Project Creation**: Admin or governance creates a project and its tiers
- **GNS Deposits**: Users deposit GNS into a selected project tier
- **Time-Locked Withdrawals**: A depositor can withdraw the original GNS only after the tier ends
- **Project-Token Rewards**: Rewards accrue over the tier duration and can be claimed after the claim delay
- **Administrative Refund**: Admin can transfer the remaining refundable project-token balance from an ended project to a supplied recipient; active depositor claims remain reserved

## Key Functions

### `CreateProject`

Creates a new project with token address, reward amount, tier configuration,
and optional `*PAD*`-separated conditions. Only admin or governance may call it.

### `DepositGns`

Deposits GNS into a project tier. The deposit amount must meet the minimum and
multiple rules.

### `CollectRewardByDepositId`

Claims the project-token reward for a deposit. Only the deposit owner can call
it, and the reward is claimable one day after deposit creation, capped by the
tier end time.

### `CollectDepositGns`

Settles any claimable project-token reward and then returns the original GNS
deposit. Only the deposit owner can call it, and the current time must be
strictly after the selected tier's end time.

### `TransferLeftFromProjectByAdmin`

Transfers the remaining refundable project-token balance from an ended project
to the supplied recipient. Only admin may call it; amounts reserved for active
depositor claims are not transferred.

## Approval Requirements

- `DepositGns` pulls GNS from the caller into the launchpad realm, so approve
  the launchpad realm for at least the deposit amount before calling.
- `CollectRewardByDepositId` and `CollectDepositGns` pay out to the caller and
  require no approval.

```go
// Approve the launchpad realm before depositing
launchpadAddress := access.MustGetAddress(prabc.ROLE_LAUNCHPAD.String())
gns.Approve(cross(cur), launchpadAddress, 10_000_000)
```

## Usage

```go
// Create a project (admin or governance; start must be at least 3 days away)
projectID := CreateProject(
    cross(cur),
    "Example Project",
    "gno.land/r/demo/projecttoken",
    recipientAddr,
    1_000_000_000,
    "", // no condition tokens
    "", // no condition amounts
    10, // 30-day tier ratio
    20, // 90-day tier ratio
    70, // 180-day tier ratio
    futureStartTimestamp,
)

// Deposit GNS into a 30-day tier; referrer is optional
depositID := DepositGns(cross(cur), projectID+":30", 10_000_000, "")

// Claim after the one-day delay
CollectRewardByDepositId(cross(cur), depositID)

// After the tier has ended, settle reward and withdraw principal
CollectDepositGns(cross(cur), depositID)

// Admin refund of the remaining project-token balance
TransferLeftFromProjectByAdmin(cross(cur), projectID, recipientAddr)
```

## Security

- Admin or governance authorization is required for project creation
- Deposits are locked until strictly after the selected tier's end time
- Project-token rewards are claimable only by the deposit owner and only after the one-day delay
- Withdrawal settles any claimable project-token reward before returning principal
- Administrative refunds require an ended project and preserve active depositor claims
- Conditions are evaluated for each deposit when configured
- Depositor and reward recipient addresses are validated

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 ↗

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.