Skip to content

YANG

Overview

YANG is the multi-state aggregator that creates a three-part state structure (Bang, Lai, Le). It orchestrates multiple reactions and installations to establish a comprehensive protocol state.

  • Inherits: DYSNOMIA
  • License: Sharia
  • Solidity: ^0.8.21

What This Means For Players

Plain English Summary: YANG is the state tracker - it remembers what's happened in the game. It maintains three connected states (Bang, Lai, Le) that capture the history and current condition of the system. When you perform actions, YANG's state evolves to reflect those changes.

Real-World Analogy: Think of YANG as a game save file that has three checkpoints. Each checkpoint (Bang, Lai, Le) captures a different aspect of the game state. Together, they provide a complete picture of where everything stands, and they're cryptographically linked so they can't be tampered with.

How It Affects Your Gameplay: - History tracking - YANG records the sequence of reactions that define the current game state - State dependencies - Many game mechanics check YANG's state to determine valid actions - Pole values - YANG provides the "pole" values used in identity generation and reactions

State Variables

Variable Type Visibility Description
Type string public constant "YANG"
Mu YAU public Reference to YAU protocol coordinator
Rho Tai public Three-part state structure
Pole uint64[3] public Array of pole values from reactions

Structs

Tai

struct Tai {
    Bao Bang;   // First reaction state
    Bao Lai;    // Created and installed state
    Bao Le;     // Second reaction state
}

Read Functions

Mu

YAU public Mu
- Returns: Reference to the YAU contract

Rho

Tai public Rho
- Returns: The Tai structure with Bang, Lai, Le

Pole

uint64[3] public Pole
- Returns: Array of three pole values

Contract Interactions

Depends On

  • DYSNOMIA - Base token functionality
  • YAU - Protocol coordination
  • ZHOU - Market orchestration (via YAU)
  • ZHENG - Installation management (via YAU)
  • YI - Token operations (via YAU)

Depended On By

  • SIU - Uses YANG for token generation

Constructor Logic

constructor(YauAddress) {
    Mu = YAU(YauAddress);

    // Add ownership through entire chain
    Mu.addOwner(address(this));
    Mu.Tau().addOwner(address(this));
    Mu.Tau().Upsilon().addOwner(address(this));
    Mu.Tau().Upsilon().Eta().addOwner(address(this));

    // 1. Bang: React via YAU
    Rho.Bang = Mu.React();
    Rho.Bang.Xi = Pole[0] = Rho.Bang.Omicron;

    // 2. Le: React via ZHOU
    Rho.Le = Mu.Tau().React(Pole[0]);
    Rho.Le.Xi = Pole[1] = Rho.Le.Omicron;

    // 3. Lai: Create new SHIO pair
    Rho.Lai.Phi = address(this);
    Rho.Lai.Mu = Mu.Tau().Alpha("Yang Rod", "MROD");
    SHA Cone = Mu.Tau().Upsilon().Eta().Beta("Yang Cone", "MCONE");
    Rho.Lai.Shio = Mu.Tau().Upsilon().Eta().Kappa(Rho.Lai.Mu, Cone);

    // Configure ownership
    Rho.Lai.Shio.addOwner(address(Mu.Tau()));
    Rho.Lai.Shio.addOwner(address(Mu.Tau().Upsilon()));
    Rho.Lai.Shio.addOwner(address(Mu.Tau().Upsilon().Eta()));

    // Generate with XOR'd Xi
    Rho.Lai.Xi = Rho.Bang.Omega ^ Rho.Le.Omega;
    Rho.Lai.Shio.Generate(Rho.Lai.Xi, Pole[1], Pole[0]);

    // Iodize and magnetize
    Mu.Tau().Upsilon().Iodize(Rho.Lai.Shio);
    Rho.Lai.Ring = Rho.Lai.Shio.Magnetize();

    // React and install
    Rho.Lai = Mu.Tau().Upsilon().Eta().React(Rho.Lai, Pole[1]);
    Pole[2] = Rho.Lai.Omicron;
    Rho.Lai = Mu.Tau().Upsilon().InstallRod(Rho.Lai.Xi, Rho.Lai, Pole[2]);
}

Special Mechanisms

Three-State Architecture

YANG creates three distinct states: 1. Bang: Result of reacting via YAU 2. Le: Result of reacting via ZHOU 3. Lai: Newly created and installed SHIO

Pole Value Chain

The Pole array creates a dependency chain: - Pole[0] = Bang.Omicron (used to generate Le) - Pole[1] = Le.Omicron (used to generate Lai) - Pole[2] = Lai.Omicron (final installation monopole)

XOR Generation

Lai's Xi is computed as Bang.Omega ^ Le.Omega, combining entropy from both reactions.

Deep Ownership Chain

YANG adds itself as owner at four levels: 1. YAU (Mu) 2. ZHOU (Mu.Tau) 3. ZHENG (Mu.Tau.Upsilon) 4. YI (Mu.Tau.Upsilon.Eta)

Comprehensive Market Rates

The Augment function sets market rates for all tokens across all three states: - Lai's tokens (Mu, Shio, Shio.Cone) - Bang's tokens (Phi, Mu, Shio, Rod, Cone) - Le's tokens (Phi, Mu, Shio, Rod, Cone)

State Diagram

YAU.React() → Bang
ZHOU.React(Bang.Omicron) → Le
Create new Shio with Xi = Bang.Omega ^ Le.Omega
React and Install → Lai
Rho = {Bang, Lai, Le}

Usage Pattern

// Access the three states
Bao memory bang = yang.Rho().Bang;
Bao memory lai = yang.Rho().Lai;
Bao memory le = yang.Rho().Le;

// Access pole values
uint64 pole0 = yang.Pole(0);
uint64 pole1 = yang.Pole(1);
uint64 pole2 = yang.Pole(2);

Contract Verification

Property Value
Keccak256 Hash 0xc56c0facdcf6e2b68d9fda3ef769ea09f7818f7fa161d5ef941e4d6fd24115f8
Source URL https://raw.githubusercontent.com/busytoby/atropa_pulsechain/main/solidity/dysnomia/08_yang.sol
Hash Generated 2026-02-08T00:29:57Z