eth-sri / securify2

Securify v2.0
Apache License 2.0
579 stars 133 forks source link

Error in analyzying smart contract #10

Open mstad opened 4 years ago

mstad commented 4 years ago

Hi, I am trying to work on a benchmark related to different analyzers. I try to scan a contract (0x7.sol) and I receive some errors (0x7 0x7_solidity.txt

.txt). Which is the main problem and How can I solve it? Thanks 0x7.txt

YannisSach commented 4 years ago

It seems like a bug in the compiler which is caused by the new line character in line 737 of 0x7_solidity.txt

"\x19Ethereum Signed Message:\n32"

I will try to fix it as soon as possible. In the meantime, you can delete the \n character or replace the string entirely.

Edit: I pushed a fix to the develop branch

mstad commented 4 years ago

I have cloned it and built the docker container. To use the compiler release 0.5.17, how should I do it?

mstad commented 4 years ago

Hi, I tries to use the master branch to analyze some contract... and I receive some errors. One of them is analyzying the 0x36.sol.txt file and I received 0x36.txt results. Do you think that I have to reinstall something or do you already know the reason? Thanks so much 0x36.sol.txt 0x36.txt

YannisSach commented 4 years ago

This was caused by the usage of staticcall. I pushed a fix to the develop branch.

mstad commented 3 years ago

Hi, I tried to use Securify with some other files receving errors processing attached files (0xf41.sol, 0xdb.sol,0x27.sol) 0x41.txt 0x27.txt 0xf41.txt

I am using solc 0.5.15, python 3.7. I do the following steps: To use the develop branch, to run the new one: $ git clone -b develop https://github.com/eth-sri/securify2.git /home/mirkostad/Programmi/Tools/securify/ I follow thw insatructions $ virtualenv --python=/usr/bin/python3.7 venv $ source venv/bin/activate To go in the home directory of project $ cd /home/mirkostad/Programmi/Tools/securify/ $ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:pwd $ pip install --upgrade pip $ pip install -r requirements.txt $ pip install -e .

Then I launched: $ securify /home/mirkostad/Programmi/smart-contracts/Mutations/Original/0xf41.sol receiving... File "/home/mirkostad/Programmi/Tools/securify/venv/bin/securify", line 33, in sys.exit(load_entry_point('securify', 'console_scripts', 'securify')()) File "/home/mirkostad/Programmi/Tools/securify/securify/main.py", line 285, in main matches.extend(pattern.find_matches()) File "/home/mirkostad/Programmi/Tools/securify/securify/analyses/patterns/static/static_analysis_patterns.py", line 73, in find_matches static = analysis_context.static_analysis File "/home/mirkostad/Programmi/Tools/securify/securify/analyses/analysis.py", line 89, in static_analysis self._static = self.config.static_analysis(self) File "/home/mirkostad/Programmi/Tools/securify/securify/main.py", line 263, in static_analysis=lambda t: static_analysis.analyze_cfg(t.cfg, souffle_config), File "/home/mirkostad/Programmi/Tools/securify/securify/staticanalysis/static_analysis.py", line 124, in analyze_cfg souffle_kwargs=kw_args_souffle) File "/home/mirkostad/Programmi/Tools/securify/securify/staticanalysis/souffle/souffle.py", line 62, in run_souffle (souffle_kwargs or {})) File "/home/mirkostad/Programmi/Tools/securify/securify/staticanalysis/souffle/wrapper.py", line 141, in souffle_wrapper stderr_data=codecs.decode(stderrdata), securify.staticanalysis.souffle.exceptions.SouffleError: Error during souffle execution:

Error loading data: Cannot open fact file builtinFunction.facts

--------> --------> I still have errors with 0x4.sol ... following the output console: Traceback (most recent call last): File "/home/mirkostad/Programmi/Tools/securify/venv/bin/securify", line 33, in sys.exit(load_entry_point('securify', 'console_scripts', 'securify')()) File "/home/mirkostad/Programmi/Tools/securify/securify/main.py", line 285, in main matches.extend(pattern.find_matches()) File "/home/mirkostad/Programmi/Tools/securify/securify/analyses/patterns/static/static_analysis_patterns.py", line 73, in find_matches static = analysis_context.static_analysis File "/home/mirkostad/Programmi/Tools/securify/securify/analyses/analysis.py", line 89, in static_analysis self._static = self.config.static_analysis(self) File "/home/mirkostad/Programmi/Tools/securify/securify/main.py", line 263, in static_analysis=lambda t: static_analysis.analyze_cfg(t.cfg, souffle_config), File "/home/mirkostad/Programmi/Tools/securify/securify/staticanalysis/static_analysis.py", line 124, in analyze_cfg souffle_kwargs=kw_args_souffle) File "/home/mirkostad/Programmi/Tools/securify/securify/staticanalysis/souffle/souffle.py", line 62, in run_souffle (souffle_kwargs or {})) File "/home/mirkostad/Programmi/Tools/securify/securify/staticanalysis/souffle/wrapper.py", line 141, in souffle_wrapper stderr_data=codecs.decode(stderrdata), securify.staticanalysis.souffle.exceptions.SouffleError: Error during souffle execution:

Error loading data: Cannot open fact file arrayPush.facts

Error loading data: Cannot open fact file builtinFunction.facts