Skip to main content

Module protected_vars

Module protected_vars 

Source
Expand description

Slither-compatible protected-variable control-flow analysis.

Storage references are tracked as may-alias sets across internal calls and control-flow joins. Calls are memoized by their storage, slot, and guard context so recursive propagation terminates.

Re-exportsยง

use super::ProtectedVars; ๐Ÿ”’
use crate::linter::LateLintPass; ๐Ÿ”’
use crate::linter::LintContext; ๐Ÿ”’
use crate::sol::Severity; ๐Ÿ”’
use crate::sol::SolLint; ๐Ÿ”’
use crate::sol::analysis::branch_always_exits; ๐Ÿ”’
use crate::sol::analysis::is_builtin; ๐Ÿ”’
use crate::sol::analysis::is_loop_termination_if; ๐Ÿ”’
use crate::sol::analysis::lhs_local_var; ๐Ÿ”’
use crate::sol::analysis::loop_update; ๐Ÿ”’
use crate::sol::analysis::runtime_entry_points; ๐Ÿ”’
use solar::ast::BinOpKind; ๐Ÿ”’
use solar::ast::ContractKind; ๐Ÿ”’
use solar::ast::DataLocation; ๐Ÿ”’
use solar::ast::FunctionKind; ๐Ÿ”’
use solar::interface::sym; ๐Ÿ”’
use solar::sema::Gcx; ๐Ÿ”’
use solar::sema::builtins::Builtin; ๐Ÿ”’
use solar::sema::hir; ๐Ÿ”’
use solar::sema::hir::CallArgs; ๐Ÿ”’
use solar::sema::hir::ContractId; ๐Ÿ”’
use solar::sema::hir::ExprId; ๐Ÿ”’
use solar::sema::hir::ExprKind; ๐Ÿ”’
use solar::sema::hir::FunctionId; ๐Ÿ”’
use solar::sema::hir::ItemId; ๐Ÿ”’
use solar::sema::hir::LoopSource; ๐Ÿ”’
use solar::sema::hir::NatSpecKind; ๐Ÿ”’
use solar::sema::hir::Res; ๐Ÿ”’
use solar::sema::hir::StmtKind; ๐Ÿ”’
use solar::sema::hir::VariableId; ๐Ÿ”’
use solar::sema::ty::CallableParamSource; ๐Ÿ”’
use solar::sema::ty::Ty; ๐Ÿ”’
use solar::sema::ty::TyAbiPrinter; ๐Ÿ”’
use solar::sema::ty::TyAbiPrinterMode; ๐Ÿ”’
use solar::sema::ty::TyKind; ๐Ÿ”’
use std::collections::HashMap; ๐Ÿ”’
use std::collections::HashSet; ๐Ÿ”’

Structsยง

AliasState ๐Ÿ”’
CallContext ๐Ÿ”’
A finite call-graph key that distinguishes storage aliases without depending on values.
CallSummary ๐Ÿ”’
EntryAnalyzer ๐Ÿ”’
FlowState ๐Ÿ”’
LoopFlow ๐Ÿ”’
States collected at break/continue statements of the innermost loop.
ModifierContinuation ๐Ÿ”’
What _ resumes: the rest of the modifier chain and the function body.

Staticsยง

PROTECTED_VARS

Functionsยง

analyze_entry ๐Ÿ”’
Runs the entry to a fixpoint over the memoized call summaries and returns, per written state variable, the guards that held on every path to some write.
callable_signature ๐Ÿ”’
is_most_derived_contract ๐Ÿ”’
Slither analyzes the effective entry points of leaf contracts so inherited declarations are interpreted in the context in which they are ultimately deployed.
is_static_internal_base ๐Ÿ”’
super.f, Base.f or Lib.f: a statically dispatched internal call.
join ๐Ÿ”’
Joins state into the accumulated state of the paths that reach a point.
protected_variables ๐Ÿ”’
Protected state variables with their @custom:security write-protection="<sig>" requirements; None marks a malformed annotation.
protection_targets ๐Ÿ”’
Guard functions and modifiers by Slither signature. Functions take precedence over modifiers; within a kind, linearization order keeps the most-derived declaration and drops shadowed ones.
slither_function_parameter ๐Ÿ”’
Formats the Solidity-signature types used by Slither function lookup.
source_type_signature ๐Ÿ”’
Formats the source-level types used by Slither modifier signatures.
write_protection_token ๐Ÿ”’
Byte offset of a standalone write-protection token in content.

Type Aliasesยง

RootMap ๐Ÿ”’
StorageRoots ๐Ÿ”’