package solidity-typechecker

  1. Overview
  2. Docs
type origin =
  1. | Defined
  2. | Imported
  3. | Inherited
type env = {
  1. upper_env : env option;
  2. mutable ident_map : (ident_desc * origin) list Solidity_common.IdentMap.t;
  3. mutable using_for : (env * type_ list) Solidity_common.AbsLongIdentMap.t;
}
and ident_desc =
  1. | Alias of alias_desc
  2. | Module of module_desc
  3. | Contract of contract_desc
  4. | Type of type_desc
  5. | Variable of variable_desc
  6. | Function of function_desc
  7. | Modifier of modifier_desc
  8. | Event of event_desc
  9. | Field of field_desc
  10. | Constr of constr_desc
and alias_desc = {
  1. alias_abs_name : Solidity_common.absolute Solidity_common.LongIdent.t;
  2. alias_pos : Solidity_common.pos;
  3. alias_target_id : Solidity_common.Ident.t;
  4. alias_target_file : string;
  5. alias_target_env : env;
  6. mutable alias_targets : (ident_desc * origin) list;
}
and module_desc = {
  1. module_abs_name : Solidity_common.absolute Solidity_common.LongIdent.t;
  2. module_pos : Solidity_common.pos;
  3. module_file : string;
  4. module_env : env;
}
and type_desc =
  1. | TDEnum of enum_desc
  2. | TDStruct of struct_desc
and enum_desc = {
  1. enum_abs_name : Solidity_common.absolute Solidity_common.LongIdent.t;
  2. enum_pos : Solidity_common.pos;
  3. enum_values : (Solidity_common.Ident.t * int) list;
}
and constr_desc = {
  1. constr_enum_desc : enum_desc;
  2. constr_name : Solidity_common.Ident.t;
  3. constr_value : int;
  4. constr_type : type_;
}
and struct_desc = {
  1. struct_abs_name : Solidity_common.absolute Solidity_common.LongIdent.t;
  2. mutable struct_fields : (Solidity_common.Ident.t * type_) list;
  3. mutable has_mapping : bool;
  4. struct_def : Solidity_ast.struct_definition;
}
and field_desc = {
  1. field_struct_desc : struct_desc;
  2. field_name : Solidity_common.Ident.t;
  3. field_type : type_;
}
and contract_desc = {
  1. contract_abs_name : Solidity_common.absolute Solidity_common.LongIdent.t;
  2. contract_env : env;
  3. mutable contract_hierarchy : (Solidity_common.absolute Solidity_common.LongIdent.t * contract_desc) list;
  4. contract_def : Solidity_ast.contract_definition;
}
and variable_desc = {
  1. variable_abs_name : Solidity_common.absolute Solidity_common.LongIdent.t;
  2. mutable variable_type : type_;
  3. variable_visibility : Solidity_ast.visibility;
  4. variable_mutability : Solidity_ast.var_mutability;
  5. variable_local : bool;
  6. mutable variable_override : Solidity_common.absolute Solidity_common.LongIdent.t list option;
  7. mutable variable_getter : function_desc option;
  8. variable_is_primitive : bool;
  9. variable_def : Solidity_ast.state_variable_definition option;
}
and function_desc = {
  1. function_abs_name : Solidity_common.absolute Solidity_common.LongIdent.t;
  2. mutable function_params : (type_ * Solidity_common.Ident.t option) list;
  3. mutable function_returns : (type_ * Solidity_common.Ident.t option) list;
  4. function_returns_lvalue : bool;
  5. function_visibility : Solidity_ast.visibility;
  6. function_mutability : Solidity_ast.fun_mutability;
  7. mutable function_override : Solidity_common.absolute Solidity_common.LongIdent.t list option;
  8. mutable function_selector : string option;
  9. function_is_method : bool;
  10. function_is_primitive : bool;
  11. function_def : Solidity_ast.function_definition option;
}
and modifier_desc = {
  1. modifier_abs_name : Solidity_common.absolute Solidity_common.LongIdent.t;
  2. mutable modifier_params : (type_ * Solidity_common.Ident.t option) list;
  3. modifier_def : Solidity_ast.modifier_definition;
}
and event_desc = {
  1. event_abs_name : Solidity_common.absolute Solidity_common.LongIdent.t;
  2. mutable event_params : (type_ * Solidity_common.Ident.t option) list;
  3. event_def : Solidity_ast.event_definition;
}
and fun_kind =
  1. | KOther
  2. | KNewContract
  3. | KExtContractFun
and function_options = {
  1. kind : fun_kind;
  2. value : bool;
  3. gas : bool;
  4. salt : bool;
}
and location =
  1. | LMemory
  2. | LStorage of bool
  3. | LCalldata
and type_ =
  1. | TBool
  2. | TInt of int
  3. | TUint of int
  4. | TFixed of int * int
  5. | TUfixed of int * int
  6. | TAddress of bool
  7. | TFixBytes of int
  8. | TBytes of location
  9. | TString of location
  10. | TEnum of Solidity_common.absolute Solidity_common.LongIdent.t * enum_desc
  11. | TStruct of Solidity_common.absolute Solidity_common.LongIdent.t * struct_desc * location
  12. | TContract of Solidity_common.absolute Solidity_common.LongIdent.t * contract_desc * bool
  13. | TArray of type_ * Z.t option * location
  14. | TMapping of type_ * type_ * location
  15. | TFunction of function_desc * function_options
  16. | TModifier of modifier_desc
  17. | TEvent of event_desc
  18. | TTuple of type_ option list
  19. | TArraySlice of type_ * location
  20. | TType of type_
  21. | TMagic of magic_type
  22. | TModule of Solidity_common.absolute Solidity_common.LongIdent.t * module_desc
  23. | TRationalConst of Q.t * int option
  24. | TLiteralString of string
and magic_type =
  1. | TMetaType of type_
  2. | TBlock
  3. | TMsg
  4. | TTx
  5. | TAbi
type Solidity_common.annot +=
  1. | AType of type_
type Solidity_common.annot +=
  1. | ATypeId of type_desc
type Solidity_common.annot +=
  1. | AContract of contract_desc
type Solidity_common.annot +=
  1. | AVariable of variable_desc * bool
type Solidity_common.annot +=
  1. | AFunction of function_desc * bool
type Solidity_common.annot +=
  1. | AModifier of modifier_desc
type Solidity_common.annot +=
  1. | AEvent of event_desc
type Solidity_common.annot +=
  1. | AField of field_desc
type Solidity_common.annot +=
  1. | AConstr of constr_desc
type Solidity_common.annot +=
  1. | AModule of module_desc
type Solidity_common.annot +=
  1. | APrimitive
type args =
  1. | AList of type_ list
  2. | ANamed of (Solidity_common.Ident.t * type_) list
type options = {
  1. allow_empty : bool;
  2. call_args : args option;
  3. fun_returns : type_ list;
  4. in_loop : bool;
  5. in_function : bool;
  6. in_modifier : bool;
  7. current_hierarchy : Solidity_common.absolute Solidity_common.LongIdent.t list;
  8. current_contract : contract_desc option;
}