This repository has been archived by the owner on Sep 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add router manager and simplify recovery config
- Loading branch information
1 parent
ba17907
commit e450c20
Showing
5 changed files
with
62 additions
and
65 deletions.
There are no files selected for viewing
This file contains 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,38 @@ | ||
// SPDX-License.Idenitifer: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
interface IRouterManager { | ||
struct SafeAccountInfo { | ||
address safe; | ||
address previousOwnerInLinkedList; | ||
} | ||
|
||
function getSafeAccountInfo( | ||
address recoveryRouter | ||
) external view returns (SafeAccountInfo memory); | ||
|
||
function getRouterForSafe(address safe) external view returns (address); | ||
} | ||
|
||
abstract contract RouterManager is IRouterManager { | ||
/** Mapping of email account recovery router contracts to safe details needed to complete recovery */ | ||
mapping(address => SafeAccountInfo) public recoveryRouterToSafeInfo; | ||
|
||
/** Mapping of safe account addresses to email account recovery router contracts**/ | ||
/** These are stored for frontends to easily find the router contract address from the given safe account address**/ | ||
mapping(address => address) public safeToRecoveryRouter; | ||
|
||
/// @inheritdoc IRouterManager | ||
function getSafeAccountInfo( | ||
address recoveryRouter | ||
) external view override returns (SafeAccountInfo memory) { | ||
return recoveryRouterToSafeInfo[recoveryRouter]; | ||
} | ||
|
||
/// @inheritdoc IRouterManager | ||
function getRouterForSafe( | ||
address safe | ||
) external view override returns (address) { | ||
return safeToRecoveryRouter[safe]; | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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