crytic-compile icon indicating copy to clipboard operation
crytic-compile copied to clipboard

Add support for solidity standard json-input format on BSC chain

Open a4dyn opened this issue 3 years ago • 0 comments

Right now we are not able to compile any project that uses solidity standard json-input format on BSC chain Example projects are: bsc:0xd90A8878a2277879600AA2cba0CADC7E1a11354D and bsc:0x141ccd27bbca7524dc6b7eea1eb41e097d7e832d The output error is shown below:

Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/crytic_compile-0.2.0-py3.9.egg/crytic_compile/platform/solc.py", line 501, in _run_solc ret: Dict = json.loads(stdout) File "/usr/local/Cellar/[email protected]/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/init.py", line 346, in loads return _default_decoder.decode(s) File "/usr/local/Cellar/[email protected]/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/local/Cellar/[email protected]/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/slither_analyzer-0.8.0-py3.9.egg/slither/main.py", line 732, in main_impl ) = process_all(filename, args, detector_classes, printer_classes) File "/usr/local/lib/python3.9/site-packages/slither_analyzer-0.8.0-py3.9.egg/slither/main.py", line 72, in process_all compilations = compile_all(target, **vars(args)) File "/usr/local/lib/python3.9/site-packages/crytic_compile-0.2.0-py3.9.egg/crytic_compile/crytic_compile.py", line 628, in compile_all compilations.append(CryticCompile(target, **kwargs)) File "/usr/local/lib/python3.9/site-packages/crytic_compile-0.2.0-py3.9.egg/crytic_compile/crytic_compile.py", line 116, in init self._compile(**kwargs) File "/usr/local/lib/python3.9/site-packages/crytic_compile-0.2.0-py3.9.egg/crytic_compile/crytic_compile.py", line 539, in _compile self._platform.compile(self, **kwargs) File "/usr/local/lib/python3.9/site-packages/crytic_compile-0.2.0-py3.9.egg/crytic_compile/platform/etherscan.py", line 317, in compile targets_json = _run_solc( File "/usr/local/lib/python3.9/site-packages/crytic_compile-0.2.0-py3.9.egg/crytic_compile/platform/solc.py", line 505, in _run_solc raise InvalidCompilation(f"Invalid solc compilation {stderr}") crytic_compile.platform.exceptions.InvalidCompilation: Invalid solc compilation ERROR:root:None ERROR:root:Error in bsc:0xd90A8878a2277879600AA2cba0CADC7E1a11354D ERROR:root:Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/crytic_compile-0.2.0-py3.9.egg/crytic_compile/platform/solc.py", line 501, in _run_solc ret: Dict = json.loads(stdout) File "/usr/local/Cellar/[email protected]/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/init.py", line 346, in loads return _default_decoder.decode(s) File "/usr/local/Cellar/[email protected]/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/local/Cellar/[email protected]/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/slither_analyzer-0.8.0-py3.9.egg/slither/main.py", line 732, in main_impl ) = process_all(filename, args, detector_classes, printer_classes) File "/usr/local/lib/python3.9/site-packages/slither_analyzer-0.8.0-py3.9.egg/slither/main.py", line 72, in process_all compilations = compile_all(target, **vars(args)) File "/usr/local/lib/python3.9/site-packages/crytic_compile-0.2.0-py3.9.egg/crytic_compile/crytic_compile.py", line 628, in compile_all compilations.append(CryticCompile(target, **kwargs)) File "/usr/local/lib/python3.9/site-packages/crytic_compile-0.2.0-py3.9.egg/crytic_compile/crytic_compile.py", line 116, in init self._compile(**kwargs) File "/usr/local/lib/python3.9/site-packages/crytic_compile-0.2.0-py3.9.egg/crytic_compile/crytic_compile.py", line 539, in _compile self._platform.compile(self, **kwargs) File "/usr/local/lib/python3.9/site-packages/crytic_compile-0.2.0-py3.9.egg/crytic_compile/platform/etherscan.py", line 317, in compile targets_json = _run_solc( File "/usr/local/lib/python3.9/site-packages/crytic_compile-0.2.0-py3.9.egg/crytic_compile/platform/solc.py", line 505, in _run_solc raise InvalidCompilation(f"Invalid solc compilation {stderr}") crytic_compile.platform.exceptions.InvalidCompilation: Invalid solc compilation

Would you like to fix this and add support to this format? Thanks!

a4dyn avatar Aug 17 '21 10:08 a4dyn