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
fa0db2a6
Unverified
Commit
fa0db2a6
authored
Oct 02, 2023
by
Maurelian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ctb): Add showLiveness method
parent
57a5f220
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
LivenessGuard.sol
packages/contracts-bedrock/src/Safe/LivenessGuard.sol
+14
-0
LivenessGuard.t.sol
packages/contracts-bedrock/test/LivenessGuard.t.sol
+1
-1
No files found.
packages/contracts-bedrock/src/Safe/LivenessGuard.sol
View file @
fa0db2a6
...
...
@@ -107,4 +107,18 @@ contract LivenessGuard is SignatureDecoder, BaseGuard {
_owners[i] = currentOwner;
}
}
/// @notice Enables an owner to demonstrate liveness by calling this method directly.
/// This is useful for owners who have not recently signed a transaction via the Safe.
function showLiveness() external {
require(safe.isOwner(msg.sender), "LivenessGuard: only Safe owners may demontstrate liveness");
lastSigned[msg.sender] = block.timestamp;
address[] memory signers = new address[](1);
signers[0] = msg.sender;
// todo(maurelian): Is there any need for this event to be differentiated from the one emitted in
// checkTransaction?
// Technically the 0x0 txHash does serve to identiy a call to this method.
emit SignersRecorded(0x0, signers);
}
}
packages/contracts-bedrock/test/LivenessGuard.t.sol
View file @
fa0db2a6
...
...
@@ -33,7 +33,7 @@ contract LivnessGuard_TestInit is Test, SafeTestTools {
}
}
contract LivnessGuard_
TestCheckTx
is LivnessGuard_TestInit {
contract LivnessGuard_
CheckTx_Test
is LivnessGuard_TestInit {
using SafeTestLib for SafeInstance;
function test_checkTransaction_succeeds() external {
...
...
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