From c4261d0f7bec3c250a979b416ed48ab13853c9d6 Mon Sep 17 00:00:00 2001 From: Rim Rakhimov Date: Tue, 2 Jul 2024 02:22:45 +0400 Subject: [PATCH] chore(libs): bump deps (#965) * libs-sourcify,libs-solidity-metadata: bump blocksocut-display-bytes to v1.1.0 * libs-solidity-metadata: bump minicbor to v0.24 * libs-solidity-metadata: move blockscout-display-bytes to dev-dependencies. Use added in updated blockscout-display-bytes `decode_hex` method instead of DisplayBytes struct. * libs-sourcify: replace DisplayBytes on new blockscout-display-bytes functions * libs-solidity-metadata: bump to v1.1.0 --- libs/solidity-metadata/Cargo.toml | 8 ++-- libs/solidity-metadata/src/lib.rs | 22 +++++----- libs/sourcify/Cargo.toml | 2 +- libs/sourcify/src/client.rs | 19 +++++---- libs/sourcify/src/types.rs | 67 +++++++++++++++---------------- 5 files changed, 61 insertions(+), 57 deletions(-) diff --git a/libs/solidity-metadata/Cargo.toml b/libs/solidity-metadata/Cargo.toml index edee48e6c..f63630276 100644 --- a/libs/solidity-metadata/Cargo.toml +++ b/libs/solidity-metadata/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "solidity-metadata" -version = "1.0.0" +version = "1.1.0" description = "Parsing solidity metadata stored in bytecode" license = "MIT" repository = "https://github.com/blockscout/blockscout-rs" @@ -11,7 +11,9 @@ categories = ["parsing"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -minicbor = { version = "0.18", features = ["std"] } +minicbor = { version = "0.24", features = ["std"] } semver = "1.0" thiserror = "1.0" -blockscout-display-bytes = "1.0" + +[dev-dependencies] +blockscout-display-bytes = "1.1.0" diff --git a/libs/solidity-metadata/src/lib.rs b/libs/solidity-metadata/src/lib.rs index 6fb9a0ebf..9b3f0ecbf 100644 --- a/libs/solidity-metadata/src/lib.rs +++ b/libs/solidity-metadata/src/lib.rs @@ -114,7 +114,7 @@ impl<'b> Decode<'b, DecodeContext> for MetadataHash { #[cfg(test)] mod metadata_hash_deserialization_tests { use super::*; - use blockscout_display_bytes::Bytes as DisplayBytes; + use blockscout_display_bytes::decode_hex; use std::str::FromStr; fn is_valid_custom_error( @@ -142,7 +142,7 @@ mod metadata_hash_deserialization_tests { // { "bzzr0": b"d4fba422541feba2d648f6657d9354ec14ea9f5919b520abe0feb60981d7b17c" } let hex = "a165627a7a72305820d4fba422541feba2d648f6657d9354ec14ea9f5919b520abe0feb60981d7b17c"; - let encoded = DisplayBytes::from_str(hex).unwrap().0; + let encoded = decode_hex(hex).unwrap(); let expected = MetadataHash { solc: None }; let expected_size = encoded.len(); @@ -160,7 +160,7 @@ mod metadata_hash_deserialization_tests { // given // { "ipfs": b"1220BCC988B1311237F2C00CCD0BFBD8B01D24DC18F720603B0DE93FE6327DF53625", "solc": b'00080e' } let hex = "a2646970667358221220bcc988b1311237f2c00ccd0bfbd8b01d24dc18f720603b0de93fe6327df5362564736f6c634300080e"; - let encoded = DisplayBytes::from_str(hex).unwrap().0; + let encoded = decode_hex(hex).unwrap(); let expected = MetadataHash { solc: Some(Version::new(0, 8, 14)), }; @@ -180,7 +180,7 @@ mod metadata_hash_deserialization_tests { // given // {"ipfs": b'1220BA5AF27FE13BC83E671BD6981216D35DF49AB3AC923741B8948B277F93FBF732', "solc": "0.8.15-ci.2022.5.23+commit.21591531"} let hex = "a2646970667358221220ba5af27fe13bc83e671bd6981216d35df49ab3ac923741b8948b277f93fbf73264736f6c637823302e382e31352d63692e323032322e352e32332b636f6d6d69742e3231353931353331"; - let encoded = DisplayBytes::from_str(hex).unwrap().0; + let encoded = decode_hex(hex).unwrap(); let expected = MetadataHash { solc: Some( Version::from_str("0.8.15-ci.2022.5.23+commit.21591531") @@ -207,11 +207,11 @@ mod metadata_hash_deserialization_tests { let second = "a165627a7a72305820d4fba422541feba2d648f6657d9354ec14ea9f5919b520abe0feb60981d7b17c"; let hex = format!("{first}{second}"); - let encoded = DisplayBytes::from_str(&hex).unwrap().0; + let encoded = decode_hex(&hex).unwrap(); let expected = MetadataHash { solc: Some(Version::new(0, 8, 14)), }; - let expected_size = DisplayBytes::from_str(first).unwrap().0.len(); + let expected_size = decode_hex(first).unwrap().len(); // when let (decoded, decoded_size) = MetadataHash::from_cbor(encoded.as_ref()) @@ -226,7 +226,7 @@ mod metadata_hash_deserialization_tests { fn deserialization_of_non_cbor_hex_should_fail() { // given let hex = "1234567890"; - let encoded = DisplayBytes::from_str(hex).unwrap().0; + let encoded = decode_hex(hex).unwrap(); // when let decoded = MetadataHash::from_cbor(encoded.as_ref()); @@ -244,7 +244,7 @@ mod metadata_hash_deserialization_tests { // given // "solc" let hex = "64736f6c63"; - let encoded = DisplayBytes::from_str(hex).unwrap().0; + let encoded = decode_hex(hex).unwrap(); // when let decoded = MetadataHash::from_cbor(encoded.as_ref()); @@ -262,7 +262,7 @@ mod metadata_hash_deserialization_tests { // given // { "solc": b'000400', "ipfs": b"1220BCC988B1311237F2C00CCD0BFBD8B01D24DC18F720603B0DE93FE6327DF53625", "solc": b'00080e' } let hex = "a364736f6c6343000400646970667358221220bcc988b1311237f2c00ccd0bfbd8b01d24dc18f720603b0de93fe6327df5362564736f6c634300080e"; - let encoded = DisplayBytes::from_str(hex).unwrap().0; + let encoded = decode_hex(hex).unwrap(); // when let decoded = MetadataHash::from_cbor(encoded.as_ref()); @@ -281,7 +281,7 @@ mod metadata_hash_deserialization_tests { // 3 elements expected in the map but got only 2: // { "ipfs": b"1220BCC988B1311237F2C00CCD0BFBD8B01D24DC18F720603B0DE93FE6327DF53625", "solc": b'00080e' } let hex = "a3646970667358221220bcc988b1311237f2c00ccd0bfbd8b01d24dc18f720603b0de93fe6327df5362564736f6c634300080e"; - let encoded = DisplayBytes::from_str(hex).unwrap().0; + let encoded = decode_hex(hex).unwrap(); // when let decoded = MetadataHash::from_cbor(encoded.as_ref()); @@ -299,7 +299,7 @@ mod metadata_hash_deserialization_tests { // given // { "ipfs": b"1220BCC988B1311237F2C00CCD0BFBD8B01D24DC18F720603B0DE93FE6327DF53625", "solc": 123 } \ let hex= "a2646970667358221220bcc988b1311237f2c00ccd0bfbd8b01d24dc18f720603b0de93fe6327df5362564736f6c63187B"; - let encoded = DisplayBytes::from_str(hex).unwrap().0; + let encoded = decode_hex(hex).unwrap(); // when let decoded = MetadataHash::from_cbor(encoded.as_ref()); diff --git a/libs/sourcify/Cargo.toml b/libs/sourcify/Cargo.toml index 4edc67ecf..e599cfa0e 100644 --- a/libs/sourcify/Cargo.toml +++ b/libs/sourcify/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" [dependencies] anyhow = "1.0.71" bytes = "1.4.0" -blockscout-display-bytes = "1.0.0" +blockscout-display-bytes = "1.1.0" reqwest = { version = "0.11.18", features = ["json"] } reqwest-middleware = "0.2.2" reqwest-retry = "0.3.0" diff --git a/libs/sourcify/src/client.rs b/libs/sourcify/src/client.rs index 5ef2d3b0d..7b790d281 100644 --- a/libs/sourcify/src/client.rs +++ b/libs/sourcify/src/client.rs @@ -5,7 +5,7 @@ use crate::{ }, Error, SourcifyError, VerifyFromEtherscanError, }; -use blockscout_display_bytes::Bytes as DisplayBytes; +use blockscout_display_bytes::ToHex; use bytes::Bytes; use reqwest::{Response, StatusCode}; use reqwest_middleware::{ClientWithMiddleware, Middleware}; @@ -126,9 +126,14 @@ impl Client { chain_id: &str, contract_address: Bytes, ) -> Result> { - let contract_address = DisplayBytes::from(contract_address); - let url = - self.generate_url(format!("files/any/{}/{}", chain_id, contract_address).as_str()); + let url = self.generate_url( + format!( + "files/any/{}/{}", + chain_id, + ToHex::to_hex(&contract_address) + ) + .as_str(), + ); let response = self .reqwest_client @@ -148,7 +153,6 @@ impl Client { chain_id: &str, contract_address: Bytes, ) -> Result> { - let contract_address = DisplayBytes::from(contract_address); let url = self.generate_url("verify/etherscan"); #[derive(Serialize)] @@ -160,7 +164,7 @@ impl Client { let request = Request { chain_id, - address: contract_address.to_string(), + address: ToHex::to_hex(&contract_address), }; let response = self @@ -251,6 +255,7 @@ impl Client { #[cfg(test)] mod tests { use super::*; + use blockscout_display_bytes::decode_hex; use governor::{ clock::DefaultClock, middleware::NoOpMiddleware, @@ -263,7 +268,7 @@ mod tests { use std::num::NonZeroU32; fn parse_contract_address(contract_address: &str) -> Bytes { - DisplayBytes::from_str(contract_address).unwrap().0 + decode_hex(contract_address).unwrap().into() } static RATE_LIMITER_MIDDLEWARE: OnceCell< diff --git a/libs/sourcify/src/types.rs b/libs/sourcify/src/types.rs index 1a82e994c..e81da221c 100644 --- a/libs/sourcify/src/types.rs +++ b/libs/sourcify/src/types.rs @@ -46,7 +46,7 @@ pub enum MatchType { pub use get_source_files_response::GetSourceFilesResponse; mod get_source_files_response { use super::*; - use blockscout_display_bytes::Bytes as DisplayBytes; + use blockscout_display_bytes::decode_hex; use bytes::Bytes; use serde::{de, Deserializer}; use std::{collections::BTreeMap, path::PathBuf, str::FromStr}; @@ -210,13 +210,13 @@ mod get_source_files_response { {placeholder}, value: {value}" ) })?; - let address = DisplayBytes::from_str(value).map_err(|err| { + let address = decode_hex(value).map_err(|err| { format!( "library map has a placeholder value that is not valid bytes; \ placeholder: {placeholder}, value: {value}, err: '{err}'" ) })?; - library_map.insert(placeholder.clone(), address.0); + library_map.insert(placeholder.clone(), address.into()); } Ok(library_map) @@ -230,12 +230,12 @@ mod get_source_files_response { )); } - let display_bytes = DisplayBytes::from_str(file.content.as_str()) + let display_bytes = decode_hex(file.content.as_str()) .map_err(|err| format!( "constructor arguments are not valid bytes; constructor_arguments: {}, err: '{err}'", file.content ))?; - Ok(display_bytes.0) + Ok(display_bytes.into()) } fn process_immutable_references(file: File) -> Result { @@ -255,10 +255,10 @@ mod get_source_files_response { pub use verify_from_etherscan::{VerifyFromEtherscanError, VerifyFromEtherscanResponse}; mod verify_from_etherscan { use super::*; - use blockscout_display_bytes::Bytes as DisplayBytes; + use blockscout_display_bytes::decode_hex; use bytes::Bytes; use serde::{de, Deserializer}; - use std::{collections::BTreeMap, str::FromStr}; + use std::collections::BTreeMap; #[derive(Clone, Debug, PartialEq, Eq)] pub struct VerifyFromEtherscanResponse { @@ -377,34 +377,31 @@ mod verify_from_etherscan { .next() .ok_or_else(|| "response does not contain any result".to_string())?; - let address = DisplayBytes::from_str(&value.address) - .map_err(|err| { - format!( - "address is not a valid byte sequence; address: {}, err: '{err}'", - value.address - ) - })? - .0; + let address = decode_hex(&value.address).map_err(|err| { + format!( + "address is not a valid byte sequence; address: {}, err: '{err}'", + value.address + ) + })?; let library_map = value .library_map .into_iter() .map(|(placeholder, value)| { - let address = DisplayBytes::from_str(&value) + let address = decode_hex(&value) .map_err(|err| { format!( "library map has a placeholder value that is not a valid byte sequence; \ placeholder: {placeholder}, value: {value}, err: '{err}'" ) - })? - .0; + })?; - Ok((placeholder, address)) + Ok((placeholder, address.into())) }) .collect::, String>>()?; Ok(Self { - address, + address: address.into(), chain_id: value.chain_id, status: value.status, library_map, @@ -417,7 +414,7 @@ mod verify_from_etherscan { #[cfg(test)] mod tests { use super::{get_source_files_response::*, *}; - use blockscout_display_bytes::Bytes as DisplayBytes; + use blockscout_display_bytes::decode_hex; use bytes::Bytes; use pretty_assertions::assert_eq; use serde_json::json; @@ -477,7 +474,7 @@ mod tests { ]), metadata: serde_json::Value::from_str("{\"compiler\":{\"version\":\"0.6.8+commit.0bbfe453\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[],\"name\":\"SourcifySolidity14\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"input\",\"type\":\"address\"}],\"name\":\"identity\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"contracts/project:/ExternalTestMultiple.sol\":\"ExternalTestMultiple\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":300},\"remappings\":[]},\"sources\":{\"contracts/project:/ExternalTestMultiple.sol\":{\"keccak256\":\"0xc40380283b7d4a97da5e247fbb7b795f6241cfe3d86e34493d87528dfcb4d56b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://86ec578963cb912c4b912f066390e564c54ea1bc5fb1a55aa4e4c77bb92b07ba\",\"dweb:/ipfs/QmeqihJa8kUjbNHNCpFRHkq1scCbjjFvaUN2gWEJCNEx1Q\"]},\"contracts/project_/ExternalTestMultiple.sol\":{\"keccak256\":\"0xff9e0ddd21b0579491371fe8d4f7e09254ffc7af9382ba287ef8d2a2fd1ce8e2\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://1f516a34091c829a18a8c5dd13fbd82f44b532e7dea6fed9f60ae731c9042d74\",\"dweb:/ipfs/QmZqm6CLGUKQ3RJCLAZy5CWo2ScLzV2r5JXWNWfBwbGCsK\"]}},\"version\":1}").unwrap(), library_map: BTreeMap::from([ - ("__$54103d3e1543ebb87230c9454f838057a5$__".into(), DisplayBytes::from_str("0x6b88c55cfbd4eda1320f802b724193cab062ccce").unwrap().0) + ("__$54103d3e1543ebb87230c9454f838057a5$__".into(), decode_hex("0x6b88c55cfbd4eda1320f802b724193cab062ccce").unwrap().into()) ]), constructor_arguments: None, immutable_references: None, @@ -551,7 +548,7 @@ mod tests { ]), metadata: serde_json::Value::from_str("{\"compiler\":{\"version\":\"0.8.4+commit.c7e474f2\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"ethAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tokenAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"DividendClaimed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"isExcluded\",\"type\":\"bool\"}],\"name\":\"ExcludeFromFees\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"isExcluded\",\"type\":\"bool\"}],\"name\":\"ExcludeMultipleAccountsFromFees\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"newValue\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"oldValue\",\"type\":\"uint256\"}],\"name\":\"GasForProcessingUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"iterations\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"claims\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"lastProcessedIndex\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"automatic\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"gas\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"processor\",\"type\":\"address\"}],\"name\":\"ProcessedDividendTracker\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"SendDividends\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"pair\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"value\",\"type\":\"bool\"}],\"name\":\"SetAutomatedMarketMakerPair\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldAddress\",\"type\":\"address\"}],\"name\":\"UpdateDividendTracker\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldAddress\",\"type\":\"address\"}],\"name\":\"UpdateUniswapV2Router\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"_amnestyBot\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"_blacklistBot\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"aidiBuybackEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"automatedMarketMakerPairs\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"buybackFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"claim\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"dailySell\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"deadAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"devMarketingAndCharityAddress\",\"outputs\":[{\"internalType\":\"address payable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"devMarketingAndCharityEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"devMarketingAndCharityFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"dividendTokenBalanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"dividendTracker\",\"outputs\":[{\"internalType\":\"contract VerseDividendTracker\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ethRedistributeFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ethRedistributionEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"excluded\",\"type\":\"bool\"}],\"name\":\"excludeFromDailyLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"excluded\",\"type\":\"bool\"}],\"name\":\"excludeFromFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"bool\",\"name\":\"excluded\",\"type\":\"bool\"}],\"name\":\"excludeMultipleAccountsFromFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gasForProcessing\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"getAccountDividendsInfo\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"getAccountDividendsInfoAtIndex\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getClaimWait\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getGasForTransfer\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLastProcessedAccount\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLastProcessedIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getNumberOfDividendTokenHolders\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTotalDividendsDistributed\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"isBot\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"isExcludedFromDailyLimit\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"isExcludedFromFees\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"lastTransfer\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"launchTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxDailySellAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxPurchaseEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"openTrading\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"gas\",\"type\":\"uint256\"}],\"name\":\"processDividendTracker\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"reinvestInactive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"name\":\"setAidiBuybackEnabled\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pair\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"value\",\"type\":\"bool\"}],\"name\":\"setAutomatedMarketMakerPair\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"name\":\"setDevMarketingAndCharityFeeEnabled\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"name\":\"setETHRedistributionEnabled\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newAmount\",\"type\":\"uint256\"}],\"name\":\"setMaxDailySellAmount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newAmount\",\"type\":\"uint256\"}],\"name\":\"setMaxPurchaseAmount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"name\":\"setMaxPurchaseEnabled\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"swapTokensAtAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"tradingOpen\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"uniswapV2Pair\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"uniswapV2Router\",\"outputs\":[{\"internalType\":\"contract IUniswapV2Router02\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"claimWait\",\"type\":\"uint256\"}],\"name\":\"updateClaimWait\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"updateDevMarketingAndCharityAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"updateDividendTracker\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newValue\",\"type\":\"uint256\"}],\"name\":\"updateGasForProcessing\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"gasForTransfer\",\"type\":\"uint256\"}],\"name\":\"updateGasForTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"updateUniswapV2Router\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"withdrawableDividendOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"allowance(address,address)\":{\"details\":\"See {IERC20-allowance}.\"},\"approve(address,uint256)\":{\"details\":\"See {IERC20-approve}. Requirements: - `spender` cannot be the zero address.\"},\"balanceOf(address)\":{\"details\":\"See {IERC20-balanceOf}.\"},\"decimals()\":{\"details\":\"Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5,05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless this function is overridden; NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.\"},\"decreaseAllowance(address,uint256)\":{\"details\":\"Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`.\"},\"increaseAllowance(address,uint256)\":{\"details\":\"Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address.\"},\"name()\":{\"details\":\"Returns the name of the token.\"},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"symbol()\":{\"details\":\"Returns the symbol of the token, usually a shorter version of the name.\"},\"totalSupply()\":{\"details\":\"See {IERC20-totalSupply}.\"},\"transfer(address,uint256)\":{\"details\":\"See {IERC20-transfer}. Requirements: - `recipient` cannot be the zero address. - the caller must have a balance of at least `amount`.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. Requirements: - `sender` and `recipient` cannot be the zero address. - `sender` must have a balance of at least `amount`. - the caller must have allowance for ``sender``'s tokens of at least `amount`.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"verse.sol\":\"Verse\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"verse.sol\":{\"keccak256\":\"0xd195f71e6fd62c78589726ae45f2e200aebc8bfe4202056e2395b3bcb2f06d52\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://42c7dacbb5b519bed940b155f8cd712e9b75f6d5ea71f2aea395853a95924b1c\",\"dweb:/ipfs/QmZfDn4NVcMZBV7zGhwxJDCA9T3XDNSzsPYVYxn8egggZr\"]}},\"version\":1}").unwrap(), library_map: BTreeMap::from([ - ("__$c486e37aeebf327f7a754ca76e58aaef3b$__".to_string(), DisplayBytes::from_str("0xa8602b5e79650417ee75f78aa60836be0f234868").unwrap().0), + ("__$c486e37aeebf327f7a754ca76e58aaef3b$__".to_string(), decode_hex("0xa8602b5e79650417ee75f78aa60836be0f234868").unwrap().into()), ]), constructor_arguments: Some(Bytes::new()), immutable_references: None, @@ -612,8 +609,8 @@ mod tests { ]), metadata: serde_json::Value::from_str("{\"compiler\":{\"version\":\"0.8.7+commit.e28d00a7\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_c\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"a\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"arr\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"b\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"c\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"test_array\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/C2.sol\":\"C2\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/Array.sol\":{\"keccak256\":\"0xa3c043d47c03251f392e0dcdf7c2ad5069436cc72561b2404a195d84a78fb33c\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://9eeae2fe8bb3e5addd48dea0b8c5a81581b4137ad605b103b7edc35ea1ab2997\",\"dweb:/ipfs/QmRaC1FTQxkcWwmyZeZ4twQswdpcTnN5GQJ2Db7RMdf14j\"]},\"contracts/Array2.sol\":{\"keccak256\":\"0x6b5b4acc9b4f10f7df803702516752978c40cb4eadd48a218dcc0503fd7f4f88\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6f9b39fbd016e6b0c62cb3a7d8abc8981fe383c345381dfd7533a8cb8a1ded69\",\"dweb:/ipfs/QmUznGnpnz1TFuQZzjDX4NzoVFsiwRzaA2T7gZQZUoFDim\"]},\"contracts/C1.sol\":{\"keccak256\":\"0x92ca0ef5999e6bae5556c90314c3b7fe3bf95cabf8423d8415ac3d3955f524df\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://1bb5f1bc39e5507da05e9d7700546f74896b47c4da076fbd744d8b6269c32a09\",\"dweb:/ipfs/QmRoabfGHHmoKTPb8vtdWFuaesoc4mUjzuSgEDE8TpeYwF\"]},\"contracts/C2.sol\":{\"keccak256\":\"0x20dd630583b88340fae8cda0a6008c0db058ee4b35d8a1f5a44bcd66ef892782\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://998e0420f165f61fec241b5fbd71f06bc150098c8981f0aeedbf5a95c240b2a0\",\"dweb:/ipfs/QmSG3mwV4zqk4NacHtf3MWSAbWW96sorEVjNBPJiWXs2LQ\"]}},\"version\":1}").unwrap(), library_map: BTreeMap::from([ - ("__$b01ade520cf6862e0b214d4ce779d49f2a$__".to_string(), DisplayBytes::from_str("0x77479d54e233b4b79b9e3f4cf2bd20575fdeb1bb").unwrap().0), - ("__$21bb6923d223bd045c4cab9806bdf3594d$__".to_string(), DisplayBytes::from_str("0x4ea76bb37c82f6f453c4cbb4ae726036a7a8b820").unwrap().0), + ("__$b01ade520cf6862e0b214d4ce779d49f2a$__".to_string(), decode_hex("0x77479d54e233b4b79b9e3f4cf2bd20575fdeb1bb").unwrap().into()), + ("__$21bb6923d223bd045c4cab9806bdf3594d$__".to_string(), decode_hex("0x4ea76bb37c82f6f453c4cbb4ae726036a7a8b820").unwrap().into()), ]), constructor_arguments: None, immutable_references: Some(serde_json::Value::from_str("{\"76\":[{\"length\":32,\"start\":242}],\"90\":[{\"length\":32,\"start\":636}],\"92\":[{\"length\":32,\"start\":708}]}").unwrap()), @@ -645,23 +642,23 @@ mod tests { ] }); let expected = VerifyFromEtherscanResponse { - address: DisplayBytes::from_str("0x123f681646d4a755815f9cb19e1acc8565a0c2ac") + address: decode_hex("0x123f681646d4a755815f9cb19e1acc8565a0c2ac") .unwrap() - .0, + .into(), chain_id: "1".to_string(), status: MatchType::Full, library_map: BTreeMap::from([ ( "lib1".into(), - DisplayBytes::from_str("0x3f681646d4a755815f9cb19e1acc8565a0c2ac") + decode_hex("0x3f681646d4a755815f9cb19e1acc8565a0c2ac") .unwrap() - .0, + .into(), ), ( "lib2".into(), - DisplayBytes::from_str("0x4f681646d4a755815f9cb19e1acc8565a0c2ac") + decode_hex("0x4f681646d4a755815f9cb19e1acc8565a0c2ac") .unwrap() - .0, + .into(), ), ]), immutable_references: None, @@ -685,17 +682,17 @@ mod tests { ] }); let expected = VerifyFromEtherscanResponse { - address: DisplayBytes::from_str("0x831b003398106153eD89a758bEC9734667D18AeC") + address: decode_hex("0x831b003398106153eD89a758bEC9734667D18AeC") .unwrap() - .0, + .into(), chain_id: "10".to_string(), status: MatchType::Partial, library_map: BTreeMap::from([ ( "__$5762d9689e001ee319dd424b89cc702f5c$__".into(), - DisplayBytes::from_str("0x9224ee604e9b62f8e0a0e5824fee2e0df2ca902f") + decode_hex("0x9224ee604e9b62f8e0a0e5824fee2e0df2ca902f") .unwrap() - .0, + .into(), ), ]), immutable_references: Some(serde_json::from_value(json!({"2155":[{"length":32,"start":4157},{"length":32,"start":4712}],"2157":[{"length":32,"start":1172},{"length":32,"start":1221},{"length":32,"start":1289},{"length":32,"start":2077},{"length":32,"start":4218},{"length":32,"start":5837}],"2159":[{"length":32,"start":742},{"length":32,"start":4943}],"2161":[{"length":32,"start":402},{"length":32,"start":3247},{"length":32,"start":5564}]})).unwrap()),