func CanTakePart
ActionCanTakePart answers the one question the page needs before it offers any of this: does this address hold a name.
Package nsvote holds domain requests and the votes on them.
Package nsvote holds domain requests and the votes on them.
A SEPARATE REALM, and deliberately so. It never writes to nsdata: it only reads it, to answer two questions — does this address hold a name, and who is the admin. So it needs no trusted-logic grant, it cannot corrupt the registry however wrong its own logic turns out to be, and it can be replaced or abandoned without touching a single name anybody owns.
It does not create domains. A vote is advice; creating the domain stays a deliberate admin call in nslogic. Wiring the two together would mean a majority could add a domain nobody had looked at, and the vault has no undo.
It holds no funds, at any point, for anybody. The only cost of proposing or voting is the storage each writer pays for their own bytes, which the chain moves directly and which comes back if the record is ever deleted.
CanTakePart answers the one question the page needs before it offers any of this: does this address hold a name.
HasVoted lets the page grey out a button instead of letting somebody sign a transaction that is certain to be rejected.
ListProposals pages newest first, which is the order anybody actually wants to read them in.
Propose asks for a domain or for a chain. Anyone holding a name may ask.
The proposer pays the storage for their own proposal, and nothing else. That cost is the whole of the spam control: it is small enough that a real request is nothing to think about and large enough that filling the tree with rubbish is not free.
Purge deletes a closed request and its votes, releasing the storage.
The refund goes to WHOEVER SIGNS THIS, which is not the people who paid — so it is admin-only and it is not a tidying operation to run casually. It exists because a registry that can only ever grow is worse, not because reclaiming somebody else's deposit is free money.
Resolve records what was decided. It does NOT create the domain — that stays a separate, deliberate call in nslogic. A vote is advice, and the vault has no undo.
Roster is the raw material for the leaderboards: one line per name, owner first, so the caller can aggregate however it likes.
It lives here rather than in nslogic because this realm is being deployed anyway and nslogic is not — adding it there would have cost a fresh deployment of the largest realm we have, for a read.
Paged, and the page walks every name in it. That is fine at the scale this registry is at and it will not be fine at fifty thousand names; at that point the aggregate belongs somewhere it is kept as it changes rather than recomputed on every read.
Version lets a caller find out what it is talking to BEFORE it sends a transaction that would be rejected for having the wrong number of arguments.
v1 has no such function, so a nil answer is itself the answer: an older realm. That is cheaper and more honest than the site assuming the newest shape and failing at signing time, which is exactly what happened when Propose grew a `kind`.
Vote records a yes or no. One per address per proposal, and it cannot be changed: a vote that can be switched turns the count into a race against whoever is watching, and there is no deadline here to make that fair.
Withdraw closes a request the proposer no longer wants. The votes already cast stay: deleting them would refund their storage to whoever called this, which is not the person who paid it.
1type Proposal struct {
2 kind string // "domain" | "chain"
3 label string // the domain, or the chain's ticker
4 reason string // why, capped: this is storage somebody is paying for
5 proposer address
6 created int64 // unix seconds
7 yes int64
8 no int64
9 status string // "open" | "accepted" | "rejected" | "withdrawn"
10 decided int64 // unix seconds, 0 while open
11}Two things get asked for here, and they are not the same request.
1domain a new *domain to sell names under
2chain a new blockchain to accept an address for on profiles
The kind is stored rather than inferred from the label, because "solana" is a plausible request of either sort and guessing wrong files somebody's vote under the wrong question.