From 8556b2108ab5b916af5ca84d5b0634997eedb476 Mon Sep 17 00:00:00 2001 From: adam Date: Fri, 30 Aug 2024 17:28:17 -0400 Subject: [PATCH] feat: update interfaces to be consistent --- src/interfaces/IModularAccount.sol | 25 ++++++++++++------------- standard/ERCs/erc-6900.md | 23 ++++++----------------- 2 files changed, 18 insertions(+), 30 deletions(-) diff --git a/src/interfaces/IModularAccount.sol b/src/interfaces/IModularAccount.sol index c133dce7..04cc2728 100644 --- a/src/interfaces/IModularAccount.sol +++ b/src/interfaces/IModularAccount.sol @@ -78,8 +78,8 @@ interface IModularAccount { /// @notice Install a module to the modular account. /// @param module The module to install. /// @param manifest the manifest describing functions to install - /// @param moduleInstallData Optional data to be decoded and used by the module to setup initial module data - /// for the modular account. + /// @param moduleInstallData Optional data to be used by the account to handle the initial execution setup, + /// data encoding is implementation-specific. function installExecution( address module, ExecutionManifest calldata manifest, @@ -91,10 +91,10 @@ interface IModularAccount { /// @dev This does not validate anything against the manifest - the caller must ensure validity. /// @param validationConfig The validation function to install, along with configuration flags. /// @param selectors The selectors to install the validation function for. - /// @param installData Optional data to be decoded and used by the module to setup initial module state. - /// @param hooks Optional hooks to install, associated with the validation function. These may be - /// pre validation hooks or execution hooks. The expected format is a bytes25 HookConfig, followed by the - /// install data, if any. + /// @param installData Optional data to be used by the account to handle the initial validation setup, data + /// encoding is implementation-specific. + /// @param hooks Optional hooks to install and associate with the validation function, data encoding is + /// implementation-specific. function installValidation( ValidationConfig validationConfig, bytes4[] calldata selectors, @@ -104,11 +104,10 @@ interface IModularAccount { /// @notice Uninstall a validation function from a set of execution selectors. /// @param validationFunction The validation function to uninstall. - /// @param uninstallData Optional data to be decoded and used by the module to clear module data for the - /// account. - /// @param hookUninstallData Optional data to be used by hooks for cleanup. If any are provided, the array must - /// be of a length equal to existing pre validation hooks plus execution hooks. Hooks are indexed by - /// pre validation hook order first, then execution hooks. + /// @param uninstallData Optional data to be used by the account to handle the validation uninstallation, data + /// encoding is implementation-specific. + /// @param hookUninstallData Optional data to be used by the account to handle hook uninstallation, data + /// encoding is implementation-specific. function uninstallValidation( ModuleEntity validationFunction, bytes calldata uninstallData, @@ -118,8 +117,8 @@ interface IModularAccount { /// @notice Uninstall a module from the modular account. /// @param module The module to uninstall. /// @param manifest the manifest describing functions to uninstall. - /// @param moduleUninstallData Optional data to be decoded and used by the module to clear module data for the - /// modular account. + /// @param moduleUninstallData Optional data to be used by the account to handle the execution uninstallation, + /// data encoding is implementation-specific. function uninstallExecution( address module, ExecutionManifest calldata manifest, diff --git a/standard/ERCs/erc-6900.md b/standard/ERCs/erc-6900.md index 8bf0cdc6..dc9f4353 100644 --- a/standard/ERCs/erc-6900.md +++ b/standard/ERCs/erc-6900.md @@ -215,7 +215,6 @@ interface IModularAccount { /// @return The account ID. function accountId() external view returns (string memory); } - ``` #### `IModularAccountView.sol` @@ -275,17 +274,6 @@ interface IModularAccountView { Module interface. Modules **MUST** implement this interface to support module management and interactions with ERC-6900 modular accounts. ```solidity -/// @dev A struct holding fields to describe the module in a purely view context. Intended for front end clients. -struct ModuleMetadata { - // A human-readable name of the module. - string name; - // The version of the module, following the semantic versioning scheme. - string version; - // The author field SHOULD be a username representing the identity of the user or organization - // that created this module. - string author; -} - interface IModule is IERC165 { /// @notice Initialize module data for the modular account. /// @dev Called by the modular account during `installExecution`. @@ -299,10 +287,11 @@ interface IModule is IERC165 { /// account. function onUninstall(bytes calldata data) external; - /// @notice Describe the metadata of the module. - /// @dev This metadata MUST stay constant over time. - /// @return A metadata struct describing the module. - function moduleMetadata() external pure returns (ModuleMetadata memory); + /// @notice Return a unique identifier for the module. + /// @dev This function MUST return a string in the format "vendor.module.semver". The vendor and module + /// names MUST NOT contain a period character. + /// @return The module ID. + function moduleId() external view returns (string memory); } ``` @@ -412,7 +401,7 @@ Execution module interface. Modules **MAY** implement this interface to provide struct ManifestExecutionFunction { // The selector to install bytes4 executionSelector; - // Whether or not the function needs runtime validation, or can be called by anyone. + // If true, the function won't need runtime validation, and can be called by anyone. bool skipRuntimeValidation; // If true, the function can be validated by a global validation function. bool allowGlobalValidation;