PathrockNetwork Gno Explorer
HomeBlocksTransactionsTokensRealmsPackagesValidatorsAnalytics

PathrockNetwork Gno Explorer — an independent explorer for Gno.land Mainnet (gnoland-1), operated by PathrockNetwork. Not an official Gno.land service.

gnowebarchive RPC

gno.land/r/g1n4pl5uc4yt5r96m9w6fmdznx3x0jyg8l6arhmt/bazaar/c/test

Realm
Open in gnoweb ↗

Overview

Kind
Realm (renderable)
Name
test
Namespace
g1n4pl5uc4yt5r96m9w6fmdznx3x0jyg8l6arhmt / bazaar / c
Files
3 (gnomod.toml)
Exported functions
48
Module
gno.land/r/g1n4pl5uc4yt5r96m9w6fmdznx3x0jyg8l6arhmt/bazaar/c/test
gno
0.9

Files (3)

  • gnomod.tomltoml
  • book.gnogno
  • test.gnogno
book.gnogno
1package test23import (4	"chain"5	"chain/banker"6	"strconv"78	"gno.land/p/g1n4pl5uc4yt5r96m9w6fmdznx3x0jyg8l6arhmt/bazaar/fee/v1"9	"gno.land/r/g1n4pl5uc4yt5r96m9w6fmdznx3x0jyg8l6arhmt/bazaar/factory"10)1112const protocolBps = int64(50)1314func List(cur realm, id int, priceUgnot int64) {15	caller := requireUser(cur)16	if priceUgnot <= 0 {17		panic("col: price")18	}19	it := mustItem(id)20	if it.listed {21		panic("col: listed")22	}23	if it.owner != caller {24		panic("col: not owner")25	}26	grcTransfer(caller, caller, self, id)27	it.listed = true28	it.seller = caller29	it.price = priceUgnot30	it.owner = self31	items.Set(itemKey(id), it)32	chain.Emit("List", "id", strconv.Itoa(id), "seller", caller.String(), "price", strconv.FormatInt(priceUgnot, 10))33}3435func UpdatePrice(cur realm, id int, priceUgnot int64) {36	caller := requireUser(cur)37	if priceUgnot <= 0 {38		panic("col: price")39	}40	it := mustItem(id)41	if !it.listed {42		panic("col: not listed")43	}44	if it.seller != caller {45		panic("col: not seller")46	}47	it.price = priceUgnot48	items.Set(itemKey(id), it)49	chain.Emit("List", "id", strconv.Itoa(id), "seller", caller.String(), "price", strconv.FormatInt(priceUgnot, 10))50}5152func Cancel(cur realm, id int) {53	caller := requireUser(cur)54	it := mustItem(id)55	if !it.listed {56		panic("col: not listed")57	}58	if caller != it.seller {59		panic("col: not seller")60	}61	grcTransfer(self, self, it.seller, id)62	it.listed = false63	it.owner = it.seller64	it.seller = address("")65	it.price = 066	items.Set(itemKey(id), it)67	chain.Emit("Cancel", "id", strconv.Itoa(id))68}6970func Buy(cur realm, id int) {71	caller := requireUser(cur)72	it := mustItem(id)73	if !it.listed {74		panic("col: not listed")75	}76	takeExact(it.price)77	if caller == it.seller {78		panic("col: self buy")79	}80	price := it.price81	proto := fee.ProtocolFee(price, protocolBps)82	royal := int64(0)83	if royaltyBps > 0 {84		royal = fee.ProtocolFee(price, int64(royaltyBps))85	}86	if proto+royal > price {87		panic("col: fee")88	}89	sellerAmt := price - proto - royal90	bk := banker.NewBanker(banker.BankerTypeRealmSend, cur)91	if sellerAmt > 0 {92		bk.SendCoins(self, it.seller, chain.Coins{{Denom: nativeDenom, Amount: sellerAmt}})93	}94	if royal > 0 {95		bk.SendCoins(self, creator, chain.Coins{{Denom: nativeDenom, Amount: royal}})96	}97	if proto > 0 {98		bk.SendCoins(self, factory.Address(), chain.Coins{{Denom: nativeDenom, Amount: proto}})99	}100	grcTransfer(self, self, caller, id)101	it.listed = false102	it.owner = caller103	it.seller = address("")104	it.price = 0105	items.Set(itemKey(id), it)106	chain.Emit("Buy", "id", strconv.Itoa(id), "buyer", caller.String(), "fee", strconv.FormatInt(proto, 10))107}108109func Transfer(cur realm, to address, id int) {110	caller := requireUser(cur)111	if !to.IsValid() {112		panic("col: invalid address")113	}114	if to == caller || to == self {115		panic("col: invalid address")116	}117	it := mustItem(id)118	if it.listed {119		panic("col: listed")120	}121	if it.owner != caller {122		panic("col: not owner")123	}124	grcTransfer(caller, caller, to, id)125	it.owner = to126	items.Set(itemKey(id), it)127	chain.Emit("Transfer", "id", strconv.Itoa(id), "to", to.String())128}129130func ProtocolBps() int64 {131	return protocolBps132}133134func grcTransfer(spender, from, to address, id int) {135	err := ledger.TransferFrom(spender, from, to, itemTid(id))136	if err != nil {137		panic("col: transfer")138	}139}140

Functions

  • AddDropItems(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, blob string)

  • Approve(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, to string, id int)

  • BalanceOf(addr string) int64

  • Buy(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, id int)

  • Cancel(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, id int)

  • CollectionOf(int) string

  • Creator() string

  • GetApproved(id int) string

  • GrcBalanceOf(addr string) int64

  • GrcName() string

  • GrcOwnerOf(id int) string

  • GrcSymbol() string

  • ImageOf(id int) string

  • Init(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, name string, symbol string, cover string, maxSupplyN int, mintPriceUgnot int64, royalty int64)

  • IsApprovedForAll(owner string, operator string) bool

  • ItemLine(id int) string

  • List(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, id int, priceUgnot int64)

  • ListDropSlots() string

  • Listed(id int) bool

  • ListOpen() string

  • LoadedOf() int

  • MaxSupply() int

  • Mint(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, name string, imageURL string) int

  • Minted() int

  • MintPrice() int64

  • Name() string

  • NameOf(id int) string

  • NextID() int

  • OwnerOf(id int) string

  • PauseMint(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string})

  • PriceOf(id int) int64

  • ProtocolBps() int64

  • PublicMint(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}) int

  • RarityOf(id int) string

  • Render(string) string

  • ResumeMint(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string})

  • RoyaltyBps() int

  • SellerOf(id int) string

  • SetApprovalForAll(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, operator string, approved bool)

  • SetRoyalty(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, bps int)

  • Symbol() string

  • TokensOf(owner string) string

  • TokenURI(id int) string

  • TotalSupply() int64

  • TraitsOf(id int) string

  • Transfer(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, to string, id int)

  • TransferFrom(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, from string, to string, id int)

  • UpdatePrice(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, id int, priceUgnot int64)

Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.

Rendered

RenderedRawgnoweb ↗

vm/qrender output, sanitized (docs/render-security.md) and displayed in an empty-sandbox iframe — scripts, forms and popups cannot run. Links stay inert in-preview; right-click to open.