Skip to content

Commit 516b753

Browse files
howydevZer0dot
andauthored
chore: update spec (#176)
Co-authored-by: Zer0dot <zer0dot.dev@gmail.com>
1 parent 800a427 commit 516b753

File tree

1 file changed

+7
-17
lines changed

1 file changed

+7
-17
lines changed

standard/ERCs/erc-6900.md

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "S
4545
- **Execution functions** execute custom logic allowed by the account.
4646
- **Hooks** execute custom logic and checks before and/or after an execution function or validation function. There are two types of hooks:
4747
- **Validation hook** functions run before a validation function. These can enforce permissions on actions authorized by a validation function.
48-
- **Execution hook** functions can run before and/or after an execution function. A pre execution hook may optionally return data to be consumed by a post execution hook function.
48+
- **Execution hook** functions can run before and/or after an execution function. Hooks can be attached either to a specific execution function selector, or a validation function. A pre execution hook may optionally return data to be consumed by a post execution hook function.
4949
- A **native function** refers to a function implemented by the modular account, as opposed to a function added by a module.
5050
- A **module** is a deployed smart contract that hosts any amount of the above three kinds of modular functions.
5151
- A module **manifest** describes the execution functions, interface ids, and hooks that should be installed on the account.
@@ -246,8 +246,8 @@ struct ValidationDataView {
246246
bool isSignatureValidation;
247247
// The pre validation hooks for this validation function.
248248
ModuleEntity[] preValidationHooks;
249-
// Permission hooks for this validation function.
250-
HookConfig[] permissionHooks;
249+
// Execution hooks to run with this validation function.
250+
HookConfig[] executionHooks;
251251
// The set of selectors that may be validated by this validation function.
252252
bytes4[] selectors;
253253
}
@@ -272,14 +272,9 @@ interface IModularAccountView {
272272

273273
#### `IModule.sol`
274274

275-
Module interface. Modules **MUST** implement this interface to support module management and interactions with MSCAs.
275+
Module interface. Modules **MUST** implement this interface to support module management and interactions with ERC-6900 modular accounts.
276276

277277
```solidity
278-
struct SelectorPermission {
279-
bytes4 functionSelector;
280-
string permissionDescription;
281-
}
282-
283278
/// @dev A struct holding fields to describe the module in a purely view context. Intended for front end clients.
284279
struct ModuleMetadata {
285280
// A human-readable name of the module.
@@ -289,11 +284,6 @@ struct ModuleMetadata {
289284
// The author field SHOULD be a username representing the identity of the user or organization
290285
// that created this module.
291286
string author;
292-
// String desciptions of the relative sensitivity of specific functions. The selectors MUST be selectors for
293-
// functions implemented by this module.
294-
SelectorPermission[] permissionDescriptors;
295-
// A list of all ERC-7715 permission strings that the module could possibly use
296-
string[] permissionRequest;
297287
}
298288
299289
interface IModule is IERC165 {
@@ -492,7 +482,7 @@ Validation installation MAY be deferred until a later time, such as upon first u
492482
During validation installation, the account MUST correctly set flags and other fields based on the incoming data provided by the user.
493483

494484
- the account MUST install all pre validation hooks required by the user and SHOULD call `onInstall` with the user-provided data on the hook module to initialize the states if required by user.
495-
- the account MUST install all permission hooks required by the user and SHOULD call `onInstall` with the user-provided data on the hook module to initialize the states if required by user.
485+
- the account MUST install all execution hooks required by the user and SHOULD call `onInstall` with the user-provided data on the hook module to initialize the states if required by user.
496486
- the account MUST add all selectors required by the user that the validation can validate.
497487
- the account MUST set all flags as required, like `isGlobal`, `isSignatureValidation`, and `isUserOpValidation`.
498488
- the account SHOULD call `onInstall` on the validation module to initialize the states if required by user.
@@ -503,7 +493,7 @@ During validation installation, the account MUST correctly set flags and other f
503493
During validation uninstallation, the account MUST correctly clear flags and other fields based on the incoming data provided by the user.
504494

505495
- the account MUST clear all flags for the validation function, like `isGlobal`, `isSignatureValidation`, and `isUserOpValidation`.
506-
- the account MUST remomve all hooks and SHOULD clear hook module states by calling `onUninstall` with the user-provided data for each hook, including both pre validation hooks and permission hooks, if required by user.
496+
- the account MUST remomve all hooks and SHOULD clear hook module states by calling `onUninstall` with the user-provided data for each hook, including both pre validation hooks and execution hooks, if required by user.
507497
- the account MUST remove all selectors that the validation function can validate.
508498
- the account MUST emit `ValidationUninstalled` as defined in the interface for all uninstalled validations.
509499

@@ -573,7 +563,7 @@ For all non-view functions within `IModularAccount` except `executeWithAuthoriza
573563

574564
If the caller is not the EntryPoint or the account, the account MUST check access control for direct call validation.
575565

576-
Prior to running the target function, the modular account MUST run all pre execution hooks that apply for the current function call. Pre execution hooks apply if they have been installed to the currently running function selector, or if they are installed as a permission hook to the validation function that was used for the current execution. Pre execution hooks MUST run validation-associated hooks first, then selector-associated hooks second.
566+
Prior to running the target function, the modular account MUST run all pre execution hooks that apply for the current function call. Pre execution hooks apply if they have been installed to the currently running function selector, or if they are installed as an execution hook to the validation function that was used for the current execution. Pre execution hooks MUST run validation-associated hooks first, then selector-associated hooks second.
577567

578568
Next, the modular account MUST run the target function, either an account native function or a module-defined execution function.
579569

0 commit comments

Comments
 (0)