Skip to content

Commit 2f291e2

Browse files
committed
Simplify by clearing config directly
1 parent 97abb03 commit 2f291e2

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

packages/contracts-bedrock/src/safe/LivenessModule2.sol

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -363,18 +363,14 @@ abstract contract LivenessModule2 {
363363
/// @param _targetSafe The Safe instance to disable this module from.
364364
function _disableThisModule(Safe _targetSafe) internal {
365365
// Clear the module configuration
366-
_targetSafe.execTransactionFromModule({
367-
to: address(this),
368-
value: 0,
369-
operation: Enum.Operation.Call,
370-
data: abi.encodeCall(LivenessModule2.clearLivenessModule, ())
371-
});
366+
// Erase the configuration data for this safe
367+
delete livenessSafeConfiguration[address(_targetSafe)];
372368

373369
// Get current modules
374-
// This might not work if you have more than 100 modules, but that's a you problem.
370+
// This might not work if you have more than 100 modules, but what are you even doing if that's the case?
375371
(address[] memory modules,) = _targetSafe.getModulesPaginated(SENTINEL_OWNER, 100);
376372

377-
// find the index of this module
373+
// Find the index of this module
378374
bool moduleFound = false;
379375
uint256 moduleIndex = 0;
380376
for (uint256 i = 0; i < modules.length; i++) {

0 commit comments

Comments
 (0)