Skip to content

SEI

Overview

SEI is the player onboarding contract that creates YUE (player bank) instances and manages the Start function for new players.

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

What This Means For Players

Plain English Summary: SEI is the new player onboarding system. When you first start playing, SEI creates your YUE (personal bank) and connects it to your LAU (player account). It's the "Start" button that officially registers you as a player in the game.

Real-World Analogy: SEI is like the welcome desk at a new gym. When you first join, they set up your membership card (LAU), open your account (YUE), and give you access to all the facilities. After that, you can use Chi() to quickly access your account info.

How It Affects Your Gameplay: - First-time setup - Call Start() to create your YUE bank when you first play - Quick access - Use Chi() to get your YUE and LAU addresses - Rename option - Existing players can use Start() to rename their YUE

State Variables

Variable Type Visibility Description
Type string public constant "SEI"
Chan CHAN public Reference to CHAN

Read Functions

Chi

function Chi() public view returns (YUE Yue, LAU UserToken)
- Access: public view - Returns: - Yue (YUE): Player's YUE bank contract retrieved from CHAN.Yan mapping - UserToken (LAU): Player's LAU identity token retrieved from CHO.GetUserTokenAddress - Description: Retrieves the caller's associated YUE and LAU addresses. - Logic Flow: 1. Check if player has started: if(Chan.Yan(tx.origin) == address(0x0)) revert NotStarted 2. Get YUE from CHAN: Yue = YUE(Chan.Yan(tx.origin)) 3. Get LAU from CHO: UserToken = LAU(Chan.Xie().Xia().Mai().Qi().Zuo().Cho().GetUserTokenAddress(tx.origin)) 4. Return both - Side Effects: None (view function) - In Plain English: Look up your game accounts - your bank (YUE) and player identity (LAU). A quick way to get both your core account addresses in one call. Reverts if you haven't started playing yet.

Write Functions

Start

function Start(address LauToken, string calldata YueName, string calldata YueSymbol) public returns (YUE Yue, LAU UserToken)
- Access: public - Parameters: - LauToken (address): Player's LAU token contract address - YueName (string): Name for the player's YUE bank token - YueSymbol (string): Symbol for the player's YUE bank token - Returns: - Yue (YUE): Player's new or existing YUE bank contract - UserToken (LAU): Player's LAU identity token - Description: Creates a new YUE bank for first-time players or renames existing YUE. - Logic Flow: 1. Mint to capacity: mintToCap() 2. Check if new player: if(Chan.Yan(tx.origin) == address(0x0)) 3. For new players: - Enter through CHO: Chan.Xie().Xia().Mai().Qi().Zuo().Cho().Enter(LauToken) - Store LAU reference: UserToken = LAU(LauToken) - Deploy new YUE: Yue = new YUE(YueName, YueSymbol, address(Chan)) - Grant CHAN ownership: Yue.addOwner(address(Chan)) - Register in CHAN: Chan.AddYue(tx.origin, address(Yue)) - Return new contracts 4. For existing players: - Get existing contracts: (Yue, UserToken) = Chi() - Rename YUE: Yue.Rename(YueName, YueSymbol) - Return existing contracts - Side Effects: May deploy new YUE contract; triggers CHO.Enter for authentication; updates CHAN.Yan mapping; mints SEI tokens - In Plain English: Create your game bank account! First-time players get a new YUE deployed with their chosen name/symbol, then it's registered with CHAN. Existing players can call this to just rename their YUE without creating a new one.

Errors

Error Parameters Description
NotStarted address Player hasn't started

Contract Interactions

Depends On

Creates

  • YUE - Player bank instances

Depended On By

  • CHEON - Uses SEI for player access
  • CHOA - Uses SEI.Chi()

Special Mechanisms

Chi Lookup

function Chi() public view returns (YUE Yue, LAU UserToken) {
    if(Chan.Yan(tx.origin) == address(0x0)) revert NotStarted(tx.origin);
    Yue = YUE(Chan.Yan(tx.origin));
    UserToken = LAU(Chan.Xie().Xia().Mai().Qi().Zuo().Cho().GetUserTokenAddress(tx.origin));
}

Start Function

function Start(address LauToken, string calldata YueName, string calldata YueSymbol) public returns (YUE Yue, LAU UserToken) {
    if(Chan.Yan(tx.origin) == address(0x0)) {
        // New player
        Chan.Xie().Xia().Mai().Qi().Zuo().Cho().Enter(LauToken);
        UserToken = LAU(LauToken);
        Yue = new YUE(YueName, YueSymbol, address(Chan));
        Yue.addOwner(address(Chan));
        Chan.AddYue(tx.origin, address(Yue));
        return (Yue, UserToken);
    }

    // Existing player - just rename
    (Yue, UserToken) = Chi();
    Yue.Rename(YueName, YueSymbol);
}

Contract Verification

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