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 source realm

Package cust0dy is the Cust0dy marketplace realm: a peer-to-peer order book and automated escrow engine for Web2 doma...

Overview

Package cust0dy is the Cust0dy marketplace realm: a peer-to-peer order book and automated escrow engine for Web2 domains, social handles and Gno handles. Coins lock in this realm at purchase time and move only on settlement, refund, or arbiter resolution.

Honesty note: the assets themselves move off-chain (a registrar push, a password handover). The realm holds the payment, records verification attestations, and gives both sides a referee (the arbiter) when they disagree. It cannot force the off-chain transfer itself.

Constants 1

const RefundWindow

1const RefundWindow = 24 * time.Hour
source

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.

Functions 22

func AcceptOffer

crossing Action
1func AcceptOffer(cur realm, offerID int) int
source

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.

func AttestVerified

crossing Action
1func AttestVerified(cur realm, id int)
source

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.

func Buy

crossing Action
1func Buy(cur realm, listingID int) int
source

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.

func CancelListing

crossing Action
1func CancelListing(cur realm, id int)
source

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

func CancelOffer

crossing Action
1func CancelOffer(cur realm, offerID int)
source

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

func ClaimAdmin

crossing Action
1func ClaimAdmin(cur realm)
source

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.

func ClaimTimeoutRefund

crossing Action
1func ClaimTimeoutRefund(cur realm, escrowID int)
source

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

func ConfirmReceived

crossing Action
1func ConfirmReceived(cur realm, escrowID int)
source

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.

func List

crossing Action
1func List(cur realm, kindStr, value string, priceUgnot int64) int
source

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

func MakeOffer

crossing Action
1func MakeOffer(cur realm, listingID int) int
source

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.

func MarkTransferSubmitted

crossing Action
1func MarkTransferSubmitted(cur realm, escrowID int)
source

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.

func OpenDispute

crossing Action
1func OpenDispute(cur realm, escrowID int, reason string)
source

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

func Render

1func Render(path string) string
source

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

func ResolveDispute

crossing Action
1func ResolveDispute(cur realm, escrowID int, paySeller bool)
source

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.

func SetArbiter

crossing Action
1func SetArbiter(cur realm, a address)
source

SetArbiter changes the dispute referee. Admin only.

func VerificationCode

Action
1func VerificationCode(id int) string
source

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.

func WithdrawFees

crossing Action
1func WithdrawFees(cur realm)
source

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

Types 3

type Escrow

struct
 1type Escrow struct {
 2	ID            int
 3	ListingID     int
 4	Seller        address
 5	Buyer         address
 6	PriceUgnot    int64 // agreed price, before fees
 7	LockedUgnot   int64 // total coins locked by the buyer
 8	State         core.State
 9	FundedAt      time.Time
10	DisputeReason string
11}
source

Escrow is one live trade.

type Listing

struct
 1type Listing struct {
 2	ID         int
 3	Seller     address
 4	Kind       core.AssetKind
 5	Value      string
 6	PriceUgnot int64
 7	State      core.ListingState
 8	Verified   bool
 9	Created    time.Time
10}
source

Listing is one sell-side order.

type Offer

struct
1type Offer struct {
2	ID          int
3	ListingID   int
4	Maker       address
5	AmountUgnot int64
6	Open        bool
7	Created     time.Time
8}
source

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

Dependencies

Source Files 4