Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detector for encodeWithSelector wrong argument count/ mismatched types #1292

Open
wants to merge 20 commits into
base: dev
Choose a base branch
from

Conversation

feliam
Copy link
Contributor

@feliam feliam commented Jul 17, 2022

The Solc Compiler does not help checking that the arguments used in when building the transaction calldata with encodeWhitSelector matches the target function. This detector look for miss-matching encodeWithSelector arguments and target function arguments.

@lgtm-com
Copy link

lgtm-com bot commented Jul 17, 2022

This pull request introduces 2 alerts when merging ecd8adb into d0a4f55 - view on LGTM.com

new alerts:

  • 2 for Unused import

@feliam feliam requested a review from 0xalpharush July 17, 2022 22:47
@lgtm-com
Copy link

lgtm-com bot commented Jul 17, 2022

This pull request introduces 1 alert when merging 7ce0a71 into d0a4f55 - view on LGTM.com

new alerts:

  • 1 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Jul 17, 2022

This pull request introduces 1 alert when merging 5fbbef5 into d0a4f55 - view on LGTM.com

new alerts:

  • 1 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Jul 21, 2022

This pull request introduces 1 alert when merging 15d79b4 into d0a4f55 - view on LGTM.com

new alerts:

  • 1 for Unused import

@0xalpharush 0xalpharush added this to the 0.9.4 milestone Apr 4, 2023
@0xalpharush 0xalpharush removed this from the 0.9.4 milestone Jun 9, 2023
@0xalpharush
Copy link
Contributor

Can we add a test case that uses an array type as an argument please?

@0xalpharush 0xalpharush changed the title Detector for encodeWithSelector wrong argument count :jetski: Detector for encodeWithSelector wrong argument count/ mismatched types Jun 22, 2023
else:
return result

_, _, argument_types = func_ids[selector.value]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This causes an error on 0x9078f5996746f134f761b93939b0fd595f68845e. We should return early if we cannot determine which function the selector map backs to until we integrate a selector db

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants