Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon-Becker committed Dec 7, 2024
1 parent 523ca3e commit a702a09
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
8 changes: 4 additions & 4 deletions crates/decompile/src/core/out/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ pub fn build_source(
functions
.iter()
.filter(|f| {
!f.fallback
&& (analyzer_type == AnalyzerType::Yul
|| (f.maybe_getter_for.is_none() && !f.is_constant()))
!f.fallback &&
(analyzer_type == AnalyzerType::Yul ||
(f.maybe_getter_for.is_none() && !f.is_constant()))
})
.for_each(|f| {
let mut function_source = Vec::new();
Expand Down Expand Up @@ -195,7 +195,7 @@ fn get_function_header(f: &AnalyzedFunction) -> Vec<String> {
.map(|(i, (_, arg))| {
format!(
"{} arg{i}",
arg.potential_types().first().unwrap_or(&"bytes32".to_string()).to_string()
arg.potential_types().first().unwrap_or(&"bytes32".to_string())
)
})
.collect::<Vec<String>>()
Expand Down
4 changes: 2 additions & 2 deletions crates/decompile/src/core/postprocess.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ impl PostprocessOrchestrator {
// Note: this can't be done with a postprocessor because it needs all lines
if !function.payable && (function.pure || function.view) && function.arguments.is_empty() {
// check for RLP encoding. very naive check, but it works for now
if function.logic.iter().any(|line| line.contains("0x0100 *"))
&& function.logic.iter().any(|line| line.contains("0x01) &"))
if function.logic.iter().any(|line| line.contains("0x0100 *")) &&
function.logic.iter().any(|line| line.contains("0x01) &"))
{
// find any storage accesses
let joined = function.logic.join(" ");
Expand Down
2 changes: 0 additions & 2 deletions crates/decompile/src/utils/heuristics/extcall.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::fmt::format;

use alloy::primitives::U256;
use futures::future::BoxFuture;
use heimdall_common::utils::{hex::ToLowerHex, strings::encode_hex_reduced};
Expand Down

0 comments on commit a702a09

Please sign in to comment.