package solidity-typechecker

  1. Overview
  2. Docs

1 Type definitions

type fun_params = (Solidity_checker_TYPES.type_ * Solidity_common.Ident.t option) list
type expr_details = {
  1. ed_read : ast_annot list Solidity_common.IdentMap.t;
  2. ed_writ : ast_annot list Solidity_common.IdentMap.t;
  3. ed_fun_calls : (fun_params * ast_annot) list Solidity_common.IdentMap.t;
  4. ed_deep_writ : ast_annot list Solidity_common.IdentMap.t;
  5. ed_read_access : Solidity_common.pos list;
  6. ed_writ_state : Solidity_common.pos list;
}
type global_def =
  1. | GDeclared
  2. | GDefined of expr_details * Solidity_ast.expression
type local_def =
  1. | LDeclared
  2. | LParam
  3. | LDefined of Solidity_ast.expression
type local_details = {
  1. loc_def : local_def;
  2. loc_mem : Solidity_ast.storage_location option;
}
type global_details = {
  1. gd_def : global_def;
  2. gd_mutab : Solidity_ast.var_mutability;
  3. mutable gd_updates : ast_annot list;
}
type modifier_details =
  1. | Constructor of ast_annot
  2. | Modifier of ast_annot
type function_details = {
  1. fd_details : expr_details;
  2. fd_kind : fun_kind;
  3. fd_purity : Solidity_ast.fun_mutability;
  4. fd_defined : bool;
  5. fd_modifiers : (fun_params * modifier_details) list Solidity_common.AbsLongIdentMap.t;
}
type fun_identity = {
  1. fi_name : Solidity_common.Ident.t;
  2. fi_params : fun_params;
}

2. Exceptions raised by the postprocessor

val failOnAnnot : Solidity_common.annot -> 'a

3 Miscellaneous

val removeListPrefix : ('a -> 'b -> bool) -> 'c -> 'd list -> 'd list
val list_compare : ('a -> 'a -> int) -> 'b list -> 'a list -> int
val list_equal : ('a -> 'a -> int) -> 'a list -> 'a list -> bool
val the : 'a option -> 'b
val identmap_add_list_unique : ('a -> 'b -> bool) -> Solidity_common.IdentMap.key -> ('c * 'd) -> ('c * 'd) list Solidity_common.IdentMap.t -> ('c * 'd) list Solidity_common.IdentMap.t
val equal_opt : ('a -> 'b -> bool) -> 'c option -> 'd option -> bool
val list_assoc_opt : ('a -> 'b -> bool) -> 'c -> ('d * 'e) list -> 'e option
val list_mem : ('a -> 'b -> bool) -> 'c -> 'd list -> bool
val identmap_list_partition : (Solidity_common.IdentMap.key -> 'a -> bool) -> 'a list Solidity_common.IdentMap.t -> 'b list Solidity_common.IdentMap.t * 'c list Solidity_common.IdentMap.t

3.5 Utils on previously defined types

val empty_expr_details : expr_details
val empty_project_env : env
val equalParams : check_ident:bool -> fun_params -> fun_params -> bool
val equalSortedParams : fun_params -> fun_params -> bool
val getInInherited : (contract_env -> 'a option) -> contract_env -> (Solidity_common.absolute Solidity_common.LongIdent.t * 'b) option
val getInEnv : ?in_inherited:bool -> (contract_env -> 'a option) -> contract_env -> ('b * Solidity_common.absolute Solidity_common.LongIdent.t option) option
val getFun : ?in_inherited:bool -> fun_identity -> contract_env -> ((fun_params * function_details) * Solidity_common.absolute Solidity_common.LongIdent.t option) option
val paramsFromExprs : Solidity_ast.expression list -> (Solidity_checker_TYPES.type_ * 'a option) list
val iterBySelector : (Solidity_common.absolute Solidity_common.LongIdent.t option -> Solidity_ast.function_definition -> unit) -> string -> contract_env -> unit
val getVisibility : fun_kind -> Solidity_ast.visibility
val is_constructor : Solidity_ast.function_definition -> bool
val pp_annot_list : Format.formatter -> 'a list -> unit
val pp_ident_map : (Format.formatter -> 'a -> unit) -> Format.formatter -> 'b Solidity_common.IdentMap.t -> unit
val pp_ident_set : Format.formatter -> Solidity_common.IdentSet.t -> unit
val pp_longident_map : (Format.formatter -> 'a -> unit) -> Format.formatter -> 'b Solidity_common.AbsLongIdentMap.t -> unit
val pp_expr_details : Format.formatter -> expr_details -> unit
val pp_global_def : Format.formatter -> global_def -> unit
val pp_global_details : Format.formatter -> global_details -> unit
val pp_fun_details : Format.formatter -> function_details -> unit
val pp_list : ('a -> 'b -> unit) -> 'c -> 'b list -> unit
val pp_opt : ('a -> 'b -> unit) -> 'c -> 'd option -> unit
val pp_ident : Format.formatter -> Solidity_common.Ident.t -> unit
val pp_fun_params : Format.formatter -> (Solidity_checker_TYPES.type_ * Solidity_common.Ident.t option) list -> unit
val pp_pair : (Format.formatter -> 'a -> unit) -> (Format.formatter -> 'b -> unit) -> Format.formatter -> ('c * 'd) -> unit
val pp_env : Format.formatter -> contract_env -> unit
val unionAssignDetails : expr_details -> expr_details -> expr_details
val removeFromAssignDetails : 'a Solidity_common.IdentMap.t -> expr_details -> expr_details
val getPos : ('a * 'b) list -> 'c
val isVirtual : function_details -> contract_env -> bool
val isConstructor : function_details -> bool
val purityToString : Solidity_ast.fun_mutability -> string

4. Analysers

val getExpressionDetails : Solidity_ast.expression -> expr_details
OCaml

Innovation. Community. Security.