Bao Structure¶
Overview¶
Bao is the central operation context structure used throughout the Dysnomia ecosystem. It encapsulates a SHIO pair with associated state and reaction outputs.
- File:
include/bao.sol - License: Sharia
- Solidity: ^0.8.21
What This Means For Players¶
Plain English Summary: Bao is your operation ticket - it carries all your info for transactions. Every time you interact with the game, a Bao is created that contains your identity (Phi), your cryptographic keys (SHIO), and the results of any reactions (Omicron/Omega). It's like a transaction receipt that also carries the tools to process the next transaction.
Real-World Analogy: Think of Bao like a boarding pass that also contains your passport, wallet, and luggage claim tickets all in one package. When you go through security (perform a game action), the Bao has everything needed to verify who you are and what you're allowed to do.
How It Affects Your Gameplay: - Identity bundle - Your Bao links your address (Phi) to your cryptographic identity (SHIO) - Transaction context - Every operation carries a Bao with the current state - Reaction results - Omicron and Omega store the outputs of cryptographic reactions - Indexing - Xi is used to find your Bao in the system's registries
Definition¶
struct Bao {
address Phi; // Associated address
SHA Mu; // Rod SHA token reference
uint64 Xi; // Generation/Index value
uint64 Pi; // Pi value (unused in most contexts)
SHIO Shio; // Associated SHIO pair
uint64 Ring; // Ring value from magnetization
uint64 Omicron; // First reaction output
uint64 Omega; // Second reaction output
}
Field Descriptions¶
| Field | Type | Purpose |
|---|---|---|
| Phi | address | Owner/reference address (contract, user token, etc.) |
| Mu | SHA | The Rod SHA token from the SHIO |
| Xi | uint64 | Index for installation or generation seed |
| Pi | uint64 | Reserved/auxiliary value |
| Shio | SHIO | The full SHIO pair (contains both Rod and Cone) |
| Ring | uint64 | Result of SHIO magnetization |
| Omicron | uint64 | First output from React operations |
| Omega | uint64 | Second output from React operations |
Lifecycle¶
1. Create with Phi = owner address
2. Create SHA tokens (Mu = Rod)
3. Create SHIO from Rod + Cone
4. Generate SHIO with Xi
5. Iodize (Isomerize + Isolate)
6. Magnetize to get Ring
7. React to get Omicron/Omega
8. Install at Xi index
Common Patterns¶
Creation¶
Bao memory On;
On.Phi = msg.sender;
On.Mu = someFactory.New("Rod", "ROD", mathLib);
SHA Cone = someFactory.New("Cone", "CONE", mathLib);
On.Shio = shioFactory.New(address(On.Mu), address(Cone), mathLib);
On.Xi = random();
On.Shio.Generate(On.Xi, alpha, beta);
// ... iodize, magnetize
On.Ring = On.Shio.Magnetize();
Reaction¶
Storage and Retrieval¶
// Store
mapping(uint64 => Bao) storage Sigma;
Sigma[On.Xi] = On;
// Retrieve
Bao memory retrieved = Sigma[someXi];
Used By¶
- YI - Nu mapping storage
- ZHENG - Sigma installation registry
- YANG - Rho.Bang/Lai/Le states
- LAU - On user state
- User - User.On field
- All domain contracts using reaction mechanics
Dependencies¶
Imports interfaces for:
- SHA - ../interfaces/02b_shainterface.sol
- SHIO - ../interfaces/03b_shiointerface.sol
Memory vs Storage¶
Bao is typically used as memory for temporary operations and passed between functions. For persistent storage, it's stored in mappings indexed by Xi or address.
// Memory (temporary)
Bao memory temp = createBao();
temp = processReaction(temp);
// Storage (persistent)
mapping(uint64 => Bao) storage registry;
registry[temp.Xi] = temp;
Contract Verification¶
| Property | Value |
|---|---|
| Keccak256 Hash | 0x257e4a9884075b125c407aec08e906b6dfd2339b178bf45d930720bc6c5250df |
| Source URL | https://raw.githubusercontent.com/busytoby/atropa_pulsechain/main/solidity/dysnomia/include/bao.sol |
| Hash Generated | 2026-02-08T00:29:08Z |