You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: standard/ERCs/erc-6900.md
+7-17Lines changed: 7 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "S
45
45
-**Execution functions** execute custom logic allowed by the account.
46
46
-**Hooks** execute custom logic and checks before and/or after an execution function or validation function. There are two types of hooks:
47
47
-**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.
49
49
- A **native function** refers to a function implemented by the modular account, as opposed to a function added by a module.
50
50
- A **module** is a deployed smart contract that hosts any amount of the above three kinds of modular functions.
51
51
- A module **manifest** describes the execution functions, interface ids, and hooks that should be installed on the account.
@@ -246,8 +246,8 @@ struct ValidationDataView {
246
246
bool isSignatureValidation;
247
247
// The pre validation hooks for this validation function.
248
248
ModuleEntity[] preValidationHooks;
249
-
// Permission hooks for this validation function.
250
-
HookConfig[] permissionHooks;
249
+
// Execution hooks to run with this validation function.
250
+
HookConfig[] executionHooks;
251
251
// The set of selectors that may be validated by this validation function.
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.
276
276
277
277
```solidity
278
-
struct SelectorPermission {
279
-
bytes4 functionSelector;
280
-
string permissionDescription;
281
-
}
282
-
283
278
/// @dev A struct holding fields to describe the module in a purely view context. Intended for front end clients.
284
279
struct ModuleMetadata {
285
280
// A human-readable name of the module.
@@ -289,11 +284,6 @@ struct ModuleMetadata {
289
284
// The author field SHOULD be a username representing the identity of the user or organization
290
285
// that created this module.
291
286
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;
297
287
}
298
288
299
289
interface IModule is IERC165 {
@@ -492,7 +482,7 @@ Validation installation MAY be deferred until a later time, such as upon first u
492
482
During validation installation, the account MUST correctly set flags and other fields based on the incoming data provided by the user.
493
483
494
484
- 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.
496
486
- the account MUST add all selectors required by the user that the validation can validate.
497
487
- the account MUST set all flags as required, like `isGlobal`, `isSignatureValidation`, and `isUserOpValidation`.
498
488
- 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
503
493
During validation uninstallation, the account MUST correctly clear flags and other fields based on the incoming data provided by the user.
504
494
505
495
- 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.
507
497
- the account MUST remove all selectors that the validation function can validate.
508
498
- the account MUST emit `ValidationUninstalled` as defined in the interface for all uninstalled validations.
509
499
@@ -573,7 +563,7 @@ For all non-view functions within `IModularAccount` except `executeWithAuthoriza
573
563
574
564
If the caller is not the EntryPoint or the account, the account MUST check access control for direct call validation.
575
565
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.
577
567
578
568
Next, the modular account MUST run the target function, either an account native function or a module-defined execution function.
0 commit comments