diff --git a/script/Deploy.s.sol b/script/Deploy.s.sol index 52bd6433..bc11230a 100644 --- a/script/Deploy.s.sol +++ b/script/Deploy.s.sol @@ -19,7 +19,6 @@ pragma solidity ^0.8.22; import {Script} from "forge-std/Script.sol"; import {console} from "forge-std/Test.sol"; - import {IEntryPoint as I4337EntryPoint} from "@eth-infinitism/account-abstraction/interfaces/IEntryPoint.sol"; import {UpgradeableModularAccount} from "../src/account/UpgradeableModularAccount.sol"; diff --git a/src/account/AccountExecutor.sol b/src/account/AccountExecutor.sol index 05db6779..2761bf54 100644 --- a/src/account/AccountExecutor.sol +++ b/src/account/AccountExecutor.sol @@ -17,10 +17,9 @@ pragma solidity ^0.8.22; -import {ERC165Checker} from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; - import {UserOperation} from "modular-account-libs/interfaces/UserOperation.sol"; import {IPlugin} from "modular-account-libs/interfaces/IPlugin.sol"; +import {ERC165Checker} from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; /// @title Account Executor /// @author Alchemy diff --git a/src/account/AccountLoupe.sol b/src/account/AccountLoupe.sol index c51e81d9..5de5d742 100644 --- a/src/account/AccountLoupe.sol +++ b/src/account/AccountLoupe.sol @@ -17,14 +17,15 @@ pragma solidity ^0.8.22; -import {AccountStorageV1} from "../account/AccountStorageV1.sol"; -import {CastLib} from "../helpers/CastLib.sol"; -import {KnownSelectors} from "../helpers/KnownSelectors.sol"; import {IAccountLoupe} from "modular-account-libs/interfaces/IAccountLoupe.sol"; import {FunctionReference} from "modular-account-libs/interfaces/IPluginManager.sol"; import {CountableLinkedListSetLib} from "modular-account-libs/libraries/CountableLinkedListSetLib.sol"; import {LinkedListSet, LinkedListSetLib} from "modular-account-libs/libraries/LinkedListSetLib.sol"; +import {AccountStorageV1} from "../account/AccountStorageV1.sol"; +import {CastLib} from "../helpers/CastLib.sol"; +import {KnownSelectors} from "../helpers/KnownSelectors.sol"; + /// @title Account Loupe /// @author Alchemy /// @notice Provides view functions for querying the configuration of a modular account. diff --git a/src/account/PluginManagerInternals.sol b/src/account/PluginManagerInternals.sol index b1dfa5d5..5a36e238 100644 --- a/src/account/PluginManagerInternals.sol +++ b/src/account/PluginManagerInternals.sol @@ -17,8 +17,6 @@ pragma solidity ^0.8.22; -import {ERC165Checker} from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; - import {FunctionReferenceLib} from "modular-account-libs/libraries/FunctionReferenceLib.sol"; import { IPlugin, @@ -32,9 +30,10 @@ import { import {FunctionReference, IPluginManager} from "modular-account-libs/interfaces/IPluginManager.sol"; import {CountableLinkedListSetLib} from "modular-account-libs/libraries/CountableLinkedListSetLib.sol"; import {LinkedListSet, LinkedListSetLib} from "modular-account-libs/libraries/LinkedListSetLib.sol"; +import {ERC165Checker} from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; -import {KnownSelectors} from "../helpers/KnownSelectors.sol"; import {AccountStorageV1} from "../account/AccountStorageV1.sol"; +import {KnownSelectors} from "../helpers/KnownSelectors.sol"; import {CastLib} from "../helpers/CastLib.sol"; import {FunctionReferenceHelpers} from "../helpers/FunctionReferenceHelpers.sol"; diff --git a/src/account/UpgradeableModularAccount.sol b/src/account/UpgradeableModularAccount.sol index e292ef19..fd336d32 100644 --- a/src/account/UpgradeableModularAccount.sol +++ b/src/account/UpgradeableModularAccount.sol @@ -17,11 +17,6 @@ pragma solidity ^0.8.22; -import {IERC1155Receiver} from "@openzeppelin/contracts/interfaces/IERC1155Receiver.sol"; -import {IERC777Recipient} from "@openzeppelin/contracts/interfaces/IERC777Recipient.sol"; -import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; -import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; - import {IAccount} from "modular-account-libs/interfaces/IAccount.sol"; import {UserOperation} from "modular-account-libs/interfaces/UserOperation.sol"; import {IPlugin, PluginManifest} from "modular-account-libs/interfaces/IPlugin.sol"; @@ -31,18 +26,22 @@ import {Call, IStandardExecutor} from "modular-account-libs/interfaces/IStandard import {CountableLinkedListSetLib} from "modular-account-libs/libraries/CountableLinkedListSetLib.sol"; import {LinkedListSet, LinkedListSetLib} from "modular-account-libs/libraries/LinkedListSetLib.sol"; import {FunctionReference, IPluginManager} from "modular-account-libs/interfaces/IPluginManager.sol"; +import {IERC1155Receiver} from "@openzeppelin/contracts/interfaces/IERC1155Receiver.sol"; +import {IERC777Recipient} from "@openzeppelin/contracts/interfaces/IERC777Recipient.sol"; +import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; +import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; -import {UUPSUpgradeable} from "../../ext/UUPSUpgradeable.sol"; -import {CastLib} from "../helpers/CastLib.sol"; -import {_coalescePreValidation, _coalesceValidation} from "../helpers/ValidationDataHelpers.sol"; import {IEntryPoint} from "../interfaces/erc4337/IEntryPoint.sol"; import {IAccountInitializable} from "../interfaces/IAccountInitializable.sol"; import {IAccountView} from "../interfaces/IAccountView.sol"; +import {CastLib} from "../helpers/CastLib.sol"; +import {_coalescePreValidation, _coalesceValidation} from "../helpers/ValidationDataHelpers.sol"; +import {FunctionReferenceHelpers} from "../helpers/FunctionReferenceHelpers.sol"; +import {UUPSUpgradeable} from "../../ext/UUPSUpgradeable.sol"; import {AccountExecutor} from "./AccountExecutor.sol"; import {AccountLoupe} from "./AccountLoupe.sol"; import {AccountStorageInitializable} from "./AccountStorageInitializable.sol"; import {PluginManagerInternals} from "./PluginManagerInternals.sol"; -import {FunctionReferenceHelpers} from "../helpers/FunctionReferenceHelpers.sol"; /// @title Upgradeable Modular Account /// @author Alchemy diff --git a/src/helpers/KnownSelectors.sol b/src/helpers/KnownSelectors.sol index 163363f9..37d6a4f1 100644 --- a/src/helpers/KnownSelectors.sol +++ b/src/helpers/KnownSelectors.sol @@ -17,22 +17,22 @@ pragma solidity ^0.8.22; -import {UUPSUpgradeable} from "../../ext/UUPSUpgradeable.sol"; +import {IAccount} from "modular-account-libs/interfaces/IAccount.sol"; +import {IAccountLoupe} from "modular-account-libs/interfaces/IAccountLoupe.sol"; +import {IPluginManager} from "modular-account-libs/interfaces/IPluginManager.sol"; +import {IPlugin} from "modular-account-libs/interfaces/IPlugin.sol"; +import {IPluginExecutor} from "modular-account-libs/interfaces/IPluginExecutor.sol"; +import {IStandardExecutor} from "modular-account-libs/interfaces/IStandardExecutor.sol"; import {IERC1155Receiver} from "@openzeppelin/contracts/interfaces/IERC1155Receiver.sol"; import {IERC777Recipient} from "@openzeppelin/contracts/interfaces/IERC777Recipient.sol"; import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; -import {IAccount} from "modular-account-libs/interfaces/IAccount.sol"; +import {UUPSUpgradeable} from "../../ext/UUPSUpgradeable.sol"; import {IAggregator} from "../../src/interfaces/erc4337/IAggregator.sol"; import {IPaymaster} from "../../src/interfaces/erc4337/IPaymaster.sol"; -import {IAccountLoupe} from "modular-account-libs/interfaces/IAccountLoupe.sol"; import {IAccountView} from "../../src/interfaces/IAccountView.sol"; -import {IPluginManager} from "modular-account-libs/interfaces/IPluginManager.sol"; import {IAccountInitializable} from "../interfaces/IAccountInitializable.sol"; -import {IPlugin} from "modular-account-libs/interfaces/IPlugin.sol"; -import {IPluginExecutor} from "modular-account-libs/interfaces/IPluginExecutor.sol"; -import {IStandardExecutor} from "modular-account-libs/interfaces/IStandardExecutor.sol"; /// @title Known Selectors /// @author Alchemy diff --git a/src/plugins/BasePlugin.sol b/src/plugins/BasePlugin.sol index 24ca0d0c..d165a709 100644 --- a/src/plugins/BasePlugin.sol +++ b/src/plugins/BasePlugin.sol @@ -17,9 +17,8 @@ pragma solidity ^0.8.22; -import {ERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol"; - import {UserOperation} from "modular-account-libs/interfaces/UserOperation.sol"; +import {ERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol"; import {IPlugin, PluginManifest, PluginMetadata} from "modular-account-libs/interfaces/IPlugin.sol"; /// @title Base contract for plugins diff --git a/src/plugins/owner/MultiOwnerPlugin.sol b/src/plugins/owner/MultiOwnerPlugin.sol index 3fd92265..f6d155d8 100644 --- a/src/plugins/owner/MultiOwnerPlugin.sol +++ b/src/plugins/owner/MultiOwnerPlugin.sol @@ -17,12 +17,6 @@ pragma solidity ^0.8.22; -import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol"; -import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; -import {SignatureChecker} from "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol"; - -import {UpgradeableModularAccount, UUPSUpgradeable} from "../../account/UpgradeableModularAccount.sol"; -import {CastLib} from "../../helpers/CastLib.sol"; import {UserOperation} from "modular-account-libs/interfaces/UserOperation.sol"; import { ManifestAssociatedFunction, @@ -40,6 +34,12 @@ import { import { SetValue, SIG_VALIDATION_PASSED, SIG_VALIDATION_FAILED } from "modular-account-libs/libraries/Constants.sol"; +import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol"; +import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; +import {SignatureChecker} from "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol"; + +import {UpgradeableModularAccount, UUPSUpgradeable} from "../../account/UpgradeableModularAccount.sol"; +import {CastLib} from "../../helpers/CastLib.sol"; import {BasePlugin} from "../BasePlugin.sol"; import {IMultiOwnerPlugin} from "./IMultiOwnerPlugin.sol"; diff --git a/src/plugins/session/SessionKeyPlugin.sol b/src/plugins/session/SessionKeyPlugin.sol index 2ed52af0..c8519574 100644 --- a/src/plugins/session/SessionKeyPlugin.sol +++ b/src/plugins/session/SessionKeyPlugin.sol @@ -17,9 +17,6 @@ pragma solidity ^0.8.22; -import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; - -import {CastLib} from "../../helpers/CastLib.sol"; import {UserOperation} from "modular-account-libs/interfaces/UserOperation.sol"; import {IPlugin} from "modular-account-libs/interfaces/IPlugin.sol"; import { @@ -43,6 +40,9 @@ import { SIG_VALIDATION_FAILED } from "modular-account-libs/libraries/Constants.sol"; import {BasePlugin} from "modular-account-libs/plugins/BasePlugin.sol"; +import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; + +import {CastLib} from "../../helpers/CastLib.sol"; import {ISessionKeyPlugin} from "./ISessionKeyPlugin.sol"; import {SessionKeyPermissions} from "./permissions/SessionKeyPermissions.sol"; diff --git a/src/plugins/session/permissions/SessionKeyPermissions.sol b/src/plugins/session/permissions/SessionKeyPermissions.sol index 34c5639a..e036d702 100644 --- a/src/plugins/session/permissions/SessionKeyPermissions.sol +++ b/src/plugins/session/permissions/SessionKeyPermissions.sol @@ -17,12 +17,12 @@ pragma solidity ^0.8.22; -import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; - import {UserOperation} from "modular-account-libs/interfaces/UserOperation.sol"; import {Call} from "modular-account-libs/interfaces/IStandardExecutor.sol"; import {IStandardExecutor} from "modular-account-libs/interfaces/IStandardExecutor.sol"; import {SIG_VALIDATION_PASSED, SIG_VALIDATION_FAILED} from "modular-account-libs/libraries/Constants.sol"; +import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; + import {ISessionKeyPlugin} from "../ISessionKeyPlugin.sol"; import {ISessionKeyPermissionsUpdates} from "./ISessionKeyPermissionsUpdates.sol"; import {SessionKeyPermissionsLoupe} from "./SessionKeyPermissionsLoupe.sol"; diff --git a/src/plugins/session/permissions/SessionKeyPermissionsBase.sol b/src/plugins/session/permissions/SessionKeyPermissionsBase.sol index 4858daf6..05178d32 100644 --- a/src/plugins/session/permissions/SessionKeyPermissionsBase.sol +++ b/src/plugins/session/permissions/SessionKeyPermissionsBase.sol @@ -18,6 +18,7 @@ pragma solidity ^0.8.22; import {PluginStorageLib, StoragePointer} from "modular-account-libs/libraries/PluginStorageLib.sol"; + import {ISessionKeyPlugin} from "../ISessionKeyPlugin.sol"; abstract contract SessionKeyPermissionsBase is ISessionKeyPlugin { diff --git a/test/account/AccountExecHooks.t.sol b/test/account/AccountExecHooks.t.sol index 655600e9..526bc460 100644 --- a/test/account/AccountExecHooks.t.sol +++ b/test/account/AccountExecHooks.t.sol @@ -18,15 +18,8 @@ pragma solidity ^0.8.22; import {Test} from "forge-std/Test.sol"; - import {EntryPoint} from "@eth-infinitism/account-abstraction/core/EntryPoint.sol"; -import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; - -import {PluginManagerInternals} from "../../src/account/PluginManagerInternals.sol"; -import {UpgradeableModularAccount} from "../../src/account/UpgradeableModularAccount.sol"; -import {MultiOwnerModularAccountFactory} from "../../src/factory/MultiOwnerModularAccountFactory.sol"; import {FunctionReferenceLib} from "modular-account-libs/libraries/FunctionReferenceLib.sol"; -import {IEntryPoint} from "../../src/interfaces/erc4337/IEntryPoint.sol"; import { IPlugin, ManifestExecutionHook, @@ -36,6 +29,12 @@ import { ManifestAssociatedFunction } from "modular-account-libs/interfaces/IPlugin.sol"; import {FunctionReference} from "modular-account-libs/interfaces/IPluginManager.sol"; +import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; + +import {PluginManagerInternals} from "../../src/account/PluginManagerInternals.sol"; +import {UpgradeableModularAccount} from "../../src/account/UpgradeableModularAccount.sol"; +import {MultiOwnerModularAccountFactory} from "../../src/factory/MultiOwnerModularAccountFactory.sol"; +import {IEntryPoint} from "../../src/interfaces/erc4337/IEntryPoint.sol"; import {MultiOwnerPlugin} from "../../src/plugins/owner/MultiOwnerPlugin.sol"; import {MockPlugin} from "../mocks/MockPlugin.sol"; diff --git a/test/account/AccountLoupe.t.sol b/test/account/AccountLoupe.t.sol index 40d436ac..d35d84b5 100644 --- a/test/account/AccountLoupe.t.sol +++ b/test/account/AccountLoupe.t.sol @@ -18,14 +18,8 @@ pragma solidity ^0.8.22; import {Test} from "forge-std/Test.sol"; - import {EntryPoint} from "@eth-infinitism/account-abstraction/core/EntryPoint.sol"; -import {UUPSUpgradeable} from "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol"; - -import {UpgradeableModularAccount} from "../../src/account/UpgradeableModularAccount.sol"; -import {MultiOwnerModularAccountFactory} from "../../src/factory/MultiOwnerModularAccountFactory.sol"; import {FunctionReferenceLib} from "modular-account-libs/libraries/FunctionReferenceLib.sol"; -import {IEntryPoint} from "../../src/interfaces/erc4337/IEntryPoint.sol"; import {IAccountLoupe} from "modular-account-libs/interfaces/IAccountLoupe.sol"; import { ManifestAssociatedFunctionType, @@ -35,6 +29,11 @@ import { } from "modular-account-libs/interfaces/IPlugin.sol"; import {FunctionReference, IPluginManager} from "modular-account-libs/interfaces/IPluginManager.sol"; import {IStandardExecutor} from "modular-account-libs/interfaces/IStandardExecutor.sol"; +import {UUPSUpgradeable} from "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol"; + +import {UpgradeableModularAccount} from "../../src/account/UpgradeableModularAccount.sol"; +import {MultiOwnerModularAccountFactory} from "../../src/factory/MultiOwnerModularAccountFactory.sol"; +import {IEntryPoint} from "../../src/interfaces/erc4337/IEntryPoint.sol"; import {IMultiOwnerPlugin} from "../../src/plugins/owner/IMultiOwnerPlugin.sol"; import {MultiOwnerPlugin} from "../../src/plugins/owner/MultiOwnerPlugin.sol"; import {MockPlugin} from "../mocks/MockPlugin.sol"; diff --git a/test/account/AccountPreValidationHooks.t.sol b/test/account/AccountPreValidationHooks.t.sol index dcee2207..37006c75 100644 --- a/test/account/AccountPreValidationHooks.t.sol +++ b/test/account/AccountPreValidationHooks.t.sol @@ -18,15 +18,8 @@ pragma solidity ^0.8.22; import {Test} from "forge-std/Test.sol"; - import {EntryPoint} from "@eth-infinitism/account-abstraction/core/EntryPoint.sol"; -import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; - -import {PluginManagerInternals} from "../../src/account/PluginManagerInternals.sol"; -import {UpgradeableModularAccount} from "../../src/account/UpgradeableModularAccount.sol"; -import {MultiOwnerModularAccountFactory} from "../../src/factory/MultiOwnerModularAccountFactory.sol"; import {FunctionReferenceLib} from "modular-account-libs/libraries/FunctionReferenceLib.sol"; -import {IEntryPoint} from "../../src/interfaces/erc4337/IEntryPoint.sol"; import {UserOperation} from "modular-account-libs/interfaces/UserOperation.sol"; import { IPlugin, @@ -36,6 +29,12 @@ import { ManifestAssociatedFunction } from "modular-account-libs/interfaces/IPlugin.sol"; import {FunctionReference} from "modular-account-libs/interfaces/IPluginManager.sol"; +import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; + +import {PluginManagerInternals} from "../../src/account/PluginManagerInternals.sol"; +import {UpgradeableModularAccount} from "../../src/account/UpgradeableModularAccount.sol"; +import {MultiOwnerModularAccountFactory} from "../../src/factory/MultiOwnerModularAccountFactory.sol"; +import {IEntryPoint} from "../../src/interfaces/erc4337/IEntryPoint.sol"; import {IMultiOwnerPlugin} from "../../src/plugins/owner/IMultiOwnerPlugin.sol"; import {MultiOwnerPlugin} from "../../src/plugins/owner/MultiOwnerPlugin.sol"; import {MockPlugin} from "../mocks/MockPlugin.sol"; diff --git a/test/account/AccountReturnData.t.sol b/test/account/AccountReturnData.t.sol index 39ad6a29..66920fc4 100644 --- a/test/account/AccountReturnData.t.sol +++ b/test/account/AccountReturnData.t.sol @@ -18,14 +18,13 @@ pragma solidity ^0.8.22; import {Test} from "forge-std/Test.sol"; - import {EntryPoint} from "@eth-infinitism/account-abstraction/core/EntryPoint.sol"; +import {FunctionReference} from "modular-account-libs/interfaces/IPluginManager.sol"; +import {Call} from "modular-account-libs/interfaces/IStandardExecutor.sol"; import {UpgradeableModularAccount} from "../../src/account/UpgradeableModularAccount.sol"; import {MultiOwnerModularAccountFactory} from "../../src/factory/MultiOwnerModularAccountFactory.sol"; import {IEntryPoint} from "../../src/interfaces/erc4337/IEntryPoint.sol"; -import {FunctionReference} from "modular-account-libs/interfaces/IPluginManager.sol"; -import {Call} from "modular-account-libs/interfaces/IStandardExecutor.sol"; import {MultiOwnerPlugin} from "../../src/plugins/owner/MultiOwnerPlugin.sol"; import { RegularResultContract, diff --git a/test/account/ExecuteFromPluginPermissions.t.sol b/test/account/ExecuteFromPluginPermissions.t.sol index c71ab72b..314c033c 100644 --- a/test/account/ExecuteFromPluginPermissions.t.sol +++ b/test/account/ExecuteFromPluginPermissions.t.sol @@ -18,14 +18,13 @@ pragma solidity ^0.8.22; import {Test, console} from "forge-std/Test.sol"; - import {EntryPoint} from "@eth-infinitism/account-abstraction/core/EntryPoint.sol"; +import {IPlugin} from "modular-account-libs/interfaces/IPlugin.sol"; +import {FunctionReference} from "modular-account-libs/interfaces/IPluginManager.sol"; import {UpgradeableModularAccount} from "../../src/account/UpgradeableModularAccount.sol"; import {MultiOwnerModularAccountFactory} from "../../src/factory/MultiOwnerModularAccountFactory.sol"; import {IEntryPoint} from "../../src/interfaces/erc4337/IEntryPoint.sol"; -import {IPlugin} from "modular-account-libs/interfaces/IPlugin.sol"; -import {FunctionReference} from "modular-account-libs/interfaces/IPluginManager.sol"; import {MultiOwnerPlugin} from "../../src/plugins/owner/MultiOwnerPlugin.sol"; import {Counter} from "../mocks/Counter.sol"; import { diff --git a/test/account/ManifestValidity.t.sol b/test/account/ManifestValidity.t.sol index 2b4e0580..69620957 100644 --- a/test/account/ManifestValidity.t.sol +++ b/test/account/ManifestValidity.t.sol @@ -18,14 +18,13 @@ pragma solidity ^0.8.22; import {Test} from "forge-std/Test.sol"; - import {EntryPoint} from "@eth-infinitism/account-abstraction/core/EntryPoint.sol"; +import {FunctionReference} from "modular-account-libs/interfaces/IPluginManager.sol"; import {PluginManagerInternals} from "../../src/account/PluginManagerInternals.sol"; import {UpgradeableModularAccount} from "../../src/account/UpgradeableModularAccount.sol"; import {MultiOwnerModularAccountFactory} from "../../src/factory/MultiOwnerModularAccountFactory.sol"; import {IEntryPoint} from "../../src/interfaces/erc4337/IEntryPoint.sol"; -import {FunctionReference} from "modular-account-libs/interfaces/IPluginManager.sol"; import {MultiOwnerPlugin} from "../../src/plugins/owner/MultiOwnerPlugin.sol"; import { BadValidationMagicValue_UserOp_Plugin, diff --git a/test/account/TokenReceiver.t.sol b/test/account/TokenReceiver.t.sol index 4e84f4ac..3b88055c 100644 --- a/test/account/TokenReceiver.t.sol +++ b/test/account/TokenReceiver.t.sol @@ -18,10 +18,17 @@ pragma solidity ^0.8.22; import {Test} from "forge-std/Test.sol"; - +import {EntryPoint} from "@eth-infinitism/account-abstraction/core/EntryPoint.sol"; +import {FunctionReference} from "modular-account-libs/interfaces/IPluginManager.sol"; +import { + IPlugin, + ManifestExecutionHook, + ManifestAssociatedFunctionType, + ManifestFunction, + PluginManifest +} from "modular-account-libs/interfaces/IPlugin.sol"; import {ERC721PresetMinterPauserAutoId} from "@openzeppelin/contracts/token/ERC721/presets/ERC721PresetMinterPauserAutoId.sol"; -import {EntryPoint} from "@eth-infinitism/account-abstraction/core/EntryPoint.sol"; import {IERC1155Receiver} from "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol"; import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import {IERC777Recipient} from "@openzeppelin/contracts/token/ERC777/IERC777Recipient.sol"; @@ -29,14 +36,6 @@ import {IERC777Recipient} from "@openzeppelin/contracts/token/ERC777/IERC777Reci import {UpgradeableModularAccount} from "../../src/account/UpgradeableModularAccount.sol"; import {MultiOwnerModularAccountFactory} from "../../src/factory/MultiOwnerModularAccountFactory.sol"; import {IEntryPoint} from "../../src/interfaces/erc4337/IEntryPoint.sol"; -import { - IPlugin, - ManifestExecutionHook, - ManifestAssociatedFunctionType, - ManifestFunction, - PluginManifest -} from "modular-account-libs/interfaces/IPlugin.sol"; -import {FunctionReference} from "modular-account-libs/interfaces/IPluginManager.sol"; import {MultiOwnerPlugin} from "../../src/plugins/owner/MultiOwnerPlugin.sol"; import {MockPlugin} from "../mocks/MockPlugin.sol"; import {MockERC1155} from "../mocks/tokens/MockERC1155.sol"; diff --git a/test/account/UpgradeableModularAccount.t.sol b/test/account/UpgradeableModularAccount.t.sol index 2c13fc44..ca75f149 100644 --- a/test/account/UpgradeableModularAccount.t.sol +++ b/test/account/UpgradeableModularAccount.t.sol @@ -19,20 +19,20 @@ pragma solidity ^0.8.22; import {Test, console} from "forge-std/Test.sol"; +import {EntryPoint} from "@eth-infinitism/account-abstraction/core/EntryPoint.sol"; +import {UserOperation} from "modular-account-libs/interfaces/UserOperation.sol"; +import {IPlugin, PluginManifest} from "modular-account-libs/interfaces/IPlugin.sol"; +import {FunctionReference, IPluginManager} from "modular-account-libs/interfaces/IPluginManager.sol"; +import {Call} from "modular-account-libs/interfaces/IStandardExecutor.sol"; import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; -import {EntryPoint} from "@eth-infinitism/account-abstraction/core/EntryPoint.sol"; import {AccountExecutor} from "../../src/account/AccountExecutor.sol"; import {PluginManagerInternals} from "../../src/account/PluginManagerInternals.sol"; import {UpgradeableModularAccount} from "../../src/account/UpgradeableModularAccount.sol"; import {MultiOwnerModularAccountFactory} from "../../src/factory/MultiOwnerModularAccountFactory.sol"; import {IEntryPoint} from "../../src/interfaces/erc4337/IEntryPoint.sol"; -import {UserOperation} from "modular-account-libs/interfaces/UserOperation.sol"; import {IAccountInitializable} from "../../src/interfaces/IAccountInitializable.sol"; -import {IPlugin, PluginManifest} from "modular-account-libs/interfaces/IPlugin.sol"; -import {FunctionReference, IPluginManager} from "modular-account-libs/interfaces/IPluginManager.sol"; -import {Call} from "modular-account-libs/interfaces/IStandardExecutor.sol"; import {IMultiOwnerPlugin} from "../../src/plugins/owner/IMultiOwnerPlugin.sol"; import {MultiOwnerPlugin} from "../../src/plugins/owner/MultiOwnerPlugin.sol"; import {SessionKeyPlugin} from "../../src/plugins/session/SessionKeyPlugin.sol"; diff --git a/test/account/UpgradeableModularAccountPluginManager.t.sol b/test/account/UpgradeableModularAccountPluginManager.t.sol index 05ad6d67..f0e871ff 100644 --- a/test/account/UpgradeableModularAccountPluginManager.t.sol +++ b/test/account/UpgradeableModularAccountPluginManager.t.sol @@ -21,19 +21,19 @@ import {Test} from "forge-std/Test.sol"; import {EntryPoint} from "@eth-infinitism/account-abstraction/core/EntryPoint.sol"; import {IPaymaster} from "@eth-infinitism/account-abstraction/interfaces/IPaymaster.sol"; -import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; - -import {PluginManagerInternals} from "../../src/account/PluginManagerInternals.sol"; -import {UpgradeableModularAccount} from "../../src/account/UpgradeableModularAccount.sol"; -import {MultiOwnerModularAccountFactory} from "../../src/factory/MultiOwnerModularAccountFactory.sol"; -import {FunctionReferenceLib} from "modular-account-libs/libraries/FunctionReferenceLib.sol"; -import {IEntryPoint} from "../../src/interfaces/erc4337/IEntryPoint.sol"; import {IAccountLoupe} from "modular-account-libs/interfaces/IAccountLoupe.sol"; import {PluginManifest} from "modular-account-libs/interfaces/IPlugin.sol"; import {IPlugin, PluginManifest} from "modular-account-libs/interfaces/IPlugin.sol"; import {FunctionReference, IPluginManager} from "modular-account-libs/interfaces/IPluginManager.sol"; import {IStandardExecutor} from "modular-account-libs/interfaces/IStandardExecutor.sol"; import {Call} from "modular-account-libs/interfaces/IStandardExecutor.sol"; +import {FunctionReferenceLib} from "modular-account-libs/libraries/FunctionReferenceLib.sol"; +import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; + +import {PluginManagerInternals} from "../../src/account/PluginManagerInternals.sol"; +import {UpgradeableModularAccount} from "../../src/account/UpgradeableModularAccount.sol"; +import {MultiOwnerModularAccountFactory} from "../../src/factory/MultiOwnerModularAccountFactory.sol"; +import {IEntryPoint} from "../../src/interfaces/erc4337/IEntryPoint.sol"; import {IMultiOwnerPlugin} from "../../src/plugins/owner/IMultiOwnerPlugin.sol"; import {MultiOwnerPlugin} from "../../src/plugins/owner/MultiOwnerPlugin.sol"; import {SessionKeyPlugin} from "../../src/plugins/session/SessionKeyPlugin.sol"; diff --git a/test/account/ValidationIntersection.t.sol b/test/account/ValidationIntersection.t.sol index 8467fe6c..f810b4a3 100644 --- a/test/account/ValidationIntersection.t.sol +++ b/test/account/ValidationIntersection.t.sol @@ -18,15 +18,14 @@ pragma solidity ^0.8.22; import {Test} from "forge-std/Test.sol"; - import {EntryPoint} from "@eth-infinitism/account-abstraction/core/EntryPoint.sol"; +import {UserOperation} from "modular-account-libs/interfaces/UserOperation.sol"; +import {FunctionReference} from "modular-account-libs/interfaces/IPluginManager.sol"; +import {SIG_VALIDATION_FAILED, SIG_VALIDATION_PASSED} from "modular-account-libs/libraries/Constants.sol"; import {UpgradeableModularAccount} from "../../src/account/UpgradeableModularAccount.sol"; import {MultiOwnerModularAccountFactory} from "../../src/factory/MultiOwnerModularAccountFactory.sol"; import {IEntryPoint} from "../../src/interfaces/erc4337/IEntryPoint.sol"; -import {UserOperation} from "modular-account-libs/interfaces/UserOperation.sol"; -import {FunctionReference} from "modular-account-libs/interfaces/IPluginManager.sol"; -import {SIG_VALIDATION_FAILED, SIG_VALIDATION_PASSED} from "modular-account-libs/libraries/Constants.sol"; import {MultiOwnerPlugin} from "../../src/plugins/owner/MultiOwnerPlugin.sol"; import { MockBaseUserOpValidationPlugin, diff --git a/test/account/phases/AccountStatePhases.t.sol b/test/account/phases/AccountStatePhases.t.sol index 08a226dc..0869c934 100644 --- a/test/account/phases/AccountStatePhases.t.sol +++ b/test/account/phases/AccountStatePhases.t.sol @@ -18,14 +18,8 @@ pragma solidity ^0.8.22; import {Test} from "forge-std/Test.sol"; - import {EntryPoint} from "@eth-infinitism/account-abstraction/core/EntryPoint.sol"; -import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; - -import {UpgradeableModularAccount} from "../../../src/account/UpgradeableModularAccount.sol"; -import {MultiOwnerModularAccountFactory} from "../../../src/factory/MultiOwnerModularAccountFactory.sol"; import {FunctionReferenceLib} from "modular-account-libs/libraries/FunctionReferenceLib.sol"; -import {IEntryPoint} from "../../../src/interfaces/erc4337/IEntryPoint.sol"; import {UserOperation} from "modular-account-libs/interfaces/UserOperation.sol"; import { IPlugin, @@ -37,6 +31,11 @@ import { } from "modular-account-libs/interfaces/IPlugin.sol"; import {FunctionReference, IPluginManager} from "modular-account-libs/interfaces/IPluginManager.sol"; import {IStandardExecutor, Call} from "modular-account-libs/interfaces/IStandardExecutor.sol"; +import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; + +import {UpgradeableModularAccount} from "../../../src/account/UpgradeableModularAccount.sol"; +import {MultiOwnerModularAccountFactory} from "../../../src/factory/MultiOwnerModularAccountFactory.sol"; +import {IEntryPoint} from "../../../src/interfaces/erc4337/IEntryPoint.sol"; import {MultiOwnerPlugin} from "../../../src/plugins/owner/MultiOwnerPlugin.sol"; import {MockPlugin} from "../../mocks/MockPlugin.sol"; import {AccountStateMutatingPlugin} from "../../mocks/plugins/AccountStateMutatingPlugin.sol"; diff --git a/test/account/phases/AccountStatePhasesExec.t.sol b/test/account/phases/AccountStatePhasesExec.t.sol index 1ea13323..b0b1f34f 100644 --- a/test/account/phases/AccountStatePhasesExec.t.sol +++ b/test/account/phases/AccountStatePhasesExec.t.sol @@ -27,6 +27,7 @@ import { } from "modular-account-libs/interfaces/IPlugin.sol"; import {IPluginManager} from "modular-account-libs/interfaces/IPluginManager.sol"; import {IStandardExecutor, Call} from "modular-account-libs/interfaces/IStandardExecutor.sol"; + import {MockPlugin} from "../../mocks/MockPlugin.sol"; import {AccountStateMutatingPlugin} from "../../mocks/plugins/AccountStateMutatingPlugin.sol"; import {AccountStatePhasesTest} from "./AccountStatePhases.t.sol"; diff --git a/test/account/phases/AccountStatePhasesRTValidation.t.sol b/test/account/phases/AccountStatePhasesRTValidation.t.sol index 72d8d127..2aba4954 100644 --- a/test/account/phases/AccountStatePhasesRTValidation.t.sol +++ b/test/account/phases/AccountStatePhasesRTValidation.t.sol @@ -17,10 +17,11 @@ pragma solidity ^0.8.22; -import {UpgradeableModularAccount} from "../../../src/account/UpgradeableModularAccount.sol"; import {IPlugin} from "modular-account-libs/interfaces/IPlugin.sol"; import {IPluginManager} from "modular-account-libs/interfaces/IPluginManager.sol"; import {IStandardExecutor, Call} from "modular-account-libs/interfaces/IStandardExecutor.sol"; + +import {UpgradeableModularAccount} from "../../../src/account/UpgradeableModularAccount.sol"; import {AccountStateMutatingPlugin} from "../../mocks/plugins/AccountStateMutatingPlugin.sol"; import {AccountStatePhasesTest} from "./AccountStatePhases.t.sol"; diff --git a/test/account/phases/AccountStatePhasesUOValidation.t.sol b/test/account/phases/AccountStatePhasesUOValidation.t.sol index 80584142..24768b0b 100644 --- a/test/account/phases/AccountStatePhasesUOValidation.t.sol +++ b/test/account/phases/AccountStatePhasesUOValidation.t.sol @@ -17,12 +17,11 @@ pragma solidity ^0.8.22; -import {AccountStatePhasesTest} from "./AccountStatePhases.t.sol"; - import {IPluginManager} from "modular-account-libs/interfaces/IPluginManager.sol"; import {IPlugin} from "modular-account-libs/interfaces/IPlugin.sol"; import {IStandardExecutor, Call} from "modular-account-libs/interfaces/IStandardExecutor.sol"; +import {AccountStatePhasesTest} from "./AccountStatePhases.t.sol"; import {AccountStateMutatingPlugin} from "../../mocks/plugins/AccountStateMutatingPlugin.sol"; // Tests the account state phase behavior when the source of the state modification diff --git a/test/comparison/CompareSimpleAccount.t.sol b/test/comparison/CompareSimpleAccount.t.sol index 36c0d91c..51abd020 100644 --- a/test/comparison/CompareSimpleAccount.t.sol +++ b/test/comparison/CompareSimpleAccount.t.sol @@ -22,10 +22,10 @@ import {Test} from "forge-std/Test.sol"; import {EntryPoint} from "@eth-infinitism/account-abstraction/core/EntryPoint.sol"; import {SimpleAccount} from "@eth-infinitism/account-abstraction/samples/SimpleAccount.sol"; import {SimpleAccountFactory} from "@eth-infinitism/account-abstraction/samples/SimpleAccountFactory.sol"; +import {UserOperation} from "modular-account-libs/interfaces/UserOperation.sol"; import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import {IEntryPoint} from "../../src/interfaces/erc4337/IEntryPoint.sol"; -import {UserOperation} from "modular-account-libs/interfaces/UserOperation.sol"; import {Counter} from "../mocks/Counter.sol"; contract CompareSimpleAccountTest is Test { diff --git a/test/factory/MultiOwnerMAFactoryTest.t.sol b/test/factory/MultiOwnerMAFactoryTest.t.sol index 2f76a19c..5d9d510a 100644 --- a/test/factory/MultiOwnerMAFactoryTest.t.sol +++ b/test/factory/MultiOwnerMAFactoryTest.t.sol @@ -18,7 +18,6 @@ pragma solidity ^0.8.22; import {Test} from "forge-std/Test.sol"; - import {EntryPoint} from "@eth-infinitism/account-abstraction/core/EntryPoint.sol"; import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; diff --git a/test/helpers/KnownSelectors.t.sol b/test/helpers/KnownSelectors.t.sol index 637cc179..086efe40 100644 --- a/test/helpers/KnownSelectors.t.sol +++ b/test/helpers/KnownSelectors.t.sol @@ -18,10 +18,14 @@ pragma solidity ^0.8.22; import {Test} from "forge-std/Test.sol"; - import {BaseAccount} from "@eth-infinitism/account-abstraction/core/BaseAccount.sol"; import {IAggregator} from "@eth-infinitism/account-abstraction/interfaces/IAggregator.sol"; import {IPaymaster} from "@eth-infinitism/account-abstraction/interfaces/IPaymaster.sol"; +import {IAccountLoupe} from "modular-account-libs/interfaces/IAccountLoupe.sol"; +import {IPlugin} from "modular-account-libs/interfaces/IPlugin.sol"; +import {IPluginExecutor} from "modular-account-libs/interfaces/IPluginExecutor.sol"; +import {IPluginManager} from "modular-account-libs/interfaces/IPluginManager.sol"; +import {IStandardExecutor} from "modular-account-libs/interfaces/IStandardExecutor.sol"; import {IERC1155Receiver} from "@openzeppelin/contracts/interfaces/IERC1155Receiver.sol"; import {IERC777Recipient} from "@openzeppelin/contracts/interfaces/IERC777Recipient.sol"; import {UUPSUpgradeable} from "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol"; @@ -30,11 +34,6 @@ import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; import {KnownSelectors} from "../../src/helpers/KnownSelectors.sol"; import {IAccountInitializable} from "../../src/interfaces/IAccountInitializable.sol"; -import {IAccountLoupe} from "modular-account-libs/interfaces/IAccountLoupe.sol"; -import {IPlugin} from "modular-account-libs/interfaces/IPlugin.sol"; -import {IPluginExecutor} from "modular-account-libs/interfaces/IPluginExecutor.sol"; -import {IPluginManager} from "modular-account-libs/interfaces/IPluginManager.sol"; -import {IStandardExecutor} from "modular-account-libs/interfaces/IStandardExecutor.sol"; contract KnownSelectorsTest is Test { function test_isNativeFunction() public { diff --git a/test/mocks/MockPlugin.sol b/test/mocks/MockPlugin.sol index f58c52a5..92710ab1 100644 --- a/test/mocks/MockPlugin.sol +++ b/test/mocks/MockPlugin.sol @@ -17,9 +17,8 @@ pragma solidity ^0.8.22; -import {ERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol"; - import {PluginManifest, PluginMetadata, IPlugin} from "modular-account-libs/interfaces/IPlugin.sol"; +import {ERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol"; contract MockPlugin is ERC165 { // It's super inefficient to hold the entire abi-encoded manifest in storage, but this is fine since it's diff --git a/test/mocks/plugins/AccountStateMutatingPlugin.sol b/test/mocks/plugins/AccountStateMutatingPlugin.sol index 84691b6c..89438ca2 100644 --- a/test/mocks/plugins/AccountStateMutatingPlugin.sol +++ b/test/mocks/plugins/AccountStateMutatingPlugin.sol @@ -25,6 +25,7 @@ import { ManifestAssociatedFunctionType, ManifestAssociatedFunction } from "modular-account-libs/interfaces/IPlugin.sol"; + import {BaseTestPlugin} from "./BaseTestPlugin.sol"; // Used in conjunction with AccountStatePhasesTest to verify that the account state is consistent when plugins are diff --git a/test/mocks/plugins/BadTransferOwnershipPlugin.sol b/test/mocks/plugins/BadTransferOwnershipPlugin.sol index dee885a0..bfdd5814 100644 --- a/test/mocks/plugins/BadTransferOwnershipPlugin.sol +++ b/test/mocks/plugins/BadTransferOwnershipPlugin.sol @@ -27,6 +27,7 @@ import { } from "modular-account-libs/interfaces/IPlugin.sol"; import {IPluginExecutor} from "modular-account-libs/interfaces/IPluginExecutor.sol"; import {IStandardExecutor} from "modular-account-libs/interfaces/IStandardExecutor.sol"; + import {IMultiOwnerPlugin} from "../../../src/plugins/owner/IMultiOwnerPlugin.sol"; import {BaseTestPlugin} from "./BaseTestPlugin.sol"; diff --git a/test/mocks/plugins/BaseTestPlugin.sol b/test/mocks/plugins/BaseTestPlugin.sol index 07fcb80c..c8116c01 100644 --- a/test/mocks/plugins/BaseTestPlugin.sol +++ b/test/mocks/plugins/BaseTestPlugin.sol @@ -18,6 +18,7 @@ pragma solidity ^0.8.22; import {PluginMetadata} from "modular-account-libs/interfaces/IPlugin.sol"; + import {BasePlugin} from "../../../src/plugins/BasePlugin.sol"; contract BaseTestPlugin is BasePlugin { diff --git a/test/mocks/plugins/ComprehensivePlugin.sol b/test/mocks/plugins/ComprehensivePlugin.sol index 6512510d..05c19588 100644 --- a/test/mocks/plugins/ComprehensivePlugin.sol +++ b/test/mocks/plugins/ComprehensivePlugin.sol @@ -27,6 +27,7 @@ import { PluginMetadata } from "modular-account-libs/interfaces/IPlugin.sol"; import {IStandardExecutor} from "modular-account-libs/interfaces/IStandardExecutor.sol"; + import {BaseTestPlugin} from "./BaseTestPlugin.sol"; contract ComprehensivePlugin is BaseTestPlugin { diff --git a/test/mocks/plugins/ExecFromPluginPermissionsMocks.sol b/test/mocks/plugins/ExecFromPluginPermissionsMocks.sol index f7d48ef9..26d7088a 100644 --- a/test/mocks/plugins/ExecFromPluginPermissionsMocks.sol +++ b/test/mocks/plugins/ExecFromPluginPermissionsMocks.sol @@ -29,6 +29,7 @@ import {IPlugin} from "modular-account-libs/interfaces/IPlugin.sol"; import {IPluginExecutor} from "modular-account-libs/interfaces/IPluginExecutor.sol"; import {FunctionReference} from "modular-account-libs/interfaces/IPluginManager.sol"; import {IStandardExecutor} from "modular-account-libs/interfaces/IStandardExecutor.sol"; + import {Counter} from "../Counter.sol"; import {BaseTestPlugin} from "./BaseTestPlugin.sol"; import {ResultCreatorPlugin} from "./ReturnDataPluginMocks.sol"; diff --git a/test/mocks/plugins/ManifestValidityMocks.sol b/test/mocks/plugins/ManifestValidityMocks.sol index 59105aa7..238d88e6 100644 --- a/test/mocks/plugins/ManifestValidityMocks.sol +++ b/test/mocks/plugins/ManifestValidityMocks.sol @@ -29,6 +29,7 @@ import {IPlugin} from "modular-account-libs/interfaces/IPlugin.sol"; import {IPluginExecutor} from "modular-account-libs/interfaces/IPluginExecutor.sol"; import {FunctionReference} from "modular-account-libs/interfaces/IPluginManager.sol"; import {IStandardExecutor} from "modular-account-libs/interfaces/IStandardExecutor.sol"; + import {BaseTestPlugin} from "./BaseTestPlugin.sol"; contract BadValidationMagicValue_UserOp_Plugin is BaseTestPlugin { diff --git a/test/mocks/plugins/ReturnDataPluginMocks.sol b/test/mocks/plugins/ReturnDataPluginMocks.sol index ecb075cf..254ceb19 100644 --- a/test/mocks/plugins/ReturnDataPluginMocks.sol +++ b/test/mocks/plugins/ReturnDataPluginMocks.sol @@ -28,6 +28,7 @@ import {IPlugin} from "modular-account-libs/interfaces/IPlugin.sol"; import {IPluginExecutor} from "modular-account-libs/interfaces/IPluginExecutor.sol"; import {FunctionReference} from "modular-account-libs/interfaces/IPluginManager.sol"; import {IStandardExecutor} from "modular-account-libs/interfaces/IStandardExecutor.sol"; + import {BaseTestPlugin} from "./BaseTestPlugin.sol"; contract RegularResultContract { diff --git a/test/mocks/plugins/UninstallErrorsPlugin.sol b/test/mocks/plugins/UninstallErrorsPlugin.sol index 9271ec6f..894469ee 100644 --- a/test/mocks/plugins/UninstallErrorsPlugin.sol +++ b/test/mocks/plugins/UninstallErrorsPlugin.sol @@ -17,8 +17,6 @@ pragma solidity ^0.8.22; -import {StorageSlot} from "@openzeppelin/contracts/utils/StorageSlot.sol"; - import { ManifestFunction, ManifestAssociatedFunctionType, @@ -26,6 +24,8 @@ import { PluginManifest, PluginMetadata } from "modular-account-libs/interfaces/IPlugin.sol"; +import {StorageSlot} from "@openzeppelin/contracts/utils/StorageSlot.sol"; + import {BaseTestPlugin} from "./BaseTestPlugin.sol"; /// Mock plugin that reverts in its uninstall callbacks. Can be configured to diff --git a/test/mocks/plugins/ValidationPluginMocks.sol b/test/mocks/plugins/ValidationPluginMocks.sol index 145d1ec1..09369093 100644 --- a/test/mocks/plugins/ValidationPluginMocks.sol +++ b/test/mocks/plugins/ValidationPluginMocks.sol @@ -24,6 +24,7 @@ import { ManifestAssociatedFunction, PluginManifest } from "modular-account-libs/interfaces/IPlugin.sol"; + import {BaseTestPlugin} from "./BaseTestPlugin.sol"; abstract contract MockBaseUserOpValidationPlugin is BaseTestPlugin { diff --git a/test/plugin/owner/MultiOwnerPlugin.t.sol b/test/plugin/owner/MultiOwnerPlugin.t.sol index ad476f53..8a606a3c 100644 --- a/test/plugin/owner/MultiOwnerPlugin.t.sol +++ b/test/plugin/owner/MultiOwnerPlugin.t.sol @@ -18,13 +18,12 @@ pragma solidity ^0.8.22; import {Test} from "forge-std/Test.sol"; - import {EntryPoint} from "@eth-infinitism/account-abstraction/core/EntryPoint.sol"; +import {UserOperation} from "modular-account-libs/interfaces/UserOperation.sol"; +import {PluginManifest} from "modular-account-libs/interfaces/IPlugin.sol"; import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import {IEntryPoint} from "../../../src/interfaces/erc4337/IEntryPoint.sol"; -import {UserOperation} from "modular-account-libs/interfaces/UserOperation.sol"; -import {PluginManifest} from "modular-account-libs/interfaces/IPlugin.sol"; import {BasePlugin} from "../../../src/plugins/BasePlugin.sol"; import {IMultiOwnerPlugin} from "../../../src/plugins/owner/IMultiOwnerPlugin.sol"; import {MultiOwnerPlugin} from "../../../src/plugins/owner/MultiOwnerPlugin.sol"; diff --git a/test/plugin/owner/MultiOwnerPluginIntegration.t.sol b/test/plugin/owner/MultiOwnerPluginIntegration.t.sol index 5b019e54..b04e130b 100644 --- a/test/plugin/owner/MultiOwnerPluginIntegration.t.sol +++ b/test/plugin/owner/MultiOwnerPluginIntegration.t.sol @@ -18,17 +18,16 @@ pragma solidity ^0.8.22; import {Test} from "forge-std/Test.sol"; - import {EntryPoint} from "@eth-infinitism/account-abstraction/core/EntryPoint.sol"; +import {UserOperation} from "modular-account-libs/interfaces/UserOperation.sol"; +import {FunctionReference} from "modular-account-libs/interfaces/IPluginManager.sol"; +import {Call} from "modular-account-libs/interfaces/IStandardExecutor.sol"; import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol"; import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import {UpgradeableModularAccount} from "../../../src/account/UpgradeableModularAccount.sol"; import {MultiOwnerModularAccountFactory} from "../../../src/factory/MultiOwnerModularAccountFactory.sol"; import {IEntryPoint} from "../../../src/interfaces/erc4337/IEntryPoint.sol"; -import {UserOperation} from "modular-account-libs/interfaces/UserOperation.sol"; -import {FunctionReference} from "modular-account-libs/interfaces/IPluginManager.sol"; -import {Call} from "modular-account-libs/interfaces/IStandardExecutor.sol"; import {IMultiOwnerPlugin} from "../../../src/plugins/owner/IMultiOwnerPlugin.sol"; import {MultiOwnerPlugin} from "../../../src/plugins/owner/MultiOwnerPlugin.sol"; import {Counter} from "../../mocks/Counter.sol"; diff --git a/test/plugin/session/SessionKeyPluginWithMultiOwner.t.sol b/test/plugin/session/SessionKeyPluginWithMultiOwner.t.sol index bd0cb7aa..cd1c3426 100644 --- a/test/plugin/session/SessionKeyPluginWithMultiOwner.t.sol +++ b/test/plugin/session/SessionKeyPluginWithMultiOwner.t.sol @@ -18,19 +18,18 @@ pragma solidity ^0.8.22; import {Test} from "forge-std/Test.sol"; - import {EntryPoint} from "@eth-infinitism/account-abstraction/core/EntryPoint.sol"; +import {FunctionReferenceLib} from "modular-account-libs/libraries/FunctionReferenceLib.sol"; +import {UserOperation} from "modular-account-libs/interfaces/UserOperation.sol"; +import {FunctionReference} from "modular-account-libs/interfaces/IPluginManager.sol"; +import {Call} from "modular-account-libs/interfaces/IStandardExecutor.sol"; import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import {ISessionKeyPermissionsUpdates} from "../../../src/plugins/session/permissions/ISessionKeyPermissionsUpdates.sol"; import {UpgradeableModularAccount} from "../../../src/account/UpgradeableModularAccount.sol"; import {MultiOwnerModularAccountFactory} from "../../../src/factory/MultiOwnerModularAccountFactory.sol"; -import {FunctionReferenceLib} from "modular-account-libs/libraries/FunctionReferenceLib.sol"; import {IEntryPoint} from "../../../src/interfaces/erc4337/IEntryPoint.sol"; -import {UserOperation} from "modular-account-libs/interfaces/UserOperation.sol"; -import {FunctionReference} from "modular-account-libs/interfaces/IPluginManager.sol"; -import {Call} from "modular-account-libs/interfaces/IStandardExecutor.sol"; import {BasePlugin} from "../../../src/plugins/BasePlugin.sol"; import {IMultiOwnerPlugin} from "../../../src/plugins/owner/IMultiOwnerPlugin.sol"; import {MultiOwnerPlugin} from "../../../src/plugins/owner/MultiOwnerPlugin.sol"; diff --git a/test/plugin/session/permissions/SessionKeyERC20SpendLimits.t.sol b/test/plugin/session/permissions/SessionKeyERC20SpendLimits.t.sol index 0865df74..7082d516 100644 --- a/test/plugin/session/permissions/SessionKeyERC20SpendLimits.t.sol +++ b/test/plugin/session/permissions/SessionKeyERC20SpendLimits.t.sol @@ -18,19 +18,18 @@ pragma solidity ^0.8.22; import {Test, console} from "forge-std/Test.sol"; - import {EntryPoint} from "@eth-infinitism/account-abstraction/core/EntryPoint.sol"; +import {FunctionReferenceLib} from "modular-account-libs/libraries/FunctionReferenceLib.sol"; +import {UserOperation} from "modular-account-libs/interfaces/UserOperation.sol"; +import {FunctionReference} from "modular-account-libs/interfaces/IPluginManager.sol"; +import {Call} from "modular-account-libs/interfaces/IStandardExecutor.sol"; import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import {ISessionKeyPermissionsUpdates} from "../../../../src/plugins/session/permissions/ISessionKeyPermissionsUpdates.sol"; import {UpgradeableModularAccount} from "../../../../src/account/UpgradeableModularAccount.sol"; import {MultiOwnerModularAccountFactory} from "../../../../src/factory/MultiOwnerModularAccountFactory.sol"; -import {FunctionReferenceLib} from "modular-account-libs/libraries/FunctionReferenceLib.sol"; import {IEntryPoint} from "../../../../src/interfaces/erc4337/IEntryPoint.sol"; -import {UserOperation} from "modular-account-libs/interfaces/UserOperation.sol"; -import {FunctionReference} from "modular-account-libs/interfaces/IPluginManager.sol"; -import {Call} from "modular-account-libs/interfaces/IStandardExecutor.sol"; import {IMultiOwnerPlugin} from "../../../../src/plugins/owner/IMultiOwnerPlugin.sol"; import {MultiOwnerPlugin} from "../../../../src/plugins/owner/MultiOwnerPlugin.sol"; import {ISessionKeyPlugin} from "../../../../src/plugins/session/ISessionKeyPlugin.sol"; diff --git a/test/plugin/session/permissions/SessionKeyGasLimits.t.sol b/test/plugin/session/permissions/SessionKeyGasLimits.t.sol index 96549ff9..7d1d686e 100644 --- a/test/plugin/session/permissions/SessionKeyGasLimits.t.sol +++ b/test/plugin/session/permissions/SessionKeyGasLimits.t.sol @@ -18,19 +18,18 @@ pragma solidity ^0.8.22; import {Test, console} from "forge-std/Test.sol"; - import {EntryPoint} from "@eth-infinitism/account-abstraction/core/EntryPoint.sol"; +import {FunctionReferenceLib} from "modular-account-libs/libraries/FunctionReferenceLib.sol"; +import {UserOperation} from "modular-account-libs/interfaces/UserOperation.sol"; +import {FunctionReference} from "modular-account-libs/interfaces/IPluginManager.sol"; +import {Call} from "modular-account-libs/interfaces/IStandardExecutor.sol"; import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import {ISessionKeyPermissionsUpdates} from "../../../../src/plugins/session/permissions/ISessionKeyPermissionsUpdates.sol"; import {UpgradeableModularAccount} from "../../../../src/account/UpgradeableModularAccount.sol"; import {MultiOwnerModularAccountFactory} from "../../../../src/factory/MultiOwnerModularAccountFactory.sol"; -import {FunctionReferenceLib} from "modular-account-libs/libraries/FunctionReferenceLib.sol"; import {IEntryPoint} from "../../../../src/interfaces/erc4337/IEntryPoint.sol"; -import {UserOperation} from "modular-account-libs/interfaces/UserOperation.sol"; -import {FunctionReference} from "modular-account-libs/interfaces/IPluginManager.sol"; -import {Call} from "modular-account-libs/interfaces/IStandardExecutor.sol"; import {IMultiOwnerPlugin} from "../../../../src/plugins/owner/IMultiOwnerPlugin.sol"; import {MultiOwnerPlugin} from "../../../../src/plugins/owner/MultiOwnerPlugin.sol"; import {ISessionKeyPlugin} from "../../../../src/plugins/session/ISessionKeyPlugin.sol"; diff --git a/test/plugin/session/permissions/SessionKeyNativeTokenSpendLimits.t.sol b/test/plugin/session/permissions/SessionKeyNativeTokenSpendLimits.t.sol index c1b762fd..46486638 100644 --- a/test/plugin/session/permissions/SessionKeyNativeTokenSpendLimits.t.sol +++ b/test/plugin/session/permissions/SessionKeyNativeTokenSpendLimits.t.sol @@ -18,19 +18,18 @@ pragma solidity ^0.8.22; import {Test, console} from "forge-std/Test.sol"; - import {EntryPoint} from "@eth-infinitism/account-abstraction/core/EntryPoint.sol"; +import {FunctionReferenceLib} from "modular-account-libs/libraries/FunctionReferenceLib.sol"; +import {UserOperation} from "modular-account-libs/interfaces/UserOperation.sol"; +import {FunctionReference} from "modular-account-libs/interfaces/IPluginManager.sol"; +import {Call} from "modular-account-libs/interfaces/IStandardExecutor.sol"; import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import {ISessionKeyPermissionsUpdates} from "../../../../src/plugins/session/permissions/ISessionKeyPermissionsUpdates.sol"; import {UpgradeableModularAccount} from "../../../../src/account/UpgradeableModularAccount.sol"; import {MultiOwnerModularAccountFactory} from "../../../../src/factory/MultiOwnerModularAccountFactory.sol"; -import {FunctionReferenceLib} from "modular-account-libs/libraries/FunctionReferenceLib.sol"; import {IEntryPoint} from "../../../../src/interfaces/erc4337/IEntryPoint.sol"; -import {UserOperation} from "modular-account-libs/interfaces/UserOperation.sol"; -import {FunctionReference} from "modular-account-libs/interfaces/IPluginManager.sol"; -import {Call} from "modular-account-libs/interfaces/IStandardExecutor.sol"; import {IMultiOwnerPlugin} from "../../../../src/plugins/owner/IMultiOwnerPlugin.sol"; import {MultiOwnerPlugin} from "../../../../src/plugins/owner/MultiOwnerPlugin.sol"; import {ISessionKeyPlugin} from "../../../../src/plugins/session/ISessionKeyPlugin.sol"; diff --git a/test/plugin/session/permissions/SessionKeyPermissions.t.sol b/test/plugin/session/permissions/SessionKeyPermissions.t.sol index 4033988b..56e26dbb 100644 --- a/test/plugin/session/permissions/SessionKeyPermissions.t.sol +++ b/test/plugin/session/permissions/SessionKeyPermissions.t.sol @@ -18,19 +18,18 @@ pragma solidity ^0.8.22; import {Test} from "forge-std/Test.sol"; - import {EntryPoint} from "@eth-infinitism/account-abstraction/core/EntryPoint.sol"; +import {UserOperation} from "modular-account-libs/interfaces/UserOperation.sol"; +import {FunctionReference} from "modular-account-libs/interfaces/IPluginManager.sol"; +import {Call} from "modular-account-libs/interfaces/IStandardExecutor.sol"; +import {FunctionReferenceLib} from "modular-account-libs/libraries/FunctionReferenceLib.sol"; import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import {ISessionKeyPermissionsUpdates} from "../../../../src/plugins/session/permissions/ISessionKeyPermissionsUpdates.sol"; import {UpgradeableModularAccount} from "../../../../src/account/UpgradeableModularAccount.sol"; import {MultiOwnerModularAccountFactory} from "../../../../src/factory/MultiOwnerModularAccountFactory.sol"; -import {FunctionReferenceLib} from "modular-account-libs/libraries/FunctionReferenceLib.sol"; import {IEntryPoint} from "../../../../src/interfaces/erc4337/IEntryPoint.sol"; -import {UserOperation} from "modular-account-libs/interfaces/UserOperation.sol"; -import {FunctionReference} from "modular-account-libs/interfaces/IPluginManager.sol"; -import {Call} from "modular-account-libs/interfaces/IStandardExecutor.sol"; import {IMultiOwnerPlugin} from "../../../../src/plugins/owner/IMultiOwnerPlugin.sol"; import {MultiOwnerPlugin} from "../../../../src/plugins/owner/MultiOwnerPlugin.sol"; import {ISessionKeyPlugin} from "../../../../src/plugins/session/ISessionKeyPlugin.sol"; diff --git a/test/upgrade/LightAccountToModularAccount.t.sol b/test/upgrade/LightAccountToModularAccount.t.sol index 8298006d..3b5ddcb9 100644 --- a/test/upgrade/LightAccountToModularAccount.t.sol +++ b/test/upgrade/LightAccountToModularAccount.t.sol @@ -18,7 +18,6 @@ pragma solidity ^0.8.22; import {Test} from "forge-std/Test.sol"; - import {LightAccount} from "@alchemy/light-account/src/LightAccount.sol"; import {LightAccountFactory} from "@alchemy/light-account/src/LightAccountFactory.sol"; import {EntryPoint} from "@eth-infinitism/account-abstraction/core/EntryPoint.sol"; diff --git a/test/upgrade/MAToMA.t.sol b/test/upgrade/MAToMA.t.sol index b4c7c078..2d8ced61 100644 --- a/test/upgrade/MAToMA.t.sol +++ b/test/upgrade/MAToMA.t.sol @@ -18,13 +18,12 @@ pragma solidity ^0.8.22; import {Test} from "forge-std/Test.sol"; - import {EntryPoint} from "@eth-infinitism/account-abstraction/core/EntryPoint.sol"; +import {Call} from "modular-account-libs/interfaces/IStandardExecutor.sol"; import {UpgradeableModularAccount} from "../../src/account/UpgradeableModularAccount.sol"; import {MultiOwnerModularAccountFactory} from "../../src/factory/MultiOwnerModularAccountFactory.sol"; import {IEntryPoint} from "../../src/interfaces/erc4337/IEntryPoint.sol"; -import {Call} from "modular-account-libs/interfaces/IStandardExecutor.sol"; import {MultiOwnerPlugin} from "../../src/plugins/owner/MultiOwnerPlugin.sol"; import {MockERC20} from "../mocks/tokens/MockERC20.sol"; import {Utils} from "../Utils.sol";