Compiler error: Stack too deep when compiling inline assembly: Variable value0 is 2 slot(s) too deep inside the stack. #2268
Unanswered
Jay-Sojitra
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Hi! Use If you want to use a standalone contract file, you may need to enable solc compiler optimizations or refactor your code so that it builds, right now it does not:
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to find bugs in my contract so if I try on one contract named maxi then it is giving error like this =>
PS D:\Ethereum\Zeru_Internship\core-protocol> slither .\contracts\defiStrategies\strategies\maxi\Maxi.sol
'solc --version' running
'solc .\contracts\defiStrategies\strategies\maxi\Maxi.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes,compact-format --allow-paths .,D:\Ethereum\Zeru_Internship\core-protocol\contracts\defiStrategies\strategies\maxi' running
Compilation warnings/errors on .\contracts\defiStrategies\strategies\maxi\Maxi.sol:
Compiler error: Stack too deep when compiling inline assembly: Variable value0 is 2 slot(s) too deep inside the stack.
Traceback (most recent call last):
File "C:\Users\Jay\AppData\Local\Programs\Python\Python311\Lib\site-packages\crytic_compile\platform\solc.py", line 582, in run_solc
ret: Dict = json.loads(stdout)
^^^^^^^^^^^^^^^^^^
File "C:\Users\Jay\AppData\Local\Programs\Python\Python311\Lib\json_init.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Jay\AppData\Local\Programs\Python\Python311\Lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Jay\AppData\Local\Programs\Python\Python311\Lib\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 "", line 198, in run_module_as_main
File "", line 88, in run_code
File "C:\Users\Jay\AppData\Local\Programs\Python\Python311\Scripts\slither.exe_main.py", line 7, in
File "C:\Users\Jay\AppData\Local\Programs\Python\Python311\Lib\site-packages\slither_main.py", line 727, in main
main_impl(all_detector_classes=detectors, all_printer_classes=printers)
File "C:\Users\Jay\AppData\Local\Programs\Python\Python311\Lib\site-packages\slither_main_.py", line 833, in main_impl
) = process_all(filename, args, detector_classes, printer_classes)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Jay\AppData\Local\Programs\Python\Python311\Lib\site-packages\slither_main_.py", line 96, in process_all
compilations = compile_all(target, **vars(args))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Jay\AppData\Local\Programs\Python\Python311\Lib\site-packages\crytic_compile\crytic_compile.py", line 718, in compile_all
compilations.append(CryticCompile(target, **kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Jay\AppData\Local\Programs\Python\Python311\Lib\site-packages\crytic_compile\crytic_compile.py", line 207, in init
self._compile(**kwargs)
File "C:\Users\Jay\AppData\Local\Programs\Python\Python311\Lib\site-packages\crytic_compile\crytic_compile.py", line 629, in _compile
self._platform.compile(self, **kwargs)
File "C:\Users\Jay\AppData\Local\Programs\Python\Python311\Lib\site-packages\crytic_compile\platform\solc.py", line 151, in compile
targets_json = _get_targets_json(compilation_unit, self._target, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Jay\AppData\Local\Programs\Python\Python311\Lib\site-packages\crytic_compile\platform\solc.py", line 280, in _get_targets_json
return _run_solc(
^^^^^^^^^^
File "C:\Users\Jay\AppData\Local\Programs\Python\Python311\Lib\site-packages\crytic_compile\platform\solc.py", line 586, in _run_solc
raise InvalidCompilation(f"Invalid solc compilation {stderr}")
crytic_compile.platform.exceptions.InvalidCompilation: Invalid solc compilation Compiler error: Stack too deep when compiling inline assembly: Variable value0 is 2 slot(s) too deep inside the stack.
PS D:\Ethereum\Zeru_Internship\core-protocol>
=> and also I have checked with npx hardhat compile then all contracts are compiling without any error.
so what is the solution of this problem?
Beta Was this translation helpful? Give feedback.
All reactions