Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detector: Tautology or contradiction #623

Merged
merged 4 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
452 changes: 240 additions & 212 deletions Cargo.lock

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions aderyn_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ license = "MIT"
crossbeam-channel = "0.5.9"
eyre = "0.6.12"
ignore = "0.4.21"
phf = {version = "0.11.2", features = ["macros"]}
phf = { version = "0.11.2", features = ["macros"] }
prettytable = "0.10.0"
rayon = "1.8.0"
semver = "1.0.20"
Expand All @@ -22,7 +22,11 @@ serde-sarif = "0.4.2"
serde_repr = "0.1.12"
strum = { version = "0.26", features = ["derive"] }
toml = "0.8.2"
cyfrin-foundry-compilers = { version = "0.3.20-aderyn", features = ["svm-solc"] }
cyfrin-foundry-compilers = { version = "0.3.20-aderyn", features = [
"svm-solc",
] }
num-bigint = "0.4"
num-traits = "0.2"
lazy-regex = "3.2.0"
derive_more = "0.99.18"

Expand Down
5 changes: 5 additions & 0 deletions aderyn_core/src/detect/detector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ pub fn get_all_issue_detectors() -> Vec<Box<dyn IssueDetector>> {
Box::<RTLODetector>::default(),
Box::<UncheckedReturnDetector>::default(),
Box::<DangerousUnaryOperatorDetector>::default(),
Box::<TautologyOrContraditionDetector>::default(),
Box::<DangerousStrictEqualityOnBalanceDetector>::default(),
Box::<StorageSignedIntegerArrayDetector>::default(),
Box::<RedundantStatementsDetector>::default(),
Expand Down Expand Up @@ -135,6 +136,7 @@ pub(crate) enum IssueDetectorNamePool {
RTLO,
UncheckedReturn,
DangerousUnaryOperator,
TautologyOrContradiction,
DangerousStrictEquailtyOnContractBalance,
SignedStorageArray,
RedundantStatements,
Expand Down Expand Up @@ -278,6 +280,9 @@ pub fn request_issue_detector_by_name(detector_name: &str) -> Option<Box<dyn Iss
IssueDetectorNamePool::DangerousUnaryOperator => {
Some(Box::<DangerousUnaryOperatorDetector>::default())
}
IssueDetectorNamePool::TautologyOrContradiction => {
Some(Box::<TautologyOrContraditionDetector>::default())
}
IssueDetectorNamePool::DangerousStrictEquailtyOnContractBalance => {
Some(Box::<DangerousStrictEqualityOnBalanceDetector>::default())
}
Expand Down
2 changes: 2 additions & 0 deletions aderyn_core/src/detect/high/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pub(crate) mod state_variable_shadowing;
pub(crate) mod storage_array_edit_with_memory;
pub(crate) mod storage_signed_integer_array;
pub(crate) mod tautological_compare;
pub(crate) mod tautology_or_contradiction;
pub(crate) mod unchecked_return;
pub(crate) mod unchecked_send;
pub(crate) mod uninitialized_state_variable;
Expand Down Expand Up @@ -56,6 +57,7 @@ pub use state_variable_shadowing::StateVariableShadowingDetector;
pub use storage_array_edit_with_memory::StorageArrayEditWithMemoryDetector;
pub use storage_signed_integer_array::StorageSignedIntegerArrayDetector;
pub use tautological_compare::TautologicalCompareDetector;
pub use tautology_or_contradiction::TautologyOrContraditionDetector;
pub use unchecked_return::UncheckedReturnDetector;
pub use unchecked_send::UncheckedSendDetector;
pub use uninitialized_state_variable::UninitializedStateVariableDetector;
Expand Down
Loading
Loading