Skip to content

Commit

Permalink
feat: diable validators on removal
Browse files Browse the repository at this point in the history
  • Loading branch information
cpb8010 committed Dec 5, 2024
1 parent 0f083e5 commit 5cd9542
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/managers/ValidatorManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ abstract contract ValidatorManager is IValidatorManager, Auth {
function _removeModuleValidator(address validator) internal {
_moduleValidatorsLinkedList().remove(validator);

validator.excessivelySafeCall(gasleft(), 0, abi.encodeWithSelector(IInitable.disable.selector));
(success); // silence unused local variable warning

emit RemoveModuleValidator(validator);
}

Expand Down
9 changes: 5 additions & 4 deletions src/validators/WebAuthValidator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@ contract WebAuthValidator is VerifierCaller, IModuleValidator {
return _addValidationKey(key);
}

// There's no mapping from account address to domains,
// so there's no way to just delete all the keys
// We can only disconnect the module from the account,
// re-linking it will allow any previous keys
function disable() external {
// There's no mapping from account address to domains,
// so there's no way to just delete all the keys
// We can only disconnect the module from the account,
// re-linking it will allow any previous keys
require(false, "Cannot disable module without removing it from account");
}

function _addValidationKey(bytes memory key) internal returns (bool) {
Expand Down

0 comments on commit 5cd9542

Please sign in to comment.