func AcceptAdministrator
crossing ActionAcceptAdministrator completes the handover started by ProposeAdministrator.
Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.
Package markets keeps collateral, positions and winning payouts on Gno. It does not discover external outcomes: each ...
Package markets keeps collateral, positions and winning payouts on Gno. It does not discover external outcomes: each market trusts its pinned oracle.
AcceptAdministrator completes the handover started by ProposeAdministrator.
Hash UTF-8 length-framed text, shared exactly with the backend source binding.
Buy creates positions only after exact payment and full market-specific collateral coverage. expectedPricePpm is the selected outcome's captured price.
Claim pays only the immediate caller's winning shares. Repeated calls abort; a losing position can be closed once with zero payout. A panic rolls back both state and bank effects in the Gno transaction.
1func CreateMarket(cur realm, id, question, rules, conditionID, yesTokenID, noTokenID string, closesAt, yesPricePpm int64, oracle address)CreateMarket freezes every field used to match an external result. There are deliberately no question/rules/source/oracle/price update functions.
1func FinalizeByOracle(cur realm, id, conditionID, rulesHash, yesTokenID, noTokenID, winner, evidenceHash string)FinalizeByOracle accepts only the pinned oracle and the entire immutable source binding. EvidenceHash commits to an externally verified final record. Neither a price threshold nor an unverified API response can call this by itself. A source can resolve before the planned closing date. Oracle finalization therefore closes trading immediately, without waiting for that deadline.
Fund adds non-refundable reserve capital, allocated solely to this market. No withdrawal or banker capability is exposed, even to the administrator.
Gno 1.5.0 does not include encoding/json. These read-only projections use explicit fields and JSON string escaping, without an external package.
MarketsJSON returns every market in creation order as one JSON array.
PositionsJSON returns the owner's positions across all markets, in market creation order. Markets where the owner never bought are omitted.
ProposeAdministrator starts a two-step handover. The proposed address must accept from its own direct user call, so a mistyped address cannot take over. Each market keeps the oracle it was created with.
Render draws the realm's public page on gnoweb: the market list at the root and one page per market at ":<id>". It is informational; the app reads JSON.
SetQuote publishes a new fixed quote while trading is open. expectedVersion prevents an operator from overwriting a quote it has not seen. Every Buy still checks the exact price its buyer reviewed.
QuoteHistory returns a detached copy of the published quotes.
1type Market struct {
2 ID string `json:"id"`
3 Question string `json:"question"`
4 Rules string `json:"rules"`
5 RulesHash string `json:"rulesHash"`
6 ConditionID string `json:"conditionId"`
7 YesTokenID string `json:"yesTokenId"`
8 NoTokenID string `json:"noTokenId"`
9 ClosesAt int64 `json:"closesAt"`
10 YesPricePpm int64 `json:"yesPricePpm"`
11 Oracle address `json:"oracle"`
12 EscrowUgnot int64 `json:"escrowUgnot"`
13 YesMicroShares int64 `json:"yesMicroShares"`
14 NoMicroShares int64 `json:"noMicroShares"`
15 Finalized bool `json:"finalized"`
16 Winner string `json:"winner"`
17 EvidenceHash string `json:"evidenceHash"`
18 FinalizedAt int64 `json:"finalizedAt"`
19 PaidUgnot int64 `json:"paidUgnot"`
20 QuoteVersion int64 `json:"quoteVersion"`
21 CreatedAt int64 `json:"createdAt"`
22 VolumeUgnot int64 `json:"volumeUgnot"`
23 Trades int64 `json:"trades"`
24}All amounts are integer ugnot. One million micro-shares is one share; a winning micro-share pays one ugnot (one whole share pays one GNOT).
QuotePoint records one published fixed quote. The history contains the creation quote and every later administrator requote, in block-time order.