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
| Function | Auth | Result |
|---|---|---|
register(account, name, website) | account | Creates an active entry, or reactivates a deactivated one (overwrites name and website). |
update(account, name, website) | account | Replaces name and website of an active entry. |
deactivate(account) | account | Marks the entry inactive (kept in storage). |
get(account) -> Option<Foundation> | none | Foundation { name, website, active }. |
is_active(account) -> bool | none | false 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
| Code | Name | When |
|---|---|---|
| 1 | AlreadyRegistered | register and an active entry exists. |
| 2 | NotFound | update or deactivate with no entry. |
| 3 | Inactive | update or deactivate on a deactivated entry. |
| 4 | InvalidName | Name empty or longer than 64 bytes. |
| 5 | InvalidWebsite | Website 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.
| Kind | Emitted by | Data |
|---|---|---|
register | register | New name, website. |
update | update | New name, website. |
deactivate | deactivate | Last name, website. |
Deactivation
deactivatekeeps the entry withactive = false; it is never deleted, so the indexer keeps history.- Deactivation is reversible:
registeron a deactivated account reactivates it (name and website overwritten after the usual validation, TTL extended, normalregisterevent). It needs the account's own auth. registeron an active entry isAlreadyRegistered;updateordeactivateon a deactivated entry areInactive.- Per account the indexer sees
register -> (update | deactivate -> register)*. Aregisterevent 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.