MAI¶
Overview¶
MAI is the second contract in the soeng chain. It extends QI calculations to incorporate QING-specific balance data.
- Inherits: DYSNOMIA V2
- License: Sharia
- Solidity: ^0.8.21
What This Means For Players¶
Plain English Summary: MAI calculates your venue-specific power. While QI measures your overall energy, MAI looks at how much of a specific QING's tokens you hold. More QING tokens = higher MAI = more influence in that venue.
Real-World Analogy: If QI is your general fitness level, MAI is your skill at a particular sport. You might be generally fit (high QI), but your MAI at a basketball venue depends on how much time (tokens) you've invested in that specific activity.
How It Affects Your Gameplay: - Venue-specific power - Your MAI differs for each QING based on your token holdings there - Chat rewards - MAI determines your rewards when chatting in a venue (capped at 1 token) - Second in the chain - MAI builds on QI and feeds into XIA calculations
State Variables¶
| Variable | Type | Visibility | Description |
|---|---|---|---|
| Type | string | public constant | "MAI" |
| Qi | QIINTERFACE | public | Reference to QI |
Write Functions¶
React¶
- Access:public
- Parameters:
- Soul (uint64): User's 64-bit Soul ID identifier
- QingWaat (uint256): Target QING's position identifier (Waat)
- Returns:
- Mai (uint256): Calculated Mai value for the user at this venue
- Description: Calculates venue-specific power by dividing user's QING token holdings by their entropy.
- Logic Flow:
1. Look up user: Alpha = Qi.Zuo().Cho().GetUserBySoul(Soul)
2. Look up QING: Qing = Qi.Zuo().GetQing(QingWaat)
3. Get user's balance of QING tokens: Qing.balanceOf(Alpha.On.Phi)
4. Get user's entropy: Alpha.Entropy
5. Return balance / entropy
- Computation Details:
- Mai = QING.balanceOf(userAddress) / User.Entropy
- Different from QI which uses Eris balance; MAI uses the specific QING's balance
- Higher QING holdings = higher Mai at that venue
- Side Effects: Mints tokens
- In Plain English: Calculate your influence at a specific venue. The more of that venue's tokens you hold, the higher your MAI. While QI measures your overall energy (Eris), MAI measures your investment in a particular venue. This affects chat rewards (capped at 1 token per message) and feeds into XIA charge calculations.
Contract Interactions¶
Depends On¶
- DYSNOMIA V2 - Base functionality
- QI - Base calculations
Depended On By¶
Special Mechanisms¶
Mai Calculation¶
function React(uint64 Soul, uint256 QingWaat) public returns (uint256 Mai) {
User memory Alpha = Qi.Zuo().Cho().GetUserBySoul(Soul);
QINGINTERFACE Qing = Qi.Zuo().GetQing(QingWaat);
return Qing.balanceOf(Alpha.On.Phi) / Alpha.Entropy;
}
Contract Verification¶
| Property | Value |
|---|---|
| Keccak256 Hash | 0x966c96f0c83054fdbf8ded08d9564b32fe01b49cdb6cb68713ac601153c095d6 |
| Source URL | https://raw.githubusercontent.com/busytoby/atropa_pulsechain/main/solidity/dysnomia/domain/soeng/02_mai.sol |
| Hash Generated | 2026-02-08T00:29:08Z |