Skip to content

Commit b26576f

Browse files
committed
refactor: rename loupe to view
1 parent a748955 commit b26576f

File tree

7 files changed

+22
-21
lines changed

7 files changed

+22
-21
lines changed

src/account/AccountLoupe.sol renamed to src/account/ModularAccountView.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ import {EnumerableMap} from "@openzeppelin/contracts/utils/structs/EnumerableMap
66
import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
77

88
import {HookConfigLib} from "../helpers/HookConfigLib.sol";
9-
import {ExecutionDataView, IAccountLoupe, ValidationDataView} from "../interfaces/IAccountLoupe.sol";
109
import {HookConfig, IModularAccount, ModuleEntity} from "../interfaces/IModularAccount.sol";
10+
import {ExecutionDataView, IModularAccountView, ValidationDataView} from "../interfaces/IModularAccountView.sol";
1111
import {ExecutionData, ValidationData, getAccountStorage} from "./AccountStorage.sol";
1212

13-
abstract contract AccountLoupe is IAccountLoupe {
13+
abstract contract ModularAccountView is IModularAccountView {
1414
using EnumerableSet for EnumerableSet.Bytes32Set;
1515
using EnumerableMap for EnumerableMap.AddressToUintMap;
1616
using HookConfigLib for HookConfig;
1717

18-
/// @inheritdoc IAccountLoupe
18+
/// @inheritdoc IModularAccountView
1919
function getExecutionData(bytes4 selector) external view override returns (ExecutionDataView memory data) {
2020
if (
2121
selector == IModularAccount.execute.selector || selector == IModularAccount.executeBatch.selector
@@ -39,7 +39,7 @@ abstract contract AccountLoupe is IAccountLoupe {
3939
}
4040
}
4141

42-
/// @inheritdoc IAccountLoupe
42+
/// @inheritdoc IModularAccountView
4343
function getValidationData(ModuleEntity validationFunction)
4444
external
4545
view

src/account/ReferenceModularAccount.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ import {Call, IModularAccount, ModuleEntity, ValidationConfig} from "../interfac
2424
import {IValidationHookModule} from "../interfaces/IValidationHookModule.sol";
2525
import {IValidationModule} from "../interfaces/IValidationModule.sol";
2626
import {AccountExecutor} from "./AccountExecutor.sol";
27-
import {AccountLoupe} from "./AccountLoupe.sol";
2827
import {AccountStorage, getAccountStorage, toHookConfig, toSetValue} from "./AccountStorage.sol";
2928
import {AccountStorageInitializable} from "./AccountStorageInitializable.sol";
29+
import {ModularAccountView} from "./ModularAccountView.sol";
3030
import {ModuleManagerInternals} from "./ModuleManagerInternals.sol";
3131

3232
contract ReferenceModularAccount is
3333
IModularAccount,
3434
AccountExecutor,
35-
AccountLoupe,
35+
ModularAccountView,
3636
AccountStorageInitializable,
3737
BaseAccount,
3838
IERC165,

src/helpers/KnownSelectors.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import {IPaymaster} from "@eth-infinitism/account-abstraction/interfaces/IPaymas
77
import {UUPSUpgradeable} from "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol";
88
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
99

10-
import {IAccountLoupe} from "../interfaces/IAccountLoupe.sol";
1110
import {IExecutionHookModule} from "../interfaces/IExecutionHookModule.sol";
1211
import {IExecutionModule} from "../interfaces/IExecutionModule.sol";
1312
import {IModularAccount} from "../interfaces/IModularAccount.sol";
13+
import {IModularAccountView} from "../interfaces/IModularAccountView.sol";
1414
import {IModule} from "../interfaces/IModule.sol";
1515
import {IValidationHookModule} from "../interfaces/IValidationHookModule.sol";
1616
import {IValidationModule} from "../interfaces/IValidationModule.sol";
@@ -35,9 +35,9 @@ library KnownSelectors {
3535
// check against UUPSUpgradeable methods
3636
|| selector == UUPSUpgradeable.proxiableUUID.selector
3737
|| selector == UUPSUpgradeable.upgradeToAndCall.selector
38-
// check against IAccountLoupe methods
39-
|| selector == IAccountLoupe.getExecutionData.selector
40-
|| selector == IAccountLoupe.getValidationData.selector;
38+
// check against IModularAccountView methods
39+
|| selector == IModularAccountView.getExecutionData.selector
40+
|| selector == IModularAccountView.getValidationData.selector;
4141
}
4242

4343
function isErc4337Function(bytes4 selector) internal pure returns (bool) {

src/interfaces/IAccountLoupe.sol renamed to src/interfaces/IModularAccountView.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct ValidationDataView {
3232
bytes4[] selectors;
3333
}
3434

35-
interface IAccountLoupe {
35+
interface IModularAccountView {
3636
/// @notice Get the execution data for a selector.
3737
/// @dev If the selector is a native function, the module address will be the address of the account.
3838
/// @param selector The selector to get the data for.

standard/ERCs/erc-6900.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Each step is modular, supporting different implementations, that allows for open
7171

7272
**Modular Smart Contract Accounts** **MAY** implement
7373

74-
- `IAccountLoupe.sol` to support visibility in account states on-chain.
74+
- `IModularAccountView.sol` to support visibility in account states on-chain.
7575
- [ERC-165](./eip-165.md) for interfaces installed from modules.
7676

7777
**Modules** **MUST** implement
@@ -195,7 +195,7 @@ interface IModularAccount {
195195
196196
```
197197

198-
#### `IAccountLoupe.sol`
198+
#### `IModularAccountView.sol`
199199

200200
Module inspection interface. Modular Smart Contract Accounts **MAY** implement this interface to support visibility in module configuration.
201201

@@ -229,7 +229,7 @@ struct ValidationDataView {
229229
bytes4[] selectors;
230230
}
231231
232-
interface IAccountLoupe {
232+
interface IModularAccountView {
233233
/// @notice Get the execution data for a selector.
234234
/// @dev If the selector is a native function, the module address will be the address of the account.
235235
/// @param selector The selector to get the data for.
@@ -524,7 +524,7 @@ The function SHOULD perform the following checks:
524524
- Revert if the hash of the manifest used at install time does not match the computed Keccak-256 hash of the module's current manifest. This prevents unclean removal of modules that attempt to force a removal of a different module configuration than the one that was originally approved by the client for installation. To allow for removal of such modules, the modular account MAY implement the capability for the manifest to be encoded in the config field as a parameter.
525525
- Revert if there is at least 1 other installed module that depends on validation functions added by this module. Modules used as dependencies SHOULD NOT be uninstalled while dependent modules exist.
526526

527-
The function SHOULD update account storage to reflect the uninstall via inspection functions, such as those defined by `IAccountLoupe`. Each dependency's record SHOULD also be updated to reflect that it has no longer has this module as a dependent.
527+
The function SHOULD update account storage to reflect the uninstall via inspection functions, such as those defined by `IModularAccountView`. Each dependency's record SHOULD also be updated to reflect that it has no longer has this module as a dependent.
528528

529529
The function MUST remove records for the module's manifest hash, dependencies, permitted function selectors, permitted external calls, and whether it can spend the account's native tokens.
530530

test/account/AccountLoupe.t.sol renamed to test/account/ModularAccountView.t.sol

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ import {UUPSUpgradeable} from "@openzeppelin/contracts/proxy/utils/UUPSUpgradeab
55

66
import {HookConfigLib} from "../../src/helpers/HookConfigLib.sol";
77
import {ModuleEntity, ModuleEntityLib} from "../../src/helpers/ModuleEntityLib.sol";
8-
import {ExecutionDataView, ValidationDataView} from "../../src/interfaces/IAccountLoupe.sol";
8+
99
import {HookConfig, IModularAccount} from "../../src/interfaces/IModularAccount.sol";
10+
import {ExecutionDataView, ValidationDataView} from "../../src/interfaces/IModularAccountView.sol";
1011

1112
import {ComprehensiveModule} from "../mocks/modules/ComprehensiveModule.sol";
1213
import {CustomValidationTestBase} from "../utils/CustomValidationTestBase.sol";
1314

14-
contract AccountLoupeTest is CustomValidationTestBase {
15+
contract ModularAccountViewTest is CustomValidationTestBase {
1516
ComprehensiveModule public comprehensiveModule;
1617

1718
event ReceivedCall(bytes msgData, uint256 msgValue);
@@ -30,7 +31,7 @@ contract AccountLoupeTest is CustomValidationTestBase {
3031
vm.stopPrank();
3132
}
3233

33-
function test_moduleLoupe_getExecutionData_native() public {
34+
function test_moduleView_getExecutionData_native() public {
3435
bytes4[] memory selectorsToCheck = new bytes4[](5);
3536

3637
selectorsToCheck[0] = IModularAccount.execute.selector;
@@ -51,7 +52,7 @@ contract AccountLoupeTest is CustomValidationTestBase {
5152
}
5253
}
5354

54-
function test_moduleLoupe_getExecutionData_module() public {
55+
function test_moduleView_getExecutionData_module() public {
5556
bytes4[] memory selectorsToCheck = new bytes4[](1);
5657
address[] memory expectedModuleAddress = new address[](1);
5758

@@ -95,7 +96,7 @@ contract AccountLoupeTest is CustomValidationTestBase {
9596
}
9697
}
9798

98-
function test_moduleLoupe_getValidationData() public {
99+
function test_moduleView_getValidationData() public {
99100
ValidationDataView memory data = account1.getValidationData(comprehensiveModuleValidation);
100101
bytes4[] memory selectors = data.selectors;
101102

test/account/ReferenceModularAccount.t.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import {SemiModularAccount} from "../../src/account/SemiModularAccount.sol";
1616

1717
import {ExecutionManifest} from "../../src/interfaces/IExecutionModule.sol";
1818

19-
import {ExecutionDataView} from "../../src/interfaces/IAccountLoupe.sol";
2019
import {Call} from "../../src/interfaces/IModularAccount.sol";
20+
import {ExecutionDataView} from "../../src/interfaces/IModularAccountView.sol";
2121

2222
import {TokenReceiverModule} from "../../src/modules/TokenReceiverModule.sol";
2323
import {SingleSignerValidationModule} from "../../src/modules/validation/SingleSignerValidationModule.sol";

0 commit comments

Comments
 (0)