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

drops/v1 package

Overview

Package drops creates Launchpad NFT collections and runs their primary mints. It charges the collection fee and each mint price, and pays the treasury and the creator inside the same transaction: it holds no funds between calls and has no admin.

Functions

AddStage

func AddStage(cur realm, id, kind string, start, end, price, floor, supplyCap, perWallet int64, root, gate, currencyKey string, maxFeeBPS int64) int

AddStage schedules a mint window and returns its index. The arguments are the terms of the stage, then the highest protocol fee the creator accepts. A collection has ten stages for its whole life: a stage that ended keeps its slot.

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/samcrew/launchpad/drops/v1" -func "AddStage" -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "gnoland-1" -remote "https://rpc.gno.land" ADDRESSgnokey query -remote "https://rpc.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/samcrew/launchpad/drops/v1" -func "AddStage" -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.gno.land" call.tx
  

AllowlistLeaf

func AllowlistLeaf(id string, index int, who address, allowance int64) merkle.Hash

AllowlistLeaf is the Merkle leaf that lets who mint up to allowance tokens in one stage: sha256(0x00 || "launchpad-drop-v1|<collection>|<stage>|<address>|<allowance>"). Only the chain's spelling of an address makes a leaf: a list written in capitals would name accounts that can never claim.

Params

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/samcrew/launchpad/drops/v1.AllowlistLeaf(,,,)"

Result

CreateCollection

func CreateCollection(cur realm, name, symbol, description, image, banner, website, mode string, revocable bool, maxSupply int64, metadataMode, baseURI, placeholderURI, commitment, provenance, royalties, currencyKey string, maxFee int64) string

CreateCollection registers the caller's collection in the NFT ledger and pays the collection fee to the treasury. maxFee is the highest fee the caller accepts: a fee above it aborts before anything is taken, whatever the caller's allowance. Native coins are attached for exactly the fee; a token is pulled for exactly the fee. The collection terms are documented on nft.Create.

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/samcrew/launchpad/drops/v1" -func "CreateCollection" -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "gnoland-1" -remote "https://rpc.gno.land" ADDRESSgnokey query -remote "https://rpc.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/samcrew/launchpad/drops/v1" -func "CreateCollection" -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.gno.land" call.tx
  

EditStage

func EditStage(cur realm, id string, index int, kind string, start, end, price, floor, supplyCap, perWallet int64, root, gate, currencyKey string, maxFeeBPS int64)

EditStage replaces a stage that has not started. Once a stage has opened its terms are final, whatever the replacement would have been: it can only be ended.

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/samcrew/launchpad/drops/v1" -func "EditStage" -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "gnoland-1" -remote "https://rpc.gno.land" ADDRESSgnokey query -remote "https://rpc.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/samcrew/launchpad/drops/v1" -func "EditStage" -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.gno.land" call.tx
  

EndStage

func EndStage(cur realm, id string, index int)

EndStage closes an open stage at once and for good. It asks no lane: a creator stops its own sale whatever is paused.

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/samcrew/launchpad/drops/v1" -func "EndStage" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "gnoland-1" -remote "https://rpc.gno.land" ADDRESSgnokey query -remote "https://rpc.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/samcrew/launchpad/drops/v1" -func "EndStage" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.gno.land" call.tx
  

GateUsed

func GateUsed(id string, index int, gateNumber int64) bool

GateUsed reports whether a gate token has already paid for a mint in a holder stage.

Params

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/samcrew/launchpad/drops/v1.GateUsed(,,)"

Result

Mint

func Mint(cur realm, id string, index int, currencyKey string, offered, allowance int64, proof string, gateNumber int64) int64

Mint sells the caller one token of an open stage and returns its number. currencyKey and offered are what the caller accepts to pay: the stage must be priced in that currency, and offered is the most it will take. Native coins are attached for exactly offered and the difference with the price comes back, which is what makes a falling price payable; a token is pulled for exactly the price. The price is split between the treasury (the fee pinned on the stage) and the creator. allowance and proof are for an allowlist stage, gateNumber for a holder stage; elsewhere they are zero and empty.

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/samcrew/launchpad/drops/v1" -func "Mint" -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "gnoland-1" -remote "https://rpc.gno.land" ADDRESSgnokey query -remote "https://rpc.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/samcrew/launchpad/drops/v1" -func "Mint" -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.gno.land" call.tx
  

MintedBy

func MintedBy(id string, index int, who string) int64

MintedBy is how many tokens who has minted in a stage. Only the chain's spelling of an address is an account: any other is refused, never read as 0.

Params

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/samcrew/launchpad/drops/v1.MintedBy(,,)"

Result

Render

func Render(path string) string

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/samcrew/launchpad/drops/v1.Render()"

Result

StagesJSON

func StagesJSON(id string) string

StagesJSON lists a collection's stages in index order. "currentPrice" is the price a mint would pay now, and is only meaningful while "open" is true.

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/samcrew/launchpad/drops/v1.StagesJSON()"

Result

TermsJSON

func TermsJSON(currencyKey string) string

TermsJSON is what creating a collection and scheduling a stage cost now: the collection fee in a currency and the protocol fee a new stage would pin. A value of -1 means the lane is closed; config's ActionStatusJSON tells whether a lane accepts new actions right now.

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/samcrew/launchpad/drops/v1.TermsJSON()"

Result