Skip to content

Commit 64ddec2

Browse files
authored
fix: v0.8 review and polish (#186)
1 parent 0bb2bfa commit 64ddec2

File tree

5 files changed

+128
-131
lines changed

5 files changed

+128
-131
lines changed

src/interfaces/IExecutionHookModule.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ interface IExecutionHookModule is IModule {
1010
/// be more than one.
1111
/// @param sender The caller address.
1212
/// @param value The call value.
13-
/// @param data The calldata sent.
13+
/// @param data The calldata sent. For `executeUserOp` calls, hook modules should receive the full msg.data.
1414
/// @return Context to pass to a post execution hook, if present. An empty bytes array MAY be returned.
1515
function preExecutionHook(uint32 entityId, address sender, uint256 value, bytes calldata data)
1616
external

src/interfaces/IModularAccount.sol

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -66,34 +66,40 @@ interface IModularAccount {
6666
/// @return An array containing the return data from the calls.
6767
function executeBatch(Call[] calldata calls) external payable returns (bytes[] memory);
6868

69-
/// @notice Execute a call using a specified runtime validation.
69+
/// @notice Execute a call using the specified runtime validation.
7070
/// @param data The calldata to send to the account.
71-
/// @param authorization The authorization data to use for the call. The first 24 bytes specifies which runtime
72-
/// validation to use, and the rest is sent as a parameter to runtime validation.
71+
/// @param authorization The authorization data to use for the call. The first 24 bytes is a ModuleEntity which
72+
/// specifies which runtime validation to use, and the rest is sent as a parameter to runtime validation.
7373
function executeWithRuntimeValidation(bytes calldata data, bytes calldata authorization)
7474
external
7575
payable
7676
returns (bytes memory);
7777

7878
/// @notice Install a module to the modular account.
7979
/// @param module The module to install.
80-
/// @param manifest the manifest describing functions to install
81-
/// @param moduleInstallData Optional data to be used by the account to handle the initial execution setup,
82-
/// data encoding is implementation-specific.
83-
function installExecution(
84-
address module,
85-
ExecutionManifest calldata manifest,
86-
bytes calldata moduleInstallData
87-
) external;
80+
/// @param manifest the manifest describing functions to install.
81+
/// @param installData Optional data to be used by the account to handle the initial execution setup. Data
82+
/// encoding
83+
/// is implementation-specific.
84+
function installExecution(address module, ExecutionManifest calldata manifest, bytes calldata installData)
85+
external;
86+
87+
/// @notice Uninstall a module from the modular account.
88+
/// @param module The module to uninstall.
89+
/// @param manifest the manifest describing functions to uninstall.
90+
/// @param uninstallData Optional data to be used by the account to handle the execution uninstallation. Data
91+
/// encoding is implementation-specific.
92+
function uninstallExecution(address module, ExecutionManifest calldata manifest, bytes calldata uninstallData)
93+
external;
8894

8995
/// @notice Installs a validation function across a set of execution selectors, and optionally mark it as a
90-
/// global validation.
96+
/// global validation function.
9197
/// @dev This does not validate anything against the manifest - the caller must ensure validity.
9298
/// @param validationConfig The validation function to install, along with configuration flags.
9399
/// @param selectors The selectors to install the validation function for.
94-
/// @param installData Optional data to be used by the account to handle the initial validation setup, data
100+
/// @param installData Optional data to be used by the account to handle the initial validation setup. Data
95101
/// encoding is implementation-specific.
96-
/// @param hooks Optional hooks to install and associate with the validation function, data encoding is
102+
/// @param hooks Optional hooks to install and associate with the validation function. Data encoding is
97103
/// implementation-specific.
98104
function installValidation(
99105
ValidationConfig validationConfig,
@@ -104,27 +110,17 @@ interface IModularAccount {
104110

105111
/// @notice Uninstall a validation function from a set of execution selectors.
106112
/// @param validationFunction The validation function to uninstall.
107-
/// @param uninstallData Optional data to be used by the account to handle the validation uninstallation, data
108-
/// encoding is implementation-specific.
109-
/// @param hookUninstallData Optional data to be used by the account to handle hook uninstallation, data
113+
/// @param uninstallData Optional data to be used by the account to handle the validation uninstallation. Data
110114
/// encoding is implementation-specific.
115+
/// @param hookUninstallData Optional data to be used by the account to handle hook uninstallation. Data
116+
/// encoding
117+
/// is implementation-specific.
111118
function uninstallValidation(
112119
ModuleEntity validationFunction,
113120
bytes calldata uninstallData,
114121
bytes[] calldata hookUninstallData
115122
) external;
116123

117-
/// @notice Uninstall a module from the modular account.
118-
/// @param module The module to uninstall.
119-
/// @param manifest the manifest describing functions to uninstall.
120-
/// @param moduleUninstallData Optional data to be used by the account to handle the execution uninstallation,
121-
/// data encoding is implementation-specific.
122-
function uninstallExecution(
123-
address module,
124-
ExecutionManifest calldata manifest,
125-
bytes calldata moduleUninstallData
126-
) external;
127-
128124
/// @notice Return a unique identifier for the account implementation.
129125
/// @dev This function MUST return a string in the format "vendor.account.semver". The vendor and account
130126
/// names MUST NOT contain a period character.

src/interfaces/IModularAccountView.sol

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

44
import {HookConfig, ModuleEntity} from "../interfaces/IModularAccount.sol";
55

6-
// Represents data associated with a specifc function selector.
6+
/// @dev Represents data associated with a specific function selector.
77
struct ExecutionDataView {
88
// The module that implements this execution function.
99
// If this is a native function, the address must remain address(0).
@@ -20,9 +20,9 @@ struct ExecutionDataView {
2020
}
2121

2222
struct ValidationDataView {
23-
// Whether or not this validation can be used as a global validation function.
23+
// Whether or not this validation function can be used as a global validation function.
2424
bool isGlobal;
25-
// Whether or not this validation is a signature validator.
25+
// Whether or not this validation function is a signature validator.
2626
bool isSignatureValidation;
2727
// Whether or not this validation is a user operation validator.
2828
bool isUserOpValidation;
@@ -38,13 +38,13 @@ interface IModularAccountView {
3838
/// @notice Get the execution data for a selector.
3939
/// @dev If the selector is a native function, the module address will be the address of the account.
4040
/// @param selector The selector to get the data for.
41-
/// @return ExecutionData The module address for this selector.
41+
/// @return The execution data for this selector.
4242
function getExecutionData(bytes4 selector) external view returns (ExecutionDataView memory);
4343

44-
/// @notice Get the validation data for a validation.
44+
/// @notice Get the validation data for a validation function.
4545
/// @dev If the selector is a native function, the module address will be the address of the account.
4646
/// @param validationFunction The validation function to get the data for.
47-
/// @return ValidationData The module address for this selector.
47+
/// @return The validation data for this validation function.
4848
function getValidationData(ModuleEntity validationFunction)
4949
external
5050
view

src/interfaces/IValidationModule.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ interface IValidationModule is IModule {
4242
/// @param sender the address that sent the ERC-1271 request to the smart account
4343
/// @param hash the hash of the ERC-1271 request
4444
/// @param signature the signature of the ERC-1271 request
45-
/// @return the ERC-1271 `MAGIC_VALUE` if the signature is valid, or 0xFFFFFFFF if invalid.
45+
/// @return The ERC-1271 `MAGIC_VALUE` if the signature is valid, or 0xFFFFFFFF if invalid.
4646
function validateSignature(
4747
address account,
4848
uint32 entityId,

0 commit comments

Comments
 (0)