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

v1 source realm

Package config is the versioned, governed configuration for Memba Launchpad. Its admin is the account that published ...

Overview

Package config is the versioned, governed configuration for Memba Launchpad. Its admin is the account that published it until a two-step handoff moves the role. Every lane starts paused and without terms.

Constants 1

const LaneDirect, LaneFairSale, LaneAirdrop, LaneCollection, LaneNFTDrops, LaneNFTMarket, NativeCurrency, LedgerTokens, LedgerNFT, maxCurrencies, maxIssuers, issuerPrefix, maxCreationFee

 1const (
 2	LaneDirect     = "direct"
 3	LaneFairSale   = "fairsale"
 4	LaneAirdrop    = "airdrop"
 5	LaneCollection = "collection"
 6	LaneNFTDrops   = "nft_drops"
 7	LaneNFTMarket  = "nft_market"
 8	NativeCurrency = "ugnot"
 9	LedgerTokens   = "tokens"
10	LedgerNFT      = "nft"
11	maxCurrencies  = 16
12	maxIssuers     = 32
13	issuerPrefix   = "gno.land/r/samcrew/"
14	maxCreationFee = sm.MaxInt64 / 12
15)
source

Functions 37

func ActionStatusJSON

Action
1func ActionStatusJSON(lane, currency string) string
source

ActionStatusJSON reports only the current config gate for a new action. Other realm, custody and publication requirements are separate.

func AllowIssuer

crossing Action
1func AllowIssuer(cur realm, ledger, pkgPath string)
source

AllowIssuer lists a realm under gno.land/r/samcrew/ as an issuer for one ledger to read. The list only grows, so a ledger can bind what an issuer created to that issuer for good.

func AssertLaneOpen

Action
1func AssertLaneOpen(lane, currency string)
source

AssertLaneOpen gates a new inflow: the lane is open and the currency is listed with complete terms. A caller that charges the terms in force reads them in the same transaction, as the NFT realms do; one that charges at the version its user signed for checks that version with AssertNewAction, as token creations and fair-sale launches do. The token lanes' exits use the terms recorded at launch and pass no gate.

func AssertNewAction

Action
1func AssertNewAction(lane, currency string, expectedVersion int64)
source

AssertNewAction also pins the version whose prices the caller signed for.

func GetTokenTerms

Action
1func GetTokenTerms(key string) string
source

GetTokenTerms is "<direct creation fee>,<fair-sale creation fee>,<raise cap>" in a currency.

func IsLaneReady

Action
1func IsLaneReady(lane, currency string) bool
source

IsLaneReady checks only immutable terms. The immediate allowlist is checked at action time so delisting cannot prevent an old launch's exits.

func IsUnspendable

Action
1func IsUnspendable(who address) bool
source

IsUnspendable reports whether a fee or a royalty paid to who could never be paid out again: who is one of the realms listed above, which have no function for that, or it is not an address as the chain writes one, so no caller can ever present it. It is a check for such receivers only, not for the recipient of a transfer: the sales realm is on the list and rightly holds and moves ledger balances of its own.

func Pause

crossing Action
1func Pause(cur realm, lane string)
source

Pause closes a lane to new launches and contributions. Claims, refunds and settlements never read the gate, so nothing here can hold funds back.

func ProposeAdmin

crossing Action
1func ProposeAdmin(cur realm, next address)
source

ProposeAdmin stages a handoff to a user account or a realm. Nothing changes until that exact address accepts, so a target that cannot call is harmless.

func RemoveCurrency

crossing Action
1func RemoveCurrency(cur realm, key string) int64
source

RemoveCurrency drops a currency's terms, its allowlist entry and its owed ceiling, so adding terms again later neither reopens it nor brings back an old ceiling by itself.

func SetPauser

crossing Action
1func SetPauser(cur realm, next address)
source

SetPauser names the one address, besides the admin, that may close lanes.

func SetSalesOwedCeiling

crossing Action
1func SetSalesOwedCeiling(cur realm, key string, ceiling int64)
source

SetSalesOwedCeiling bounds what the sales realm may owe in one currency, its fees, escrow, refunds and proceeds together, for a fair-sale contribution to be accepted. Nothing else reads it: settlements, claims, releases and sweeps go through at any ceiling, and a ceiling below what is already owed only stops new contributions. Unlike a pause, it lets running sales take orders while there is room. MaxInt64, the default, is no ceiling. It is not a term a launch signs for, so it adds no version.

func SetTokenTerms

crossing Action
1func SetTokenTerms(cur realm, key string, directCreationFee, fairSaleCreationFee, fairSaleRaiseCap int64) int64
source

SetTokenTerms prices token creation in one currency and bounds what a single fair sale may raise in it.

func SetTreasury

crossing Action
1func SetTreasury(cur realm, treasury address) int64
source

SetTreasury names the receiver of protocol fees. Once named it can be replaced, not removed.

func Unpause

crossing Action
1func Unpause(cur realm, lane, currency string)
source

Unpause opens a lane. It needs a pauser in place and one listed currency whose terms for the lane are complete.

Types 2

type CurrencyParams

struct
1type CurrencyParams struct {
2	Key                 string
3	DirectCreationFee   int64
4	FairSaleCreationFee int64 // never below DirectCreationFee: cancelling a sale returns its allocation
5	FairSaleRaiseCap    int64 // most quote one fair sale may hold in escrow; 0 closes fair sales
6	CollectionFee       int64
7}
source

CurrencyParams holds the terms of one quote currency. A fee of -1 closes the lane that charges it.

type Params

struct
1type Params struct {
2	PrimaryFeeBPS      int64 // share of settled fair-sale proceeds
3	NFTPrimaryFeeBPS   int64
4	NFTSecondaryFeeBPS int64
5	Treasury           address
6	Currencies         []CurrencyParams
7}
source

Params is one immutable snapshot of launch terms. A rate of -1 closes the lane that charges it.

Imports 7

Source Files 3