From 64c77b5e952b7af21ff1206fe38d63480b83e1ae Mon Sep 17 00:00:00 2001 From: Facundo Lerena Date: Wed, 6 Dec 2023 10:34:56 -0300 Subject: [PATCH 1/7] changed core-mem-forget to avoid-.. --- .github/workflows/test-detectors.yml | 2 +- .../Cargo.toml | 0 .../src/lib.rs | 16 ++++++++-------- scout-audit-internal/src/detector.rs | 2 +- .../src/detector/lint_message.rs | 2 +- .../remediated-example/Cargo.toml | 0 .../remediated-example/src/lib.rs | 6 +++--- .../vulnerable-example/Cargo.toml | 0 .../vulnerable-example/src/lib.rs | 6 +++--- 9 files changed, 17 insertions(+), 17 deletions(-) rename detectors/{core-mem-forget => avoid-core-mem-forget}/Cargo.toml (100%) rename detectors/{core-mem-forget => avoid-core-mem-forget}/src/lib.rs (89%) rename test-cases/{core-mem-forget/core-mem-forget-1 => avoid-core-mem-forget/avoid-core-mem-forget-1}/remediated-example/Cargo.toml (100%) rename test-cases/{core-mem-forget/core-mem-forget-1 => avoid-core-mem-forget/avoid-core-mem-forget-1}/remediated-example/src/lib.rs (79%) rename test-cases/{core-mem-forget/core-mem-forget-1 => avoid-core-mem-forget/avoid-core-mem-forget-1}/vulnerable-example/Cargo.toml (100%) rename test-cases/{core-mem-forget/core-mem-forget-1 => avoid-core-mem-forget/avoid-core-mem-forget-1}/vulnerable-example/src/lib.rs (79%) diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index 272548fb..e9ffaea1 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -97,7 +97,7 @@ jobs: - macos-latest test: [ - "core-mem-forget", + "avoid-avoid-avoid-core-mem-forget", "divide-before-multiply", "overflow-check", "unprotected-update-current-contract-wasm", diff --git a/detectors/core-mem-forget/Cargo.toml b/detectors/avoid-core-mem-forget/Cargo.toml similarity index 100% rename from detectors/core-mem-forget/Cargo.toml rename to detectors/avoid-core-mem-forget/Cargo.toml diff --git a/detectors/core-mem-forget/src/lib.rs b/detectors/avoid-core-mem-forget/src/lib.rs similarity index 89% rename from detectors/core-mem-forget/src/lib.rs rename to detectors/avoid-core-mem-forget/src/lib.rs index 18101039..fa421c5e 100644 --- a/detectors/core-mem-forget/src/lib.rs +++ b/detectors/avoid-core-mem-forget/src/lib.rs @@ -41,18 +41,18 @@ dylint_linting::impl_pre_expansion_lint! { /// } ///``` - pub CORE_MEM_FORGET, + pub AVOID_CORE_MEM_FORGET, Warn, - Detector::CoreMemForget.get_lint_message(), - CoreMemForget::default() + Detector::AvoidCoreMemForget.get_lint_message(), + AvoidCoreMemForget::default() } #[derive(Default)] -pub struct CoreMemForget { +pub struct AvoidCoreMemForget { stack: Vec, } -impl EarlyLintPass for CoreMemForget { +impl EarlyLintPass for AvoidCoreMemForget { fn check_item(&mut self, _cx: &EarlyContext, item: &Item) { if self.in_test_item() || is_test_item(item) { self.stack.push(item.id); @@ -70,9 +70,9 @@ impl EarlyLintPass for CoreMemForget { if path.segments[2].ident.name.to_string() == "forget"; then { - Detector::CoreMemForget.span_lint_and_help( + Detector::AvoidCoreMemForget.span_lint_and_help( cx, - CORE_MEM_FORGET, + AVOID_CORE_MEM_FORGET, expr.span, "Instead, use the `let _ = ...` pattern or `.drop` method to forget the value.", ); @@ -102,7 +102,7 @@ fn is_test_item(item: &Item) -> bool { }) } -impl CoreMemForget { +impl AvoidCoreMemForget { fn in_test_item(&self) -> bool { !self.stack.is_empty() } diff --git a/scout-audit-internal/src/detector.rs b/scout-audit-internal/src/detector.rs index 76325dd9..ec8be39d 100644 --- a/scout-audit-internal/src/detector.rs +++ b/scout-audit-internal/src/detector.rs @@ -38,7 +38,7 @@ impl Detector { /// Returns the lint message for the detector. pub const fn get_lint_message(&self) -> &'static str { match self { - Detector::CoreMemForget => CORE_MEM_FORGET_LINT_MESSAGE, + Detector::AvoidCoreMemForget => AVOID_CORE_MEM_FORGET_LINT_MESSAGE, Detector::DivideBeforeMultiply => DIVIDE_BEFORE_MULTIPLY_LINT_MESSAGE, Detector::UnsafeExpect => UNSAFE_EXPECT_LINT_MESSAGE, Detector::OverflowCheck => OVERFLOW_CHECK_LINT_MESSAGE, diff --git a/scout-audit-internal/src/detector/lint_message.rs b/scout-audit-internal/src/detector/lint_message.rs index 769ea146..37cfda56 100644 --- a/scout-audit-internal/src/detector/lint_message.rs +++ b/scout-audit-internal/src/detector/lint_message.rs @@ -1,4 +1,4 @@ -pub const CORE_MEM_FORGET_LINT_MESSAGE: &str = +pub const AVOID_CORE_MEM_FORGET_LINT_MESSAGE: &str = "Use the `let _ = ...` pattern or `.drop()` method to forget the value"; pub const DIVIDE_BEFORE_MULTIPLY_LINT_MESSAGE: &str = "Division before multiplication might result in a loss of precision"; diff --git a/test-cases/core-mem-forget/core-mem-forget-1/remediated-example/Cargo.toml b/test-cases/avoid-core-mem-forget/avoid-core-mem-forget-1/remediated-example/Cargo.toml similarity index 100% rename from test-cases/core-mem-forget/core-mem-forget-1/remediated-example/Cargo.toml rename to test-cases/avoid-core-mem-forget/avoid-core-mem-forget-1/remediated-example/Cargo.toml diff --git a/test-cases/core-mem-forget/core-mem-forget-1/remediated-example/src/lib.rs b/test-cases/avoid-core-mem-forget/avoid-core-mem-forget-1/remediated-example/src/lib.rs similarity index 79% rename from test-cases/core-mem-forget/core-mem-forget-1/remediated-example/src/lib.rs rename to test-cases/avoid-core-mem-forget/avoid-core-mem-forget-1/remediated-example/src/lib.rs index a9a18872..e6789bb7 100644 --- a/test-cases/core-mem-forget/core-mem-forget-1/remediated-example/src/lib.rs +++ b/test-cases/avoid-core-mem-forget/avoid-core-mem-forget-1/remediated-example/src/lib.rs @@ -2,7 +2,7 @@ use soroban_sdk::{contract, contractimpl, contracttype}; #[contract] -pub struct CoreMemForget; +pub struct AvoidCoreMemForget; #[contracttype] #[derive(Eq, PartialEq)] @@ -12,7 +12,7 @@ pub struct WithoutCopy { } #[contractimpl] -impl CoreMemForget { +impl AvoidCoreMemForget { pub fn forget_something(n: WithoutCopy) -> u64 { let _ = n; 0 @@ -27,7 +27,7 @@ mod tests { fn test_forget_something() { let test_value: WithoutCopy = WithoutCopy { a: 80, b: 60 }; - let result = CoreMemForget::forget_something(test_value); + let result = AvoidCoreMemForget::forget_something(test_value); assert_eq!(result, 0); } diff --git a/test-cases/core-mem-forget/core-mem-forget-1/vulnerable-example/Cargo.toml b/test-cases/avoid-core-mem-forget/avoid-core-mem-forget-1/vulnerable-example/Cargo.toml similarity index 100% rename from test-cases/core-mem-forget/core-mem-forget-1/vulnerable-example/Cargo.toml rename to test-cases/avoid-core-mem-forget/avoid-core-mem-forget-1/vulnerable-example/Cargo.toml diff --git a/test-cases/core-mem-forget/core-mem-forget-1/vulnerable-example/src/lib.rs b/test-cases/avoid-core-mem-forget/avoid-core-mem-forget-1/vulnerable-example/src/lib.rs similarity index 79% rename from test-cases/core-mem-forget/core-mem-forget-1/vulnerable-example/src/lib.rs rename to test-cases/avoid-core-mem-forget/avoid-core-mem-forget-1/vulnerable-example/src/lib.rs index 2b6409d7..9f8aa0df 100644 --- a/test-cases/core-mem-forget/core-mem-forget-1/vulnerable-example/src/lib.rs +++ b/test-cases/avoid-core-mem-forget/avoid-core-mem-forget-1/vulnerable-example/src/lib.rs @@ -2,7 +2,7 @@ use soroban_sdk::{contract, contractimpl, contracttype}; #[contract] -pub struct CoreMemForget; +pub struct AvoidCoreMemForget; #[contracttype] #[derive(Eq, PartialEq)] @@ -12,7 +12,7 @@ pub struct WithoutCopy { } #[contractimpl] -impl CoreMemForget { +impl AvoidCoreMemForget { pub fn forget_something(n: WithoutCopy) -> u64 { core::mem::forget(n); 0 @@ -27,7 +27,7 @@ mod tests { fn test_forget_something() { let test_value: WithoutCopy = WithoutCopy { a: 80, b: 60 }; - let result = CoreMemForget::forget_something(test_value); + let result = AvoidCoreMemForget::forget_something(test_value); assert_eq!(result, 0); } From ddf57e31fdd3f9f6c455646dcbd50c5b94656983 Mon Sep 17 00:00:00 2001 From: Facundo Lerena Date: Wed, 6 Dec 2023 11:06:19 -0300 Subject: [PATCH 2/7] Update test-detectors.yml --- .github/workflows/test-detectors.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index e9ffaea1..bed96882 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -97,7 +97,7 @@ jobs: - macos-latest test: [ - "avoid-avoid-avoid-core-mem-forget", + "avoid-core-mem-forget", "divide-before-multiply", "overflow-check", "unprotected-update-current-contract-wasm", From 4b10b5657924f188e6c9d06ae7ed8d351dc0de55 Mon Sep 17 00:00:00 2001 From: Facundo Lerena Date: Wed, 6 Dec 2023 11:10:39 -0300 Subject: [PATCH 3/7] forgot one name --- scout-audit-internal/src/detector.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scout-audit-internal/src/detector.rs b/scout-audit-internal/src/detector.rs index ece508e9..802af2e1 100644 --- a/scout-audit-internal/src/detector.rs +++ b/scout-audit-internal/src/detector.rs @@ -26,7 +26,7 @@ use strum::{Display, EnumIter}; #[derive(Debug, Display, Clone, EnumIter, PartialEq, Eq, Hash)] #[strum(serialize_all = "kebab-case")] pub enum Detector { - CoreMemForget, + AvoidCoreMemForget, DivideBeforeMultiply, InsufficientlyRandomValues, OverflowCheck, From b570602b82c941ac012074c1104482866482095b Mon Sep 17 00:00:00 2001 From: Facundo Lerena Date: Wed, 6 Dec 2023 11:12:38 -0300 Subject: [PATCH 4/7] removed old name --- detectors/core-mem-forget/Cargo.toml | 20 ---- detectors/core-mem-forget/src/lib.rs | 98 ------------------- .../remediated-example/Cargo.toml | 30 ------ .../remediated-example/src/lib.rs | 37 ------- .../vulnerable-example/Cargo.toml | 30 ------ .../vulnerable-example/src/lib.rs | 37 ------- 6 files changed, 252 deletions(-) delete mode 100644 detectors/core-mem-forget/Cargo.toml delete mode 100644 detectors/core-mem-forget/src/lib.rs delete mode 100644 test-cases/core-mem-forget/core-mem-forget-1/remediated-example/Cargo.toml delete mode 100644 test-cases/core-mem-forget/core-mem-forget-1/remediated-example/src/lib.rs delete mode 100644 test-cases/core-mem-forget/core-mem-forget-1/vulnerable-example/Cargo.toml delete mode 100644 test-cases/core-mem-forget/core-mem-forget-1/vulnerable-example/src/lib.rs diff --git a/detectors/core-mem-forget/Cargo.toml b/detectors/core-mem-forget/Cargo.toml deleted file mode 100644 index fc07fb1e..00000000 --- a/detectors/core-mem-forget/Cargo.toml +++ /dev/null @@ -1,20 +0,0 @@ -[package] -name = "core-mem-forget" -version = "0.1.0" -edition = "2021" - -[lib] -crate-type = ["cdylib"] - -[dependencies] -clippy_utils = { workspace = true } -dylint_linting = { workspace = true } -if_chain = { workspace = true } - -scout-audit-internal = { workspace = true } - -[dev-dependencies] -dylint_testing = { workspace = true } - -[package.metadata.rust-analyzer] -rustc_private = true diff --git a/detectors/core-mem-forget/src/lib.rs b/detectors/core-mem-forget/src/lib.rs deleted file mode 100644 index 8d2f9c30..00000000 --- a/detectors/core-mem-forget/src/lib.rs +++ /dev/null @@ -1,98 +0,0 @@ -#![feature(rustc_private)] - -extern crate rustc_ast; -extern crate rustc_hir; -extern crate rustc_span; - -use if_chain::if_chain; -use rustc_ast::{Expr, ExprKind, Item, NodeId}; -use rustc_lint::{EarlyContext, EarlyLintPass}; -use rustc_span::sym; -use scout_audit_internal::Detector; - -dylint_linting::impl_pre_expansion_lint! { - /// ### What it does - /// Checks for `core::mem::forget` usage. - /// ### Why is this bad? - /// This is a bad practice because it can lead to memory leaks, resource leaks and logic errors. - /// ### Example - /// ```rust - /// pub fn forget_something(n: WithoutCopy) -> u64 { - /// core::mem::forget(n); - /// 0 - /// } - /// ``` - /// - /// Use instead: - /// ```rust - /// pub fn forget_something(n: WithoutCopy) -> u64 { - /// let _ = n; - /// 0 - /// } - /// ``` - - pub CORE_MEM_FORGET, - Warn, - Detector::CoreMemForget.get_lint_message(), - CoreMemForget::default() -} - -#[derive(Default)] -pub struct CoreMemForget { - stack: Vec, -} - -impl EarlyLintPass for CoreMemForget { - fn check_item(&mut self, _cx: &EarlyContext, item: &Item) { - if self.in_test_item() || is_test_item(item) { - self.stack.push(item.id); - } - } - - fn check_expr(&mut self, cx: &EarlyContext, expr: &Expr) { - if_chain! { - if !self.in_test_item(); - if let ExprKind::Call(a, _) = &expr.kind; - if let ExprKind::Path(_, path) = &a.kind; - if path.segments.len() == 3; - if path.segments[0].ident.name.to_string() == "core"; - if path.segments[1].ident.name.to_string() == "mem"; - if path.segments[2].ident.name.to_string() == "forget"; - then { - Detector::CoreMemForget.span_lint_and_help( - cx, - CORE_MEM_FORGET, - expr.span, - "Instead, use the `let _ = ...` pattern or `.drop` method to forget the value.", - ); - } - } - } -} - -fn is_test_item(item: &Item) -> bool { - item.attrs.iter().any(|attr| { - if attr.has_name(sym::test) { - true - } else { - if_chain! { - if attr.has_name(sym::cfg); - if let Some(items) = attr.meta_item_list(); - if let [item] = items.as_slice(); - if let Some(feature_item) = item.meta_item(); - if feature_item.has_name(sym::test); - then { - true - } else { - false - } - } - } - }) -} - -impl CoreMemForget { - fn in_test_item(&self) -> bool { - !self.stack.is_empty() - } -} diff --git a/test-cases/core-mem-forget/core-mem-forget-1/remediated-example/Cargo.toml b/test-cases/core-mem-forget/core-mem-forget-1/remediated-example/Cargo.toml deleted file mode 100644 index 9d6db30e..00000000 --- a/test-cases/core-mem-forget/core-mem-forget-1/remediated-example/Cargo.toml +++ /dev/null @@ -1,30 +0,0 @@ -[package] -name = "core-mem-forget-1-remediated" -version = "0.1.0" -edition = "2021" - -[lib] -crate-type = ["cdylib"] - -[dependencies] -soroban-sdk = { version = "20.0.0-rc2" } - -[dev_dependencies] -soroban-sdk = { version = "20.0.0-rc2", features = ["testutils"] } - -[features] -testutils = ["soroban-sdk/testutils"] - -[profile.release] -opt-level = "z" -overflow-checks = true -debug = 0 -strip = "symbols" -debug-assertions = false -panic = "abort" -codegen-units = 1 -lto = true - -[profile.release-with-logs] -inherits = "release" -debug-assertions = true diff --git a/test-cases/core-mem-forget/core-mem-forget-1/remediated-example/src/lib.rs b/test-cases/core-mem-forget/core-mem-forget-1/remediated-example/src/lib.rs deleted file mode 100644 index 0e6fab6b..00000000 --- a/test-cases/core-mem-forget/core-mem-forget-1/remediated-example/src/lib.rs +++ /dev/null @@ -1,37 +0,0 @@ -#![no_std] -use soroban_sdk::{contract, contractimpl, contracttype}; - -#[contract] -pub struct CoreMemForget; - -#[contracttype] -#[derive(Eq, PartialEq)] -pub struct WithoutCopy { - pub a: u64, - pub b: u64, -} - -#[contractimpl] -impl CoreMemForget { - pub fn forget_something(n: WithoutCopy) -> u64 { - let _ = n; - 0 - } -} - -#[cfg(test)] -mod tests { - use crate::*; - - #[test] - fn test_forget_something() { - // Given - let test_value: WithoutCopy = WithoutCopy { a: 80, b: 60 }; - - // When - let result = CoreMemForget::forget_something(test_value); - - // Then - assert_eq!(result, 0); - } -} diff --git a/test-cases/core-mem-forget/core-mem-forget-1/vulnerable-example/Cargo.toml b/test-cases/core-mem-forget/core-mem-forget-1/vulnerable-example/Cargo.toml deleted file mode 100644 index 9b848f19..00000000 --- a/test-cases/core-mem-forget/core-mem-forget-1/vulnerable-example/Cargo.toml +++ /dev/null @@ -1,30 +0,0 @@ -[package] -name = "core-mem-forget-1-vulnerable" -version = "0.1.0" -edition = "2021" - -[lib] -crate-type = ["cdylib"] - -[dependencies] -soroban-sdk = { version = "20.0.0-rc2" } - -[dev_dependencies] -soroban-sdk = { version = "20.0.0-rc2", features = ["testutils"] } - -[features] -testutils = ["soroban-sdk/testutils"] - -[profile.release] -opt-level = "z" -overflow-checks = true -debug = 0 -strip = "symbols" -debug-assertions = false -panic = "abort" -codegen-units = 1 -lto = true - -[profile.release-with-logs] -inherits = "release" -debug-assertions = true diff --git a/test-cases/core-mem-forget/core-mem-forget-1/vulnerable-example/src/lib.rs b/test-cases/core-mem-forget/core-mem-forget-1/vulnerable-example/src/lib.rs deleted file mode 100644 index 6d993d95..00000000 --- a/test-cases/core-mem-forget/core-mem-forget-1/vulnerable-example/src/lib.rs +++ /dev/null @@ -1,37 +0,0 @@ -#![no_std] -use soroban_sdk::{contract, contractimpl, contracttype}; - -#[contract] -pub struct CoreMemForget; - -#[contracttype] -#[derive(Eq, PartialEq)] -pub struct WithoutCopy { - pub a: u64, - pub b: u64, -} - -#[contractimpl] -impl CoreMemForget { - pub fn forget_something(n: WithoutCopy) -> u64 { - core::mem::forget(n); - 0 - } -} - -#[cfg(test)] -mod tests { - use crate::*; - - #[test] - fn test_forget_something() { - // Given - let test_value: WithoutCopy = WithoutCopy { a: 80, b: 60 }; - - // When - let result = CoreMemForget::forget_something(test_value); - - // Then - assert_eq!(result, 0); - } -} From a0baa26bbb89b98b97983088a399ebf93ee84571 Mon Sep 17 00:00:00 2001 From: Facundo Lerena Date: Wed, 6 Dec 2023 11:15:21 -0300 Subject: [PATCH 5/7] package names --- detectors/avoid-core-mem-forget/Cargo.toml | 2 +- .../avoid-core-mem-forget-1/remediated-example/Cargo.toml | 2 +- .../avoid-core-mem-forget-1/vulnerable-example/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/detectors/avoid-core-mem-forget/Cargo.toml b/detectors/avoid-core-mem-forget/Cargo.toml index fc07fb1e..ac154ea0 100644 --- a/detectors/avoid-core-mem-forget/Cargo.toml +++ b/detectors/avoid-core-mem-forget/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "core-mem-forget" +name = "avoid-core-mem-forget" version = "0.1.0" edition = "2021" diff --git a/test-cases/avoid-core-mem-forget/avoid-core-mem-forget-1/remediated-example/Cargo.toml b/test-cases/avoid-core-mem-forget/avoid-core-mem-forget-1/remediated-example/Cargo.toml index 9d6db30e..1b643e7c 100644 --- a/test-cases/avoid-core-mem-forget/avoid-core-mem-forget-1/remediated-example/Cargo.toml +++ b/test-cases/avoid-core-mem-forget/avoid-core-mem-forget-1/remediated-example/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "core-mem-forget-1-remediated" +name = "avoid-core-mem-forget-1-remediated" version = "0.1.0" edition = "2021" diff --git a/test-cases/avoid-core-mem-forget/avoid-core-mem-forget-1/vulnerable-example/Cargo.toml b/test-cases/avoid-core-mem-forget/avoid-core-mem-forget-1/vulnerable-example/Cargo.toml index 9b848f19..863f16e0 100644 --- a/test-cases/avoid-core-mem-forget/avoid-core-mem-forget-1/vulnerable-example/Cargo.toml +++ b/test-cases/avoid-core-mem-forget/avoid-core-mem-forget-1/vulnerable-example/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "core-mem-forget-1-vulnerable" +name = "avoid-core-mem-forget-1-vulnerable" version = "0.1.0" edition = "2021" From c44d96e3c0a5c6507420b295c54623d52acdf3a8 Mon Sep 17 00:00:00 2001 From: Facundo Lerena Date: Wed, 6 Dec 2023 11:18:21 -0300 Subject: [PATCH 6/7] dup --- scout-audit-internal/src/detector/lint_message.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/scout-audit-internal/src/detector/lint_message.rs b/scout-audit-internal/src/detector/lint_message.rs index 45bcc7b0..0a1621a9 100644 --- a/scout-audit-internal/src/detector/lint_message.rs +++ b/scout-audit-internal/src/detector/lint_message.rs @@ -5,7 +5,6 @@ pub const INSUFFICIENTLY_RANDOM_VALUES_LINT_MESSAGE: &str = pub const DIVIDE_BEFORE_MULTIPLY_LINT_MESSAGE: &str = "Division before multiplication might result in a loss of precision"; -pub const INSUFFICIENTLY_RANDOM_VALUES_LINT_MESSAGE: &str = "Use env.prng() to generate random numbers, and remember that all random numbers are under the control of validators"; pub const OVERFLOW_CHECK_LINT_MESSAGE: &str = "Use `overflow-checks = true` in Cargo.toml profile"; pub const UNPROTECTED_UPDATE_CURRENT_CONTRACT_LINT_MESSAGE: &str = "This update_current_contract_wasm is called without access control"; From 6aeec54f51c48f314ef4ab833d4970f6b6f59d0d Mon Sep 17 00:00:00 2001 From: Facundo Lerena Date: Wed, 6 Dec 2023 11:22:26 -0300 Subject: [PATCH 7/7] dup again --- scout-audit-internal/src/detector.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/scout-audit-internal/src/detector.rs b/scout-audit-internal/src/detector.rs index e38aa365..85b88bf1 100644 --- a/scout-audit-internal/src/detector.rs +++ b/scout-audit-internal/src/detector.rs @@ -43,7 +43,6 @@ impl Detector { Detector::InsufficientlyRandomValues => INSUFFICIENTLY_RANDOM_VALUES_LINT_MESSAGE, Detector::DivideBeforeMultiply => DIVIDE_BEFORE_MULTIPLY_LINT_MESSAGE, - Detector::InsufficientlyRandomValues => INSUFFICIENTLY_RANDOM_VALUES_LINT_MESSAGE, Detector::OverflowCheck => OVERFLOW_CHECK_LINT_MESSAGE, Detector::UnprotectedUpdateCurrentContractWasm => { UNPROTECTED_UPDATE_CURRENT_CONTRACT_LINT_MESSAGE