Fix edge case w.r.t solc versions (#1812)

pull/1814/head
Nikhil Parasaram 1 year ago committed by GitHub
parent 91c4ddad2e
commit 93965debbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      mythril/mythril/mythril_disassembler.py

@ -232,6 +232,17 @@ class MythrilDisassembler:
return address, contracts
def check_run_integer_module(self, source_file):
with open(source_file, "r") as f:
for line in f:
if "unchecked" in line:
return True
if self.solc_version is None:
# Runs the version installed in the system (likely 0.8.0+)
# Post 0.8.0 versions automatically add assertions to sanity check arithmetic
return False
# Strip leading 'v' from version if it's there
normalized_version = self.solc_version.lstrip("v")
@ -242,11 +253,6 @@ class MythrilDisassembler:
):
return True
with open(source_file, "r") as f:
for line in f:
if "unchecked" in line:
return True
return False
def load_from_solidity(

Loading…
Cancel
Save