Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

cust0dy state

Back to all declarations

require

func(cond bool, msg string)
Open
OID
0f956c…3d1a:5
require details

Inspect func

ClaimAdmin

func()

ClaimAdmin makes the caller the marketplace operator, once. The deployer calls this right after deployment; afterwards it panics for everyone. The first admin also becomes the first arbiter.

Open
OID
0f956c…3d1a:6
ClaimAdmin details

Inspect func

SetArbiter

func(a .uverse.address)

SetArbiter changes the dispute referee. Admin only.

Open
OID
0f956c…3d1a:7
SetArbiter details

Inspect func

WithdrawFees

func()

WithdrawFees sends accrued platform fees to the admin. Admin only.

Open
OID
0f956c…3d1a:8
WithdrawFees details

Inspect func

List

func(kindStr string, value string, priceUgnot int64) int

List creates a sell order for a domain, social handle or Gno handle. The asset is not verified yet; see VerificationCode and AttestVerified.

Open
OID
0f956c…3d1a:9
List details

Inspect func

VerificationCode

func(id int) string

VerificationCode is the string the seller must publish off-chain to prove control of the asset: a DNS TXT record for a domain, a bio/post code for a social or Gno handle. It binds the listing id and the seller address, so a code cannot be reused for someone else's listing.

Open
OID
0f956c…3d1a:10
VerificationCode details

Inspect func

AttestVerified

func(id int)

AttestVerified marks a listing as ownership-verified. Only the arbiter (or admin) may attest, and only after an off-chain check, for example with verifier/dns\_verify.py. The attestation is public and on the record.

Open
OID
0f956c…3d1a:11
AttestVerified details

Inspect func

CancelListing

func(id int)

CancelListing withdraws an open listing. Seller only, and only while no live escrow holds it.

Open
OID
0f956c…3d1a:12
CancelListing details

Inspect func

Buy

func(listingID int) int

Buy purchases a listing at full price. The buyer must attach exactly BuyerTotal(price) ugnot (price + 2.5% buyer fee). The coins lock in this realm until settlement. Returns the escrow id.

Open
OID
0f956c…3d1a:13
Buy details

Inspect func

MakeOffer

func(listingID int) int

MakeOffer locks coins as a buy-side offer on a listing. Offers are all-in: no extra buyer fee is charged if the seller accepts. Attach the offered amount as ugnot. Returns the offer id.

Open
OID
0f956c…3d1a:14
MakeOffer details

Inspect func

CancelOffer

func(offerID int)

CancelOffer withdraws an open offer and refunds the maker in full.

Open
OID
0f956c…3d1a:15
CancelOffer details

Inspect func

AcceptOffer

func(offerID int) int

AcceptOffer lets the seller accept an open offer. The offer's locked coins become the escrow; the buyer fee is waived (offers are all-in) and only the 5% seller fee applies at settlement. Returns the escrow id.

Open
OID
0f956c…3d1a:16
AcceptOffer details

Inspect func

MarkTransferSubmitted

func(escrowID int)

MarkTransferSubmitted records that the seller has started the off-chain handover (registrar push, credential handover, ...). This stops the buyer's automatic refund window; from here the exits are buyer confirmation or a dispute.

Open
OID
0f956c…3d1a:17
MarkTransferSubmitted details

Inspect func

ConfirmReceived

func(escrowID int)

ConfirmReceived settles the trade: the seller is paid the agreed price minus the 5% seller fee; the remainder of the locked coins is platform fee. Buyer only. Never confirm before the asset is actually in your control: confirming is final.

Open
OID
0f956c…3d1a:18
ConfirmReceived details

Inspect func

ClaimTimeoutRefund

func(escrowID int)

ClaimTimeoutRefund returns the full locked amount to the buyer after RefundWindow has passed without the seller submitting a transfer.

Open
OID
0f956c…3d1a:19
ClaimTimeoutRefund details

Inspect func

OpenDispute

func(escrowID int, reason string)

OpenDispute freezes a live trade for the arbiter. Either party may open one; the reason is stored on-chain.

Open
OID
0f956c…3d1a:20
OpenDispute details

Inspect func

ResolveDispute

func(escrowID int, paySeller bool)

ResolveDispute settles a disputed trade by arbiter decision: paySeller true pays the seller as on completion; false refunds the buyer in full. Every resolution is public on the record.

Open
OID
0f956c…3d1a:21
ResolveDispute details

Inspect func

settle

func(e *cust0dy.Escrow)

settle pays the seller and books the platform fee. The escrow state must already be terminal when this runs.

Open
OID
0f956c…3d1a:22
settle details

Inspect func

Render

func(path string) string

Render is the gnoweb entry point. Routes: "" order book, "l/\<id>" listing, "e/\<id>" deal room, "u/\<addr>" profile.

Open
OID
0f956c…3d1a:23
Render details

Inspect func

kindBadge

func(k cust0dy_core.AssetKind) string
Open
OID
0f956c…3d1a:26
kindBadge details

Inspect func

renderListing

func(l *cust0dy.Listing) string
Open
OID
0f956c…3d1a:28
renderListing details

Inspect func

renderEscrow

func(e *cust0dy.Escrow) string
Open
OID
0f956c…3d1a:29
renderEscrow details

Inspect func

renderProfile

func(addr string) string
Open
OID
0f956c…3d1a:30
renderProfile details

Inspect func

collectOpenListings

func() []*cust0dy.Listing
Open
OID
0f956c…3d1a:31
collectOpenListings details

Inspect func

shortAddr

func(a string) string
Open
OID
0f956c…3d1a:32
shortAddr details

Inspect func

RefundWindow

time.Duration

RefundWindow is how long a buyer can pull an automatic refund while the seller has not submitted any transfer. After the seller submits, the exit paths are buyer confirmation or a dispute.

Value

<zero>

Listing

type

Listing is one sell-side order.

Value

cust0dy.Listing

Offer

type

Offer is one buy-side order. The offered amount is locked at creation.

Value

cust0dy.Offer

Escrow

type

Escrow is one live trade.

Value

cust0dy.Escrow

listings

v0.Tree

// strconv id -> \*Listing

Open
OID
0f956c…3d1a:34
listings details

Inspect ref

offers

v0.Tree

// strconv id -> \*Offer

Open
OID
0f956c…3d1a:36
offers details

Inspect ref

escrows

v0.Tree

// strconv id -> \*Escrow

Open
OID
0f956c…3d1a:38
escrows details

Inspect ref

listingSeq

int

Value

3

offerSeq

int

Value

0

escrowSeq

int

Value

1

admin

.uverse.address

// marketplace operator; claims once, see ClaimAdmin

Value

<gnolang.StringValue>

arbiter

.uverse.address

// dispute referee; set by admin

Value

<gnolang.StringValue>

feesUgnot

int64

// total platform fees accrued (coins sit in the realm balance)

Value

1875000

getListing

func(id int) *cust0dy.Listing
Open
OID
0f956c…3d1a:49
getListing details

Inspect func

getOffer

func(id int) *cust0dy.Offer
Open
OID
0f956c…3d1a:50
getOffer details

Inspect func

getEscrow

func(id int) *cust0dy.Escrow
Open
OID
0f956c…3d1a:51
getEscrow details

Inspect func

send

func(to .uverse.address, ugnot int64)

send moves coins out of the realm balance. Only callable after the state transition has already been recorded by the caller.

Open
OID
0f956c…3d1a:52
send details

Inspect func

ListingCount

func() int

ListingCount returns the number of listings ever created.

Open
OID
0f956c…3d1a:53
ListingCount details

Inspect func

EscrowCount

func() int

EscrowCount returns the number of escrows ever created.

Open
OID
0f956c…3d1a:54
EscrowCount details

Inspect func

GetListing

func(id int) cust0dy.Listing

GetListing returns one listing by id.

Open
OID
0f956c…3d1a:55
GetListing details

Inspect func

GetEscrow

func(id int) cust0dy.Escrow

GetEscrow returns one escrow by id.

Open
OID
0f956c…3d1a:56
GetEscrow details

Inspect func

AccruedFees

func() int64

AccruedFees returns the total platform fees collected, in ugnot.

Open
OID
0f956c…3d1a:57
AccruedFees details

Inspect func
bankerNew : func() banker.Banker Inspect
require : func(cond bool, msg string) Inspect
ClaimAdmin : func() Inspect
SetArbiter : func(a .uverse.address) Inspect
WithdrawFees : func() Inspect
List : func(kindStr string, value string, priceUgnot int64) int Inspect
VerificationCode : func(id int) string Inspect
AttestVerified : func(id int) Inspect
CancelListing : func(id int) Inspect
Buy : func(listingID int) int Inspect
MakeOffer : func(listingID int) int Inspect
CancelOffer : func(offerID int) Inspect
AcceptOffer : func(offerID int) int Inspect
MarkTransferSubmitted : func(escrowID int) Inspect
ConfirmReceived : func(escrowID int) Inspect
ClaimTimeoutRefund : func(escrowID int) Inspect
OpenDispute : func(escrowID int, reason string) Inspect
ResolveDispute : func(escrowID int, paySeller bool) Inspect
settle : func(e *cust0dy.Escrow) Inspect
Render : func(path string) string Inspect
gnot : func(ugnot int64) string Inspect
kindBadge : func(k cust0dy_core.AssetKind) string Inspect
renderHome : func() string Inspect
renderListing : func(l *cust0dy.Listing) string Inspect
renderEscrow : func(e *cust0dy.Escrow) string Inspect
renderProfile : func(addr string) string Inspect
collectOpenListings : func() []*cust0dy.Listing Inspect
shortAddr : func(a string) string Inspect
RefundWindow : time.Duration =<zero>
Listing : type =cust0dy.Listing
Offer : type =cust0dy.Offer
Escrow : type =cust0dy.Escrow
listings : v0.Tree Inspect
offers : v0.Tree Inspect
escrows : v0.Tree Inspect
listingSeq : int =3
offerSeq : int =0
escrowSeq : int =1
admin : .uverse.address =<gnolang.StringValue>
arbiter : .uverse.address =<gnolang.StringValue>
feesUgnot : int64 =1875000
mustUserCall : func() Inspect
mustAdmin : func() Inspect
mustArbiter : func() Inspect
getListing : func(id int) *cust0dy.Listing Inspect
getOffer : func(id int) *cust0dy.Offer Inspect
getEscrow : func(id int) *cust0dy.Escrow Inspect
send : func(to .uverse.address, ugnot int64) Inspect
ListingCount : func() int Inspect
EscrowCount : func() int Inspect
GetListing : func(id int) cust0dy.Listing Inspect
GetEscrow : func(id int) cust0dy.Escrow Inspect
AccruedFees : func() int64 Inspect
Arbiter : func() .uverse.address Inspect
Admin : func() .uverse.address Inspect