From fb0afd5bf8f84632d2435de1ae30852103d7baf3 Mon Sep 17 00:00:00 2001 From: RubensGitHub <44226748+0xrubes@users.noreply.github.com> Date: Sun, 4 May 2025 13:10:12 +0200 Subject: [PATCH 1/2] add execution hooks for native selectors too --- src/account/ModularAccountView.sol | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/account/ModularAccountView.sol b/src/account/ModularAccountView.sol index 19518e78..9cffe665 100644 --- a/src/account/ModularAccountView.sol +++ b/src/account/ModularAccountView.sol @@ -30,12 +30,11 @@ abstract contract ModularAccountView is IERC6900AccountView { data.module = executionStorage.module; data.skipRuntimeValidation = executionStorage.skipRuntimeValidation; data.allowGlobalValidation = executionStorage.allowGlobalValidation; - - uint256 executionHooksLen = executionStorage.executionHooks.length(); - data.executionHooks = new HookConfig[](executionHooksLen); - for (uint256 i = 0; i < executionHooksLen; ++i) { - data.executionHooks[i] = toHookConfig(executionStorage.executionHooks.at(i)); - } + } + uint256 executionHooksLen = executionStorage.executionHooks.length(); + data.executionHooks = new HookConfig[](executionHooksLen); + for (uint256 i = 0; i < executionHooksLen; ++i) { + data.executionHooks[i] = toHookConfig(executionStorage.executionHooks.at(i)); } } From 7d231f17f9f8d702e38e5527f88f627785ba8a05 Mon Sep 17 00:00:00 2001 From: RubensGitHub <44226748+0xrubes@users.noreply.github.com> Date: Sun, 4 May 2025 13:23:06 +0200 Subject: [PATCH 2/2] move executionStorage declaration up --- src/account/ModularAccountView.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/account/ModularAccountView.sol b/src/account/ModularAccountView.sol index 9cffe665..391305f3 100644 --- a/src/account/ModularAccountView.sol +++ b/src/account/ModularAccountView.sol @@ -17,6 +17,7 @@ abstract contract ModularAccountView is IERC6900AccountView { /// @inheritdoc IERC6900AccountView function getExecutionData(bytes4 selector) external view override returns (ExecutionDataView memory data) { + ExecutionStorage storage executionStorage = getAccountStorage().executionStorage[selector]; if ( selector == IERC6900Account.execute.selector || selector == IERC6900Account.executeBatch.selector || selector == UUPSUpgradeable.upgradeToAndCall.selector @@ -26,7 +27,6 @@ abstract contract ModularAccountView is IERC6900AccountView { data.module = address(this); data.allowGlobalValidation = true; } else { - ExecutionStorage storage executionStorage = getAccountStorage().executionStorage[selector]; data.module = executionStorage.module; data.skipRuntimeValidation = executionStorage.skipRuntimeValidation; data.allowGlobalValidation = executionStorage.allowGlobalValidation;