Skip to content

Const & Value Type

Wowok Protocol edited this page Jun 4, 2024 · 1 revision

Definitions related to Wowok: operators, constants, data types, etc.

Guard's Query Operators

Guard bytecode logical operators

export enum OperatorType {   
    TYPE_QUERY = 1, // query wowok object   
    TYPE_LOGIC_AS_U256_GREATER = 11,   
    TYPE_LOGIC_AS_U256_GREATER_EQUAL = 12,   
    TYPE_LOGIC_AS_U256_LESSER = 13,   
    TYPE_LOGIC_AS_U256_LESSER_EQUAL = 14,     
    TYPE_LOGIC_AS_U256_EQUAL = 15,    
    TYPE_LOGIC_EQUAL = 16, // TYPE&DATA(vector<u8>) MUST BE EQUAL    
    TYPE_LOGIC_HAS_SUBSTRING = 17, // SUBSTRING   
    TYPE_LOGIC_ALWAYS_TRUE = 18, // aways true   
    TYPE_LOGIC_NOT = 19, // NOT
    TYPE_LOGIC_AND = 20, // AND
    TYPE_LOGIC_OR = 21, // OR
}   

Special data type definitions

export enum ContextType { 
    TYPE_SIGNER = 60, // Signer: TYPE_ADDRESS type     
    TYPE_CLOCK = 61, // On-chain time: TYPE_U64 type 
    TYPE_WITNESS_ID = 62, // Relationship witness: TYPE_ADDRESS type    
    TYPE_CONSTANT = 80, // Guard constant, a data reference pointing to Guard.constants   
}  

Data Type Definitions
data types supported by Wowok for use in Repository storage and Guard verification, etc.

export enum ValueType {   
    TYPE_BOOL = 100,   
    TYPE_ADDRESS = 101,   
    TYPE_U64 = 102,   
    TYPE_U8 = 103,   
    TYPE_VEC_U8 = 104,   
    TYPE_U128 = 105,   
    TYPE_VEC_ADDRESS = 106,   
    TYPE_VEC_BOOL = 107,   
    TYPE_VEC_VEC_U8 = 108,   
    TYPE_VEC_U64 = 109,   
    TYPE_VEC_U128 = 110,   
    TYPE_OPTION_ADDRESS = 111,   
    TYPE_OPTION_BOOL = 112,    
    TYPE_OPTION_U8 = 113,   
    TYPE_OPTION_U64 = 114,
    TYPE_OPTION_U128 = 115,   
    TYPE_OPTION_U256 = 116,   
    TYPE_VEC_U256 = 117,   
    TYPE_U256 = 118,  
}

Errors

100002: Incorrect string length   
100004: String cannot be empty   
100010: Invalid percentage value   
100012: Does not conform to ASCII character set  
100014: Incorrect data type   
100016: Addition overflow   
100018: Multiplication overflow   
100020: Subtraction overflow   
Clone this wiki locally