QING
Address
0x1299bBac80F7038c19C20843f80608Bd80C14A74Code
[
{
"inputs": [
{
"internalType": "uint256",
"name": "Luo",
"type": "uint256"
},
{
"internalType": "address",
"name": "Integrative",
"type": "address"
},
{
"internalType": "address",
"name": "ChoAddress",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [
{
"internalType": "address",
"name": "UserToken",
"type": "address"
}
],
"name": "AlreadyJoined",
"type": "error"
},
{
"inputs": [
{
"internalType": "address",
"name": "origin",
"type": "address"
},
{
"internalType": "address",
"name": "account",
"type": "address"
},
{
"internalType": "address",
"name": "what",
"type": "address"
}
],
"name": "BouncerUnauthorized",
"type": "error"
},
{
"inputs": [
{
"internalType": "address",
"name": "AssetAddress",
"type": "address"
},
{
"internalType": "uint256",
"name": "Amount",
"type": "uint256"
}
],
"name": "CoverChargeUnauthorized",
"type": "error"
},
{
"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": "Forbidden",
"type": "error"
},
{
"inputs": [
{
"internalType": "address",
"name": "Contract",
"type": "address"
},
{
"internalType": "uint256",
"name": "CurrentRate",
"type": "uint256"
}
],
"name": "MarketRateCanOnlyBeIncreased",
"type": "error"
},
{
"inputs": [
{
"internalType": "address",
"name": "asset",
"type": "address"
}
],
"name": "MarketRateNotFound",
"type": "error"
},
{
"inputs": [
{
"internalType": "uint64",
"name": "Soul",
"type": "uint64"
}
],
"name": "NotAdmitted",
"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"
},
{
"inputs": [
{
"internalType": "address",
"name": "Asset",
"type": "address"
},
{
"internalType": "uint256",
"name": "CoverCharge",
"type": "uint256"
}
],
"name": "PayCover",
"type": "error"
},
{
"inputs": [
{
"internalType": "address",
"name": "Contract",
"type": "address"
},
{
"internalType": "uint256",
"name": "MaximumRate",
"type": "uint256"
}
],
"name": "TokenMaximumRate",
"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": false,
"internalType": "string",
"name": "Username",
"type": "string"
},
{
"indexed": false,
"internalType": "uint64",
"name": "Soul",
"type": "uint64"
},
{
"indexed": false,
"internalType": "uint64",
"name": "Aura",
"type": "uint64"
},
{
"indexed": false,
"internalType": "string",
"name": "LogLine",
"type": "string"
}
],
"name": "LogEvent",
"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"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint64",
"name": "Soul",
"type": "uint64"
},
{
"indexed": false,
"internalType": "uint64",
"name": "Aura",
"type": "uint64"
},
{
"indexed": false,
"internalType": "address",
"name": "Token",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "Withdrawal",
"type": "event"
},
{
"inputs": [
{
"internalType": "address",
"name": "Contract",
"type": "address"
},
{
"internalType": "uint256",
"name": "Rate",
"type": "uint256"
}
],
"name": "AddMarketRate",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "UserToken",
"type": "address"
}
],
"name": "Admitted",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bool",
"name": "_b",
"type": "bool"
}
],
"name": "AllowCROWS",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "Asset",
"outputs": [
{
"internalType": "contract DYSNOMIA",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "BouncerDivisor",
"outputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract LAU",
"name": "UserToken",
"type": "address"
},
{
"internalType": "string",
"name": "MSG",
"type": "string"
}
],
"name": "Chat",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "Cho",
"outputs": [
{
"internalType": "contract CHOINTERFACE",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "CoverCharge",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "Entropy",
"outputs": [
{
"internalType": "uint64",
"name": "",
"type": "uint64"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "GWAT",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_a",
"type": "address"
}
],
"name": "GetMarketRate",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "QingWaat",
"type": "uint256"
}
],
"name": "GetQing",
"outputs": [
{
"internalType": "contract QINGINTERFACE",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "UserToken",
"type": "address"
}
],
"name": "Join",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "Map",
"outputs": [
{
"internalType": "contract MAPINTERFACE",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "MotzkinPrime",
"outputs": [
{
"internalType": "uint64",
"name": "",
"type": "uint64"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "NoCROWS",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"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": [
{
"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": "Type",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "Waat",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "what",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "Withdraw",
"outputs": [],
"stateMutability": "nonpayable",
"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": [
{
"internalType": "address",
"name": "cBouncer",
"type": "address"
}
],
"name": "bouncer",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"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": "_a",
"type": "address"
}
],
"name": "removeGuest",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "toRemove",
"type": "address"
}
],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_d",
"type": "uint16"
}
],
"name": "setBouncerDivisor",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_c",
"type": "uint256"
}
],
"name": "setCoverCharge",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_a",
"type": "address"
}
],
"name": "setGuestlist",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_a",
"type": "address"
},
{
"internalType": "bool",
"name": "active",
"type": "bool"
}
],
"name": "setStaff",
"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_v2.sol";
import "./interfaces/01b_chointerface.sol";
import "../interfaces/mapinterface.sol";
contract QING is DYSNOMIA {
string public constant Type = "QING";
CHOINTERFACE public Cho;
DYSNOMIA public Asset;
MAPINTERFACE public Map;
uint256 public Waat;
uint64 public Entropy;
uint16 public BouncerDivisor;
uint256 public CoverCharge;
bool public NoCROWS;
mapping(address => bool) private _staff;
mapping(address => uint256) private _list;
bool public immutable GWAT;
constructor(uint256 Luo, address Integrative, address ChoAddress) DYSNOMIA("Mysterious Qing", "q", address(DYSNOMIA(ChoAddress).Xiao())) {
if(Luo % 476733977057179 == 0) GWAT = false;
else GWAT = true;
Cho = CHOINTERFACE(ChoAddress);
Waat = Luo;
Asset = DYSNOMIA(Integrative);
Map = MAPINTERFACE(msg.sender);
_staff[tx.origin] = true;
setBouncerDivisor(32); // Default Based On Holding 25 CROWS
setCoverCharge(0);
NoCROWS = false;
uint256 originMint = Xiao.Random() % maxSupply / 10;
_mint(address(this), originMint * 10 ** decimals());
(Entropy, ) = Cho.React(Xiao.Random());
_mintToCap();
}
error MarketRateCanOnlyBeIncreased(address Contract, uint256 CurrentRate);
error TokenMaximumRate(address Contract, uint256 MaximumRate);
function AddMarketRate(address Contract, uint256 Rate) public onlyOwners {
if(Rate < GetMarketRate(Contract)) revert MarketRateCanOnlyBeIncreased(Contract, GetMarketRate(Contract));
uint256 _maxRate = DYSNOMIA(Contract).totalSupply() / 777;
if(Rate > _maxRate) revert TokenMaximumRate(Contract, _maxRate);
_addMarketRate(Contract, Rate);
}
function GetQing(uint256 QingWaat) public view returns (QINGINTERFACE) {
return Map.GetQing(QingWaat);
}
event Withdrawal(uint64 Soul, uint64 Aura, address Token, uint256 amount);
function Withdraw(address what, uint256 amount) public onlyOwners {
assert(!GWAT);
User memory Alpha = Cho.GetUser();
DYSNOMIA withdrawToken = DYSNOMIA(what);
withdrawToken.transfer(msg.sender, amount);
emit Withdrawal(Alpha.Soul, Cho.Void().Nu().Aura(), what, amount);
}
function AllowCROWS(bool _b) public onlyOwners {
NoCROWS = !_b;
}
function setBouncerDivisor(uint16 _d) public onlyBouncers {
BouncerDivisor = _d;
}
function setCoverCharge(uint256 _c) public onlyBouncers {
CoverCharge = _c;
}
function setStaff(address _a, bool active) public onlyBouncers {
_staff[_a] = active;
}
function setGuestlist(address _a) public onlyBouncers {
_list[_a] = block.timestamp + 1 days;
}
function removeGuest(address _a) public onlyBouncers {
_list[_a] = 0;
}
modifier onlyBouncers() {
_checkBouncer();
_;
}
function bouncer(address cBouncer) public view returns (bool) {
if(_staff[cBouncer]) return true;
if(NoCROWS == false && DYSNOMIA(CROWSContract).balanceOf(cBouncer) >= 25 * 10 ** decimals()) return true;
uint256 _ts = Asset.totalSupply();
if(Asset.balanceOf(cBouncer) >= (_ts / BouncerDivisor)) return true;
if(Map.hasOwner(address(Asset)))
return Asset.owner(cBouncer);
return false;
}
error BouncerUnauthorized(address origin, address account, address what);
function _checkBouncer() internal view {
if(!bouncer(tx.origin) && !bouncer(msg.sender)) {
address UserToken = Cho.GetUserTokenAddress(tx.origin);
if(!bouncer(UserToken))
revert BouncerUnauthorized(tx.origin, msg.sender, address(this));
}
}
error AlreadyJoined(address UserToken);
error CoverChargeUnauthorized(address AssetAddress, uint256 Amount);
function Join(address UserToken) public {
Cho.VerifyUserTokenPermissions(UserToken);
if(CoverCharge > 0 && _list[UserToken] < block.timestamp) {
if(Asset.allowance(msg.sender, address(this)) <= CoverCharge) revert CoverChargeUnauthorized(address(Asset), CoverCharge);
bool paid = Asset.transferFrom(msg.sender, address(this), CoverCharge);
if(!paid) revert CoverChargeUnauthorized(address(Asset), CoverCharge);
}
if(_list[UserToken] < block.timestamp)
_list[UserToken] = block.timestamp + 1 days;
if(Cho.GetUserTokenAddress(tx.origin) == address(0x0))
Cho.Enter(UserToken);
_mintToCap();
}
function Admitted(address UserToken) public view returns (bool) {
if(CoverCharge != 0 && _list[UserToken] < block.timestamp) return false;
return true;
}
error PayCover(address Asset, uint256 CoverCharge);
error Forbidden(address Asset);
error NotAdmitted(uint64 Soul);
event LogEvent(string Username, uint64 Soul, uint64 Aura, string LogLine);
function Chat(LAU UserToken, string memory MSG) public {
if(Map.Forbidden(address(Asset))) revert Forbidden(address(Asset));
_mintToCap();
uint64 _soul = UserToken.Saat(1);
Cho.VerifyUserTokenPermissions(address(UserToken));
if(!Admitted(address(UserToken))) revert NotAdmitted(_soul);
if(CoverCharge != 0 && !(_list[address(UserToken)] > block.timestamp)) revert PayCover(address(Asset), CoverCharge);
emit LogEvent(UserToken.Username(), _soul, UserToken.Saat(2), MSG);
}
}
Last updated