Skip to content
Open
Show file tree
Hide file tree
Changes from 11 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
Copy link
Contributor Author

@gonzaotc gonzaotc Feb 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated account readme.adoc with recent changes from pr #87

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
2 changes: 1 addition & 1 deletion scripts/prepare-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ for f in "$examples_source_dir"/**/*.sol; do
sed -Ee '/^import/s|"(\.\./)+|"@openzeppelin/community-contracts/|' "$f" > "$examples_target_dir/$name"
done

node scripts/gen-nav.js "$OUTDIR" > "$OUTDIR/../nav.adoc"
node scripts/gen-nav.js "$OUTDIR" > "$OUTDIR/../nav.adoc"
Loading