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
5a1baf8f
Unverified
Commit
5a1baf8f
authored
Oct 23, 2023
by
Maurelian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ctb): Clean up and comment the checkAfterExecution hook
parent
0831cd6d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
11 deletions
+12
-11
LivenessGuard.sol
packages/contracts-bedrock/src/Safe/LivenessGuard.sol
+12
-11
No files found.
packages/contracts-bedrock/src/Safe/LivenessGuard.sol
View file @
5a1baf8f
...
...
@@ -34,21 +34,22 @@ contract LivenessGuard is ISemver, GetSigners, BaseGuard {
/// 1. Add new owners to the lastSigned mapping
/// 2. Delete removed owners from the lastSigned mapping
function checkAfterExecution(bytes32, bool) external {
// Get the current set of owners
address[] memory ownersAfter = safe.getOwners();
// Iterate over the current owners, and remove one at a time from the ownersBefore set.
for (uint256 i = 0; i < ownersAfter.length; i++) {
if (ownersBefore.contains(ownersAfter[i])) {
// This address was already present, no change, remove it from the set.
ownersBefore.remove(ownersAfter[i]);
} else {
// This address is newly added, add it to the lastSigned mapping
// If the value was present, remove() returns true.
if (ownersBefore.remove(ownersAfter[i]) == false) {
// This address was not already an owner, add it to the lastSigned mapping
lastSigned[ownersAfter[i]] = block.timestamp;
}
// Iterate over ownersSet. Any remaining addresses are no longer an owner, so we delete
// it from the lastSigned mapping.
for (uint256 j = 0; j < ownersBefore.length(); j++) {
address owner = ownersBefore.at(j);
delete lastSigned[owner]
;
}
}
// Now iterate over the remaining ownersBefore entries. Any remaining addresses are no longer an owner, so we
// delete them from the lastSigned mapping.
for (uint256 j = 0; j < ownersBefore.length(); j++) {
address owner = ownersBefore.at(j)
;
delete lastSigned[owner];
}
return;
}
...
...
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