v1 source realm
Package nft is the Launchpad collection ledger. Each collection is a GRC721 token whose transfer mode, royalties and ...
Package nft is the Launchpad collection ledger. Each collection is a GRC721 token whose transfer mode, royalties and metadata rules are fixed at creation. Collections are created, and their tokens minted, only by issuer realms: the Launchpad drops realm and any realm the config admin adds. Holders move, approve and burn their own tokens. The ledger has no admin of its own: nothing here can move a holder's token or change a collection's terms, and a paused lane stops only new collections and new mints.
2
const dropsPath, marketPath, ModeOpen, ModeRoyaltyProtected, ModeSoulbound, StatusActive, StatusBurned, StatusRevoked
38
func AcceptCreator
crossing ActionAcceptCreator makes the caller the creator it was proposed as.
func AllowMarket
crossing ActionAllowMarket adds a realm through which a royalty-protected collection's tokens may be sold. The list starts with the Launchpad market and only grows: a holder's way out can be widened, never taken away. The ledger cannot make a realm pay: the creator vouches that the market it lists pays this collection's royalties, and every holder can read the list.
func ApprovalJSON
ActionApprovalJSON answers, in one read, whether operator may move an active token: by a single-token approval or by the owner's collection-wide one.
func Approve
crossing ActionApprove lets one account move one token; an empty address clears it. A soulbound token takes no approval at all, a royalty-protected one only a listed market.
func BalanceOf
Actionfunc Burn
crossing ActionBurn is the holder's alone, in every mode. No creator, operator or admin can destroy a token somebody else holds, except through Revoke.
func CapabilitiesJSON
ActionCapabilitiesJSON tells a wallet or a market what a holder of this collection can do, without it knowing the modes. "markets" is empty when any operator may be approved. Royalties are paid by markets at sale. "royaltyEnforcement" is "none" without royalties; "market_sales" for an open collection, where the ledger enforces nothing: a market that honours royalties pays them at a sale, and a direct transfer or any other realm pays none; "listed_markets" when the ledger lets a token move only through the realms in "markets". Whether a listed realm pays is the word of the creator who listed it. "creatorRevoke" is the creator's right to revoke a token of a revocable soulbound collection.
func CollectionJSON
Actionfunc CommitTraits
crossing ActionCommitTraits records, once, the Merkle root of the collection's traits. It waits for frozen metadata so the root cannot outlive the files it describes. A leaf is sha256(0x00 || "launchpad-trait-v1|<collection>|<number>|<type>=<value>") in a p/samcrew/launchpad/merkle/v1 tree, where neither the type nor the value contains "=" or "|": a leaf has then one reading only, and a leaf that breaks the rule matches no trait offer. The ledger cannot check the root against the files; whoever relies on it must recompute it from them.
func Count
Actionfunc Create
crossing ActionCreate registers a collection for a creator the calling issuer realm has authenticated and charged. The issuer is recorded on the collection and no other realm can mint into it. royalties is "address:bps;address:bps" with addresses in strictly ascending order, or empty; the metadata arguments are those of newMetadata.
func Epoch
ActionEpoch returns the ID of a token's current custody: a new one at every move and every change of its single-token approval (the same approval again changes nothing), never one given before; 0 for a retired token. A market binds an order to it, so the order dies with the custody it was made under.
func FreezeMetadata
crossing ActionFreezeMetadata gives up the right to change a mutable collection's base URI.
func FreezeProfile
crossing Actionfunc HoldingsJSON
ActionHoldingsJSON pages through the tokens an account holds, across every collection, in collection then number order.
func IsApprovedForAll
Actionfunc ListCollectionsJSON
ActionListCollectionsJSON pages through a summary of every collection, in creation order. CollectionJSON has the full record.
func MintTo
crossing ActionMintTo issues the next token number. Only the collection's issuer calls it, after its own accounting of stages and payment. The ledger mints to whoever the issuer names: it is the issuer's duty to mint a soulbound token only to the wallet that asked for it.
func ProposeCreator
crossing ActionProposeCreator starts handing the creator role to another account. Nothing changes until that account accepts; an empty address withdraws the offer.
func Render
func Reveal
crossing ActionReveal publishes the base URI committed at creation, with the salt that opens the commitment, and fixes it for good. The commitment stays bound to the account that created the collection, whoever holds the creator role now.
func RevealCommitment
ActionRevealCommitment is what a creator commits to at creation and opens at Reveal: sha256("launchpad-reveal-v1|<creator>|<salt>|<base URI>"), with a salt of 64 hex digits the creator keeps secret until then. The salt keeps a guessed URI from being confirmed before the reveal. The creator's address keeps another account from reusing the commitment: a collection's ID does not exist yet when its creator commits, so the account stands in for it.
func Revoke
crossing ActionRevoke retires a credential. It exists only for soulbound collections created as revocable, a term every holder could read before claiming. A holder who burns first leaves a burned token, not a revoked one.
func RoyaltyBPS
Actionfunc SealSupply
crossing ActionSealSupply ends minting for good, whatever the cap was.
func SetApprovalForAll
crossing ActionSetApprovalForAll lets, or stops letting, one account move every token the caller holds in the collection.
func SetBaseURI
crossing ActionSetBaseURI points a mutable collection at new metadata. Every change is announced with its revision number.
func SetIssuer
crossing ActionSetIssuer moves the collection's minting to another issuer realm, for instance a later version of the one that created it. Only the creator can choose it, and only among realms allowed to issue.
func SetProfile
crossing Actionfunc StatusOf
Actionfunc TokenJSON
ActionTokenJSON describes one minted number. A retired token has no owner.
func TokenURI
ActionTokenURI answers for every minted number, retired or not: the metadata of a burned token is still part of the collection's public record.
func TokensJSON
ActionTokensJSON pages through a collection's minted numbers in order, retired ones included.
func TotalSupply
Actionfunc TraitsRoot
ActionTraitsRoot is empty until the creator commits one.
func TransferFrom
crossing ActionTransferFrom moves a token when the collection's mode lets the caller move one, and the caller owns it or is approved for it.
func GetInfo
Actionfunc RoyaltyQuote
ActionRoyaltyQuote floors each receiver's share of price. The seller keeps the rounding remainder.
2
type Info
struct 1type Info struct {
2 ID string // "C<n>"
3 GRC721ID string
4 Issuer address // the only realm that mints into the collection
5 Creator address
6 Originator address // the creator at creation, whoever holds the role now
7 PendingCreator address
8 Name string
9 Symbol string
10 Description string
11 Image string
12 Banner string
13 Website string
14 Mode string
15 Revocable bool // soulbound only: the creator may revoke a token
16 MaxSupply int64 // zero means an uncapped open edition
17 Sealed bool // no token can ever be minted again
18 Minted int64 // includes retired tokens; numbers are never reused
19 ProfileFrozen bool
20}Info is a collection's public record. The creator may edit the profile fields until FreezeProfile, hand the creator role over and seal the supply; everything else is immutable.
type RoyaltyPayout
struct12
- chain stdlib
- crypto/sha256 stdlib
- encoding/hex stdlib
- gno.land/p/nt/avl/v0 package
- gno.land/p/nt/grc721/v0 package
- gno.land/p/nt/seqid/v0 package
- gno.land/p/samcrew/launchpad/currency/v1 package
- gno.land/p/samcrew/launchpad/meta/v1 package
- gno.land/p/samcrew/launchpad/safemath/v1 package
- gno.land/r/samcrew/launchpad/config/v1 realm
- strconv stdlib
- strings stdlib