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
139751ad
Unverified
Commit
139751ad
authored
Oct 23, 2023
by
Maurelian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ctb): Clean up removeOwner method on module
parent
66a0eee4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
9 deletions
+2
-9
LivenessModule.sol
packages/contracts-bedrock/src/Safe/LivenessModule.sol
+2
-9
No files found.
packages/contracts-bedrock/src/Safe/LivenessModule.sol
View file @
139751ad
...
@@ -72,7 +72,7 @@ contract LivenessModule is ISemver {
...
@@ -72,7 +72,7 @@ contract LivenessModule is ISemver {
"LivenessModule: guard has been changed"
"LivenessModule: guard has been changed"
);
);
// Check that the owner has not signed a transaction in the last 30 days
// Check that the owner
to remove
has not signed a transaction in the last 30 days
require(
require(
livenessGuard.lastLive(owner) < block.timestamp - livenessInterval,
livenessGuard.lastLive(owner) < block.timestamp - livenessInterval,
"LivenessModule: owner has signed recently"
"LivenessModule: owner has signed recently"
...
@@ -83,21 +83,14 @@ contract LivenessModule is ISemver {
...
@@ -83,21 +83,14 @@ contract LivenessModule is ISemver {
uint256 numOwners = owners.length - 1;
uint256 numOwners = owners.length - 1;
uint256 thresholdAfter;
uint256 thresholdAfter;
if (hasMinOwners(numOwners)) {
if (hasMinOwners(numOwners)) {
// Preserves the invariant that the Safe has at least numOwners
// Call the Safe to remove the owner and update the threshold
thresholdAfter = get75PercentThreshold(numOwners);
thresholdAfter = get75PercentThreshold(numOwners);
console.log("removing one owner. numOwners: %s, thresholdAfter: %s", numOwners, thresholdAfter);
address prevOwner = _getPrevOwner(owner, owners);
address prevOwner = _getPrevOwner(owner, owners);
// Call the Safe to remove the owner
_removeOwner({ _prevOwner: prevOwner, _owner: owner, _threshold: thresholdAfter });
_removeOwner({ _prevOwner: prevOwner, _owner: owner, _threshold: thresholdAfter });
} else {
} else {
console.log("removing all owners. numOwnersAfter: %s", numOwners);
// The number of owners is dangerously low, so we wish to transfer the ownership of this Safe
// The number of owners is dangerously low, so we wish to transfer the ownership of this Safe
// to the fallback owner.
// to the fallback owner.
// The threshold will be 1 because we are removing all owners except the fallback owner
// thresholdAfter = 1; // todo: why is this here? We should be able to delete it.
// Remove owners one at a time starting from the last owner.
// Remove owners one at a time starting from the last owner.
// Since we're removing them in order from last to first, the ordering will remain constant,
// Since we're removing them in order from last to first, the ordering will remain constant,
// and we shouldn't need to query the list of owners again.
// and we shouldn't need to query the list of owners again.
...
...
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