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.
- Kind: Contract
- License: Sharia
- Solidity: ^0.8.21
- Source:
05_zheng.sol
Inheritance Chain (C3 Linearized)¶
- self — ZHENG
- DYSNOMIA
- MultiOwnable
Immediate Parents¶
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 | Mutability | Initial Value | NatSpec |
|---|---|---|---|---|---|
Type |
string |
public | constant | ZHENG |
|
Eta |
YI |
public | mutable | `` | |
Sigma |
mapping(uint64 => Bao) |
private | mutable | `` |
Errors¶
| Error | Parameters | NatSpec |
|---|---|---|
SigmaAlreadyInstalled |
address Phi |
Constructor¶
constructor¶
constructor(address YiContract) DYSNOMIA(unicode"CHATLOG Zheng", unicode"ZHENG", address(DYSNOMIA(YiContract).Xiao()))
- Modifiers:
DYSNOMIA(unicode"CHATLOG Zheng", unicode"ZHENG", address(DYSNOMIA(YiContract).Xiao())) - Parameters: address YiContract
Functions¶
External & Public¶
GetRodByIdx¶
- Visibility: public
- Parameters: uint64 _theta
- Returns: Bao memory
InstallRod¶
function InstallRod(uint64 Theta, Bao memory Beta, uint64 Monopole) public onlyOwners returns (Bao memory)
- Visibility: public
- Modifiers:
onlyOwners - Parameters: uint64 Theta, Bao memory Beta, uint64 Monopole
- Returns: Bao memory
InstallCone¶
function InstallCone(uint64 Theta, Bao memory Beta, uint64 Monopole) public onlyOwners returns (Bao memory)
- Visibility: public
- Modifiers:
onlyOwners - Parameters: uint64 Theta, Bao memory Beta, uint64 Monopole
- Returns: Bao memory
Mau¶
function Mau(string memory name, string memory symbol, uint64 Xi, uint64 Rho, uint64 Upsilon) public onlyOwners returns (Bao memory On)
- Visibility: public
- Modifiers:
onlyOwners - Parameters: string memory name, string memory symbol, uint64 Xi, uint64 Rho, uint64 Upsilon
- Returns: Bao memory On
Iodize¶
- Visibility: public
- Parameters: SHIO Shio
Internal¶
Augment¶
- Visibility: internal
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¶
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-04-17T20:48:07Z |