Documentation: Registry

Documentation

Registry

A Soroban contract with one registry entry per foundation account. No admin, no upgrade function, no token handling, no funds. Only the foundation's own account can write its entry.

Register a foundation

A foundation calls register(account, name, website) signed by its own account (account.require_auth()). Then it lists the same account in the ACCOUNTS field of its website's stellar.toml. Both together make it domain-verified; see stellar.toml verification. Nobody approves it by hand.

Functions

FunctionAuthResult
register(account, name, website)accountCreates an active entry, or reactivates a deactivated one (overwrites name and website).
update(account, name, website)accountReplaces name and website of an active entry.
deactivate(account)accountMarks the entry inactive (kept in storage).
get(account) -> Option<Foundation>noneFoundation { name, website, active }.
is_active(account) -> boolnonefalse if missing or inactive.

Validation is checked after auth, before storage. name: 1 to 64 UTF-8 bytes. website: 1 to 253 bytes, a bare domain with no / (so no scheme or path), no whitespace or control bytes. This is a format check only; domain ownership is verified off-chain via stellar.toml (SEP-1).

Errors

CodeNameWhen
1AlreadyRegisteredregister and an active entry exists.
2NotFoundupdate or deactivate with no entry.
3Inactiveupdate or deactivate on a deactivated entry.
4InvalidNameName empty or longer than 64 bytes.
5InvalidWebsiteWebsite empty, longer than 253 bytes, or contains /, whitespace or control bytes.

Events

Topics are ["spare", <kind>, account]; data is a vec [name, website]. Failed calls emit nothing.

KindEmitted byData
registerregisterNew name, website.
updateupdateNew name, website.
deactivatedeactivateLast name, website.

Deactivation

  • deactivate keeps the entry with active = false; it is never deleted, so the indexer keeps history.
  • Deactivation is reversible: register on a deactivated account reactivates it (name and website overwritten after the usual validation, TTL extended, normal register event). It needs the account's own auth.
  • register on an active entry is AlreadyRegistered; update or deactivate on a deactivated entry are Inactive.
  • Per account the indexer sees register -> (update | deactivate -> register)*. A register event for an already-known account means reactivation.

TTL

Entries live in persistent storage. register and update extend the TTL: the threshold is about 30 days (30 * 17_280 ledgers) and the extension goes to about 60 days. Entries not touched for about 60 days expire; the indexer flags entries close to expiry so the foundation can call update to renew. get and is_active do not extend. Deactivated entries are not extended while inactive and may expire from ledger state; reactivating an expired entry is a fresh register.