DYSNOMIA¶
Overview¶
DYSNOMIA is the abstract base token contract for the entire ecosystem. It implements ERC20-like functionality with multi-owner governance, market rate exchange system, and utility functions for string/hex conversion.
- Kind: Abstract Contract
- License: Sharia
- Solidity: ^0.8.21
- Source:
01_dysnomia.sol
Inheritance Chain (C3 Linearized)¶
- self — DYSNOMIA
- MultiOwnable
Immediate Parents¶
What This Means For Players¶
Plain English Summary: DYSNOMIA is the "gold coin" that everything in the game is built upon. Every token, currency, and reward in the Dysnomia ecosystem inherits from this base contract. It's not a token you directly hold - it's the foundation that makes all other tokens work.
Real-World Analogy: Think of DYSNOMIA like the "rules of money" in a video game. Just like how all currencies in a game (gold, gems, credits) follow the same basic rules for how they're counted, transferred, and exchanged, DYSNOMIA defines those rules for every token in this ecosystem.
Key Features For Players: - Token exchanges built-in - You can swap any DYSNOMIA-based token for another using Purchase/Redeem, without needing an external exchange - Random supply - Each token has a randomly-determined maximum supply, making every token unique - Multi-owner control - Tokens can have multiple managers, enabling shared control of game resources
State Variables¶
| Variable | Type | Visibility | Mutability | Initial Value | NatSpec |
|---|---|---|---|---|---|
_balances |
mapping(address => uint256) |
private | mutable | `` | |
_allowances |
mapping(address => mapping(address => uint256)) |
private | mutable | `` | |
_totalSupply |
uint256 |
private | mutable | `` | |
__name |
string |
internal | mutable | `` | |
__symbol |
string |
internal | mutable | `` | |
MotzkinPrime |
uint64 |
public | constant | 953467954114363 |
|
Xiao |
atropaMath |
public | mutable | `` | |
maxSupply |
uint256 |
public | mutable | `` | |
_marketRates |
mapping(address => uint256) |
private | mutable | `` |
Events¶
| Event | Parameters | Anonymous | NatSpec |
|---|---|---|---|
Transfer |
address indexed from, address indexed to, uint256 value | no | |
Approval |
address indexed owner, address indexed spender, uint256 value | no |
Errors¶
| Error | Parameters | NatSpec |
|---|---|---|
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 |
Constructor¶
constructor¶
constructor(string memory name_, string memory symbol_, address mathContract) MultiOwnable(msg.sender)
- Modifiers:
MultiOwnable(msg.sender) - Parameters: string memory name_, string memory symbol_, address mathContract
Functions¶
External & Public¶
Rename¶
- Visibility: public
- Modifiers:
onlyOwners - Parameters: string memory newName, string memory newSymbol
mintToCap¶
- Visibility: public
- Modifiers:
onlyOwners
GetMarketRate¶
- Visibility: public
- State Mutability: view
- Parameters: address _a
- Returns: uint256
Purchase¶
- Visibility: public
- Parameters: address _t, uint256 _a
Redeem¶
- Visibility: public
- Parameters: address _t, uint256 _a
name¶
- Visibility: public
- State Mutability: view
- Virtual: yes
- Returns: string memory
symbol¶
- Visibility: public
- State Mutability: view
- Virtual: yes
- Returns: string memory
decimals¶
- Visibility: public
- State Mutability: view
- Virtual: yes
- Returns: uint8
totalSupply¶
- Visibility: public
- State Mutability: view
- Virtual: yes
- Returns: uint256
balanceOf¶
- Visibility: public
- State Mutability: view
- Virtual: yes
- Parameters: address account
- Returns: uint256
transfer¶
- Visibility: public
- Virtual: yes
- Parameters: address to, uint256 value
- Returns: bool
allowance¶
- Visibility: public
- State Mutability: view
- Virtual: yes
- Parameters: address owner, address spender
- Returns: uint256
approve¶
- Visibility: public
- Virtual: yes
- Parameters: address spender, uint256 value
- Returns: bool
transferFrom¶
- Visibility: public
- Virtual: yes
- Parameters: address from, address to, uint256 value
- Returns: bool
Internal¶
_mintToCap¶
- Visibility: internal
AddMarketRate¶
- Visibility: internal
- Parameters: address _a, uint256 _r
_transfer¶
- Visibility: internal
- Parameters: address from, address to, uint256 value
_update¶
- Visibility: internal
- Virtual: yes
- Parameters: address from, address to, uint256 value
_mint¶
- Visibility: internal
- Parameters: address account, uint256 value
_approve¶
- Visibility: internal
- Parameters: address owner, address spender, uint256 value
_approve¶
- Visibility: internal
- Virtual: yes
- Parameters: address owner, address spender, uint256 value, bool emitEvent
_spendAllowance¶
- Visibility: internal
- Virtual: yes
- Parameters: address owner, address spender, uint256 value
log10¶
- Visibility: internal
- State Mutability: pure
- Parameters: uint256 value
- Returns: uint256
String¶
- Visibility: internal
- State Mutability: pure
- Parameters: uint256 value
- Returns: string memory buffer
Hex¶
- Visibility: internal
- State Mutability: pure
- Parameters: address account
- Returns: string memory
Hex¶
- Visibility: internal
- State Mutability: pure
- Parameters: uint256 value
- Returns: string memory
Hex¶
- Visibility: internal
- State Mutability: pure
- Parameters: bytes32 value
- Returns: string memory
Hex¶
- Visibility: internal
- State Mutability: pure
- Parameters: bytes memory data
- Returns: string memory
Inherited Members¶
This contract inherits the members below from its parents. See each parent's dedicated MD for full signatures, NatSpec, and semantics.
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¶
- MultiOwnable - Access control
- VMREQ via atropaMath interface - Random number generation
Depended On By¶
- All token contracts in the ecosystem inherit from DYSNOMIA
Special Mechanisms¶
Market Rate System¶
Enables token-to-token exchanges without external AMM. Each contract can set internal exchange rates for other tokens, allowing direct Purchase/Redeem operations.
Random Max Supply¶
Constructor uses Xiao.Random() % 111111 to set a randomized maximum supply, with initial mint being 10% of that maximum.
Multi-Owner Governance¶
Inherits from MultiOwnable allowing multiple addresses to have administrative privileges.
Contract Verification¶
| Property | Value |
|---|---|
| Keccak256 Hash | 0xa2f5740edb50339b5617e2baf5d9f6d45d23e86f9beadd6cae14cf8de7fee7c6 |
| Source URL | https://raw.githubusercontent.com/busytoby/atropa_pulsechain/main/solidity/dysnomia/01_dysnomia.sol |
| Hash Generated | 2026-04-17T20:48:06Z |