SHIOFactory¶
Overview¶
SHIOFactory is a factory contract for deploying new SHIO token instances with proper ownership configuration for both the SHIO and its underlying SHA tokens.
- License: Sharia
- Solidity: ^0.8.21
What This Means For Players¶
Plain English Summary: SHIOFactory assembles your paired lock system. It takes two SHA keys (Rod and Cone) and welds them together into a SHIO pair. This factory handles the complex wiring that lets your two keys work in harmony for chat, identity, and reactions.
Real-World Analogy: Imagine a locksmith who specializes in two-key safes. You bring them two separate keys, and they install them into a single lock mechanism that requires both keys to work together. That's what SHIOFactory does with Rod and Cone tokens.
How It Affects Your Gameplay: - Pair creation - Your SHIO pair is assembled here during account creation - Integrated ownership - The SHIO automatically gets permission to use its Rod and Cone
State Variables¶
None - stateless factory pattern
Write Functions¶
New¶
- Access:public
- Parameters:
- Rod (address): Address of the Rod SHA token (one half of the pair)
- Cone (address): Address of the Cone SHA token (other half of the pair)
- MathLib (address): Address of VMREQ math library contract for cryptographic operations
- Returns:
- Zeta (SHIO): Newly deployed SHIO contract instance that pairs the Rod and Cone
- Description: Deploys a new SHIO pairing two SHA tokens, configures ownership, and grants the SHIO control of both underlying SHAs.
- Logic Flow:
1. Deploy new SHIO: Zeta = new SHIO(Rod, Cone, MathLib)
2. Add caller as SHIO owner: Zeta.addOwner(msg.sender)
3. Add transaction origin as SHIO owner: Zeta.addOwner(tx.origin)
4. Renounce factory ownership of SHIO: Zeta.renounceOwnership(address(this))
5. Add SHIO as owner of Rod SHA: SHA(Rod).addOwner(address(Zeta))
6. Add SHIO as owner of Cone SHA: SHA(Cone).addOwner(address(Zeta))
7. Return new SHIO contract
- Side Effects: Deploys new SHIO contract; modifies ownership on SHIO, Rod, and Cone contracts
- In Plain English: Combine two keys (Rod and Cone) into a paired lock system. The factory creates the SHIO pair, grants it control over both underlying SHA keys, then gives full ownership to you and the calling contract. The SHIO can now perform cryptographic operations using its paired keys.
Contract Interactions¶
Depends On¶
Depended On By¶
- YI - Uses factory to create SHIO pairs
Ownership Pattern¶
1. Factory deploys SHIO(Rod, Cone, MathLib)
2. Factory adds msg.sender as SHIO owner
3. Factory adds tx.origin as SHIO owner
4. Factory renounces its ownership of SHIO
5. Factory adds SHIO address as owner of Rod SHA
6. Factory adds SHIO address as owner of Cone SHA
This ensures: - The calling contract and human initiator own the SHIO - The SHIO can manipulate its Rod and Cone tokens - The factory retains no control
Usage Example¶
// From YI contract
SHA Rod = SHAFactoryInterface.New("Shio Rod", "SROD", MathLib);
SHA Cone = SHAFactoryInterface.New("Shio Cone", "SCONE", MathLib);
SHIO Psi = SHIOFactoryInterface.New(address(Rod), address(Cone), MathLib);
Contract Verification¶
| Property | Value |
|---|---|
| Keccak256 Hash | 0x889e3d1bb18d39a8235bd9117a4bb6caefc6c8655cc6785bfbf0117523397a87 |
| Source URL | https://raw.githubusercontent.com/busytoby/atropa_pulsechain/main/solidity/dysnomia/03c_shiofactory.sol |
| Hash Generated | 2026-02-08T00:29:57Z |