Skip to content
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

Add ERC-7579 Social Recovery Executor Module (In Progress) #85

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions contracts/account/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ This directory includes contracts to build accounts for ERC-4337. These include:

* {AccountCore}: An ERC-4337 smart account implementation that includes the core logic to process user operations.
* {Account}: An extension of `AccountCore` that implements the recommended features for ERC-4337 smart accounts.
* {AccountSignerERC7702}: An account implementation with low-level signature validation performed by an EOA.
* {AccountERC7579}: An extension of `AccountCore` that implements support for ERC-7579 modules.
* {AccountERC7579Hooked}: An extension of `AccountERC7579` with support for a single hook module (type 4).
* {ERC7821}: Minimal batch executor implementation contracts. Useful to enable easy batch execution for smart contracts.
* {ERC7579SocialRecoveryExecutor}: A social recovery module for ERC-7579 accounts.

== Core

Expand All @@ -17,10 +19,18 @@ This directory includes contracts to build accounts for ERC-4337. These include:

== Extensions

{{SignerERC7702}}
{{AccountERC7579}}

{{AccountERC7759}}

{{AccountERC7759Hooked}}
{{AccountERC7579Hooked}}

{{ERC7821}}

{{ERC7579Modules}}

== ERC7579 Modules

This section includes several ERC-7579 Module implementations for {AccountERC7579}:

* {ERC7579SocialRecoveryExecutor}: A social recovery module enabling account reconfiguration through a timelocked guardian-based consensus mechanism.

{{ERC7579SocialRecoveryExecutor}}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import {ERC7579SocialRecoveryExecutor} from "../../../account/extensions/ERC7579Modules/ERC7579SocialRecoveryExecutor.sol";

contract ERC7579SocialRecoveryExecutorMock is ERC7579SocialRecoveryExecutor {
constructor(string memory name, string memory version) ERC7579SocialRecoveryExecutor(name, version) {}

// helper for testing signature validation
function validateGuardianSignatures(
address account,
GuardianSignature[] calldata guardianSignatures,
bytes32 digest
) public view virtual {
super._validateGuardianSignatures(account, guardianSignatures, digest);
}
}
8 changes: 8 additions & 0 deletions contracts/mocks/account/modules/ERC7579ValidatorMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ abstract contract ERC7579ValidatorMock is ERC7579ModuleMock(MODULE_TYPE_VALIDATO
super.onUninstall(data);
}

function updateSigner(address newSigner) public virtual {
_associatedSigners[msg.sender] = newSigner;
}

function getSigner(address sender) public view virtual returns (address) {
return _associatedSigners[sender];
}

function validateUserOp(
PackedUserOperation calldata userOp,
bytes32 userOpHash
Expand Down
2 changes: 1 addition & 1 deletion lib/forge-std
Loading