Reference / Contract functions
Contract functions
Every callable function, with permissions.
Profiles
| Function | Who | Effect |
|---|---|---|
| register(name, bio, contact) | anyone | creates your on-chain seller profile; name required |
| updateProfile(name, bio, contact) | registered seller | edits every profile field |
| setActive(bool) | registered seller | toggles visibility in the seller browse |
Listings
| Function | Who | Effect |
|---|---|---|
| createListing(kind, platform, handle, title, description, price) | registered seller | lists 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 Active | edits the listing before it sells |
| delist(id) | seller, while Active | hides the listing from the market |
| relist(id) | seller, while Delisted | puts it back on the market |
Escrow flow
| Function | Who | Effect |
|---|---|---|
| buy(id) | anyone but the seller | escrows the full price in USDG; Active → InEscrow |
| deliver(id, deliveryURI) | seller | posts the (encrypted) credential handover; starts the 3-day review window; re-callable to update the URI |
| confirmReceipt(id) | buyer | releases the escrow: fee to treasury, rest to seller |
| claimPayment(id) | seller | self-payout once the review window has passed; blocked while disputed |
| refundPurchase(id) | buyer | full refund if nothing was delivered within the delivery window; listing returns to the market |
| cancelSale(id) | seller | backs out of an escrowed sale; buyer refunded, listing relists |
| raiseDispute(id, reason) | buyer, while Delivered | flags a broken handover; freezes the seller's auto-claim |
| resolveDispute(id, releaseToSeller) | owner | pays the seller, or refunds the buyer and relists |
| rateSeller(id, 1-5, review) | buyer, once, after Sold | adds 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) | anyone | posts to the listing's public Q&A thread; 1-500 chars, emitted as an event only (nothing in storage) |
| boost(id, amount) | anyone with $AKA | spends $AKA to raise an Active listing's rank; tokens go to the treasury |
Reads
| Function | Returns |
|---|---|
| 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)
| Function | Bounds |
|---|---|
| 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 |