Skip to content Search Apps Documentation Source Content 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.

sealedbid state

Back to all declarations

Denom

untyped string

Denom is the only asset this realm accepts.

Value

"ugnot"

MaxFeeBps

int64

MaxFeeBps 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

int64

Input bounds.

Value

1000

MaxBid

int64

// 1,000,000 GNOT

Value

1000000000000

MinCommitBlocks

int64

Input bounds.

Value

10

MinRevealBlocks

int64

Input bounds.

Value

20

MaxWindowBlocks

int64

Input bounds.

Value

7500000

CommitmentLen

untyped bigint

Input bounds.

Value

(64 <untyped> bigint)

MinSaltLen

untyped bigint

Input bounds.

Value

(16 <untyped> bigint)

MaxSaltLen

untyped bigint

Input bounds.

Value

(128 <untyped> bigint)

MaxLotLen

untyped bigint

Input bounds.

Value

(200 <untyped> bigint)

MaxBiddersPerSale

untyped bigint

Input bounds.

Value

(25 <untyped> bigint)

MaxSalesPerSeller

untyped bigint

Input bounds.

Value

(50 <untyped> bigint)

RenderLimit

untyped bigint

Input bounds.

Value

(20 <untyped> bigint)

bid

type

bid is one bidder's sealed commitment and, once opened, its contents.

Value

sealedbid.bid

sale

type

Value

sealedbid.sale

admin

.uverse.address

Value

<gnolang.StringValue>

pendingAdmin

.uverse.address

Value

<zero>

feeRecipient

.uverse.address

Value

<gnolang.StringValue>

feeBps

int64

// snapshotted into NEW sales

Value

0

self

.uverse.address

Value

<gnolang.StringValue>

nextID

int64

Value

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

sellerNum

*v0.Tree

// seller.String() -> \*int64, stored sales

Open
OID
0c059f…028f:16
sellerNum details

Inspect pointer

CommitHash

func(amount int64, salt string) string

CommitHash 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.

Open
OID
0c059f…028f:25
CommitHash details

Inspect func

CreateSale

func(lot string, reserve int64, minDeposit int64, commitBlocks int64, revealBlocks int64) int64

CreateSale 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.

Open
OID
0c059f…028f:26
CreateSale details

Inspect func

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.

Open
OID
0c059f…028f:27
Cancel details

Inspect func

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).

Open
OID
0c059f…028f:28
Commit details

Inspect func

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.

Open
OID
0c059f…028f:29
Reveal details

Inspect func

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.

Open
OID
0c059f…028f:30
Close details

Inspect func

Claim

func(amount int64)

Claim sends amount ugnot of the caller's claimable balance — refunds, winner's change, and seller proceeds — to the caller.

Open
OID
0c059f…028f:31
Claim details

Inspect func

ClaimAll

func()

ClaimAll sends the caller's entire claimable balance to the caller.

Open
OID
0c059f…028f:32
ClaimAll details

Inspect func

SetFeeRecipient

func(recipient .uverse.address)
Open
OID
0c059f…028f:34
SetFeeRecipient details

Inspect func

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.

Open
OID
0c059f…028f:36
SweepDenom details

Inspect func

TransferAdmin

func(successor .uverse.address)
Open
OID
0c059f…028f:37
TransferAdmin details

Inspect func

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)
Open
OID
0c059f…028f:39
SaleInfo details

Inspect func

MinDeposit

func(saleID int64) int64

MinDeposit 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)).

Open
OID
0c059f…028f:40
MinDeposit details

Inspect func

Lot

func(saleID int64) string

Lot returns the sale's free-text lot description.

Open
OID
0c059f…028f:41
Lot details

Inspect func

Phase

func(saleID int64) string

Phase 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.

Open
OID
0c059f…028f:42
Phase details

Inspect func

Status

func(saleID int64) string

Status 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.

Open
OID
0c059f…028f:43
Status details

Inspect func

Winner

func(saleID int64) .uverse.address
Open
OID
0c059f…028f:44
Winner details

Inspect func

Price

func(saleID int64) int64

Price is the SECOND price the winner actually paid once the sale has Settled, else 0. It is not the winning bid; see [WinningBid](#WinningBid).

Open
OID
0c059f…028f:45
Price details

Inspect func

WinningBid

func(saleID int64) int64

WinningBid 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.

Open
OID
0c059f…028f:46
WinningBid details

Inspect func

SecondBid

func(saleID int64) int64

SecondBid is the second-highest OPENED bid, or 0. With a tie on the highest it equals the highest.

Open
OID
0c059f…028f:47
SecondBid details

Inspect func

ProvisionalPrice

func(saleID int64) int64

ProvisionalPrice 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.

Open
OID
0c059f…028f:48
ProvisionalPrice details

Inspect func

CommitmentOf

func(saleID int64, bidder .uverse.address) string

CommitmentOf returns the bidder's stored commitment on a sale ("" if none).

Open
OID
0c059f…028f:49
CommitmentOf details

Inspect func

DepositOf

func(saleID int64, bidder .uverse.address) int64

DepositOf returns the bidder's escrowed deposit on a sale (0 if none).

Open
OID
0c059f…028f:50
DepositOf details

Inspect func

HasRevealed

func(saleID int64, bidder .uverse.address) bool

HasRevealed reports whether the bidder has opened their bid on a sale.

Open
OID
0c059f…028f:51
HasRevealed details

Inspect func

RevealedAmountOf

func(saleID int64, bidder .uverse.address) int64

RevealedAmountOf returns the bidder's OPENED bid amount (0 while sealed). A revealed bid is public by construction — it travelled in a transaction.

Open
OID
0c059f…028f:52
RevealedAmountOf details

Inspect func

ForfeitedOf

func(saleID int64) int64

ForfeitedOf is the total deposit liquidated to the seller on a closed sale (0 before close). A cumulative statistic, not a held balance.

Open
OID
0c059f…028f:53
ForfeitedOf details

Inspect func

BidsOn

func(saleID int64) int64

BidsOn is how many commitments a sale holds; RevealedOn how many are opened.

Open
OID
0c059f…028f:54
BidsOn details

Inspect func

RevealedOn

func(saleID int64) int64
Open
OID
0c059f…028f:55
RevealedOn details

Inspect func

BlocksLeft

func(saleID int64) int64

BlocksLeft is how many blocks remain in the sale's current window (0 once the reveal window has shut or the sale is terminal).

Open
OID
0c059f…028f:56
BlocksLeft details

Inspect func

IsCloseable

func(saleID int64) bool

IsCloseable reports whether Close would succeed right now.

Open
OID
0c059f…028f:57
IsCloseable details

Inspect func

SalesOf

func(seller .uverse.address) int64
Open
OID
0c059f…028f:59
SalesOf details

Inspect func

PendingAdmin

func() .uverse.address
Open
OID
0c059f…028f:61
PendingAdmin details

Inspect func

FeeRecipient

func() .uverse.address
Open
OID
0c059f…028f:62
FeeRecipient details

Inspect func

ClaimableOf

func(a .uverse.address) int64
Open
OID
0c059f…028f:65
ClaimableOf details

Inspect func

ForfeitedTotal

func() int64
Open
OID
0c059f…028f:70
ForfeitedTotal details

Inspect func

phaseOf

func(s *sealedbid.sale) string

phaseOf derives the sale's phase from the chain height. Nothing stores it, so it cannot disagree with the guards in Commit, Reveal and Close.

Open
OID
0c059f…028f:74
phaseOf details

Inspect func

clearing

func(s *sealedbid.sale) (h1 int64, h2 int64, winner .uverse.address, winnerSeq int64)
Open
OID
0c059f…028f:75
clearing details

Inspect func

vickreyPrice

func(h2 int64, reserve int64) int64

vickreyPrice 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.

Open
OID
0c059f…028f:76
vickreyPrice details

Inspect func

findBid

func(s *sealedbid.sale, bidder .uverse.address) *sealedbid.bid
Open
OID
0c059f…028f:77
findBid details

Inspect func

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.

Open
OID
0c059f…028f:78
assertCommitment details

Inspect func

mustSale

func(id int64) *sealedbid.sale
Open
OID
0c059f…028f:79
mustSale details

Inspect func

counter

func(tree *v0.Tree, a .uverse.address) *int64
Open
OID
0c059f…028f:81
counter details

Inspect func

addChecked

func(a int64, b int64) (int64, bool)
Open
OID
0c059f…028f:82
addChecked details

Inspect func

hasPrefix

func(s string, p string) bool
Open
OID
0c059f…028f:85
hasPrefix details

Inspect func

renderSale

func(idStr string) string
Open
OID
0c059f…028f:88
renderSale details

Inspect func

priceCell

func(s *sealedbid.sale) string
Open
OID
0c059f…028f:89
priceCell details

Inspect func
Denom : untyped string ="ugnot"
MaxFeeBps : int64 =1000
SaleOpen : untyped string ="open"
SaleSettled : untyped string ="settled"
SaleUnsold : untyped string ="unsold"
SaleCancelled : untyped string ="cancelled"
PhaseCommit : untyped string ="commit"
PhaseReveal : untyped string ="reveal"
PhaseCloseable : untyped string ="closeable"
MinBid : int64 =1000
MaxBid : int64 =1000000000000
MinCommitBlocks : int64 =10
MinRevealBlocks : int64 =20
MaxWindowBlocks : int64 =7500000
CommitmentLen : untyped bigint =(64 <untyped> bigint)
MinSaltLen : untyped bigint =(16 <untyped> bigint)
MaxSaltLen : untyped bigint =(128 <untyped> bigint)
MaxLotLen : untyped bigint =(200 <untyped> bigint)
MaxBiddersPerSale : untyped bigint =(25 <untyped> bigint)
MaxSalesPerSeller : untyped bigint =(50 <untyped> bigint)
RenderLimit : untyped bigint =(20 <untyped> bigint)
bid : type =sealedbid.bid
sale : type =sealedbid.sale
admin : .uverse.address =<gnolang.StringValue>
pendingAdmin : .uverse.address =<zero>
feeRecipient : .uverse.address =<gnolang.StringValue>
feeBps : int64 =0
self : .uverse.address =<gnolang.StringValue>
nextID : int64 =1
sealed : int64 =0
revealed : int64 =0
forfeitedTotal : int64 =0
sales : *v0.Tree Inspect
sellerNum : *v0.Tree Inspect
ledger : *feeledger.Ledger Inspect
init.35 : func() Inspect
CommitHash : func(amount int64, salt string) string Inspect
CreateSale : func(lot string, reserve int64, minDeposit int64, commitBlocks int64, revealBlocks int64) int64 Inspect
Cancel : func(saleID int64) Inspect
Commit : func(saleID int64, commitment string) Inspect
Reveal : func(saleID int64, amount int64, salt string) Inspect
Close : func(saleID int64) Inspect
Claim : func(amount int64) Inspect
ClaimAll : func() Inspect
SetFeeBps : func(bps int64) Inspect
SetFeeRecipient : func(recipient .uverse.address) Inspect
WithdrawFees : func() Inspect
SweepDenom : func(denom string) Inspect
TransferAdmin : func(successor .uverse.address) Inspect
AcceptAdmin : func() Inspect
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) Inspect
MinDeposit : func(saleID int64) int64 Inspect
Lot : func(saleID int64) string Inspect
Phase : func(saleID int64) string Inspect
Status : func(saleID int64) string Inspect
Winner : func(saleID int64) .uverse.address Inspect
Price : func(saleID int64) int64 Inspect
WinningBid : func(saleID int64) int64 Inspect
SecondBid : func(saleID int64) int64 Inspect
ProvisionalPrice : func(saleID int64) int64 Inspect
CommitmentOf : func(saleID int64, bidder .uverse.address) string Inspect
DepositOf : func(saleID int64, bidder .uverse.address) int64 Inspect
HasRevealed : func(saleID int64, bidder .uverse.address) bool Inspect
RevealedAmountOf : func(saleID int64, bidder .uverse.address) int64 Inspect
ForfeitedOf : func(saleID int64) int64 Inspect
BidsOn : func(saleID int64) int64 Inspect
RevealedOn : func(saleID int64) int64 Inspect
BlocksLeft : func(saleID int64) int64 Inspect
IsCloseable : func(saleID int64) bool Inspect
HasSale : func(saleID int64) bool Inspect
SalesOf : func(seller .uverse.address) int64 Inspect
Admin : func() .uverse.address Inspect
PendingAdmin : func() .uverse.address Inspect
FeeRecipient : func() .uverse.address Inspect
FeeBps : func() int64 Inspect
NumSales : func() int64 Inspect
ClaimableOf : func(a .uverse.address) int64 Inspect
FeesAccrued : func() int64 Inspect
Liabilities : func() int64 Inspect
Sealed : func() int64 Inspect
Revealed : func() int64 Inspect
ForfeitedTotal : func() int64 Inspect
Held : func() int64 Inspect
Address : func() .uverse.address Inspect
Height : func() int64 Inspect
phaseOf : func(s *sealedbid.sale) string Inspect
clearing : func(s *sealedbid.sale) (h1 int64, h2 int64, winner .uverse.address, winnerSeq int64) Inspect
vickreyPrice : func(h2 int64, reserve int64) int64 Inspect
findBid : func(s *sealedbid.sale, bidder .uverse.address) *sealedbid.bid Inspect
assertCommitment : func(c string) Inspect
mustSale : func(id int64) *sealedbid.sale Inspect
assertNoSend : func() Inspect
counter : func(tree *v0.Tree, a .uverse.address) *int64 Inspect
addChecked : func(a int64, b int64) (int64, bool) Inspect
padID : func(id int64) string Inspect
itoa : func(n int64) string Inspect
hasPrefix : func(s string, p string) bool Inspect
Render : func(path string) string Inspect
renderHome : func() string Inspect
renderSale : func(idStr string) string Inspect
priceCell : func(s *sealedbid.sale) string Inspect