ZHENG¶
Overview¶
ZHENG is the Rod/Cone installation manager that handles registering and installing Bao operations into indexed slots. It provides the infrastructure for managing multiple SHIO pairs with their associated state.
- Inherits: DYSNOMIA
- License: Sharia
- Solidity: ^0.8.21
What This Means For Players¶
Plain English Summary: ZHENG is the installation manager - it registers your stuff in the system. When new tokens, accounts, or game elements are created, ZHENG assigns them a permanent spot in the registry. Think of it as the DMV that issues license plates - once your token is installed, it has a permanent address.
Real-World Analogy: Imagine a parking garage with numbered spots. ZHENG is the attendant who assigns each car (token/operation) to a specific numbered spot. Once parked, your spot is reserved forever - no one else can take it. You can always find your car by remembering your spot number.
How It Affects Your Gameplay: - Permanent registration - Your player tokens get installed here and can always be found - Market rate setup - When tokens are installed, their exchange rates are automatically set up - System infrastructure - All the behind-the-scenes installation that makes the game work
State Variables¶
| Variable | Type | Visibility | Description |
|---|---|---|---|
| Type | string | public constant | "ZHENG" |
| Eta | YI | public | Reference to YI orchestration layer |
| Sigma | mapping(uint64 => Bao) | private | Installed Rods indexed by Theta |
Read Functions¶
GetRodByIdx¶
- Parameters:_theta - Index value
- Returns: Bao installed at that index
- Description: Retrieves an installed Rod by its index
- In Plain English: Look up a player or token's registration by their index number. Like finding your parking spot by its number.
Write Functions¶
InstallRod¶
function InstallRod(uint64 Theta, Bao memory Beta, uint64 Monopole) public onlyOwners returns(Bao memory)
onlyOwners
- Parameters:
- Theta (uint64): Installation index (slot in Sigma registry)
- Beta (Bao): Bao operation context to install
- Monopole (uint64): Monopole value for initial reaction
- Returns:
- Bao: Updated Bao after installation with new Omicron/Omega
- Description: Installs a Bao as a Rod at the specified index, reacts it, and sets comprehensive market rates.
- Logic Flow:
1. Check slot is empty: if(Sigma[Theta].Phi != address(0x0)) revert SigmaAlreadyInstalled
2. Call _mintToCap()
3. Store in YI: Eta.Bing(Beta)
4. React via YI: Beta = Eta.React(Beta, Monopole)
5. Store in Sigma: Sigma[Theta] = Beta
6. Log: Beta.Shio.Log(Theta, Monopole, "Rod Installed In Zheng Sigma")
7. Set market rates for: Beta.Phi, Beta.Shio, Beta.Shio.Rod(), Beta.Shio.Cone()
8. Return updated Beta
- Side Effects: Reverts if slot occupied; updates Sigma and YI.Nu mappings; emits log; sets 4 market rates; mints tokens
- In Plain English: Register a Bao in the permanent registry at a specific slot. Once installed, it cannot be overwritten. The Bao is reacted with the Monopole to mix in entropy, then comprehensive market rates are set for all associated tokens. This is the primary installation path for system-level components.
InstallCone¶
function InstallCone(uint64 Theta, Bao memory Beta, uint64 Monopole) public onlyOwners returns(Bao memory)
onlyOwners
- Parameters:
- Theta (uint64): Installation index
- Beta (Bao): Bao to install
- Monopole (uint64): Monopole value for reaction
- Returns:
- Bao: Updated Bao after installation
- Description: Lightweight installation that only sets market rate for the Cone.
- Logic Flow:
1. Check slot is empty: if(Sigma[Theta].Phi != address(0x0)) revert SigmaAlreadyInstalled
2. Call _mintToCap()
3. Store in YI: Eta.Bing(Beta)
4. React via YI: Beta = Eta.React(Beta, Monopole)
5. Store in Sigma: Sigma[Theta] = Beta
6. Log: Beta.Shio.Log(Theta, Monopole, "Cone Installed In Zheng Sigma")
7. Set market rate for: Beta.Shio.Cone() only
8. Return updated Beta
- Side Effects: Same as InstallRod but only sets 1 market rate (Cone)
- In Plain English: Register a Bao as a Cone counterpart. Similar to InstallRod but sets fewer market rates since Cones are typically paired with already-installed Rods. Used for completing paired registrations.
Mau¶
function Mau(string memory name, string memory symbol, uint64 Xi, uint64 Rho, uint64 Upsilon) public onlyOwners returns (Bao memory On)
onlyOwners
- Parameters:
- name (string): Token name for the new SHA pair
- symbol (string): Token symbol prefix
- Xi (uint64): Generation seed for SHIO.Generate
- Rho (uint64): Rho parameter (typically Aura) for Generate
- Upsilon (uint64): Upsilon parameter (typically Soul) for Generate and as installation index
- Returns:
- On (Bao): Fully created and installed Bao
- Description: Creates a complete SHIO setup from scratch and installs it as a Cone.
- Logic Flow:
1. Create Rod SHA: Eta.Beta(name + " Rod", symbol + "ROD")
2. Create Cone SHA: Eta.Beta(name + " Siu Cone", symbol + "VCONE")
3. Add caller as owner of both
4. Set On.Phi = msg.sender, On.Mu = Rod
5. Create SHIO: On.Shio = Eta.Kappa(Rod, Cone)
6. Setup ownership chain for SHIO
7. Set On.Xi = Xi
8. Generate SHIO: On.Shio.Generate(On.Xi, Rho, Upsilon)
9. Ionize: Iodize(On.Shio)
10. Magnetize: On.Ring = On.Shio.Magnetize()
11. Install as Cone: On = InstallCone(Upsilon, On, Rho)
12. Call _mintToCap()
- Side Effects: Creates 2 SHA contracts and 1 SHIO contract; installs in Sigma; sets market rates; mints tokens
- In Plain English: Create a complete player identity from scratch. This is the full lifecycle: creates Rod and Cone SHA tokens, pairs them into a SHIO, generates cryptographic state, bonds them together (Iodize), finalizes (Magnetize), and installs in the registry. Used by SIU.Miu() for user creation.
Iodize¶
- Access:public
- Parameters:
- Shio (SHIO): SHIO instance to bond
- Description: Completes SHIO bonding by calling both Isomerize and Isolate.
- Logic Flow:
1. Call Shio.Isomerize() - bonds the Rod
2. Call Shio.Isolate() - bonds the Cone
3. Call _mintToCap()
- Side Effects: Modifies Rod and Cone Dynamo/Pole values; mints tokens
- In Plain English: Lock a SHIO pair together permanently by bonding both halves. This is a convenience function that calls both Isomerize (Rod) and Isolate (Cone) in one call. Must be done before Magnetize to complete the pairing.
Errors¶
| Error | Parameters | Description |
|---|---|---|
| SigmaAlreadyInstalled | Phi | Slot already has an installation |
Contract Interactions¶
Depends On¶
Depended On By¶
Special Mechanisms¶
Sigma Registry¶
The Sigma mapping uses uint64 keys (typically Xi or Theta values) to store Bao installations. Once installed, a slot cannot be overwritten.
Installation Process¶
1. Check slot is empty
2. Store Bao in YI (Bing)
3. React Bao with Monopole
4. Store reacted Bao in Sigma
5. Log installation
6. Set market rates for all tokens
Market Rate Configuration¶
InstallRod sets market rates for: - Bao.Phi address - Bao.Shio address - Bao.Shio.Rod address - Bao.Shio.Cone address
InstallCone only sets rate for Cone (minimized setup).
Mau Complete Creation¶
The Mau function handles the full lifecycle: 1. Create Rod SHA via YI 2. Create Cone SHA via YI 3. Create SHIO from Rod/Cone 4. Setup ownership chain 5. Generate SHIO with parameters 6. Iodize the SHIO 7. Magnetize the SHIO 8. Install as Cone
Usage Pattern¶
// Create and install a complete setup
Bao memory setup = zheng.Mau("My Token", "MTK", xi, rho, upsilon);
// Or install an existing Bao
Bao memory existing = ...;
existing = zheng.InstallRod(theta, existing, monopole);
// Retrieve later
Bao memory retrieved = zheng.GetRodByIdx(theta);
Contract Verification¶
| Property | Value |
|---|---|
| Keccak256 Hash | 0x6078b42d4fe57900b92e66fc3723331b7d217e2e6aedbfd6ae4004c99a81c720 |
| Source URL | https://raw.githubusercontent.com/busytoby/atropa_pulsechain/main/solidity/dysnomia/05_zheng.sol |
| Hash Generated | 2026-02-08T00:29:57Z |