Skip to content

Commit

Permalink
Vanilla test in solidifi tx-origin benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
merendamattia committed Jan 24, 2025
1 parent 00d1e10 commit cd9a9b1
Show file tree
Hide file tree
Showing 52 changed files with 18 additions and 1,558 deletions.
8 changes: 5 additions & 3 deletions scripts/python/journal/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,11 @@ def extract_and_save_bytecode(bytecode_dir, json_dir, is_ethersolve=False, file_
# TX-ORIGIN
# extract_solidity_versions('./tx-origin-solidifi/source-code',
# './tx-origin-solidifi/source-code/versions.csv')
compile_solidity_sources_with_different_version('./tx-origin-solidifi/source-code',
'./tx-origin-solidifi/json',
'./tx-origin-solidifi/source-code/versions.csv')
# compile_solidity_sources_with_different_version('./tx-origin-solidifi/source-code',
# './tx-origin-solidifi/json',
# './tx-origin-solidifi/source-code/versions.csv')
compile_solidity_sources('./tx-origin-solidifi/source-code',
'./tx-origin-solidifi/json')

if args.longest_bytecode:
# EVMLiSA
Expand Down
18 changes: 13 additions & 5 deletions scripts/python/journal/run-benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,8 +593,8 @@ def calculate_f_measure(precision, recall):

args = parser.parse_args()

if not args.no_analysis:
build_evmlisa()
# if not args.no_analysis:
# build_evmlisa()

if args.tx_origin:
if args.solidifi:
Expand All @@ -603,13 +603,21 @@ def calculate_f_measure(precision, recall):
'results_dir': './tx-origin-solidifi/results',
'result_evmlisa_dir': './tx-origin-solidifi/results/evmlisa',
'type': 'txorigin'})
evmlisa_vanilla_thread = threading.Thread(target=evmlisa, kwargs={'bytecode_dir': './vanilla-solidifi/bytecode/evmlisa',
'results_dir': './vanilla-solidifi/results',
'result_evmlisa_dir': './vanilla-solidifi/results/evmlisa',
'type': 'txorigin'})

evmlisa_vanilla_thread.start()
evmlisa_thread.start()
evmlisa_thread.join()
evmlisa_vanilla_thread.join()

check_sound_analysis_evmlisa('./tx-origin-solidifi/results/evmlisa')

results_evmlisa = get_results_evmlisa('./tx-origin-solidifi/results/evmlisa', 'evmlisa-buggy-tx-origin-solidifi')

results_solidifi = get_results_solidifi('./SolidiFI-buggy-contracts/tx.origin', 'tx-origin', 'solidify')
results_evmlisa = subtract_dicts(get_results_evmlisa('./tx-origin-solidifi/results/evmlisa', 'evmlisa-buggy-solidifi'),
get_results_evmlisa('./vanilla-solidifi/results/evmlisa', 'evmlisa-vanilla-solidifi'))

# Precision
evmlisa_precision = calculate_precision(results_evmlisa, results_solidifi)
Expand All @@ -625,7 +633,7 @@ def calculate_f_measure(precision, recall):
# Plot results
plot_results(results_evmlisa,
results_solidifi,
'solidifi tx-origin')
'solidifi_tx-origin')


if args.reentrancy:
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit cd9a9b1

Please sign in to comment.