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

memba_collections source realm

Package memba\_collections is the canonical, multi-collection NFT registry for the Memba open marketplace + launchpad...

Overview

Package memba_collections is the canonical, multi-collection NFT registry for the Memba open marketplace + launchpad. It is the ONE irreversible realm: it holds every launched collection's internal grc721 ledger, so it can never be redeployed without orphaning NFTs. The full frozen ABI lives in Memba/docs/planning/CANONICAL_COLLECTION_ABI.md (v3, build-ready).

Design anchors:

  • grc721 Reader/Writer split: the realm holds the concrete *metadataNFT behind the unexported membaNFT interface; writes derive the caller from unsafe.PreviousRealm().Address() inside crossing wrappers.
  • Royalty is enforced IN-REALM as BPS (never grc721's percent/100 path).
  • MarketTransfer is the ONLY token-movement path; only registered engines may call it (the moat). There is no public TransferFrom/gift/airdrop.
  • Both ugnot and GRC20 mint payments transit the realm via a per-denom proceeds ledger; CEI ordering is frozen (effects before interactions).

Constants 3

const MaxRoyaltyBPS, DefaultRoyaltyBPS, MinCreatorRoyaltyBPS, MinMintPrice, MaxPriceUgnot, MaxPrimaryFeeBPS, RoyaltySentinel, MaxSlugLen

 1const (
 2	MaxRoyaltyBPS        = 1000                  // 10% hard ceiling (defensive)
 3	DefaultRoyaltyBPS    = 500                   // 5% applied when creator passes RoyaltySentinel
 4	MinCreatorRoyaltyBPS = 0                     // creators may opt fully out
 5	MinMintPrice         = 1000                  // 0.001 GNOT — anti-truncation
 6	MaxPriceUgnot        = 1_000_000_000_000_000 // 1e15
 7	MaxPrimaryFeeBPS     = 2000                  // 20% — bounds primaryFeeBPS so MaxPriceUgnot*bps < MaxInt64
 8	RoyaltySentinel      = -1                    // CreateCollection royaltyBPS sentinel → DefaultRoyaltyBPS
 9	MaxSlugLen           = 64
10)
source

── Tunable bounds (constants — permanent) ──────────────────────────────────

const AdminAddress

1const AdminAddress = "g1x7k4628w93a7wzdhqc06atzx0v50rnshweuxu0"
source

AdminAddress is the Samouraï 2-of-2 multisig (samcrew-core-test1). Seeds platformAdmin, pauser, and feeRecipient at genesis; all three are mutable.

Functions 43

func Approve

crossing Action
1func Approve(cur realm, id string, operator address, tid grc721.TokenID)
source

Approve grants single-token transfer approval. Caller must own/operate.

func Burn

crossing Action
1func Burn(cur realm, id string, tid grc721.TokenID)
source

Burn destroys a token the caller owns and clears any per-token royalty. Burning never reopens a supply slot (nextAutoTokenID only increments, S-2).

func ClearTokenRoyalty

crossing Action
1func ClearTokenRoyalty(cur realm, id string, tid grc721.TokenID)
source

ClearTokenRoyalty removes a per-token override; the token falls back to the collection default. Admin only.

func CreateCollection

crossing Action
1func CreateCollection(cur realm, slug, name, symbol string, royaltyBPS int64, royaltyRecip, mintCustody address, maxSupply, maxPerWallet int64) string
source

CreateCollection launches a new collection. Open + fee-gated: anyone may call it, paying createFee in ugnot. royaltyBPS == RoyaltySentinel(-1) uses DefaultRoyaltyBPS; otherwise it is clamped to [MinCreatorRoyaltyBPS, maxCreatorRoyaltyBPS]. name/symbol are COSMETIC only — identity is the derived collectionID = caller/slug.

func ForceSetCollectionAdmin

crossing Action
1func ForceSetCollectionAdmin(cur realm, id string, newAdmin address)
source

ForceSetCollectionAdmin is the platformAdmin break-glass for a lost or compromised creator key. Event-logged.

func MarketTransfer

crossing Action
1func MarketTransfer(cur realm, id string, from, to address, tid grc721.TokenID)
source

MarketTransfer is the ONLY token-movement path. Only a registered market realm may call it; it moves the token via the realm's internal ledger with the market as the grc721 caller (the seller must have approved the market).

func Mint

crossing Action
1func Mint(cur realm, id string, to address, tokenURI string) string
source

Mint is the admin no-pay mint. Auto-assigns the next sequential tid.

func MintAllowlist

crossing Action
1func MintAllowlist(cur realm, id string, proof string, maxQty int64, tokenURI string) string
source

MintAllowlist mints in the allowlist phase. The caller proves membership via a Merkle proof of (caller, maxQty); per-wallet quantity is enforced.

`proof` is the comma-separated list of hex-encoded sibling hashes. It MUST cross the ABI as a single string: a vm/MsgCall arg cannot encode a []string (the VM only converts scalars and base64 []byte — gno convert.go), so a []string proof param would make this entrypoint uncallable from a wallet.

func MintPublic

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

MintPublic mints in the public phase, paying mintPrice in payDenom.

func MintedBy

Action
1func MintedBy(id string, who address) int64
source

MintedBy returns how many tokens an address has minted in a collection.

func Pause

crossing Action
1func Pause(cur realm)
source

Pause halts the whole registry. The fast pauser role OR platformAdmin.

func PauseCollection

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

PauseCollection / UnpauseCollection pause a single collection. Collection admin, pauser, or platformAdmin.

func RegisterMarket

crossing Action
1func RegisterMarket(cur realm, market address)
source

RegisterMarket authorizes a marketplace realm to call MarketTransfer. This is a drain key: platformAdmin only, event-logged.

func Render

1func Render(path string) string
source

Render mux:

Example
1""                 → paginated collection list (?page=N)
2"collection/<id>"  → collection detail

func SetApprovalForAll

crossing Action
1func SetApprovalForAll(cur realm, id string, operator address, approved bool)
source

SetApprovalForAll grants/revokes operator approval for all the caller's tokens in the collection (this is how a seller authorizes a marketplace).

func SetCollectionAdmin

crossing Action
1func SetCollectionAdmin(cur realm, id string, newAdmin address)
source

SetCollectionAdmin proposes a new collection admin (step 1 of 2).

func SetMintConfig

crossing Action
1func SetMintConfig(cur realm, id string, mintPrice int64, payDenom string, maxSupply, maxPerWallet, mintStartBlock, mintCooldownBlocks int64)
source

SetMintConfig sets the full mint configuration. Admin only. payDenom must be native ("" / "ugnot") or a currently-allowed denom. mintPrice (when > 0) must be in [MinMintPrice, MaxPriceUgnot]. maxSupply cannot be set below the number already minted. Emits MintConfigChanged carrying every cap (E-2).

func SetMintPhase

crossing Action
1func SetMintPhase(cur realm, id string, phase int, allowlistRoot string)
source

SetMintPhase sets the sale phase and (for the allowlist phase) the Merkle root. Admin only. Emits MintPhaseSet with the root for off-chain indexers.

func SetRoyalty

crossing Action
1func SetRoyalty(cur realm, id string, recip address, bps int64)
source

SetRoyalty updates the collection-default royalty. Admin only; bps must be in [MinCreatorRoyaltyBPS, maxCreatorRoyaltyBPS].

func SetTokenRoyalty

crossing Action
1func SetTokenRoyalty(cur realm, id string, tid grc721.TokenID, recip address, bps int64)
source

SetTokenRoyalty sets a per-token royalty override. PRESENCE of the override wins over the collection default — even bps==0 means "royalty OFF for this token" (S-1). Admin only; bps <= maxCreatorRoyaltyBPS.

func WithdrawProceeds

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

WithdrawProceeds sends a collection's accrued proceeds in `denom` to its fixed mintCustody. CEI: zero the ledger entry BEFORE sending.

func CollectionInfo

Action
1func CollectionInfo(id string) CollectionView
source

CollectionInfo returns a structured view of a collection.

Types 1

type CollectionView

struct
 1type CollectionView struct {
 2	ID           string
 3	Creator      address
 4	Admin        address
 5	Name         string
 6	Symbol       string
 7	RoyaltyBPS   int64
 8	RoyaltyRecip address
 9	Phase        int
10	MintPrice    int64
11	PayDenom     string
12	MaxSupply    int64
13	MaxPerWallet int64
14	Minted       int64
15	Paused       bool
16}
source

CollectionView is a structured read of a collection's public fields.

Imports 14

Source Files 10