Skip to content

Commit

Permalink
feat: minor coding best practice improvement
Browse files Browse the repository at this point in the history
wip
  • Loading branch information
zeroknots committed Jun 13, 2024
1 parent 8cc744b commit 72057f1
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 14 deletions.
7 changes: 3 additions & 4 deletions src/EmailRecoveryManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,9 @@ contract EmailRecoveryManager is EmailAccountRecoveryNew, IEmailRecoveryManager
address _dkimRegistry,
address _emailAuthImpl,
address _subjectHandler
) {
verifierAddr = _verifier;
dkimAddr = _dkimRegistry;
emailAuthImplementationAddr = _emailAuthImpl;
)
EmailAccountRecoveryNew(_verifier, _dkimRegistry, _emailAuthImpl)
{
subjectHandler = _subjectHandler;
}

Expand Down
12 changes: 9 additions & 3 deletions src/experimental/EmailAccountRecoveryNew.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,15 @@ import { ERC1967Proxy } from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy
/// new guardian and recovering a wallet.
abstract contract EmailAccountRecoveryNew {
uint8 constant EMAIL_ACCOUNT_RECOVERY_VERSION_ID = 1;
address public verifierAddr;
address public dkimAddr;
address public emailAuthImplementationAddr;
address internal immutable verifierAddr;
address internal immutable dkimAddr;
address internal immutable emailAuthImplementationAddr;

constructor(address _verifierAddr, address _dkimAddr, address _emailAuthImplementationAddr) {
verifierAddr = _verifierAddr;
dkimAddr = _dkimAddr;
emailAuthImplementationAddr = _emailAuthImplementationAddr;
}

/// @notice Returns the address of the verifier contract.
/// @dev This function is virtual and can be overridden by inheriting contracts.
Expand Down
6 changes: 3 additions & 3 deletions src/handlers/EmailRecoverySubjectHandler.sol
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ contract EmailRecoverySubjectHandler is IEmailRecoverySubjectHandler {

function validateAcceptanceSubject(
uint256 templateIdx,
bytes[] memory subjectParams
bytes[] calldata subjectParams
)
external
view
pure
returns (address)
{
if (templateIdx != 0) {
Expand All @@ -70,7 +70,7 @@ contract EmailRecoverySubjectHandler is IEmailRecoverySubjectHandler {

function validateRecoverySubject(
uint256 templateIdx,
bytes[] memory subjectParams,
bytes[] calldata subjectParams,
address recoveryManager
)
public
Expand Down
6 changes: 3 additions & 3 deletions src/handlers/SafeRecoverySubjectHandler.sol
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ contract SafeRecoverySubjectHandler is IEmailRecoverySubjectHandler {

function validateAcceptanceSubject(
uint256 templateIdx,
bytes[] memory subjectParams
bytes[] calldata subjectParams
)
external
view
pure
returns (address)
{
if (templateIdx != 0) {
Expand All @@ -73,7 +73,7 @@ contract SafeRecoverySubjectHandler is IEmailRecoverySubjectHandler {

function validateRecoverySubject(
uint256 templateIdx,
bytes[] memory subjectParams,
bytes[] calldata subjectParams,
address recoveryManager
)
public
Expand Down
2 changes: 1 addition & 1 deletion src/modules/EmailRecoveryModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ contract EmailRecoveryModule is ERC7579ExecutorBase, IRecoveryModule {
CONSTANTS
//////////////////////////////////////////////////////////////////////////*/

address private immutable EMAIL_RECOVERY_MANAGER;
address public immutable EMAIL_RECOVERY_MANAGER;

event NewValidatorRecovery(address indexed validatorModule, bytes4 recoverySelector);

Expand Down

0 comments on commit 72057f1

Please sign in to comment.