Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wrong suffix .abis -> .abi #175

Closed
wants to merge 5 commits into from
Closed

Fix wrong suffix .abis -> .abi #175

wants to merge 5 commits into from

Conversation

0xAWM
Copy link
Contributor

@0xAWM 0xAWM commented Aug 21, 2023

  1. In some cases, the generated solution cannot be replayed, specifically manifested as "when arg len ==0, arg_offset sometimes exceeds the memory size".
    let arg = if arg_len == 0 {
    vec![]
    } else {
    interp.memory.get_slice(arg_offset, arg_len).to_vec()
    };
  2. The file suffix generated by solc is abi instead of abis
    // This function loads constructs Contract infos from path p
    // The organization of directory p should be
    // p
    // |- contract1.abis
    // |- contract1.bin
    // |- contract2.abis
    // |- contract2.bin
    pub fn from_glob(
    p: &str,
    state: &mut EVMFuzzState,
    proxy_deploy_codes: &Vec<String>,
    constructor_args_map: &HashMap<String, Vec<String>>,
    ) -> Self {
    let mut prefix_file_count: HashMap<String, u8> = HashMap::new();
    let mut contract_combined_json_info = None;
    for i in glob(p).expect("not such folder") {
    match i {
    Ok(path) => {
    let path_str = path.to_str().unwrap();
    if path_str.ends_with(".abis") {
    *prefix_file_count
    .entry(path_str.replace(".abis", "").clone())
    .or_insert(0) += 1;
    } else if path_str.ends_with(".bin") {
    *prefix_file_count
    .entry(path_str.replace(".bin", "").clone())
    .or_insert(0) += 1;
    } else if path_str.ends_with("combined.json") {
    contract_combined_json_info = Some(path_str.to_string());
    } else {
    println!("Found unknown file in folder: {:?}", path.display())
    }
    }

@0xAWM 0xAWM closed this Sep 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant