-
Notifications
You must be signed in to change notification settings - Fork 3.9k
[move-fuzz] A DUG-guided fuzzer for Move-based smart contracts #19406
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
base: main
Are you sure you want to change the base?
Changes from all commits
904b76b
587c044
ce81181
9114017
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| // Copyright (c) Aptos Foundation | ||
| // Licensed pursuant to the Innovation-Enabling Source Code License, available at https://github.com/aptos-labs/aptos-core/blob/main/LICENSE | ||
|
|
||
| use aptos_cli_common::{CliCommand, CliTypedResult}; | ||
| use async_trait::async_trait; | ||
| use clap::Parser; | ||
| use move_fuzz::{ | ||
| cli::{run_on, FuzzCommand}, | ||
| language::LanguageSetting, | ||
| }; | ||
| use std::path::PathBuf; | ||
|
|
||
| /// Fuzz a collection of Move packages | ||
| #[derive(Parser)] | ||
| pub struct Fuzz { | ||
| /// Path to the project directory | ||
| path: PathBuf, | ||
|
|
||
| /// Subdirectories to be included in the analysis | ||
| #[clap(long)] | ||
| subdir: Vec<PathBuf>, | ||
|
|
||
| /// Choose a language version | ||
| #[clap(long, default_value = "2.3+")] | ||
| language: LanguageSetting, | ||
|
|
||
| /// Named alias declarations | ||
| #[clap(long)] | ||
| alias: Vec<String>, | ||
|
|
||
| /// Resource account declaration | ||
| #[clap(long)] | ||
| resource: Vec<String>, | ||
|
|
||
| /// Execute in-place instead of copying over the directory to a tempdir | ||
| #[clap(long)] | ||
| in_place: bool, | ||
|
|
||
| /// Skip automated update of dependencies | ||
| #[clap(long)] | ||
| skip_deps_update: bool, | ||
|
|
||
| /// Print additional diagnostics if available. | ||
| #[clap(short, long, action = clap::ArgAction::Count)] | ||
| verbose: u8, | ||
|
|
||
| /// Command | ||
| #[clap(subcommand)] | ||
| command: FuzzCommand, | ||
| } | ||
|
|
||
| #[async_trait] | ||
| impl CliCommand<&'static str> for Fuzz { | ||
| fn command_name(&self) -> &'static str { | ||
| "Fuzz" | ||
| } | ||
|
|
||
| async fn execute(self) -> CliTypedResult<&'static str> { | ||
| let Self { | ||
| path, | ||
| subdir, | ||
| language, | ||
| alias, | ||
| resource, | ||
| in_place, | ||
| skip_deps_update, | ||
| verbose, | ||
| command, | ||
| } = self; | ||
| run_on( | ||
| path, | ||
| subdir, | ||
| language, | ||
| alias, | ||
| resource, | ||
| in_place, | ||
| skip_deps_update, | ||
| verbose, | ||
| command, | ||
| )?; | ||
| Ok("succeeded") | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -86,7 +86,7 @@ impl CoverageMap { | |
| } else { | ||
| // Don't count scripts (for now) | ||
| assert_eq!(context_segs.pop().unwrap(), "main",); | ||
| assert_eq!(context_segs.pop().unwrap(), "Script",); | ||
| assert_eq!(context_segs.pop().unwrap(), "script",); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Inconsistent
|
||
| } | ||
| } | ||
| Ok(self) | ||
|
|
@@ -332,7 +332,7 @@ impl TraceMap { | |
| } else { | ||
| // Don't count scripts (for now) | ||
| assert_eq!(context_segs.pop().unwrap(), "main",); | ||
| assert_eq!(context_segs.pop().unwrap(), "Script",); | ||
| assert_eq!(context_segs.pop().unwrap(), "script",); | ||
| } | ||
| } | ||
| Ok(self) | ||
|
|
||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are duplicate_with_assumption and get_state_delta being used anywhere in this PR?