const GOV_XGNS_PATH, GNS_TOKEN_KEY
contract paths
Token distribution platform for launching projects with time-locked GNS deposits and project-token rewards.
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.
*PAD* between condition expressionsCreateProjectCreates a new project with token address, reward amount, tier configuration,
and optional *PAD*-separated conditions. Only admin or governance may call it.
DepositGnsDeposits GNS into a project tier. The deposit amount must meet the minimum and multiple rules.
CollectRewardByDepositIdClaims 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.
CollectDepositGnsSettles 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.
TransferLeftFromProjectByAdminTransfers 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.
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.1// Approve the launchpad realm before depositing
2launchpadAddress := access.MustGetAddress(prabc.ROLE_LAUNCHPAD.String())
3gns.Approve(cross(cur), launchpadAddress, 10_000_000)
1// Create a project (admin or governance; start must be at least 3 days away)
2projectID := CreateProject(
3 cross(cur),
4 "Example Project",
5 "gno.land/r/demo/projecttoken",
6 recipientAddr,
7 1_000_000_000,
8 "", // no condition tokens
9 "", // no condition amounts
10 10, // 30-day tier ratio
11 20, // 90-day tier ratio
12 70, // 180-day tier ratio
13 futureStartTimestamp,
14)
15
16// Deposit GNS into a 30-day tier; referrer is optional
17depositID := DepositGns(cross(cur), projectID+":30", 10_000_000, "")
18
19// Claim after the one-day delay
20CollectRewardByDepositId(cross(cur), depositID)
21
22// After the tier has ended, settle reward and withdraw principal
23CollectDepositGns(cross(cur), depositID)
24
25// Admin refund of the remaining project-token balance
26TransferLeftFromProjectByAdmin(cross(cur), projectID, recipientAddr)
NewLaunchpadV1 constructs a version-one launchpad implementation backed by launchpadStore.
Parameters:
Returns: