-
Notifications
You must be signed in to change notification settings - Fork 36
Add moduleTypeId check to installModule/uninstallModule. #28
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
Add moduleTypeId check to installModule/uninstallModule. #28
Conversation
src/MSABasic.sol
Outdated
| onlyEntryPointOrSelf | ||
| { | ||
|
|
||
| if (!IModule(module).isModuleType(moduleTypeId)) revert MismatchModuleTypeId(moduleTypeId); |
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.
maybe we should check if module passed supports interfaceId for IModule?
@kopy-kat
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.
isModuleType should be sufficient right?
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.
yes it is sufficient. we should write more tests though
kopy-kat
left a comment
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.
tysm @doublespending! left a couple of comments but this looks good
src/MSABasic.sol
Outdated
| onlyEntryPointOrSelf | ||
| { | ||
|
|
||
| if (!IModule(module).isModuleType(moduleTypeId)) revert MismatchModuleTypeId(moduleTypeId); |
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.
isModuleType should be sufficient right?
src/MSAAdvanced.sol
Outdated
| { | ||
| (address hook, bytes memory hookData) = _preCheck(); | ||
|
|
||
| if (!IModule(module).isModuleType(moduleTypeId)) revert MismatchModuleTypeId(moduleTypeId); |
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.
imo this is not needed since this check is already done on installation right?
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.
Yes, we can remove it.
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.
which methods are these?
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.
wdym? my point is that we already check moduletype onInstallation, but I dont think theres a need to check on uninstallation since it doesnt rly matter anyways (bc the module wont be used anymore)
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.
should be good imo, on uninstall if module address is wrong or if it doesn't match typeid it would revert with sentinel list or in module itself. will share if anything post writing more tests
src/MSABasic.sol
Outdated
| onlyEntryPointOrSelf | ||
| { | ||
|
|
||
| if (!IModule(module).isModuleType(moduleTypeId)) revert MismatchModuleTypeId(moduleTypeId); |
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.
same as above
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.
Yes, we can remove it.
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.
which methods are these?
|
lmk what you think of the comments and we can merge if it looks good |
|
LGTM thanks ser |
No description provided.