Trait LateLintPass
pub trait LateLintPass<'gcx>: Send + Sync {
Show 14 methods
// Provided methods
fn check_nested_source(
&mut self,
_ctx: &LintContext<'_, '_>,
_gcx: Gcx<'gcx>,
_id: SourceId,
) { ... }
fn check_nested_item(
&mut self,
_ctx: &LintContext<'_, '_>,
_gcx: Gcx<'gcx>,
_id: ItemId,
) { ... }
fn check_nested_contract(
&mut self,
_ctx: &LintContext<'_, '_>,
_gcx: Gcx<'gcx>,
_id: ContractId,
) { ... }
fn check_nested_function(
&mut self,
_ctx: &LintContext<'_, '_>,
_gcx: Gcx<'gcx>,
_id: FunctionId,
) { ... }
fn check_nested_var(
&mut self,
_ctx: &LintContext<'_, '_>,
_gcx: Gcx<'gcx>,
_id: VariableId,
) { ... }
fn check_item(
&mut self,
_ctx: &LintContext<'_, '_>,
_gcx: Gcx<'gcx>,
_item: Item<'gcx, 'gcx>,
) { ... }
fn check_contract(
&mut self,
_ctx: &LintContext<'_, '_>,
_gcx: Gcx<'gcx>,
_contract: &'gcx Contract<'gcx>,
) { ... }
fn check_function(
&mut self,
_ctx: &LintContext<'_, '_>,
_gcx: Gcx<'gcx>,
_function: &'gcx Function<'gcx>,
) { ... }
fn check_modifier(
&mut self,
_ctx: &LintContext<'_, '_>,
_gcx: Gcx<'gcx>,
_modifier: &'gcx Modifier<'gcx>,
) { ... }
fn check_var(
&mut self,
_ctx: &LintContext<'_, '_>,
_gcx: Gcx<'gcx>,
_var: &'gcx Variable<'gcx>,
) { ... }
fn check_expr(
&mut self,
_ctx: &LintContext<'_, '_>,
_gcx: Gcx<'gcx>,
_expr: &'gcx Expr<'gcx>,
) { ... }
fn check_call_args(
&mut self,
_ctx: &LintContext<'_, '_>,
_gcx: Gcx<'gcx>,
_args: &'gcx CallArgs<'gcx>,
) { ... }
fn check_stmt(
&mut self,
_ctx: &LintContext<'_, '_>,
_gcx: Gcx<'gcx>,
_stmt: &'gcx Stmt<'gcx>,
) { ... }
fn check_ty(
&mut self,
_ctx: &LintContext<'_, '_>,
_gcx: Gcx<'gcx>,
_ty: &'gcx Type<'gcx>,
) { ... }
}Expand description
A lint pass that runs on Solar’s analyzed HIR.
Every hook receives the global context; the HIR is available as gcx.hir.
Provided Methods§
fn check_nested_source( &mut self, _ctx: &LintContext<'_, '_>, _gcx: Gcx<'gcx>, _id: SourceId, )
fn check_nested_item( &mut self, _ctx: &LintContext<'_, '_>, _gcx: Gcx<'gcx>, _id: ItemId, )
fn check_nested_contract( &mut self, _ctx: &LintContext<'_, '_>, _gcx: Gcx<'gcx>, _id: ContractId, )
fn check_nested_function( &mut self, _ctx: &LintContext<'_, '_>, _gcx: Gcx<'gcx>, _id: FunctionId, )
fn check_nested_var( &mut self, _ctx: &LintContext<'_, '_>, _gcx: Gcx<'gcx>, _id: VariableId, )
fn check_item( &mut self, _ctx: &LintContext<'_, '_>, _gcx: Gcx<'gcx>, _item: Item<'gcx, 'gcx>, )
fn check_contract( &mut self, _ctx: &LintContext<'_, '_>, _gcx: Gcx<'gcx>, _contract: &'gcx Contract<'gcx>, )
fn check_function( &mut self, _ctx: &LintContext<'_, '_>, _gcx: Gcx<'gcx>, _function: &'gcx Function<'gcx>, )
fn check_modifier( &mut self, _ctx: &LintContext<'_, '_>, _gcx: Gcx<'gcx>, _modifier: &'gcx Modifier<'gcx>, )
fn check_var( &mut self, _ctx: &LintContext<'_, '_>, _gcx: Gcx<'gcx>, _var: &'gcx Variable<'gcx>, )
fn check_expr( &mut self, _ctx: &LintContext<'_, '_>, _gcx: Gcx<'gcx>, _expr: &'gcx Expr<'gcx>, )
fn check_call_args( &mut self, _ctx: &LintContext<'_, '_>, _gcx: Gcx<'gcx>, _args: &'gcx CallArgs<'gcx>, )
fn check_stmt( &mut self, _ctx: &LintContext<'_, '_>, _gcx: Gcx<'gcx>, _stmt: &'gcx Stmt<'gcx>, )
fn check_ty( &mut self, _ctx: &LintContext<'_, '_>, _gcx: Gcx<'gcx>, _ty: &'gcx Type<'gcx>, )
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl<'gcx> LateLintPass<'gcx> for ArbitrarySendErc20
impl<'gcx> LateLintPass<'gcx> for ArbitrarySendEth
impl<'gcx> LateLintPass<'gcx> for AsmKeccak256
impl<'gcx> LateLintPass<'gcx> for AssertStateChange
impl<'gcx> LateLintPass<'gcx> for BlockTimestamp
impl<'gcx> LateLintPass<'gcx> for CacheArrayLength
impl<'gcx> LateLintPass<'gcx> for CallsLoop
impl<'gcx> LateLintPass<'gcx> for ControlledDelegatecall
impl<'gcx> LateLintPass<'gcx> for CostlyLoop
impl<'gcx> LateLintPass<'gcx> for CyclomaticComplexity
impl<'gcx> LateLintPass<'gcx> for DelegatecallLoop
impl<'gcx> LateLintPass<'gcx> for DeprecatedOzFunction
impl<'gcx> LateLintPass<'gcx> for DivideBeforeMultiply
impl<'gcx> LateLintPass<'gcx> for Ecrecover
impl<'gcx> LateLintPass<'gcx> for EncodedPackedCollision
impl<'gcx> LateLintPass<'gcx> for EnumerableLoopRemoval
impl<'gcx> LateLintPass<'gcx> for ExternalFunction
impl<'gcx> LateLintPass<'gcx> for FunctionInitState
impl<'gcx> LateLintPass<'gcx> for FunctionSelectorCollision
impl<'gcx> LateLintPass<'gcx> for IncorrectERC20Interface
impl<'gcx> LateLintPass<'gcx> for IncorrectERC721Interface
impl<'gcx> LateLintPass<'gcx> for IncorrectExp
impl<'gcx> LateLintPass<'gcx> for IncorrectModifier
impl<'gcx> LateLintPass<'gcx> for IncorrectStrictEquality
impl<'gcx> LateLintPass<'gcx> for IncorrectUsingFor
impl<'gcx> LateLintPass<'gcx> for LiteralInsteadOfConstant
impl<'gcx> LateLintPass<'gcx> for LockedEther
impl<'gcx> LateLintPass<'gcx> for MappingDeletion
impl<'gcx> LateLintPass<'gcx> for MissingEventsAccessControl
impl<'gcx> LateLintPass<'gcx> for MissingEventsArithmetic
impl<'gcx> LateLintPass<'gcx> for MissingZeroCheck
impl<'gcx> LateLintPass<'gcx> for MsgValueLoop
impl<'gcx> LateLintPass<'gcx> for NamedStructFields
impl<'gcx> LateLintPass<'gcx> for NonReentrantNotFirst
impl<'gcx> LateLintPass<'gcx> for ProtectedVars
impl<'gcx> LateLintPass<'gcx> for RedundantBaseConstructorCall
impl<'gcx> LateLintPass<'gcx> for ReentrancyEth
impl<'gcx> LateLintPass<'gcx> for ReentrancyEvents
impl<'gcx> LateLintPass<'gcx> for RequireRevertInLoop
impl<'gcx> LateLintPass<'gcx> for ReturnBomb
impl<'gcx> LateLintPass<'gcx> for SolmateSafeTransferLib
impl<'gcx> LateLintPass<'gcx> for TautologicalCompare
impl<'gcx> LateLintPass<'gcx> for TypeBasedTautology
impl<'gcx> LateLintPass<'gcx> for UnchangedStateVariables
impl<'gcx> LateLintPass<'gcx> for UncheckedTransferERC20
Checks that calls to functions with the same signature as the ERC20 transfer methods, and which return a boolean, are not ignored.
WARN: can issue false positives, as it doesn’t check that the contract being called sticks to the full ERC20 specification.