Skip to content
Closed
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
6 changes: 3 additions & 3 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public fun movy_post_increment(
let state = context::borrow_state(movy);
let previous_val = bag::borrow<ID, u64>(state, ctr_id);
if (*previous_val + n != new_val) {
crash_because(b"Increment does not correctly inreases internal value.".to_string());
crash_because(b"Increment does not correctly increases internal value.".to_string());
}
}
```
Expand Down Expand Up @@ -145,7 +145,7 @@ To write invariants for contracts, see [the counter sample](./test-data/counter/
movy = {git = "https://github.com/BitsLabSec/movy", subdir = "move/movy", rev = "master"}
```

## Contritubions
## Contributions

**Movy** is very open to contributions! We expect your feedbacks and pull requests. See the roadmap or contact us for further information.

Expand All @@ -159,7 +159,7 @@ At this moment, `movy` is in very early-alpha state with the folloing features m

## Credits

Belobog is inspired by several pioneering projects:
Movy is inspired by several pioneering projects:

- [Belobog](https://github.com/abortfuzz/belobog)
- [ityfuzz](https://github.com/fuzzland/ityfuzz)
Expand Down
2 changes: 1 addition & 1 deletion crates/movy-analysis/src/type_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ impl MoveTypeGraph {
self.graph.add_edge(ty_node_idx, fidx, edge);
}

for rt in function.return_paramters.iter() {
for rt in function.return_parameters.iter() {
let ty = if let Some(deref) = rt.dereference() {
*deref.clone()
} else {
Expand Down
4 changes: 2 additions & 2 deletions crates/movy-fuzz/src/meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,15 @@ fn should_skip_function(base: &Metadata, func_data: &MoveFunctionAbi) -> bool {
|| matches!(t, MoveAbiSignatureToken::Reference(_))
|| t.is_tx_context()
}) && func_data
.return_paramters
.return_parameters
.iter()
.all(|t| t.is_mutable() || t.ability().is_some_and(|a| a.contains(MoveAbility::DROP)))
{
// skip read-only functions
return true;
}

for ret_ty in func_data.return_paramters.iter() {
for ret_ty in func_data.return_parameters.iter() {
let self_used = func_data
.parameters
.iter()
Expand Down
4 changes: 2 additions & 2 deletions crates/movy-fuzz/src/mutators/object_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ impl ObjectData {
}
}

for (j, ret_ty) in function.return_paramters.iter().enumerate() {
for (j, ret_ty) in function.return_parameters.iter().enumerate() {
if let MoveAbiSignatureToken::Vector(inner) = ret_ty {
let instantiated_ret_ty = ret_ty.subst(ty_args_map).unwrap();
match inner.as_ref() {
Expand Down Expand Up @@ -271,7 +271,7 @@ impl ObjectData {
if !matches!(instantiated_ret_ty, MoveTypeTag::Struct(_)) {
continue; // Only process struct return types
}
let res_arg = if function.return_paramters.len() == 1 {
let res_arg = if function.return_parameters.len() == 1 {
SequenceArgument::Result(i as u16)
} else {
SequenceArgument::NestedResult(i as u16, j as u16)
Expand Down
6 changes: 3 additions & 3 deletions crates/movy-fuzz/src/mutators/sequence/append.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ where
);
let Some((arg_ty_arg, mut producing_ty_arg, mapping, ret_idx)) = pre_func
.1
.return_paramters
.return_parameters
.iter()
.enumerate()
.filter_map(|(i, ret_ty)| {
Expand Down Expand Up @@ -462,11 +462,11 @@ where
);

let arguments = movecall.arguments.clone();
let returns = if function.return_paramters.len() == 1 {
let returns = if function.return_parameters.len() == 1 {
vec![SequenceArgument::Result(ptb.commands.len() as u16)]
} else {
function
.return_paramters
.return_parameters
.iter()
.enumerate()
.map(|(j, _)| SequenceArgument::NestedResult(ptb.commands.len() as u16, j as u16))
Expand Down
2 changes: 1 addition & 1 deletion crates/movy-fuzz/src/mutators/sequence/post.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub fn process_balance(ptb: &mut MoveSequence, state: &(impl HasFuzzMetadata + H
)
.unwrap();
let Some(MoveAbiSignatureToken::StructInstantiation(_, type_arguments)) =
function.return_paramters.get(ret_idx as usize)
function.return_parameters.get(ret_idx as usize)
else {
panic!("Expected balance return type to be a struct");
};
Expand Down
6 changes: 3 additions & 3 deletions crates/movy-fuzz/src/mutators/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ where
.iter()
.any(|param| param.contains_type_param(i as u16))
&& !function
.return_paramters
.return_parameters
.iter()
.any(|ret| ret.contains_type_param(i as u16))
{
Expand Down Expand Up @@ -327,10 +327,10 @@ where
if !function
.parameters
.iter()
.chain(function.return_paramters.iter())
.chain(function.return_parameters.iter())
.any(|param| param.contains_type_param(i as u16))
&& !function
.return_paramters
.return_parameters
.iter()
.any(|ret| ret.contains_type_param(i as u16))
{
Expand Down
2 changes: 1 addition & 1 deletion crates/movy-replay/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ impl<
gas,
None,
)?;
log::info!("Commiting movy_init effects...");
log::info!("Committing movy_init effects...");
log::debug!(
"Status: {:?} Changed Objects: {}, Removed Objects: {}",
results.effects.status(),
Expand Down
10 changes: 5 additions & 5 deletions crates/movy-types/src/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,7 @@ impl From<Visibility> for MoveFunctionVisibility {
pub struct MoveFunctionAbi {
pub name: String,
pub parameters: Vec<MoveAbiSignatureToken>,
pub return_paramters: Vec<MoveAbiSignatureToken>,
pub return_parameters: Vec<MoveAbiSignatureToken>,
pub type_parameters: Vec<MoveAbility>,
pub visibility: MoveFunctionVisibility,
// TODO: Aptos's acquires
Expand Down Expand Up @@ -1052,12 +1052,12 @@ impl Display for MoveFunctionAbi {
v.to_string()
})
.join(", "),
if self.return_paramters.is_empty() {
if self.return_parameters.is_empty() {
"".to_string()
} else {
format!(
": {}",
self.return_paramters
self.return_parameters
.iter()
.map(|v| if f.alternate() {
format!("{:#}", v)
Expand Down Expand Up @@ -1100,7 +1100,7 @@ impl MoveFunctionAbi {
type_parameters: ftys,
visibility: vis,
parameters,
return_paramters: returns,
return_parameters: returns,
}
}
pub fn from_module_def(fdef: &FunctionDefinition, module: &CompiledModule) -> Self {
Expand Down Expand Up @@ -1227,7 +1227,7 @@ impl MovePackageAbi {
for ty in fc.parameters.iter_mut() {
ty.published_at(prev, address);
}
for ty in fc.return_paramters.iter_mut() {
for ty in fc.return_parameters.iter_mut() {
ty.published_at(prev, address);
}
}
Expand Down
4 changes: 2 additions & 2 deletions crates/movy/src/analysis/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ pub enum AnalysisSubcommand {
}

#[derive(Args)]
pub struct AnlaysisArgs {
pub struct AnalysisArgs {
#[clap(subcommand)]
pub cmd: AnalysisSubcommand,
}

impl AnlaysisArgs {
impl AnalysisArgs {
pub async fn run(self) -> Result<(), MovyError> {
match self.cmd {
AnalysisSubcommand::TypeGraph(args) => args.run().await?,
Expand Down
4 changes: 2 additions & 2 deletions crates/movy/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use clap::{Parser, Subcommand};

use crate::{analysis::AnlaysisArgs, sui::SuiArgs};
use crate::{analysis::AnalysisArgs, sui::SuiArgs};

mod analysis;
mod aptos;
Expand All @@ -9,7 +9,7 @@ mod sui;
#[derive(Subcommand)]
pub enum MovySubcommand {
Sui(SuiArgs),
Analysis(AnlaysisArgs), // Aptos(AptosArgs)
Analysis(AnalysisArgs), // Aptos(AptosArgs)
}

#[derive(Parser)]
Expand Down
4 changes: 2 additions & 2 deletions crates/movy/src/sui/fuzz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ pub struct SuiFuzzArgs {
pub time_limit: Option<u64>,
#[arg(long, help = "rng seeds")]
pub seed: Option<u64>,
#[arg(short, long, help = "Ouput directory to save all contents")]
#[arg(short, long, help = "Output directory to save all contents")]
pub output: Option<PathBuf>,
#[arg(
short,
Expand Down Expand Up @@ -171,7 +171,7 @@ impl SuiFuzzArgs {
if self.force_removal {
std::fs::remove_dir_all(output)?;
} else {
return Err(eyre!("The given output is already there, pass -f or env MOVY_FORCE_REMOVAl to always remove it").into());
return Err(eyre!("The given output is already there, pass -f or env MOVY_FORCE_REMOVAL to always remove it").into());
}
}
std::fs::create_dir_all(output)?;
Expand Down
2 changes: 1 addition & 1 deletion test-data/counter/tests/movy.move
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@ public fun movy_post_increment(
let previous_val = bag::borrow<ID, u64>(state, ctr_id);
log_keyed_u64(b"post-increment".to_string(), new_val);
if (*previous_val + n != new_val) {
crash_because(b"Increment does not correctly inreases internal value.".to_string());
crash_because(b"Increment does not correctly increases internal value.".to_string());
}
}