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

update isContract checks #80

Merged
merged 2 commits into from
Feb 10, 2024

Conversation

livingrockrises
Copy link
Collaborator

Summary

Comments in draft report

In a few functions, if an address is a contract, the transaction is reverted.
This behavior can be seen in the depositFor(), setSigner(), and setFeeCollector() functions.

The isContract() function uses extcodesize, and returns true if the address has any code in it. However, this code is bypassable by a contract that performs all its’ operations in the constructor and does not contain any runtime code.

After taking a look at the Entrypoint contract and how it handles withdrawing funds to these addresses, we were unable to find any security impact from allowing these addresses to be con- tracts. Therefore, we are marking this finding as informational in impact.
However, since this means the check is somewhat unnecessary, we note that it does increase gas usage.

Recommendations

Remove the isContract() checks unless there is a valid reason for them to be there.

Change Type

  • Bug Fix
  • Refactor
  • New Feature
  • Breaking Change
  • Documentation Update
  • Performance Improvement
  • Other

Checklist

  • My code follows this project's style guidelines
  • I've reviewed my own code
  • I've added comments for any hard-to-understand areas
  • I've updated the documentation if necessary
  • My changes generate no new warnings
  • I've added tests that prove my fix is effective or my feature works
  • All unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Additional Information

Branch Naming

Copy link

linear bot commented Feb 4, 2024

@livingrockrises livingrockrises merged commit 4fd1993 into develop Feb 10, 2024
3 checks passed
@livingrockrises livingrockrises deleted the remediations/SMA-575-sponsorship-pm branch February 10, 2024 22:40
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.

3 participants