diff --git a/certora/harnesses/AccountHarness.sol b/certora/harnesses/AccountHarness.sol index 5051702103b..5cd1e538ba8 100644 --- a/certora/harnesses/AccountHarness.sol +++ b/certora/harnesses/AccountHarness.sol @@ -1,11 +1,11 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.26; -import {AccountERC7702WithModulesMock} from "../patched/mocks/account/AccountMock.sol"; +import {AccountEIP7702WithModulesMock} from "../patched/mocks/account/AccountMock.sol"; import {EIP712} from "../patched/utils/cryptography/EIP712.sol"; import {EnumerableSet} from "../patched/utils/structs/EnumerableSet.sol"; -contract AccountHarness is AccountERC7702WithModulesMock { +contract AccountHarness is AccountEIP7702WithModulesMock { using EnumerableSet for EnumerableSet.AddressSet; constructor(string memory name, string memory version) EIP712(name, version) {} diff --git a/contracts/account/extensions/draft-AccountERC7579.sol b/contracts/account/extensions/draft-AccountERC7579.sol index 2302d8359b6..7ba2b92bb4d 100644 --- a/contracts/account/extensions/draft-AccountERC7579.sol +++ b/contracts/account/extensions/draft-AccountERC7579.sol @@ -400,7 +400,7 @@ abstract contract AccountERC7579 is Account, IERC1271, IERC7579Execution, IERC75 * actual copy. However, this would require `_installModule` to get a calldata bytes object instead of a memory * bytes object. This would prevent calling `_installModule` from a contract constructor and would force the use * of external initializers. That may change in the future, as most accounts will probably be deployed as - * clones/proxy/ERC-7702 delegates and therefore rely on initializers anyway. + * clones/proxy/EIP-7702 delegates and therefore rely on initializers anyway. */ function _decodeFallbackData( bytes memory data diff --git a/contracts/account/utils/EIP7702Utils.sol b/contracts/account/utils/EIP7702Utils.sol index df9ca8acc81..974b5ef6642 100644 --- a/contracts/account/utils/EIP7702Utils.sol +++ b/contracts/account/utils/EIP7702Utils.sol @@ -6,7 +6,7 @@ pragma solidity ^0.8.20; /** * @dev Library with common EIP-7702 utility functions. * - * See https://eips.ethereum.org/EIPS/eip-7702[ERC-7702]. + * See https://eips.ethereum.org/EIPS/eip-7702[EIP-7702]. */ library EIP7702Utils { bytes3 internal constant EIP7702_PREFIX = 0xef0100; diff --git a/contracts/mocks/account/AccountMock.sol b/contracts/mocks/account/AccountMock.sol index b5e17bf42c7..ae526c8e817 100644 --- a/contracts/mocks/account/AccountMock.sol +++ b/contracts/mocks/account/AccountMock.sol @@ -81,7 +81,7 @@ abstract contract AccountWebAuthnMock is Account, SignerWebAuthn, ERC7739, ERC78 } } -abstract contract AccountERC7702Mock is Account, SignerEIP7702, ERC7739, ERC7821, ERC721Holder, ERC1155Holder { +abstract contract AccountEIP7702Mock is Account, SignerEIP7702, ERC7739, ERC7821, ERC721Holder, ERC1155Holder { /// @inheritdoc ERC7821 function _erc7821AuthorizedExecutor( address caller, @@ -92,7 +92,7 @@ abstract contract AccountERC7702Mock is Account, SignerEIP7702, ERC7739, ERC7821 } } -abstract contract AccountERC7702WithModulesMock is +abstract contract AccountEIP7702WithModulesMock is Account, AccountERC7579, SignerEIP7702, @@ -119,7 +119,7 @@ abstract contract AccountERC7702WithModulesMock is return erc7739magic == bytes4(0xffffffff) ? AccountERC7579.isValidSignature(hash, signature) : erc7739magic; } - /// @dev Enable signature using the ERC-7702 signer. + /// @dev Enable signature using the EIP-7702 signer. function _rawSignatureValidation( bytes32 hash, bytes calldata signature diff --git a/contracts/mocks/docs/account/MyAccountERC7702.sol b/contracts/mocks/docs/account/MyAccountEIP7702.sol similarity index 89% rename from contracts/mocks/docs/account/MyAccountERC7702.sol rename to contracts/mocks/docs/account/MyAccountEIP7702.sol index e28b578a0da..b7d8052c21d 100644 --- a/contracts/mocks/docs/account/MyAccountERC7702.sol +++ b/contracts/mocks/docs/account/MyAccountEIP7702.sol @@ -1,4 +1,4 @@ -// contracts/MyAccountERC7702.sol +// contracts/MyAccountEIP7702.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.20; @@ -8,7 +8,7 @@ import {ERC1155Holder} from "../../../token/ERC1155/utils/ERC1155Holder.sol"; import {ERC7821} from "../../../account/extensions/draft-ERC7821.sol"; import {SignerEIP7702} from "../../../utils/cryptography/signers/SignerEIP7702.sol"; -contract MyAccountERC7702 is Account, SignerEIP7702, ERC7821, ERC721Holder, ERC1155Holder { +contract MyAccountEIP7702 is Account, SignerEIP7702, ERC7821, ERC721Holder, ERC1155Holder { /// @dev Allows the entry point as an authorized executor. function _erc7821AuthorizedExecutor( address caller, diff --git a/contracts/utils/cryptography/signers/SignerEIP7702.sol b/contracts/utils/cryptography/signers/SignerEIP7702.sol index a129445eda2..393b1702320 100644 --- a/contracts/utils/cryptography/signers/SignerEIP7702.sol +++ b/contracts/utils/cryptography/signers/SignerEIP7702.sol @@ -7,7 +7,7 @@ import {AbstractSigner} from "./AbstractSigner.sol"; import {ECDSA} from "../ECDSA.sol"; /** - * @dev Implementation of {AbstractSigner} for implementation for an EOA. Useful for ERC-7702 accounts. + * @dev Implementation of {AbstractSigner} for implementation for an EOA. Useful for EIP-7702 accounts. * * @custom:stateless */ diff --git a/docs/modules/ROOT/pages/accounts.adoc b/docs/modules/ROOT/pages/accounts.adoc index 5d42eaf36ac..78e44ff639a 100644 --- a/docs/modules/ROOT/pages/accounts.adoc +++ b/docs/modules/ROOT/pages/accounts.adoc @@ -343,7 +343,7 @@ https://eips.ethereum.org/EIPS/eip-7702[EIP-7702] lets EOAs delegate to smart co The signature verification stays compatible: delegated EOAs are treated as contracts using ERC-1271, making it easy to redelegate to a contract with ERC-1271 support with little overhead by reusing the validation mechanism of the account. -TIP: Learn more about delegating to an ERC-7702 account in our xref:eoa-delegation.adoc[EOA Delegation] section. +TIP: Learn more about delegating to an EIP-7702 account in our xref:eoa-delegation.adoc[EOA Delegation] section. === ERC-7579 Modules diff --git a/docs/modules/ROOT/pages/eoa-delegation.adoc b/docs/modules/ROOT/pages/eoa-delegation.adoc index 088b0a83f4e..f81b6f847a1 100644 --- a/docs/modules/ROOT/pages/eoa-delegation.adoc +++ b/docs/modules/ROOT/pages/eoa-delegation.adoc @@ -6,7 +6,7 @@ https://eips.ethereum.org/EIPS/eip-7702[EIP-7702] introduces a new transaction t * Sponsoring transactions for other users. * Implementing privilege de-escalation (e.g., sub-keys with limited permissions) -This section walks you through the process of delegating an EOA to a contract following https://eips.ethereum.org/EIPS/eip-7702[ERC-7702]. This allows you to use your EOA's private key to sign and execute operations with custom execution logic. Combined with https://eips.ethereum.org/EIPS/eip-4337[ERC-4337] infrastructure, users can achieve gas sponsoring through https://docs.openzeppelin.com/community-contracts/paymasters[paymasters]. +This section walks you through the process of delegating an EOA to a contract following https://eips.ethereum.org/EIPS/eip-7702[EIP-7702]. This allows you to use your EOA's private key to sign and execute operations with custom execution logic. Combined with https://eips.ethereum.org/EIPS/eip-4337[ERC-4337] infrastructure, users can achieve gas sponsoring through https://docs.openzeppelin.com/community-contracts/paymasters[paymasters]. == Delegating execution @@ -14,7 +14,7 @@ EIP-7702 enables EOAs to delegate their execution capabilities to smart contract [source,solidity] ---- -include::api:example$account/MyAccountERC7702.sol[] +include::api:example$account/MyAccountEIP7702.sol[] ---- TIP: Users can delegate to an instance of xref:api:account.adoc#ERC7821[`ERC-7821`] for a minimal batch executor that does not use ERC-4337 related code. diff --git a/scripts/upgradeable/upgradeable.patch b/scripts/upgradeable/upgradeable.patch index cb6ae7e7d37..d5529e4ffa3 100644 --- a/scripts/upgradeable/upgradeable.patch +++ b/scripts/upgradeable/upgradeable.patch @@ -361,30 +361,30 @@ index 304d1386a..a1cd63bee 100644 -@openzeppelin/contracts/=contracts/ +@openzeppelin/contracts-upgradeable/=contracts/ +@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/ -diff --git a/test/account/AccountERC7702.test.js b/test/account/AccountERC7702.test.js +diff --git a/test/account/AccountEIP7702.test.js b/test/account/AccountEIP7702.test.js index f442d49af..8f22dc926 100644 ---- a/test/account/AccountERC7702.test.js -+++ b/test/account/AccountERC7702.test.js +--- a/test/account/AccountEIP7702.test.js ++++ b/test/account/AccountEIP7702.test.js @@ -26,8 +26,8 @@ async function fixture() { // domain cannot be fetched using getDomain(mock) before the mock is deployed const domain = { -- name: 'AccountERC7702Mock', +- name: 'AccountEIP7702Mock', - version: '1', + name: '', // Not initialized in the context of signer + version: '', // Not initialized in the context of signer chainId: entrypointDomain.chainId, verifyingContract: mock.address, }; -diff --git a/test/account/examples/AccountERC7702WithModulesMock.test.js b/test/account/examples/AccountERC7702WithModulesMock.test.js +diff --git a/test/account/examples/AccountEIP7702WithModulesMock.test.js b/test/account/examples/AccountEIP7702WithModulesMock.test.js index 8ceab19d1..c3f4194a6 100644 ---- a/test/account/examples/AccountERC7702WithModulesMock.test.js -+++ b/test/account/examples/AccountERC7702WithModulesMock.test.js +--- a/test/account/examples/AccountEIP7702WithModulesMock.test.js ++++ b/test/account/examples/AccountEIP7702WithModulesMock.test.js @@ -36,8 +36,8 @@ async function fixture() { // domain cannot be fetched using getDomain(mock) before the mock is deployed const domain = { -- name: 'AccountERC7702WithModulesMock', +- name: 'AccountEIP7702WithModulesMock', - version: '1', + name: '', // Not initialized in the context of signer + version: '', // Not initialized in the context of signer diff --git a/test/account/AccountERC7702.t.sol b/test/account/AccountEIP7702.t.sol similarity index 91% rename from test/account/AccountERC7702.t.sol rename to test/account/AccountEIP7702.t.sol index c8c685ffb3a..b14ef17c5c4 100644 --- a/test/account/AccountERC7702.t.sol +++ b/test/account/AccountEIP7702.t.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.20; import {Test} from "forge-std/Test.sol"; -import {AccountERC7702Mock} from "@openzeppelin/contracts/mocks/account/AccountMock.sol"; +import {AccountEIP7702Mock} from "@openzeppelin/contracts/mocks/account/AccountMock.sol"; import {CallReceiverMock} from "@openzeppelin/contracts/mocks/CallReceiverMock.sol"; import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol"; import { @@ -17,11 +17,11 @@ import {Strings} from "@openzeppelin/contracts/utils/Strings.sol"; import {PackedUserOperation} from "@openzeppelin/contracts/interfaces/draft-IERC4337.sol"; import {ERC7821} from "@openzeppelin/contracts/account/extensions/draft-ERC7821.sol"; -contract AccountERC7702MockConstructor is AccountERC7702Mock { +contract AccountEIP7702MockConstructor is AccountEIP7702Mock { constructor() EIP712("MyAccount", "1") {} } -contract AccountERC7702Test is Test { +contract AccountEIP7702Test is Test { using ERC7579Utils for *; using ERC4337Utils for PackedUserOperation; using Strings for *; @@ -33,7 +33,7 @@ contract AccountERC7702Test is Test { // ERC-4337 signer uint256 private _signerPrivateKey; - AccountERC7702MockConstructor private _signer; + AccountEIP7702MockConstructor private _signer; function setUp() public { // Deploy target contract @@ -41,11 +41,11 @@ contract AccountERC7702Test is Test { // Setup signer _signerPrivateKey = 0x1234; - _signer = AccountERC7702MockConstructor(payable(vm.addr(_signerPrivateKey))); + _signer = AccountEIP7702MockConstructor(payable(vm.addr(_signerPrivateKey))); vm.deal(address(_signer), MAX_ETH); // Sign and attach delegation - vm.signAndAttachDelegation(address(new AccountERC7702MockConstructor()), _signerPrivateKey); + vm.signAndAttachDelegation(address(new AccountEIP7702MockConstructor()), _signerPrivateKey); // Setup entrypoint address entrypoint = address(ERC4337Utils.ENTRYPOINT_V08); diff --git a/test/account/AccountERC7702.test.js b/test/account/AccountEIP7702.test.js similarity index 90% rename from test/account/AccountERC7702.test.js rename to test/account/AccountEIP7702.test.js index f442d49af41..e9b2bdef15a 100644 --- a/test/account/AccountERC7702.test.js +++ b/test/account/AccountEIP7702.test.js @@ -19,14 +19,14 @@ async function fixture() { // ERC-4337 account const helper = new ERC4337Helper(); - const mock = await helper.newAccount('$AccountERC7702Mock', ['AccountERC7702Mock', '1'], { erc7702signer: signer }); + const mock = await helper.newAccount('$AccountEIP7702Mock', ['AccountEIP7702Mock', '1'], { eip7702signer: signer }); // ERC-4337 Entrypoint domain const entrypointDomain = await getDomain(predeploy.entrypoint.v08); // domain cannot be fetched using getDomain(mock) before the mock is deployed const domain = { - name: 'AccountERC7702Mock', + name: 'AccountEIP7702Mock', version: '1', chainId: entrypointDomain.chainId, verifyingContract: mock.address, @@ -40,7 +40,7 @@ async function fixture() { return { helper, mock, domain, signer, target, beneficiary, other, signUserOp }; } -describe('AccountERC7702', function () { +describe('AccountEIP7702', function () { beforeEach(async function () { Object.assign(this, await loadFixture(fixture)); }); diff --git a/test/account/examples/AccountERC7702WithModulesMock.test.js b/test/account/examples/AccountEIP7702WithModulesMock.test.js similarity index 91% rename from test/account/examples/AccountERC7702WithModulesMock.test.js rename to test/account/examples/AccountEIP7702WithModulesMock.test.js index 8ceab19d1bd..8de7dfeeb02 100644 --- a/test/account/examples/AccountERC7702WithModulesMock.test.js +++ b/test/account/examples/AccountEIP7702WithModulesMock.test.js @@ -27,8 +27,8 @@ async function fixture() { // ERC-4337 account const helper = new ERC4337Helper(); - const mock = await helper.newAccount('$AccountERC7702WithModulesMock', ['AccountERC7702WithModulesMock', '1'], { - erc7702signer: eoa, + const mock = await helper.newAccount('$AccountEIP7702WithModulesMock', ['AccountEIP7702WithModulesMock', '1'], { + eip7702signer: eoa, }); // ERC-4337 Entrypoint domain @@ -36,7 +36,7 @@ async function fixture() { // domain cannot be fetched using getDomain(mock) before the mock is deployed const domain = { - name: 'AccountERC7702WithModulesMock', + name: 'AccountEIP7702WithModulesMock', version: '1', chainId: entrypointDomain.chainId, verifyingContract: mock.address, @@ -45,12 +45,12 @@ async function fixture() { return { helper, validator, mock, domain, entrypointDomain, eoa, target, anotherTarget, beneficiary, other }; } -describe('AccountERC7702WithModules: ERC-7702 account with ERC-7579 modules supports', function () { +describe('AccountEIP7702WithModules: EIP-7702 account with ERC-7579 modules supports', function () { beforeEach(async function () { Object.assign(this, await loadFixture(fixture)); }); - describe('using ERC-7702 signer', function () { + describe('using EIP-7702 signer', function () { beforeEach(async function () { this.signer = this.eoa; this.signUserOp = userOp => @@ -86,7 +86,7 @@ describe('AccountERC7702WithModules: ERC-7702 account with ERC-7579 modules supp // Use the first 20 bytes from the nonce key (24 bytes) to identify the validator module this.userOp = { nonce: ethers.zeroPadBytes(ethers.hexlify(this.validator.target), 32) }; - // Deploy (using ERC-7702) and add the validator module using EOA + // Deploy (using EIP-7702) and add the validator module using EOA await this.mock.deploy(); await this.mock.connect(this.eoa).installModule(MODULE_TYPE_VALIDATOR, this.validator, this.signer.address); }); diff --git a/test/helpers/erc4337.js b/test/helpers/erc4337.js index 2451fd361f9..847834980e7 100644 --- a/test/helpers/erc4337.js +++ b/test/helpers/erc4337.js @@ -109,11 +109,11 @@ class ERC4337Helper { const accountFactory = await ethers.getContractFactory(name); - if (params.erc7702signer) { + if (params.eip7702signer) { const delegate = await accountFactory.deploy(...extraArgs); - const instance = await params.erc7702signer.getAddress().then(address => accountFactory.attach(address)); - const authorization = await params.erc7702signer.authorize({ address: delegate.target }); - return new ERC7702SmartAccount(instance, authorization, env); + const instance = await params.eip7702signer.getAddress().then(address => accountFactory.attach(address)); + const authorization = await params.eip7702signer.authorize({ address: delegate.target }); + return new EIP7702SmartAccount(instance, authorization, env); } else { const initCode = await accountFactory .getDeployTransaction(...extraArgs) @@ -163,7 +163,7 @@ class SmartAccount extends ethers.BaseContract { } } -class ERC7702SmartAccount extends SmartAccount { +class EIP7702SmartAccount extends SmartAccount { constructor(instance, authorization, env) { super(instance, undefined, env); this.authorization = authorization;