Skip to content

Commit

Permalink
Shorten names (Start of 0.3.2) (#759)
Browse files Browse the repository at this point in the history
  • Loading branch information
TilakMaddy authored Oct 10, 2024
1 parent 0279da5 commit 6db64b2
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 27 deletions.
18 changes: 8 additions & 10 deletions aderyn_core/src/detect/detector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ pub fn get_all_detectors_names() -> Vec<String> {
#[derive(Debug, PartialEq, EnumString, Display)]
#[strum(serialize_all = "kebab-case")]
pub(crate) enum IssueDetectorNamePool {
StateVariableCouldBeDeclaredImmutable,
StateVariableCouldBeImmutable,
MultiplePlaceholders,
StateVariableChangesWithoutEvents,
MissingInheritance,
Expand All @@ -135,7 +135,7 @@ pub(crate) enum IssueDetectorNamePool {
CentralizationRisk,
SolmateSafeTransferLib,
HashCollisionDueToAbiEncodePacked,
SignatureMalleabilityDueToRawEcrecover,
RawEcrecover,
DeprecatedOzFunctions,
UnsafeERC20Functions,
UnspecificSolidityPragma,
Expand Down Expand Up @@ -183,7 +183,7 @@ pub(crate) enum IssueDetectorNamePool {
UncheckedReturn,
DangerousUnaryOperator,
TautologyOrContradiction,
DangerousStrictEquailtyOnContractBalance,
StrictEquailtyCheckOnContractBalance,
SignedStorageArray,
RedundantStatements,
PublicVariableReadInExternalContext,
Expand All @@ -201,7 +201,7 @@ pub(crate) enum IssueDetectorNamePool {
UninitializedLocalVariable,
ReturnBomb,
OutOfOrderRetryable,
StateVariableCouldBeDeclaredConstant,
StateVariableCouldBeConstant,
// NOTE: `Undecided` will be the default name (for new bots).
// If it's accepted, a new variant will be added to this enum before normalizing it in aderyn
Undecided,
Expand All @@ -211,7 +211,7 @@ pub fn request_issue_detector_by_name(detector_name: &str) -> Option<Box<dyn Iss
// Expects a valid detector_name
let detector_name = IssueDetectorNamePool::from_str(detector_name).ok()?;
match detector_name {
IssueDetectorNamePool::StateVariableCouldBeDeclaredImmutable => {
IssueDetectorNamePool::StateVariableCouldBeImmutable => {
Some(Box::<StateVariableCouldBeImmutableDetector>::default())
}
IssueDetectorNamePool::MultiplePlaceholders => {
Expand All @@ -228,7 +228,7 @@ pub fn request_issue_detector_by_name(detector_name: &str) -> Option<Box<dyn Iss
}
IssueDetectorNamePool::UnusedImport => Some(Box::<UnusedImportDetector>::default()),
IssueDetectorNamePool::VoidConstructor => Some(Box::<VoidConstructorDetector>::default()),
IssueDetectorNamePool::StateVariableCouldBeDeclaredConstant => {
IssueDetectorNamePool::StateVariableCouldBeConstant => {
Some(Box::<StateVariableCouldBeConstantDetector>::default())
}
IssueDetectorNamePool::LiteralInsteadOfConstant => {
Expand Down Expand Up @@ -287,9 +287,7 @@ pub fn request_issue_detector_by_name(detector_name: &str) -> Option<Box<dyn Iss
IssueDetectorNamePool::HashCollisionDueToAbiEncodePacked => {
Some(Box::<AvoidAbiEncodePackedDetector>::default())
}
IssueDetectorNamePool::SignatureMalleabilityDueToRawEcrecover => {
Some(Box::<EcrecoverDetector>::default())
}
IssueDetectorNamePool::RawEcrecover => Some(Box::<EcrecoverDetector>::default()),
IssueDetectorNamePool::DeprecatedOzFunctions => {
Some(Box::<DeprecatedOZFunctionsDetector>::default())
}
Expand Down Expand Up @@ -406,7 +404,7 @@ pub fn request_issue_detector_by_name(detector_name: &str) -> Option<Box<dyn Iss
IssueDetectorNamePool::TautologyOrContradiction => {
Some(Box::<TautologyOrContraditionDetector>::default())
}
IssueDetectorNamePool::DangerousStrictEquailtyOnContractBalance => {
IssueDetectorNamePool::StrictEquailtyCheckOnContractBalance => {
Some(Box::<DangerousStrictEqualityOnBalanceDetector>::default())
}
IssueDetectorNamePool::SignedStorageArray => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl IssueDetector for DangerousStrictEqualityOnBalanceDetector {
}

fn name(&self) -> String {
IssueDetectorNamePool::DangerousStrictEquailtyOnContractBalance.to_string()
IssueDetectorNamePool::StrictEquailtyCheckOnContractBalance.to_string()
}
}

Expand Down
2 changes: 1 addition & 1 deletion aderyn_core/src/detect/low/ecrecover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl IssueDetector for EcrecoverDetector {
}

fn name(&self) -> String {
format!("{}", IssueDetectorNamePool::SignatureMalleabilityDueToRawEcrecover)
format!("{}", IssueDetectorNamePool::RawEcrecover)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ impl IssueDetector for StateVariableCouldBeConstantDetector {
}

fn name(&self) -> String {
format!("{}", IssueDetectorNamePool::StateVariableCouldBeDeclaredConstant)
format!("{}", IssueDetectorNamePool::StateVariableCouldBeConstant)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ impl IssueDetector for StateVariableCouldBeImmutableDetector {
}

fn name(&self) -> String {
format!("{}", IssueDetectorNamePool::StateVariableCouldBeDeclaredImmutable)
format!("{}", IssueDetectorNamePool::StateVariableCouldBeImmutable)
}
}

Expand Down
2 changes: 1 addition & 1 deletion reports/adhoc-sol-files-highs-only-report.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions reports/report.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions reports/report.sarif

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6db64b2

Please sign in to comment.