Skip to content

Commit

Permalink
grevm(fix): check if the TxEnv.data complies with ABI specifications (p…
Browse files Browse the repository at this point in the history
  • Loading branch information
AshinGau committed Oct 13, 2024
1 parent 612c5be commit 3e2ed77
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/grevm/src/hint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,11 @@ impl ParallelExecutionHints {
if code.is_none() && data.is_empty() {
return;
}
println!("code {:?} data {:?}", code, data);
// println!("code {:?} data {:?}", code, data);
if data.len() < 4 || (data.len() - 4) % 32 != 0 {
// Invalid tx, or tx that triggers fallback CALL
return;
}
let (func_id, parameters) = Self::decode_contract_parameters(data);
// TODO(gravity_richard.zhz): refactor the judgement later with contract template
// ERC20_transfer
Expand Down

0 comments on commit 3e2ed77

Please sign in to comment.