Denom
untyped stringDenom is the only asset this realm accepts.
Value
"ugnot"
MaxFeeBps
int64MaxFeeBps is the hard protocol-fee cap: 1000 bps = 10%. The fee applies only to the seller's PROCEEDS at close — never to a refund, never to the winner's change, and never to a forfeited deposit (see Close).
Value
1000
SaleOpen
untyped string// in its commit, reveal, or awaiting-close phase
Value
"open"
SaleSettled
untyped string// closed WITH a winner; proceeds credited
Value
"settled"
SaleUnsold
untyped string// closed with no valid opening, or below reserve
Value
"unsold"
SaleCancelled
untyped string// seller cancelled before any commitment
Value
"cancelled"
PhaseCommit
untyped string// accepting commitments
Value
"commit"
PhaseReveal
untyped string// accepting openings
Value
"reveal"
PhaseCloseable
untyped string// reveal window shut; Close will succeed
Value
"closeable"
MinBid
int64Input bounds.
Value
1000
MaxBid
int64// 1,000,000 GNOT
Value
1000000000000
MinCommitBlocks
int64Input bounds.
Value
10
MinRevealBlocks
int64Input bounds.
Value
20
MaxWindowBlocks
int64Input bounds.
Value
7500000
CommitmentLen
untyped bigintInput bounds.
Value
(64 <untyped> bigint)
MinSaltLen
untyped bigintInput bounds.
Value
(16 <untyped> bigint)
MaxSaltLen
untyped bigintInput bounds.
Value
(128 <untyped> bigint)
MaxLotLen
untyped bigintInput bounds.
Value
(200 <untyped> bigint)
MaxBiddersPerSale
untyped bigintInput bounds.
Value
(25 <untyped> bigint)
MaxSalesPerSeller
untyped bigintInput bounds.
Value
(50 <untyped> bigint)
RenderLimit
untyped bigintInput bounds.
Value
(20 <untyped> bigint)
bid
typebid is one bidder's sealed commitment and, once opened, its contents.
Value
sealedbid.bid
sale
typeValue
sealedbid.sale
admin
.uverse.addressValue
<gnolang.StringValue>
pendingAdmin
.uverse.addressValue
<zero>
feeRecipient
.uverse.addressValue
<gnolang.StringValue>
feeBps
int64// snapshotted into NEW sales
Value
0
self
.uverse.addressValue
<gnolang.StringValue>
nextID
int64Value
1
sealed
int64// Σ deposits behind UNOPENED commitments in non-terminal sales
Value
0
revealed
int64// Σ deposits behind OPENED commitments awaiting close
Value
0
forfeitedTotal
int64// cumulative statistic across all sales
Value
0
sales
*v0.Tree// padID(id) -> \*sale
- OID
- 0c059f…028f:13
sales details
sellerNum
*v0.Tree// seller.String() -> \*int64, stored sales
- OID
- 0c059f…028f:16
sellerNum details
ledger
*feeledger.Ledger- OID
- 0c059f…028f:19
ledger details
init.35
func()- OID
- 0c059f…028f:23
init.35 details
CommitHash
func(amount int64, salt string) stringCommitHash returns the commitment for a bid of \`amount\` under \`salt\`: the sha256 of a LENGTH-PREFIXED encoding of the two parts, as 64 lowercase hex characters. The length prefixes are what make the encoding unambiguous — without them a commitment to (12, "34salt...") and one to (1, "234salt...") could collide, and a bidder could open a commitment as a bid they never made. The scheme follows p/moul/agents/commit/v0; see the package doc for why it is reimplemented rather than imported. This is a VIEW. Compute your commitment locally or with a read-only query — calling it inside a transaction publishes the salt and destroys the seal.
- OID
- 0c059f…028f:25
CommitHash details
CreateSale
func(lot string, reserve int64, minDeposit int64, commitBlocks int64, revealBlocks int64) int64CreateSale lists a lot for sealed-bid second-price sale. The caller becomes the seller. \`reserve\` is 0 (no reserve) or a floor in \[MinBid, MaxBid] that the HIGHEST revealed bid must meet for the sale to settle. Commitments are accepted for \`commitBlocks\` blocks, then openings for \`revealBlocks\` blocks, after which anyone may [Close](#Close). The current protocol fee is snapshotted in. Returns the id. \`minDeposit\` is the ENTRY PRICE per commitment, and it is the seller's one defence against slot squatting: a sale has at most MaxBiddersPerSale slots, a slot is never released, and a squatter who reveals a dust bid is refunded in full fee-free — so with no entry price a rival locks an honest bidder out of any sale for the cost of gas. Size it to the lot, not to the dust floor. 0 means "no preference", resolved to the max(MinBid, reserve) floor, which is the weakest setting and leaves the squatting cost at MaxBiddersPerSale times that floor. The floor includes the reserve because a bid under the reserve cannot win, so escrowing less than the reserve buys only a slot.
- OID
- 0c059f…028f:26
CreateSale details
Cancel
func(saleID int64)Cancel withdraws a sale that has taken no commitment. Seller only. Once any commitment stands the sale can only run to Close — a seller cannot pull the lot out from under an escrowed bidder, and cannot strand a deposit.
- OID
- 0c059f…028f:27
Cancel details
Commit
func(saleID int64, commitment string)Commit escrows a deposit behind a sealed bid. The caller attaches the deposit and supplies only \`commitment\` — [CommitHash](#CommitHash)(amount, salt) as 64 lowercase hex characters — so the realm learns the bid's CEILING (the deposit) and not the bid. The deposit is the ceiling on what can later be opened, so escrow at least what you intend to bid; escrow more to hide it better. One commitment per bidder per sale, and a commitment already present on this sale is refused (copying another bidder's hash without knowing its contents would otherwise be free and could never be opened).
- OID
- 0c059f…028f:28
Commit details
Reveal
func(saleID int64, amount int64, salt string)Reveal opens the caller's sealed bid on a sale whose commit window has shut. \`amount\` and \`salt\` must hash to the stored commitment, \`amount\` must be in \[MinBid, MaxBid], and \`amount\` must not exceed the deposit — a bidder who committed above their escrow has no valid opening and forfeits at Close. Opening does not move coins; it moves the deposit from the \`sealed\` bucket to the \`revealed\` one and records the bid for the clearing scan.
- OID
- 0c059f…028f:29
Reveal details
Close
func(saleID int64)Close settles a sale whose reveal window has shut. Anyone may call it; no sale's terminal state may depend on a party acting. The clearing rule: among the OPENED bids the highest wins and pays max(second-highest, reserve, MinBid) — a strict Vickrey price, floored so that a lone bidder does not win for nothing and so that a reserve is honoured as a price and not merely as a veto. Ties on the highest amount go to the EARLIEST opening, which makes the tie-break deterministic and independent of storage order, and a tie sets the second price equal to the first, so a tied winner pays their full bid. The money, all of it credited and none of it sent: - winner: change of \`deposit - price\`, fee-free (it is their own coin coming back, not a sale) - seller: \`price\`, at the sale's snapshotted fee - every other opened bid: its deposit back in full, fee-free - every UNOPENED commitment: deposit credited to the SELLER, fee-free. Fee-free is deliberate: a fee is a cut of a SALE, and taking a cut of liquidated damages would give the fee recipient a revenue interest in bidders failing to reveal. If no bid was opened, or the highest opened bid is below the reserve, the sale is Unsold: every opened bid is refunded in full and only the unopened commitments forfeit.
- OID
- 0c059f…028f:30
Close details
Claim
func(amount int64)Claim sends amount ugnot of the caller's claimable balance — refunds, winner's change, and seller proceeds — to the caller.
- OID
- 0c059f…028f:31
Claim details
ClaimAll
func()ClaimAll sends the caller's entire claimable balance to the caller.
- OID
- 0c059f…028f:32
ClaimAll details
SetFeeBps
func(bps int64)- OID
- 0c059f…028f:33
SetFeeBps details
SetFeeRecipient
func(recipient .uverse.address)- OID
- 0c059f…028f:34
SetFeeRecipient details
WithdrawFees
func()- OID
- 0c059f…028f:35
WithdrawFees details
SweepDenom
func(denom string)SweepDenom recovers out-of-band coins to the fee recipient. For the ledger denom the reserve is sealed + revealed + Liabilities() — escrowed deposits, claimable refunds, change, proceeds and the fee pot are all structurally unreachable.
- OID
- 0c059f…028f:36
SweepDenom details
TransferAdmin
func(successor .uverse.address)- OID
- 0c059f…028f:37
TransferAdmin details
AcceptAdmin
func()- OID
- 0c059f…028f:38
AcceptAdmin details
SaleInfo
func(saleID int64) (seller .uverse.address, reserve int64, minDeposit int64, feeBps int64, commitEnd int64, revealEnd int64, createdHeight int64, bids int64, revealedBids int64, status string)- OID
- 0c059f…028f:39
SaleInfo details
MinDeposit
func(saleID int64) int64MinDeposit is the resolved entry price for one commitment on this sale: the smallest deposit [Commit](#Commit) accepts. It is at least max(MinBid, reserve) and is the seller's defence against slot squatting (audit Y1; see [CreateSale](#CreateSale)).
- OID
- 0c059f…028f:40
MinDeposit details
Lot
func(saleID int64) stringLot returns the sale's free-text lot description.
- OID
- 0c059f…028f:41
Lot details
Phase
func(saleID int64) stringPhase reports where a sale is: "commit", "reveal" or "closeable" while it is open, else its terminal status. The phase is derived from the chain height and is never stored, so it cannot disagree with the guards.
- OID
- 0c059f…028f:42
Phase details
Status
func(saleID int64) stringStatus is the sale's STORED state -- one of "open", "settled", "unsold" or "cancelled". It answers a different question from [Phase](#Phase): an open sale has three distinct phases but only one status, and a closed one has a status that no longer moves with the chain height.
- OID
- 0c059f…028f:43
Status details
Winner
func(saleID int64) .uverse.address- OID
- 0c059f…028f:44
Winner details
Price
func(saleID int64) int64Price is the SECOND price the winner actually paid once the sale has Settled, else 0. It is not the winning bid; see [WinningBid](#WinningBid).
- OID
- 0c059f…028f:45
Price details
WinningBid
func(saleID int64) int64WinningBid is the highest OPENED bid on a sale, available as soon as it is revealed (a revealed bid is public). It is what the winner bid, not what they pay.
- OID
- 0c059f…028f:46
WinningBid details
SecondBid
func(saleID int64) int64SecondBid is the second-highest OPENED bid, or 0. With a tie on the highest it equals the highest.
- OID
- 0c059f…028f:47
SecondBid details
ProvisionalPrice
func(saleID int64) int64ProvisionalPrice is what the winner would pay if the sale closed right now: max(second bid, reserve, MinBid), or 0 if nothing is opened yet or the highest opening is below the reserve.
- OID
- 0c059f…028f:48
ProvisionalPrice details
CommitmentOf
func(saleID int64, bidder .uverse.address) stringCommitmentOf returns the bidder's stored commitment on a sale ("" if none).
- OID
- 0c059f…028f:49
CommitmentOf details
DepositOf
func(saleID int64, bidder .uverse.address) int64DepositOf returns the bidder's escrowed deposit on a sale (0 if none).
- OID
- 0c059f…028f:50
DepositOf details
HasRevealed
func(saleID int64, bidder .uverse.address) boolHasRevealed reports whether the bidder has opened their bid on a sale.
- OID
- 0c059f…028f:51
HasRevealed details
RevealedAmountOf
func(saleID int64, bidder .uverse.address) int64RevealedAmountOf returns the bidder's OPENED bid amount (0 while sealed). A revealed bid is public by construction — it travelled in a transaction.
- OID
- 0c059f…028f:52
RevealedAmountOf details
ForfeitedOf
func(saleID int64) int64ForfeitedOf is the total deposit liquidated to the seller on a closed sale (0 before close). A cumulative statistic, not a held balance.
- OID
- 0c059f…028f:53
ForfeitedOf details
BidsOn
func(saleID int64) int64BidsOn is how many commitments a sale holds; RevealedOn how many are opened.
- OID
- 0c059f…028f:54
BidsOn details
RevealedOn
func(saleID int64) int64- OID
- 0c059f…028f:55
RevealedOn details
BlocksLeft
func(saleID int64) int64BlocksLeft is how many blocks remain in the sale's current window (0 once the reveal window has shut or the sale is terminal).
- OID
- 0c059f…028f:56
BlocksLeft details
IsCloseable
func(saleID int64) boolIsCloseable reports whether Close would succeed right now.
- OID
- 0c059f…028f:57
IsCloseable details
HasSale
func(saleID int64) bool- OID
- 0c059f…028f:58
HasSale details
SalesOf
func(seller .uverse.address) int64- OID
- 0c059f…028f:59
SalesOf details
Admin
func() .uverse.address- OID
- 0c059f…028f:60
Admin details
PendingAdmin
func() .uverse.address- OID
- 0c059f…028f:61
PendingAdmin details
FeeRecipient
func() .uverse.address- OID
- 0c059f…028f:62
FeeRecipient details
FeeBps
func() int64- OID
- 0c059f…028f:63
FeeBps details
NumSales
func() int64- OID
- 0c059f…028f:64
NumSales details
ClaimableOf
func(a .uverse.address) int64- OID
- 0c059f…028f:65
ClaimableOf details
FeesAccrued
func() int64- OID
- 0c059f…028f:66
FeesAccrued details
Liabilities
func() int64- OID
- 0c059f…028f:67
Liabilities details
Sealed
func() int64- OID
- 0c059f…028f:68
Sealed details
Revealed
func() int64- OID
- 0c059f…028f:69
Revealed details
ForfeitedTotal
func() int64- OID
- 0c059f…028f:70
ForfeitedTotal details
Held
func() int64- OID
- 0c059f…028f:71
Held details
Address
func() .uverse.address- OID
- 0c059f…028f:72
Address details
Height
func() int64- OID
- 0c059f…028f:73
Height details
phaseOf
func(s *sealedbid.sale) stringphaseOf derives the sale's phase from the chain height. Nothing stores it, so it cannot disagree with the guards in Commit, Reveal and Close.
- OID
- 0c059f…028f:74
phaseOf details
clearing
func(s *sealedbid.sale) (h1 int64, h2 int64, winner .uverse.address, winnerSeq int64)- OID
- 0c059f…028f:75
clearing details
vickreyPrice
func(h2 int64, reserve int64) int64vickreyPrice is the clearing price: the second bid, floored by the reserve and by the dust floor. Each of the three is \<= the winning bid in the branch that uses it — h2 by definition, the reserve because a lower high bid is Unsold, and MinBid because Reveal rejects anything under it — so the winner's change is never negative.
- OID
- 0c059f…028f:76
vickreyPrice details
findBid
func(s *sealedbid.sale, bidder .uverse.address) *sealedbid.bid- OID
- 0c059f…028f:77
findBid details
assertCommitment
func(c string)assertCommitment accepts exactly CommitmentLen LOWERCASE hex characters. Uppercase is rejected rather than normalised: CommitHash emits lowercase, so an uppercase commitment could never be opened, and refusing it at Commit turns a silent total loss of the deposit into an immediate error.
- OID
- 0c059f…028f:78
assertCommitment details
mustSale
func(id int64) *sealedbid.sale- OID
- 0c059f…028f:79
mustSale details
assertNoSend
func()- OID
- 0c059f…028f:80
assertNoSend details
counter
func(tree *v0.Tree, a .uverse.address) *int64- OID
- 0c059f…028f:81
counter details
addChecked
func(a int64, b int64) (int64, bool)- OID
- 0c059f…028f:82
addChecked details
padID
func(id int64) string- OID
- 0c059f…028f:83
padID details
itoa
func(n int64) string- OID
- 0c059f…028f:84
itoa details
hasPrefix
func(s string, p string) bool- OID
- 0c059f…028f:85
hasPrefix details
Render
func(path string) string- OID
- 0c059f…028f:86
Render details
renderHome
func() string- OID
- 0c059f…028f:87
renderHome details
renderSale
func(idStr string) string- OID
- 0c059f…028f:88
renderSale details
priceCell
func(s *sealedbid.sale) string- OID
- 0c059f…028f:89