From 2b6ee18e4076e3ff37913fbe5d5cfc8a4dc3be49 Mon Sep 17 00:00:00 2001 From: Omar Abdulla Date: Wed, 23 Jul 2025 14:53:19 +0300 Subject: [PATCH] Better handling for length in equivalency checks --- crates/format/src/input.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/crates/format/src/input.rs b/crates/format/src/input.rs index d16444e..2bc0a88 100644 --- a/crates/format/src/input.rs +++ b/crates/format/src/input.rs @@ -214,8 +214,16 @@ impl Calldata { continue; } + let other = if other.len() < 32 { + let mut vec = other.to_vec(); + vec.resize(32, 0); + std::borrow::Cow::Owned(vec) + } else { + std::borrow::Cow::Borrowed(other) + }; + let this = resolve_argument(this, deployed_contracts, chain_state_provider)?; - let other = U256::from_be_slice(other); + let other = U256::from_be_slice(&other); if this != other { return Ok(false); }