VOID¶
Overview¶
VOID is the user session and chat management contract. It handles user registration, authentication, chat logging, and attribute storage. It serves as the primary entry point for user interactions with the Dysnomia ecosystem.
- Inherits: DYSNOMIA
- License: Sharia
- Solidity: ^0.8.21
What This Means For Players¶
Plain English Summary: VOID is the login system - it manages who you are and your chat sessions. When you first join Dysnomia, you "Enter" through VOID to create your account. VOID remembers your Soul ID, handles your chat messages, and stores your personal settings like your username.
Real-World Analogy: VOID is like the front desk of a members-only club. When you first visit, the front desk creates your membership card (your LAU token) and assigns you a member number (Soul ID). Every time you return, they recognize you and let you in. They also handle the intercom system (chat) and keep track of your preferences.
How It Affects Your Gameplay: - Account creation - VOID creates your player session when you first "Enter" - Chat routing - All your messages go through VOID to reach the right channels - Attribute storage - Your username, aliases, and other settings are managed here - Session persistence - VOID remembers you between visits so you don't have to re-register
State Variables¶
| Variable | Type | Visibility | Description |
|---|---|---|---|
| Type | string | public constant | "VOID" |
| Nu | SIU | public | Reference to SIU token generator |
| _activeUsers | mapping(address => uint64) | private | Maps wallet addresses to Soul IDs |
| _kecNames | mapping(string => bytes32) | private | Hashed log channel names |
| _libraries | mapping(string => address) | private | Registered library contracts |
Read Functions¶
GetLibraryAddress¶
- Parameters:name - Library name
- Returns: Library contract address
- Description: Retrieves the address of a registered library
- In Plain English: Look up where a specific system library is located. Libraries provide shared functionality like attribute storage.
GetAttribute¶
- Parameters:name - Attribute name
- Returns: Attribute value for the calling user
- Description: Retrieves a user attribute via the libattribute library
- In Plain English: Read one of your saved settings like your username or other personal data you've stored in the system.
Alias (view)¶
function Alias(address name) public view returns (string memory)
function Alias(Bao memory Theta) public view returns (string memory)
Write Functions¶
AddLibrary¶
- Access:onlyOwners
- Parameters:
- name (string): Library name key (e.g., "libattribute", "corereactions")
- _a (address): Address of the library contract
- Description: Registers a library contract in the internal registry.
- Logic Flow:
1. Store _libraries[name] = _a
2. Call _mintToCap()
- Side Effects: Updates _libraries mapping; mints tokens
- In Plain English: Register a new system library by name. Libraries provide shared functionality like attribute storage (libattribute) or reaction processing (corereactions). Admin-only because libraries have system-wide impact.
Log (multiple overloads)¶
function Log(string memory LogLine) public
function Log(uint64 Sigma, string memory LogLine) public onlyOwners
function Log(address Sigma, string memory LogLine) public onlyOwners
public, others are onlyOwners
- Parameters:
- LogLine (string): Message to log
- Sigma (uint64 or address): Target Soul ID or address for the log
- Description: Logs messages to specific SHIO chatlog channels.
- Logic Flow:
- Log(LogLine): Get caller's Soul from _activeUsers[msg.sender], emit via GetBySoul(Soul).Shio.Log(...)
- Log(Sigma, LogLine): Log to SHIO at Soul ID Sigma
- Log(address, LogLine): Look up Soul from address, log to that SHIO
- Computation Details:
- GetBySoul(Sigma) navigates: Nu.Psi().Mu().Tau().Upsilon().GetRodByIdx(Sigma)
- Side Effects: Emits LogEvent on target SHIO; mints tokens
- In Plain English: Record a message on the blockchain. The simple version logs to your own SHIO. The Soul ID and address versions (owner-only) log to specific user channels for system events or admin messages.
Chat¶
- Access:public
- Parameters:
- chatline (string): The chat message content
- Description: Sends a formatted chat message with username to ZHOU's channel.
- Logic Flow:
1. Check _activeUsers[msg.sender] != 0 or revert NoUserEntry
2. Get username via GetAttribute("Username")
3. Check bytes(Username).length >= 1 or revert NoUserName
4. Format message: "<Username> chatline"
5. Route to ZHOU via Log("ZHOU", formattedMessage)
6. Call _mintToCap()
- Side Effects: Emits LogEvent on ZHOU's installation SHIO; mints tokens
- In Plain English: Send a chat message visible to everyone. Your username is automatically attached in angle brackets (like <Alice> Hello!). Requires you to be registered and have a username set. Messages are logged to ZHOU's channel.
SetAttribute¶
- Access:public
- Parameters:
- name (string): Attribute name (e.g., "Username")
- value (string): Attribute value to store
- Description: Stores a user attribute via the libattribute library.
- Logic Flow:
1. Check _activeUsers[msg.sender] != 0 or revert NoUserEntry
2. Call LIBATTRIBUTE(_libraries["libattribute"]).Set(_activeUsers[msg.sender], name, value)
3. Call _mintToCap()
- Side Effects: Updates attribute storage in libattribute; mints tokens
- In Plain English: Save a personal setting like your username. The value is stored permanently under your Soul ID and can be retrieved later with GetAttribute. You must be registered to set attributes.
Alias (write)¶
function Alias(address name, string memory value) public
function Alias(Bao memory Theta, string memory value) public
public
- Parameters:
- name (address) or Theta (Bao): Target to create alias for
- value (string): Alias string to assign
- Description: Creates a personal alias for an address or Bao.
- Logic Flow:
1. Check _activeUsers[msg.sender] != 0 or revert NoUserEntry
2. Call LIBATTRIBUTE(_libraries["libattribute"]).Alias(_activeUsers[msg.sender], name/Theta, value)
3. Call _mintToCap()
- Side Effects: Updates alias storage in libattribute; mints tokens
- In Plain English: Give a nickname to any address or player's Bao. Like adding a contact name in your phone. Aliases are personal to you - other users don't see your aliases. Makes it easier to remember who's who.
Enter (registration)¶
function Enter(string memory name, string memory symbol) public returns(uint64[3] memory Saat, Bao memory On)
public
- Parameters:
- name (string): Token name for the user's token
- symbol (string): Token symbol for the user's token
- Returns:
- Saat (uint64[3]): Array containing [Pole, Soul, Aura]
- On (Bao): User's operation context with SHIO and state
- Description: Creates a new user session with a new token via SIU.
- Logic Flow:
1. Check _activeUsers[msg.sender] == 0 or revert UserAlreadyCreated
2. Call (Saat, On) = Nu.Miu(name, symbol) to create user via SIU
3. Add caller as owner: On.Shio.addOwner(msg.sender)
4. Verify ownership: On.Shio.owner(msg.sender) or revert NotShioOwner
5. Store: _activeUsers[msg.sender] = Saat[1] (Soul ID)
6. Call _mintToCap()
- Side Effects: Creates new token via SIU; updates _activeUsers; adds SHIO ownership; mints tokens
- In Plain English: Create your player account! This is the "sign up" function. It creates your unique token, generates your Soul ID (at Saat[1]) and Aura (at Saat[2]), and sets up your SHIO for chat. You become an owner of your SHIO. Can only be called once per wallet.
Enter (login)¶
- Access:public
- Returns:
- Saat (uint64[3]): Array containing [Pole, Soul, Aura]
- On (Bao): User's operation context
- Description: Retrieves existing user session data for already-registered users.
- Logic Flow:
1. Check _activeUsers[msg.sender] != 0 or revert NoUserEntry
2. Get fresh Pole: Saat[0] = Nu.Psi().Pole(2)
3. Get Soul: Saat[1] = _activeUsers[msg.sender]
4. Get current Aura: Saat[2] = Nu.Aura()
5. Get Bao: On = GetBySoul(Saat[1])
6. Verify ownership: On.Shio.owner(msg.sender) or revert NotShioOwner
7. Call _mintToCap()
- Side Effects: Mints tokens
- In Plain English: Log back in to your existing account. Returns your Soul ID, a fresh Pole value, the current Aura, and your Bao context. Verifies you still own your SHIO. Use this to reconnect after previously registering.
Errors¶
| Error | Parameters | Description |
|---|---|---|
| NoUserEntry | User | User not registered |
| NoUserName | User | Username not set |
| UserAlreadyCreated | User | User already has a session |
| NotShioOwner | Shio, Requestor | Caller doesn't own the SHIO |
| InvalidLogXi | Xi | Unknown log channel name |
Contract Interactions¶
Depends On¶
- DYSNOMIA - Base token functionality
- SIU - Token generation
- LIBATTRIBUTE - Attribute storage
Depended On By¶
- LAU - User interface layer
- LAUFactory - Creates LAU instances
- All domain contracts that need user sessions
Constructor Logic¶
constructor(SiuAddress) {
Nu = SIU(SiuAddress);
// Add ownership through chain
Nu.addOwner(address(this));
// ... (adds to Psi, Mu, Tau, Upsilon, Eta)
// Add SHIO ownership for specific installations
GetBySoul(ZHOU(...).Xi()).Shio.addOwner(address(this));
GetBySoul(YANG(...).Rho().Lai.Xi).Shio.addOwner(address(this));
// Register channel names
_kecNames["ZHOU"] = keccak256("ZHOU");
_kecNames["YANG"] = keccak256("YANG");
}
Special Mechanisms¶
Soul ID System¶
Each user receives a unique 64-bit Soul ID upon registration. The Soul ID is derived from the Saat array and serves as the primary user identifier.
GetBySoul¶
Internal function that retrieves a user's Bao from ZHENG by their Soul ID:
function GetBySoul(uint64 Sigma) internal returns(Bao memory On) {
return Nu.Psi().Mu().Tau().Upsilon().GetRodByIdx(Sigma);
}
Log Channel Routing¶
The internal Log function with string Xi parameter routes to specific SHIOs: - "ZHOU" → ZHOU's Xi installation - "YANG" → YANG's Lai installation
Library Integration¶
VOID registers and uses library contracts:
- libattribute: User attribute storage
- Additional libraries can be registered via AddLibrary
Chat Format¶
Chat messages are formatted as: <Username> message
Usage Pattern¶
// Register new user
(uint64[3] memory saat, Bao memory on) = void.Enter("My Token", "MTKN");
// Set username
void.SetAttribute("Username", "Alice");
// Send chat
void.Chat("Hello World!");
// Login again later
(saat, on) = void.Enter();
// Set alias for an address
void.Alias(someAddress, "Bob's Wallet");
Contract Verification¶
| Property | Value |
|---|---|
| Keccak256 Hash | 0x7c7f3267344c72f8864ae380047ee3a9797d3209fce4fc9285b09c9cc7edfe3a |
| Source URL | https://raw.githubusercontent.com/busytoby/atropa_pulsechain/main/solidity/dysnomia/10_void.sol |
| Hash Generated | 2026-02-08T00:29:57Z |