You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to run Slither on https://github.com/xenoliss/keyspace-v3 I get an error on the SlithIR generation. I believe it might be due to the code instantiating a function based on the results of the ternary.
Code example to reproduce the issue:
// Keystore.sol// breaks SlithIR generation
(uint256currentConfigNonce, function (ConfigLib.Config calldata) returns (bytes32) applyConfigInternal) = block
.chainid == masterChainId
? (_sMaster().configNonce, _applyMasterConfig)
: (_sReplica().currentConfigNonce, _applyReplicaConfig);
// ternary rewritten as if else does not break SlithIR generationuint256 currentConfigNonce;
function (ConfigLib.Config calldata) returns (bytes32) applyConfigInternal;
if (block.chainid== masterChainId) {
currentConfigNonce =_sMaster().configNonce;
applyConfigInternal= _applyMasterConfig;
} else {
currentConfigNonce =_sReplica().currentConfigNonce;
applyConfigInternal= _applyReplicaConfig;
}
Version:
0.10.2
Relevant log output:
➜ contracts git:(main) ✗ slither .'forge clean' running (wd: /Users/eli/Downloads/keyspace-v3/contracts)
'forge config --json' running
'forge build --build-info --skip */test/** */script/** --force' running (wd: /Users/eli/Downloads/keyspace-v3/contracts)
ERROR:ContractSolcParsing:Missing functionVariable not found: require(bool,error) (context ConfigLib src/libs/ConfigLib.sol#4-60 (1 - 2))
ERROR:ContractSolcParsing:Missing functionVariable not found: require(bool,error) (context EIP4788Lib src/libs/l1-state-root/EIP4788Lib.sol#6-178 (1 - 2))
ERROR:ContractSolcParsing:Missing functionVariable not found: require(bool,error) (context L1BlockLib src/libs/l1-state-root/L1BlockLib.sol#7-100 (1 - 2))
ERROR:ContractSolcParsing:Missing modifier Variable not found: require(bool,error) (context Keystore src/Keystore.sol#33-457 (1 - 2))
ERROR:ContractSolcParsing:Missing functionVariable not found: require(bool,error) (context Keystore src/Keystore.sol#33-457 (1 - 2))
ERROR:ContractSolcParsing:Missing modifier Variable not found: require(bool,error) (context OPStackKeystore src/chains/OPStackKeystore.sol#27-142 (1 - 2))
ERROR:ContractSolcParsing:Missing functionVariable not found: require(bool,error) (context OPStackKeystore src/chains/OPStackKeystore.sol#27-142 (1 - 2))
ERROR:ContractSolcParsing:Missing functionVariable not found: require(bool,error) (context TransientUUPSUpgradeable src/examples/TransientUUPSUpgradeable.sol#6-41 (1 - 2))
ERROR:ContractSolcParsing:Missing modifier Variable not found: require(bool,error) (context MultiOwnableWallet src/examples/MultiOwnableWallet.opstack.sol#73-354 (1 - 2))
ERROR:ContractSolcParsing:Missing functionVariable not found: require(bool,error) (context MultiOwnableWallet src/examples/MultiOwnableWallet.opstack.sol#73-354 (1 - 2))
ERROR:SlitherSolcParsing:
Failed to generate IR for Keystore.setConfig. Please open an issue https://github.com/crytic/slither/issues.
Keystore.setConfig (src/Keystore.sol#135-181):
(currentConfigNonce,applyConfigInternal) = if block.chainid == masterChainId then (_sMaster().configNonce,_applyMasterConfig) else (_sReplica().currentConfigNonce,_applyReplicaConfig)
Traceback (most recent call last):
File "/Users/eli/.pyenv/versions/3.12.2/lib/python3.12/site-packages/slither/__main__.py", line 859, in main_impl
) = process_all(filename, args, detector_classes, printer_classes)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/eli/.pyenv/versions/3.12.2/lib/python3.12/site-packages/slither/__main__.py", line 107, in process_all
) = process_single(compilation, args, detector_classes, printer_classes)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/eli/.pyenv/versions/3.12.2/lib/python3.12/site-packages/slither/__main__.py", line 80, in process_single
slither = Slither(target, ast_format=ast, **vars(args))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/eli/.pyenv/versions/3.12.2/lib/python3.12/site-packages/slither/slither.py", line 199, in __init__
self._init_parsing_and_analyses(kwargs.get("skip_analyze", False))
File "/Users/eli/.pyenv/versions/3.12.2/lib/python3.12/site-packages/slither/slither.py", line 219, in _init_parsing_and_analyses
raise e
File "/Users/eli/.pyenv/versions/3.12.2/lib/python3.12/site-packages/slither/slither.py", line 215, in _init_parsing_and_analyses
parser.analyze_contracts()
File "/Users/eli/.pyenv/versions/3.12.2/lib/python3.12/site-packages/slither/solc_parsing/slither_compilation_unit_solc.py", line 593, in analyze_contracts
self._convert_to_slithir()
File "/Users/eli/.pyenv/versions/3.12.2/lib/python3.12/site-packages/slither/solc_parsing/slither_compilation_unit_solc.py", line 827, in _convert_to_slithir
raise e
File "/Users/eli/.pyenv/versions/3.12.2/lib/python3.12/site-packages/slither/solc_parsing/slither_compilation_unit_solc.py", line 812, in _convert_to_slithir
func.generate_slithir_and_analyze()
File "/Users/eli/.pyenv/versions/3.12.2/lib/python3.12/site-packages/slither/core/declarations/function.py", line 1830, in generate_slithir_and_analyze
node.slithir_generation()
File "/Users/eli/.pyenv/versions/3.12.2/lib/python3.12/site-packages/slither/core/cfg/node.py", line 717, in slithir_generation
self._irs = convert_expression(expression, self) # type:ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/eli/.pyenv/versions/3.12.2/lib/python3.12/site-packages/slither/slithir/convert.py", line 115, in convert_expression
visitor = ExpressionToSlithIR(expression, node)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/eli/.pyenv/versions/3.12.2/lib/python3.12/site-packages/slither/visitors/slithir/expression_to_slithir.py", line 174, in __init__
self._visit_expression(self.expression)
File "/Users/eli/.pyenv/versions/3.12.2/lib/python3.12/site-packages/slither/visitors/expression/expression.py", line 43, in _visit_expression
self._visit_assignement_operation(expression)
File "/Users/eli/.pyenv/versions/3.12.2/lib/python3.12/site-packages/slither/visitors/expression/expression.py", line 99, in _visit_assignement_operation
self._visit_expression(expression.expression_right)
File "/Users/eli/.pyenv/versions/3.12.2/lib/python3.12/site-packages/slither/visitors/expression/expression.py", line 93, in _visit_expression
self._post_visit(expression)
File "/Users/eli/.pyenv/versions/3.12.2/lib/python3.12/site-packages/slither/visitors/expression/expression.py", line 276, in _post_visit
self._post_conditional_expression(expression)
File "/Users/eli/.pyenv/versions/3.12.2/lib/python3.12/site-packages/slither/visitors/slithir/expression_to_slithir.py", line 435, in _post_conditional_expression
raise SlithIRError(f"Ternary operator are not convertible to SlithIR {expression}")
slither.slithir.exceptions.SlithIRError: Ternary operator are not convertible to SlithIR if block.chainid == masterChainId then (_sMaster().configNonce,_applyMasterConfig) else (_sReplica().currentConfigNonce,_applyReplicaConfig)
ERROR:root:Error:
ERROR:root:Ternary operator are not convertible to SlithIR if block.chainid == masterChainId then (_sMaster().configNonce,_applyMasterConfig) else (_sReplica().currentConfigNonce,_applyReplicaConfig)
ERROR:root:Please report an issue to https://github.com/crytic/slither/issues
The text was updated successfully, but these errors were encountered:
Hi. This issue seems to be fixed in slither's dev branch however your codebase is affected by #2610. To run slither you have to install it from the dev branch and rename the authorizationProof argument to validationProof.
Describe the issue:
When attempting to run Slither on https://github.com/xenoliss/keyspace-v3 I get an error on the SlithIR generation. I believe it might be due to the code instantiating a function based on the results of the ternary.
Code example to reproduce the issue:
Version:
0.10.2
Relevant log output:
The text was updated successfully, but these errors were encountered: