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
2103d61d
Unverified
Commit
2103d61d
authored
Oct 23, 2023
by
Maurelian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor(ctb): Extract guard check into _verifyGuard()
parent
4a042355
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
LivenessModule.sol
packages/contracts-bedrock/src/Safe/LivenessModule.sol
+9
-6
No files found.
packages/contracts-bedrock/src/Safe/LivenessModule.sol
View file @
2103d61d
...
...
@@ -67,10 +67,7 @@ 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(
address(livenessGuard) == address(uint160(uint256(bytes32(safe.getStorageAt(GUARD_STORAGE_SLOT, 1))))),
"LivenessModule: guard has been changed"
);
_verifyGuard();
// Check that the owner to remove has not signed a transaction in the last 30 days
require(
...
...
@@ -142,14 +139,20 @@ contract LivenessModule is ISemver {
"LivenessModule: Safe must have the minimum number of owners, or be owned solely by the fallback owner"
);
// Check that the threshold is correct
// Check that the threshold is correct. This check is also correct when there is a single
// owner, because get75PercentThreshold(1) returns 1.
uint256 threshold = safe.getThreshold();
require(
threshold == get75PercentThreshold(numOwners),
"LivenessModule: threshold must be 75% of the number of owners"
);
// Check that the guard has not been changed
// Check that the guard has not been changed.
_verifyGuard();
}
/// @notice Reverts if the guard address does not match the expected value.
function _verifyGuard() internal view {
require(
address(livenessGuard) == address(uint160(uint256(bytes32(safe.getStorageAt(GUARD_STORAGE_SLOT, 1))))),
"LivenessModule: guard has been changed"
...
...
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