From 6bef45e0cde83ac8061d60570edd94745fb3cd07 Mon Sep 17 00:00:00 2001 From: Jay Paik Date: Sun, 7 Jan 2024 16:58:12 -0500 Subject: [PATCH] fix: [spearbit-72] cache dependencies.length earlier --- src/account/PluginManagerInternals.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/account/PluginManagerInternals.sol b/src/account/PluginManagerInternals.sol index 66f42b40c..7a0c0751d 100644 --- a/src/account/PluginManagerInternals.sol +++ b/src/account/PluginManagerInternals.sol @@ -350,11 +350,11 @@ abstract contract PluginManagerInternals is IPluginManager, AccountStorageV1 { } // Check that the dependencies match the manifest. - if (dependencies.length != manifest.dependencyInterfaceIds.length) { + uint256 length = dependencies.length; + if (length != manifest.dependencyInterfaceIds.length) { revert InvalidDependenciesProvided(); } - uint256 length = dependencies.length; for (uint256 i = 0; i < length;) { // Check the dependency interface id over the address of the dependency. (address dependencyAddr,) = dependencies[i].unpack();