diff --git a/src/account/AccountLoupe.sol b/src/account/AccountLoupe.sol index 37a3227e..6a841a88 100644 --- a/src/account/AccountLoupe.sol +++ b/src/account/AccountLoupe.sol @@ -12,10 +12,10 @@ import { HookGroup, toFunctionReferenceArray } from "./AccountStorage.sol"; +import {FunctionReference} from "../helpers/FunctionReferenceLib.sol"; import {IAccountLoupe} from "../interfaces/IAccountLoupe.sol"; import {IPluginManager} from "../interfaces/IPluginManager.sol"; import {IStandardExecutor} from "../interfaces/IStandardExecutor.sol"; -import {FunctionReference} from "../libraries/FunctionReferenceLib.sol"; abstract contract AccountLoupe is IAccountLoupe { using EnumerableMap for EnumerableMap.Bytes32ToUintMap; diff --git a/src/account/AccountStorage.sol b/src/account/AccountStorage.sol index 36d2845d..5988cfd6 100644 --- a/src/account/AccountStorage.sol +++ b/src/account/AccountStorage.sol @@ -1,10 +1,11 @@ // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.19; -import {IPlugin} from "../interfaces/IPlugin.sol"; import {EnumerableMap} from "@openzeppelin/contracts/utils/structs/EnumerableMap.sol"; import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; -import {FunctionReference} from "../libraries/FunctionReferenceLib.sol"; + +import {FunctionReference} from "../helpers/FunctionReferenceLib.sol"; +import {IPlugin} from "../interfaces/IPlugin.sol"; // bytes = keccak256("ERC6900.UpgradeableModularAccount.Storage") bytes32 constant _ACCOUNT_STORAGE_SLOT = 0x9f09680beaa4e5c9f38841db2460c401499164f368baef687948c315d9073e40; diff --git a/src/account/PluginManagerInternals.sol b/src/account/PluginManagerInternals.sol index 44a8c0ff..b4bada9e 100644 --- a/src/account/PluginManagerInternals.sol +++ b/src/account/PluginManagerInternals.sol @@ -15,7 +15,7 @@ import { PermittedExternalCallData, StoredInjectedHook } from "./AccountStorage.sol"; -import {FunctionReference, FunctionReferenceLib} from "../libraries/FunctionReferenceLib.sol"; +import {FunctionReference, FunctionReferenceLib} from "../helpers/FunctionReferenceLib.sol"; import {IPluginManager} from "../interfaces/IPluginManager.sol"; import { IPlugin, diff --git a/src/account/UpgradeableModularAccount.sol b/src/account/UpgradeableModularAccount.sol index 5464e2bb..11b820ab 100644 --- a/src/account/UpgradeableModularAccount.sol +++ b/src/account/UpgradeableModularAccount.sol @@ -13,7 +13,7 @@ import {AccountExecutor} from "./AccountExecutor.sol"; import {AccountLoupe} from "./AccountLoupe.sol"; import {AccountStorage, HookGroup, getAccountStorage, getPermittedCallKey} from "./AccountStorage.sol"; import {AccountStorageInitializable} from "./AccountStorageInitializable.sol"; -import {FunctionReference, FunctionReferenceLib} from "../libraries/FunctionReferenceLib.sol"; +import {FunctionReference, FunctionReferenceLib} from "../helpers/FunctionReferenceLib.sol"; import {IPlugin, PluginManifest} from "../interfaces/IPlugin.sol"; import {IPluginExecutor} from "../interfaces/IPluginExecutor.sol"; import {IPluginManager} from "../interfaces/IPluginManager.sol"; diff --git a/src/libraries/FunctionReferenceLib.sol b/src/helpers/FunctionReferenceLib.sol similarity index 100% rename from src/libraries/FunctionReferenceLib.sol rename to src/helpers/FunctionReferenceLib.sol diff --git a/src/interfaces/IAccountLoupe.sol b/src/interfaces/IAccountLoupe.sol index cdf1525f..79ca52e9 100644 --- a/src/interfaces/IAccountLoupe.sol +++ b/src/interfaces/IAccountLoupe.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.19; -import {FunctionReference} from "../libraries/FunctionReferenceLib.sol"; +import {FunctionReference} from "../helpers/FunctionReferenceLib.sol"; interface IAccountLoupe { /// @notice Config for an execution function, given a selector diff --git a/src/interfaces/IPluginManager.sol b/src/interfaces/IPluginManager.sol index 7b7dd85f..2b6fb40b 100644 --- a/src/interfaces/IPluginManager.sol +++ b/src/interfaces/IPluginManager.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.19; -import {FunctionReference} from "../libraries/FunctionReferenceLib.sol"; +import {FunctionReference} from "../helpers/FunctionReferenceLib.sol"; /// @title Plugin Manager Interface interface IPluginManager { diff --git a/test/account/AccountExecHooks.t.sol b/test/account/AccountExecHooks.t.sol index cd10df41..d63e5c2e 100644 --- a/test/account/AccountExecHooks.t.sol +++ b/test/account/AccountExecHooks.t.sol @@ -4,6 +4,8 @@ pragma solidity ^0.8.19; import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import {EntryPoint} from "@eth-infinitism/account-abstraction/core/EntryPoint.sol"; +import {UpgradeableModularAccount} from "../../src/account/UpgradeableModularAccount.sol"; +import {FunctionReference, FunctionReferenceLib} from "../../src/helpers/FunctionReferenceLib.sol"; import {IPluginManager} from "../../src/interfaces/IPluginManager.sol"; import { IPlugin, @@ -13,9 +15,7 @@ import { ManifestFunction, PluginManifest } from "../../src/interfaces/IPlugin.sol"; -import {UpgradeableModularAccount} from "../../src/account/UpgradeableModularAccount.sol"; import {SingleOwnerPlugin} from "../../src/plugins/owner/SingleOwnerPlugin.sol"; -import {FunctionReference, FunctionReferenceLib} from "../../src/libraries/FunctionReferenceLib.sol"; import {MockPlugin} from "../mocks/MockPlugin.sol"; import {MSCAFactoryFixture} from "../mocks/MSCAFactoryFixture.sol"; diff --git a/test/account/AccountLoupe.t.sol b/test/account/AccountLoupe.t.sol index 0f016895..e7981c1f 100644 --- a/test/account/AccountLoupe.t.sol +++ b/test/account/AccountLoupe.t.sol @@ -5,8 +5,7 @@ import {UUPSUpgradeable} from "@openzeppelin/contracts/proxy/utils/UUPSUpgradeab import {EntryPoint} from "@eth-infinitism/account-abstraction/core/EntryPoint.sol"; import {UpgradeableModularAccount} from "../../src/account/UpgradeableModularAccount.sol"; -import {ISingleOwnerPlugin} from "../../src/plugins/owner/ISingleOwnerPlugin.sol"; -import {SingleOwnerPlugin} from "../../src/plugins/owner/SingleOwnerPlugin.sol"; +import {FunctionReference, FunctionReferenceLib} from "../../src/helpers/FunctionReferenceLib.sol"; import { ManifestAssociatedFunctionType, ManifestExecutionHook, @@ -16,7 +15,8 @@ import { import {IAccountLoupe} from "../../src/interfaces/IAccountLoupe.sol"; import {IPluginManager} from "../../src/interfaces/IPluginManager.sol"; import {IStandardExecutor} from "../../src/interfaces/IStandardExecutor.sol"; -import {FunctionReference, FunctionReferenceLib} from "../../src/libraries/FunctionReferenceLib.sol"; +import {ISingleOwnerPlugin} from "../../src/plugins/owner/ISingleOwnerPlugin.sol"; +import {SingleOwnerPlugin} from "../../src/plugins/owner/SingleOwnerPlugin.sol"; import {MSCAFactoryFixture} from "../mocks/MSCAFactoryFixture.sol"; import {ComprehensivePlugin} from "../mocks/plugins/ComprehensivePlugin.sol"; diff --git a/test/account/AccountPermittedCallHooks.t.sol b/test/account/AccountPermittedCallHooks.t.sol index a90eaae0..3dd38363 100644 --- a/test/account/AccountPermittedCallHooks.t.sol +++ b/test/account/AccountPermittedCallHooks.t.sol @@ -4,6 +4,8 @@ pragma solidity ^0.8.19; import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import {EntryPoint} from "@eth-infinitism/account-abstraction/core/EntryPoint.sol"; +import {UpgradeableModularAccount} from "../../src/account/UpgradeableModularAccount.sol"; +import {FunctionReference} from "../../src/helpers/FunctionReferenceLib.sol"; import {IPluginManager} from "../../src/interfaces/IPluginManager.sol"; import { IPlugin, @@ -13,9 +15,7 @@ import { ManifestFunction, PluginManifest } from "../../src/interfaces/IPlugin.sol"; -import {UpgradeableModularAccount} from "../../src/account/UpgradeableModularAccount.sol"; import {SingleOwnerPlugin} from "../../src/plugins/owner/SingleOwnerPlugin.sol"; -import {FunctionReference} from "../../src/libraries/FunctionReferenceLib.sol"; import {MockPlugin} from "../mocks/MockPlugin.sol"; import {MSCAFactoryFixture} from "../mocks/MSCAFactoryFixture.sol"; diff --git a/test/account/AccountReturnData.t.sol b/test/account/AccountReturnData.t.sol index d2772a95..1ca8996b 100644 --- a/test/account/AccountReturnData.t.sol +++ b/test/account/AccountReturnData.t.sol @@ -3,11 +3,11 @@ pragma solidity ^0.8.19; import {EntryPoint} from "@eth-infinitism/account-abstraction/core/EntryPoint.sol"; -import {IPluginManager} from "../../src/interfaces/IPluginManager.sol"; import {UpgradeableModularAccount} from "../../src/account/UpgradeableModularAccount.sol"; -import {SingleOwnerPlugin} from "../../src/plugins/owner/SingleOwnerPlugin.sol"; -import {FunctionReference} from "../../src/libraries/FunctionReferenceLib.sol"; +import {FunctionReference} from "../../src/helpers/FunctionReferenceLib.sol"; +import {IPluginManager} from "../../src/interfaces/IPluginManager.sol"; import {Call} from "../../src/interfaces/IStandardExecutor.sol"; +import {SingleOwnerPlugin} from "../../src/plugins/owner/SingleOwnerPlugin.sol"; import { RegularResultContract, diff --git a/test/account/ExecuteFromPluginPermissions.t.sol b/test/account/ExecuteFromPluginPermissions.t.sol index 48b65d98..efb4a7b2 100644 --- a/test/account/ExecuteFromPluginPermissions.t.sol +++ b/test/account/ExecuteFromPluginPermissions.t.sol @@ -5,10 +5,10 @@ import {console} from "forge-std/Test.sol"; import {EntryPoint} from "@eth-infinitism/account-abstraction/core/EntryPoint.sol"; -import {IPluginManager} from "../../src/interfaces/IPluginManager.sol"; import {UpgradeableModularAccount} from "../../src/account/UpgradeableModularAccount.sol"; +import {FunctionReference} from "../../src/helpers/FunctionReferenceLib.sol"; +import {IPluginManager} from "../../src/interfaces/IPluginManager.sol"; import {SingleOwnerPlugin} from "../../src/plugins/owner/SingleOwnerPlugin.sol"; -import {FunctionReference} from "../../src/libraries/FunctionReferenceLib.sol"; import {MSCAFactoryFixture} from "../mocks/MSCAFactoryFixture.sol"; import {Counter} from "../mocks/Counter.sol"; diff --git a/test/account/ManifestValidity.t.sol b/test/account/ManifestValidity.t.sol index 18972d07..d85f03aa 100644 --- a/test/account/ManifestValidity.t.sol +++ b/test/account/ManifestValidity.t.sol @@ -3,11 +3,11 @@ pragma solidity ^0.8.19; import {EntryPoint} from "@eth-infinitism/account-abstraction/core/EntryPoint.sol"; -import {IPluginManager} from "../../src/interfaces/IPluginManager.sol"; -import {UpgradeableModularAccount} from "../../src/account/UpgradeableModularAccount.sol"; import {PluginManagerInternals} from "../../src/account/PluginManagerInternals.sol"; +import {UpgradeableModularAccount} from "../../src/account/UpgradeableModularAccount.sol"; +import {FunctionReference} from "../../src/helpers/FunctionReferenceLib.sol"; +import {IPluginManager} from "../../src/interfaces/IPluginManager.sol"; import {SingleOwnerPlugin} from "../../src/plugins/owner/SingleOwnerPlugin.sol"; -import {FunctionReference} from "../../src/libraries/FunctionReferenceLib.sol"; import {MSCAFactoryFixture} from "../mocks/MSCAFactoryFixture.sol"; import { diff --git a/test/account/UpgradeableModularAccount.t.sol b/test/account/UpgradeableModularAccount.t.sol index 528eedd2..49b7f078 100644 --- a/test/account/UpgradeableModularAccount.t.sol +++ b/test/account/UpgradeableModularAccount.t.sol @@ -9,15 +9,14 @@ import {UserOperation} from "@eth-infinitism/account-abstraction/interfaces/User import {PluginManagerInternals} from "../../src/account/PluginManagerInternals.sol"; import {UpgradeableModularAccount} from "../../src/account/UpgradeableModularAccount.sol"; -import {SingleOwnerPlugin} from "../../src/plugins/owner/SingleOwnerPlugin.sol"; -import {TokenReceiverPlugin} from "../../src/plugins/TokenReceiverPlugin.sol"; -import {PluginManifest} from "../../src/interfaces/IPlugin.sol"; +import {FunctionReference} from "../../src/helpers/FunctionReferenceLib.sol"; +import {IPlugin, PluginManifest} from "../../src/interfaces/IPlugin.sol"; import {IAccountLoupe} from "../../src/interfaces/IAccountLoupe.sol"; import {IPluginManager} from "../../src/interfaces/IPluginManager.sol"; import {IPluginExecutor} from "../../src/interfaces/IPluginExecutor.sol"; import {Call} from "../../src/interfaces/IStandardExecutor.sol"; -import {FunctionReference} from "../../src/libraries/FunctionReferenceLib.sol"; -import {IPlugin, PluginManifest} from "../../src/interfaces/IPlugin.sol"; +import {SingleOwnerPlugin} from "../../src/plugins/owner/SingleOwnerPlugin.sol"; +import {TokenReceiverPlugin} from "../../src/plugins/TokenReceiverPlugin.sol"; import {Counter} from "../mocks/Counter.sol"; import {MSCAFactoryFixture} from "../mocks/MSCAFactoryFixture.sol"; diff --git a/test/account/ValidationIntersection.t.sol b/test/account/ValidationIntersection.t.sol index b33f5187..d098b40b 100644 --- a/test/account/ValidationIntersection.t.sol +++ b/test/account/ValidationIntersection.t.sol @@ -4,10 +4,10 @@ pragma solidity ^0.8.19; import {EntryPoint} from "@eth-infinitism/account-abstraction/core/EntryPoint.sol"; import {UserOperation} from "@eth-infinitism/account-abstraction/interfaces/UserOperation.sol"; -import {IPluginManager} from "../../src/interfaces/IPluginManager.sol"; import {UpgradeableModularAccount} from "../../src/account/UpgradeableModularAccount.sol"; +import {FunctionReference} from "../../src/helpers/FunctionReferenceLib.sol"; +import {IPluginManager} from "../../src/interfaces/IPluginManager.sol"; import {SingleOwnerPlugin} from "../../src/plugins/owner/SingleOwnerPlugin.sol"; -import {FunctionReference} from "../../src/libraries/FunctionReferenceLib.sol"; import {MSCAFactoryFixture} from "../mocks/MSCAFactoryFixture.sol"; import { diff --git a/test/libraries/FunctionReferenceLib.t.sol b/test/libraries/FunctionReferenceLib.t.sol index 0fc899d0..6870a3ba 100644 --- a/test/libraries/FunctionReferenceLib.t.sol +++ b/test/libraries/FunctionReferenceLib.t.sol @@ -2,7 +2,8 @@ pragma solidity ^0.8.19; import {Test} from "forge-std/Test.sol"; -import {FunctionReference, FunctionReferenceLib} from "../../src/libraries/FunctionReferenceLib.sol"; + +import {FunctionReference, FunctionReferenceLib} from "../../src/helpers/FunctionReferenceLib.sol"; contract FunctionReferenceLibTest is Test { function testFuzz_functionReference_packing(address addr, uint8 functionId) public { diff --git a/test/mocks/plugins/ExecFromPluginPermissionsMocks.sol b/test/mocks/plugins/ExecFromPluginPermissionsMocks.sol index 8861012f..ece287cf 100644 --- a/test/mocks/plugins/ExecFromPluginPermissionsMocks.sol +++ b/test/mocks/plugins/ExecFromPluginPermissionsMocks.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.19; +import {FunctionReference} from "../../../src/helpers/FunctionReferenceLib.sol"; import { ManifestFunction, ManifestAssociatedFunctionType, @@ -12,9 +13,8 @@ import { import {IStandardExecutor} from "../../../src/interfaces/IStandardExecutor.sol"; import {IPluginExecutor} from "../../../src/interfaces/IPluginExecutor.sol"; import {IPlugin} from "../../../src/interfaces/IPlugin.sol"; -import {BaseTestPlugin} from "./BaseTestPlugin.sol"; -import {FunctionReference} from "../../../src/libraries/FunctionReferenceLib.sol"; +import {BaseTestPlugin} from "./BaseTestPlugin.sol"; import {ResultCreatorPlugin} from "./ReturnDataPluginMocks.sol"; import {Counter} from "../Counter.sol"; diff --git a/test/mocks/plugins/ManifestValidityMocks.sol b/test/mocks/plugins/ManifestValidityMocks.sol index 6ec719f4..27243f79 100644 --- a/test/mocks/plugins/ManifestValidityMocks.sol +++ b/test/mocks/plugins/ManifestValidityMocks.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.19; +import {FunctionReference} from "../../../src/helpers/FunctionReferenceLib.sol"; import { ManifestFunction, ManifestAssociatedFunctionType, @@ -12,8 +13,8 @@ import { import {IStandardExecutor} from "../../../src/interfaces/IStandardExecutor.sol"; import {IPluginExecutor} from "../../../src/interfaces/IPluginExecutor.sol"; import {IPlugin} from "../../../src/interfaces/IPlugin.sol"; + import {BaseTestPlugin} from "./BaseTestPlugin.sol"; -import {FunctionReference} from "../../../src/libraries/FunctionReferenceLib.sol"; contract BadValidationMagicValue_UserOp_Plugin is BaseTestPlugin { function onInstall(bytes calldata) external override {} diff --git a/test/mocks/plugins/ReturnDataPluginMocks.sol b/test/mocks/plugins/ReturnDataPluginMocks.sol index e226a329..34ce8e28 100644 --- a/test/mocks/plugins/ReturnDataPluginMocks.sol +++ b/test/mocks/plugins/ReturnDataPluginMocks.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.19; +import {FunctionReference} from "../../../src/helpers/FunctionReferenceLib.sol"; import { ManifestFunction, ManifestAssociatedFunctionType, @@ -11,8 +12,8 @@ import { import {IStandardExecutor} from "../../../src/interfaces/IStandardExecutor.sol"; import {IPluginExecutor} from "../../../src/interfaces/IPluginExecutor.sol"; import {IPlugin} from "../../../src/interfaces/IPlugin.sol"; + import {BaseTestPlugin} from "./BaseTestPlugin.sol"; -import {FunctionReference} from "../../../src/libraries/FunctionReferenceLib.sol"; contract RegularResultContract { function foo() external pure returns (bytes32) { diff --git a/test/plugin/TokenReceiverPlugin.t.sol b/test/plugin/TokenReceiverPlugin.t.sol index 009b42e9..c3a7a03a 100644 --- a/test/plugin/TokenReceiverPlugin.t.sol +++ b/test/plugin/TokenReceiverPlugin.t.sol @@ -8,10 +8,10 @@ import {ERC721PresetMinterPauserAutoId} from import {IERC777Recipient} from "@openzeppelin/contracts/token/ERC777/IERC777Recipient.sol"; import {IERC1155Receiver} from "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol"; -import {TokenReceiverPlugin} from "../../src/plugins/TokenReceiverPlugin.sol"; import {UpgradeableModularAccount} from "../../src/account/UpgradeableModularAccount.sol"; -import {FunctionReference} from "../../src/libraries/FunctionReferenceLib.sol"; +import {FunctionReference} from "../../src/helpers/FunctionReferenceLib.sol"; import {IPluginManager} from "../../src/interfaces/IPluginManager.sol"; +import {TokenReceiverPlugin} from "../../src/plugins/TokenReceiverPlugin.sol"; import {MSCAFactoryFixture} from "../mocks/MSCAFactoryFixture.sol"; import {MockERC777} from "../mocks/MockERC777.sol";