COREREACTIONSLIB¶
Overview¶
COREREACTIONSLIB provides centralized reaction functions for the Dysnomia ecosystem. It orchestrates entropy-based state transformations across multiple SHIOs, initializing the core reaction chain during deployment.
- Kind: Contract
- License: Sharia
- Solidity: ^0.8.21
- Source:
lib/reactions_core.sol
Inheritance Chain (C3 Linearized)¶
- self — COREREACTIONSLIB
- DYSNOMIA
- MultiOwnable
Immediate Parents¶
What This Means For Players¶
Plain English Summary: COREREACTIONSLIB is the physics engine of the Dysnomia world - it handles all the cryptographic "reactions" that happen when you interact with the game. When you chat, claim territory, or trade, reactions occur that update the game state in unpredictable but deterministic ways.
Real-World Analogy: Think of it like the physics calculations in a video game. When you throw a ball, the game calculates where it lands. In Dysnomia, when you perform actions, COREREACTIONSLIB calculates the resulting state changes using cryptographic math.
How It Affects Your Gameplay: - Entropy tracking - Your actions contribute to system randomness - Chat reactions - Every chat message triggers cryptographic reactions - State evolution - Reactions update values like BRIGHTNESS, HUE, and WHITE that influence the game - Color metaphor - BLACK, WHITE, BRIGHTNESS, HUE represent different entropy states
State Variables¶
| Variable | Type | Visibility | Mutability | Initial Value | NatSpec |
|---|---|---|---|---|---|
Type |
string |
public | constant | ReactionsLib |
|
Void |
VOID |
public | mutable | `` | |
Cho |
CHOINTERFACE |
public | mutable | `` | |
BLACK |
uint64 |
public | mutable | `` | |
HYUN |
uint64 |
public | mutable | `` | |
SHUTTER |
uint64 |
public | mutable | `` | |
BRIGHTNESS |
uint64 |
public | mutable | `` | |
HUE |
uint64 |
public | mutable | `` | |
WHITE |
uint64 |
public | mutable | `` |
Constructor¶
constructor¶
constructor(address VoidAddress) DYSNOMIA(unicode"DYSNOMIA ReactionsLib", unicode"ReactionsLib", address(DYSNOMIA(VoidAddress).Xiao()))
- Modifiers:
DYSNOMIA(unicode"DYSNOMIA ReactionsLib", unicode"ReactionsLib", address(DYSNOMIA(VoidAddress).Xiao())) - Parameters: address VoidAddress
Functions¶
External & Public¶
RegisterChoForTalk¶
- Visibility: public
- Modifiers:
onlyOwners - Parameters: address ChoAddress
Entropy¶
- Visibility: public
- Parameters: Bao memory On
- Returns: uint64
Initialize¶
- Visibility: public
- Parameters: Bao memory On
- Returns: uint64, uint64
ReactToTalk¶
- Visibility: public
- Parameters: User memory Alpha
- Returns: uint64, uint64
React¶
- Visibility: public
- Parameters: Bao memory On, uint64 Omicron, uint64 Omega
- Returns: uint64, uint64
ReactToBang¶
- Visibility: public
- Parameters: Bao memory On, uint64 Omicron, uint64 Omega
- Returns: uint64, uint64
ReactToLai¶
- Visibility: public
- Parameters: Bao memory On, uint64 Omicron, uint64 Omega
- Returns: uint64, uint64
ReactToLe¶
- Visibility: public
- Parameters: Bao memory On, uint64 Omicron, uint64 Omega
- Returns: uint64, uint64
ReactToNew¶
- Visibility: public
- Parameters: Bao memory On, uint64[3] memory Saat
- Returns: uint64, uint64
OperatorReact¶
- Visibility: public
- Parameters: Bao memory On, uint64 Omega
- Returns: uint64, uint64
ReactBang¶
- Visibility: public
- Parameters: uint64 Eta
- Returns: uint64, uint64
ReactLai¶
- Visibility: public
- Parameters: uint64 Gamma
- Returns: uint64, uint64
ReactLe¶
- Visibility: public
- Parameters: uint64 Delta
- Returns: uint64, uint64
ReactEris¶
- Visibility: public
- Parameters: uint64 Iota
- Returns: uint64, uint64
ReactFomalhaute¶
- Visibility: public
- Parameters: uint64 Mu
- Returns: uint64, uint64
ReactFornax¶
- Visibility: public
- Parameters: uint64 Rho
- Returns: uint64, uint64
ReactShioRod¶
- Visibility: public
- Parameters: SHIO Beta, uint64 Theta
- Returns: uint64, uint64
ReactShioCone¶
- Visibility: public
- Parameters: SHIO Beta, uint64 Theta
- Returns: uint64, uint64
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 virtual 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 |
|---|---|
_addLibraryOwner |
function _addLibraryOwner(VOID Void, string memory what) internal |
_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 |
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 V2 - Base functionality
- VOID - Session management
- CHO - User authentication
- YANG - Multi-state access
Registered In¶
- VOID library registry as "corereactions"
Constructor Initialization¶
The constructor performs an extensive initialization sequence:
constructor(VoidAddress) {
// Register as library
Void.AddLibrary("corereactions", address(this));
// Create own user session
(Saat, On) = Void.Enter("ReactionsLib", "ReactionsLib");
// Initialize reaction chain
BLACK = Entropy(On);
(BRIGHTNESS, HUE) = Initialize(On);
(BRIGHTNESS, HUE) = React(On, BRIGHTNESS, HUE);
(HYUN, SHUTTER) = ReactToBang(On, BRIGHTNESS, HUE);
(BRIGHTNESS, HUE) = ReactToNew(On, Saat);
(BRIGHTNESS, HUE) = ReactToLai(On, BRIGHTNESS, HUE);
(BRIGHTNESS, HUE) = OperatorReact(On, BLACK);
(BRIGHTNESS, HUE) = ReactToLe(On, BLACK, HYUN);
(BRIGHTNESS, HUE) = ReactBang(BRIGHTNESS);
(BRIGHTNESS, HUE) = ReactEris(HUE);
(BRIGHTNESS, HUE) = ReactLai(BRIGHTNESS);
(BRIGHTNESS, HUE) = ReactFomalhaute(HUE);
(BRIGHTNESS, HUE) = ReactLe(BRIGHTNESS);
(BRIGHTNESS, HUE) = ReactFornax(HUE);
(BRIGHTNESS, WHITE) = ReactShioCone(On.Shio, BLACK);
// Verify initialization
assert(BLACK > 1551);
assert(BRIGHTNESS > 1551);
assert(HUE > 1551);
assert(WHITE > 1551);
}
Special Mechanisms¶
System SHIOs¶
The library reacts against several system-level SHIOs: - Bang: YANG's first reaction state - Lai: YANG's created installation - Le: YANG's second reaction state - Eris: Installation at Lai.Xi - Fomalhaute: Installation at ZHOU.Xi - Fornax: YI's primary SHIO (Psi)
XOR Accumulation Pattern¶
All React functions use XOR to combine values:
Entropy Computation¶
function Entropy(Bao memory On) public returns (uint64) {
return Xiao.modExp64(
On.Shio.Rho().Cone.View().Chin,
On.Shio.Rho().Rod.View().Chin,
MotzkinPrime
);
}
Minimum Value Assertions¶
Constructor verifies all values exceed 1551, ensuring proper initialization.
Usage Pattern¶
// Get entropy for a Bao
uint64 entropy = reactionsLib.Entropy(myBao);
// React through the chain
(uint64 o, uint64 w) = reactionsLib.ReactShioRod(shio, inputValue);
// React against system states
(o, w) = reactionsLib.ReactToBang(myBao, brightness, hue);
Contract Verification¶
| Property | Value |
|---|---|
| Keccak256 Hash | 0x79a0678e9a7b48a328d337b1519c3eac978a9c2f76c242ee94f9ae8a20bc92cf |
| Source URL | https://raw.githubusercontent.com/busytoby/atropa_pulsechain/main/solidity/dysnomia/lib/reactions_core.sol |
| Hash Generated | 2026-04-17T20:48:17Z |