-
Notifications
You must be signed in to change notification settings - Fork 3.9k
LivenessModule2 implementation #17272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 47 commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
9d13224
start
JosepBove 8102495
DeployOwnership scripts update
JosepBove dd75f3e
cleanup
JosepBove 5f934f7
reset challangeStartTime when re-enabling the module
JosepBove ec5b31a
remove duplicated comment
JosepBove 59cae4d
test cleanup
JosepBove e93c34f
fmt
JosepBove ee88fb3
semverlock
JosepBove dc1887d
add livenessmodule2 to checkfrozenfiles
JosepBove 989ae74
address alcueca's feedback
JosepBove d3bf748
change ownershiptransfer logic
JosepBove 34419fe
pre-pr
JosepBove 548fcf4
LivenessModule - Slightly simplified code (#17277)
alcueca 874836d
address smartcontract's feedback
JosepBove 37ae803
alcueca's feedback
JosepBove 93494c7
smartcontract's feedback
JosepBove f5fb1d3
add extra checks suggested by alcueca
JosepBove ee4de98
fix clear error
JosepBove e971a46
update snapshots
JosepBove 9c0f85c
conflicts
JosepBove 53efa74
Merge branch 'develop' into jb/liveness-module
JosepBove 6a29e0d
name nitpicks and coverage at 100%
JosepBove 39f603c
fix tests
JosepBove f0abb54
remove interface extra lines
JosepBove 6545424
fix event on test
JosepBove c670f52
rename isChallenged function to getChallengePeriodEnd
JosepBove 737affc
update snapshots
JosepBove d42b2b7
Merge branch 'develop' into jb/liveness-module
JosepBove f671313
update implementation from specs
JosepBove 669f2e1
sentinel owner and interface fix
JosepBove e4669ac
DRYness comments
JosepBove 405ae9c
move getter at the top
JosepBove 7b7923f
update comment
JosepBove dc3d59f
rename event
JosepBove d0dc8a5
add _assertModuleConfigured
JosepBove 60a11a4
add _assertModuleEnabled
JosepBove a93ac08
assert module enable fixes
JosepBove 1c27cb6
_cancelChallenge internal function
JosepBove 44c3ada
fix comments
JosepBove 3fb2639
more comments
JosepBove e177a22
split configure errors
JosepBove a8a54cd
owner transfer invariant
JosepBove e03a5d7
address comments
JosepBove 01eade2
address kelvin's feedback
JosepBove 5818472
lint
JosepBove e8f4b89
more comments
JosepBove 5f77577
Merge branch 'develop' into jb/liveness-module
JosepBove 5be1c2d
alcueca's comments
JosepBove d071478
Merge branch 'develop' into jb/liveness-module
JosepBove File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
packages/contracts-bedrock/interfaces/safe/ILivenessModule2.sol
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| // SPDX-License-Identifier: MIT | ||
| pragma solidity ^0.8.0; | ||
|
|
||
| import { ISemver } from "interfaces/universal/ISemver.sol"; | ||
|
|
||
| /// @title ILivenessModule2 | ||
| /// @notice Interface for LivenessModule2, a singleton module for challenge-based ownership transfer | ||
| interface ILivenessModule2 is ISemver { | ||
| /// @notice Configuration for a Safe's liveness module | ||
| struct ModuleConfig { | ||
| uint256 livenessResponsePeriod; | ||
| address fallbackOwner; | ||
| } | ||
|
|
||
| /// @notice Returns the configuration for a Safe | ||
| /// @return livenessResponsePeriod The response period | ||
| /// @return fallbackOwner The fallback owner address | ||
| function safeConfigs(address) external view returns (uint256 livenessResponsePeriod, address fallbackOwner); | ||
|
|
||
| /// @notice Returns the challenge start time for a Safe (0 if no challenge) | ||
| /// @return The challenge start timestamp | ||
| function challengeStartTime(address) external view returns (uint256); | ||
|
|
||
| /// @notice Semantic version | ||
| /// @return version The contract version | ||
| function version() external view returns (string memory); | ||
|
|
||
| /// @notice Configures the module for a Safe that has already enabled it | ||
| /// @param _config The configuration parameters for the module | ||
| function configure(ModuleConfig memory _config) external; | ||
|
|
||
| /// @notice Clears the module configuration for a Safe | ||
| function clear() external; | ||
|
|
||
JosepBove marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| /// @notice Returns challenge_start_time + liveness_response_period if there is a challenge, or 0 if not | ||
| /// @param _safe The Safe address to query | ||
| /// @return The challenge end timestamp, or 0 if no challenge | ||
| function getChallengePeriodEnd(address _safe) external view returns (uint256); | ||
|
|
||
| /// @notice Challenges an enabled safe | ||
| /// @param _safe The Safe to challenge | ||
| function challenge(address _safe) external; | ||
|
|
||
| /// @notice Responds to a challenge for an enabled safe, canceling it | ||
| function respond() external; | ||
|
|
||
| /// @notice Removes all current owners from an enabled safe and appoints fallback as sole owner | ||
| /// @param _safe The Safe to transfer ownership of | ||
| function changeOwnershipToFallback(address _safe) external; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.