From a6143543191e520a69ddfd20de1611d4a27e9bb6 Mon Sep 17 00:00:00 2001 From: publicqi Date: Mon, 24 Jun 2024 17:08:55 -0700 Subject: [PATCH] fix etherscan similar match --- src/evm/onchain/mod.rs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/evm/onchain/mod.rs b/src/evm/onchain/mod.rs index 474b7c4d..67ae44a2 100644 --- a/src/evm/onchain/mod.rs +++ b/src/evm/onchain/mod.rs @@ -384,10 +384,17 @@ impl OnChain { let sigs = extract_sig_from_contract(&contract_code_str); let mut unknown_sigs: usize = 0; for sig in &sigs { - if let Some(abi) = state.metadata_map().get::().unwrap().get(sig) { - parsed_abi.push(abi.clone()); - } else { - unknown_sigs += 1; + match state.metadata_map().get::() { + Some(abis) => { + if let Some(abi) = abis.get(sig) { + parsed_abi.push(abi.clone()); + } else { + unknown_sigs += 1; + } + } + None => { + unknown_sigs += 1; + } } }