Skip to content

SHAFactory

Overview

SHAFactory is a factory contract for deploying new SHA token instances. It handles ownership setup and transfer during creation.

Inheritance Chain (C3 Linearized)

No base contracts; this contract has no parents.

Immediate Parents

None (root of its hierarchy).

What This Means For Players

Plain English Summary: SHAFactory is like a key-cutting machine - it creates new SHA tokens (your cryptographic keys) on demand. When the game needs a new SHA for a player or operation, it asks the factory to make one. Players don't use this directly; it works automatically when you create your account.

Real-World Analogy: Think of a hardware store that cuts keys. You don't operate the machine yourself - you just ask for a key and it gets made for you. SHAFactory works the same way: other game contracts ask it to make SHA tokens, and it produces them with the right ownership already set up.

How It Affects Your Gameplay: - Automatic key creation - When you join, SHA tokens are created for you automatically - Proper ownership - The factory ensures you own your keys, not the system

Constructor

constructor

constructor()

Functions

External & Public

New

function New(string memory name, string memory symbol, address MathLib) public returns (SHA Eta)
  • Visibility: public
  • Parameters: string memory name, string memory symbol, address MathLib
  • Returns: SHA Eta

Contract Interactions

Depends On

  • SHA - Contract being deployed

Depended On By

  • YI - Uses factory to create SHA tokens
  • ZHENG - Uses factory indirectly through YI

Ownership Pattern

1. Factory deploys SHA
2. Factory adds msg.sender as owner
3. Factory adds tx.origin as owner
4. Factory renounces its own ownership

This ensures: - The calling contract becomes an owner - The human initiator becomes an owner - 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);





Contract Verification

Property Value
Keccak256 Hash 0x5376888581e85e2d9f79459f4ceb8c4be0d256103e5e76485270d545b87a4d82
Source URL https://raw.githubusercontent.com/busytoby/atropa_pulsechain/main/solidity/dysnomia/02c_shafactory.sol
Hash Generated 2026-04-17T20:48:07Z