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.
Compiled ABI¶
The compiled ABI below is produced by solc 0.8.21 from the exact source bytes hashed in the Contract Verification section. Consumers can paste it directly into ethers/web3/viem.
Click to expand JSON ABI
[
{
"inputs": [
{
"internalType": "address",
"name": "origin",
"type": "address"
},
{
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "address",
"name": "what",
"type": "address"
},
{
"internalType": "uint256",
"name": "allowance",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "needed",
"type": "uint256"
}
],
"name": "DysnomiaInsufficientAllowance",
"type": "error"
},
{
"inputs": [
{
"internalType": "address",
"name": "origin",
"type": "address"
},
{
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "address",
"name": "what",
"type": "address"
},
{
"internalType": "uint256",
"name": "balance",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "needed",
"type": "uint256"
}
],
"name": "DysnomiaInsufficientBalance",
"type": "error"
},
{
"inputs": [
{
"internalType": "address",
"name": "asset",
"type": "address"
}
],
"name": "MarketRateNotFound",
"type": "error"
},
{
"inputs": [
{
"internalType": "address",
"name": "origin",
"type": "address"
},
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "address",
"name": "what",
"type": "address"
}
],
"name": "OwnableInvalidOwner",
"type": "error"
},
{
"inputs": [
{
"internalType": "address",
"name": "origin",
"type": "address"
},
{
"internalType": "address",
"name": "account",
"type": "address"
},
{
"internalType": "address",
"name": "what",
"type": "address"
}
],
"name": "OwnableUnauthorizedAccount",
"type": "error"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Approval",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "bool",
"name": "state",
"type": "bool"
}
],
"name": "OwnershipUpdate",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"inputs": [
{
"internalType": "address",
"name": "_a",
"type": "address"
}
],
"name": "GetMarketRate",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "MotzkinPrime",
"outputs": [
{
"internalType": "uint64",
"name": "",
"type": "uint64"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_t",
"type": "address"
},
{
"internalType": "uint256",
"name": "_a",
"type": "uint256"
}
],
"name": "Purchase",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_t",
"type": "address"
},
{
"internalType": "uint256",
"name": "_a",
"type": "uint256"
}
],
"name": "Redeem",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "newName",
"type": "string"
},
{
"internalType": "string",
"name": "newSymbol",
"type": "string"
}
],
"name": "Rename",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "Xiao",
"outputs": [
{
"internalType": "contract atropaMath",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "addOwner",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "address",
"name": "spender",
"type": "address"
}
],
"name": "allowance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "decimals",
"outputs": [
{
"internalType": "uint8",
"name": "",
"type": "uint8"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "maxSupply",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "mintToCap",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "name",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "cOwner",
"type": "address"
}
],
"name": "owner",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "toRemove",
"type": "address"
}
],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "symbol",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "transfer",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
]
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-20T02:38:18Z |