YI
Address
0x4757438723055f14a1af5c9651c2e37730f41a9eCode
[
{
"inputs": [
{
"internalType": "address",
"name": "_shaFactory",
"type": "address"
},
{
"internalType": "address",
"name": "_shioFactory",
"type": "address"
},
{
"internalType": "address",
"name": "MathLib",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"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": "Bang",
"outputs": [
{
"components": [
{
"internalType": "address",
"name": "Phi",
"type": "address"
},
{
"internalType": "contract SHA",
"name": "Mu",
"type": "address"
},
{
"internalType": "uint64",
"name": "Xi",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "Pi",
"type": "uint64"
},
{
"internalType": "contract SHIO",
"name": "Shio",
"type": "address"
},
{
"internalType": "uint64",
"name": "Ring",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "Omicron",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "Omega",
"type": "uint64"
}
],
"internalType": "struct Bao",
"name": "",
"type": "tuple"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "Name",
"type": "string"
},
{
"internalType": "string",
"name": "Symbol",
"type": "string"
}
],
"name": "Beta",
"outputs": [
{
"internalType": "contract SHA",
"name": "",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"components": [
{
"internalType": "address",
"name": "Phi",
"type": "address"
},
{
"internalType": "contract SHA",
"name": "Mu",
"type": "address"
},
{
"internalType": "uint64",
"name": "Xi",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "Pi",
"type": "uint64"
},
{
"internalType": "contract SHIO",
"name": "Shio",
"type": "address"
},
{
"internalType": "uint64",
"name": "Ring",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "Omicron",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "Omega",
"type": "uint64"
}
],
"internalType": "struct Bao",
"name": "_b",
"type": "tuple"
}
],
"name": "Bing",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_a",
"type": "address"
}
],
"name": "GetMarketRate",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract SHA",
"name": "Rod",
"type": "address"
},
{
"internalType": "contract SHA",
"name": "Cone",
"type": "address"
}
],
"name": "Kappa",
"outputs": [
{
"internalType": "contract SHIO",
"name": "",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "MotzkinPrime",
"outputs": [
{
"internalType": "uint64",
"name": "",
"type": "uint64"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "Psi",
"outputs": [
{
"internalType": "contract SHIO",
"name": "",
"type": "address"
}
],
"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": [
{
"components": [
{
"internalType": "address",
"name": "Phi",
"type": "address"
},
{
"internalType": "contract SHA",
"name": "Mu",
"type": "address"
},
{
"internalType": "uint64",
"name": "Xi",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "Pi",
"type": "uint64"
},
{
"internalType": "contract SHIO",
"name": "Shio",
"type": "address"
},
{
"internalType": "uint64",
"name": "Ring",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "Omicron",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "Omega",
"type": "uint64"
}
],
"internalType": "struct Bao",
"name": "Gamma",
"type": "tuple"
},
{
"internalType": "uint64",
"name": "Pi",
"type": "uint64"
}
],
"name": "React",
"outputs": [
{
"components": [
{
"internalType": "address",
"name": "Phi",
"type": "address"
},
{
"internalType": "contract SHA",
"name": "Mu",
"type": "address"
},
{
"internalType": "uint64",
"name": "Xi",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "Pi",
"type": "uint64"
},
{
"internalType": "contract SHIO",
"name": "Shio",
"type": "address"
},
{
"internalType": "uint64",
"name": "Ring",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "Omicron",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "Omega",
"type": "uint64"
}
],
"internalType": "struct Bao",
"name": "",
"type": "tuple"
}
],
"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": "Ring",
"outputs": [
{
"internalType": "uint64",
"name": "",
"type": "uint64"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "SHAFactoryInterface",
"outputs": [
{
"internalType": "contract SHAFactory",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "SHIOFactoryInterface",
"outputs": [
{
"internalType": "contract SHIOFactory",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "Type",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "Xi",
"outputs": [
{
"internalType": "uint64",
"name": "",
"type": "uint64"
}
],
"stateMutability": "view",
"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"
}
]// SPDX-License-Identifier: Sharia
pragma solidity ^0.8.21;
import "./01_dysnomia.sol";
import "./include/bao.sol";
import "./interfaces/02d_shafactoryinterface.sol";
import "./interfaces/03b_shiointerface.sol";
import "./interfaces/03d_shiofactoryinterface.sol";
contract YI is DYSNOMIA {
string public constant Type = "YI";
SHIO public Psi;
mapping(address => Bao) private Nu;
uint64 public Xi;
uint64 public Ring;
SHAFactory public SHAFactoryInterface;
SHIOFactory public SHIOFactoryInterface;
constructor(address _shaFactory, address _shioFactory, address MathLib) DYSNOMIA(unicode"CHATLOG Yi", unicode"YI", MathLib) {
SHAFactoryInterface = SHAFactory(_shaFactory);
SHIOFactoryInterface = SHIOFactory(_shioFactory);
SHA Rod = SHAFactoryInterface.New("Shio Rod", "SROD", MathLib);
SHA Cone = SHAFactoryInterface.New("Shio Cone", "SCONE", MathLib);
Psi = SHIOFactoryInterface.New(address(Rod), address(Cone), MathLib);
Xi = Xiao.Random();
Psi.Generate(Xi, Xiao.Random(), Xiao.Random());
Ionize();
Ring = Psi.Magnetize();
Augment();
}
function Augment() internal {
AddMarketRate(address(Psi), 1 * 10 ** decimals());
AddMarketRate(address(Psi.Rod()), 1 * 10 ** decimals());
AddMarketRate(address(Psi.Cone()), 1 * 10 ** decimals());
_mintToCap();
}
function Beta(string calldata Name, string calldata Symbol) public onlyOwners returns(SHA) {
SHA Xun = SHAFactoryInterface.New(Name, Symbol, address(Xiao));
Xun.addOwner(msg.sender);
_mintToCap();
return Xun;
}
function Kappa(SHA Rod, SHA Cone) public onlyOwners returns(SHIO) {
SHIO Xie = SHIOFactoryInterface.New(address(Rod), address(Cone), address(Xiao));
Xie.addOwner(msg.sender);
_mintToCap();
return Xie;
}
function Bing(Bao memory _b) public onlyOwners {
Nu[_b.Phi] = _b;
SHIO(_b.Shio).Log(0, 0, "Added to Yi.Nu");
_mintToCap();
}
function Bang(address _a) public view returns(Bao memory) {
return Nu[_a];
}
function Ionize() private {
Psi.Isomerize();
Psi.Isolate();
_mintToCap();
}
function React(Bao memory Gamma, uint64 Pi) public returns(Bao memory) {
(Gamma.Omicron, Gamma.Omega) = SHIO(Gamma.Shio).React(Pi);
_mintToCap();
return Gamma;
}
}Last updated