Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

pad source realm

Package pad is gnomemepad: a self-contained meme launchpad for gno.land.

Overview

Package pad is gnomemepad: a self-contained meme launchpad for gno.land.

Direction A — factory IS the market (no external AMM required):

Example
1Create → bonding curve (virtual CPMM, fair mint) → Graduate (atomic)
2→ locked real CPMM pool (permanent LP, no remove) → creator/protocol fees

Hybrid of Pump.fun (curve + graduation) and Noxa Fun (no external migration, permanent lock) adapted to Gno: banker push payments, on-chain Render discovery.

Constants 1

const TotalSupply, CurveSupply, PoolSeed, VirtualUgnot0, VirtualToken0, GraduationThreshold, FeeBPS, CreatorFeeShareBPS, ProtocolFeeShareBPS, CreateBondUgnot, BondRefundBuyers, BondRefundMaxHeights, AntiSnipeHeights, AntiSnipeMaxBuyBPS, StatusCurve, StatusGraduated, MaxTradeHistory, TradeSideBuy, TradeSideSell, TradeSideOpen, DenomUgnot

 1const (
 2	// Token economics
 3	TotalSupply int64 = 1_000_000_000
 4	CurveSupply int64 = 800_000_000 // sold on bonding curve
 5	PoolSeed    int64 = 200_000_000 // locked into CPMM at graduation
 6
 7	// Virtual constant-product seed (Pump-style)
 8	VirtualUgnot0 int64 = 30_000_000    // 30 GNOT virtual
 9	VirtualToken0 int64 = 1_073_000_191 // virtual token side
10
11	// Graduation when net ugnot raised into the curve reaches this.
12	// 50 GNOT — testnet-friendly; raise for production.
13	// Keep below the ugnot needed to exhaust CurveSupply on the virtual CPMM.
14	GraduationThreshold int64 = 50_000_000
15
16	// Fees: 1.20% total. Of the fee: 40% creator, 40% protocol, 20% LP/k remainder.
17	FeeBPS              int64 = 120
18	CreatorFeeShareBPS  int64 = 4000
19	ProtocolFeeShareBPS int64 = 4000
20
21	// Anti-spam create bond (1 GNOT). Refunded if min unique buyers hit before expire.
22	CreateBondUgnot      int64 = 1_000_000
23	BondRefundBuyers     int   = 5
24	BondRefundMaxHeights int64 = 100_000 // ~ loosely long window; chain-dependent
25
26	// Anti-snipe: first N heights after create, max buy as % of total supply (BPS of TotalSupply).
27	AntiSnipeHeights   int64 = 20
28	AntiSnipeMaxBuyBPS int64 = 500 // 5% of total supply per tx in first windows
29
30	// Status
31	StatusCurve     = 0
32	StatusGraduated = 1
33
34	// Trade history cap for per-token price charts (ring buffer).
35	MaxTradeHistory = 128
36	// Trade sides stored in history
37	TradeSideBuy  = 0
38	TradeSideSell = 1
39	TradeSideOpen = 2 // initial listing mark
40
41	DenomUgnot = "ugnot"
42)
source

Functions 24

func Buy

crossing Action
1func Buy(cur realm, id string) int64
source

Buy spends -send ugnot on the bonding curve; credits tokens to the caller. Auto-graduates when RaisedUgnot >= GraduationThreshold.

func ClaimCreatorFees

crossing Action
1func ClaimCreatorFees(cur realm, id string) int64
source

ClaimCreatorFees withdraws accrued creator fees for a launch.

func Create

crossing Action
1func Create(cur realm, name, symbol, uri string) string
source

Create deploys a fair-launch meme. Requires CreateBondUgnot via -send. No pre-mint; all tradeable float starts on the bonding curve.

func Graduate

crossing Action
1func Graduate(cur realm, id string)
source

Graduate permissionlessly moves a ready curve into a permanently locked CPMM.

func Init

crossing Action
1func Init(cur realm)
source

Init sets the protocol treasury. First EOA caller becomes fee recipient.

func LaunchInfo

Action
1func LaunchInfo(id string) string
source

LaunchInfo returns a single-line pipe-delimited summary for UIs/indexers:

Example
1id|name|symbol|status|raised|sold|buyers|creatorFees|poolUgnot|poolToken|uri|creator|virtualUgnot|virtualToken|created

status: 0=curve 1=graduated

func ListIDs

Action
1func ListIDs() string
source

ListIDs returns newline-separated launch IDs (sorted by AVL key / creation order).

func ParamsInfo

Action
1func ParamsInfo() string
source

ParamsInfo returns fixed MVP parameters for UI display. total|curve|poolSeed|gradThreshold|feeBps|createBond

func Render

1func Render(path string) string
source

Render provides on-chain discovery (gnoweb). Read-only by convention.

Paths:

Example
1""              — home / list
2token/{id}      — launch detail
3help            — API help

func Sell

crossing Action
1func Sell(cur realm, id string, tokensIn int64) int64
source

Sell burns curve tokens and pays ugnot (fee on output).

func SwapBuy

crossing Action
1func SwapBuy(cur realm, id string) int64
source

SwapBuy buys tokens from the graduated pool with -send ugnot.

func SwapSell

crossing Action
1func SwapSell(cur realm, id string, tokensIn int64) int64
source

SwapSell sells tokens into the graduated pool for ugnot.

func TradeCount

Action
1func TradeCount(id string) int
source

TradeCount returns number of stored chart samples for a launch.

func TradeHistory

Action
1func TradeHistory(id string) string
source

TradeHistory returns newline-separated chart points:

Example
1height|side|ugnot|tokens|priceScaled

side: 0=buy 1=sell 2=open/graduate. Ordered oldest → newest.

func Transfer

crossing Action
1func Transfer(cur realm, id string, to address, amount int64)
source

Transfer moves factory-ledger tokens between addresses.

Types 2

type Launch

struct
 1type Launch struct {
 2	ID      string
 3	Name    string
 4	Symbol  string
 5	URI     string
 6	Creator address
 7	Status  int
 8	Created int64 // block height
 9
10	// Virtual curve reserves
11	VirtualUgnot int64
12	VirtualToken int64
13	RealSold     int64 // tokens sold on curve (≤ CurveSupply)
14	RaisedUgnot  int64 // net ugnot collateral in curve (excl. fee vaults)
15
16	// Real pool (post-grad); LP permanently locked — no remove path
17	PoolUgnot int64
18	PoolToken int64
19
20	// Token balances: bech32 -> int64 (factory-managed ledger)
21	Balances avl.Tree
22
23	CreatorFees  int64
24	BondUgnot    int64
25	BondRefunded bool
26	UniqueBuyers avl.Tree
27	BuyerCount   int
28
29	// Chart history (ordered AVL keys)
30	Trades    avl.Tree // tradeKey -> *Trade
31	NextTrade int64
32}
source

Launch is one meme market: curve phase then locked pool phase.

type Trade

struct
1type Trade struct {
2	Height int64
3	Side   int // TradeSideBuy | TradeSideSell | TradeSideOpen
4	Ugnot  int64
5	Tokens int64
6	Price  int64 // ugnot per token * 1e6 after the trade
7}
source

Trade is one price sample for charts (capped history per launch).

Imports 10

Source Files 4