-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fix/enable mode module types (m06) #112
Fix/enable mode module types (m06) #112
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## remediations/cantina-spearbit #112 +/- ##
================================================================
Coverage ? 72.31%
================================================================
Files ? 13
Lines ? 679
Branches ? 124
================================================================
Hits ? 491
Misses ? 188
Partials ? 0
Continue to review full report in Codecov by Sentry.
|
if (op.nonce.isModuleEnableMode()) { | ||
PackedUserOperation memory userOp = op; | ||
userOp.signature = _enableMode(userOpHash, op.signature); | ||
if (!_isValidatorInstalled(validator)) return VALIDATION_FAILED; | ||
validationData = IValidator(validator).validateUserOp(userOp, userOpHash); | ||
} else { |
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.
Is there any reason the order changed? I think it's less likely to happen when calling with EnableMode enabled compared to when calling without EnableMode
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.
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.
contracts/types/Constants.sol
Outdated
@@ -38,7 +38,7 @@ uint256 constant MODULE_TYPE_FALLBACK = 3; | |||
|
|||
// Module type identifier for hooks | |||
uint256 constant MODULE_TYPE_HOOK = 4; | |||
bytes32 constant MODULE_ENABLE_MODE_TYPE_HASH = keccak256("ModuleEnableMode(address module, bytes32 initDataHash)"); | |||
bytes32 constant MODULE_ENABLE_MODE_TYPE_HASH = keccak256("ModuleEnableMode(address module, uint256 moduleType, bytes32 userOpHash, bytes32 initDataHash)"); |
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.
According to the [EIP-712 standard](https://eips.ethereum.org/EIPS/eip-712), members are joined by a "," without any blank space.
The type of a struct is encoded as name ‖ "(" ‖ member₁ ‖ "," ‖ member₂ ‖ "," ‖ … ‖ memberₙ ")" where each member is written as type ‖ " " ‖ name. For example, the above Mail struct is encoded as Mail(address from,address to,string contents).
Check M-06 for more info if it applies here.
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.
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.
fixed!
Fix/enable mode module types
🚨 Report Summary
For more details view the full report in OpenZeppelin Code Inspector |
🤖 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
|
2375a58
into
remediations/cantina-spearbit
Fix Issue #30) : Enable mode would not install any module types but validators or multitypes with validator included.
Also includes fixes to issues 37,38,42 from PR#111