From dd018f5752ded76db6675e03b81038dc22928302 Mon Sep 17 00:00:00 2001 From: howydev <132113803+howydev@users.noreply.github.com> Date: Fri, 7 Jun 2024 16:53:07 -0400 Subject: [PATCH] fix: lint --- src/account/AccountStorage.sol | 11 ----------- src/account/PluginManagerInternals.sol | 9 +-------- src/interfaces/IPlugin.sol | 6 ------ test/account/AccountExecHooks.t.sol | 4 ++-- test/account/ExecuteFromPluginPermissions.t.sol | 1 - test/account/UpgradeableModularAccount.t.sol | 4 ++-- test/mocks/plugins/ExecFromPluginPermissionsMocks.sol | 7 +------ test/mocks/plugins/ReturnDataPluginMocks.sol | 7 +------ 8 files changed, 7 insertions(+), 42 deletions(-) diff --git a/src/account/AccountStorage.sol b/src/account/AccountStorage.sol index 7b7c8229..79102581 100644 --- a/src/account/AccountStorage.sol +++ b/src/account/AccountStorage.sol @@ -3,7 +3,6 @@ pragma solidity ^0.8.25; import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; -import {IPlugin} from "../interfaces/IPlugin.sol"; import {ExecutionHook} from "../interfaces/IAccountLoupe.sol"; import {FunctionReference} from "../interfaces/IPluginManager.sol"; @@ -20,16 +19,6 @@ struct PluginData { uint256 dependentCount; } -// Represents data associated with a plugin's permission to use `executeFromPluginExternal` -// to interact with contracts and addresses external to the account and its plugins. -struct PermittedExternalCallData { - // Is this address on the permitted addresses list? If it is, we either have a - // list of allowed selectors, or the flag that allows any selector. - bool addressPermitted; - bool anySelectorPermitted; - mapping(bytes4 => bool) permittedSelectors; -} - // Represents data associated with a specifc function selector. struct SelectorData { // The plugin that implements this execution function. diff --git a/src/account/PluginManagerInternals.sol b/src/account/PluginManagerInternals.sol index d55c6ec6..4b5d0188 100644 --- a/src/account/PluginManagerInternals.sol +++ b/src/account/PluginManagerInternals.sol @@ -11,18 +11,11 @@ import { ManifestFunction, ManifestAssociatedFunctionType, ManifestAssociatedFunction, - ManifestExternalCallPermission, PluginManifest } from "../interfaces/IPlugin.sol"; import {ExecutionHook} from "../interfaces/IAccountLoupe.sol"; import {FunctionReference, IPluginManager} from "../interfaces/IPluginManager.sol"; -import { - AccountStorage, - getAccountStorage, - SelectorData, - toSetValue, - PermittedExternalCallData -} from "./AccountStorage.sol"; +import {AccountStorage, getAccountStorage, SelectorData, toSetValue} from "./AccountStorage.sol"; abstract contract PluginManagerInternals is IPluginManager { using EnumerableSet for EnumerableSet.Bytes32Set; diff --git a/src/interfaces/IPlugin.sol b/src/interfaces/IPlugin.sol index 76c898d8..f7335ae4 100644 --- a/src/interfaces/IPlugin.sol +++ b/src/interfaces/IPlugin.sol @@ -47,12 +47,6 @@ struct ManifestExecutionHook { bool isPostHook; } -struct ManifestExternalCallPermission { - address externalAddress; - bool permitAnySelector; - bytes4[] selectors; -} - struct SelectorPermission { bytes4 functionSelector; string permissionDescription; diff --git a/test/account/AccountExecHooks.t.sol b/test/account/AccountExecHooks.t.sol index e0ea9112..83cd13ce 100644 --- a/test/account/AccountExecHooks.t.sol +++ b/test/account/AccountExecHooks.t.sol @@ -24,8 +24,8 @@ contract AccountExecHooksTest is AccountTestBase { uint8 internal constant _POST_HOOK_FUNCTION_ID_2 = 2; uint8 internal constant _BOTH_HOOKS_FUNCTION_ID_3 = 3; - PluginManifest internal m1; - PluginManifest internal m2; + PluginManifest internal _m1; + PluginManifest internal _m2; event PluginInstalled(address indexed plugin, bytes32 manifestHash, FunctionReference[] dependencies); event PluginUninstalled(address indexed plugin, bool indexed callbacksSucceeded); diff --git a/test/account/ExecuteFromPluginPermissions.t.sol b/test/account/ExecuteFromPluginPermissions.t.sol index 90811671..c6b148db 100644 --- a/test/account/ExecuteFromPluginPermissions.t.sol +++ b/test/account/ExecuteFromPluginPermissions.t.sol @@ -3,7 +3,6 @@ pragma solidity ^0.8.19; import {console} from "forge-std/Test.sol"; -import {UpgradeableModularAccount} from "../../src/account/UpgradeableModularAccount.sol"; import {FunctionReference} from "../../src/helpers/FunctionReferenceLib.sol"; import {Counter} from "../mocks/Counter.sol"; diff --git a/test/account/UpgradeableModularAccount.t.sol b/test/account/UpgradeableModularAccount.t.sol index a153fb50..30280257 100644 --- a/test/account/UpgradeableModularAccount.t.sol +++ b/test/account/UpgradeableModularAccount.t.sol @@ -11,7 +11,7 @@ import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol"; import {PluginManagerInternals} from "../../src/account/PluginManagerInternals.sol"; import {UpgradeableModularAccount} from "../../src/account/UpgradeableModularAccount.sol"; import {FunctionReference, FunctionReferenceLib} from "../../src/helpers/FunctionReferenceLib.sol"; -import {IPlugin, PluginManifest} from "../../src/interfaces/IPlugin.sol"; +import {PluginManifest} from "../../src/interfaces/IPlugin.sol"; import {IAccountLoupe} from "../../src/interfaces/IAccountLoupe.sol"; import {IPluginManager} from "../../src/interfaces/IPluginManager.sol"; import {Call} from "../../src/interfaces/IStandardExecutor.sol"; @@ -37,7 +37,7 @@ contract UpgradeableModularAccountTest is AccountTestBase { address public ethRecipient; Counter public counter; - PluginManifest internal manifest; + PluginManifest internal _manifest; FunctionReference public ownerValidation; diff --git a/test/mocks/plugins/ExecFromPluginPermissionsMocks.sol b/test/mocks/plugins/ExecFromPluginPermissionsMocks.sol index e050ab22..1e1981ad 100644 --- a/test/mocks/plugins/ExecFromPluginPermissionsMocks.sol +++ b/test/mocks/plugins/ExecFromPluginPermissionsMocks.sol @@ -1,12 +1,7 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.19; -import { - ManifestExecutionFunction, - ManifestExternalCallPermission, - PluginManifest, - PluginMetadata -} from "../../../src/interfaces/IPlugin.sol"; +import {ManifestExecutionFunction, PluginManifest, PluginMetadata} from "../../../src/interfaces/IPlugin.sol"; import {IPluginExecutor} from "../../../src/interfaces/IPluginExecutor.sol"; import {BasePlugin} from "../../../src/plugins/BasePlugin.sol"; diff --git a/test/mocks/plugins/ReturnDataPluginMocks.sol b/test/mocks/plugins/ReturnDataPluginMocks.sol index 3b3f6463..3486309c 100644 --- a/test/mocks/plugins/ReturnDataPluginMocks.sol +++ b/test/mocks/plugins/ReturnDataPluginMocks.sol @@ -1,12 +1,7 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.19; -import { - ManifestExecutionFunction, - ManifestExternalCallPermission, - PluginManifest, - PluginMetadata -} from "../../../src/interfaces/IPlugin.sol"; +import {ManifestExecutionFunction, PluginManifest, PluginMetadata} from "../../../src/interfaces/IPlugin.sol"; import {IPluginExecutor} from "../../../src/interfaces/IPluginExecutor.sol"; import {BasePlugin} from "../../../src/plugins/BasePlugin.sol";