Skip to content
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

### Breaking changes

- `SignerERC7702` is renamed as `SignerEIP7702`. Imports and inheritance must be updated to that new name and path. Behavior is unmodified.
- Update minimum pragma to 0.8.24 in `Votes`, `VotesExtended`, `ERC20Votes`, `Strings`, `ERC1155URIStorage`, `MessageHashUtils`, `ERC721URIStorage`, `ERC721Votes`, `ERC721Wrapper`, `ERC721Burnable`, `ERC721Consecutive`, `ERC721Enumerable`, `ERC721Pausable`, `ERC721Royalty`, `ERC721Wrapper`, `EIP712`, and `ERC7739`. ([#5726](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/5726))

### Deprecation
Expand Down
10 changes: 5 additions & 5 deletions contracts/mocks/account/AccountMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {SignerECDSA} from "../../utils/cryptography/signers/SignerECDSA.sol";
import {SignerP256} from "../../utils/cryptography/signers/SignerP256.sol";
import {SignerRSA} from "../../utils/cryptography/signers/SignerRSA.sol";
import {SignerWebAuthn} from "../../utils/cryptography/signers/SignerWebAuthn.sol";
import {SignerERC7702} from "../../utils/cryptography/signers/SignerERC7702.sol";
import {SignerEIP7702} from "../../utils/cryptography/signers/SignerEIP7702.sol";
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Import fails: SignerEIP7702.sol not found (rename source file).

Same root cause as other failures: the signer file wasn’t renamed. Rename the source file to SignerEIP7702.sol to unblock compilation.

🧰 Tools
🪛 GitHub Actions: formal verification

[error] 19-19: Source 'contracts/utils/cryptography/signers/SignerEIP7702.sol' not found.

🤖 Prompt for AI Agents
In contracts/mocks/account/AccountMock.sol around line 19, the import of
SignerEIP7702.sol fails because the actual signer source file was not renamed to
match this import; rename the signer source file in
../../utils/cryptography/signers/ to SignerEIP7702.sol (or alternatively update
the import to the actual filename) so the import path matches the file name and
compilation can succeed.

import {SignerERC7913} from "../../utils/cryptography/signers/SignerERC7913.sol";
import {MultiSignerERC7913} from "../../utils/cryptography/signers/MultiSignerERC7913.sol";
import {MultiSignerERC7913Weighted} from "../../utils/cryptography/signers/MultiSignerERC7913Weighted.sol";
Expand Down Expand Up @@ -81,7 +81,7 @@ abstract contract AccountWebAuthnMock is Account, SignerWebAuthn, ERC7739, ERC78
}
}

abstract contract AccountERC7702Mock is Account, SignerERC7702, ERC7739, ERC7821, ERC721Holder, ERC1155Holder {
abstract contract AccountERC7702Mock is Account, SignerEIP7702, ERC7739, ERC7821, ERC721Holder, ERC1155Holder {
/// @inheritdoc ERC7821
function _erc7821AuthorizedExecutor(
address caller,
Expand All @@ -95,7 +95,7 @@ abstract contract AccountERC7702Mock is Account, SignerERC7702, ERC7739, ERC7821
abstract contract AccountERC7702WithModulesMock is
Account,
AccountERC7579,
SignerERC7702,
SignerEIP7702,
ERC7739,
ERC721Holder,
ERC1155Holder
Expand All @@ -122,8 +122,8 @@ abstract contract AccountERC7702WithModulesMock is
function _rawSignatureValidation(
bytes32 hash,
bytes calldata signature
) internal view virtual override(AbstractSigner, AccountERC7579, SignerERC7702) returns (bool) {
return SignerERC7702._rawSignatureValidation(hash, signature);
) internal view virtual override(AbstractSigner, AccountERC7579, SignerEIP7702) returns (bool) {
return SignerEIP7702._rawSignatureValidation(hash, signature);
}
}

Expand Down
4 changes: 2 additions & 2 deletions contracts/mocks/docs/account/MyAccountERC7702.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import {Account} from "../../../account/Account.sol";
import {ERC721Holder} from "../../../token/ERC721/utils/ERC721Holder.sol";
import {ERC1155Holder} from "../../../token/ERC1155/utils/ERC1155Holder.sol";
import {ERC7821} from "../../../account/extensions/draft-ERC7821.sol";
import {SignerERC7702} from "../../../utils/cryptography/signers/SignerERC7702.sol";
import {SignerEIP7702} from "../../../utils/cryptography/signers/SignerEIP7702.sol";

contract MyAccountERC7702 is Account, SignerERC7702, ERC7821, ERC721Holder, ERC1155Holder {
contract MyAccountERC7702 is Account, SignerEIP7702, ERC7821, ERC721Holder, ERC1155Holder {
Comment on lines +9 to +11
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Import fails: SignerEIP7702.sol not found (rename source file).

CI error shows this import path doesn’t exist yet. After renaming the signer file to SignerEIP7702.sol (in the signers folder), this will compile.


🏁 Script executed:

#!/bin/bash
# Confirm the import target exists after the rename
test -f contracts/utils/cryptography/signers/SignerEIP7702.sol && echo "OK: SignerEIP7702.sol present" || (echo "Missing SignerEIP7702.sol" && exit 1)

Length of output: 25


Fix missing import: add or rename SignerEIP7702.sol or update the import

contracts/mocks/docs/account/MyAccountERC7702.sol (lines 9-11) imports contracts/utils/cryptography/signers/SignerEIP7702.sol, but that file is missing (local check returned "Missing SignerEIP7702.sol") — either create/rename the signer file at that path or change the import to the correct filename.

🧰 Tools
🪛 GitHub Actions: checks

[error] 9-9: forge test -vvv: Source 'contracts/utils/cryptography/signers/SignerEIP7702.sol' not found: File not found. Searched the following locations: '/home/runner/work/openzeppelin-contracts/openzeppelin-contracts'.

🪛 GitHub Actions: formal verification

[error] 9-9: Source 'contracts/utils/cryptography/signers/SignerEIP7702.sol' not found.

🤖 Prompt for AI Agents
In contracts/mocks/docs/account/MyAccountERC7702.sol around lines 9-11 the
import for "../../../utils/cryptography/signers/SignerEIP7702.sol" points to a
missing file; either add or rename the signer source to that exact path and
filename (SignerEIP7702.sol) exporting the SignerEIP7702 contract, or update
this import to the actual existing signer filename/path (and adjust the contract
inheritance if the contract name differs) so the compiler can locate the signer
implementation.

/// @dev Allows the entry point as an authorized executor.
function _erc7821AuthorizedExecutor(
address caller,
Expand Down
4 changes: 2 additions & 2 deletions contracts/utils/cryptography/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ A collection of contracts and libraries that implement various signature validat
* {AbstractSigner}: Abstract contract for internal signature validation in smart contracts.
* {ERC7739}: An abstract contract to validate signatures following the rehashing scheme from {ERC7739Utils}.
* {SignerECDSA}, {SignerP256}, {SignerRSA}: Implementations of an {AbstractSigner} with specific signature validation algorithms.
* {SignerERC7702}: Implementation of {AbstractSigner} that validates signatures using the contract's own address as the signer, useful for delegated accounts following EIP-7702.
* {SignerEIP7702}: Implementation of {AbstractSigner} that validates signatures using the contract's own address as the signer, useful for delegated accounts following EIP-7702.
* {SignerWebAuthn}: Implementation of {SignerP256} that supports WebAuthn
* {SignerERC7913}, {MultiSignerERC7913}, {MultiSignerERC7913Weighted}: Implementations of {AbstractSigner} that validate signatures based on ERC-7913. Including a simple and weighted multisignature scheme.
* {ERC7913P256Verifier}, {ERC7913RSAVerifier}, {ERC7913WebAuthnVerifier}: Ready to use ERC-7913 signature verifiers for P256, RSA keys and WebAuthn.
Expand Down Expand Up @@ -56,7 +56,7 @@ A collection of contracts and libraries that implement various signature validat

{{SignerRSA}}

{{SignerERC7702}}
{{SignerEIP7702}}

{{SignerERC7913}}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (utils/cryptography/signers/SignerERC7702.sol)
// OpenZeppelin Contracts (last updated v5.4.0) (utils/cryptography/signers/SignerEIP7702.sol)

pragma solidity ^0.8.20;

Expand All @@ -11,7 +11,7 @@ import {ECDSA} from "../ECDSA.sol";
*
* @custom:stateless
*/
abstract contract SignerERC7702 is AbstractSigner {
abstract contract SignerEIP7702 is AbstractSigner {
/**
* @dev Validates the signature using the EOA's address (i.e. `address(this)`).
*/
Expand Down
6 changes: 3 additions & 3 deletions docs/modules/ROOT/pages/accounts.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Since the minimum requirement of xref:api:account.adoc#Account[`Account`] is to
* xref:api:utils/cryptography.adoc#SignerECDSA[`SignerECDSA`]: Verifies signatures produced by regular EVM Externally Owned Accounts (EOAs).
* xref:api:utils/cryptography.adoc#SignerP256[`SignerP256`]: Validates signatures using the secp256r1 curve, common for World Wide Web Consortium (W3C) standards such as FIDO keys, passkeys or secure enclaves.
* xref:api:utils/cryptography.adoc#SignerRSA[`SignerRSA`]: Verifies signatures of traditional PKI systems and X.509 certificates.
* xref:api:utils/cryptography.adoc#SignerERC7702[`SignerERC7702`]: Checks EOA signatures delegated to this signer using https://eips.ethereum.org/EIPS/eip-7702#set-code-transaction[EIP-7702 authorizations]
* xref:api:utils/cryptography.adoc#SignerEIP7702[`SignerEIP7702`]: Checks EOA signatures delegated to this signer using https://eips.ethereum.org/EIPS/eip-7702#set-code-transaction[EIP-7702 authorizations]
* xref:api:utils/cryptography.adoc#SignerERC7913[`SignerERC7913`]: Verifies generalized signatures following https://eips.ethereum.org/EIPS/eip-7913[ERC-7913].
* https://docs.openzeppelin.com/community-contracts/0.0.1/api/utils#SignerZKEmail[`SignerZKEmail`]: Enables email-based authentication for smart contracts using zero knowledge proofs of email authority signatures.
* xref:api:utils/cryptography.adoc#MultiSignerERC7913[`MultiSignerERC7913`]: Allows using multiple ERC-7913 signers with a threshold-based signature verification system.
Expand Down Expand Up @@ -96,9 +96,9 @@ Here's an example of how to use batched execution using EIP-7702:
----
import {Account} from "@openzeppelin/community-contracts/account/Account.sol";
import {ERC7821} from "@openzeppelin/community-contracts/account/extensions/draft-ERC7821.sol";
import {SignerERC7702} from "@openzeppelin/community-contracts/utils/cryptography/SignerERC7702.sol";
import {SignerEIP7702} from "@openzeppelin/community-contracts/utils/cryptography/SignerEIP7702.sol";

contract MyAccount is Account, SignerERC7702, ERC7821 {
contract MyAccount is Account, SignerEIP7702, ERC7821 {
// Override to allow the entrypoint to execute batches
function _erc7821AuthorizedExecutor(
address caller,
Expand Down
4 changes: 2 additions & 2 deletions docs/modules/ROOT/pages/eoa-delegation.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This section walks you through the process of delegating an EOA to a contract fo

== Delegating execution

EIP-7702 enables EOAs to delegate their execution capabilities to smart contracts, effectively bridging the gap between traditional and xref:accounts.adoc[Smart Accounts]. The xref:api:utils/cryptography.adoc#[`SignerERC7702`] utility facilitates this delegation by verifying signatures against the EOA's address (`address(this)`), making it easier to implement EIP-7702 in smart contract accounts.
EIP-7702 enables EOAs to delegate their execution capabilities to smart contracts, effectively bridging the gap between traditional and xref:accounts.adoc[Smart Accounts]. The xref:api:utils/cryptography.adoc#[`SignerEIP7702`] utility facilitates this delegation by verifying signatures against the EOA's address (`address(this)`), making it easier to implement EIP-7702 in smart contract accounts.

[source,solidity]
----
Expand Down Expand Up @@ -86,7 +86,7 @@ WARNING: Updating the delegation designator may render your EOA unusable due to

== Using with ERC-4337

The ability to set code to execute logic on an EOA allows users to leverage ERC-4337 infrastructure to process user operations. Developers only need to combine an xref:api:account.adoc#Account[`Account`] contract with an xref:api:utils/cryptography.adoc#SignerERC7702[`SignerERC7702`] to accomplish ERC-4337 compliance out of the box.
The ability to set code to execute logic on an EOA allows users to leverage ERC-4337 infrastructure to process user operations. Developers only need to combine an xref:api:account.adoc#Account[`Account`] contract with an xref:api:utils/cryptography.adoc#SignerEIP7702[`SignerEIP7702`] to accomplish ERC-4337 compliance out of the box.

=== Sending a UserOp

Expand Down
Loading