1package bazaargens23import (4 "chain"5 "chain/banker"6 "strconv"78 "gno.land/p/g1n4pl5uc4yt5r96m9w6fmdznx3x0jyg8l6arhmt/bazaar/fee/v1"9 factory "gno.land/r/g1n4pl5uc4yt5r96m9w6fmdznx3x0jyg8l6arhmt/bazaar/bazaarv5"10)1112func List(cur realm, id int, priceUgnot int64) {13 caller := requireUser(cur)14 if priceUgnot <= 0 {15 panic("col: price")16 }17 it := mustItem(id)18 if it.listed {19 panic("col: listed")20 }21 if it.owner != caller {22 panic("col: not owner")23 }24 grcTransfer(caller, caller, self, id)25 it.listed = true26 it.seller = caller27 it.price = priceUgnot28 it.owner = self29 items.Set(itemKey(id), it)30 chain.Emit("List", "id", strconv.Itoa(id), "seller", caller.String(), "price", strconv.FormatInt(priceUgnot, 10))31}3233func UpdatePrice(cur realm, id int, priceUgnot int64) {34 caller := requireUser(cur)35 if priceUgnot <= 0 {36 panic("col: price")37 }38 it := mustItem(id)39 if !it.listed {40 panic("col: not listed")41 }42 if it.seller != caller {43 panic("col: not seller")44 }45 it.price = priceUgnot46 items.Set(itemKey(id), it)47 chain.Emit("List", "id", strconv.Itoa(id), "seller", caller.String(), "price", strconv.FormatInt(priceUgnot, 10))48}4950func Cancel(cur realm, id int) {51 caller := requireUser(cur)52 it := mustItem(id)53 if !it.listed {54 panic("col: not listed")55 }56 if caller != it.seller {57 panic("col: not seller")58 }59 grcTransfer(self, self, it.seller, id)60 it.listed = false61 it.owner = it.seller62 it.seller = address("")63 it.price = 064 items.Set(itemKey(id), it)65 chain.Emit("Cancel", "id", strconv.Itoa(id))66}6768func Buy(cur realm, id int) {69 caller := requireUser(cur)70 it := mustItem(id)71 if !it.listed {72 panic("col: not listed")73 }74 if caller == it.seller {75 panic("col: self buy")76 }77 takeExact(it.price)78 price := it.price79 proto := fee.ProtocolFee(price, tradeProtocolBps(it.seller, caller))80 royal := int64(0)81 if royaltyBps > 0 {82 royal = fee.ProtocolFee(price, int64(royaltyBps))83 }84 if proto+royal > price {85 panic("col: fee")86 }87 sellerAmt := price - proto - royal88 share := int64(0)89 if proto > 0 {90 share = fee.ProtocolFee(proto, factory.GenesisShareBps())91 }92 sinkAmt := proto - share93 sink := factory.ProtocolSink()94 if proto > 0 && !sink.IsValid() {95 panic("col: sink")96 }97 bk := banker.NewBanker(banker.BankerTypeRealmSend, cur)98 if sellerAmt > 0 {99 bk.SendCoins(self, it.seller, chain.Coins{{Denom: nativeDenom, Amount: sellerAmt}})100 }101 if royal > 0 {102 bk.SendCoins(self, creator, chain.Coins{{Denom: nativeDenom, Amount: royal}})103 }104 if sinkAmt > 0 {105 bk.SendCoins(self, sink, chain.Coins{{Denom: nativeDenom, Amount: sinkAmt}})106 }107 if share > 0 {108 gaddr := factory.GenesisSink()109 if !gaddr.IsValid() {110 panic("col: genesis")111 }112 bk.SendCoins(self, gaddr, chain.Coins{{Denom: nativeDenom, Amount: share}})113 }114 grcTransfer(self, self, caller, id)115 it.listed = false116 it.owner = caller117 it.seller = address("")118 it.price = 0119 items.Set(itemKey(id), it)120 chain.Emit("Buy", "id", strconv.Itoa(id), "buyer", caller.String(), "fee", strconv.FormatInt(proto, 10))121}122123func Transfer(cur realm, to address, id int) {124 caller := requireUser(cur)125 if !to.IsValid() {126 panic("col: invalid address")127 }128 if to == caller || to == self {129 panic("col: invalid address")130 }131 it := mustItem(id)132 if it.listed {133 panic("col: listed")134 }135 if it.owner != caller {136 panic("col: not owner")137 }138 grcTransfer(caller, caller, to, id)139 it.owner = to140 items.Set(itemKey(id), it)141 chain.Emit("Transfer", "id", strconv.Itoa(id), "to", to.String())142}143144func ProtocolBps() int64 {145 return factory.ProtocolBps()146}147148func tradeProtocolBps(seller, buyer address) int64 {149 bps := ProtocolBps()150 d := factory.HolderDiscount(seller.String())151 if bd := factory.HolderDiscount(buyer.String()); bd > d {152 d = bd153 }154 if d > bps {155 return 0156 }157 return bps - d158}159160func grcTransfer(spender, from, to address, id int) {161 err := ledger.TransferFrom(spender, from, to, itemTid(id))162 if err != nil {163 panic("col: transfer")164 }165}166AddAllowlist(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)
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)
AllowN() int
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, tid string)
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
DropSaleOf() string
GetApproved(id int) string
GrcBalanceOf(addr string) int64
GrcName() string
GrcOwnerOf(id int) string
GrcSymbol() string
Hidden() bool
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
MintCapOf() int
Minted() int
MintPrice() int64
MintScheduleOf() string
Name() string
NameOf(id int) string
NextID() int
OnAllowlist(addr string) bool
OwnerOf(tid string) (string, interface {Error func() string})
Paused() bool
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})
PhaseMintCapOf() string
Prereveal() 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})
Reveal(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)
RevealCollection(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})
Revealed(id int) bool
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)
SetDropSale(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}, wlPriceUgnot int64, wlQty int)
SetHidden(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}, hide bool)
SetMintCap(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}, n int)
SetMintPrice(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}, priceUgnot int64)
SetMintSchedule(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}, wlStartUnix int64, wlEndUnix int64, publicStartUnix int64, publicEndUnix int64)
SetPhaseMintCap(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}, wlN int, pubN int)
SetPrereveal(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}, image string)
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)
StartPublic(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})
Symbol() string
TokenByIndex(index int64) string
TokenOfOwnerByIndex(owner string, index int64) string
TokensOf(owner string) string
TokenURI(tid string) 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, tid string)
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.
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.