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

gnofly package

Overview

Package gnofly is the wrapper that puts gnofly's planes on Bazaar (bazaar.gnomi.fun), the NFT marketplace of gno.land.

Bazaar lists the collections registered on its factory, bazaarv5, and sends its site's List, Buy and Cancel to the collection's own package. This realm is that package for the planes: Init registers it under the slug "gnofly" (its last path element), and it holds the book. It mints nothing: the planes are the tokens of gno.land/r/g1t2kg2vtr3fukg43eujkn6x53gfdyakhngt4sfd/gnofly/nfts/planes, moved with that realm's TransferFrom. A seller first approves this realm there (Approve, or SetApprovalForAll once); List then moves the plane here, in escrow, Buy hands it to the buyer and Cancel back to the seller.

A sale pays, out of its price: Bazaar's fee (read from the factory: its ProtocolBps less the holder discount, split between its sinks), the planes realm's royalty (5% to the gnofly treasury), and the rest to the seller.

It is version v1 of the market; v0 is the same book without Bazaar, which cannot register. SetPaused stops new listings for a move to a newer version; Cancel and Buy keep working, so no plane is ever stuck here.

Every write is a direct call from a wallet: no realm can list, buy or cancel in a user's name.

Function

Buy

func Buy(cur realm, id int)

Buy buys a listed plane: send exactly its price in ugnot. Out of the price: Bazaar's fee (bazaarFee, to its sinks), the planes realm's royalty (RoyaltyInfo: 5% to the gnofly treasury), and the rest to the seller; the plane goes to the buyer. It works while the market is paused.

Param

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/g1t2kg2vtr3fukg43eujkn6x53gfdyakhngt4sfd/gnofly/nfts/market/bazaar/v1/gnofly" -func "Buy" -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/g1t2kg2vtr3fukg43eujkn6x53gfdyakhngt4sfd/gnofly/nfts/market/bazaar/v1/gnofly" -func "Buy" -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