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.
- Kind: Contract
- License: Sharia
- Solidity: ^0.8.21
- Source:
04_yi.sol
Inheritance Chain (C3 Linearized)¶
- self — YI
- DYSNOMIA
- MultiOwnable
Immediate Parents¶
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 | Mutability | Initial Value | NatSpec |
|---|---|---|---|---|---|
Type |
string |
public | constant | YI |
|
Psi |
SHIO |
public | mutable | `` | |
Nu |
mapping(address => Bao) |
private | mutable | `` | |
Xi |
uint64 |
public | mutable | `` | |
Ring |
uint64 |
public | mutable | `` | |
SHAFactoryInterface |
SHAFactory |
public | mutable | `` | |
SHIOFactoryInterface |
SHIOFactory |
public | mutable | `` |
Constructor¶
constructor¶
constructor(address _shaFactory, address _shioFactory, address MathLib) DYSNOMIA(unicode"CHATLOG Yi", unicode"YI", MathLib)
- Modifiers:
DYSNOMIA(unicode"CHATLOG Yi", unicode"YI", MathLib) - Parameters: address _shaFactory, address _shioFactory, address MathLib
Functions¶
External & Public¶
Beta¶
- Visibility: public
- Modifiers:
onlyOwners - Parameters: string calldata Name, string calldata Symbol
- Returns: SHA
Kappa¶
- Visibility: public
- Modifiers:
onlyOwners - Parameters: SHA Rod, SHA Cone
- Returns: SHIO
Bing¶
- Visibility: public
- Modifiers:
onlyOwners - Parameters: Bao memory _b
Bang¶
- Visibility: public
- State Mutability: view
- Parameters: address _a
- Returns: Bao memory
React¶
- Visibility: public
- Parameters: Bao memory Gamma, uint64 Pi
- Returns: Bao memory
Internal¶
Augment¶
- Visibility: internal
Private¶
Ionize¶
- Visibility: private
Inherited Members¶
This contract inherits the members below from its parents. See each parent's dedicated MD for full signatures, NatSpec, and semantics.
From DYSNOMIA¶
External & Public Functions
| Function | Signature | State Mutability |
|---|---|---|
Rename |
function Rename(string memory newName, string memory newSymbol) public onlyOwners |
nonpayable |
mintToCap |
function mintToCap() public onlyOwners |
nonpayable |
GetMarketRate |
function GetMarketRate(address _a) public view returns (uint256) |
view |
Purchase |
function Purchase(address _t, uint256 _a) public |
nonpayable |
Redeem |
function Redeem(address _t, uint256 _a) public |
nonpayable |
name |
function name() public view virtual returns (string memory) |
view |
symbol |
function symbol() public view virtual returns (string memory) |
view |
decimals |
function decimals() public view virtual returns (uint8) |
view |
totalSupply |
function totalSupply() public view virtual returns (uint256) |
view |
balanceOf |
function balanceOf(address account) public view virtual returns (uint256) |
view |
transfer |
function transfer(address to, uint256 value) public virtual returns (bool) |
nonpayable |
allowance |
function allowance(address owner, address spender) public view virtual returns (uint256) |
view |
approve |
function approve(address spender, uint256 value) public virtual returns (bool) |
nonpayable |
transferFrom |
function transferFrom(address from, address to, uint256 value) public virtual returns (bool) |
nonpayable |
Internal Functions
| Function | Signature |
|---|---|
_mintToCap |
function _mintToCap() internal |
AddMarketRate |
function AddMarketRate(address _a, uint256 _r) internal |
_transfer |
function _transfer(address from, address to, uint256 value) internal |
_update |
function _update(address from, address to, uint256 value) internal virtual |
_mint |
function _mint(address account, uint256 value) internal |
_approve |
function _approve(address owner, address spender, uint256 value) internal |
_spendAllowance |
function _spendAllowance(address owner, address spender, uint256 value) internal virtual |
log10 |
function log10(uint256 value) internal pure returns (uint256) |
String |
function String(uint256 value) internal pure returns (string memory buffer) |
Hex |
function Hex(address account) internal pure returns (string memory) |
Events
| Event | Parameters |
|---|---|
Transfer |
address indexed from, address indexed to, uint256 value |
Approval |
address indexed owner, address indexed spender, uint256 value |
Errors
| Error | Parameters |
|---|---|
MarketRateNotFound |
address asset |
DysnomiaInsufficientBalance |
address origin, address sender, address from, address to, address what, uint256 balance, uint256 needed |
DysnomiaInsufficientAllowance |
address origin, address sender, address owner, address spender, address what, uint256 allowance, uint256 needed |
State Variables (private parent storage is not reachable and is omitted)
| Variable | Type | Visibility | Mutability |
|---|---|---|---|
__name |
string |
internal | mutable |
__symbol |
string |
internal | mutable |
MotzkinPrime |
uint64 |
public | constant |
Xiao |
atropaMath |
public | mutable |
maxSupply |
uint256 |
public | mutable |
From MultiOwnable¶
External & Public Functions
| Function | Signature | State Mutability |
|---|---|---|
owner |
function owner() external view virtual returns (address) |
view |
renounceOwnership |
function renounceOwnership(address toRemove) public virtual onlyOwners |
nonpayable |
addOwner |
function addOwner(address newOwner) public virtual onlyOwners |
nonpayable |
Internal Functions
| Function | Signature |
|---|---|
_checkOwner |
function _checkOwner() internal view virtual |
_changeOwnership |
function _changeOwnership(address cOwner, bool cState) internal virtual |
Events
| Event | Parameters |
|---|---|
OwnershipUpdate |
address indexed newOwner, bool indexed state |
Errors
| Error | Parameters |
|---|---|
OwnableUnauthorizedAccount |
address origin, address account, address what |
OwnableInvalidOwner |
address origin, address owner, address what |
Modifiers
| Modifier | Parameters |
|---|---|
onlyOwners |
(none) |
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-04-17T20:48:07Z |