From 54b3f92162477d70794acdff1fe891f8c5665d25 Mon Sep 17 00:00:00 2001 From: Waiz Khan Date: Wed, 21 May 2025 16:09:02 +0500 Subject: [PATCH 1/2] minor changes --- .gitignore | 3 ++- FUNDING.json | 8 -------- src/ast_parsing/ast_parser.py | 2 +- try_smartmuv.py | 15 ++++++++++++++- 4 files changed, 17 insertions(+), 11 deletions(-) delete mode 100644 FUNDING.json diff --git a/.gitignore b/.gitignore index 628d2eb..ee6322d 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,5 @@ config_exp test_smartmuv.py dist smartmuv.egg-info -test_env \ No newline at end of file +test_env +output_data \ No newline at end of file diff --git a/FUNDING.json b/FUNDING.json deleted file mode 100644 index bf1db94..0000000 --- a/FUNDING.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "drips": { - "ethereum": { - "ownedBy": "0x61B3A112665968d2D286a473E7A783749F7aB69f" - } - } - } - \ No newline at end of file diff --git a/src/ast_parsing/ast_parser.py b/src/ast_parsing/ast_parser.py index da4323e..88aa75f 100644 --- a/src/ast_parsing/ast_parser.py +++ b/src/ast_parsing/ast_parser.py @@ -99,7 +99,7 @@ def check_if_stmt(statement, definition, functions, variables, mappings): return functions, variables, mappings -def parse_ast(children, cont_name): +def parse_ast(children): all_contracts_details = {} variables = [] state_vars = [] diff --git a/try_smartmuv.py b/try_smartmuv.py index 1b312dd..60c355e 100644 --- a/try_smartmuv.py +++ b/try_smartmuv.py @@ -40,17 +40,30 @@ def read_source_code(contract_name, input_dir): for slot in slots_details: print(slot) + # save to json file + with open(f"tests/output_data/{contract_name}_slot_details.json", "w") as f: + json.dump(slots_details, f) + + elif option == "2": results, slots_details, slots_and_data, block_number = extract_regular_variables( contract_name, source_code, cont_addr, compiler_version, "mainnet") print("\nDetails of Extracted Regular Variables are:\n") for var in results: print(var) - + + # save to json file + with open(f"tests/output_data/{contract_name}_elementary_data.json", "w") as f: + json.dump(results, f) + elif option == "3": contract_state, _, variables_slot_results, slots_and_data, key_analysis_result, block_number = extract_contract_state( contract_name, source_code, cont_addr, compiler_version, "mainnet") print("\nDetails of Extracted Contract State:\n") for var in contract_state: print(var) + + # save to json file + with open(f"tests/output_data/{contract_name}_complete_data.json", "w") as f: + json.dump(contract_state, f) \ No newline at end of file From 532d58daad92218a0e5119ad19f9bc13c68b673b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 20 Nov 2025 01:23:44 +0000 Subject: [PATCH 2/2] Initial plan