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
With some debugging on when it fails, the faulty line is the SentMessage member here
if (selector != SentMessage.selector) revertEventPayloadNotSentMessage();
Looking at when the assertion fails, it seems like adding Event as a a valid instance of variable_left for Member fixes this bug
Code example to reproduce the issue:
if (selector != SentMessage.selector) revert EventPayloadNotSentMessage();
Version:
0.10.4
Relevant log output:
Failed to generate IR for L2ToL2CrossDomainMessenger.relayMessage. Please open an issue https://github.com/crytic/slither/issues.
L2ToL2CrossDomainMessenger.relayMessage (src/L2/L2ToL2CrossDomainMessenger.sol#132-182):
_id.origin != Predeploys.L2_TO_L2_CROSS_DOMAIN_MESSENGER
revert IdentifierOriginNotL2ToL2CrossDomainMessenger()()
CrossL2Inbox(Predeploys.CROSS_L2_INBOX).validateMessage(_id,keccak256(bytes)(_sentMessage))
(selector,_destination,_target,_nonce) = abi.decode(_sentMessage,(bytes32,uint256,address,uint256))
selector != SentMessage.selector
revert EventPayloadNotSentMessage()()
_destination != block.chainid
revert MessageDestinationNotRelayChain()()
_target == Predeploys.CROSS_L2_INBOX
revert MessageTargetCrossL2Inbox()()
_target == Predeploys.L2_TO_L2_CROSS_DOMAIN_MESSENGER
revert MessageTargetL2ToL2CrossDomainMessenger()()
(_sender,_message) = abi.decode(_sentMessage,(address,bytes))
_source = _id.chainId
messageHash = keccak256(bytes)(abi.encode(_destination,_source,_nonce,_sender,_target,_message))
successfulMessages[messageHash]
revert MessageAlreadyRelayed()()
_storeMessageMetadata(_source,_sender)
success = SafeCall.call(_target,msg.value,_message)
success
successfulMessages[messageHash] = true
RelayedMessage(_source,_nonce,messageHash)
FailedRelayedMessage(_source,_nonce,messageHash)
_storeMessageMetadata(0,address(0))
nonReentrant()
Traceback (most recent call last):
File "/opt/slither/bin/slither", line 8, in<module>sys.exit(main())
File "/opt/slither/lib/python3.9/site-packages/slither/__main__.py", line 776, in main
main_impl(all_detector_classes=detectors, all_printer_classes=printers)
File "/opt/slither/lib/python3.9/site-packages/slither/__main__.py", line 882, in main_impl
) = process_all(filename, args, detector_classes, printer_classes)
File "/opt/slither/lib/python3.9/site-packages/slither/__main__.py", line 107, in process_all
) = process_single(compilation, args, detector_classes, printer_classes)
File "/opt/slither/lib/python3.9/site-packages/slither/__main__.py", line 80, in process_single
slither = Slither(target, ast_format=ast, **vars(args))
File "/opt/slither/lib/python3.9/site-packages/slither/slither.py", line 202, in __init__
self._init_parsing_and_analyses(kwargs.get("skip_analyze", False))
File "/opt/slither/lib/python3.9/site-packages/slither/slither.py", line 221, in _init_parsing_and_analyses
raise e
File "/opt/slither/lib/python3.9/site-packages/slither/slither.py", line 217, in _init_parsing_and_analyses
parser.analyze_contracts()
File "/opt/slither/lib/python3.9/site-packages/slither/solc_parsing/slither_compilation_unit_solc.py", line 593, in analyze_contracts
self._convert_to_slithir()
File "/opt/slither/lib/python3.9/site-packages/slither/solc_parsing/slither_compilation_unit_solc.py", line 827, in _convert_to_slithir
raise e
File "/opt/slither/lib/python3.9/site-packages/slither/solc_parsing/slither_compilation_unit_solc.py", line 812, in _convert_to_slithir
func.generate_slithir_and_analyze()
File "/opt/slither/lib/python3.9/site-packages/slither/core/declarations/function.py", line 1827, in generate_slithir_and_analyze
node.slithir_generation()
File "/opt/slither/lib/python3.9/site-packages/slither/core/cfg/node.py", line 717, in slithir_generation
self._irs = convert_expression(expression, self) # type:ignore
File "/opt/slither/lib/python3.9/site-packages/slither/slithir/convert.py", line 115, in convert_expression
visitor = ExpressionToSlithIR(expression, node)
File "/opt/slither/lib/python3.9/site-packages/slither/visitors/slithir/expression_to_slithir.py", line 174, in __init__
self._visit_expression(self.expression)
File "/opt/slither/lib/python3.9/site-packages/slither/visitors/expression/expression.py", line 76, in _visit_expression
visitor(expression)
File "/opt/slither/lib/python3.9/site-packages/slither/visitors/expression/expression.py", line 88, in _visit_binary_operation
self._visit_expression(expression.expression_right)
File "/opt/slither/lib/python3.9/site-packages/slither/visitors/expression/expression.py", line 78, in _visit_expression
self._post_visit(expression)
File "/opt/slither/lib/python3.9/site-packages/slither/visitors/expression/expression.py", line 276, in _post_visit
self._post_member_access(expression)
File "/opt/slither/lib/python3.9/site-packages/slither/visitors/slithir/expression_to_slithir.py", line 612, in _post_member_access
member = Member(expr, Constant(expression.member_name), val_ref)
File "/opt/slither/lib/python3.9/site-packages/slither/slithir/operations/member.py", line 34, in __init__
assert is_valid_rvalue(variable_left) or isinstance(
AssertionError
The text was updated successfully, but these errors were encountered:
Describe the issue:
slither checks fails due to an error in this PR: ethereum-optimism/optimism#11592
With some debugging on when it fails, the faulty line is the
SentMessage
member hereLooking at when the assertion fails, it seems like adding
Event
as a a valid instance ofvariable_left
for Member fixes this bugCode example to reproduce the issue:
if (selector != SentMessage.selector) revert EventPayloadNotSentMessage();
Version:
0.10.4
Relevant log output:
The text was updated successfully, but these errors were encountered: