YI¶
Overview¶
YI is the DeFi orchestration layer that manages SHIO creation, Bao operations, and coordinates between SHA/SHIO factories. It serves as the primary interface for creating and reacting with token pairs.
- Inherits: DYSNOMIA
- License: Sharia
- Solidity: ^0.8.21
What This Means For Players¶
Plain English Summary: YI is the token factory floor - where new game currencies get created. It coordinates the creation of SHA and SHIO tokens, manages your operation tickets (Bao), and handles the complex setup required when new tokens are born into the ecosystem.
Real-World Analogy: Think of YI like a mint that produces coins. It has the machinery (factories) to create new currencies, the recipes (protocols) for how to make them properly, and the assembly lines (operations) that link everything together. When you or the game needs a new type of token, YI is what builds it.
How It Affects Your Gameplay: - Token creation - New game currencies are minted through YI - Operation management - Your Bao (transaction ticket) gets stored and processed here - Reaction handling - When you interact with the game, YI processes the cryptographic reactions
State Variables¶
| Variable | Type | Visibility | Description |
|---|---|---|---|
| Type | string | public constant | "YI" |
| Psi | SHIO | public | Primary SHIO instance created at deployment |
| Nu | mapping(address => Bao) | private | Stored Bao operations by address |
| Xi | uint64 | public | Generation seed value |
| Ring | uint64 | public | Ring value from magnetization |
| SHAFactoryInterface | SHAFactory | public | SHA factory contract reference |
| SHIOFactoryInterface | SHIOFactory | public | SHIO factory contract reference |
Read Functions¶
Bang¶
- Parameters:_a - Address to query
- Returns: Stored Bao for the address
- Description: Retrieves a stored Bao operation
- In Plain English: Look up a stored operation context by address. Returns all the cryptographic info for that operation.
Write Functions¶
Beta¶
- Access:onlyOwners
- Parameters:
- Name (string): Token name for the new SHA
- Symbol (string): Token symbol for the new SHA
- Returns:
- SHA: New SHA token instance
- Description: Creates a new SHA token via the SHAFactory.
- Logic Flow:
1. Call SHAFactoryInterface.New(Name, Symbol, address(Xiao))
2. Add caller as owner: Xun.addOwner(msg.sender)
3. Call _mintToCap()
4. Return the new SHA instance
- Side Effects: Deploys new SHA contract; mints YI tokens
- In Plain English: Mint a new cryptographic key token. This creates a fresh SHA with its own randomly-seeded Base, Secret, and Signal values. The caller becomes an owner so they can use the token for SHIO pairing.
Kappa¶
- Access:onlyOwners
- Parameters:
- Rod (SHA): Rod SHA token address
- Cone (SHA): Cone SHA token address
- Returns:
- SHIO: New SHIO pair instance
- Description: Creates a new SHIO pair from two existing SHA tokens.
- Logic Flow:
1. Call SHIOFactoryInterface.New(address(Rod), address(Cone), address(Xiao))
2. Add caller as owner: Xie.addOwner(msg.sender)
3. Call _mintToCap()
4. Return the new SHIO instance
- Side Effects: Deploys new SHIO contract; mints YI tokens
- In Plain English: Combine two SHA keys into a paired SHIO. The Rod and Cone SHA tokens will be cryptographically bound together. The caller becomes an owner of the new SHIO so they can Generate and React on it.
Bing¶
- Access:onlyOwners
- Parameters:
- _b (Bao): Bao operation context to store
- Description: Stores a Bao in the Nu mapping indexed by its Phi address.
- Logic Flow:
1. Store: Nu[_b.Phi] = _b
2. Log: SHIO(_b.Shio).Log(0, 0, "Added to Yi.Nu")
3. Call _mintToCap()
- Side Effects: Updates Nu mapping; emits LogEvent on SHIO; mints tokens
- In Plain English: Save an operation context for later retrieval. The Bao is indexed by its Phi address, so you can retrieve it later with Bang(). Used for stateful multi-step operations where you need to store intermediate state.
React¶
- Access:public
- Parameters:
- Gamma (Bao): Bao operation context containing the SHIO to react
- Pi (uint64): Reaction input value
- Returns:
- Bao: Updated Bao with new Omicron and Omega values
- Description: Executes a reaction on the Bao's SHIO and stores the outputs.
- Logic Flow:
1. Call SHIO reaction: (Gamma.Omicron, Gamma.Omega) = SHIO(Gamma.Shio).React(Pi)
2. Call _mintToCap()
3. Return updated Gamma
- Computation Details:
- SHIO.React XORs Pi with Monopole, then reacts on Rod and Cone
- Outputs are symmetric: if Rod and Cone are properly paired, outputs verify each other
- Side Effects: Triggers SHIO reaction; updates Bao fields; mints tokens
- In Plain English: Process an operation through the cryptographic system. The input Pi is mixed with the SHIO's Monopole and reacted through both Rod and Cone. The resulting Omicron and Omega values can be used for rewards, verification, or chaining to other reactions.
Contract Interactions¶
Depends On¶
- DYSNOMIA - Base token functionality
- SHAFactory - Creates SHA tokens
- SHIOFactory - Creates SHIO pairs
- VMREQ - Random number generation
Depended On By¶
- ZHENG - Uses YI for token management
- All higher-level contracts in the chain
Constructor Logic¶
constructor(_shaFactory, _shioFactory, MathLib) {
// 1. Create Rod and Cone SHA tokens
SHA Rod = SHAFactoryInterface.New("Shio Rod", "SROD", MathLib);
SHA Cone = SHAFactoryInterface.New("Shio Cone", "SCONE", MathLib);
// 2. Create SHIO pair
Psi = SHIOFactoryInterface.New(address(Rod), address(Cone), MathLib);
// 3. Generate random Xi and initialize
Xi = Xiao.Random();
Psi.Generate(Xi, Xiao.Random(), Xiao.Random());
// 4. Ionize (Isomerize + Isolate)
Ionize();
// 5. Magnetize to finalize
Ring = Psi.Magnetize();
}
Special Mechanisms¶
Ionize Pattern¶
Private function that calls both Isomerize and Isolate on the SHIO, completing the bonding phase for both Rod and Cone.
Market Rate Augmentation¶
Constructor automatically sets market rates for: - The SHIO token - The Rod SHA token - The Cone SHA token
Bao Storage¶
The Nu mapping allows storing operation contexts (Bao) for later retrieval and reaction, enabling stateful multi-step operations.
Usage Pattern¶
// Create new SHA token
SHA myToken = yi.Beta("My Token", "MTK");
// Create new SHIO pair
SHIO myPair = yi.Kappa(rod, cone);
// Store and react on Bao
Bao memory bao = Bao({...});
yi.Bing(bao);
bao = yi.React(bao, inputValue);
Contract Verification¶
| Property | Value |
|---|---|
| Keccak256 Hash | 0xa80f7db865d04a52e0326ce064af8cf42894330123c3dca99b3c0b3ef5bad21a |
| Source URL | https://raw.githubusercontent.com/busytoby/atropa_pulsechain/main/solidity/dysnomia/04_yi.sol |
| Hash Generated | 2026-02-08T00:29:57Z |