SHAFactory — The Key-Cutter
One-line pitch: SHAFactory deploys new SHA tokens and makes the caller and transaction origin owners.
What this is
Section titled “What this is”A factory contract with one job: New(name, symbol, MathLib) deploys a fresh SHA instance with the right owner wired up. It’s called by YI during player onboarding and whenever else the system needs a new key.
If you’ve played a web3 game before
Section titled “If you’ve played a web3 game before”- Closest analogy: CREATE2 factory — deploys new contracts from a template.
- Or: the ERC-6551 registry — a universal “spawn me a token-bound thing” endpoint.
- Or: a Gnosis Safe factory — one call, one fully-configured safe out the other end.
| Dysnomia term | What it maps to |
|---|---|
| SHAFactory | Deployer contract for SHA tokens |
| New(…) | The deploy function — returns a new SHA |
What you actually do with it
Section titled “What you actually do with it”- Normal play: let YI use the factory during identity setup.
- Advanced: call
New(name, symbol, stockMath)directly to create a separate player-owned SHA.
Use these calls here. Simulations preview the current state; each confirmed call is a separate transaction.
0x4208333D65A90577E3da39B84D6A95eb9db717D2SHAFactory.New(string name, string symbol, address MathLib)Simulate / call
Open this function to load its call form.
Rewards / costs
Section titled “Rewards / costs”- Cost: the direct caller pays contract-deployment gas.
- Reward: none.
Requirements & gating
Section titled “Requirements & gating”Newis public. Use the stock math contract when the new SHA is intended to remain compatible with the stock game.
Where it connects
Section titled “Where it connects”Produces SHA instances. Used by YI during account creation and by ZHENG indirectly.
Quick FAQ
Section titled “Quick FAQ”Q: Why a factory instead of inline deployment? A: Reusability and ownership wiring. The factory ensures every new SHA has consistent ownership setup.
Want the Solidity? The contract reference lives at
technical/core/02c_SHAFACTORY.