Module Solidity_postcheck_utils

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) -> 'a -> 'b list -> 'b list
val list_compare : ('a -> 'a -> int) -> 'a list -> 'a list -> int
val list_equal : ('a -> 'a -> int) -> 'a list -> 'a list -> bool
val the : 'a option -> 'a
val identmap_add_list_unique : ('a -> 'a -> bool) -> Solidity_common.IdentMap.key -> ('a * 'b) -> ('a * 'b) list Solidity_common.IdentMap.t -> ('a * 'b) list Solidity_common.IdentMap.t
val equal_opt : ('a -> 'b -> bool) -> 'a option -> 'b option -> bool
val list_assoc_opt : ('a -> 'b -> bool) -> 'b -> ('a * 'c) list -> 'c option
val list_mem : ('a -> 'b -> bool) -> 'b -> 'a list -> bool
val identmap_list_partition : (Solidity_common.IdentMap.key -> 'a -> bool) -> 'a list Solidity_common.IdentMap.t -> 'a list Solidity_common.IdentMap.t * 'a 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 * 'a) option
val getInEnv : ?in_inherited:bool -> (contract_env -> 'a option) -> contract_env -> ('a * 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 : Stdlib.Format.formatter -> 'a list -> unit
val pp_ident_map : (Stdlib.Format.formatter -> 'a -> unit) -> Stdlib.Format.formatter -> 'a Solidity_common.IdentMap.t -> unit
val pp_ident_set : Stdlib.Format.formatter -> Solidity_common.IdentSet.t -> unit
val pp_longident_map : (Stdlib.Format.formatter -> 'a -> unit) -> Stdlib.Format.formatter -> 'a Solidity_common.AbsLongIdentMap.t -> unit
val pp_expr_details : Stdlib.Format.formatter -> expr_details -> unit
val pp_global_def : Stdlib.Format.formatter -> global_def -> unit
val pp_mutab : Stdlib.Format.formatter -> Solidity_ast.var_mutability -> unit
val pp_global_details : Stdlib.Format.formatter -> global_details -> unit
val pp_fun_details : Stdlib.Format.formatter -> function_details -> unit
val pp_list : ('a -> 'b -> unit) -> 'a -> 'b list -> unit
val pp_opt : ('a -> 'b -> unit) -> 'a -> 'b option -> unit
val pp_ident : Stdlib.Format.formatter -> Solidity_common.Ident.t -> unit
val pp_fun_params : Stdlib.Format.formatter -> (Solidity_checker_TYPES.type_ * Solidity_common.Ident.t option) list -> unit
val pp_pair : (Stdlib.Format.formatter -> 'a -> unit) -> (Stdlib.Format.formatter -> 'b -> unit) -> Stdlib.Format.formatter -> ('a * 'b) -> unit
val pp_env : Stdlib.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 -> 'b
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