Skip to content

Commit 0fc8e4b

Browse files
akronim26Amxx
andauthored
Rename SignerERC7702 as SignerEIP7702 (#5932)
Co-authored-by: Hadrien Croubois <[email protected]>
1 parent dc9c900 commit 0fc8e4b

File tree

7 files changed

+17
-16
lines changed

7 files changed

+17
-16
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
### Breaking changes
88

9+
- `SignerERC7702` is renamed as `SignerEIP7702`. Imports and inheritance must be updated to that new name and path. Behavior is unmodified.
910
- 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))
1011

1112
### Deprecation

contracts/mocks/account/AccountMock.sol

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {SignerECDSA} from "../../utils/cryptography/signers/SignerECDSA.sol";
1616
import {SignerP256} from "../../utils/cryptography/signers/SignerP256.sol";
1717
import {SignerRSA} from "../../utils/cryptography/signers/SignerRSA.sol";
1818
import {SignerWebAuthn} from "../../utils/cryptography/signers/SignerWebAuthn.sol";
19-
import {SignerERC7702} from "../../utils/cryptography/signers/SignerERC7702.sol";
19+
import {SignerEIP7702} from "../../utils/cryptography/signers/SignerEIP7702.sol";
2020
import {SignerERC7913} from "../../utils/cryptography/signers/SignerERC7913.sol";
2121
import {MultiSignerERC7913} from "../../utils/cryptography/signers/MultiSignerERC7913.sol";
2222
import {MultiSignerERC7913Weighted} from "../../utils/cryptography/signers/MultiSignerERC7913Weighted.sol";
@@ -81,7 +81,7 @@ abstract contract AccountWebAuthnMock is Account, SignerWebAuthn, ERC7739, ERC78
8181
}
8282
}
8383

84-
abstract contract AccountERC7702Mock is Account, SignerERC7702, ERC7739, ERC7821, ERC721Holder, ERC1155Holder {
84+
abstract contract AccountERC7702Mock is Account, SignerEIP7702, ERC7739, ERC7821, ERC721Holder, ERC1155Holder {
8585
/// @inheritdoc ERC7821
8686
function _erc7821AuthorizedExecutor(
8787
address caller,
@@ -95,7 +95,7 @@ abstract contract AccountERC7702Mock is Account, SignerERC7702, ERC7739, ERC7821
9595
abstract contract AccountERC7702WithModulesMock is
9696
Account,
9797
AccountERC7579,
98-
SignerERC7702,
98+
SignerEIP7702,
9999
ERC7739,
100100
ERC721Holder,
101101
ERC1155Holder
@@ -122,8 +122,8 @@ abstract contract AccountERC7702WithModulesMock is
122122
function _rawSignatureValidation(
123123
bytes32 hash,
124124
bytes calldata signature
125-
) internal view virtual override(AbstractSigner, AccountERC7579, SignerERC7702) returns (bool) {
126-
return SignerERC7702._rawSignatureValidation(hash, signature);
125+
) internal view virtual override(AbstractSigner, AccountERC7579, SignerEIP7702) returns (bool) {
126+
return SignerEIP7702._rawSignatureValidation(hash, signature);
127127
}
128128
}
129129

contracts/mocks/docs/account/MyAccountERC7702.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import {Account} from "../../../account/Account.sol";
66
import {ERC721Holder} from "../../../token/ERC721/utils/ERC721Holder.sol";
77
import {ERC1155Holder} from "../../../token/ERC1155/utils/ERC1155Holder.sol";
88
import {ERC7821} from "../../../account/extensions/draft-ERC7821.sol";
9-
import {SignerERC7702} from "../../../utils/cryptography/signers/SignerERC7702.sol";
9+
import {SignerEIP7702} from "../../../utils/cryptography/signers/SignerEIP7702.sol";
1010

11-
contract MyAccountERC7702 is Account, SignerERC7702, ERC7821, ERC721Holder, ERC1155Holder {
11+
contract MyAccountERC7702 is Account, SignerEIP7702, ERC7821, ERC721Holder, ERC1155Holder {
1212
/// @dev Allows the entry point as an authorized executor.
1313
function _erc7821AuthorizedExecutor(
1414
address caller,

contracts/utils/cryptography/README.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ A collection of contracts and libraries that implement various signature validat
1717
* {AbstractSigner}: Abstract contract for internal signature validation in smart contracts.
1818
* {ERC7739}: An abstract contract to validate signatures following the rehashing scheme from {ERC7739Utils}.
1919
* {SignerECDSA}, {SignerP256}, {SignerRSA}: Implementations of an {AbstractSigner} with specific signature validation algorithms.
20-
* {SignerERC7702}: Implementation of {AbstractSigner} that validates signatures using the contract's own address as the signer, useful for delegated accounts following EIP-7702.
20+
* {SignerEIP7702}: Implementation of {AbstractSigner} that validates signatures using the contract's own address as the signer, useful for delegated accounts following EIP-7702.
2121
* {SignerWebAuthn}: Implementation of {SignerP256} that supports WebAuthn
2222
* {SignerERC7913}, {MultiSignerERC7913}, {MultiSignerERC7913Weighted}: Implementations of {AbstractSigner} that validate signatures based on ERC-7913. Including a simple and weighted multisignature scheme.
2323
* {ERC7913P256Verifier}, {ERC7913RSAVerifier}, {ERC7913WebAuthnVerifier}: Ready to use ERC-7913 signature verifiers for P256, RSA keys and WebAuthn.
@@ -56,7 +56,7 @@ A collection of contracts and libraries that implement various signature validat
5656

5757
{{SignerRSA}}
5858

59-
{{SignerERC7702}}
59+
{{SignerEIP7702}}
6060

6161
{{SignerERC7913}}
6262

contracts/utils/cryptography/signers/SignerERC7702.sol renamed to contracts/utils/cryptography/signers/SignerEIP7702.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
// OpenZeppelin Contracts (last updated v5.4.0) (utils/cryptography/signers/SignerERC7702.sol)
2+
// OpenZeppelin Contracts (last updated v5.4.0) (utils/cryptography/signers/SignerEIP7702.sol)
33

44
pragma solidity ^0.8.20;
55

@@ -11,7 +11,7 @@ import {ECDSA} from "../ECDSA.sol";
1111
*
1212
* @custom:stateless
1313
*/
14-
abstract contract SignerERC7702 is AbstractSigner {
14+
abstract contract SignerEIP7702 is AbstractSigner {
1515
/**
1616
* @dev Validates the signature using the EOA's address (i.e. `address(this)`).
1717
*/

docs/modules/ROOT/pages/accounts.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Since the minimum requirement of xref:api:account.adoc#Account[`Account`] is to
2323
* xref:api:utils/cryptography.adoc#SignerECDSA[`SignerECDSA`]: Verifies signatures produced by regular EVM Externally Owned Accounts (EOAs).
2424
* 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.
2525
* xref:api:utils/cryptography.adoc#SignerRSA[`SignerRSA`]: Verifies signatures of traditional PKI systems and X.509 certificates.
26-
* 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]
26+
* 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]
2727
* xref:api:utils/cryptography.adoc#SignerERC7913[`SignerERC7913`]: Verifies generalized signatures following https://eips.ethereum.org/EIPS/eip-7913[ERC-7913].
2828
* 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.
2929
* xref:api:utils/cryptography.adoc#MultiSignerERC7913[`MultiSignerERC7913`]: Allows using multiple ERC-7913 signers with a threshold-based signature verification system.
@@ -96,9 +96,9 @@ Here's an example of how to use batched execution using EIP-7702:
9696
----
9797
import {Account} from "@openzeppelin/community-contracts/account/Account.sol";
9898
import {ERC7821} from "@openzeppelin/community-contracts/account/extensions/draft-ERC7821.sol";
99-
import {SignerERC7702} from "@openzeppelin/community-contracts/utils/cryptography/SignerERC7702.sol";
99+
import {SignerEIP7702} from "@openzeppelin/community-contracts/utils/cryptography/SignerEIP7702.sol";
100100
101-
contract MyAccount is Account, SignerERC7702, ERC7821 {
101+
contract MyAccount is Account, SignerEIP7702, ERC7821 {
102102
// Override to allow the entrypoint to execute batches
103103
function _erc7821AuthorizedExecutor(
104104
address caller,

docs/modules/ROOT/pages/eoa-delegation.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This section walks you through the process of delegating an EOA to a contract fo
1010

1111
== Delegating execution
1212

13-
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.
13+
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.
1414

1515
[source,solidity]
1616
----
@@ -86,7 +86,7 @@ WARNING: Updating the delegation designator may render your EOA unusable due to
8686

8787
== Using with ERC-4337
8888

89-
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.
89+
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.
9090

9191
=== Sending a UserOp
9292

0 commit comments

Comments
 (0)