Skip to content
This repository has been archived by the owner on May 26, 2023. It is now read-only.

Commit

Permalink
Update input_helper.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Mayur1496 committed Sep 15, 2020
1 parent e86c3a1 commit e809206
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions oyente/input_helper.py
Expand Up @@ -108,10 +108,13 @@ def _get_compiled_contracts(self):

return self.compiled_contracts

def _extract_bin_obj(self, com: CryticCompile):
return [(com.contracts_filenames[name].used + ':' + name, com.bytecode_runtime(name)) for name in com.contracts_names if com.bytecode_runtime(name)]

def _compile_solidity(self):
try:
com = CryticCompile(self.source, solc_remaps=self.remap)
contracts = [(com.contracts_filenames[name].absolute + ':' + name, com.bytecode_runtime(name)) for name in com.contracts_names if com.bytecode_runtime(name)]
contracts = self._extract_bin_obj(com)

libs = {lib for _, bytecode in contracts for lib in re.findall(r"_+(.*?)_+", bytecode) if lib}
if libs:
Expand Down Expand Up @@ -168,9 +171,8 @@ def _link_libraries(self, filename, libs):
option += " --libraries %s:%s" % (lib, lib_address)

com = CryticCompile(target=self.source, solc_args=option[1:], solc_remaps=self.remap)
contracts = [(com.contracts_filenames[name].absolute + ':' + name, com.bytecode_runtime(name)) for name in com.contracts_names if com.bytecode_runtime(name)]

return contracts

return self._extract_bin_obj(com)

def _prepare_disasm_files_for_analysis(self, contracts):
for contract, bytecode in contracts:
Expand Down

0 comments on commit e809206

Please sign in to comment.