Skip to content

Conversation

sidarth16
Copy link
Contributor

@sidarth16 sidarth16 commented Jul 9, 2025

Fix: Deduplicate functions in get_msg_sender_checks to avoid repeated msg.sender condition nodes (#2747)

✅ Applied Fix (safe & immediate):

  • Wraps the combined function list in a set() to deduplicate Function instances.
  • Ensures complete analysis while avoiding repeated conditions in output.

⚠️ Alternative (riskier but potentially optimal):

  • modifier functions are being included both via internal calls and explicitly in function.modifiers.
  • Removing explicit function.modifiers in all_functions could also prevent duplicates,
    but risks missing edge cases where a modifier is attached but not present in internal calls.

The current fix ensures correctness, safety, and consistent analysis output.

…oid repeated msg.sender conditions

Fix: Deduplicate functions in get_msg_sender_checks to avoid repeated msg.sender conditions (crytic#2747)

This resolves an issue where the `authorization` printer would output duplicate msg.sender checks due to modifiers being included both in `function.all_internal_calls()` and explicitly in `function.modifiers`.

✅ Applied Fix (safe):
- Wraps the combined function list in a `set()` to deduplicate `Function` instances.
- Ensures complete analysis while avoiding repeated conditions in output.
@sidarth16 sidarth16 requested a review from smonicas as a code owner July 9, 2025 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant