Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
20a0c6c4
Unverified
Commit
20a0c6c4
authored
Oct 23, 2023
by
Maurelian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ctb): ensure guard has not changed before calling removeOwner
parent
aef990f3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
LivenessModule.sol
packages/contracts-bedrock/src/Safe/LivenessModule.sol
+8
-1
LivenessModule.t.sol
packages/contracts-bedrock/test/LivenessModule.t.sol
+1
-0
No files found.
packages/contracts-bedrock/src/Safe/LivenessModule.sol
View file @
20a0c6c4
...
...
@@ -36,6 +36,10 @@ contract LivenessModule is ISemver {
/// This can be updated by replacing with a new module.
address public immutable fallbackOwner;
/// @notice The storage slot used in the safe to store the guard address
/// keccak256("guard_manager.guard.address")
uint256 internal constant GUARD_STORAGE_SLOT = 0x4a204f620c8c5ccdca3fd54d003badd85ba500436a431f0cbda4f558c93c34c8;
/// @notice The address of the first owner in the linked list of owners
address internal constant SENTINEL_OWNERS = address(0x1);
...
...
@@ -63,7 +67,10 @@ contract LivenessModule is ISemver {
/// ownership of the Safe is transferred to the fallback owner.
function removeOwner(address owner) external {
// Check that the guard has not been changed
require(livenessGuard == safe.getGuard(), "LivenessModule: guard has been changed");
require(
address(livenessGuard) == address(uint160(uint256(bytes32(safe.getStorageAt(GUARD_STORAGE_SLOT, 1))))),
"LivenessModule: guard has been changed"
);
// Check that the owner has not signed a transaction in the last 30 days
require(
...
...
packages/contracts-bedrock/test/LivenessModule.t.sol
View file @
20a0c6c4
...
...
@@ -33,6 +33,7 @@ contract LivnessModule_TestInit is Test, SafeTestTools {
_fallbackOwner: makeAddr("fallbackOwner")
});
safeInstance.enableModule(address(livenessModule));
safeInstance.setGuard(address(livenessGuard));
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment