Skip to content

Commit 4597693

Browse files
mmv08nlordellremedcu
authored
Docs: Update the IModuleManager and IOwnerManager interfaces to clarify the usage of the prevModule and prevOwner (#993)
Updated the `IModuleManager` and `IOwnerManager` interfaces to clarify the usage of the `prevModule` and `prevOwner` parameters in the `disableModule` and `removeOwner` functions. Added details specifying that when the module or owner to be removed is the first (or only) element in the list, the respective `prevModule` or `prevOwner` must be set to the sentinel address `0x1`. This improves understanding of the linked list structure used in these functions. fixes #992 --------- Co-authored-by: Nicholas Rodrigues Lordello <n@lordello.net> Co-authored-by: Shebin John <admin@remedcu.com>
1 parent 4be4e95 commit 4597693

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

contracts/interfaces/IModuleManager.sol

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ interface IModuleManager {
2727
/**
2828
* @notice Disables the module `module` for the Safe.
2929
* @dev This can only be done via a Safe transaction.
30-
* @param prevModule Previous module in the modules linked list.
30+
* @param prevModule Previous module in the modules linked list. If the module to be
31+
* disabled is the first (or only) element of the list, `prevModule` MUST be
32+
* set to the sentinel address `0x1` (referred to as `SENTINEL_MODULES` in the
33+
* implementation).
3134
* @param module Module to be removed.
3235
*/
3336
function disableModule(address prevModule, address module) external;

contracts/interfaces/IOwnerManager.sol

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ interface IOwnerManager {
2121
/**
2222
* @notice Removes the owner `owner` from the Safe and updates the threshold to `_threshold`.
2323
* @dev This can only be done via a Safe transaction.
24-
* @param prevOwner Owner that pointed to the owner to be removed in the linked list
24+
* @param prevOwner Owner that pointed to the `owner` to be removed in the linked list.
25+
* If the owner to be removed is the first (or only) element of the list,
26+
* `prevOwner` MUST be set to the sentinel address `0x1` (referred to as
27+
* `SENTINEL_OWNERS` in the implementation).
2528
* @param owner Owner address to be removed.
2629
* @param _threshold New threshold.
2730
*/
@@ -30,7 +33,10 @@ interface IOwnerManager {
3033
/**
3134
* @notice Replaces the owner `oldOwner` in the Safe with `newOwner`.
3235
* @dev This can only be done via a Safe transaction.
33-
* @param prevOwner Owner that pointed to the owner to be replaced in the linked list
36+
* @param prevOwner Owner that pointed to the `oldOwner` to be replaced in the linked list.
37+
* If the owner to be replaced is the first (or only) element of the list,
38+
* `prevOwner` MUST be set to the sentinel address `0x1` (referred to as
39+
* `SENTINEL_OWNERS` in the implementation).
3440
* @param oldOwner Owner address to be replaced.
3541
* @param newOwner New owner address.
3642
*/

0 commit comments

Comments
 (0)