Reference / Contract functions

Contract functions

Every callable function, with permissions.

Profiles

FunctionWhoEffect
register(name, bio, contact)anyonecreates your on-chain seller profile; name required
updateProfile(name, bio, contact)registered selleredits every profile field
setActive(bool)registered sellertoggles visibility in the seller browse

Listings

FunctionWhoEffect
createListing(kind, platform, handle, title, description, price)registered sellerlists anything handoverable; kind is one of username / account / credits / followers / service / other; handle optional (empty for services), title required; price in USDG units (6 decimals); returns the listingId
updateListing(id, title, description, price)seller, while Activeedits the listing before it sells
delist(id)seller, while Activehides the listing from the market
relist(id)seller, while Delistedputs it back on the market

Escrow flow

FunctionWhoEffect
buy(id)anyone but the sellerescrows the full price in USDG; Active → InEscrow
deliver(id, deliveryURI)sellerposts the (encrypted) credential handover; starts the 3-day review window; re-callable to update the URI
confirmReceipt(id)buyerreleases the escrow: fee to treasury, rest to seller
claimPayment(id)sellerself-payout once the review window has passed; blocked while disputed
refundPurchase(id)buyerfull refund if nothing was delivered within the delivery window; listing returns to the market
cancelSale(id)sellerbacks out of an escrowed sale; buyer refunded, listing relists
raiseDispute(id, reason)buyer, while Deliveredflags a broken handover; freezes the seller's auto-claim
resolveDispute(id, releaseToSeller)ownerpays the seller, or refunds the buyer and relists
rateSeller(id, 1-5, review)buyer, once, after Soldadds to the seller's on-chain rating; review is an optional written note (max 500 chars) shown on the seller's profile
postMessage(id, text)anyoneposts to the listing's public Q&A thread; 1-500 chars, emitted as an event only (nothing in storage)
boost(id, amount)anyone with $AKAspends $AKA to raise an Active listing's rank; tokens go to the treasury

Reads

FunctionReturns
sellerCount() / sellerList(i) / getSeller(addr)enumerate profiles and read one (name, bio, contact, active, sales, rating stats)
listingCount() / getListing(id)enumerate listings and read full listing state, boostPoints included
averageRatingX100(addr)average rating times 100 (450 = 4.50 stars)
isRegistered(addr) / boostActive() / boostToken()profile and boost checks
feeBps() / treasury() / reviewPeriod() / deliveryPeriod() / usdg()protocol parameters

Admin (owner only)

FunctionBounds
setBoostToken(token)any ERC-20; 0x0 disables boosting
setFee(bps)0 to 1000 (10% hard cap)
setTreasury(addr)non-zero address
setReviewPeriod(seconds)1 to 30 days
setDeliveryPeriod(seconds)1 to 30 days