@@ -245,20 +245,10 @@ abstract contract ModuleManager is AllStorage, EIP712, IModuleManager {
245245 }
246246 }
247247
248- /// Review: _tryUninstallValidators Might as well not call onUninstall() at all
249- /// Review: separate internal method can be added that accepts an array of data.
250248 /// @dev Uninstalls all validators from the smart account.
251249 /// @dev This function is called in the _onRedelegation function in StartaleSmartAccount.sol
252- function _tryUninstallValidators () internal {
250+ function _uninstallAllValidators () internal {
253251 SentinelListLib.SentinelList storage $valdiators = _getAccountStorage ().validators;
254- address validator = $valdiators.getNext (SENTINEL);
255- while (validator != SENTINEL) {
256- try IValidator (validator).onUninstall ('' ) {}
257- catch {
258- emit ValidatorUninstallFailed (validator, '' );
259- }
260- validator = $valdiators.getNext (validator);
261- }
262252 $valdiators.popAll ();
263253 }
264254
@@ -289,20 +279,10 @@ abstract contract ModuleManager is AllStorage, EIP712, IModuleManager {
289279 }
290280 }
291281
292- /// Review: _tryUninstallExecutors Might as well not call onUninstall() at all
293- /// Review: separate internal method can be added that accepts an array of data.
294282 /// @dev Uninstalls all executors from the smart account.
295283 /// @dev This function is called in the _onRedelegation function in StartaleSmartAccount.sol
296- function _tryUninstallExecutors () internal {
284+ function _uninstallAllExecutors () internal {
297285 SentinelListLib.SentinelList storage $executors = _getAccountStorage ().executors;
298- address executor = $executors.getNext (SENTINEL);
299- while (executor != SENTINEL) {
300- try IExecutor (executor).onUninstall ('' ) {}
301- catch {
302- emit ExecutorUninstallFailed (executor, '' );
303- }
304- executor = $executors.getNext (executor);
305- }
306286 $executors.popAll ();
307287 }
308288
@@ -337,20 +317,14 @@ abstract contract ModuleManager is AllStorage, EIP712, IModuleManager {
337317 }
338318 }
339319
340- /// Review: _tryUninstallHook
341320 /// @dev Uninstalls a hook module.
342321 /// @param hook The address of the hook to be uninstalled.
343- function _tryUninstallHook (address hook ) internal virtual {
322+ function _uninstallHook (address hook ) internal virtual {
344323 if (hook != address (0 )) {
345- try IHook (hook).onUninstall ('' ) {}
346- catch {
347- emit HookUninstallFailed (hook, '' );
348- }
349324 _setHook (address (0 ));
350325 }
351326 }
352327
353- // Review: if uninstalling selectors also need some data.
354328 function _tryUninstallFallbacks () internal {
355329 AccountStorage storage ds = _getAccountStorage ();
356330 uint256 len = ds.fallbackSelectors.length ;
@@ -556,14 +530,13 @@ abstract contract ModuleManager is AllStorage, EIP712, IModuleManager {
556530 uint256 hookType ,
557531 bytes calldata data
558532 ) internal virtual {
559- // Review
560- // Check if the hook is installed according to supplied type
561- // Check if the hook is one of the allowed types
562- // IModule(preValidationHook).onUninstall(data);
563533 _setPreValidationHook (hookType, address (0 ));
534+ try IModule (preValidationHook).onUninstall (data) {}
535+ catch {
536+ emit PreValidationHookUninstallFailed (preValidationHook, data);
537+ }
564538 }
565539
566- // Review: _tryUninstallPreValidationHook
567540 function _tryUninstallPreValidationHook (address hook , uint256 hookType ) internal virtual {
568541 if (hook == address (0 )) return ;
569542 if (hookType == MODULE_TYPE_PREVALIDATION_HOOK_ERC1271) {
0 commit comments