# 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.
## 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
NewLaunchpadV1(launchpadStore 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}) interface {CollectDepositGns func(int, .uverse.realm, string) (int64, .uverse.error); CollectEmissionReward func(int, .uverse.realm); CollectProtocolFee func(int, .uverse.realm); CollectProtocolFeeReward func(int, .uverse.realm, string); CollectRewardByDepositId func(int, .uverse.realm, string) int64; CreateProject func(int, .uverse.realm, string, string, .uverse.address, int64, string, string, int64, int64, int64, int64) string; DepositGns func(int, .uverse.realm, string, int64, string) string; GetCurrentDepositId func() int64; GetDeposit func(string) (gno.land/r/gnoswap/launchpad.Deposit, .uverse.error); GetDepositAmount func(string) (int64, .uverse.error); GetDepositCount func() int; GetDepositCreatedAt func(string) (int64, .uverse.error); GetDepositCreatedHeight func(string) (int64, .uverse.error); GetDepositEndTime func(string) (int64, .uverse.error); GetDepositProjectID func(string) (string, .uverse.error); GetDepositProjectTierID func(string) (string, .uverse.error); GetDepositTier func(string) (int64, .uverse.error); GetDepositWithdrawnHeight func(string) (int64, .uverse.error); GetDepositWithdrawnTime func(string) (int64, .uverse.error); GetProjectActiveStatus func(string) (bool, .uverse.error); GetProjectCondition func(string, string) (*gno.land/r/gnoswap/launchpad.ProjectCondition, .uverse.error); GetProjectCreatedAt func(string) (int64, .uverse.error); GetProjectCreatedHeight func(string) (int64, .uverse.error); GetProjectDepositAmount func(string) (int64, .uverse.error); GetProjectName func(string) (string, .uverse.error); GetProjectRecipient func(string) (.uverse.address, .uverse.error); GetProjectTier func(string, int64) (*gno.land/r/gnoswap/launchpad.ProjectTier, .uverse.error); GetProjectTierDistributeAmountPerSecondX128 func(string, int64) (*gno.land/p/gnoswap/uint256/v1.Uint, .uverse.error); GetProjectTierEndTime func(string, int64) (int64, .uverse.error); GetProjectTierRewardAccumulatedDistributeAmount func(string) (int64, .uverse.error); GetProjectTierRewardAccumulatedRewardPerDepositX128 func(string) (*gno.land/p/gnoswap/uint256/v1.Uint, .uverse.error); GetProjectTierRewardAccumulatedTime func(string) (int64, .uverse.error); GetProjectTierRewardClaimableDuration func(string) (int64, .uverse.error); GetProjectTierRewardDistributeAmountPerSecondX128 func(string) (*gno.land/p/gnoswap/uint256/v1.Uint, .uverse.error); GetProjectTierRewardDistributeEndTime func(string) (int64, .uverse.error); GetProjectTierRewardDistributeStartTime func(string) (int64, .uverse.error); GetProjectTierRewardManager func(string) (*gno.land/r/gnoswap/launchpad.RewardManager, .uverse.error); GetProjectTierRewardManagerCount func() int; GetProjectTierRewardTotalClaimedAmount func(string) (int64, .uverse.error); GetProjectTierRewardTotalDistributeAmount func(string) (int64, .uverse.error); GetProjectTierRewards func(string, int64) *gno.land/p/nt/bptree/rotree/v0.ReadOnlyTree; GetProjectTierStartTime func(string, int64) (int64, .uverse.error); GetProjectTierTotalCollectedAmount func(string, int64) (int64, .uverse.error); GetProjectTierTotalDepositAmount func(string, int64) (int64, .uverse.error); GetProjectTierTotalDepositCount func(string, int64) (int64, .uverse.error); GetProjectTierTotalDistributeAmount func(string, int64) (int64, .uverse.error); GetProjectTierTotalWithdrawAmount func(string, int64) (int64, .uverse.error); GetProjectTierTotalWithdrawCount func(string, int64) (int64, .uverse.error); GetProjectTiersRatios func(string) (map[int64]int64, .uverse.error); GetProjectTokenPath func(string) (string, .uverse.error); GetProjects func() *gno.land/p/nt/bptree/rotree/v0.ReadOnlyTree; GetRewardState func(string, string) (*gno.land/r/gnoswap/launchpad.RewardState, .uverse.error); GetTotalGNSStakedAmount func() int64; Render func(string) string; TransferLeftFromProjectByAdmin func(int, .uverse.realm, string, .uverse.address) int64}
Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.
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.