Skip to content

Commit 262e02f

Browse files
fix: STAA-12 remediation commit v
1 parent a3708a9 commit 262e02f

File tree

2 files changed

+6
-27
lines changed

2 files changed

+6
-27
lines changed

src/StartaleSmartAccount.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ contract StartaleSmartAccount is
119119
validationData = IValidator(validator).validateUserOp(userOp, userOpHash);
120120
}
121121

122-
/// @notice Executes transactions in single or batch modes as specified by the execution mode.
122+
/// @notice Executes transactions in single or batch modes as specified g by the execution mode.
123123
/// @param mode The execution mode detailing how transactions should be handled (single, batch, default, try/catch).
124124
/// @param executionCalldata The encoded transaction data to execute.
125125
/// @dev This function handles transaction execution flexibility and is protected by the `onlyEntryPoint` modifier.
@@ -332,13 +332,13 @@ contract StartaleSmartAccount is
332332
_uninstallAllValidators();
333333
_uninstallAllExecutors();
334334
_uninstallHook(_getHook());
335-
_tryUninstallPreValidationHook(
335+
_uninstallPreValidationHook(
336336
_getPreValidationHook(MODULE_TYPE_PREVALIDATION_HOOK_ERC1271), MODULE_TYPE_PREVALIDATION_HOOK_ERC1271
337337
);
338-
_tryUninstallPreValidationHook(
338+
_uninstallPreValidationHook(
339339
_getPreValidationHook(MODULE_TYPE_PREVALIDATION_HOOK_ERC4337), MODULE_TYPE_PREVALIDATION_HOOK_ERC4337
340340
);
341-
_tryUninstallFallbacks();
341+
_uninstallAllFallbacks();
342342
_uninstallAllInterfaces();
343343
_initSentinelLists();
344344
}

src/core/ModuleManager.sol

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -319,25 +319,12 @@ abstract contract ModuleManager is AllStorage, EIP712, IModuleManager {
319319
}
320320
}
321321

322-
function _tryUninstallFallbacks() internal {
322+
function _uninstallAllFallbacks() internal {
323323
AccountStorage storage ds = _getAccountStorage();
324324
uint256 len = ds.fallbackSelectors.length;
325325

326326
for (uint256 i = 0; i < len; i++) {
327327
bytes4 selector = ds.fallbackSelectors[i];
328-
FallbackHandler memory handler = ds.fallbacks[selector];
329-
330-
if (address(handler.handler) == address(0)) continue;
331-
332-
(bool success, bytes memory returnData) = handler.handler.excessivelySafeCall(
333-
gasleft(), 0, 0, abi.encodeWithSelector(IModule.onUninstall.selector, abi.encodePacked(selector))
334-
);
335-
if (!success) {
336-
emit ExternalCallFailed(
337-
handler.handler, abi.encodeWithSelector(IModule.onUninstall.selector, abi.encodePacked(selector)), returnData
338-
);
339-
}
340-
341328
ds.fallbacks[selector] = FallbackHandler(address(0), CallType.wrap(0x00));
342329
}
343330

@@ -531,20 +518,12 @@ abstract contract ModuleManager is AllStorage, EIP712, IModuleManager {
531518
}
532519
}
533520

534-
function _tryUninstallPreValidationHook(address hook, uint256 hookType) internal virtual {
521+
function _uninstallPreValidationHook(address hook, uint256 hookType) internal virtual {
535522
if (hook == address(0)) return;
536523
if (hookType == MODULE_TYPE_PREVALIDATION_HOOK_ERC1271) {
537-
try _getAccountStorage().preValidationHookERC1271.onUninstall('') {}
538-
catch {
539-
emit PreValidationHookUninstallFailed(hook, '');
540-
}
541524
_setPreValidationHook(hookType, address(0));
542525
emit ModuleUninstalled(hookType, hook);
543526
} else if (hookType == MODULE_TYPE_PREVALIDATION_HOOK_ERC4337) {
544-
try _getAccountStorage().preValidationHookERC4337.onUninstall('') {}
545-
catch {
546-
emit PreValidationHookUninstallFailed(hook, '');
547-
}
548527
_setPreValidationHook(hookType, address(0));
549528
emit ModuleUninstalled(hookType, hook);
550529
} else {

0 commit comments

Comments
 (0)