Skip to content

Commit 858f035

Browse files
committed
refactor: rename upgradeablemodularaccount to referencemodularaccount
1 parent 094605e commit 858f035

26 files changed

+128
-137
lines changed

script/Deploy.s.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";
88

99
import {AccountFactory} from "../src/account/AccountFactory.sol";
1010

11+
import {ReferenceModularAccount} from "../src/account/ReferenceModularAccount.sol";
1112
import {SemiModularAccount} from "../src/account/SemiModularAccount.sol";
12-
import {UpgradeableModularAccount} from "../src/account/UpgradeableModularAccount.sol";
1313
import {SingleSignerValidationModule} from "../src/modules/validation/SingleSignerValidationModule.sol";
1414

1515
contract DeployScript is Script {
@@ -51,7 +51,7 @@ contract DeployScript is Script {
5151

5252
address addr = Create2.computeAddress(
5353
salt,
54-
keccak256(abi.encodePacked(type(UpgradeableModularAccount).creationCode, abi.encode(entryPoint))),
54+
keccak256(abi.encodePacked(type(ReferenceModularAccount).creationCode, abi.encode(entryPoint))),
5555
CREATE2_FACTORY
5656
);
5757
if (addr != expected) {
@@ -63,7 +63,7 @@ contract DeployScript is Script {
6363

6464
if (addr.code.length == 0) {
6565
console.log("No code found at expected address, deploying...");
66-
UpgradeableModularAccount deployed = new UpgradeableModularAccount{salt: salt}(entryPoint);
66+
ReferenceModularAccount deployed = new ReferenceModularAccount{salt: salt}(entryPoint);
6767

6868
if (address(deployed) != expected) {
6969
console.log("Deployed address mismatch");
@@ -166,7 +166,7 @@ contract DeployScript is Script {
166166
console.log("No code found at expected address, deploying...");
167167
AccountFactory deployed = new AccountFactory{salt: salt}(
168168
entryPoint,
169-
UpgradeableModularAccount(payable(accountImpl)),
169+
ReferenceModularAccount(payable(accountImpl)),
170170
SemiModularAccount(payable(semiModularAccountImpl)),
171171
singleSignerValidationModule,
172172
owner

src/account/AccountFactory.sol

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
77
import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";
88
import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";
99

10+
import {ReferenceModularAccount} from "../account/ReferenceModularAccount.sol";
1011
import {SemiModularAccount} from "../account/SemiModularAccount.sol";
11-
import {UpgradeableModularAccount} from "../account/UpgradeableModularAccount.sol";
1212
import {ValidationConfigLib} from "../helpers/ValidationConfigLib.sol";
1313

1414
import {LibClone} from "solady/utils/LibClone.sol";
1515

1616
contract AccountFactory is Ownable {
17-
UpgradeableModularAccount public immutable ACCOUNT_IMPL;
17+
ReferenceModularAccount public immutable ACCOUNT_IMPL;
1818
SemiModularAccount public immutable SEMI_MODULAR_ACCOUNT_IMPL;
1919
bytes32 private immutable _PROXY_BYTECODE_HASH;
2020
IEntryPoint public immutable ENTRY_POINT;
@@ -25,7 +25,7 @@ contract AccountFactory is Ownable {
2525

2626
constructor(
2727
IEntryPoint _entryPoint,
28-
UpgradeableModularAccount _accountImpl,
28+
ReferenceModularAccount _accountImpl,
2929
SemiModularAccount _semiModularImpl,
3030
address _singleSignerValidationModule,
3131
address owner
@@ -47,7 +47,7 @@ contract AccountFactory is Ownable {
4747
*/
4848
function createAccount(address owner, uint256 salt, uint32 entityId)
4949
external
50-
returns (UpgradeableModularAccount)
50+
returns (ReferenceModularAccount)
5151
{
5252
bytes32 combinedSalt = getSalt(owner, salt, entityId);
5353
address addr = Create2.computeAddress(combinedSalt, _PROXY_BYTECODE_HASH);
@@ -58,7 +58,7 @@ contract AccountFactory is Ownable {
5858
// not necessary to check return addr since next call will fail if so
5959
new ERC1967Proxy{salt: combinedSalt}(address(ACCOUNT_IMPL), "");
6060
// point proxy to actual implementation and init plugins
61-
UpgradeableModularAccount(payable(addr)).initializeWithValidation(
61+
ReferenceModularAccount(payable(addr)).initializeWithValidation(
6262
ValidationConfigLib.pack(SINGLE_SIGNER_VALIDATION_MODULE, entityId, true, true),
6363
new bytes4[](0),
6464
pluginInstallData,
@@ -67,7 +67,7 @@ contract AccountFactory is Ownable {
6767
emit ModularAccountDeployed(addr, owner, salt);
6868
}
6969

70-
return UpgradeableModularAccount(payable(addr));
70+
return ReferenceModularAccount(payable(addr));
7171
}
7272

7373
function createSemiModularAccount(address owner, uint256 salt) external returns (SemiModularAccount) {

src/account/AccountStorage.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet
55

66
import {HookConfig, ModuleEntity} from "../interfaces/IModularAccount.sol";
77

8-
// bytes = keccak256("ERC6900.UpgradeableModularAccount.Storage")
9-
bytes32 constant _ACCOUNT_STORAGE_SLOT = 0x9f09680beaa4e5c9f38841db2460c401499164f368baef687948c315d9073e40;
8+
// bytes = keccak256("ERC6900.ReferenceModularAccount.Storage")
9+
bytes32 constant _ACCOUNT_STORAGE_SLOT = 0xc531f081ecdb5a90f38c197521797881a6e5c752a7d451780f325a95f8b91f45;
1010

1111
// Represents data associated with a specifc function selector.
1212
struct ExecutionData {

src/account/UpgradeableModularAccount.sol renamed to src/account/ReferenceModularAccount.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import {AccountStorage, getAccountStorage, toHookConfig, toSetValue} from "./Acc
2929
import {AccountStorageInitializable} from "./AccountStorageInitializable.sol";
3030
import {ModuleManagerInternals} from "./ModuleManagerInternals.sol";
3131

32-
contract UpgradeableModularAccount is
32+
contract ReferenceModularAccount is
3333
IModularAccount,
3434
AccountExecutor,
3535
AccountLoupe,

src/account/SemiModularAccount.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: GPL-3.0
22
pragma solidity ^0.8.25;
33

4-
import {UpgradeableModularAccount} from "./UpgradeableModularAccount.sol";
4+
import {ReferenceModularAccount} from "./ReferenceModularAccount.sol";
55
import {IEntryPoint} from "@eth-infinitism/account-abstraction/interfaces/IEntryPoint.sol";
66
import {PackedUserOperation} from "@eth-infinitism/account-abstraction/interfaces/PackedUserOperation.sol";
77

@@ -13,7 +13,7 @@ import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/Messa
1313
import {SignatureChecker} from "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol";
1414
import {LibClone} from "solady/utils/LibClone.sol";
1515

16-
contract SemiModularAccount is UpgradeableModularAccount {
16+
contract SemiModularAccount is ReferenceModularAccount {
1717
using MessageHashUtils for bytes32;
1818
using ModuleEntityLib for ModuleEntity;
1919

@@ -46,7 +46,7 @@ contract SemiModularAccount is UpgradeableModularAccount {
4646
error FallbackSignerDisabled();
4747
error InitializerDisabled();
4848

49-
constructor(IEntryPoint anEntryPoint) UpgradeableModularAccount(anEntryPoint) {}
49+
constructor(IEntryPoint anEntryPoint) ReferenceModularAccount(anEntryPoint) {}
5050

5151
/// @notice Updates the fallback signer address in storage.
5252
/// @dev This function causes the fallback signer getter to ignore the bytecode signer if it is nonzero. It can

test/account/AccountFactory.t.sol

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ pragma solidity ^0.8.19;
33

44
import {AccountFactory} from "../../src/account/AccountFactory.sol";
55

6+
import {ReferenceModularAccount} from "../../src/account/ReferenceModularAccount.sol";
67
import {SemiModularAccount} from "../../src/account/SemiModularAccount.sol";
7-
import {UpgradeableModularAccount} from "../../src/account/UpgradeableModularAccount.sol";
88
import {AccountTestBase} from "../utils/AccountTestBase.sol";
99

1010
contract AccountFactoryTest is AccountTestBase {
1111
AccountFactory internal _factory;
12-
UpgradeableModularAccount internal _account;
12+
ReferenceModularAccount internal _account;
1313
SemiModularAccount internal _semiModularAccount;
1414

1515
function setUp() public {
16-
_account = new UpgradeableModularAccount(entryPoint);
16+
_account = new ReferenceModularAccount(entryPoint);
1717
_semiModularAccount = new SemiModularAccount(entryPoint);
1818

1919
_factory = new AccountFactory(
@@ -22,23 +22,23 @@ contract AccountFactoryTest is AccountTestBase {
2222
}
2323

2424
function test_createAccount() public {
25-
UpgradeableModularAccount account = _factory.createAccount(address(this), 100, 0);
25+
ReferenceModularAccount account = _factory.createAccount(address(this), 100, 0);
2626

2727
assertEq(address(account.entryPoint()), address(entryPoint));
2828
}
2929

3030
function test_createAccountAndGetAddress() public {
31-
UpgradeableModularAccount account = _factory.createAccount(address(this), 100, 0);
31+
ReferenceModularAccount account = _factory.createAccount(address(this), 100, 0);
3232

3333
assertEq(address(account), address(_factory.createAccount(address(this), 100, 0)));
3434
}
3535

3636
function test_multipleDeploy() public {
37-
UpgradeableModularAccount account = _factory.createAccount(address(this), 100, 0);
37+
ReferenceModularAccount account = _factory.createAccount(address(this), 100, 0);
3838

3939
uint256 startGas = gasleft();
4040

41-
UpgradeableModularAccount account2 = _factory.createAccount(address(this), 100, 0);
41+
ReferenceModularAccount account2 = _factory.createAccount(address(this), 100, 0);
4242

4343
// Assert that the 2nd deployment call cost less than 1 sstore
4444
// Implies that no deployment was done on the second calls

test/account/DirectCallsFromModule.t.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: UNLICENSED
22
pragma solidity ^0.8.19;
33

4-
import {UpgradeableModularAccount} from "../../src/account/UpgradeableModularAccount.sol";
4+
import {ReferenceModularAccount} from "../../src/account/ReferenceModularAccount.sol";
55

66
import {HookConfigLib} from "../../src/helpers/HookConfigLib.sol";
77
import {ModuleEntity, ModuleEntityLib} from "../../src/helpers/ModuleEntityLib.sol";
@@ -155,6 +155,6 @@ contract DirectCallsFromModuleTest is AccountTestBase {
155155
}
156156

157157
function _buildDirectCallDisallowedError(bytes4 selector) internal pure returns (bytes memory) {
158-
return abi.encodeWithSelector(UpgradeableModularAccount.ValidationFunctionMissing.selector, selector);
158+
return abi.encodeWithSelector(ReferenceModularAccount.ValidationFunctionMissing.selector, selector);
159159
}
160160
}

test/account/GlobalValidationTest.t.sol

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pragma solidity ^0.8.25;
44
import {PackedUserOperation} from "@eth-infinitism/account-abstraction/interfaces/PackedUserOperation.sol";
55
import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol";
66

7-
import {UpgradeableModularAccount} from "../../src/account/UpgradeableModularAccount.sol";
7+
import {ReferenceModularAccount} from "../../src/account/ReferenceModularAccount.sol";
88
import {ModuleEntityLib} from "../../src/helpers/ModuleEntityLib.sol";
99

1010
import {AccountTestBase} from "../utils/AccountTestBase.sol";
@@ -17,13 +17,13 @@ contract GlobalValidationTest is AccountTestBase {
1717
// A separate account and owner that isn't deployed yet, used to test initcode
1818
address public owner2;
1919
uint256 public owner2Key;
20-
UpgradeableModularAccount public account2;
20+
ReferenceModularAccount public account2;
2121

2222
function setUp() public {
2323
(owner2, owner2Key) = makeAddrAndKey("owner2");
2424

2525
// Compute counterfactual address
26-
account2 = UpgradeableModularAccount(payable(factory.getAddress(owner2, 0)));
26+
account2 = ReferenceModularAccount(payable(factory.getAddress(owner2, 0)));
2727
vm.deal(address(account2), 100 ether);
2828

2929
_signerValidation =
@@ -38,7 +38,7 @@ contract GlobalValidationTest is AccountTestBase {
3838
sender: address(account2),
3939
nonce: 0,
4040
initCode: abi.encodePacked(address(factory), abi.encodeCall(factory.createAccount, (owner2, 0))),
41-
callData: abi.encodeCall(UpgradeableModularAccount.execute, (ethRecipient, 1 wei, "")),
41+
callData: abi.encodeCall(ReferenceModularAccount.execute, (ethRecipient, 1 wei, "")),
4242
accountGasLimits: _encodeGas(VERIFICATION_GAS_LIMIT, CALL_GAS_LIMIT),
4343
preVerificationGas: 0,
4444
gasFees: _encodeGas(1, 1),
@@ -65,7 +65,7 @@ contract GlobalValidationTest is AccountTestBase {
6565

6666
vm.prank(owner2);
6767
account2.executeWithAuthorization(
68-
abi.encodeCall(UpgradeableModularAccount.execute, (ethRecipient, 1 wei, "")),
68+
abi.encodeCall(ReferenceModularAccount.execute, (ethRecipient, 1 wei, "")),
6969
_encodeSignature(_signerValidation, GLOBAL_VALIDATION, "")
7070
);
7171

test/account/MultiValidation.t.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/Messa
77

88
import {IEntryPoint} from "@eth-infinitism/account-abstraction/interfaces/IEntryPoint.sol";
99

10-
import {UpgradeableModularAccount} from "../../src/account/UpgradeableModularAccount.sol";
10+
import {ReferenceModularAccount} from "../../src/account/ReferenceModularAccount.sol";
1111

1212
import {ModuleEntityLib} from "../../src/helpers/ModuleEntityLib.sol";
1313
import {ValidationConfigLib} from "../../src/helpers/ValidationConfigLib.sol";
@@ -62,7 +62,7 @@ contract MultiValidationTest is AccountTestBase {
6262
vm.prank(owner1);
6363
vm.expectRevert(
6464
abi.encodeWithSelector(
65-
UpgradeableModularAccount.RuntimeValidationFunctionReverted.selector,
65+
ReferenceModularAccount.RuntimeValidationFunctionReverted.selector,
6666
address(validator2),
6767
TEST_DEFAULT_VALIDATION_ENTITY_ID,
6868
abi.encodeWithSignature("NotAuthorized()")
@@ -93,7 +93,7 @@ contract MultiValidationTest is AccountTestBase {
9393
sender: address(account1),
9494
nonce: 0,
9595
initCode: "",
96-
callData: abi.encodeCall(UpgradeableModularAccount.execute, (address(0), 0, "")),
96+
callData: abi.encodeCall(ReferenceModularAccount.execute, (address(0), 0, "")),
9797
accountGasLimits: _encodeGas(VERIFICATION_GAS_LIMIT, CALL_GAS_LIMIT),
9898
preVerificationGas: 0,
9999
gasFees: _encodeGas(1, 1),

0 commit comments

Comments
 (0)