Skip to main content

CodeFuzzer

Struct CodeFuzzer 

Source
pub struct CodeFuzzer {
    pub seed: u64,
    /* private fields */
}
Expand description

Fuzzer utilities for property-based vulnerability detection testing.

Generates code patterns to test detector robustness and minimize false positives. Deterministic pseudo-random number generator for fuzz testing

Fields§

§seed: u64

Implementations§

Source§

impl CodeFuzzer

Source

pub fn new(seed: Option<u64>) -> Self

Create new fuzzer with optional seed

Source

pub fn random_function_name(&mut self) -> String

Generate random function name

Source

pub fn random_variable_name(&mut self) -> String

Generate random variable names

Source

pub fn generate_solidity_function( &mut self, include_vulnerable_pattern: bool, ) -> String

Generate random Solidity function with variable control flow

Source

pub fn generate_merkle_pattern(&mut self, vulnerable: bool) -> String

Generate random Solidity with merkle root pattern

Source

pub fn generate_oracle_pattern(&mut self, vulnerable: bool) -> String

Generate random oracle usage pattern

Source

pub fn generate_collateral_pattern(&mut self, vulnerable: bool) -> String

Generate random collateral check pattern

Source

pub fn generate_contract(&mut self, function_count: usize) -> String

Generate random contract with multiple functions

Source

pub fn generate_rust_pattern(&mut self, vulnerable: bool) -> String

Generate random Rust code pattern

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.