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
+15-10Lines changed: 15 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ requires: 165, 4337
13
13
14
14
## Abstract
15
15
16
-
This proposal standardizes smart contract accounts and account modules, which are smart contract interfaces that allow for composable logic within smart contract accounts. This proposal is compliant with [ERC-4337](./eip-4337.md). This standard emphasizes secure permissioning of modules, and maximal interoperability between all speccompliant accounts and modules.
16
+
This proposal standardizes smart contract accounts and account modules, which are smart contract interfaces that allow for composable logic within smart contract accounts. This proposal is compliant with [ERC-4337](./eip-4337.md). This standard emphasizes secure permissioning of modules, and maximal interoperability between all spec-compliant accounts and modules.
17
17
18
18
This modular approach splits account functionality into three categories, implements them in external contracts, and defines an expected execution flow from accounts.
19
19
@@ -29,7 +29,7 @@ We propose a standard that coordinates the implementation work between module de
29
29
30
30

31
31
32
-
These modules can contain execution logic, validation functions, and hooks. Validation functions define the circumstances under which the smart contract account will approve actions taken on its behalf, while hooks allow for pre- and post-execution controls.
32
+
These modules can contain execution logic, validation functions, and hooks. Validation functions define the circumstances under which the smart contract account will approve actions taken on its behalf, while hooks allow for pre and postexecution controls.
33
33
34
34
Accounts adopting this standard will support modular, upgradable execution and validation logic. Defining this as a standard for smart contract accounts will make modules easier to develop securely and will allow for greater interoperability.
35
35
@@ -45,8 +45,8 @@ 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.
47
47
There are two types of hooks:
48
-
- **Validation Hook** functions run before a validation function. These can enforce permissions on actions authorized by a validation function.
49
-
- **Execution Hook** functions run can run before and/or after an execution function. The pre execution hook may optionally return data to be consumed by a post execution hook functions.
48
+
- **Validation hook** functions run before a validation function. These can enforce permissions on actions authorized by a validation function.
49
+
- **Execution hook** functions run can run before and/or after an execution function. The pre execution hook may optionally return data to be consumed by a post execution hook functions.
50
50
- A **native function** refers to a function implemented by the modular account, as opposed to a function added by a module.
51
51
- A **module** is a deployed smart contract that hosts any amount of the above three kinds of modular functions.
52
52
- A module **manifest** describes the execution functions, interface ids, and hooks that should be installed on the account.
@@ -67,8 +67,7 @@ Each step is modular, supporting different implementations, that allows for open
67
67
68
68
-`IAccount.sol` from [ERC-4337](./eip-4337.md).
69
69
-`IAccountExecute.sol` from [ERC-4337](./eip-4337.md).
70
-
-`IModularAccount.sol` to support installing and uninstalling modules.
71
-
-`IStandardExecutor.sol` to support open-ended execution.
70
+
-`IModularAccount.sol` to support module management and usage, and account identification.
/// @param selectors The selectors to install the validation function for.
155
154
/// @param installData Optional data to be decoded and used by the module to setup initial module state.
156
155
/// @param hooks Optional hooks to install, associated with the validation function. These may be
157
-
/// pre-validation hooks or execution hooks. The expected format is a bytes26 HookConfig, followed by the
156
+
/// prevalidation hooks or execution hooks. The expected format is a bytes26 HookConfig, followed by the
158
157
/// install data, if any.
159
158
function installValidation(
160
159
ValidationConfig validationConfig,
@@ -168,8 +167,8 @@ interface IModularAccount {
168
167
/// @param uninstallData Optional data to be decoded and used by the module to clear module data for the
169
168
/// account.
170
169
/// @param hookUninstallData Optional data to be used by hooks for cleanup. If any are provided, the array must
171
-
/// be of a length equal to existing pre-validation hooks plus permission hooks. Hooks are indexed by
172
-
/// pre-validation hook order first, then permission hooks.
170
+
/// be of a length equal to existing prevalidation hooks plus permission hooks. Hooks are indexed by
171
+
/// prevalidation hook order first, then permission hooks.
173
172
function uninstallValidation(
174
173
ModuleEntity validationFunction,
175
174
bytes calldata uninstallData,
@@ -186,6 +185,12 @@ interface IModularAccount {
186
185
ExecutionManifest calldata manifest,
187
186
bytes calldata moduleUninstallData
188
187
) external;
188
+
189
+
/// @notice Return a unique identifier for the account implementation.
190
+
/// @dev This function MUST return a string in the format "vendor.account.semver". The vendor and account
191
+
/// names MUST NOT contain a period character.
192
+
/// @return The account ID.
193
+
function accountId() external view returns (string memory);
189
194
}
190
195
191
196
```
@@ -583,7 +588,7 @@ The modular smart contract accounts themselves are trusted components. Installed
583
588
584
589
Users should perform careful due diligence before installing a module and should be mindful of the fact that modules are potentially dangerous. The module's manifest can give users an understanding of the potential risks they are exposed to for that particular module. For instance, a request to install certain validation functions and/or hooks on certain execution selectors could potentially be a vector for DOS.
585
590
586
-
Execution hooks have no awareness of other execution hooks being performed in the same function selector execution setting. Since execution hooks can perform state changes, this reveals an important security consideration: An execution hook can only assure that at the time of its own execution, certain conditions are met, but this can not be generalized to the entire pre-execution context of potentially multiple pre-execution hooks. For example, a pre-execution hook cannot be assured that the storage it performed validation upon does not get further updated in subsequent pre-execution hooks. Even a post-execution hook potentially repeating the validation cannot assure that the storage remains unmodified because a prior post-execution hook may have reset the state. As long as the requirements checked by a module as part of an execution hook are only modifiable by the module itself, this can be considered safe.
591
+
Execution hooks have no awareness of other execution hooks being performed in the same function selector execution setting. Since execution hooks can perform state changes, this reveals an important security consideration: An execution hook can only assure that at the time of its own execution, certain conditions are met, but this can not be generalized to the entire preexecution context of potentially multiple preexecution hooks. For example, a preexecution hook cannot be assured that the storage it performed validation upon does not get further updated in subsequent preexecution hooks. Even a postexecution hook potentially repeating the validation cannot assure that the storage remains unmodified because a prior postexecution hook may have reset the state. As long as the requirements checked by a module as part of an execution hook are only modifiable by the module itself, this can be considered safe.
0 commit comments