forge_lint/sol/gas/
mod.rs1use crate::sol::{EarlyLintPass, LateLintPass, SolLint};
2
3mod cache_array_length;
4mod costly_loop;
5mod custom_errors;
6mod external_function;
7mod immutable;
8mod keccak;
9mod unused_state_variables;
10mod var_read_using_this;
11use cache_array_length::CACHE_ARRAY_LENGTH;
12use costly_loop::COSTLY_LOOP;
13use custom_errors::CUSTOM_ERRORS;
14use external_function::EXTERNAL_FUNCTION;
15use immutable::{COULD_BE_CONSTANT, COULD_BE_IMMUTABLE};
16use keccak::ASM_KECCAK256;
17use unused_state_variables::UNUSED_STATE_VARIABLES;
18use var_read_using_this::VAR_READ_USING_THIS;
19
20register_lints!(
21 (AsmKeccak256, late, (ASM_KECCAK256)),
22 (CacheArrayLength, late, (CACHE_ARRAY_LENGTH)),
23 (CostlyLoop, late, (COSTLY_LOOP)),
24 (CustomErrors, early, (CUSTOM_ERRORS)),
25 (UnchangedStateVariables, late, (COULD_BE_IMMUTABLE, COULD_BE_CONSTANT)),
26 (ExternalFunction, late, (EXTERNAL_FUNCTION)),
27 (UnusedStateVariables, late, (UNUSED_STATE_VARIABLES)),
28 (VarReadUsingThis, late, (VAR_READ_USING_THIS)),
29);