DYSNOMIA¶
Overview¶
DYSNOMIA V2 is an alternate implementation of the base token with minor internal differences. It's functionally equivalent to DYSNOMIA but used by specific domain contracts.
- Kind: Abstract Contract
- License: Sharia
- Solidity: ^0.8.21
- Source:
01_dysnomia_v2.sol
Inheritance Chain (C3 Linearized)¶
- self — DYSNOMIA
- MultiOwnable
Immediate Parents¶
What This Means For Players¶
Plain English Summary: DYSNOMIA V2 is essentially the same as DYSNOMIA V1 - it's the foundation for game tokens. The "V2" just means it's a slightly newer version used by the domain (game-specific) contracts. For players, there's no practical difference between tokens using V1 or V2.
Real-World Analogy: Think of V1 and V2 like two editions of the same board game rule book. The rules are the same, but one was printed for the "core" game and one for the "expansion packs" (domain contracts). Your gameplay experience is identical either way.
How It Affects Your Gameplay: - No visible difference - V1 and V2 tokens work identically from a player perspective - Domain tokens use this - Game-specific tokens like H2O and VITUS are built on V2
Differences from V1¶
The V2 contract has the same public interface as V1 but with internal naming differences:
- Uses _addMarketRate instead of AddMarketRate for internal market rate setting
- Used primarily by domain contracts that were developed later in the project
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
- Virtual: yes
- 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¶
_addLibraryOwner¶
- Visibility: internal
- Parameters: VOID Void, string memory what
_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
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
Depended On By¶
- Domain contracts in
/domain/ - Library contracts in
/lib/ - Hecke
- STRINGLIB
- COREREACTIONSLIB
Usage Pattern¶
// V1 pattern (core contracts)
contract MyToken is DYSNOMIA {
constructor() DYSNOMIA("Name", "SYM", mathAddr) {
AddMarketRate(someToken, rate);
}
}
// V2 pattern (domain contracts)
contract MyDomainToken is DYSNOMIA {
constructor() DYSNOMIA("Name", "SYM", mathAddr) {
_addMarketRate(someToken, rate);
}
}
Notes¶
Both versions are functionally interchangeable. The existence of two versions appears to be an artifact of development history rather than a deliberate design decision.
Contract Verification¶
| Property | Value |
|---|---|
| Keccak256 Hash | 0xb89798bc29755c806444016434774f935310e4bccdc7019797aeed65ffe46817 |
| Source URL | https://raw.githubusercontent.com/busytoby/atropa_pulsechain/main/solidity/dysnomia/01_dysnomia_v2.sol |
| Hash Generated | 2026-04-17T20:48:07Z |