-
Notifications
You must be signed in to change notification settings - Fork 10
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
🔒 H-02 - Prevent Freezing of Funds in Factory Contracts #114
Conversation
Changes to gas cost
🧾 Summary (5% most significant diffs)
Full diff report 👇
|
@@ -58,6 +58,8 @@ contract NexusAccountFactory is Stakeable, INexusFactory { | |||
if (!alreadyDeployed) { | |||
INexus(account).initializeAccount(initData); | |||
emit AccountCreated(account, initData, salt); | |||
} else if (msg.value > 0) { | |||
revert AccountAlreadyDeployed(account); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we have negative test case for this how entrypoint behaves.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by sending a userop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reviewed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good. we can review naming of events once again, and get more reviews!
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## fix/security-h01 #114 +/- ##
====================================================
- Coverage 72.18% 71.17% -1.02%
====================================================
Files 13 13
Lines 676 680 +4
Branches 124 151 +27
====================================================
- Hits 488 484 -4
- Misses 186 196 +10
+ Partials 2 0 -2
... and 4 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
🔒 H-03 - Enforce Registry Calls Before Module Setup to Comply with EIP-7484
🤖 Slither Analysis Report 🔎Slither report
# Slither report
_This comment was automatically generated by the GitHub Actions workflow._
THIS CHECKLIST IS NOT COMPLETE. Use
constable-statesImpact: Optimization
|
🔒 H-02 - Prevent Freezing of Funds in Factory Contracts
🚨 Report Summary
For more details view the full report in OpenZeppelin Code Inspector |
H-02. Freezing of user funds in factory contracts when
alreadyDeployed
istrue
Issue: When a user tries to create a Nexus account that has already been deployed, the initial ETH deposit gets stuck in the factory contract. This can be exploited by attackers to perform griefing attacks.
Fix: Introduced a new error
AccountAlreadyDeployed
that reverts the tx if the account is already deployed andmsg.value
> 0.Summary of Fixes:
AccountAlreadyDeployed
error.AccountAlreadyDeployed
when the account is already deployed andmsg.value
> 0.