Skip to content

CHEON

Overview

CHEON is the player management contract that coordinates player rewards through the Su function. It manages interactions between SEI and CHAN.

  • Inherits: DYSNOMIA V2
  • License: Sharia
  • Solidity: ^0.8.21

What This Means For Players

Plain English Summary: CHEON handles player rewards - it calculates what you earn and delivers it to your YUE. When you interact with venues or claim territory, CHEON's Su function figures out your rewards based on your activity and power values.

Real-World Analogy: CHEON is like the payroll department at a company. When you do work (interact with QINGs), CHEON calculates your paycheck (rewards) based on your performance (charge, hypobar, epibar) and deposits it into your bank account (YUE).

How It Affects Your Gameplay: - Reward calculation - Su() calculates your rewards for interacting with a QING - Token delivery - Rewards are minted directly to your YUE - Bar tracking - Hypobar and Epibar values accumulate based on your activity

State Variables

Variable Type Visibility Description
Type string public constant "CHEON"
Sei SEI public Reference to SEI

Write Functions

Su

function Su(address Qing) public returns (uint256 Charge, uint256 Hypobar, uint256 Epibar)
- Access: public - Parameters: - Qing (address): Target QING venue address to interact with - Returns: - Charge (uint256): Reaction charge value from CHAN.ReactYue - Hypobar (uint256): Accumulated Omega values from YUE.Bar for this QING - Epibar (uint256): Accumulated Omicron values from YUE.Bar for this QING - Description: Processes player interaction with a venue, calculates rewards, and delivers MAI tokens to the player's YUE. - Logic Flow: 1. Get player state: (Chi, UserToken) = Sei.Chi() 2. Create QING interface: _qing = QINGINTERFACE(Qing) 3. React YUE against QING: Charge = Sei.Chan().ReactYue(Chi, Qing) 4. Mint to capacity: mintToCap() 5. Calculate MAI reward: Mai = Sei.Chan().Xie().Xia().Mai().React(UserToken.Saat(1), _qing.Waat()) 6. Cap reward: if(Mai > 1 * 10^18) Mai = 1 * 10^18 7. Transfer if balance available: if(balanceOf(this) >= Mai) _transfer(this, Chi, Mai) 8. Trigger YUE mint: Sei.Chan().YueMintToOrigin(Chi) 9. Get bar values: (Hypobar, Epibar) = Chi.Bar(Qing) - Computation Details: - MAI reward comes from soeng chain calculation MAI.React(Soul, Waat) - Maximum reward per call capped at 1 CHEON token - Bar values are accumulated Omega/Omicron from previous YUE.React calls - Side Effects: Triggers YUE reaction via CHAN; may transfer CHEON tokens to YUE; triggers YueMintToOrigin; triggers full MAI soeng calculation; mints CHEON tokens - In Plain English: Collect your rewards from interacting with a venue! Su reacts your bank with the venue to build activity, calculates MAI-based rewards (capped at 1 token), deposits them to your bank, and returns your accumulated bar scores (Hypobar/Epibar) that track your total activity at this venue.

Contract Interactions

Depends On

Depended On By

  • WORLD - Uses CHEON for Code rewards
  • META - References CHEON

Special Mechanisms

Su Calculation

function Su(address Qing) public returns (uint256 Charge, uint256 Hypobar, uint256 Epibar) {
    (YUEINTERFACE Chi, LAU UserToken) = Sei.Chi();
    QINGINTERFACE _qing = QINGINTERFACE(Qing);

    // React YUE against QING
    Charge = Sei.Chan().ReactYue(Chi, Qing);

    // Calculate MAI reward
    uint256 Mai = Sei.Chan().Xie().Xia().Mai().React(UserToken.Saat(1), _qing.Waat());

    // Cap and transfer
    if(Mai > 1 * 10 ** decimals()) Mai = 1 * 10 ** decimals();
    if(balanceOf(address(this)) >= Mai)
        _transfer(address(this), address(Chi), Mai);

    // Mint to origin
    Sei.Chan().YueMintToOrigin(Chi);

    // Get bar values
    (Hypobar, Epibar) = Chi.Bar(Qing);
}

Contract Verification

Property Value
Keccak256 Hash 0x2cfc4b32ecf06d93a40f5531642a5f871dbb637a26e1d39c2a57694a492834f3
Source URL https://raw.githubusercontent.com/busytoby/atropa_pulsechain/main/solidity/dysnomia/domain/tang/02_cheon.sol
Hash Generated 2026-02-08T00:29:08Z