From 77ee7433f467df526aad6ab284fb381b92abe052 Mon Sep 17 00:00:00 2001 From: HuaweiGu Date: Fri, 13 Sep 2024 15:51:04 -0400 Subject: [PATCH] chore: organize imports --- foundry.toml | 1 + script/001_DeployPluginManager.s.sol | 2 +- script/002_DeployUpgradableMSCAFactory.s.sol | 2 +- script/003_DeploySingleOwnerMSCAFactory.s.sol | 2 +- script/004_DeploySingleOwnerPlugin.s.sol | 2 +- script/005_DeployECDSAAccountFactory.s.sol | 2 +- script/006_DeployAddressBookPlugin.s.sol | 2 +- ...7_DeployColdStorageAddressBookPlugin.s.sol | 4 +- ...DeployWeightedWebauthnMultisigPlugin.s.sol | 4 +- .../009_SetUpgradableMSCAFactoryPlugins.s.sol | 2 +- script/010_StakeUpgradableMSCAFactory.s.sol | 2 +- script/011_DeployTokenCallbackPlugin.s.sol | 2 +- src/account/CoreAccount.sol | 10 +-- src/account/v1/ECDSAAccount.sol | 12 +-- .../v1/factory/ECDSAAccountFactory.sol | 2 +- src/callback/DefaultCallbackHandler.sol | 6 +- src/libs/RecipientAddressLib.sol | 2 +- src/libs/WebAuthnLib.sol | 2 +- src/msca/6900/shared/libs/AddressDLLLib.sol | 2 +- src/msca/6900/shared/libs/Bytes32DLLLib.sol | 4 +- src/msca/6900/shared/libs/Bytes4DLLLib.sol | 4 +- src/msca/6900/v0.7/account/BaseMSCA.sol | 64 ++++++++-------- src/msca/6900/v0.7/account/UpgradableMSCA.sol | 15 ++-- .../v0.7/account/semi/SingleOwnerMSCA.sol | 63 ++++++++-------- .../v0.7/factories/UpgradableMSCAFactory.sol | 12 +-- .../factories/semi/SingleOwnerMSCAFactory.sol | 8 +- src/msca/6900/v0.7/interfaces/IPlugin.sol | 4 +- src/msca/6900/v0.7/libs/ExecutionHookLib.sol | 14 ++-- .../v0.7/libs/FunctionReferenceDLLLib.sol | 6 +- .../RepeatableFunctionReferenceDLLLib.sol | 6 +- .../6900/v0.7/libs/SelectorRegistryLib.sol | 16 ++-- .../6900/v0.7/libs/WalletStorageV1Lib.sol | 2 +- .../6900/v0.7/managers/PluginExecutor.sol | 12 +-- src/msca/6900/v0.7/managers/PluginManager.sol | 26 +++---- .../6900/v0.7/managers/StandardExecutor.sol | 4 +- src/msca/6900/v0.7/plugins/BasePlugin.sol | 10 +-- .../plugins/v1_0_0/acl/SingleOwnerPlugin.sol | 34 +++++---- .../v1_0_0/addressbook/AddressBookPlugin.sol | 29 ++++---- .../ColdStorageAddressBookPlugin.sol | 35 ++++----- .../v1_0_0/multisig/BaseMultisigPlugin.sol | 20 ++--- .../multisig/BaseWeightedMultisigPlugin.sol | 20 ++--- .../multisig/IWeightedMultisigPlugin.sol | 2 +- .../WeightedWebauthnMultisigPlugin.sol | 41 +++++----- .../utility/DefaultTokenCallbackPlugin.sol | 18 ++--- src/msca/6900/v0.8/account/BaseMSCA.sol | 74 ++++++++++--------- src/msca/6900/v0.8/account/UpgradableMSCA.sol | 18 +++-- .../v0.8/factories/UpgradableMSCAFactory.sol | 12 +-- src/msca/6900/v0.8/interfaces/IPlugin.sol | 2 +- .../6900/v0.8/interfaces/IPluginManager.sol | 2 +- src/msca/6900/v0.8/interfaces/IValidation.sol | 2 +- .../6900/v0.8/interfaces/IValidationHook.sol | 2 +- src/msca/6900/v0.8/libs/ExecutionHookLib.sol | 11 +-- .../6900/v0.8/libs/SelectorRegistryLib.sol | 23 +++--- src/msca/6900/v0.8/libs/WalletStorageLib.sol | 2 +- .../libs/thirdparty/ValidationConfigLib.sol | 2 +- src/msca/6900/v0.8/managers/PluginManager.sol | 31 ++++---- src/msca/6900/v0.8/plugins/BasePlugin.sol | 2 +- .../erc712/BaseERC712CompliantModule.sol | 2 +- .../ColdStorageAddressBookPlugin.sol | 37 +++++----- .../v1_0_0/multisig/BaseMultisigPlugin.sol | 19 ++--- .../multisig/BaseWeightedMultisigPlugin.sol | 21 +++--- .../multisig/IWeightedMultisigPlugin.sol | 2 +- .../WeightedWebauthnMultisigPlugin.sol | 26 ++++--- .../SingleSignerValidationModule.sol | 27 +++---- src/paymaster/BasePaymaster.sol | 11 +-- .../v1/permissioned/SponsorPaymaster.sol | 13 ++-- src/utils/PaymasterUtils.sol | 2 +- test/ECDSAAccountAndFactory.t.sol | 16 ++-- test/SponsorPaymaster.t.sol | 6 +- test/WalletMigration.t.sol | 17 +++-- ...SingleOwnerMSCAWithAddressBookPlugin.t.sol | 5 +- ...SingleOwnerMSCAWithSingleOwnerPlugin.t.sol | 5 +- .../UpgradableMSCAWithSingleOwnerPlugin.t.sol | 5 +- test/gas/PluginGasProfileBase.t.sol | 4 +- test/libs/PublicKeyLib.t.sol | 2 +- test/libs/PublicKeyLibCaller.sol | 2 +- test/libs/RecipientAddressLib.t.sol | 11 +-- test/libs/webauthn/WebAuthnLib.t.sol | 5 +- test/libs/webauthn/WebAuthnLibFuzz.t.sol | 5 +- .../msca/6900/shared/libs/Bytes32DLLLib.t.sol | 2 +- test/msca/6900/shared/libs/Bytes4DLLLib.t.sol | 2 +- .../6900/shared/libs/ValidationDataLib.t.sol | 4 +- .../6900/v0.7/HookFunctionReferenceDLL.t.sol | 4 +- test/msca/6900/v0.7/PluginExecutor.t.sol | 24 +++--- test/msca/6900/v0.7/PluginManager.t.sol | 18 +++-- .../RepeatableFunctionReferenceDLLLib.t.sol | 4 +- test/msca/6900/v0.7/SingleOwnerMSCA.t.sol | 29 ++++---- .../6900/v0.7/SingleOwnerMSCAFactory.t.sol | 11 +-- test/msca/6900/v0.7/SingleOwnerPlugin.t.sol | 41 +++++----- test/msca/6900/v0.7/TestCircleMSCA.sol | 32 ++++---- test/msca/6900/v0.7/TestCircleMSCAFactory.sol | 8 +- .../TestPermitAnyExternalAddressPlugin.sol | 10 ++- ...yExternalAddressWithPostHookOnlyPlugin.sol | 10 ++- ...nyExternalAddressWithPreHookOnlyPlugin.sol | 10 ++- test/msca/6900/v0.7/TestTokenPlugin.sol | 10 ++- .../v0.7/TestTokenWithPostHookOnlyPlugin.sol | 10 ++- .../v0.7/TestTokenWithPreHookOnlyPlugin.sol | 10 ++- .../6900/v0.7/TestUserOpAllPassValidator.sol | 4 +- test/msca/6900/v0.7/TestUserOpValidator.sol | 4 +- .../6900/v0.7/TestUserOpValidatorHook.sol | 4 +- .../TestUserOpValidatorWithDependencyHook.sol | 2 +- test/msca/6900/v0.7/UpgradableMSCA.t.sol | 55 +++++++------- .../6900/v0.7/UpgradableMSCAFactory.t.sol | 21 +++--- test/msca/6900/v0.7/WalletStorageV1Lib.t.sol | 10 +-- .../AddressBookPluginWithFullMSCA.t.sol | 19 ++--- .../AddressBookPluginWithSemiMSCA.t.sol | 20 ++--- ...StorageAddressBookPluginWithFullMSCA.t.sol | 45 +++++------ ...StorageAddressBookPluginWithSemiMSCA.t.sol | 45 ++++++----- .../WeightedWebauthnMultisigPlugin.t.sol | 59 ++++++++------- .../6900/v0.8/DynamicValidationHookData.t.sol | 22 +++--- test/msca/6900/v0.8/FooBarPlugin.sol | 13 ++-- test/msca/6900/v0.8/PermittedCall.t.sol | 13 ++-- test/msca/6900/v0.8/PluginManager.t.sol | 31 ++++---- test/msca/6900/v0.8/SelfCallRule.t.sol | 25 ++++--- test/msca/6900/v0.8/TestCircleMSCA.sol | 18 ++--- test/msca/6900/v0.8/TestCircleMSCAFactory.sol | 17 +++-- .../6900/v0.8/TestPermittedCallPlugin.sol | 9 ++- test/msca/6900/v0.8/TestTokenPlugin.sol | 25 ++++--- test/msca/6900/v0.8/TestUserOpValidator.sol | 11 +-- .../6900/v0.8/TestUserOpValidatorHook.sol | 11 +-- test/msca/6900/v0.8/UpgradableMSCA.t.sol | 58 ++++++++------- .../6900/v0.8/UpgradableMSCAFactory.t.sol | 23 +++--- .../v0.8/helpers/TestAddressBookPlugin.sol | 23 +++--- .../libs/thirdparty/ModuleEntityLib.t.sol | 4 +- .../thirdparty/SparseCalldataSegmentLib.t.sol | 2 +- .../SingleSignerValidationModule.t.sol | 34 +++++---- .../msca/6900/v0.8/utils/AccountTestUtils.sol | 8 +- test/util/TestERC777.sol | 4 +- test/util/TestUtils.sol | 5 +- 129 files changed, 991 insertions(+), 850 deletions(-) diff --git a/foundry.toml b/foundry.toml index c86f677..b174572 100644 --- a/foundry.toml +++ b/foundry.toml @@ -19,3 +19,4 @@ depth = 15 [fmt] line_length = 120 wrap_comments = true +sort_imports = true diff --git a/script/001_DeployPluginManager.s.sol b/script/001_DeployPluginManager.s.sol index 7006d24..da40a5e 100644 --- a/script/001_DeployPluginManager.s.sol +++ b/script/001_DeployPluginManager.s.sol @@ -18,8 +18,8 @@ */ pragma solidity 0.8.24; -import {console, Script} from "forge-std/src/Script.sol"; import {PluginManager} from "../src/msca/6900/v0.7/managers/PluginManager.sol"; +import {Script, console} from "forge-std/src/Script.sol"; contract DeployPluginManagerScript is Script { address constant EXPECTED_PLUGIN_MANAGER = address(0x5c2099d54979B1F4c84eB5d3fc50041a78aE4E15); diff --git a/script/002_DeployUpgradableMSCAFactory.s.sol b/script/002_DeployUpgradableMSCAFactory.s.sol index 3202946..d85f9bb 100644 --- a/script/002_DeployUpgradableMSCAFactory.s.sol +++ b/script/002_DeployUpgradableMSCAFactory.s.sol @@ -18,8 +18,8 @@ */ pragma solidity 0.8.24; -import {console, Script} from "forge-std/src/Script.sol"; import {UpgradableMSCAFactory} from "../src/msca/6900/v0.7/factories/UpgradableMSCAFactory.sol"; +import {Script, console} from "forge-std/src/Script.sol"; contract DeployUpgradableMSCAFactoryScript is Script { address constant PLUGIN_MANAGER = 0x5c2099d54979B1F4c84eB5d3fc50041a78aE4E15; diff --git a/script/003_DeploySingleOwnerMSCAFactory.s.sol b/script/003_DeploySingleOwnerMSCAFactory.s.sol index c71484f..1fd224d 100644 --- a/script/003_DeploySingleOwnerMSCAFactory.s.sol +++ b/script/003_DeploySingleOwnerMSCAFactory.s.sol @@ -18,8 +18,8 @@ */ pragma solidity 0.8.24; -import "forge-std/src/Script.sol"; import "../src/msca/6900/v0.7/factories/semi/SingleOwnerMSCAFactory.sol"; +import "forge-std/src/Script.sol"; contract DeploySingleOwnerMSCAFactoryScript is Script { address constant PLUGIN_MANAGER = 0xc751A2bFA2A4a5b27E94ad735534c16a0999d871; diff --git a/script/004_DeploySingleOwnerPlugin.s.sol b/script/004_DeploySingleOwnerPlugin.s.sol index b4f6be5..0e079ef 100644 --- a/script/004_DeploySingleOwnerPlugin.s.sol +++ b/script/004_DeploySingleOwnerPlugin.s.sol @@ -18,8 +18,8 @@ */ pragma solidity 0.8.24; -import "forge-std/src/Script.sol"; import "../src/msca/6900/v0.7/plugins/v1_0_0/acl/SingleOwnerPlugin.sol"; +import "forge-std/src/Script.sol"; contract DeploySingleOwnerPluginScript is Script { address payable constant EXPECTED_PLUGIN_ADDRESS = payable(address(0xFfC2440999EF1F84089Ca1418b673D4B9c089bBe)); diff --git a/script/005_DeployECDSAAccountFactory.s.sol b/script/005_DeployECDSAAccountFactory.s.sol index c3219ba..f0dd75b 100644 --- a/script/005_DeployECDSAAccountFactory.s.sol +++ b/script/005_DeployECDSAAccountFactory.s.sol @@ -18,8 +18,8 @@ */ pragma solidity 0.8.24; -import "forge-std/src/Script.sol"; import "../src/account/v1/factory/ECDSAAccountFactory.sol"; +import "forge-std/src/Script.sol"; /// @dev We actually still used hardhat deployment for this legacy contract. This script is more for convenience /// purpose. diff --git a/script/006_DeployAddressBookPlugin.s.sol b/script/006_DeployAddressBookPlugin.s.sol index d502806..aad500d 100644 --- a/script/006_DeployAddressBookPlugin.s.sol +++ b/script/006_DeployAddressBookPlugin.s.sol @@ -18,9 +18,9 @@ */ pragma solidity 0.8.24; +import {AddressBookPlugin} from "../src/msca/6900/v0.7/plugins/v1_0_0/addressbook/AddressBookPlugin.sol"; import {Script} from "forge-std/src/Script.sol"; import {console} from "forge-std/src/console.sol"; -import {AddressBookPlugin} from "../src/msca/6900/v0.7/plugins/v1_0_0/addressbook/AddressBookPlugin.sol"; contract DeployAddressBookPluginScript is Script { // TODO: replace this with officially deployed address diff --git a/script/007_DeployColdStorageAddressBookPlugin.s.sol b/script/007_DeployColdStorageAddressBookPlugin.s.sol index a4b440a..6e1fe9d 100644 --- a/script/007_DeployColdStorageAddressBookPlugin.s.sol +++ b/script/007_DeployColdStorageAddressBookPlugin.s.sol @@ -18,10 +18,10 @@ */ pragma solidity 0.8.24; -import {Script} from "forge-std/src/Script.sol"; -import {console} from "forge-std/src/console.sol"; import {ColdStorageAddressBookPlugin} from "../src/msca/6900/v0.7/plugins/v1_0_0/addressbook/ColdStorageAddressBookPlugin.sol"; +import {Script} from "forge-std/src/Script.sol"; +import {console} from "forge-std/src/console.sol"; contract DeployColdStorageAddressBookPluginScript is Script { address payable constant EXPECTED_PLUGIN_ADDRESS = payable(address(0x7E7e5B99F9C3dF2E2f38418e0F7C08C3911a4413)); diff --git a/script/008_DeployWeightedWebauthnMultisigPlugin.s.sol b/script/008_DeployWeightedWebauthnMultisigPlugin.s.sol index 8460b42..de2d956 100644 --- a/script/008_DeployWeightedWebauthnMultisigPlugin.s.sol +++ b/script/008_DeployWeightedWebauthnMultisigPlugin.s.sol @@ -18,10 +18,10 @@ */ pragma solidity 0.8.24; -import {Script} from "forge-std/src/Script.sol"; -import {console} from "forge-std/src/console.sol"; import {WeightedWebauthnMultisigPlugin} from "../src/msca/6900/v0.7/plugins/v1_0_0/multisig/WeightedWebauthnMultisigPlugin.sol"; +import {Script} from "forge-std/src/Script.sol"; +import {console} from "forge-std/src/console.sol"; contract DeployWeightedWebauthnMultisigPlugin is Script { address payable constant EXPECTED_PLUGIN_ADDRESS = payable(address(0x5FC0e9da759812cd862625bF6d3EA02EB0666160)); diff --git a/script/009_SetUpgradableMSCAFactoryPlugins.s.sol b/script/009_SetUpgradableMSCAFactoryPlugins.s.sol index 6e346b5..333a3ff 100644 --- a/script/009_SetUpgradableMSCAFactoryPlugins.s.sol +++ b/script/009_SetUpgradableMSCAFactoryPlugins.s.sol @@ -18,8 +18,8 @@ */ pragma solidity 0.8.24; -import {console, Script} from "forge-std/src/Script.sol"; import {UpgradableMSCAFactory} from "../src/msca/6900/v0.7/factories/UpgradableMSCAFactory.sol"; +import {Script, console} from "forge-std/src/Script.sol"; contract SetUpgradableMSCAFactoryPlugins is Script { address payable constant EXPECTED_FACTORY_ADDRESS = payable(address(0x95abd14795D32A4e636e976Ff31dC634Ad33A09E)); diff --git a/script/010_StakeUpgradableMSCAFactory.s.sol b/script/010_StakeUpgradableMSCAFactory.s.sol index 56fb467..f8e0d1d 100644 --- a/script/010_StakeUpgradableMSCAFactory.s.sol +++ b/script/010_StakeUpgradableMSCAFactory.s.sol @@ -18,8 +18,8 @@ */ pragma solidity 0.8.24; -import {console, Script} from "forge-std/src/Script.sol"; import {UpgradableMSCAFactory} from "../src/msca/6900/v0.7/factories/UpgradableMSCAFactory.sol"; +import {Script, console} from "forge-std/src/Script.sol"; contract StakeUpgradableMSCAFactory is Script { address payable constant EXPECTED_FACTORY_ADDRESS = payable(address(0x95abd14795D32A4e636e976Ff31dC634Ad33A09E)); diff --git a/script/011_DeployTokenCallbackPlugin.s.sol b/script/011_DeployTokenCallbackPlugin.s.sol index 0af2bab..27f68ca 100644 --- a/script/011_DeployTokenCallbackPlugin.s.sol +++ b/script/011_DeployTokenCallbackPlugin.s.sol @@ -18,8 +18,8 @@ */ pragma solidity 0.8.24; -import {Script, console} from "forge-std/src/Script.sol"; import {DefaultTokenCallbackPlugin} from "../src/msca/6900/v0.7/plugins/v1_0_0/utility/DefaultTokenCallbackPlugin.sol"; +import {Script, console} from "forge-std/src/Script.sol"; contract DeployTokenCallbackPluginScript is Script { // Safety check to avoid accidental deploy. Change address to 0x0 if you want to deploy a new version. diff --git a/src/account/CoreAccount.sol b/src/account/CoreAccount.sol index 874a7e3..5fd51ae 100644 --- a/src/account/CoreAccount.sol +++ b/src/account/CoreAccount.sol @@ -18,14 +18,14 @@ */ pragma solidity 0.8.24; -import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; +import {DefaultCallbackHandler} from "../callback/DefaultCallbackHandler.sol"; +import {ExecutionUtils} from "../utils/ExecutionUtils.sol"; +import {BaseAccount} from "@account-abstraction/contracts/core/BaseAccount.sol"; +import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; +import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import {PausableUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol"; import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol"; -import {BaseAccount} from "@account-abstraction/contracts/core/BaseAccount.sol"; -import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; -import {ExecutionUtils} from "../utils/ExecutionUtils.sol"; -import {DefaultCallbackHandler} from "../callback/DefaultCallbackHandler.sol"; /** * @dev Upgradable & ownable contract. One of the most common templates. diff --git a/src/account/v1/ECDSAAccount.sol b/src/account/v1/ECDSAAccount.sol index 29bb1b8..e0c084e 100644 --- a/src/account/v1/ECDSAAccount.sol +++ b/src/account/v1/ECDSAAccount.sol @@ -18,14 +18,14 @@ */ pragma solidity 0.8.24; -import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; -import "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol"; -import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; -import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; +import {SIG_VALIDATION_FAILED} from "../../common/Constants.sol"; +import "../CoreAccount.sol"; import "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; import "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; -import "../CoreAccount.sol"; -import {SIG_VALIDATION_FAILED} from "../../common/Constants.sol"; +import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; +import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; +import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; +import "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol"; /** * @dev Upgradable & ownable (by EOA key) contract. One of the most common templates. diff --git a/src/account/v1/factory/ECDSAAccountFactory.sol b/src/account/v1/factory/ECDSAAccountFactory.sol index f03241a..abc1d41 100644 --- a/src/account/v1/factory/ECDSAAccountFactory.sol +++ b/src/account/v1/factory/ECDSAAccountFactory.sol @@ -18,9 +18,9 @@ */ pragma solidity 0.8.24; +import "../ECDSAAccount.sol"; import "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; import "@openzeppelin/contracts/utils/Create2.sol"; -import "../ECDSAAccount.sol"; /** * @dev Account factory that creates the upgradeable account signed and verified by ECDSA. diff --git a/src/callback/DefaultCallbackHandler.sol b/src/callback/DefaultCallbackHandler.sol index 9b41cd7..3e45766 100644 --- a/src/callback/DefaultCallbackHandler.sol +++ b/src/callback/DefaultCallbackHandler.sol @@ -18,10 +18,10 @@ */ pragma solidity 0.8.24; -import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; -import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; -import {IERC1155Receiver} from "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol"; import {IERC777Recipient} from "@openzeppelin/contracts/interfaces/IERC777Recipient.sol"; +import {IERC1155Receiver} from "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol"; +import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; +import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; /** * @dev Token callback handler. Allowing account receiving these tokens. diff --git a/src/libs/RecipientAddressLib.sol b/src/libs/RecipientAddressLib.sol index 9b65a0c..afcdb85 100644 --- a/src/libs/RecipientAddressLib.sol +++ b/src/libs/RecipientAddressLib.sol @@ -18,8 +18,8 @@ */ pragma solidity 0.8.24; -import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {IERC1155} from "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; +import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; /** diff --git a/src/libs/WebAuthnLib.sol b/src/libs/WebAuthnLib.sol index 7a83f4b..2bf622c 100644 --- a/src/libs/WebAuthnLib.sol +++ b/src/libs/WebAuthnLib.sol @@ -18,9 +18,9 @@ */ pragma solidity 0.8.24; +import {WebAuthnData} from "../common/CommonStructs.sol"; import {FCL_ecdsa} from "@fcl/FCL_ecdsa.sol"; import {FCL_Elliptic_ZZ} from "@fcl/FCL_elliptic.sol"; -import {WebAuthnData} from "../common/CommonStructs.sol"; /// @title WebAuthn /// diff --git a/src/msca/6900/shared/libs/AddressDLLLib.sol b/src/msca/6900/shared/libs/AddressDLLLib.sol index fca640e..48fc3ad 100644 --- a/src/msca/6900/shared/libs/AddressDLLLib.sol +++ b/src/msca/6900/shared/libs/AddressDLLLib.sol @@ -18,7 +18,7 @@ */ pragma solidity 0.8.24; -import {ItemAlreadyExists, ItemDoesNotExist, InvalidLimit} from "../common/Errors.sol"; +import {InvalidLimit, ItemAlreadyExists, ItemDoesNotExist} from "../common/Errors.sol"; import {AddressDLL} from "../common/Structs.sol"; /** diff --git a/src/msca/6900/shared/libs/Bytes32DLLLib.sol b/src/msca/6900/shared/libs/Bytes32DLLLib.sol index 0344789..d684197 100644 --- a/src/msca/6900/shared/libs/Bytes32DLLLib.sol +++ b/src/msca/6900/shared/libs/Bytes32DLLLib.sol @@ -18,9 +18,9 @@ */ pragma solidity 0.8.24; -import {InvalidItem, ItemAlreadyExists, ItemDoesNotExist, InvalidLimit} from "../../shared/common/Errors.sol"; -import {Bytes32DLL} from "../common/Structs.sol"; import {SENTINEL_BYTES32} from "../../../../common/Constants.sol"; +import {InvalidItem, InvalidLimit, ItemAlreadyExists, ItemDoesNotExist} from "../../shared/common/Errors.sol"; +import {Bytes32DLL} from "../common/Structs.sol"; /** * @dev Enumerable & ordered doubly linked list built using mapping(bytes32 => bytes32). diff --git a/src/msca/6900/shared/libs/Bytes4DLLLib.sol b/src/msca/6900/shared/libs/Bytes4DLLLib.sol index 842ced3..e9b40e1 100644 --- a/src/msca/6900/shared/libs/Bytes4DLLLib.sol +++ b/src/msca/6900/shared/libs/Bytes4DLLLib.sol @@ -18,9 +18,9 @@ */ pragma solidity 0.8.24; -import {ItemAlreadyExists, ItemDoesNotExist, InvalidLimit} from "../../shared/common/Errors.sol"; -import {Bytes4DLL} from "../common/Structs.sol"; import {SENTINEL_BYTES4} from "../../../../common/Constants.sol"; +import {InvalidLimit, ItemAlreadyExists, ItemDoesNotExist} from "../../shared/common/Errors.sol"; +import {Bytes4DLL} from "../common/Structs.sol"; /** * @dev Enumerable & ordered doubly linked list built using mapping(bytes4 => bytes4). diff --git a/src/msca/6900/v0.7/account/BaseMSCA.sol b/src/msca/6900/v0.7/account/BaseMSCA.sol index 13474f7..005b3da 100644 --- a/src/msca/6900/v0.7/account/BaseMSCA.sol +++ b/src/msca/6900/v0.7/account/BaseMSCA.sol @@ -18,45 +18,47 @@ */ pragma solidity 0.8.24; -import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; -import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; -import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; +import { + EMPTY_FUNCTION_REFERENCE, + SENTINEL_BYTES21, + WALLET_AUTHOR, + WALLET_VERSION_1 +} from "../../../../common/Constants.sol"; import {ExecutionUtils} from "../../../../utils/ExecutionUtils.sol"; +import { + InvalidAuthorizer, + InvalidExecutionFunction, + InvalidValidationFunctionId, + NotFoundSelector, + UnauthorizedCaller +} from "../../shared/common/Errors.sol"; +import {AddressDLL, ValidationData} from "../../shared/common/Structs.sol"; +import {AddressDLLLib} from "../../shared/libs/AddressDLLLib.sol"; +import {ValidationDataLib} from "../../shared/libs/ValidationDataLib.sol"; +import { + PRE_HOOK_ALWAYS_DENY_FUNCTION_REFERENCE, + RUNTIME_VALIDATION_ALWAYS_ALLOW_FUNCTION_REFERENCE +} from "../common/Constants.sol"; +import "../common/Structs.sol"; +import {IAccountLoupe} from "../interfaces/IAccountLoupe.sol"; import {IPlugin} from "../interfaces/IPlugin.sol"; import {IPluginExecutor} from "../interfaces/IPluginExecutor.sol"; -import {IAccountLoupe} from "../interfaces/IAccountLoupe.sol"; import {IPluginManager} from "../interfaces/IPluginManager.sol"; import {IStandardExecutor} from "../interfaces/IStandardExecutor.sol"; -import {PluginManager} from "../managers/PluginManager.sol"; -import {StandardExecutor} from "../managers/StandardExecutor.sol"; -import {PluginExecutor} from "../managers/PluginExecutor.sol"; -import {WalletStorageV1Lib} from "../libs/WalletStorageV1Lib.sol"; import {ExecutionHookLib} from "../libs/ExecutionHookLib.sol"; -import {WalletStorageInitializable} from "./WalletStorageInitializable.sol"; -import {RepeatableFunctionReferenceDLLLib} from "../libs/RepeatableFunctionReferenceDLLLib.sol"; import {FunctionReferenceLib} from "../libs/FunctionReferenceLib.sol"; -import {AddressDLLLib} from "../../shared/libs/AddressDLLLib.sol"; -import {ValidationDataLib} from "../../shared/libs/ValidationDataLib.sol"; +import {RepeatableFunctionReferenceDLLLib} from "../libs/RepeatableFunctionReferenceDLLLib.sol"; + import {SelectorRegistryLib} from "../libs/SelectorRegistryLib.sol"; -import { - UnauthorizedCaller, - NotFoundSelector, - InvalidValidationFunctionId, - InvalidAuthorizer, - InvalidExecutionFunction -} from "../../shared/common/Errors.sol"; -import "../common/Structs.sol"; -import { - WALLET_AUTHOR, - WALLET_VERSION_1, - SENTINEL_BYTES21, - EMPTY_FUNCTION_REFERENCE -} from "../../../../common/Constants.sol"; -import {ValidationData, AddressDLL} from "../../shared/common/Structs.sol"; -import { - RUNTIME_VALIDATION_ALWAYS_ALLOW_FUNCTION_REFERENCE, - PRE_HOOK_ALWAYS_DENY_FUNCTION_REFERENCE -} from "../common/Constants.sol"; +import {WalletStorageV1Lib} from "../libs/WalletStorageV1Lib.sol"; +import {PluginExecutor} from "../managers/PluginExecutor.sol"; +import {PluginManager} from "../managers/PluginManager.sol"; +import {StandardExecutor} from "../managers/StandardExecutor.sol"; + +import {WalletStorageInitializable} from "./WalletStorageInitializable.sol"; +import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; +import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; +import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; /** * @dev Base MSCA implementation with **authentication**. diff --git a/src/msca/6900/v0.7/account/UpgradableMSCA.sol b/src/msca/6900/v0.7/account/UpgradableMSCA.sol index 345c542..f47b83d 100644 --- a/src/msca/6900/v0.7/account/UpgradableMSCA.sol +++ b/src/msca/6900/v0.7/account/UpgradableMSCA.sol @@ -18,17 +18,18 @@ */ pragma solidity 0.8.24; -import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; -import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; -import {BaseMSCA} from "./BaseMSCA.sol"; +import {DefaultCallbackHandler} from "../../../../callback/DefaultCallbackHandler.sol"; import {ExecutionUtils} from "../../../../utils/ExecutionUtils.sol"; -import {PluginManager} from "../managers/PluginManager.sol"; import {InvalidInitializationInput} from "../../shared/common/Errors.sol"; import {FunctionReference} from "../common/Structs.sol"; -import {DefaultCallbackHandler} from "../../../../callback/DefaultCallbackHandler.sol"; -import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; -import {IERC1155Receiver} from "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol"; +import {PluginManager} from "../managers/PluginManager.sol"; +import {BaseMSCA} from "./BaseMSCA.sol"; +import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; +import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol"; +import {IERC1155Receiver} from "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol"; +import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; /** * @dev Leverage {ERC1967Proxy} brought by UUPS proxies, when this contract is set as the implementation behind such a diff --git a/src/msca/6900/v0.7/account/semi/SingleOwnerMSCA.sol b/src/msca/6900/v0.7/account/semi/SingleOwnerMSCA.sol index 1428a15..b0db104 100644 --- a/src/msca/6900/v0.7/account/semi/SingleOwnerMSCA.sol +++ b/src/msca/6900/v0.7/account/semi/SingleOwnerMSCA.sol @@ -18,45 +18,48 @@ */ pragma solidity 0.8.24; -import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; -import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol"; -import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; -import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; -import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; -import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; -import {IERC1155Receiver} from "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol"; -import {SignatureChecker} from "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol"; -import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; -import {IPlugin} from "../../interfaces/IPlugin.sol"; -import {BaseMSCA} from "../BaseMSCA.sol"; -import {PluginManager} from "../../managers/PluginManager.sol"; import {DefaultCallbackHandler} from "../../../../../callback/DefaultCallbackHandler.sol"; -import {ExecutionUtils} from "../../../../../utils/ExecutionUtils.sol"; -import {RepeatableFunctionReferenceDLLLib} from "../../libs/RepeatableFunctionReferenceDLLLib.sol"; -import {FunctionReferenceLib} from "../../libs/FunctionReferenceLib.sol"; -import {WalletStorageV1Lib} from "../../libs/WalletStorageV1Lib.sol"; -import {ValidationDataLib} from "../../../shared/libs/ValidationDataLib.sol"; -import { - NotFoundSelector, - InvalidValidationFunctionId, - InvalidAuthorizer, - UnauthorizedCaller -} from "../../../shared/common/Errors.sol"; -import {FunctionReference, RepeatableBytes21DLL, ExecutionDetail} from "../../common/Structs.sol"; + import { - EIP1271_VALID_SIGNATURE, EIP1271_INVALID_SIGNATURE, + EIP1271_VALID_SIGNATURE, EMPTY_FUNCTION_REFERENCE, - SIG_VALIDATION_SUCCEEDED, - SIG_VALIDATION_FAILED, EMPTY_FUNCTION_REFERENCE, - SENTINEL_BYTES21 + SENTINEL_BYTES21, + SIG_VALIDATION_FAILED, + SIG_VALIDATION_SUCCEEDED } from "../../../../../common/Constants.sol"; +import {ExecutionUtils} from "../../../../../utils/ExecutionUtils.sol"; +import { + InvalidAuthorizer, + InvalidValidationFunctionId, + NotFoundSelector, + UnauthorizedCaller +} from "../../../shared/common/Errors.sol"; import {ValidationData} from "../../../shared/common/Structs.sol"; +import {ValidationDataLib} from "../../../shared/libs/ValidationDataLib.sol"; import { - RUNTIME_VALIDATION_ALWAYS_ALLOW_FUNCTION_REFERENCE, - PRE_HOOK_ALWAYS_DENY_FUNCTION_REFERENCE + PRE_HOOK_ALWAYS_DENY_FUNCTION_REFERENCE, + RUNTIME_VALIDATION_ALWAYS_ALLOW_FUNCTION_REFERENCE } from "../../common/Constants.sol"; +import {ExecutionDetail, FunctionReference, RepeatableBytes21DLL} from "../../common/Structs.sol"; +import {IPlugin} from "../../interfaces/IPlugin.sol"; +import {FunctionReferenceLib} from "../../libs/FunctionReferenceLib.sol"; +import {RepeatableFunctionReferenceDLLLib} from "../../libs/RepeatableFunctionReferenceDLLLib.sol"; +import {WalletStorageV1Lib} from "../../libs/WalletStorageV1Lib.sol"; +import {PluginManager} from "../../managers/PluginManager.sol"; +import {BaseMSCA} from "../BaseMSCA.sol"; +import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; +import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; +import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; +import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol"; + +import {IERC1155Receiver} from "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol"; +import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; +import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; + +import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; +import {SignatureChecker} from "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol"; /** * @dev Semi-MSCA that enshrines single owner into the account storage. diff --git a/src/msca/6900/v0.7/factories/UpgradableMSCAFactory.sol b/src/msca/6900/v0.7/factories/UpgradableMSCAFactory.sol index 60ebfbe..6ce2c19 100644 --- a/src/msca/6900/v0.7/factories/UpgradableMSCAFactory.sol +++ b/src/msca/6900/v0.7/factories/UpgradableMSCAFactory.sol @@ -18,14 +18,14 @@ */ pragma solidity 0.8.24; -import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; -import {Create2} from "@openzeppelin/contracts/utils/Create2.sol"; -import {Ownable2Step} from "@openzeppelin/contracts/access/Ownable2Step.sol"; -import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; -import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; +import {Create2FailedDeployment, InvalidInitializationInput, InvalidLength} from "../../shared/common/Errors.sol"; import {UpgradableMSCA} from "../account/UpgradableMSCA.sol"; import {PluginManager} from "../managers/PluginManager.sol"; -import {Create2FailedDeployment, InvalidInitializationInput, InvalidLength} from "../../shared/common/Errors.sol"; +import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; +import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; +import {Ownable2Step} from "@openzeppelin/contracts/access/Ownable2Step.sol"; +import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; +import {Create2} from "@openzeppelin/contracts/utils/Create2.sol"; /** * @dev Account factory that creates the upgradeable MSCA with a set of plugins to be installed. diff --git a/src/msca/6900/v0.7/factories/semi/SingleOwnerMSCAFactory.sol b/src/msca/6900/v0.7/factories/semi/SingleOwnerMSCAFactory.sol index 061e72b..a567fd2 100644 --- a/src/msca/6900/v0.7/factories/semi/SingleOwnerMSCAFactory.sol +++ b/src/msca/6900/v0.7/factories/semi/SingleOwnerMSCAFactory.sol @@ -18,12 +18,12 @@ */ pragma solidity 0.8.24; +import {Create2FailedDeployment, InvalidInitializationInput} from "../../../shared/common/Errors.sol"; +import {SingleOwnerMSCA} from "../../account/semi/SingleOwnerMSCA.sol"; +import {PluginManager} from "../../managers/PluginManager.sol"; +import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; import {Create2} from "@openzeppelin/contracts/utils/Create2.sol"; -import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; -import {PluginManager} from "../../managers/PluginManager.sol"; -import {SingleOwnerMSCA} from "../../account/semi/SingleOwnerMSCA.sol"; -import {Create2FailedDeployment, InvalidInitializationInput} from "../../../shared/common/Errors.sol"; /** * @dev Account factory that creates the semi-MSCA that enshrines single owner into the account storage. diff --git a/src/msca/6900/v0.7/interfaces/IPlugin.sol b/src/msca/6900/v0.7/interfaces/IPlugin.sol index 4edf048..5b9f498 100644 --- a/src/msca/6900/v0.7/interfaces/IPlugin.sol +++ b/src/msca/6900/v0.7/interfaces/IPlugin.sol @@ -18,9 +18,9 @@ */ pragma solidity 0.8.24; -import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; -import "../common/Structs.sol"; import "../common/PluginManifest.sol"; +import "../common/Structs.sol"; +import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; /** * @dev Implements https://eips.ethereum.org/EIPS/eip-6900. Plugins must implement this interface to support plugin diff --git a/src/msca/6900/v0.7/libs/ExecutionHookLib.sol b/src/msca/6900/v0.7/libs/ExecutionHookLib.sol index bf28982..f6461d6 100644 --- a/src/msca/6900/v0.7/libs/ExecutionHookLib.sol +++ b/src/msca/6900/v0.7/libs/ExecutionHookLib.sol @@ -18,16 +18,16 @@ */ pragma solidity 0.8.24; -import {IPlugin} from "../interfaces/IPlugin.sol"; -import {RepeatableFunctionReferenceDLLLib} from "./RepeatableFunctionReferenceDLLLib.sol"; -import {FunctionReferenceLib} from "./FunctionReferenceLib.sol"; -import {InvalidValidationFunctionId} from "../../shared/common/Errors.sol"; -import "../common/Structs.sol"; import {EMPTY_FUNCTION_REFERENCE, SENTINEL_BYTES21} from "../../../../common/Constants.sol"; +import {InvalidValidationFunctionId} from "../../shared/common/Errors.sol"; import { - RUNTIME_VALIDATION_ALWAYS_ALLOW_FUNCTION_REFERENCE, - PRE_HOOK_ALWAYS_DENY_FUNCTION_REFERENCE + PRE_HOOK_ALWAYS_DENY_FUNCTION_REFERENCE, + RUNTIME_VALIDATION_ALWAYS_ALLOW_FUNCTION_REFERENCE } from "../common/Constants.sol"; +import "../common/Structs.sol"; +import {IPlugin} from "../interfaces/IPlugin.sol"; +import {FunctionReferenceLib} from "./FunctionReferenceLib.sol"; +import {RepeatableFunctionReferenceDLLLib} from "./RepeatableFunctionReferenceDLLLib.sol"; /** * @dev Process pre or post execution hooks. diff --git a/src/msca/6900/v0.7/libs/FunctionReferenceDLLLib.sol b/src/msca/6900/v0.7/libs/FunctionReferenceDLLLib.sol index eeb08c0..f81c743 100644 --- a/src/msca/6900/v0.7/libs/FunctionReferenceDLLLib.sol +++ b/src/msca/6900/v0.7/libs/FunctionReferenceDLLLib.sol @@ -18,12 +18,12 @@ */ pragma solidity 0.8.24; -import {FunctionReferenceLib} from "./FunctionReferenceLib.sol"; +import {EMPTY_FUNCTION_REFERENCE, SENTINEL_BYTES21} from "../../../../common/Constants.sol"; import { - InvalidFunctionReference, ItemAlreadyExists, ItemDoesNotExist, InvalidLimit + InvalidFunctionReference, InvalidLimit, ItemAlreadyExists, ItemDoesNotExist } from "../../shared/common/Errors.sol"; import "../common/Structs.sol"; -import {SENTINEL_BYTES21, EMPTY_FUNCTION_REFERENCE} from "../../../../common/Constants.sol"; +import {FunctionReferenceLib} from "./FunctionReferenceLib.sol"; /** * @dev Enumerable & ordered doubly linked list built using mapping(bytes21 => bytes21) for function reference. diff --git a/src/msca/6900/v0.7/libs/RepeatableFunctionReferenceDLLLib.sol b/src/msca/6900/v0.7/libs/RepeatableFunctionReferenceDLLLib.sol index d6c3f84..a6a219e 100644 --- a/src/msca/6900/v0.7/libs/RepeatableFunctionReferenceDLLLib.sol +++ b/src/msca/6900/v0.7/libs/RepeatableFunctionReferenceDLLLib.sol @@ -18,10 +18,10 @@ */ pragma solidity 0.8.24; -import {FunctionReferenceLib} from "./FunctionReferenceLib.sol"; -import {InvalidFunctionReference, ItemDoesNotExist, InvalidLimit} from "../../shared/common/Errors.sol"; -import "../common/Structs.sol"; import {EMPTY_FUNCTION_REFERENCE, SENTINEL_BYTES21} from "../../../../common/Constants.sol"; +import {InvalidFunctionReference, InvalidLimit, ItemDoesNotExist} from "../../shared/common/Errors.sol"; +import "../common/Structs.sol"; +import {FunctionReferenceLib} from "./FunctionReferenceLib.sol"; /** * @dev Enumerable & ordered doubly linked list built using RepeatableBytes21DLL. diff --git a/src/msca/6900/v0.7/libs/SelectorRegistryLib.sol b/src/msca/6900/v0.7/libs/SelectorRegistryLib.sol index 4630f55..0fbf4ef 100644 --- a/src/msca/6900/v0.7/libs/SelectorRegistryLib.sol +++ b/src/msca/6900/v0.7/libs/SelectorRegistryLib.sol @@ -18,18 +18,20 @@ */ pragma solidity 0.8.24; -import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; -import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; -import {IPaymaster} from "@account-abstraction/contracts/interfaces/IPaymaster.sol"; -import {IAggregator} from "@account-abstraction/contracts/interfaces/IAggregator.sol"; import {IAccountLoupe} from "../interfaces/IAccountLoupe.sol"; -import {IPluginManager} from "../interfaces/IPluginManager.sol"; + import {IPlugin} from "../interfaces/IPlugin.sol"; import {IPluginExecutor} from "../interfaces/IPluginExecutor.sol"; +import {IPluginManager} from "../interfaces/IPluginManager.sol"; import {IStandardExecutor} from "../interfaces/IStandardExecutor.sol"; -import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; -import {IERC1155Receiver} from "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol"; +import {IAggregator} from "@account-abstraction/contracts/interfaces/IAggregator.sol"; +import {IPaymaster} from "@account-abstraction/contracts/interfaces/IPaymaster.sol"; +import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; + import {IERC777Recipient} from "@openzeppelin/contracts/interfaces/IERC777Recipient.sol"; +import {IERC1155Receiver} from "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol"; +import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; +import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; library SelectorRegistryLib { bytes4 internal constant INITIALIZE_UPGRADABLE_MSCA = diff --git a/src/msca/6900/v0.7/libs/WalletStorageV1Lib.sol b/src/msca/6900/v0.7/libs/WalletStorageV1Lib.sol index 0c0cef4..231fe33 100644 --- a/src/msca/6900/v0.7/libs/WalletStorageV1Lib.sol +++ b/src/msca/6900/v0.7/libs/WalletStorageV1Lib.sol @@ -18,8 +18,8 @@ */ pragma solidity 0.8.24; -import "../common/Structs.sol"; import {AddressDLL} from "../../shared/common/Structs.sol"; +import "../common/Structs.sol"; /// @dev The same storage will be used for v1.x.y of MSCAs. library WalletStorageV1Lib { diff --git a/src/msca/6900/v0.7/managers/PluginExecutor.sol b/src/msca/6900/v0.7/managers/PluginExecutor.sol index 7409b2e..3c61668 100644 --- a/src/msca/6900/v0.7/managers/PluginExecutor.sol +++ b/src/msca/6900/v0.7/managers/PluginExecutor.sol @@ -18,14 +18,14 @@ */ pragma solidity 0.8.24; -import {ERC165Checker} from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; -import {IPluginExecutor} from "../interfaces/IPluginExecutor.sol"; -import {WalletStorageV1Lib} from "../libs/WalletStorageV1Lib.sol"; -import {ExecutionHookLib} from "../libs/ExecutionHookLib.sol"; -import {IPlugin} from "../interfaces/IPlugin.sol"; import {ExecutionUtils} from "../../../../utils/ExecutionUtils.sol"; -import {NotFoundSelector, InvalidExecutionFunction} from "../../shared/common/Errors.sol"; +import {InvalidExecutionFunction, NotFoundSelector} from "../../shared/common/Errors.sol"; import "../common/Structs.sol"; +import {IPlugin} from "../interfaces/IPlugin.sol"; +import {IPluginExecutor} from "../interfaces/IPluginExecutor.sol"; +import {ExecutionHookLib} from "../libs/ExecutionHookLib.sol"; +import {WalletStorageV1Lib} from "../libs/WalletStorageV1Lib.sol"; +import {ERC165Checker} from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; /** * @dev Default implementation of https://eips.ethereum.org/EIPS/eip-6900. MSCAs must implement this interface to diff --git a/src/msca/6900/v0.7/managers/PluginManager.sol b/src/msca/6900/v0.7/managers/PluginManager.sol index a0b55e1..81d77ad 100644 --- a/src/msca/6900/v0.7/managers/PluginManager.sol +++ b/src/msca/6900/v0.7/managers/PluginManager.sol @@ -18,23 +18,23 @@ */ pragma solidity 0.8.24; -import {ERC165Checker} from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; -import {IPlugin} from "../interfaces/IPlugin.sol"; -import {WalletStorageV1Lib} from "../libs/WalletStorageV1Lib.sol"; -import {AddressDLLLib} from "../../shared/libs/AddressDLLLib.sol"; -import {RepeatableFunctionReferenceDLLLib} from "../libs/RepeatableFunctionReferenceDLLLib.sol"; -import {FunctionReferenceDLLLib} from "../libs/FunctionReferenceDLLLib.sol"; -import {FunctionReferenceLib} from "../libs/FunctionReferenceLib.sol"; -import {SelectorRegistryLib} from "../libs/SelectorRegistryLib.sol"; -import {InvalidFunctionReference} from "../../shared/common/Errors.sol"; -import "../common/Structs.sol"; -import "../common/PluginManifest.sol"; import {EMPTY_FUNCTION_REFERENCE} from "../../../../common/Constants.sol"; +import {InvalidFunctionReference} from "../../shared/common/Errors.sol"; import {AddressDLL} from "../../shared/common/Structs.sol"; +import {AddressDLLLib} from "../../shared/libs/AddressDLLLib.sol"; import { - RUNTIME_VALIDATION_ALWAYS_ALLOW_FUNCTION_REFERENCE, - PRE_HOOK_ALWAYS_DENY_FUNCTION_REFERENCE + PRE_HOOK_ALWAYS_DENY_FUNCTION_REFERENCE, + RUNTIME_VALIDATION_ALWAYS_ALLOW_FUNCTION_REFERENCE } from "../common/Constants.sol"; +import "../common/PluginManifest.sol"; +import "../common/Structs.sol"; +import {IPlugin} from "../interfaces/IPlugin.sol"; +import {FunctionReferenceDLLLib} from "../libs/FunctionReferenceDLLLib.sol"; +import {FunctionReferenceLib} from "../libs/FunctionReferenceLib.sol"; +import {RepeatableFunctionReferenceDLLLib} from "../libs/RepeatableFunctionReferenceDLLLib.sol"; +import {SelectorRegistryLib} from "../libs/SelectorRegistryLib.sol"; +import {WalletStorageV1Lib} from "../libs/WalletStorageV1Lib.sol"; +import {ERC165Checker} from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; /** * @dev Default implementation of https://eips.ethereum.org/EIPS/eip-6900. MSCAs must implement this interface to diff --git a/src/msca/6900/v0.7/managers/StandardExecutor.sol b/src/msca/6900/v0.7/managers/StandardExecutor.sol index b79da84..0ac85bf 100644 --- a/src/msca/6900/v0.7/managers/StandardExecutor.sol +++ b/src/msca/6900/v0.7/managers/StandardExecutor.sol @@ -18,10 +18,10 @@ */ pragma solidity 0.8.24; -import {ERC165Checker} from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; -import {IPlugin} from "../interfaces/IPlugin.sol"; import {ExecutionUtils} from "../../../../utils/ExecutionUtils.sol"; import "../common/Structs.sol"; +import {IPlugin} from "../interfaces/IPlugin.sol"; +import {ERC165Checker} from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; /** * @dev Default implementation of https://eips.ethereum.org/EIPS/eip-6900. MSCAs must implement this interface to diff --git a/src/msca/6900/v0.7/plugins/BasePlugin.sol b/src/msca/6900/v0.7/plugins/BasePlugin.sol index c7a4749..c839d63 100644 --- a/src/msca/6900/v0.7/plugins/BasePlugin.sol +++ b/src/msca/6900/v0.7/plugins/BasePlugin.sol @@ -18,12 +18,12 @@ */ pragma solidity 0.8.24; -import {ERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol"; -import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; -import {IPlugin} from "../interfaces/IPlugin.sol"; -import "../common/Structs.sol"; -import "../common/PluginManifest.sol"; import {NotImplemented} from "../../shared/common/Errors.sol"; +import "../common/PluginManifest.sol"; +import "../common/Structs.sol"; +import {IPlugin} from "../interfaces/IPlugin.sol"; +import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; +import {ERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol"; /** * @dev Default implementation of https://eips.ethereum.org/EIPS/eip-6900. MSCAs must implement this interface to diff --git a/src/msca/6900/v0.7/plugins/v1_0_0/acl/SingleOwnerPlugin.sol b/src/msca/6900/v0.7/plugins/v1_0_0/acl/SingleOwnerPlugin.sol index 11cc3b5..90a667e 100644 --- a/src/msca/6900/v0.7/plugins/v1_0_0/acl/SingleOwnerPlugin.sol +++ b/src/msca/6900/v0.7/plugins/v1_0_0/acl/SingleOwnerPlugin.sol @@ -18,27 +18,29 @@ */ pragma solidity 0.8.24; -import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; -import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol"; -import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; -import {SignatureChecker} from "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol"; -import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; -import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; -import {BasePlugin} from "../../BasePlugin.sol"; -import {IStandardExecutor} from "../../../interfaces/IStandardExecutor.sol"; -import {IPluginManager} from "../../../interfaces/IPluginManager.sol"; -import {ISingleOwnerPlugin} from "./ISingleOwnerPlugin.sol"; -import {UnauthorizedCaller, InvalidValidationFunctionId} from "../../../../shared/common/Errors.sol"; -import "../../../common/Structs.sol"; -import "../../../common/PluginManifest.sol"; import { EIP1271_INVALID_SIGNATURE, EIP1271_VALID_SIGNATURE, - SIG_VALIDATION_FAILED, - SIG_VALIDATION_SUCCEEDED, + PLUGIN_AUTHOR, PLUGIN_VERSION_1, - PLUGIN_AUTHOR + SIG_VALIDATION_FAILED, + SIG_VALIDATION_SUCCEEDED } from "../../../../../../common/Constants.sol"; +import {InvalidValidationFunctionId, UnauthorizedCaller} from "../../../../shared/common/Errors.sol"; +import "../../../common/PluginManifest.sol"; +import "../../../common/Structs.sol"; +import {IPluginManager} from "../../../interfaces/IPluginManager.sol"; +import {IStandardExecutor} from "../../../interfaces/IStandardExecutor.sol"; +import {BasePlugin} from "../../BasePlugin.sol"; + +import {ISingleOwnerPlugin} from "./ISingleOwnerPlugin.sol"; +import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; +import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; +import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol"; +import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; + +import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; +import {SignatureChecker} from "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol"; /** * @dev Single owner plugin which is forked from OZ's Ownable. This plugin allows MSCA to be owned by an EOA or another diff --git a/src/msca/6900/v0.7/plugins/v1_0_0/addressbook/AddressBookPlugin.sol b/src/msca/6900/v0.7/plugins/v1_0_0/addressbook/AddressBookPlugin.sol index a2ad256..5911ed8 100644 --- a/src/msca/6900/v0.7/plugins/v1_0_0/addressbook/AddressBookPlugin.sol +++ b/src/msca/6900/v0.7/plugins/v1_0_0/addressbook/AddressBookPlugin.sol @@ -18,27 +18,28 @@ */ pragma solidity 0.8.24; -import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; -import {ReentrancyGuard} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; -import {IStandardExecutor} from "../../../interfaces/IStandardExecutor.sol"; +import { + PLUGIN_AUTHOR, + PLUGIN_VERSION_1, + SIG_VALIDATION_FAILED, + SIG_VALIDATION_SUCCEEDED +} from "../../../../../../common/Constants.sol"; +import {CastLib} from "../../../../../../libs/CastLib.sol"; +import {InvalidLength, Unsupported} from "../../../../shared/common/Errors.sol"; +import "../../../common/PluginManifest.sol"; +import "../../../common/Structs.sol"; +import {IPlugin} from "../../../interfaces/IPlugin.sol"; import {IPluginExecutor} from "../../../interfaces/IPluginExecutor.sol"; +import {IStandardExecutor} from "../../../interfaces/IStandardExecutor.sol"; import {BasePlugin} from "../../BasePlugin.sol"; import {IAddressBookPlugin} from "./IAddressBookPlugin.sol"; -import {IPlugin} from "../../../interfaces/IPlugin.sol"; +import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; + import { AssociatedLinkedListSet, AssociatedLinkedListSetLib } from "@modular-account-libs/libraries/AssociatedLinkedListSetLib.sol"; -import {CastLib} from "../../../../../../libs/CastLib.sol"; -import {Unsupported, InvalidLength} from "../../../../shared/common/Errors.sol"; -import "../../../common/Structs.sol"; -import "../../../common/PluginManifest.sol"; -import { - SIG_VALIDATION_FAILED, - SIG_VALIDATION_SUCCEEDED, - PLUGIN_VERSION_1, - PLUGIN_AUTHOR -} from "../../../../../../common/Constants.sol"; +import {ReentrancyGuard} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; /** * @dev Implementation for IAddressBookPlugin. AddressBookPlugin would require the owner validation provided by native diff --git a/src/msca/6900/v0.7/plugins/v1_0_0/addressbook/ColdStorageAddressBookPlugin.sol b/src/msca/6900/v0.7/plugins/v1_0_0/addressbook/ColdStorageAddressBookPlugin.sol index 46dd24e..e02bc8e 100644 --- a/src/msca/6900/v0.7/plugins/v1_0_0/addressbook/ColdStorageAddressBookPlugin.sol +++ b/src/msca/6900/v0.7/plugins/v1_0_0/addressbook/ColdStorageAddressBookPlugin.sol @@ -18,33 +18,34 @@ */ pragma solidity 0.8.24; -import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; -import {IStandardExecutor} from "../../../interfaces/IStandardExecutor.sol"; -import {BasePlugin} from "../../BasePlugin.sol"; -import {IAddressBookPlugin} from "./IAddressBookPlugin.sol"; -import {IPlugin} from "../../../interfaces/IPlugin.sol"; -import {RecipientAddressLib} from "../../../../../../libs/RecipientAddressLib.sol"; import { - AssociatedLinkedListSet, - AssociatedLinkedListSetLib -} from "@modular-account-libs/libraries/AssociatedLinkedListSetLib.sol"; + PLUGIN_AUTHOR, + PLUGIN_VERSION_1, + SIG_VALIDATION_FAILED, + SIG_VALIDATION_SUCCEEDED +} from "../../../../../../common/Constants.sol"; import {CastLib} from "../../../../../../libs/CastLib.sol"; +import {RecipientAddressLib} from "../../../../../../libs/RecipientAddressLib.sol"; import {Unsupported} from "../../../../shared/common/Errors.sol"; -import {Call} from "../../../common/Structs.sol"; import { - PluginManifest, - PluginMetadata, ManifestAssociatedFunction, ManifestAssociatedFunctionType, ManifestFunction, + PluginManifest, + PluginMetadata, SelectorPermission } from "../../../common/PluginManifest.sol"; +import {Call} from "../../../common/Structs.sol"; +import {IPlugin} from "../../../interfaces/IPlugin.sol"; +import {IStandardExecutor} from "../../../interfaces/IStandardExecutor.sol"; +import {BasePlugin} from "../../BasePlugin.sol"; +import {IAddressBookPlugin} from "./IAddressBookPlugin.sol"; +import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; + import { - SIG_VALIDATION_FAILED, - SIG_VALIDATION_SUCCEEDED, - PLUGIN_VERSION_1, - PLUGIN_AUTHOR -} from "../../../../../../common/Constants.sol"; + AssociatedLinkedListSet, + AssociatedLinkedListSetLib +} from "@modular-account-libs/libraries/AssociatedLinkedListSetLib.sol"; /** * @dev This plugin serves as an enhanced version of the AddressBookPlugin, incorporating additional limitations on diff --git a/src/msca/6900/v0.7/plugins/v1_0_0/multisig/BaseMultisigPlugin.sol b/src/msca/6900/v0.7/plugins/v1_0_0/multisig/BaseMultisigPlugin.sol index 727de21..26ab094 100644 --- a/src/msca/6900/v0.7/plugins/v1_0_0/multisig/BaseMultisigPlugin.sol +++ b/src/msca/6900/v0.7/plugins/v1_0_0/multisig/BaseMultisigPlugin.sol @@ -19,23 +19,25 @@ pragma solidity 0.8.24; -import {BasePlugin} from "../../BasePlugin.sol"; -import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; -import { - AssociatedLinkedListSet, - AssociatedLinkedListSetLib -} from "@modular-account-libs/libraries/AssociatedLinkedListSetLib.sol"; import { + EMPTY_HASH, SIG_VALIDATION_FAILED, SIG_VALIDATION_SUCCEEDED, - EMPTY_HASH, ZERO, ZERO_BYTES32 } from "../../../../../../common/Constants.sol"; -import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; + import {CastLib} from "../../../../../../libs/CastLib.sol"; -import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; + import {NotImplemented} from "../../../../shared/common/Errors.sol"; +import {BasePlugin} from "../../BasePlugin.sol"; +import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; +import { + AssociatedLinkedListSet, + AssociatedLinkedListSetLib +} from "@modular-account-libs/libraries/AssociatedLinkedListSetLib.sol"; +import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; +import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; /// @title Base Multisig Plugin /// @author Circle diff --git a/src/msca/6900/v0.7/plugins/v1_0_0/multisig/BaseWeightedMultisigPlugin.sol b/src/msca/6900/v0.7/plugins/v1_0_0/multisig/BaseWeightedMultisigPlugin.sol index 7b6b95c..5d25744 100644 --- a/src/msca/6900/v0.7/plugins/v1_0_0/multisig/BaseWeightedMultisigPlugin.sol +++ b/src/msca/6900/v0.7/plugins/v1_0_0/multisig/BaseWeightedMultisigPlugin.sol @@ -19,21 +19,23 @@ pragma solidity 0.8.24; -import {IWeightedMultisigPlugin} from "./IWeightedMultisigPlugin.sol"; -import {IERC712CompliantPlugin} from "./IERC712CompliantPlugin.sol"; -import {BaseMultisigPlugin} from "./BaseMultisigPlugin.sol"; +import {CredentialType, OwnerData, PublicKey} from "../../../../../../common/CommonStructs.sol"; + +import {AddressBytesLib} from "../../../../../../libs/AddressBytesLib.sol"; +import {PublicKeyLib} from "../../../../../../libs/PublicKeyLib.sol"; +import {SetValueLib} from "../../../../../../libs/SetValueLib.sol"; +import {NotImplemented} from "../../../../shared/common/Errors.sol"; import {BasePlugin} from "../../BasePlugin.sol"; -import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol"; +import {BaseMultisigPlugin} from "./BaseMultisigPlugin.sol"; +import {IERC712CompliantPlugin} from "./IERC712CompliantPlugin.sol"; +import {IWeightedMultisigPlugin} from "./IWeightedMultisigPlugin.sol"; + import { AssociatedLinkedListSet, AssociatedLinkedListSetLib } from "@modular-account-libs/libraries/AssociatedLinkedListSetLib.sol"; import {SetValue} from "@modular-account-libs/libraries/Constants.sol"; -import {NotImplemented} from "../../../../shared/common/Errors.sol"; -import {PublicKey, OwnerData, CredentialType} from "../../../../../../common/CommonStructs.sol"; -import {PublicKeyLib} from "../../../../../../libs/PublicKeyLib.sol"; -import {SetValueLib} from "../../../../../../libs/SetValueLib.sol"; -import {AddressBytesLib} from "../../../../../../libs/AddressBytesLib.sol"; +import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol"; /// @title Base Weighted Multisig Plugin /// @author Circle diff --git a/src/msca/6900/v0.7/plugins/v1_0_0/multisig/IWeightedMultisigPlugin.sol b/src/msca/6900/v0.7/plugins/v1_0_0/multisig/IWeightedMultisigPlugin.sol index a5be42c..84c2bd0 100644 --- a/src/msca/6900/v0.7/plugins/v1_0_0/multisig/IWeightedMultisigPlugin.sol +++ b/src/msca/6900/v0.7/plugins/v1_0_0/multisig/IWeightedMultisigPlugin.sol @@ -18,8 +18,8 @@ */ pragma solidity 0.8.24; +import {OwnerData, PublicKey} from "../../../../../../common/CommonStructs.sol"; import {IERC712CompliantPlugin} from "./IERC712CompliantPlugin.sol"; -import {PublicKey, OwnerData} from "../../../../../../common/CommonStructs.sol"; /// @title Weighted Multisig Plugin Interface /// @author Circle diff --git a/src/msca/6900/v0.7/plugins/v1_0_0/multisig/WeightedWebauthnMultisigPlugin.sol b/src/msca/6900/v0.7/plugins/v1_0_0/multisig/WeightedWebauthnMultisigPlugin.sol index f3c5c43..fb3ba55 100644 --- a/src/msca/6900/v0.7/plugins/v1_0_0/multisig/WeightedWebauthnMultisigPlugin.sol +++ b/src/msca/6900/v0.7/plugins/v1_0_0/multisig/WeightedWebauthnMultisigPlugin.sol @@ -19,39 +19,40 @@ pragma solidity 0.8.24; -import {IWeightedMultisigPlugin} from "./IWeightedMultisigPlugin.sol"; -import {IERC712CompliantPlugin} from "./IERC712CompliantPlugin.sol"; -import {BaseWeightedMultisigPlugin} from "./BaseWeightedMultisigPlugin.sol"; import { + EIP1271_INVALID_SIGNATURE, + EIP1271_VALID_SIGNATURE, + PLUGIN_AUTHOR, + PLUGIN_VERSION_1 +} from "../../../../../../common/Constants.sol"; +import {BaseMSCA} from "../../../account/BaseMSCA.sol"; +import { + ManifestAssociatedFunction, + ManifestAssociatedFunctionType, + ManifestFunction, PluginManifest, PluginMetadata, - SelectorPermission, - ManifestFunction, - ManifestAssociatedFunction, - ManifestAssociatedFunctionType + SelectorPermission } from "../../../common/PluginManifest.sol"; -import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol"; -import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; +import {BaseWeightedMultisigPlugin} from "./BaseWeightedMultisigPlugin.sol"; +import {IERC712CompliantPlugin} from "./IERC712CompliantPlugin.sol"; +import {IWeightedMultisigPlugin} from "./IWeightedMultisigPlugin.sol"; + import { AssociatedLinkedListSet, AssociatedLinkedListSetLib } from "@modular-account-libs/libraries/AssociatedLinkedListSetLib.sol"; import {SetValue} from "@modular-account-libs/libraries/Constants.sol"; -import {BaseMSCA} from "../../../account/BaseMSCA.sol"; import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; -import { - EIP1271_VALID_SIGNATURE, - EIP1271_INVALID_SIGNATURE, - PLUGIN_AUTHOR, - PLUGIN_VERSION_1 -} from "../../../../../../common/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 {IStandardExecutor} from "../../../interfaces/IStandardExecutor.sol"; +import {OwnerData, PublicKey, WebAuthnSigDynamicPart} from "../../../../../../common/CommonStructs.sol"; +import {AddressBytesLib} from "../../../../../../libs/AddressBytesLib.sol"; import {PublicKeyLib} from "../../../../../../libs/PublicKeyLib.sol"; import {WebAuthnLib} from "../../../../../../libs/WebAuthnLib.sol"; -import {AddressBytesLib} from "../../../../../../libs/AddressBytesLib.sol"; -import {PublicKey, WebAuthnSigDynamicPart, OwnerData} from "../../../../../../common/CommonStructs.sol"; +import {IStandardExecutor} from "../../../interfaces/IStandardExecutor.sol"; +import {SignatureChecker} from "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol"; /// @title Weighted Multisig Plugin That Supports Additional Webauthn Authentication /// @author Circle diff --git a/src/msca/6900/v0.7/plugins/v1_0_0/utility/DefaultTokenCallbackPlugin.sol b/src/msca/6900/v0.7/plugins/v1_0_0/utility/DefaultTokenCallbackPlugin.sol index 05a34e8..6cefb43 100644 --- a/src/msca/6900/v0.7/plugins/v1_0_0/utility/DefaultTokenCallbackPlugin.sol +++ b/src/msca/6900/v0.7/plugins/v1_0_0/utility/DefaultTokenCallbackPlugin.sol @@ -18,18 +18,18 @@ */ pragma solidity 0.8.24; -import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; -import {IERC777Recipient} from "@openzeppelin/contracts/interfaces/IERC777Recipient.sol"; -import {IERC1155Receiver} from "@openzeppelin/contracts/interfaces/IERC1155Receiver.sol"; -import {BasePlugin} from "../../BasePlugin.sol"; +import {PLUGIN_AUTHOR, PLUGIN_VERSION_1} from "../../../../../../common/Constants.sol"; import { - PluginManifest, - PluginMetadata, - ManifestFunction, ManifestAssociatedFunction, - ManifestAssociatedFunctionType + ManifestAssociatedFunctionType, + ManifestFunction, + PluginManifest, + PluginMetadata } from "../../../common/PluginManifest.sol"; -import {PLUGIN_VERSION_1, PLUGIN_AUTHOR} from "../../../../../../common/Constants.sol"; +import {BasePlugin} from "../../BasePlugin.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"; /** * @dev Default token callback handler plugin. Similar to DefaultCallbackHandler. diff --git a/src/msca/6900/v0.8/account/BaseMSCA.sol b/src/msca/6900/v0.8/account/BaseMSCA.sol index d8fa658..ba34ed6 100644 --- a/src/msca/6900/v0.8/account/BaseMSCA.sol +++ b/src/msca/6900/v0.8/account/BaseMSCA.sol @@ -18,55 +18,59 @@ */ pragma solidity 0.8.24; -import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; -import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; -import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; -import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol"; +import { + EIP1271_INVALID_SIGNATURE, + EIP1271_VALID_SIGNATURE, + EMPTY_MODULE_ENTITY, + WALLET_AUTHOR, + WALLET_VERSION_1 +} from "../../../../common/Constants.sol"; import {ExecutionUtils} from "../../../../utils/ExecutionUtils.sol"; -import {IAccountLoupe} from "../interfaces/IAccountLoupe.sol"; -import {IPluginManager} from "../interfaces/IPluginManager.sol"; -import {IStandardExecutor} from "../interfaces/IStandardExecutor.sol"; -import {PluginManager} from "../managers/PluginManager.sol"; -import {StandardExecutor} from "../managers/StandardExecutor.sol"; -import {WalletStorageLib} from "../libs/WalletStorageLib.sol"; -import {ExecutionHookLib} from "../libs/ExecutionHookLib.sol"; -import {WalletStorageInitializable} from "./WalletStorageInitializable.sol"; -import {Bytes32DLLLib} from "../../shared/libs/Bytes32DLLLib.sol"; -import {ModuleEntityLib} from "../libs/thirdparty/ModuleEntityLib.sol"; -import {AddressDLLLib} from "../../shared/libs/AddressDLLLib.sol"; -import {ValidationDataLib} from "../../shared/libs/ValidationDataLib.sol"; -import {SelectorRegistryLib} from "../libs/SelectorRegistryLib.sol"; import { + InvalidAuthorizer, InvalidExecutionFunction, - UnauthorizedCaller, NotFoundSelector, - InvalidAuthorizer + UnauthorizedCaller } from "../../shared/common/Errors.sol"; +import {AddressDLL, Bytes32DLL, Bytes4DLL, ValidationData} from "../../shared/common/Structs.sol"; +import {AddressDLLLib} from "../../shared/libs/AddressDLLLib.sol"; +import {Bytes32DLLLib} from "../../shared/libs/Bytes32DLLLib.sol"; + +import {Bytes32DLLLib} from "../../shared/libs/Bytes32DLLLib.sol"; + +import {Bytes4DLLLib} from "../../shared/libs/Bytes4DLLLib.sol"; +import {ValidationDataLib} from "../../shared/libs/ValidationDataLib.sol"; +import {GLOBAL_VALIDATION_FLAG, RESERVED_VALIDATION_DATA_INDEX} from "../common/Constants.sol"; import { Bytes32DLL, - ExecutionDetail, - PostExecHookToRun, Call, + ExecutionDetail, ExecutionHook, + PostExecHookToRun, ValidationDetail } from "../common/Structs.sol"; -import { - WALLET_AUTHOR, - WALLET_VERSION_1, - EMPTY_MODULE_ENTITY, - EIP1271_INVALID_SIGNATURE, - EIP1271_VALID_SIGNATURE -} from "../../../../common/Constants.sol"; -import {ValidationData, AddressDLL, Bytes32DLL, Bytes4DLL} from "../../shared/common/Structs.sol"; + +import {ModuleEntity, ValidationConfig} from "../common/Types.sol"; +import {IAccountExecute} from "../interfaces/IAccountExecute.sol"; +import {IAccountLoupe} from "../interfaces/IAccountLoupe.sol"; +import {IPluginManager} from "../interfaces/IPluginManager.sol"; +import {IStandardExecutor} from "../interfaces/IStandardExecutor.sol"; import {IValidation} from "../interfaces/IValidation.sol"; import {IValidationHook} from "../interfaces/IValidationHook.sol"; -import {GLOBAL_VALIDATION_FLAG, RESERVED_VALIDATION_DATA_INDEX} from "../common/Constants.sol"; -import {SparseCalldataSegmentLib} from "../libs/thirdparty/SparseCalldataSegmentLib.sol"; -import {Bytes32DLLLib} from "../../shared/libs/Bytes32DLLLib.sol"; -import {IAccountExecute} from "../interfaces/IAccountExecute.sol"; -import {Bytes4DLLLib} from "../../shared/libs/Bytes4DLLLib.sol"; -import {ValidationConfig, ModuleEntity} from "../common/Types.sol"; +import {ExecutionHookLib} from "../libs/ExecutionHookLib.sol"; +import {SelectorRegistryLib} from "../libs/SelectorRegistryLib.sol"; +import {WalletStorageLib} from "../libs/WalletStorageLib.sol"; +import {ModuleEntityLib} from "../libs/thirdparty/ModuleEntityLib.sol"; + import {ModuleEntityLib} from "../libs/thirdparty/ModuleEntityLib.sol"; +import {SparseCalldataSegmentLib} from "../libs/thirdparty/SparseCalldataSegmentLib.sol"; +import {PluginManager} from "../managers/PluginManager.sol"; +import {StandardExecutor} from "../managers/StandardExecutor.sol"; +import {WalletStorageInitializable} from "./WalletStorageInitializable.sol"; +import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; +import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; +import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol"; +import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; /** * @dev Base MSCA implementation with **authentication**. diff --git a/src/msca/6900/v0.8/account/UpgradableMSCA.sol b/src/msca/6900/v0.8/account/UpgradableMSCA.sol index 018ec3f..9503a48 100644 --- a/src/msca/6900/v0.8/account/UpgradableMSCA.sol +++ b/src/msca/6900/v0.8/account/UpgradableMSCA.sol @@ -18,17 +18,19 @@ */ pragma solidity 0.8.24; -import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; -import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; -import {BaseMSCA} from "./BaseMSCA.sol"; +import {DefaultCallbackHandler} from "../../../../callback/DefaultCallbackHandler.sol"; import {ExecutionUtils} from "../../../../utils/ExecutionUtils.sol"; -import {PluginManager} from "../managers/PluginManager.sol"; import {InvalidInitializationInput} from "../../shared/common/Errors.sol"; -import {DefaultCallbackHandler} from "../../../../callback/DefaultCallbackHandler.sol"; -import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; -import {IERC1155Receiver} from "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol"; -import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol"; + import {ValidationConfig} from "../common/Types.sol"; +import {PluginManager} from "../managers/PluginManager.sol"; +import {BaseMSCA} from "./BaseMSCA.sol"; +import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; +import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; + +import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol"; +import {IERC1155Receiver} from "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol"; +import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; /** * @dev Leverage {ERC1967Proxy} brought by UUPS proxies, when this contract is set as the implementation behind such a diff --git a/src/msca/6900/v0.8/factories/UpgradableMSCAFactory.sol b/src/msca/6900/v0.8/factories/UpgradableMSCAFactory.sol index d51cc76..e418bfc 100644 --- a/src/msca/6900/v0.8/factories/UpgradableMSCAFactory.sol +++ b/src/msca/6900/v0.8/factories/UpgradableMSCAFactory.sol @@ -18,14 +18,14 @@ */ pragma solidity 0.8.24; -import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; -import {Create2} from "@openzeppelin/contracts/utils/Create2.sol"; -import {Ownable2Step} from "@openzeppelin/contracts/access/Ownable2Step.sol"; -import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; -import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; +import {Create2FailedDeployment, InvalidInitializationInput, InvalidLength} from "../../shared/common/Errors.sol"; import {UpgradableMSCA} from "../account/UpgradableMSCA.sol"; import {PluginManager} from "../managers/PluginManager.sol"; -import {Create2FailedDeployment, InvalidInitializationInput, InvalidLength} from "../../shared/common/Errors.sol"; +import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; +import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; +import {Ownable2Step} from "@openzeppelin/contracts/access/Ownable2Step.sol"; +import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; +import {Create2} from "@openzeppelin/contracts/utils/Create2.sol"; /** * @dev Account factory that creates the upgradeable MSCA with a set of plugins to be installed. diff --git a/src/msca/6900/v0.8/interfaces/IPlugin.sol b/src/msca/6900/v0.8/interfaces/IPlugin.sol index 4c4c0e2..26536ec 100644 --- a/src/msca/6900/v0.8/interfaces/IPlugin.sol +++ b/src/msca/6900/v0.8/interfaces/IPlugin.sol @@ -18,8 +18,8 @@ */ pragma solidity 0.8.24; -import {IERC165} from "@openzeppelin/contracts/interfaces/IERC165.sol"; import {PluginManifest, PluginMetadata} from "../common/PluginManifest.sol"; +import {IERC165} from "@openzeppelin/contracts/interfaces/IERC165.sol"; /** * @dev Implements https://eips.ethereum.org/EIPS/eip-6900. Plugins must implement this interface to support plugin diff --git a/src/msca/6900/v0.8/interfaces/IPluginManager.sol b/src/msca/6900/v0.8/interfaces/IPluginManager.sol index 92c5cbd..f880088 100644 --- a/src/msca/6900/v0.8/interfaces/IPluginManager.sol +++ b/src/msca/6900/v0.8/interfaces/IPluginManager.sol @@ -18,7 +18,7 @@ */ pragma solidity 0.8.24; -import {ValidationConfig, ModuleEntity} from "../common/Types.sol"; +import {ModuleEntity, ValidationConfig} from "../common/Types.sol"; /** * @dev Implements https://eips.ethereum.org/EIPS/eip-6900. MSCAs must implement this interface to support installing diff --git a/src/msca/6900/v0.8/interfaces/IValidation.sol b/src/msca/6900/v0.8/interfaces/IValidation.sol index 98de1ce..d3a3a0d 100644 --- a/src/msca/6900/v0.8/interfaces/IValidation.sol +++ b/src/msca/6900/v0.8/interfaces/IValidation.sol @@ -18,8 +18,8 @@ */ pragma solidity 0.8.24; -import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; import {IPlugin} from "./IPlugin.sol"; +import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; /** * @dev Implements https://eips.ethereum.org/EIPS/eip-6900. Plugins must implement this interface to support plugin diff --git a/src/msca/6900/v0.8/interfaces/IValidationHook.sol b/src/msca/6900/v0.8/interfaces/IValidationHook.sol index e3439b3..b6ee4cd 100644 --- a/src/msca/6900/v0.8/interfaces/IValidationHook.sol +++ b/src/msca/6900/v0.8/interfaces/IValidationHook.sol @@ -18,8 +18,8 @@ */ pragma solidity 0.8.24; -import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; import {IPlugin} from "./IPlugin.sol"; +import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; /** * @dev Implements https://eips.ethereum.org/EIPS/eip-6900. Plugins must implement this interface to support plugin diff --git a/src/msca/6900/v0.8/libs/ExecutionHookLib.sol b/src/msca/6900/v0.8/libs/ExecutionHookLib.sol index ac6df92..cc75202 100644 --- a/src/msca/6900/v0.8/libs/ExecutionHookLib.sol +++ b/src/msca/6900/v0.8/libs/ExecutionHookLib.sol @@ -18,13 +18,14 @@ */ pragma solidity 0.8.24; -import {IExecutionHook} from "../interfaces/IExecutionHook.sol"; -import {ModuleEntityLib} from "./thirdparty/ModuleEntityLib.sol"; -import {PostExecHookToRun, ExecutionHook} from "../common/Structs.sol"; -import {SENTINEL_BYTES32, EMPTY_MODULE_ENTITY} from "../../../../common/Constants.sol"; +import {EMPTY_MODULE_ENTITY, SENTINEL_BYTES32} from "../../../../common/Constants.sol"; import {Bytes32DLL} from "../../shared/common/Structs.sol"; -import {ModuleEntity} from "../common/Types.sol"; + import {Bytes32DLLLib} from "../../shared/libs/Bytes32DLLLib.sol"; +import {ExecutionHook, PostExecHookToRun} from "../common/Structs.sol"; +import {ModuleEntity} from "../common/Types.sol"; +import {IExecutionHook} from "../interfaces/IExecutionHook.sol"; +import {ModuleEntityLib} from "./thirdparty/ModuleEntityLib.sol"; /** * @dev Process pre or post execution hooks. diff --git a/src/msca/6900/v0.8/libs/SelectorRegistryLib.sol b/src/msca/6900/v0.8/libs/SelectorRegistryLib.sol index 57f4cd0..d7c576a 100644 --- a/src/msca/6900/v0.8/libs/SelectorRegistryLib.sol +++ b/src/msca/6900/v0.8/libs/SelectorRegistryLib.sol @@ -18,20 +18,23 @@ */ pragma solidity 0.8.24; -import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; -import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; -import {IPaymaster} from "@account-abstraction/contracts/interfaces/IPaymaster.sol"; -import {IAggregator} from "@account-abstraction/contracts/interfaces/IAggregator.sol"; import {IAccountLoupe} from "../interfaces/IAccountLoupe.sol"; -import {IPluginManager} from "../interfaces/IPluginManager.sol"; -import {IPlugin} from "../interfaces/IPlugin.sol"; -import {IValidationHook} from "../interfaces/IValidationHook.sol"; -import {IValidation} from "../interfaces/IValidation.sol"; + import {IExecutionHook} from "../interfaces/IExecutionHook.sol"; +import {IPlugin} from "../interfaces/IPlugin.sol"; +import {IPluginManager} from "../interfaces/IPluginManager.sol"; + import {IStandardExecutor} from "../interfaces/IStandardExecutor.sol"; -import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; -import {IERC1155Receiver} from "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol"; +import {IValidation} from "../interfaces/IValidation.sol"; +import {IValidationHook} from "../interfaces/IValidationHook.sol"; +import {IAggregator} from "@account-abstraction/contracts/interfaces/IAggregator.sol"; +import {IPaymaster} from "@account-abstraction/contracts/interfaces/IPaymaster.sol"; +import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; + import {IERC777Recipient} from "@openzeppelin/contracts/interfaces/IERC777Recipient.sol"; +import {IERC1155Receiver} from "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol"; +import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; +import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; library SelectorRegistryLib { bytes4 internal constant INITIALIZE_UPGRADABLE_MSCA = diff --git a/src/msca/6900/v0.8/libs/WalletStorageLib.sol b/src/msca/6900/v0.8/libs/WalletStorageLib.sol index 5f91959..7b11247 100644 --- a/src/msca/6900/v0.8/libs/WalletStorageLib.sol +++ b/src/msca/6900/v0.8/libs/WalletStorageLib.sol @@ -18,8 +18,8 @@ */ pragma solidity 0.8.24; -import {ExecutionDetail, ValidationDetail} from "../common/Structs.sol"; import {AddressDLL} from "../../shared/common/Structs.sol"; +import {ExecutionDetail, ValidationDetail} from "../common/Structs.sol"; import {ModuleEntity} from "../common/Types.sol"; /// @dev The same storage will be used for ERC6900 v0.8 MSCAs. diff --git a/src/msca/6900/v0.8/libs/thirdparty/ValidationConfigLib.sol b/src/msca/6900/v0.8/libs/thirdparty/ValidationConfigLib.sol index 69878a5..0dfb93d 100644 --- a/src/msca/6900/v0.8/libs/thirdparty/ValidationConfigLib.sol +++ b/src/msca/6900/v0.8/libs/thirdparty/ValidationConfigLib.sol @@ -18,7 +18,7 @@ */ pragma solidity 0.8.24; -import {ValidationConfig, ModuleEntity} from "../../common/Types.sol"; +import {ModuleEntity, ValidationConfig} from "../../common/Types.sol"; // Validation config is a packed representation of a validation function and flags for its configuration. // Layout: diff --git a/src/msca/6900/v0.8/managers/PluginManager.sol b/src/msca/6900/v0.8/managers/PluginManager.sol index 3846c39..a474519 100644 --- a/src/msca/6900/v0.8/managers/PluginManager.sol +++ b/src/msca/6900/v0.8/managers/PluginManager.sol @@ -18,24 +18,29 @@ */ pragma solidity 0.8.24; -import {ERC165Checker} from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; -import {IPlugin} from "../interfaces/IPlugin.sol"; -import {WalletStorageLib} from "../libs/WalletStorageLib.sol"; -import {AddressDLLLib} from "../../shared/libs/AddressDLLLib.sol"; -import {Bytes32DLLLib} from "../../shared/libs/Bytes32DLLLib.sol"; -import {ModuleEntityLib} from "../libs/thirdparty/ModuleEntityLib.sol"; -import {SelectorRegistryLib} from "../libs/SelectorRegistryLib.sol"; -import {PluginManifest, ManifestValidation, ManifestExecutionFunction} from "../common/PluginManifest.sol"; import {SENTINEL_BYTES32, SENTINEL_BYTES4} from "../../../../common/Constants.sol"; import {AddressDLL} from "../../shared/common/Structs.sol"; -import {ExecutionHook, ValidationDetail} from "../common/Structs.sol"; + import {Bytes32DLL, Bytes4DLL} from "../../shared/common/Structs.sol"; -import {RESERVED_VALIDATION_DATA_INDEX} from "../common/Constants.sol"; +import {AddressDLLLib} from "../../shared/libs/AddressDLLLib.sol"; +import {Bytes32DLLLib} from "../../shared/libs/Bytes32DLLLib.sol"; + import {Bytes4DLLLib} from "../../shared/libs/Bytes4DLLLib.sol"; -import {ValidationConfigLib} from "../libs/thirdparty/ValidationConfigLib.sol"; -import {ValidationConfig, ModuleEntity} from "../common/Types.sol"; -import {ModuleEntityLib} from "../libs/thirdparty/ModuleEntityLib.sol"; +import {RESERVED_VALIDATION_DATA_INDEX} from "../common/Constants.sol"; +import {ManifestExecutionFunction, ManifestValidation, PluginManifest} from "../common/PluginManifest.sol"; +import {ExecutionHook, ValidationDetail} from "../common/Structs.sol"; + +import {ModuleEntity, ValidationConfig} from "../common/Types.sol"; +import {IPlugin} from "../interfaces/IPlugin.sol"; + import {ExecutionHookLib} from "../libs/ExecutionHookLib.sol"; +import {SelectorRegistryLib} from "../libs/SelectorRegistryLib.sol"; +import {WalletStorageLib} from "../libs/WalletStorageLib.sol"; +import {ModuleEntityLib} from "../libs/thirdparty/ModuleEntityLib.sol"; + +import {ModuleEntityLib} from "../libs/thirdparty/ModuleEntityLib.sol"; +import {ValidationConfigLib} from "../libs/thirdparty/ValidationConfigLib.sol"; +import {ERC165Checker} from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; /** * @dev Default implementation of https://eips.ethereum.org/EIPS/eip-6900. MSCAs must implement this interface to diff --git a/src/msca/6900/v0.8/plugins/BasePlugin.sol b/src/msca/6900/v0.8/plugins/BasePlugin.sol index e5ad943..6450db3 100644 --- a/src/msca/6900/v0.8/plugins/BasePlugin.sol +++ b/src/msca/6900/v0.8/plugins/BasePlugin.sol @@ -18,9 +18,9 @@ */ pragma solidity 0.8.24; +import {IPlugin} from "../interfaces/IPlugin.sol"; import {IERC165} from "@openzeppelin/contracts/interfaces/IERC165.sol"; import {ERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol"; -import {IPlugin} from "../interfaces/IPlugin.sol"; /** * @dev Default implementation of https://eips.ethereum.org/EIPS/eip-6900. MSCAs must implement this interface to diff --git a/src/msca/6900/v0.8/plugins/thirdparty/erc712/BaseERC712CompliantModule.sol b/src/msca/6900/v0.8/plugins/thirdparty/erc712/BaseERC712CompliantModule.sol index 3879bb9..f787a20 100644 --- a/src/msca/6900/v0.8/plugins/thirdparty/erc712/BaseERC712CompliantModule.sol +++ b/src/msca/6900/v0.8/plugins/thirdparty/erc712/BaseERC712CompliantModule.sol @@ -18,8 +18,8 @@ */ pragma solidity 0.8.24; -import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; import {IERC712Compliant} from "../../../../shared/erc712/IERC712Compliant.sol"; +import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; // @notice Forked from 6900 reference implementation with some modifications. // A base contract for modules that use EIP-712 structured data signing. diff --git a/src/msca/6900/v0.8/plugins/v1_0_0/addressbook/ColdStorageAddressBookPlugin.sol b/src/msca/6900/v0.8/plugins/v1_0_0/addressbook/ColdStorageAddressBookPlugin.sol index 08a0874..d53091a 100644 --- a/src/msca/6900/v0.8/plugins/v1_0_0/addressbook/ColdStorageAddressBookPlugin.sol +++ b/src/msca/6900/v0.8/plugins/v1_0_0/addressbook/ColdStorageAddressBookPlugin.sol @@ -18,32 +18,33 @@ */ pragma solidity 0.8.24; -import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; -import {IERC165} from "@openzeppelin/contracts/interfaces/IERC165.sol"; -import {BasePlugin} from "../../BasePlugin.sol"; -import {IAddressBookPlugin} from "./IAddressBookPlugin.sol"; -import {IPlugin} from "../../../interfaces/IPlugin.sol"; -import {IValidationHook} from "../../../interfaces/IValidationHook.sol"; -import {RecipientAddressLib} from "../../../../../../libs/RecipientAddressLib.sol"; import { - AssociatedLinkedListSet, - AssociatedLinkedListSetLib -} from "@modular-account-libs/libraries/AssociatedLinkedListSetLib.sol"; + PLUGIN_AUTHOR, + PLUGIN_VERSION_1, + SIG_VALIDATION_FAILED, + SIG_VALIDATION_SUCCEEDED +} from "../../../../../../common/Constants.sol"; import {CastLib} from "../../../../../../libs/CastLib.sol"; +import {RecipientAddressLib} from "../../../../../../libs/RecipientAddressLib.sol"; import {Unsupported} from "../../../../shared/common/Errors.sol"; -import {Call} from "../../../common/Structs.sol"; import { + ManifestExecutionFunction, PluginManifest, PluginMetadata, - SelectorPermission, - ManifestExecutionFunction + SelectorPermission } from "../../../common/PluginManifest.sol"; +import {Call} from "../../../common/Structs.sol"; +import {IPlugin} from "../../../interfaces/IPlugin.sol"; +import {IValidationHook} from "../../../interfaces/IValidationHook.sol"; +import {BasePlugin} from "../../BasePlugin.sol"; +import {IAddressBookPlugin} from "./IAddressBookPlugin.sol"; +import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; + import { - SIG_VALIDATION_FAILED, - SIG_VALIDATION_SUCCEEDED, - PLUGIN_VERSION_1, - PLUGIN_AUTHOR -} from "../../../../../../common/Constants.sol"; + AssociatedLinkedListSet, + AssociatedLinkedListSetLib +} from "@modular-account-libs/libraries/AssociatedLinkedListSetLib.sol"; +import {IERC165} from "@openzeppelin/contracts/interfaces/IERC165.sol"; /** * @dev This plugin serves as an enhanced version of the AddressBookPlugin, incorporating additional limitations on diff --git a/src/msca/6900/v0.8/plugins/v1_0_0/multisig/BaseMultisigPlugin.sol b/src/msca/6900/v0.8/plugins/v1_0_0/multisig/BaseMultisigPlugin.sol index b189da9..ff89d26 100644 --- a/src/msca/6900/v0.8/plugins/v1_0_0/multisig/BaseMultisigPlugin.sol +++ b/src/msca/6900/v0.8/plugins/v1_0_0/multisig/BaseMultisigPlugin.sol @@ -19,23 +19,24 @@ pragma solidity 0.8.24; -import {BasePlugin} from "../../BasePlugin.sol"; -import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; -import { - AssociatedLinkedListSet, - AssociatedLinkedListSetLib -} from "@modular-account-libs/libraries/AssociatedLinkedListSetLib.sol"; import { + EMPTY_HASH, SIG_VALIDATION_FAILED, SIG_VALIDATION_SUCCEEDED, - EMPTY_HASH, ZERO, ZERO_BYTES32 } from "../../../../../../common/Constants.sol"; -import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; -import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; + import {NotImplementedFunction} from "../../../../shared/common/Errors.sol"; import {IValidation} from "../../../interfaces/IValidation.sol"; +import {BasePlugin} from "../../BasePlugin.sol"; +import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; +import { + AssociatedLinkedListSet, + AssociatedLinkedListSetLib +} from "@modular-account-libs/libraries/AssociatedLinkedListSetLib.sol"; +import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; +import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; /// @title Base Multisig Plugin /// @author Circle diff --git a/src/msca/6900/v0.8/plugins/v1_0_0/multisig/BaseWeightedMultisigPlugin.sol b/src/msca/6900/v0.8/plugins/v1_0_0/multisig/BaseWeightedMultisigPlugin.sol index f273c38..545a53d 100644 --- a/src/msca/6900/v0.8/plugins/v1_0_0/multisig/BaseWeightedMultisigPlugin.sol +++ b/src/msca/6900/v0.8/plugins/v1_0_0/multisig/BaseWeightedMultisigPlugin.sol @@ -19,22 +19,25 @@ pragma solidity 0.8.24; -import {IWeightedMultisigPlugin} from "./IWeightedMultisigPlugin.sol"; -import {BaseMultisigPlugin} from "./BaseMultisigPlugin.sol"; -import {BasePlugin} from "../../BasePlugin.sol"; +import {CredentialType, OwnerData, PublicKey} from "../../../../../../common/CommonStructs.sol"; + +import {AddressBytesLib} from "../../../../../../libs/AddressBytesLib.sol"; +import {PublicKeyLib} from "../../../../../../libs/PublicKeyLib.sol"; +import {SetValueLib} from "../../../../../../libs/SetValueLib.sol"; +import {NotImplemented} from "../../../../shared/common/Errors.sol"; import {IPlugin} from "../../../interfaces/IPlugin.sol"; + +import {IValidation} from "../../../interfaces/IValidation.sol"; +import {BasePlugin} from "../../BasePlugin.sol"; +import {BaseMultisigPlugin} from "./BaseMultisigPlugin.sol"; +import {IWeightedMultisigPlugin} from "./IWeightedMultisigPlugin.sol"; + import { AssociatedLinkedListSet, AssociatedLinkedListSetLib } from "@modular-account-libs/libraries/AssociatedLinkedListSetLib.sol"; import {SetValue} from "@modular-account-libs/libraries/Constants.sol"; -import {NotImplemented} from "../../../../shared/common/Errors.sol"; -import {PublicKey, OwnerData, CredentialType} from "../../../../../../common/CommonStructs.sol"; -import {PublicKeyLib} from "../../../../../../libs/PublicKeyLib.sol"; -import {SetValueLib} from "../../../../../../libs/SetValueLib.sol"; -import {AddressBytesLib} from "../../../../../../libs/AddressBytesLib.sol"; import {IERC165} from "@openzeppelin/contracts/interfaces/IERC165.sol"; -import {IValidation} from "../../../interfaces/IValidation.sol"; /// @title Base Weighted Multisig Plugin /// @author Circle diff --git a/src/msca/6900/v0.8/plugins/v1_0_0/multisig/IWeightedMultisigPlugin.sol b/src/msca/6900/v0.8/plugins/v1_0_0/multisig/IWeightedMultisigPlugin.sol index 7c719c2..e5be3ef 100644 --- a/src/msca/6900/v0.8/plugins/v1_0_0/multisig/IWeightedMultisigPlugin.sol +++ b/src/msca/6900/v0.8/plugins/v1_0_0/multisig/IWeightedMultisigPlugin.sol @@ -18,7 +18,7 @@ */ pragma solidity 0.8.24; -import {PublicKey, OwnerData} from "../../../../../../common/CommonStructs.sol"; +import {OwnerData, PublicKey} from "../../../../../../common/CommonStructs.sol"; /// @title Weighted Multisig Plugin Interface /// @author Circle diff --git a/src/msca/6900/v0.8/plugins/v1_0_0/multisig/WeightedWebauthnMultisigPlugin.sol b/src/msca/6900/v0.8/plugins/v1_0_0/multisig/WeightedWebauthnMultisigPlugin.sol index 53c8b30..9ff7f65 100644 --- a/src/msca/6900/v0.8/plugins/v1_0_0/multisig/WeightedWebauthnMultisigPlugin.sol +++ b/src/msca/6900/v0.8/plugins/v1_0_0/multisig/WeightedWebauthnMultisigPlugin.sol @@ -19,30 +19,32 @@ pragma solidity 0.8.24; -import {IWeightedMultisigPlugin} from "./IWeightedMultisigPlugin.sol"; -import {BaseWeightedMultisigPlugin} from "./BaseWeightedMultisigPlugin.sol"; +import { + EIP1271_INVALID_SIGNATURE, + EIP1271_VALID_SIGNATURE, + PLUGIN_AUTHOR, + PLUGIN_VERSION_1 +} from "../../../../../../common/Constants.sol"; import {PluginManifest, PluginMetadata, SelectorPermission} from "../../../common/PluginManifest.sol"; -import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; +import {BaseWeightedMultisigPlugin} from "./BaseWeightedMultisigPlugin.sol"; +import {IWeightedMultisigPlugin} from "./IWeightedMultisigPlugin.sol"; + import { AssociatedLinkedListSet, AssociatedLinkedListSetLib } from "@modular-account-libs/libraries/AssociatedLinkedListSetLib.sol"; import {SetValue} from "@modular-account-libs/libraries/Constants.sol"; -import { - EIP1271_VALID_SIGNATURE, - EIP1271_INVALID_SIGNATURE, - PLUGIN_AUTHOR, - PLUGIN_VERSION_1 -} from "../../../../../../common/Constants.sol"; +import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; -import {SignatureChecker} from "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol"; +import {OwnerData, PublicKey, WebAuthnSigDynamicPart} from "../../../../../../common/CommonStructs.sol"; +import {AddressBytesLib} from "../../../../../../libs/AddressBytesLib.sol"; import {PublicKeyLib} from "../../../../../../libs/PublicKeyLib.sol"; import {WebAuthnLib} from "../../../../../../libs/WebAuthnLib.sol"; -import {AddressBytesLib} from "../../../../../../libs/AddressBytesLib.sol"; -import {PublicKey, WebAuthnSigDynamicPart, OwnerData} from "../../../../../../common/CommonStructs.sol"; + import {NotImplementedFunction} from "../../../../shared/common/Errors.sol"; import {IWeightedMultisigPlugin} from "../../../../v0.8/plugins/v1_0_0/multisig/IWeightedMultisigPlugin.sol"; import {BaseERC712CompliantModule} from "../../thirdparty/erc712/BaseERC712CompliantModule.sol"; +import {SignatureChecker} from "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol"; /// @title Weighted Multisig Plugin That Supports Additional Webauthn Authentication /// @author Circle diff --git a/src/msca/6900/v0.8/plugins/v1_0_0/validation/SingleSignerValidationModule.sol b/src/msca/6900/v0.8/plugins/v1_0_0/validation/SingleSignerValidationModule.sol index 3f7be17..13e1352 100644 --- a/src/msca/6900/v0.8/plugins/v1_0_0/validation/SingleSignerValidationModule.sol +++ b/src/msca/6900/v0.8/plugins/v1_0_0/validation/SingleSignerValidationModule.sol @@ -18,25 +18,26 @@ */ pragma solidity 0.8.24; -import {IERC165} from "@openzeppelin/contracts/interfaces/IERC165.sol"; -import {SignatureChecker} from "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol"; -import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; -import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; -import {BasePlugin} from "../../BasePlugin.sol"; -import {ISingleSignerValidationModule} from "./ISingleSignerValidationModule.sol"; -import {IPlugin} from "../../../interfaces/IPlugin.sol"; -import {IValidation} from "../../../interfaces/IValidation.sol"; -import {UnauthorizedCaller} from "../../../../shared/common/Errors.sol"; -import {PluginManifest, PluginMetadata, SelectorPermission} from "../../../common/PluginManifest.sol"; import { EIP1271_INVALID_SIGNATURE, EIP1271_VALID_SIGNATURE, - SIG_VALIDATION_FAILED, - SIG_VALIDATION_SUCCEEDED, + PLUGIN_AUTHOR, PLUGIN_VERSION_1, - PLUGIN_AUTHOR + SIG_VALIDATION_FAILED, + SIG_VALIDATION_SUCCEEDED } from "../../../../../../common/Constants.sol"; +import {UnauthorizedCaller} from "../../../../shared/common/Errors.sol"; +import {PluginManifest, PluginMetadata, SelectorPermission} from "../../../common/PluginManifest.sol"; +import {IPlugin} from "../../../interfaces/IPlugin.sol"; +import {IValidation} from "../../../interfaces/IValidation.sol"; +import {BasePlugin} from "../../BasePlugin.sol"; + import {BaseERC712CompliantModule} from "../../thirdparty/erc712/BaseERC712CompliantModule.sol"; +import {ISingleSignerValidationModule} from "./ISingleSignerValidationModule.sol"; +import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; +import {IERC165} from "@openzeppelin/contracts/interfaces/IERC165.sol"; +import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; +import {SignatureChecker} from "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol"; /** * @notice This validation module allows the MSCA to be validated by a ECDSA secp256k1 curve signature or a 1271 diff --git a/src/paymaster/BasePaymaster.sol b/src/paymaster/BasePaymaster.sol index 506cf0c..540fe09 100644 --- a/src/paymaster/BasePaymaster.sol +++ b/src/paymaster/BasePaymaster.sol @@ -18,14 +18,15 @@ */ pragma solidity 0.8.24; +import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; +import {IPaymaster} from "@account-abstraction/contracts/interfaces/IPaymaster.sol"; + +import {IStakeManager} from "@account-abstraction/contracts/interfaces/IStakeManager.sol"; +import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; +import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; -import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import {PausableUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol"; -import {IPaymaster} from "@account-abstraction/contracts/interfaces/IPaymaster.sol"; -import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; -import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; -import {IStakeManager} from "@account-abstraction/contracts/interfaces/IStakeManager.sol"; /** * The paymaster must also have a deposit, which the entry point will charge UserOperation costs from. diff --git a/src/paymaster/v1/permissioned/SponsorPaymaster.sol b/src/paymaster/v1/permissioned/SponsorPaymaster.sol index cd40e47..37fce2e 100644 --- a/src/paymaster/v1/permissioned/SponsorPaymaster.sol +++ b/src/paymaster/v1/permissioned/SponsorPaymaster.sol @@ -20,14 +20,15 @@ pragma solidity 0.8.24; /* solhint-disable reason-string */ -import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; -import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; -import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; -import "@account-abstraction/contracts/interfaces/IPaymaster.sol"; -import "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; import "../../../utils/PaymasterUtils.sol"; -import {_packValidationData} from "@account-abstraction/contracts/core/Helpers.sol"; + import "../../BasePaymaster.sol"; +import {_packValidationData} from "@account-abstraction/contracts/core/Helpers.sol"; +import "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; +import "@account-abstraction/contracts/interfaces/IPaymaster.sol"; +import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; +import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; +import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; /** * For sponsor mode, a signature is required from Circle. The purpose of signature is mostly used to allow Circle diff --git a/src/utils/PaymasterUtils.sol b/src/utils/PaymasterUtils.sol index eaf329a..3d1dedb 100644 --- a/src/utils/PaymasterUtils.sol +++ b/src/utils/PaymasterUtils.sol @@ -21,8 +21,8 @@ pragma solidity 0.8.24; /* solhint-disable reason-string */ /* solhint-disable no-inline-assembly */ -import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; import {UserOperationLib} from "@account-abstraction/contracts/core/UserOperationLib.sol"; +import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; enum ChargeMode { GAS_ONLY, // paymaster will charge a network fee diff --git a/test/ECDSAAccountAndFactory.t.sol b/test/ECDSAAccountAndFactory.t.sol index c3873ea..3cc921a 100644 --- a/test/ECDSAAccountAndFactory.t.sol +++ b/test/ECDSAAccountAndFactory.t.sol @@ -18,16 +18,18 @@ */ pragma solidity 0.8.24; -import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; -import "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; -import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; -import "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; import "../src/account/v1/factory/ECDSAAccountFactory.sol"; + +import "./util/TestERC1155.sol"; +import "./util/TestERC721.sol"; +import "./util/TestLiquidityPool.sol"; import "./util/TestUtils.sol"; +import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; +import "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; +import "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; +import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; + import "forge-std/src/console.sol"; -import "./util/TestLiquidityPool.sol"; -import "./util/TestERC721.sol"; -import "./util/TestERC1155.sol"; contract ECDSAAccountAndFactoryTest is TestUtils { // erc721 diff --git a/test/SponsorPaymaster.t.sol b/test/SponsorPaymaster.t.sol index 7fcc412..1041e7f 100644 --- a/test/SponsorPaymaster.t.sol +++ b/test/SponsorPaymaster.t.sol @@ -19,11 +19,13 @@ pragma solidity 0.8.24; import "../src/paymaster/v1/permissioned/SponsorPaymaster.sol"; -import "@account-abstraction/contracts/interfaces/IPaymaster.sol"; + import "./util/TestUtils.sol"; + +import "@account-abstraction/contracts/core/EntryPoint.sol"; +import "@account-abstraction/contracts/interfaces/IPaymaster.sol"; import "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; -import "@account-abstraction/contracts/core/EntryPoint.sol"; contract SponsorPaymasterTest is TestUtils { using UserOperationLib for PackedUserOperation; diff --git a/test/WalletMigration.t.sol b/test/WalletMigration.t.sol index d0e6fc4..198db14 100644 --- a/test/WalletMigration.t.sol +++ b/test/WalletMigration.t.sol @@ -18,18 +18,19 @@ */ pragma solidity 0.8.24; -import {TestUtils} from "./util/TestUtils.sol"; -import "./util/TestERC721.sol"; -import "./util/TestERC1155.sol"; -import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; +import {ECDSAAccount} from "../src/account/v1/ECDSAAccount.sol"; +import {ECDSAAccountFactory} from "../src/account/v1/factory/ECDSAAccountFactory.sol"; import {FunctionReference} from "../src/msca/6900/v0.7/common/Structs.sol"; -import "./util/TestLiquidityPool.sol"; import "../src/msca/6900/v0.7/factories/semi/SingleOwnerMSCAFactory.sol"; -import "../src/msca/6900/v0.7/libs/FunctionReferenceLib.sol"; import "../src/msca/6900/v0.7/interfaces/IStandardExecutor.sol"; +import "../src/msca/6900/v0.7/libs/FunctionReferenceLib.sol"; import "../src/msca/6900/v0.7/plugins/v1_0_0/acl/SingleOwnerPlugin.sol"; -import {ECDSAAccountFactory} from "../src/account/v1/factory/ECDSAAccountFactory.sol"; -import {ECDSAAccount} from "../src/account/v1/ECDSAAccount.sol"; +import "./util/TestERC1155.sol"; +import "./util/TestERC721.sol"; + +import "./util/TestLiquidityPool.sol"; +import {TestUtils} from "./util/TestUtils.sol"; +import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; contract WalletMigrationTest is TestUtils { using FunctionReferenceLib for bytes21; diff --git a/test/gas/6900/v0.7/plugins/addressbook/SingleOwnerMSCAWithAddressBookPlugin.t.sol b/test/gas/6900/v0.7/plugins/addressbook/SingleOwnerMSCAWithAddressBookPlugin.t.sol index 86aa228..5f7b5dd 100644 --- a/test/gas/6900/v0.7/plugins/addressbook/SingleOwnerMSCAWithAddressBookPlugin.t.sol +++ b/test/gas/6900/v0.7/plugins/addressbook/SingleOwnerMSCAWithAddressBookPlugin.t.sol @@ -19,10 +19,11 @@ pragma solidity 0.8.24; import {FunctionReference} from "../../../../../../src/msca/6900/v0.7/common/Structs.sol"; -import {PluginGasProfileBaseTest} from "../../../../PluginGasProfileBase.t.sol"; -import "../../../../../../src/utils/ExecutionUtils.sol"; + import "../../../../../../src/msca/6900/v0.7/factories/semi/SingleOwnerMSCAFactory.sol"; import "../../../../../../src/msca/6900/v0.7/plugins/v1_0_0/addressbook/AddressBookPlugin.sol"; +import "../../../../../../src/utils/ExecutionUtils.sol"; +import {PluginGasProfileBaseTest} from "../../../../PluginGasProfileBase.t.sol"; contract SingleOwnerMSCAWithAddressBookPluginTest is PluginGasProfileBaseTest { event PluginInstalled(address indexed plugin, bytes32 manifestHash, FunctionReference[] dependencies); diff --git a/test/gas/6900/v0.7/plugins/singleowner/SingleOwnerMSCAWithSingleOwnerPlugin.t.sol b/test/gas/6900/v0.7/plugins/singleowner/SingleOwnerMSCAWithSingleOwnerPlugin.t.sol index 8fa5075..59f2416 100644 --- a/test/gas/6900/v0.7/plugins/singleowner/SingleOwnerMSCAWithSingleOwnerPlugin.t.sol +++ b/test/gas/6900/v0.7/plugins/singleowner/SingleOwnerMSCAWithSingleOwnerPlugin.t.sol @@ -19,10 +19,11 @@ pragma solidity 0.8.24; import "../../../../../../src/msca/6900/v0.7/common/Structs.sol"; + +import "../../../../../../src/msca/6900/v0.7/factories/semi/SingleOwnerMSCAFactory.sol"; import "../../../../../../src/msca/6900/v0.7/plugins/v1_0_0/acl/SingleOwnerPlugin.sol"; -import "../../../../PluginGasProfileBase.t.sol"; import "../../../../../../src/utils/ExecutionUtils.sol"; -import "../../../../../../src/msca/6900/v0.7/factories/semi/SingleOwnerMSCAFactory.sol"; +import "../../../../PluginGasProfileBase.t.sol"; contract SingleOwnerMSCAWithSingleOwnerPluginTest is PluginGasProfileBaseTest { event PluginInstalled(address indexed plugin, bytes32 manifestHash, FunctionReference[] dependencies); diff --git a/test/gas/6900/v0.7/plugins/singleowner/UpgradableMSCAWithSingleOwnerPlugin.t.sol b/test/gas/6900/v0.7/plugins/singleowner/UpgradableMSCAWithSingleOwnerPlugin.t.sol index a1408d9..c92a468 100644 --- a/test/gas/6900/v0.7/plugins/singleowner/UpgradableMSCAWithSingleOwnerPlugin.t.sol +++ b/test/gas/6900/v0.7/plugins/singleowner/UpgradableMSCAWithSingleOwnerPlugin.t.sol @@ -19,11 +19,12 @@ pragma solidity 0.8.24; import "../../../../../../src/msca/6900/v0.7/common/Structs.sol"; -import "../../../../../../src/msca/6900/v0.7/plugins/v1_0_0/acl/SingleOwnerPlugin.sol"; -import "../../../../PluginGasProfileBase.t.sol"; + import "../../../../../../src/msca/6900/v0.7/factories/UpgradableMSCAFactory.sol"; +import "../../../../../../src/msca/6900/v0.7/plugins/v1_0_0/acl/SingleOwnerPlugin.sol"; import "../../../../../../src/utils/ExecutionUtils.sol"; import {TestUserOpAllPassValidator} from "../../../../../msca/6900/v0.7/TestUserOpAllPassValidator.sol"; +import "../../../../PluginGasProfileBase.t.sol"; contract UpgradableMSCAWithSingleOwnerPluginTest is PluginGasProfileBaseTest { event PluginInstalled(address indexed plugin, bytes32 manifestHash, FunctionReference[] dependencies); diff --git a/test/gas/PluginGasProfileBase.t.sol b/test/gas/PluginGasProfileBase.t.sol index bc35e12..9ffc4fd 100644 --- a/test/gas/PluginGasProfileBase.t.sol +++ b/test/gas/PluginGasProfileBase.t.sol @@ -18,11 +18,11 @@ */ pragma solidity 0.8.24; -import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; +import {TestUtils} from "../util/TestUtils.sol"; import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; +import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; import {console} from "forge-std/src/console.sol"; -import {TestUtils} from "../util/TestUtils.sol"; abstract contract PluginGasProfileBaseTest is TestUtils { uint256 constant OV_PER_ZERO_BYTE = 4; diff --git a/test/libs/PublicKeyLib.t.sol b/test/libs/PublicKeyLib.t.sol index 5f86646..56f7920 100644 --- a/test/libs/PublicKeyLib.t.sol +++ b/test/libs/PublicKeyLib.t.sol @@ -18,9 +18,9 @@ */ pragma solidity 0.8.24; +import {PublicKey} from "../../src/common/CommonStructs.sol"; import {TestUtils} from "../util/TestUtils.sol"; import {PublicKeyLibCaller} from "./PublicKeyLibCaller.sol"; -import {PublicKey} from "../../src/common/CommonStructs.sol"; contract PublicKeyLibTest is TestUtils { PublicKeyLibCaller private publicKeyLibCaller = new PublicKeyLibCaller(); diff --git a/test/libs/PublicKeyLibCaller.sol b/test/libs/PublicKeyLibCaller.sol index 21633b4..6b253a8 100644 --- a/test/libs/PublicKeyLibCaller.sol +++ b/test/libs/PublicKeyLibCaller.sol @@ -18,8 +18,8 @@ */ pragma solidity 0.8.24; -import {PublicKeyLib} from "../../src/libs/PublicKeyLib.sol"; import {PublicKey} from "../../src/common/CommonStructs.sol"; +import {PublicKeyLib} from "../../src/libs/PublicKeyLib.sol"; /** * @dev Used in tests, for coverage. diff --git a/test/libs/RecipientAddressLib.t.sol b/test/libs/RecipientAddressLib.t.sol index 85b7a12..b4cf361 100644 --- a/test/libs/RecipientAddressLib.t.sol +++ b/test/libs/RecipientAddressLib.t.sol @@ -18,15 +18,16 @@ */ pragma solidity 0.8.24; -import {TestUtils} from "../util/TestUtils.sol"; -import {console} from "forge-std/src/console.sol"; -import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; -import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; +import {RecipientAddressLib} from "../../src/libs/RecipientAddressLib.sol"; import {TestERC1155} from "../util/TestERC1155.sol"; import {TestERC721} from "../util/TestERC721.sol"; import {TestLiquidityPool} from "../util/TestLiquidityPool.sol"; -import {RecipientAddressLib} from "../../src/libs/RecipientAddressLib.sol"; +import {TestUtils} from "../util/TestUtils.sol"; + import {RecipientAddressLibWrapper} from "./RecipientAddressLibWrapper.sol"; +import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; +import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; +import {console} from "forge-std/src/console.sol"; contract RecipientAddressLibTest is TestUtils { bytes4 internal constant ERC20_INCREASE_ALLOWANCE = bytes4(keccak256("increaseAllowance(address,uint256)")); diff --git a/test/libs/webauthn/WebAuthnLib.t.sol b/test/libs/webauthn/WebAuthnLib.t.sol index 4c4ed67..5663cd0 100644 --- a/test/libs/webauthn/WebAuthnLib.t.sol +++ b/test/libs/webauthn/WebAuthnLib.t.sol @@ -18,10 +18,11 @@ */ pragma solidity 0.8.24; -import {Base64Url} from "@fcl/utils/Base64Url.sol"; import {TestUtils} from "../.../../../util/TestUtils.sol"; -import {WebAuthnLib} from "../../../src/libs/WebAuthnLib.sol"; + import {WebAuthnData} from "../../../src/common/CommonStructs.sol"; +import {WebAuthnLib} from "../../../src/libs/WebAuthnLib.sol"; +import {Base64Url} from "@fcl/utils/Base64Url.sol"; contract WebAuthnTest is TestUtils { bytes private challenge = abi.encode(0xf631058a3ba1116acce12396fad0a125b5041c43f8e15723709f81aa8d5f4ccf); diff --git a/test/libs/webauthn/WebAuthnLibFuzz.t.sol b/test/libs/webauthn/WebAuthnLibFuzz.t.sol index 33b05fb..3751161 100644 --- a/test/libs/webauthn/WebAuthnLibFuzz.t.sol +++ b/test/libs/webauthn/WebAuthnLibFuzz.t.sol @@ -18,13 +18,14 @@ */ pragma solidity 0.8.24; -import {FCL_ecdsa} from "@fcl/FCL_ecdsa.sol"; import {TestUtils} from "../.../../../util/TestUtils.sol"; + +import {WebAuthnData} from "../../../src/common/CommonStructs.sol"; import {WebAuthnLib} from "../../../src/libs/WebAuthnLib.sol"; import {Utils} from "./Utils.sol"; +import {FCL_ecdsa} from "@fcl/FCL_ecdsa.sol"; import {stdJson} from "forge-std/src/StdJson.sol"; import {console} from "forge-std/src/console.sol"; -import {WebAuthnData} from "../../../src/common/CommonStructs.sol"; contract WebAuthnFuzzTest is TestUtils { using stdJson for string; diff --git a/test/msca/6900/shared/libs/Bytes32DLLLib.t.sol b/test/msca/6900/shared/libs/Bytes32DLLLib.t.sol index a7b474f..5580298 100644 --- a/test/msca/6900/shared/libs/Bytes32DLLLib.t.sol +++ b/test/msca/6900/shared/libs/Bytes32DLLLib.t.sol @@ -20,10 +20,10 @@ pragma solidity 0.8.24; /* solhint-disable one-contract-per-file */ -import {TestUtils} from "../../../../util/TestUtils.sol"; import {SENTINEL_BYTES32} from "../../../../../src/common/Constants.sol"; import {Bytes32DLL} from "../../../../../src/msca/6900/shared/common/Structs.sol"; import {Bytes32DLLLib} from "../../../../../src/msca/6900/shared/libs/Bytes32DLLLib.sol"; +import {TestUtils} from "../../../../util/TestUtils.sol"; contract TestDLL { using Bytes32DLLLib for Bytes32DLL; diff --git a/test/msca/6900/shared/libs/Bytes4DLLLib.t.sol b/test/msca/6900/shared/libs/Bytes4DLLLib.t.sol index 19ce0c6..5da7524 100644 --- a/test/msca/6900/shared/libs/Bytes4DLLLib.t.sol +++ b/test/msca/6900/shared/libs/Bytes4DLLLib.t.sol @@ -20,10 +20,10 @@ pragma solidity 0.8.24; /* solhint-disable one-contract-per-file */ -import {TestUtils} from "../../../../util/TestUtils.sol"; import {SENTINEL_BYTES4} from "../../../../../src/common/Constants.sol"; import {Bytes4DLL} from "../../../../../src/msca/6900/shared/common/Structs.sol"; import {Bytes4DLLLib} from "../../../../../src/msca/6900/shared/libs/Bytes4DLLLib.sol"; +import {TestUtils} from "../../../../util/TestUtils.sol"; contract TestDLL { using Bytes4DLLLib for Bytes4DLL; diff --git a/test/msca/6900/shared/libs/ValidationDataLib.t.sol b/test/msca/6900/shared/libs/ValidationDataLib.t.sol index d6f1169..5607dfe 100644 --- a/test/msca/6900/shared/libs/ValidationDataLib.t.sol +++ b/test/msca/6900/shared/libs/ValidationDataLib.t.sol @@ -18,9 +18,9 @@ */ pragma solidity 0.8.24; -import {TestUtils} from "../../../../util/TestUtils.sol"; -import {ValidationDataLib} from "../../../../../src/msca/6900/shared/libs/ValidationDataLib.sol"; import {ValidationData} from "../../../../../src/msca/6900/shared/common/Structs.sol"; +import {ValidationDataLib} from "../../../../../src/msca/6900/shared/libs/ValidationDataLib.sol"; +import {TestUtils} from "../../../../util/TestUtils.sol"; contract ValidationDataLibTest is TestUtils { using ValidationDataLib for ValidationData; diff --git a/test/msca/6900/v0.7/HookFunctionReferenceDLL.t.sol b/test/msca/6900/v0.7/HookFunctionReferenceDLL.t.sol index f8a59ae..3726be6 100644 --- a/test/msca/6900/v0.7/HookFunctionReferenceDLL.t.sol +++ b/test/msca/6900/v0.7/HookFunctionReferenceDLL.t.sol @@ -18,10 +18,10 @@ */ pragma solidity 0.8.24; -import "../../../util/TestUtils.sol"; -import "forge-std/src/console.sol"; import "../../../../src/msca/6900/v0.7/common/Structs.sol"; +import "../../../util/TestUtils.sol"; import "./TestRepeatableFunctionReferenceDLL.sol"; +import "forge-std/src/console.sol"; contract HookFunctionReferenceDLLTest is TestUtils { using FunctionReferenceLib for bytes21; diff --git a/test/msca/6900/v0.7/PluginExecutor.t.sol b/test/msca/6900/v0.7/PluginExecutor.t.sol index e8a9acd..c9cd62e 100644 --- a/test/msca/6900/v0.7/PluginExecutor.t.sol +++ b/test/msca/6900/v0.7/PluginExecutor.t.sol @@ -18,22 +18,26 @@ */ pragma solidity 0.8.24; -import "../../../util/TestUtils.sol"; -import "forge-std/src/console.sol"; -import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; -import "./TestCircleMSCA.sol"; import "../../../../src/msca/6900/v0.7/common/Structs.sol"; -import "./TestUserOpValidator.sol"; -import "./TestUserOpValidatorHook.sol"; -import "../../../util/TestLiquidityPool.sol"; + import "../../../../src/msca/6900/v0.7/plugins/v1_0_0/acl/SingleOwnerPlugin.sol"; -import "./TestTokenPlugin.sol"; +import "../../../util/TestLiquidityPool.sol"; +import "../../../util/TestUtils.sol"; +import "./TestCircleMSCA.sol"; + import "./TestCircleMSCAFactory.sol"; import "./TestPermitAnyExternalAddressPlugin.sol"; -import "./TestTokenWithPostHookOnlyPlugin.sol"; + import "./TestPermitAnyExternalAddressWithPostHookOnlyPlugin.sol"; -import "./TestTokenWithPreHookOnlyPlugin.sol"; + import "./TestPermitAnyExternalAddressWithPreHookOnlyPlugin.sol"; +import "./TestTokenPlugin.sol"; +import "./TestTokenWithPostHookOnlyPlugin.sol"; +import "./TestTokenWithPreHookOnlyPlugin.sol"; +import "./TestUserOpValidator.sol"; +import "./TestUserOpValidatorHook.sol"; +import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; +import "forge-std/src/console.sol"; contract PluginExecutorTest is TestUtils { using FunctionReferenceLib for bytes21; diff --git a/test/msca/6900/v0.7/PluginManager.t.sol b/test/msca/6900/v0.7/PluginManager.t.sol index a5f48cd..9a0d268 100644 --- a/test/msca/6900/v0.7/PluginManager.t.sol +++ b/test/msca/6900/v0.7/PluginManager.t.sol @@ -18,19 +18,21 @@ */ pragma solidity 0.8.24; +import {EMPTY_FUNCTION_REFERENCE} from "../../../../src/common/Constants.sol"; +import "../../../../src/msca/6900/v0.7/common/Structs.sol"; +import "../../../../src/msca/6900/v0.7/plugins/v1_0_0/acl/SingleOwnerPlugin.sol"; +import "../../../util/TestLiquidityPool.sol"; import "../../../util/TestUtils.sol"; -import "forge-std/src/console.sol"; -import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; import "./TestCircleMSCA.sol"; -import "../../../../src/msca/6900/v0.7/common/Structs.sol"; + +import "./TestCircleMSCAFactory.sol"; +import "./TestTokenPlugin.sol"; import "./TestUserOpValidator.sol"; import "./TestUserOpValidatorHook.sol"; -import "../../../util/TestLiquidityPool.sol"; -import "../../../../src/msca/6900/v0.7/plugins/v1_0_0/acl/SingleOwnerPlugin.sol"; -import "./TestTokenPlugin.sol"; -import "./TestCircleMSCAFactory.sol"; + import "./TestUserOpValidatorWithDependencyHook.sol"; -import {EMPTY_FUNCTION_REFERENCE} from "../../../../src/common/Constants.sol"; +import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; +import "forge-std/src/console.sol"; /// Tests for install/uninstall contract PluginManagerTest is TestUtils { diff --git a/test/msca/6900/v0.7/RepeatableFunctionReferenceDLLLib.t.sol b/test/msca/6900/v0.7/RepeatableFunctionReferenceDLLLib.t.sol index 1a3925a..2cf340e 100644 --- a/test/msca/6900/v0.7/RepeatableFunctionReferenceDLLLib.t.sol +++ b/test/msca/6900/v0.7/RepeatableFunctionReferenceDLLLib.t.sol @@ -18,10 +18,10 @@ */ pragma solidity 0.8.24; -import "../../../util/TestUtils.sol"; -import "forge-std/src/console.sol"; import "../../../../src/msca/6900/v0.7/common/Structs.sol"; +import "../../../util/TestUtils.sol"; import "./TestRepeatableFunctionReferenceDLL.sol"; +import "forge-std/src/console.sol"; contract RepeatableFunctionReferenceDLLibTest is TestUtils { using FunctionReferenceLib for bytes21; diff --git a/test/msca/6900/v0.7/SingleOwnerMSCA.t.sol b/test/msca/6900/v0.7/SingleOwnerMSCA.t.sol index 2083905..5c0586b 100644 --- a/test/msca/6900/v0.7/SingleOwnerMSCA.t.sol +++ b/test/msca/6900/v0.7/SingleOwnerMSCA.t.sol @@ -18,26 +18,29 @@ */ pragma solidity 0.8.24; -import "../../../util/TestUtils.sol"; -import "forge-std/src/console.sol"; -import "../../../util/TestERC721.sol"; -import "../../../util/TestERC1155.sol"; -import "../../../util/TestERC777.sol"; -import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; +import {InvalidExecutionFunction} from "../../../../src/msca/6900/shared/common/Errors.sol"; import "../../../../src/msca/6900/v0.7/common/Structs.sol"; -import "./TestUserOpValidator.sol"; -import "./TestUserOpValidatorHook.sol"; -import "../../../util/TestLiquidityPool.sol"; import "../../../../src/msca/6900/v0.7/factories/semi/SingleOwnerMSCAFactory.sol"; -import "../../../../src/msca/6900/v0.7/libs/FunctionReferenceLib.sol"; import "../../../../src/msca/6900/v0.7/interfaces/IStandardExecutor.sol"; +import "../../../../src/msca/6900/v0.7/libs/FunctionReferenceLib.sol"; import "../../../../src/msca/6900/v0.7/plugins/v1_0_0/acl/SingleOwnerPlugin.sol"; -import {TestTokenPlugin} from "./TestTokenPlugin.sol"; import "../../../../src/utils/ExecutionUtils.sol"; import "../../../util/Mock1820Registry.sol"; -import {InvalidExecutionFunction} from "../../../../src/msca/6900/shared/common/Errors.sol"; -import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; +import "../../../util/TestERC1155.sol"; +import "../../../util/TestERC721.sol"; +import "../../../util/TestERC777.sol"; +import "../../../util/TestLiquidityPool.sol"; +import "../../../util/TestUtils.sol"; + +import {TestTokenPlugin} from "./TestTokenPlugin.sol"; + import {TestUserOpAllPassValidator} from "./TestUserOpAllPassValidator.sol"; +import "./TestUserOpValidator.sol"; +import "./TestUserOpValidatorHook.sol"; +import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; + +import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; +import "forge-std/src/console.sol"; contract SingleOwnerMSCATest is TestUtils { using FunctionReferenceLib for bytes21; diff --git a/test/msca/6900/v0.7/SingleOwnerMSCAFactory.t.sol b/test/msca/6900/v0.7/SingleOwnerMSCAFactory.t.sol index 674af47..9337f73 100644 --- a/test/msca/6900/v0.7/SingleOwnerMSCAFactory.t.sol +++ b/test/msca/6900/v0.7/SingleOwnerMSCAFactory.t.sol @@ -18,15 +18,16 @@ */ pragma solidity 0.8.24; -import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; -import "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; -import "../../../util/TestUtils.sol"; -import "forge-std/src/console.sol"; import "../../../../src/msca/6900/v0.7/common/Structs.sol"; -import {PluginManager} from "../../../../src/msca/6900/v0.7/managers/PluginManager.sol"; + import "../../../../src/msca/6900/v0.7/factories/semi/SingleOwnerMSCAFactory.sol"; import "../../../../src/msca/6900/v0.7/interfaces/IStandardExecutor.sol"; +import {PluginManager} from "../../../../src/msca/6900/v0.7/managers/PluginManager.sol"; import "../../../util/TestLiquidityPool.sol"; +import "../../../util/TestUtils.sol"; +import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; +import "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; +import "forge-std/src/console.sol"; contract SingleOwnerMSCAFactoryTest is TestUtils { event AccountCreated(address indexed proxy, address sender, bytes32 salt); diff --git a/test/msca/6900/v0.7/SingleOwnerPlugin.t.sol b/test/msca/6900/v0.7/SingleOwnerPlugin.t.sol index 95248e5..b18e9ad 100644 --- a/test/msca/6900/v0.7/SingleOwnerPlugin.t.sol +++ b/test/msca/6900/v0.7/SingleOwnerPlugin.t.sol @@ -20,28 +20,35 @@ pragma solidity 0.8.24; /* solhint-disable max-states-count */ -import {TestUtils} from "../../../util/TestUtils.sol"; -import {console} from "forge-std/src/console.sol"; -import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; -import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; -import {TestCircleMSCA} from "./TestCircleMSCA.sol"; +import {EMPTY_FUNCTION_REFERENCE, PLUGIN_AUTHOR, PLUGIN_VERSION_1} from "../../../../src/common/Constants.sol"; + +import {NotImplemented} from "../../../../src/msca/6900/shared/common/Errors.sol"; + +import {RUNTIME_VALIDATION_ALWAYS_ALLOW_FUNCTION_REFERENCE} from "../../../../src/msca/6900/v0.7/common/Constants.sol"; +import {PluginMetadata} from "../../../../src/msca/6900/v0.7/common/PluginManifest.sol"; import {FunctionReference} from "../../../../src/msca/6900/v0.7/common/Structs.sol"; -import {SingleOwnerPlugin} from "../../../../src/msca/6900/v0.7/plugins/v1_0_0/acl/SingleOwnerPlugin.sol"; -import {ISingleOwnerPlugin} from "../../../../src/msca/6900/v0.7/plugins/v1_0_0/acl/ISingleOwnerPlugin.sol"; -import {TestCircleMSCAFactory} from "./TestCircleMSCAFactory.sol"; -import {TestLiquidityPool} from "../../../util/TestLiquidityPool.sol"; + +import {IPluginManager} from "../../../../src/msca/6900/v0.7/interfaces/IPluginManager.sol"; +import {IStandardExecutor} from "../../../../src/msca/6900/v0.7/interfaces/IStandardExecutor.sol"; import {FunctionReferenceLib} from "../../../../src/msca/6900/v0.7/libs/FunctionReferenceLib.sol"; import {PluginManager} from "../../../../src/msca/6900/v0.7/managers/PluginManager.sol"; -import {PluginMetadata} from "../../../../src/msca/6900/v0.7/common/PluginManifest.sol"; -import {PLUGIN_VERSION_1, PLUGIN_AUTHOR, EMPTY_FUNCTION_REFERENCE} from "../../../../src/common/Constants.sol"; -import {IStandardExecutor} from "../../../../src/msca/6900/v0.7/interfaces/IStandardExecutor.sol"; -import {IPluginManager} from "../../../../src/msca/6900/v0.7/interfaces/IPluginManager.sol"; -import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; -import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; -import {NotImplemented} from "../../../../src/msca/6900/shared/common/Errors.sol"; + import {BasePlugin} from "../../../../src/msca/6900/v0.7/plugins/BasePlugin.sol"; +import {ISingleOwnerPlugin} from "../../../../src/msca/6900/v0.7/plugins/v1_0_0/acl/ISingleOwnerPlugin.sol"; +import {SingleOwnerPlugin} from "../../../../src/msca/6900/v0.7/plugins/v1_0_0/acl/SingleOwnerPlugin.sol"; + +import {TestLiquidityPool} from "../../../util/TestLiquidityPool.sol"; +import {TestUtils} from "../../../util/TestUtils.sol"; +import {TestCircleMSCA} from "./TestCircleMSCA.sol"; +import {TestCircleMSCAFactory} from "./TestCircleMSCAFactory.sol"; +import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; +import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; + +import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; +import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; + import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol"; -import {RUNTIME_VALIDATION_ALWAYS_ALLOW_FUNCTION_REFERENCE} from "../../../../src/msca/6900/v0.7/common/Constants.sol"; +import {console} from "forge-std/src/console.sol"; /// Tests for SingleOwnerPlugin contract SingleOwnerPluginTest is TestUtils { diff --git a/test/msca/6900/v0.7/TestCircleMSCA.sol b/test/msca/6900/v0.7/TestCircleMSCA.sol index 6bb8878..099bfb9 100644 --- a/test/msca/6900/v0.7/TestCircleMSCA.sol +++ b/test/msca/6900/v0.7/TestCircleMSCA.sol @@ -18,28 +18,30 @@ */ pragma solidity 0.8.24; -import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; -import {StorageSlot} from "@openzeppelin/contracts/utils/StorageSlot.sol"; -import {UpgradableMSCA} from "../../../../src/msca/6900/v0.7/account/UpgradableMSCA.sol"; -import {ERC1967Utils} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol"; -import {WalletStorageV1Lib} from "../../../../src/msca/6900/v0.7/libs/WalletStorageV1Lib.sol"; -import {AddressDLLLib} from "../../../../src/msca/6900/shared/libs/AddressDLLLib.sol"; -import {FunctionReferenceDLLLib} from "../../../../src/msca/6900/v0.7/libs/FunctionReferenceDLLLib.sol"; -import {RepeatableFunctionReferenceDLLLib} from - "../../../../src/msca/6900/v0.7/libs/RepeatableFunctionReferenceDLLLib.sol"; -import {FunctionReferenceLib} from "../../../../src/msca/6900/v0.7/libs/FunctionReferenceLib.sol"; import {AddressDLL} from "../../../../src/msca/6900/shared/common/Structs.sol"; +import {AddressDLLLib} from "../../../../src/msca/6900/shared/libs/AddressDLLLib.sol"; +import {UpgradableMSCA} from "../../../../src/msca/6900/v0.7/account/UpgradableMSCA.sol"; + import { Bytes21DLL, - RepeatableBytes21DLL, - FunctionReference, - ExecutionHooks, - ExecutionFunctionConfig, ExecutionDetail, + ExecutionFunctionConfig, + ExecutionHooks, + FunctionReference, + PermittedExternalCall, PluginDetail, - PermittedExternalCall + RepeatableBytes21DLL } from "../../../../src/msca/6900/v0.7/common/Structs.sol"; +import {FunctionReferenceDLLLib} from "../../../../src/msca/6900/v0.7/libs/FunctionReferenceDLLLib.sol"; +import {FunctionReferenceLib} from "../../../../src/msca/6900/v0.7/libs/FunctionReferenceLib.sol"; +import {RepeatableFunctionReferenceDLLLib} from + "../../../../src/msca/6900/v0.7/libs/RepeatableFunctionReferenceDLLLib.sol"; +import {WalletStorageV1Lib} from "../../../../src/msca/6900/v0.7/libs/WalletStorageV1Lib.sol"; + import {PluginManager} from "../../../../src/msca/6900/v0.7/managers/PluginManager.sol"; +import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; +import {ERC1967Utils} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol"; +import {StorageSlot} from "@openzeppelin/contracts/utils/StorageSlot.sol"; // testing contract with some convenience methods contract TestCircleMSCA is UpgradableMSCA { diff --git a/test/msca/6900/v0.7/TestCircleMSCAFactory.sol b/test/msca/6900/v0.7/TestCircleMSCAFactory.sol index 68d1821..7694932 100644 --- a/test/msca/6900/v0.7/TestCircleMSCAFactory.sol +++ b/test/msca/6900/v0.7/TestCircleMSCAFactory.sol @@ -18,12 +18,12 @@ */ pragma solidity 0.8.24; +import {Create2FailedDeployment, InvalidLength} from "../../../../src/msca/6900/shared/common/Errors.sol"; +import "./TestCircleMSCA.sol"; +import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; +import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; import "@openzeppelin/contracts/utils/Create2.sol"; -import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; -import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; -import "./TestCircleMSCA.sol"; -import {InvalidLength, Create2FailedDeployment} from "../../../../src/msca/6900/shared/common/Errors.sol"; /** * @dev Only for testing purpose. Account factory that creates the TestCircleMSCA with a set of plugins to be installed. diff --git a/test/msca/6900/v0.7/TestPermitAnyExternalAddressPlugin.sol b/test/msca/6900/v0.7/TestPermitAnyExternalAddressPlugin.sol index 297607a..783d587 100644 --- a/test/msca/6900/v0.7/TestPermitAnyExternalAddressPlugin.sol +++ b/test/msca/6900/v0.7/TestPermitAnyExternalAddressPlugin.sol @@ -18,14 +18,16 @@ */ pragma solidity 0.8.24; -import "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; +import {PLUGIN_AUTHOR, PLUGIN_VERSION_1, SIG_VALIDATION_SUCCEEDED} from "../../../../src/common/Constants.sol"; import "../../../../src/msca/6900/v0.7/common/Structs.sol"; -import {SIG_VALIDATION_SUCCEEDED, PLUGIN_AUTHOR, PLUGIN_VERSION_1} from "../../../../src/common/Constants.sol"; -import "../../../../src/msca/6900/v0.7/interfaces/IStandardExecutor.sol"; -import "../../../../src/msca/6900/v0.7/interfaces/IPluginManager.sol"; + import "../../../../src/msca/6900/v0.7/interfaces/IPluginExecutor.sol"; +import "../../../../src/msca/6900/v0.7/interfaces/IPluginManager.sol"; +import "../../../../src/msca/6900/v0.7/interfaces/IStandardExecutor.sol"; + import "../../../../src/msca/6900/v0.7/plugins/BasePlugin.sol"; import "../../../util/TestLiquidityPool.sol"; +import "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; import "forge-std/src/console.sol"; /** diff --git a/test/msca/6900/v0.7/TestPermitAnyExternalAddressWithPostHookOnlyPlugin.sol b/test/msca/6900/v0.7/TestPermitAnyExternalAddressWithPostHookOnlyPlugin.sol index 5fcba1e..3e95b46 100644 --- a/test/msca/6900/v0.7/TestPermitAnyExternalAddressWithPostHookOnlyPlugin.sol +++ b/test/msca/6900/v0.7/TestPermitAnyExternalAddressWithPostHookOnlyPlugin.sol @@ -18,14 +18,16 @@ */ pragma solidity 0.8.24; -import "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; -import "../../../../src/msca/6900/v0.7/common/Structs.sol"; import {PLUGIN_AUTHOR, PLUGIN_VERSION_1, SIG_VALIDATION_SUCCEEDED} from "../../../../src/common/Constants.sol"; -import "../../../../src/msca/6900/v0.7/interfaces/IStandardExecutor.sol"; -import "../../../../src/msca/6900/v0.7/interfaces/IPluginManager.sol"; +import "../../../../src/msca/6900/v0.7/common/Structs.sol"; + import "../../../../src/msca/6900/v0.7/interfaces/IPluginExecutor.sol"; +import "../../../../src/msca/6900/v0.7/interfaces/IPluginManager.sol"; +import "../../../../src/msca/6900/v0.7/interfaces/IStandardExecutor.sol"; + import "../../../../src/msca/6900/v0.7/plugins/BasePlugin.sol"; import "../../../util/TestLiquidityPool.sol"; +import "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; import "forge-std/src/console.sol"; /** diff --git a/test/msca/6900/v0.7/TestPermitAnyExternalAddressWithPreHookOnlyPlugin.sol b/test/msca/6900/v0.7/TestPermitAnyExternalAddressWithPreHookOnlyPlugin.sol index 50113f7..e39f1c6 100644 --- a/test/msca/6900/v0.7/TestPermitAnyExternalAddressWithPreHookOnlyPlugin.sol +++ b/test/msca/6900/v0.7/TestPermitAnyExternalAddressWithPreHookOnlyPlugin.sol @@ -18,14 +18,16 @@ */ pragma solidity 0.8.24; -import "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; +import {PLUGIN_AUTHOR, PLUGIN_VERSION_1, SIG_VALIDATION_SUCCEEDED} from "../../../../src/common/Constants.sol"; import "../../../../src/msca/6900/v0.7/common/Structs.sol"; -import {SIG_VALIDATION_SUCCEEDED, PLUGIN_AUTHOR, PLUGIN_VERSION_1} from "../../../../src/common/Constants.sol"; -import "../../../../src/msca/6900/v0.7/interfaces/IStandardExecutor.sol"; -import "../../../../src/msca/6900/v0.7/interfaces/IPluginManager.sol"; + import "../../../../src/msca/6900/v0.7/interfaces/IPluginExecutor.sol"; +import "../../../../src/msca/6900/v0.7/interfaces/IPluginManager.sol"; +import "../../../../src/msca/6900/v0.7/interfaces/IStandardExecutor.sol"; + import "../../../../src/msca/6900/v0.7/plugins/BasePlugin.sol"; import "../../../util/TestLiquidityPool.sol"; +import "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; import "forge-std/src/console.sol"; /** diff --git a/test/msca/6900/v0.7/TestTokenPlugin.sol b/test/msca/6900/v0.7/TestTokenPlugin.sol index 2857d0a..043545f 100644 --- a/test/msca/6900/v0.7/TestTokenPlugin.sol +++ b/test/msca/6900/v0.7/TestTokenPlugin.sol @@ -18,15 +18,17 @@ */ pragma solidity 0.8.24; -import "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; +import {PLUGIN_AUTHOR, PLUGIN_VERSION_1, SIG_VALIDATION_SUCCEEDED} from "../../../../src/common/Constants.sol"; import "../../../../src/msca/6900/v0.7/common/Structs.sol"; -import {SIG_VALIDATION_SUCCEEDED, PLUGIN_AUTHOR, PLUGIN_VERSION_1} from "../../../../src/common/Constants.sol"; -import "../../../../src/msca/6900/v0.7/interfaces/IStandardExecutor.sol"; -import "../../../../src/msca/6900/v0.7/interfaces/IPluginManager.sol"; + import "../../../../src/msca/6900/v0.7/interfaces/IPluginExecutor.sol"; +import "../../../../src/msca/6900/v0.7/interfaces/IPluginManager.sol"; +import "../../../../src/msca/6900/v0.7/interfaces/IStandardExecutor.sol"; + import "../../../../src/msca/6900/v0.7/plugins/BasePlugin.sol"; import "../../../../src/msca/6900/v0.7/plugins/v1_0_0/acl/ISingleOwnerPlugin.sol"; import "../../../util/TestLiquidityPool.sol"; +import "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; import "forge-std/src/console.sol"; /** diff --git a/test/msca/6900/v0.7/TestTokenWithPostHookOnlyPlugin.sol b/test/msca/6900/v0.7/TestTokenWithPostHookOnlyPlugin.sol index e44277a..284475e 100644 --- a/test/msca/6900/v0.7/TestTokenWithPostHookOnlyPlugin.sol +++ b/test/msca/6900/v0.7/TestTokenWithPostHookOnlyPlugin.sol @@ -18,15 +18,17 @@ */ pragma solidity 0.8.24; -import "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; +import {PLUGIN_AUTHOR, PLUGIN_VERSION_1, SIG_VALIDATION_SUCCEEDED} from "../../../../src/common/Constants.sol"; import "../../../../src/msca/6900/v0.7/common/Structs.sol"; -import {SIG_VALIDATION_SUCCEEDED, PLUGIN_VERSION_1, PLUGIN_AUTHOR} from "../../../../src/common/Constants.sol"; -import "../../../../src/msca/6900/v0.7/interfaces/IStandardExecutor.sol"; -import "../../../../src/msca/6900/v0.7/interfaces/IPluginManager.sol"; + import "../../../../src/msca/6900/v0.7/interfaces/IPluginExecutor.sol"; +import "../../../../src/msca/6900/v0.7/interfaces/IPluginManager.sol"; +import "../../../../src/msca/6900/v0.7/interfaces/IStandardExecutor.sol"; + import "../../../../src/msca/6900/v0.7/plugins/BasePlugin.sol"; import "../../../../src/msca/6900/v0.7/plugins/v1_0_0/acl/ISingleOwnerPlugin.sol"; import "../../../util/TestLiquidityPool.sol"; +import "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; import "forge-std/src/console.sol"; /** diff --git a/test/msca/6900/v0.7/TestTokenWithPreHookOnlyPlugin.sol b/test/msca/6900/v0.7/TestTokenWithPreHookOnlyPlugin.sol index f9d3f0f..49ae49e 100644 --- a/test/msca/6900/v0.7/TestTokenWithPreHookOnlyPlugin.sol +++ b/test/msca/6900/v0.7/TestTokenWithPreHookOnlyPlugin.sol @@ -18,15 +18,17 @@ */ pragma solidity 0.8.24; -import "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; +import {PLUGIN_AUTHOR, PLUGIN_VERSION_1, SIG_VALIDATION_SUCCEEDED} from "../../../../src/common/Constants.sol"; import "../../../../src/msca/6900/v0.7/common/Structs.sol"; -import {SIG_VALIDATION_SUCCEEDED, PLUGIN_VERSION_1, PLUGIN_AUTHOR} from "../../../../src/common/Constants.sol"; -import "../../../../src/msca/6900/v0.7/interfaces/IStandardExecutor.sol"; -import "../../../../src/msca/6900/v0.7/interfaces/IPluginManager.sol"; + import "../../../../src/msca/6900/v0.7/interfaces/IPluginExecutor.sol"; +import "../../../../src/msca/6900/v0.7/interfaces/IPluginManager.sol"; +import "../../../../src/msca/6900/v0.7/interfaces/IStandardExecutor.sol"; + import "../../../../src/msca/6900/v0.7/plugins/BasePlugin.sol"; import "../../../../src/msca/6900/v0.7/plugins/v1_0_0/acl/ISingleOwnerPlugin.sol"; import "../../../util/TestLiquidityPool.sol"; +import "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; import "forge-std/src/console.sol"; /** diff --git a/test/msca/6900/v0.7/TestUserOpAllPassValidator.sol b/test/msca/6900/v0.7/TestUserOpAllPassValidator.sol index 39517dc..0b35504 100644 --- a/test/msca/6900/v0.7/TestUserOpAllPassValidator.sol +++ b/test/msca/6900/v0.7/TestUserOpAllPassValidator.sol @@ -18,10 +18,10 @@ */ pragma solidity 0.8.24; -import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; -import {BasePlugin} from "../../../../src/msca/6900/v0.7/plugins/BasePlugin.sol"; import {ValidationData} from "../../../../src/msca/6900/shared/common/Structs.sol"; import {PluginManifest} from "../../../../src/msca/6900/v0.7/common/PluginManifest.sol"; +import {BasePlugin} from "../../../../src/msca/6900/v0.7/plugins/BasePlugin.sol"; +import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; contract TestUserOpAllPassValidator is BasePlugin { ValidationData expectedValidationData; diff --git a/test/msca/6900/v0.7/TestUserOpValidator.sol b/test/msca/6900/v0.7/TestUserOpValidator.sol index b62b2b2..c0edfdf 100644 --- a/test/msca/6900/v0.7/TestUserOpValidator.sol +++ b/test/msca/6900/v0.7/TestUserOpValidator.sol @@ -18,9 +18,9 @@ */ pragma solidity 0.8.24; -import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; -import {BasePlugin} from "../../../../src/msca/6900/v0.7/plugins/BasePlugin.sol"; import {ValidationData} from "../../../../src/msca/6900/shared/common/Structs.sol"; +import {BasePlugin} from "../../../../src/msca/6900/v0.7/plugins/BasePlugin.sol"; +import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; contract TestUserOpValidator is BasePlugin { ValidationData private expectedValidationData; diff --git a/test/msca/6900/v0.7/TestUserOpValidatorHook.sol b/test/msca/6900/v0.7/TestUserOpValidatorHook.sol index d4a635d..4b6fe1c 100644 --- a/test/msca/6900/v0.7/TestUserOpValidatorHook.sol +++ b/test/msca/6900/v0.7/TestUserOpValidatorHook.sol @@ -18,9 +18,9 @@ */ pragma solidity 0.8.24; -import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; -import {BasePlugin} from "../../../../src/msca/6900/v0.7/plugins/BasePlugin.sol"; import {ValidationData} from "../../../../src/msca/6900/shared/common/Structs.sol"; +import {BasePlugin} from "../../../../src/msca/6900/v0.7/plugins/BasePlugin.sol"; +import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; contract TestValidatorHook is BasePlugin { ValidationData expectedValidationData; diff --git a/test/msca/6900/v0.7/TestUserOpValidatorWithDependencyHook.sol b/test/msca/6900/v0.7/TestUserOpValidatorWithDependencyHook.sol index 169686c..74862ab 100644 --- a/test/msca/6900/v0.7/TestUserOpValidatorWithDependencyHook.sol +++ b/test/msca/6900/v0.7/TestUserOpValidatorWithDependencyHook.sol @@ -18,9 +18,9 @@ */ pragma solidity 0.8.24; +import {ValidationData} from "../../../../src/msca/6900/shared/common/Structs.sol"; import "../../../../src/msca/6900/v0.7/plugins/BasePlugin.sol"; import "../../../../src/msca/6900/v0.7/plugins/v1_0_0/acl/ISingleOwnerPlugin.sol"; -import {ValidationData} from "../../../../src/msca/6900/shared/common/Structs.sol"; /// This hook cannot be installed due to expecting being installed with hook dependencies contract TestUserOpValidatorWithDependencyHook is BasePlugin { diff --git a/test/msca/6900/v0.7/UpgradableMSCA.t.sol b/test/msca/6900/v0.7/UpgradableMSCA.t.sol index 83e2cc6..d14fc36 100644 --- a/test/msca/6900/v0.7/UpgradableMSCA.t.sol +++ b/test/msca/6900/v0.7/UpgradableMSCA.t.sol @@ -18,39 +18,44 @@ */ pragma solidity 0.8.24; -import {TestUtils} from "../../../util/TestUtils.sol"; -import {TestERC721} from "../../../util/TestERC721.sol"; -import {TestERC1155} from "../../../util/TestERC1155.sol"; -import {UpgradableMSCA} from "../../../../src/msca/6900/v0.7/account/UpgradableMSCA.sol"; -import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; -import {TestCircleMSCA} from "./TestCircleMSCA.sol"; -import {FunctionReference, ExecutionFunctionConfig} from "../../../../src/msca/6900/v0.7/common/Structs.sol"; -import {TestUserOpValidator} from "./TestUserOpValidator.sol"; -import {TestValidatorHook} from "./TestUserOpValidatorHook.sol"; -import {TestCircleMSCAFactory} from "./TestCircleMSCAFactory.sol"; -import {SingleOwnerPlugin} from "../../../../src/msca/6900/v0.7/plugins/v1_0_0/acl/SingleOwnerPlugin.sol"; -import {TestLiquidityPool} from "../../../util/TestLiquidityPool.sol"; import {EMPTY_FUNCTION_REFERENCE} from "../../../../src/common/Constants.sol"; -import {FunctionReferenceLib} from "../../../../src/msca/6900/v0.7/libs/FunctionReferenceLib.sol"; -import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; -import {PluginManager} from "../../../../src/msca/6900/v0.7/managers/PluginManager.sol"; + import {ValidationData} from "../../../../src/msca/6900/shared/common/Structs.sol"; -import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; -import {TestValidatorHook} from "../v0.7/TestUserOpValidatorHook.sol"; -import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; +import {UpgradableMSCA} from "../../../../src/msca/6900/v0.7/account/UpgradableMSCA.sol"; + +import { + PRE_HOOK_ALWAYS_DENY_FUNCTION_REFERENCE, + RUNTIME_VALIDATION_ALWAYS_ALLOW_FUNCTION_REFERENCE +} from "../../../../src/msca/6900/v0.7/common/Constants.sol"; import { - PluginManifest, - ManifestFunction, ManifestAssociatedFunction, ManifestAssociatedFunctionType, ManifestExecutionHook, - ManifestExternalCallPermission + ManifestExternalCallPermission, + ManifestFunction, + PluginManifest } from "../../../../src/msca/6900/v0.7/common/PluginManifest.sol"; +import {ExecutionFunctionConfig, FunctionReference} from "../../../../src/msca/6900/v0.7/common/Structs.sol"; import {IStandardExecutor} from "../../../../src/msca/6900/v0.7/interfaces/IStandardExecutor.sol"; -import { - RUNTIME_VALIDATION_ALWAYS_ALLOW_FUNCTION_REFERENCE, - PRE_HOOK_ALWAYS_DENY_FUNCTION_REFERENCE -} from "../../../../src/msca/6900/v0.7/common/Constants.sol"; +import {FunctionReferenceLib} from "../../../../src/msca/6900/v0.7/libs/FunctionReferenceLib.sol"; +import {PluginManager} from "../../../../src/msca/6900/v0.7/managers/PluginManager.sol"; +import {SingleOwnerPlugin} from "../../../../src/msca/6900/v0.7/plugins/v1_0_0/acl/SingleOwnerPlugin.sol"; +import {TestERC1155} from "../../../util/TestERC1155.sol"; +import {TestERC721} from "../../../util/TestERC721.sol"; + +import {TestLiquidityPool} from "../../../util/TestLiquidityPool.sol"; +import {TestUtils} from "../../../util/TestUtils.sol"; + +import {TestValidatorHook} from "../v0.7/TestUserOpValidatorHook.sol"; +import {TestCircleMSCA} from "./TestCircleMSCA.sol"; +import {TestCircleMSCAFactory} from "./TestCircleMSCAFactory.sol"; +import {TestUserOpValidator} from "./TestUserOpValidator.sol"; +import {TestValidatorHook} from "./TestUserOpValidatorHook.sol"; +import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; + +import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; +import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; +import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; contract UpgradableMSCATest is TestUtils { using FunctionReferenceLib for bytes21; diff --git a/test/msca/6900/v0.7/UpgradableMSCAFactory.t.sol b/test/msca/6900/v0.7/UpgradableMSCAFactory.t.sol index 1ea74e1..d69213b 100644 --- a/test/msca/6900/v0.7/UpgradableMSCAFactory.t.sol +++ b/test/msca/6900/v0.7/UpgradableMSCAFactory.t.sol @@ -18,20 +18,23 @@ */ pragma solidity 0.8.24; -import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; -import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; -import {TestUtils} from "../../../util/TestUtils.sol"; -import {UpgradableMSCAFactory} from "../../../../src/msca/6900/v0.7/factories/UpgradableMSCAFactory.sol"; +import {InvalidInitializationInput} from "../../../../src/msca/6900/shared/common/Errors.sol"; import {UpgradableMSCA} from "../../../../src/msca/6900/v0.7/account/UpgradableMSCA.sol"; + +import {FunctionReference} from "../../../../src/msca/6900/v0.7/common/Structs.sol"; +import {UpgradableMSCAFactory} from "../../../../src/msca/6900/v0.7/factories/UpgradableMSCAFactory.sol"; + +import {IStandardExecutor} from "../../../../src/msca/6900/v0.7/interfaces/IStandardExecutor.sol"; import {PluginManager} from "../../../../src/msca/6900/v0.7/managers/PluginManager.sol"; import {SingleOwnerPlugin} from "../../../../src/msca/6900/v0.7/plugins/v1_0_0/acl/SingleOwnerPlugin.sol"; -import {TestLiquidityPool} from "../../../util/TestLiquidityPool.sol"; -import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; -import {InvalidInitializationInput} from "../../../../src/msca/6900/shared/common/Errors.sol"; import {ExecutionUtils} from "../../../../src/utils/ExecutionUtils.sol"; -import {FunctionReference} from "../../../../src/msca/6900/v0.7/common/Structs.sol"; +import {TestLiquidityPool} from "../../../util/TestLiquidityPool.sol"; +import {TestUtils} from "../../../util/TestUtils.sol"; +import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; + import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; -import {IStandardExecutor} from "../../../../src/msca/6900/v0.7/interfaces/IStandardExecutor.sol"; +import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; +import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; contract UpgradableMSCAFactoryTest is TestUtils { event AccountCreated(address indexed proxy, bytes32 sender, bytes32 salt); diff --git a/test/msca/6900/v0.7/WalletStorageV1Lib.t.sol b/test/msca/6900/v0.7/WalletStorageV1Lib.t.sol index d08b8e1..441f5b8 100644 --- a/test/msca/6900/v0.7/WalletStorageV1Lib.t.sol +++ b/test/msca/6900/v0.7/WalletStorageV1Lib.t.sol @@ -18,15 +18,15 @@ */ pragma solidity 0.8.24; -import "../../../util/TestUtils.sol"; -import "forge-std/src/console.sol"; +import {SENTINEL_BYTES21} from "../../../../src/common/Constants.sol"; import "../../../../src/msca/6900/v0.7/account/UpgradableMSCA.sol"; -import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; -import "./TestCircleMSCA.sol"; import "../../../../src/msca/6900/v0.7/common/Structs.sol"; +import "../../../util/TestUtils.sol"; +import "./TestCircleMSCA.sol"; import "./TestUserOpValidator.sol"; import "./TestUserOpValidatorHook.sol"; -import {SENTINEL_BYTES21} from "../../../../src/common/Constants.sol"; +import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; +import "forge-std/src/console.sol"; contract WalletStorageV1LibTest is TestUtils { using RepeatableFunctionReferenceDLLLib for RepeatableBytes21DLL; diff --git a/test/msca/6900/v0.7/plugins/AddressBookPluginWithFullMSCA.t.sol b/test/msca/6900/v0.7/plugins/AddressBookPluginWithFullMSCA.t.sol index 1d771b9..72a5276 100644 --- a/test/msca/6900/v0.7/plugins/AddressBookPluginWithFullMSCA.t.sol +++ b/test/msca/6900/v0.7/plugins/AddressBookPluginWithFullMSCA.t.sol @@ -18,19 +18,20 @@ */ pragma solidity 0.8.24; -import "../../../../util/TestUtils.sol"; -import "forge-std/src/console.sol"; -import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; +import "../../../../../src/msca/6900/v0.7/account/BaseMSCA.sol"; +import {PRE_HOOK_ALWAYS_DENY_FUNCTION_REFERENCE} from "../../../../../src/msca/6900/v0.7/common/Constants.sol"; import "../../../../../src/msca/6900/v0.7/common/Structs.sol"; -import "../../../../../src/msca/6900/v0.7/plugins/v1_0_0/acl/SingleOwnerPlugin.sol"; -import "../../../../util/TestLiquidityPool.sol"; -import "../../../../../src/msca/6900/v0.7/plugins/v1_0_0/addressbook/IAddressBookPlugin.sol"; import "../../../../../src/msca/6900/v0.7/factories/UpgradableMSCAFactory.sol"; import "../../../../../src/msca/6900/v0.7/libs/FunctionReferenceLib.sol"; -import "../../../../../src/utils/ExecutionUtils.sol"; +import "../../../../../src/msca/6900/v0.7/plugins/v1_0_0/acl/SingleOwnerPlugin.sol"; + import "../../../../../src/msca/6900/v0.7/plugins/v1_0_0/addressbook/AddressBookPlugin.sol"; -import "../../../../../src/msca/6900/v0.7/account/BaseMSCA.sol"; -import {PRE_HOOK_ALWAYS_DENY_FUNCTION_REFERENCE} from "../../../../../src/msca/6900/v0.7/common/Constants.sol"; +import "../../../../../src/msca/6900/v0.7/plugins/v1_0_0/addressbook/IAddressBookPlugin.sol"; +import "../../../../../src/utils/ExecutionUtils.sol"; +import "../../../../util/TestLiquidityPool.sol"; +import "../../../../util/TestUtils.sol"; +import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; +import "forge-std/src/console.sol"; // some common test cases related to plugin itself is covered in AddressBookPluginWithSemiMSCATest contract AddressBookPluginWithFullMSCATest is TestUtils { diff --git a/test/msca/6900/v0.7/plugins/AddressBookPluginWithSemiMSCA.t.sol b/test/msca/6900/v0.7/plugins/AddressBookPluginWithSemiMSCA.t.sol index 7e2545e..84c0825 100644 --- a/test/msca/6900/v0.7/plugins/AddressBookPluginWithSemiMSCA.t.sol +++ b/test/msca/6900/v0.7/plugins/AddressBookPluginWithSemiMSCA.t.sol @@ -18,20 +18,20 @@ */ pragma solidity 0.8.24; -import "../../../../util/TestUtils.sol"; -import "forge-std/src/console.sol"; -import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; -import "../../../../../src/msca/6900/v0.7/common/Structs.sol"; -import "../../../../util/TestLiquidityPool.sol"; +import {NotImplemented} from "../../../../../src/msca/6900/shared/common/Errors.sol"; import "../../../../../src/msca/6900/v0.7/account/semi/SingleOwnerMSCA.sol"; +import "../../../../../src/msca/6900/v0.7/common/Structs.sol"; import "../../../../../src/msca/6900/v0.7/factories/semi/SingleOwnerMSCAFactory.sol"; +import "../../../../../src/msca/6900/v0.7/interfaces/IPluginManager.sol"; +import "../../../../../src/msca/6900/v0.7/interfaces/IStandardExecutor.sol"; import "../../../../../src/msca/6900/v0.7/libs/FunctionReferenceLib.sol"; -import "../../../../../src/utils/ExecutionUtils.sol"; -import "../../../../../src/msca/6900/v0.7/plugins/v1_0_0/addressbook/IAddressBookPlugin.sol"; import "../../../../../src/msca/6900/v0.7/plugins/v1_0_0/addressbook/AddressBookPlugin.sol"; -import "../../../../../src/msca/6900/v0.7/interfaces/IStandardExecutor.sol"; -import "../../../../../src/msca/6900/v0.7/interfaces/IPluginManager.sol"; -import {NotImplemented} from "../../../../../src/msca/6900/shared/common/Errors.sol"; +import "../../../../../src/msca/6900/v0.7/plugins/v1_0_0/addressbook/IAddressBookPlugin.sol"; +import "../../../../../src/utils/ExecutionUtils.sol"; +import "../../../../util/TestLiquidityPool.sol"; +import "../../../../util/TestUtils.sol"; +import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; +import "forge-std/src/console.sol"; contract AddressBookPluginWithSemiMSCATest is TestUtils { using FunctionReferenceLib for bytes21; diff --git a/test/msca/6900/v0.7/plugins/ColdStorageAddressBookPluginWithFullMSCA.t.sol b/test/msca/6900/v0.7/plugins/ColdStorageAddressBookPluginWithFullMSCA.t.sol index ae43877..b9a1d48 100644 --- a/test/msca/6900/v0.7/plugins/ColdStorageAddressBookPluginWithFullMSCA.t.sol +++ b/test/msca/6900/v0.7/plugins/ColdStorageAddressBookPluginWithFullMSCA.t.sol @@ -18,35 +18,38 @@ */ pragma solidity 0.8.24; -import {TestUtils} from "../../../../util/TestUtils.sol"; -import {console} from "forge-std/src/console.sol"; -import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; -import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; -import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; +import {EMPTY_FUNCTION_REFERENCE} from "../../../../../src/common/Constants.sol"; +import {UnauthorizedCaller} from "../../../../../src/msca/6900/shared/common/Errors.sol"; +import {BaseMSCA} from "../../../../../src/msca/6900/v0.7/account/BaseMSCA.sol"; +import {UpgradableMSCA} from "../../../../../src/msca/6900/v0.7/account/UpgradableMSCA.sol"; + +import {RUNTIME_VALIDATION_ALWAYS_ALLOW_FUNCTION_REFERENCE} from + "../../../../../src/msca/6900/v0.7/common/Constants.sol"; import { - FunctionReference, + Call, ExecutionFunctionConfig, ExecutionHooks, - Call + FunctionReference } from "../../../../../src/msca/6900/v0.7/common/Structs.sol"; -import {TestLiquidityPool} from "../../../../util/TestLiquidityPool.sol"; -import {FunctionReferenceLib} from "../../../../../src/msca/6900/v0.7/libs/FunctionReferenceLib.sol"; -import {ExecutionUtils} from "../../../../../src/utils/ExecutionUtils.sol"; -import {IAddressBookPlugin} from "../../../../../src/msca/6900/v0.7/plugins/v1_0_0/addressbook/IAddressBookPlugin.sol"; -import {IStandardExecutor} from "../../../../../src/msca/6900/v0.7/interfaces/IStandardExecutor.sol"; +import {UpgradableMSCAFactory} from "../../../../../src/msca/6900/v0.7/factories/UpgradableMSCAFactory.sol"; import {IPluginManager} from "../../../../../src/msca/6900/v0.7/interfaces/IPluginManager.sol"; +import {IStandardExecutor} from "../../../../../src/msca/6900/v0.7/interfaces/IStandardExecutor.sol"; +import {FunctionReferenceLib} from "../../../../../src/msca/6900/v0.7/libs/FunctionReferenceLib.sol"; + import {PluginManager} from "../../../../../src/msca/6900/v0.7/managers/PluginManager.sol"; + +import {ISingleOwnerPlugin} from "../../../../../src/msca/6900/v0.7/plugins/v1_0_0/acl/ISingleOwnerPlugin.sol"; +import {SingleOwnerPlugin} from "../../../../../src/msca/6900/v0.7/plugins/v1_0_0/acl/SingleOwnerPlugin.sol"; import {ColdStorageAddressBookPlugin} from "../../../../../src/msca/6900/v0.7/plugins/v1_0_0/addressbook/ColdStorageAddressBookPlugin.sol"; -import {BaseMSCA} from "../../../../../src/msca/6900/v0.7/account/BaseMSCA.sol"; -import {UpgradableMSCA} from "../../../../../src/msca/6900/v0.7/account/UpgradableMSCA.sol"; -import {EMPTY_FUNCTION_REFERENCE} from "../../../../../src/common/Constants.sol"; -import {UnauthorizedCaller} from "../../../../../src/msca/6900/shared/common/Errors.sol"; -import {UpgradableMSCAFactory} from "../../../../../src/msca/6900/v0.7/factories/UpgradableMSCAFactory.sol"; -import {SingleOwnerPlugin} from "../../../../../src/msca/6900/v0.7/plugins/v1_0_0/acl/SingleOwnerPlugin.sol"; -import {ISingleOwnerPlugin} from "../../../../../src/msca/6900/v0.7/plugins/v1_0_0/acl/ISingleOwnerPlugin.sol"; -import {RUNTIME_VALIDATION_ALWAYS_ALLOW_FUNCTION_REFERENCE} from - "../../../../../src/msca/6900/v0.7/common/Constants.sol"; +import {IAddressBookPlugin} from "../../../../../src/msca/6900/v0.7/plugins/v1_0_0/addressbook/IAddressBookPlugin.sol"; +import {ExecutionUtils} from "../../../../../src/utils/ExecutionUtils.sol"; +import {TestLiquidityPool} from "../../../../util/TestLiquidityPool.sol"; +import {TestUtils} from "../../../../util/TestUtils.sol"; +import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; +import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; +import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; +import {console} from "forge-std/src/console.sol"; // some common test cases related to plugin itself is covered in ColdStorageAddressBookPluginWithSemiMSCATest contract ColdStorageAddressBookPluginWithFullMSCATest is TestUtils { diff --git a/test/msca/6900/v0.7/plugins/ColdStorageAddressBookPluginWithSemiMSCA.t.sol b/test/msca/6900/v0.7/plugins/ColdStorageAddressBookPluginWithSemiMSCA.t.sol index 6b71377..656e5ed 100644 --- a/test/msca/6900/v0.7/plugins/ColdStorageAddressBookPluginWithSemiMSCA.t.sol +++ b/test/msca/6900/v0.7/plugins/ColdStorageAddressBookPluginWithSemiMSCA.t.sol @@ -18,38 +18,43 @@ */ pragma solidity 0.8.24; -import {TestUtils} from "../../../../util/TestUtils.sol"; -import {console} from "forge-std/src/console.sol"; -import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; -import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; -import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; +import {EMPTY_FUNCTION_REFERENCE, PLUGIN_AUTHOR, PLUGIN_VERSION_1} from "../../../../../src/common/Constants.sol"; +import {NotImplemented, UnauthorizedCaller, Unsupported} from "../../../../../src/msca/6900/shared/common/Errors.sol"; +import {BaseMSCA} from "../../../../../src/msca/6900/v0.7/account/BaseMSCA.sol"; +import {SingleOwnerMSCA} from "../../../../../src/msca/6900/v0.7/account/semi/SingleOwnerMSCA.sol"; + +import {RUNTIME_VALIDATION_ALWAYS_ALLOW_FUNCTION_REFERENCE} from + "../../../../../src/msca/6900/v0.7/common/Constants.sol"; +import {PluginMetadata} from "../../../../../src/msca/6900/v0.7/common/PluginManifest.sol"; import { - FunctionReference, + Call, ExecutionFunctionConfig, ExecutionHooks, - Call + FunctionReference } from "../../../../../src/msca/6900/v0.7/common/Structs.sol"; -import {TestLiquidityPool} from "../../../../util/TestLiquidityPool.sol"; -import {SingleOwnerMSCA} from "../../../../../src/msca/6900/v0.7/account/semi/SingleOwnerMSCA.sol"; import {SingleOwnerMSCAFactory} from "../../../../../src/msca/6900/v0.7/factories/semi/SingleOwnerMSCAFactory.sol"; -import {FunctionReferenceLib} from "../../../../../src/msca/6900/v0.7/libs/FunctionReferenceLib.sol"; -import {ExecutionUtils} from "../../../../../src/utils/ExecutionUtils.sol"; -import {IAddressBookPlugin} from "../../../../../src/msca/6900/v0.7/plugins/v1_0_0/addressbook/IAddressBookPlugin.sol"; -import {IStandardExecutor} from "../../../../../src/msca/6900/v0.7/interfaces/IStandardExecutor.sol"; import {IPluginManager} from "../../../../../src/msca/6900/v0.7/interfaces/IPluginManager.sol"; +import {IStandardExecutor} from "../../../../../src/msca/6900/v0.7/interfaces/IStandardExecutor.sol"; +import {FunctionReferenceLib} from "../../../../../src/msca/6900/v0.7/libs/FunctionReferenceLib.sol"; + import {PluginManager} from "../../../../../src/msca/6900/v0.7/managers/PluginManager.sol"; + +import {BasePlugin} from "../../../../../src/msca/6900/v0.7/plugins/BasePlugin.sol"; import {ColdStorageAddressBookPlugin} from "../../../../../src/msca/6900/v0.7/plugins/v1_0_0/addressbook/ColdStorageAddressBookPlugin.sol"; -import {PluginMetadata} from "../../../../../src/msca/6900/v0.7/common/PluginManifest.sol"; -import {BaseMSCA} from "../../../../../src/msca/6900/v0.7/account/BaseMSCA.sol"; -import {BasePlugin} from "../../../../../src/msca/6900/v0.7/plugins/BasePlugin.sol"; -import {PLUGIN_VERSION_1, PLUGIN_AUTHOR, EMPTY_FUNCTION_REFERENCE} from "../../../../../src/common/Constants.sol"; -import {UnauthorizedCaller, NotImplemented, Unsupported} from "../../../../../src/msca/6900/shared/common/Errors.sol"; +import {IAddressBookPlugin} from "../../../../../src/msca/6900/v0.7/plugins/v1_0_0/addressbook/IAddressBookPlugin.sol"; +import {ExecutionUtils} from "../../../../../src/utils/ExecutionUtils.sol"; + import {TestERC1155} from "../../../../util/TestERC1155.sol"; import {TestERC721} from "../../../../util/TestERC721.sol"; +import {TestLiquidityPool} from "../../../../util/TestLiquidityPool.sol"; +import {TestUtils} from "../../../../util/TestUtils.sol"; + import {ColdStorageAddressBookPluginWrapper} from "./ColdStorageAddressBookPluginWrapper.sol"; -import {RUNTIME_VALIDATION_ALWAYS_ALLOW_FUNCTION_REFERENCE} from - "../../../../../src/msca/6900/v0.7/common/Constants.sol"; +import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; +import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; +import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; +import {console} from "forge-std/src/console.sol"; contract ColdStorageAddressBookPluginWithSemiMSCATest is TestUtils { using FunctionReferenceLib for bytes21; diff --git a/test/msca/6900/v0.7/plugins/WeightedWebauthnMultisigPlugin.t.sol b/test/msca/6900/v0.7/plugins/WeightedWebauthnMultisigPlugin.t.sol index 2378ffc..c7ec8b7 100644 --- a/test/msca/6900/v0.7/plugins/WeightedWebauthnMultisigPlugin.t.sol +++ b/test/msca/6900/v0.7/plugins/WeightedWebauthnMultisigPlugin.t.sol @@ -21,45 +21,50 @@ pragma solidity 0.8.24; /* solhint-disable max-states-count */ -import {TestUtils} from "../../../../util/TestUtils.sol"; -import {WeightedWebauthnMultisigPlugin} from - "../../../../../src/msca/6900/v0.7/plugins/v1_0_0/multisig/WeightedWebauthnMultisigPlugin.sol"; -import {BasePlugin} from "../../../../../src/msca/6900/v0.7/plugins/BasePlugin.sol"; -import {BaseMultisigPlugin} from "../../../../../src/msca/6900/v0.7/plugins/v1_0_0/multisig/BaseMultisigPlugin.sol"; -import {IPlugin} from "../../../../../src/msca/6900/v0.7/interfaces/IPlugin.sol"; -import {IWeightedMultisigPlugin} from - "../../../../../src/msca/6900/v0.7/plugins/v1_0_0/multisig/IWeightedMultisigPlugin.sol"; -import {PluginManifest, PluginMetadata} from "../../../../../src/msca/6900/v0.7/common/PluginManifest.sol"; import { + CredentialType, + OwnerData, + PublicKey, + WebAuthnData, + WebAuthnSigDynamicPart +} from "../../../../../src/common/CommonStructs.sol"; +import { + EIP1271_INVALID_SIGNATURE, + EIP1271_VALID_SIGNATURE, PLUGIN_AUTHOR, PLUGIN_VERSION_1, - EIP1271_VALID_SIGNATURE, - EIP1271_INVALID_SIGNATURE, - SIG_VALIDATION_SUCCEEDED, SIG_VALIDATION_FAILED, + SIG_VALIDATION_SUCCEEDED, ZERO_BYTES32 } from "../../../../../src/common/Constants.sol"; -import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; -import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; -import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; -import { - PublicKey, - WebAuthnData, - WebAuthnSigDynamicPart, - OwnerData, - CredentialType -} from "../../../../../src/common/CommonStructs.sol"; -import {PublicKeyLib} from "../../../../../src/libs/PublicKeyLib.sol"; + import {AddressBytesLib} from "../../../../../src/libs/AddressBytesLib.sol"; -import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; +import {PublicKeyLib} from "../../../../../src/libs/PublicKeyLib.sol"; + +import {WebAuthnLib} from "../../../../../src/libs/WebAuthnLib.sol"; import {NotImplemented} from "../../../../../src/msca/6900/shared/common/Errors.sol"; +import {PluginManifest, PluginMetadata} from "../../../../../src/msca/6900/v0.7/common/PluginManifest.sol"; +import {IPlugin} from "../../../../../src/msca/6900/v0.7/interfaces/IPlugin.sol"; +import {BasePlugin} from "../../../../../src/msca/6900/v0.7/plugins/BasePlugin.sol"; +import {BaseMultisigPlugin} from "../../../../../src/msca/6900/v0.7/plugins/v1_0_0/multisig/BaseMultisigPlugin.sol"; +import {IWeightedMultisigPlugin} from + "../../../../../src/msca/6900/v0.7/plugins/v1_0_0/multisig/IWeightedMultisigPlugin.sol"; +import {WeightedWebauthnMultisigPlugin} from + "../../../../../src/msca/6900/v0.7/plugins/v1_0_0/multisig/WeightedWebauthnMultisigPlugin.sol"; + import {MockContractOwner} from "../../../../util/MockContractOwner.sol"; -import {WebAuthnLib} from "../../../../../src/libs/WebAuthnLib.sol"; -import {VmSafe} from "forge-std/src/Vm.sol"; +import {TestUtils} from "../../../../util/TestUtils.sol"; +import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; +import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; +import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; + import {FCL_Elliptic_ZZ} from "@fcl/FCL_elliptic.sol"; +import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; + +import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; import {stdJson} from "forge-std/src/StdJson.sol"; +import {VmSafe} from "forge-std/src/Vm.sol"; import {console} from "forge-std/src/console.sol"; -import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; contract WeightedWebauthnMultisigPluginTest is TestUtils { using ECDSA for bytes32; diff --git a/test/msca/6900/v0.8/DynamicValidationHookData.t.sol b/test/msca/6900/v0.8/DynamicValidationHookData.t.sol index 7123e25..a1b56b7 100644 --- a/test/msca/6900/v0.8/DynamicValidationHookData.t.sol +++ b/test/msca/6900/v0.8/DynamicValidationHookData.t.sol @@ -20,22 +20,26 @@ pragma solidity 0.8.24; /* solhint-disable max-states-count */ -import {AccountTestUtils} from "./utils/AccountTestUtils.sol"; import {UpgradableMSCA} from "../../../../src/msca/6900/v0.8/account/UpgradableMSCA.sol"; -import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; -import {TestCircleMSCA} from "./TestCircleMSCA.sol"; + import {ModuleEntity} from "../../../../src/msca/6900/v0.8/common/Types.sol"; -import {TestCircleMSCAFactory} from "./TestCircleMSCAFactory.sol"; + +import {IStandardExecutor} from "../../../../src/msca/6900/v0.8/interfaces/IStandardExecutor.sol"; +import {ModuleEntityLib} from "../../../../src/msca/6900/v0.8/libs/thirdparty/ModuleEntityLib.sol"; + +import {ValidationConfigLib} from "../../../../src/msca/6900/v0.8/libs/thirdparty/ValidationConfigLib.sol"; +import {PluginManager} from "../../../../src/msca/6900/v0.8/managers/PluginManager.sol"; import {SingleSignerValidationModule} from "../../../../src/msca/6900/v0.8/plugins/v1_0_0/validation/SingleSignerValidationModule.sol"; -import {ModuleEntityLib} from "../../../../src/msca/6900/v0.8/libs/thirdparty/ModuleEntityLib.sol"; +import {TestCircleMSCA} from "./TestCircleMSCA.sol"; +import {TestCircleMSCAFactory} from "./TestCircleMSCAFactory.sol"; + +import {TestAddressBookPlugin} from "./helpers/TestAddressBookPlugin.sol"; +import {AccountTestUtils} from "./utils/AccountTestUtils.sol"; +import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; -import {PluginManager} from "../../../../src/msca/6900/v0.8/managers/PluginManager.sol"; import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; -import {IStandardExecutor} from "../../../../src/msca/6900/v0.8/interfaces/IStandardExecutor.sol"; -import {TestAddressBookPlugin} from "./helpers/TestAddressBookPlugin.sol"; import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; -import {ValidationConfigLib} from "../../../../src/msca/6900/v0.8/libs/thirdparty/ValidationConfigLib.sol"; // We use TestCircleMSCA (that inherits from UpgradableMSCA) because it has some convenience functions contract DynamicValidationHookDataTest is AccountTestUtils { diff --git a/test/msca/6900/v0.8/FooBarPlugin.sol b/test/msca/6900/v0.8/FooBarPlugin.sol index fae1cf1..83dd076 100644 --- a/test/msca/6900/v0.8/FooBarPlugin.sol +++ b/test/msca/6900/v0.8/FooBarPlugin.sol @@ -18,17 +18,18 @@ */ pragma solidity 0.8.24; -import {PLUGIN_VERSION_1, PLUGIN_AUTHOR} from "../../../../src/common/Constants.sol"; -import {BasePlugin} from "../../../../src/msca/6900/v0.8/plugins/BasePlugin.sol"; +import {PLUGIN_AUTHOR, PLUGIN_VERSION_1} from "../../../../src/common/Constants.sol"; + +import {SIG_VALIDATION_SUCCEEDED} from "../../../../src/common/Constants.sol"; +import {NotImplementedFunction} from "../../../../src/msca/6900/shared/common/Errors.sol"; import { + ManifestExecutionFunction, PluginManifest, - PluginMetadata, - ManifestExecutionFunction + PluginMetadata } from "../../../../src/msca/6900/v0.8/common/PluginManifest.sol"; -import {NotImplementedFunction} from "../../../../src/msca/6900/shared/common/Errors.sol"; import {IValidation} from "../../../../src/msca/6900/v0.8/interfaces/IValidation.sol"; +import {BasePlugin} from "../../../../src/msca/6900/v0.8/plugins/BasePlugin.sol"; import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; -import {SIG_VALIDATION_SUCCEEDED} from "../../../../src/common/Constants.sol"; contract FooBarPlugin is IValidation, BasePlugin { string public constant NAME = "Your Favourite Fruit Bar Plugin"; diff --git a/test/msca/6900/v0.8/PermittedCall.t.sol b/test/msca/6900/v0.8/PermittedCall.t.sol index b3b617e..5e347d0 100644 --- a/test/msca/6900/v0.8/PermittedCall.t.sol +++ b/test/msca/6900/v0.8/PermittedCall.t.sol @@ -18,14 +18,15 @@ */ pragma solidity 0.8.24; -import {TestUtils} from "../../../util/TestUtils.sol"; -import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; -import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; -import {PluginManager} from "../../../../src/msca/6900/v0.8/managers/PluginManager.sol"; -import {TestPermittedCallPlugin} from "./TestPermittedCallPlugin.sol"; -import {UpgradableMSCAFactory} from "../../../../src/msca/6900/v0.8/factories/UpgradableMSCAFactory.sol"; import {UpgradableMSCA} from "../../../../src/msca/6900/v0.8/account/UpgradableMSCA.sol"; +import {UpgradableMSCAFactory} from "../../../../src/msca/6900/v0.8/factories/UpgradableMSCAFactory.sol"; +import {PluginManager} from "../../../../src/msca/6900/v0.8/managers/PluginManager.sol"; +import {TestUtils} from "../../../util/TestUtils.sol"; + import {FooBarPlugin} from "./FooBarPlugin.sol"; +import {TestPermittedCallPlugin} from "./TestPermittedCallPlugin.sol"; +import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; +import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; contract PermittedCallTest is TestUtils { IEntryPoint private entryPoint = new EntryPoint(); diff --git a/test/msca/6900/v0.8/PluginManager.t.sol b/test/msca/6900/v0.8/PluginManager.t.sol index 3acf268..d818adc 100644 --- a/test/msca/6900/v0.8/PluginManager.t.sol +++ b/test/msca/6900/v0.8/PluginManager.t.sol @@ -18,24 +18,29 @@ */ pragma solidity 0.8.24; -import {AccountTestUtils} from "./utils/AccountTestUtils.sol"; -import {console} from "forge-std/src/console.sol"; -import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; -import {TestCircleMSCA} from "./TestCircleMSCA.sol"; -import {TestLiquidityPool} from "../../../util/TestLiquidityPool.sol"; +import {PLUGIN_AUTHOR, PLUGIN_VERSION_1} from "../../../../src/common/Constants.sol"; +import {PluginMetadata} from "../../../../src/msca/6900/v0.8/common/PluginManifest.sol"; + +import {ModuleEntity, ValidationConfig} from "../../../../src/msca/6900/v0.8/common/Types.sol"; +import {IPluginManager} from "../../../../src/msca/6900/v0.8/interfaces/IPluginManager.sol"; +import {ModuleEntityLib} from "../../../../src/msca/6900/v0.8/libs/thirdparty/ModuleEntityLib.sol"; + +import {ValidationConfigLib} from "../../../../src/msca/6900/v0.8/libs/thirdparty/ValidationConfigLib.sol"; +import {PluginManager} from "../../../../src/msca/6900/v0.8/managers/PluginManager.sol"; import {SingleSignerValidationModule} from "../../../../src/msca/6900/v0.8/plugins/v1_0_0/validation/SingleSignerValidationModule.sol"; -import {TestTokenPlugin} from "./TestTokenPlugin.sol"; +import {TestLiquidityPool} from "../../../util/TestLiquidityPool.sol"; +import {TestCircleMSCA} from "./TestCircleMSCA.sol"; + import {TestCircleMSCAFactory} from "./TestCircleMSCAFactory.sol"; -import {ModuleEntityLib} from "../../../../src/msca/6900/v0.8/libs/thirdparty/ModuleEntityLib.sol"; +import {TestTokenPlugin} from "./TestTokenPlugin.sol"; +import {AccountTestUtils} from "./utils/AccountTestUtils.sol"; +import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; + import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; -import {PluginManager} from "../../../../src/msca/6900/v0.8/managers/PluginManager.sol"; -import {PluginMetadata} from "../../../../src/msca/6900/v0.8/common/PluginManifest.sol"; -import {PLUGIN_VERSION_1, PLUGIN_AUTHOR} from "../../../../src/common/Constants.sol"; + import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; -import {IPluginManager} from "../../../../src/msca/6900/v0.8/interfaces/IPluginManager.sol"; -import {ValidationConfig, ModuleEntity} from "../../../../src/msca/6900/v0.8/common/Types.sol"; -import {ValidationConfigLib} from "../../../../src/msca/6900/v0.8/libs/thirdparty/ValidationConfigLib.sol"; +import {console} from "forge-std/src/console.sol"; /// Tests for install/uninstall contract PluginManagerTest is AccountTestUtils { diff --git a/test/msca/6900/v0.8/SelfCallRule.t.sol b/test/msca/6900/v0.8/SelfCallRule.t.sol index 3b3c15d..09a9b48 100644 --- a/test/msca/6900/v0.8/SelfCallRule.t.sol +++ b/test/msca/6900/v0.8/SelfCallRule.t.sol @@ -18,23 +18,24 @@ */ pragma solidity 0.8.24; -import {AccountTestUtils} from "./utils/AccountTestUtils.sol"; -import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; -import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; -import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; -import {PluginManager} from "../../../../src/msca/6900/v0.8/managers/PluginManager.sol"; -import {SingleSignerValidationModule} from - "../../../../src/msca/6900/v0.8/plugins/v1_0_0/validation/SingleSignerValidationModule.sol"; -import {FooBarPlugin} from "./FooBarPlugin.sol"; +import {BaseMSCA} from "../../../../src/msca/6900/v0.8/account/BaseMSCA.sol"; import {Call} from "../../../../src/msca/6900/v0.8/common/Structs.sol"; -import {ModuleEntityLib} from "../../../../src/msca/6900/v0.8/libs/thirdparty/ModuleEntityLib.sol"; +import {ModuleEntity, ValidationConfig} from "../../../../src/msca/6900/v0.8/common/Types.sol"; import {IAccountExecute} from "../../../../src/msca/6900/v0.8/interfaces/IAccountExecute.sol"; import {IStandardExecutor} from "../../../../src/msca/6900/v0.8/interfaces/IStandardExecutor.sol"; +import {ModuleEntityLib} from "../../../../src/msca/6900/v0.8/libs/thirdparty/ModuleEntityLib.sol"; import {ValidationConfigLib} from "../../../../src/msca/6900/v0.8/libs/thirdparty/ValidationConfigLib.sol"; -import {ValidationConfig, ModuleEntity} from "../../../../src/msca/6900/v0.8/common/Types.sol"; -import {TestCircleMSCAFactory} from "./TestCircleMSCAFactory.sol"; +import {PluginManager} from "../../../../src/msca/6900/v0.8/managers/PluginManager.sol"; +import {SingleSignerValidationModule} from + "../../../../src/msca/6900/v0.8/plugins/v1_0_0/validation/SingleSignerValidationModule.sol"; +import {FooBarPlugin} from "./FooBarPlugin.sol"; + import {TestCircleMSCA} from "./TestCircleMSCA.sol"; -import {BaseMSCA} from "../../../../src/msca/6900/v0.8/account/BaseMSCA.sol"; +import {TestCircleMSCAFactory} from "./TestCircleMSCAFactory.sol"; +import {AccountTestUtils} from "./utils/AccountTestUtils.sol"; +import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; +import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; +import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; contract SelfCallRuleTest is AccountTestUtils { using ModuleEntityLib for ModuleEntity; diff --git a/test/msca/6900/v0.8/TestCircleMSCA.sol b/test/msca/6900/v0.8/TestCircleMSCA.sol index 71db763..a0fdf8a 100644 --- a/test/msca/6900/v0.8/TestCircleMSCA.sol +++ b/test/msca/6900/v0.8/TestCircleMSCA.sol @@ -18,19 +18,19 @@ */ pragma solidity 0.8.24; -import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; -import {StorageSlot} from "@openzeppelin/contracts/utils/StorageSlot.sol"; -import {ERC1967Utils} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol"; -import {WalletStorageLib} from "../../../../src/msca/6900/v0.8/libs/WalletStorageLib.sol"; +import {AddressDLL, Bytes32DLL, Bytes4DLL} from "../../../../src/msca/6900/shared/common/Structs.sol"; import {AddressDLLLib} from "../../../../src/msca/6900/shared/libs/AddressDLLLib.sol"; import {Bytes32DLLLib} from "../../../../src/msca/6900/shared/libs/Bytes32DLLLib.sol"; -import {ModuleEntityLib} from "../../../../src/msca/6900/v0.8/libs/thirdparty/ModuleEntityLib.sol"; -import {UpgradableMSCA} from "../../../../src/msca/6900/v0.8/account/UpgradableMSCA.sol"; -import {PluginManager} from "../../../../src/msca/6900/v0.8/managers/PluginManager.sol"; -import {Bytes32DLL, ExecutionHook, ExecutionDetail} from "../../../../src/msca/6900/v0.8/common/Structs.sol"; -import {AddressDLL, Bytes4DLL, Bytes32DLL} from "../../../../src/msca/6900/shared/common/Structs.sol"; import {Bytes4DLLLib} from "../../../../src/msca/6900/shared/libs/Bytes4DLLLib.sol"; +import {UpgradableMSCA} from "../../../../src/msca/6900/v0.8/account/UpgradableMSCA.sol"; +import {Bytes32DLL, ExecutionDetail, ExecutionHook} from "../../../../src/msca/6900/v0.8/common/Structs.sol"; import {ModuleEntity} from "../../../../src/msca/6900/v0.8/common/Types.sol"; +import {WalletStorageLib} from "../../../../src/msca/6900/v0.8/libs/WalletStorageLib.sol"; +import {ModuleEntityLib} from "../../../../src/msca/6900/v0.8/libs/thirdparty/ModuleEntityLib.sol"; +import {PluginManager} from "../../../../src/msca/6900/v0.8/managers/PluginManager.sol"; +import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; +import {ERC1967Utils} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol"; +import {StorageSlot} from "@openzeppelin/contracts/utils/StorageSlot.sol"; // testing contract with some convenience methods contract TestCircleMSCA is UpgradableMSCA { diff --git a/test/msca/6900/v0.8/TestCircleMSCAFactory.sol b/test/msca/6900/v0.8/TestCircleMSCAFactory.sol index e24241c..2225310 100644 --- a/test/msca/6900/v0.8/TestCircleMSCAFactory.sol +++ b/test/msca/6900/v0.8/TestCircleMSCAFactory.sol @@ -18,16 +18,17 @@ */ pragma solidity 0.8.24; -import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; -import {Create2} from "@openzeppelin/contracts/utils/Create2.sol"; -import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; -import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; -import {TestCircleMSCA} from "./TestCircleMSCA.sol"; +import {Create2FailedDeployment, InvalidLength} from "../../../../src/msca/6900/shared/common/Errors.sol"; import {UpgradableMSCA} from "../../../../src/msca/6900/v0.8/account/UpgradableMSCA.sol"; -import {PluginManager} from "../../../../src/msca/6900/v0.8/managers/PluginManager.sol"; -import {InvalidLength, Create2FailedDeployment} from "../../../../src/msca/6900/shared/common/Errors.sol"; -import {ValidationConfigLib} from "../../../../src/msca/6900/v0.8/libs/thirdparty/ValidationConfigLib.sol"; + import {ValidationConfig} from "../../../../src/msca/6900/v0.8/common/Types.sol"; +import {ValidationConfigLib} from "../../../../src/msca/6900/v0.8/libs/thirdparty/ValidationConfigLib.sol"; +import {PluginManager} from "../../../../src/msca/6900/v0.8/managers/PluginManager.sol"; +import {TestCircleMSCA} from "./TestCircleMSCA.sol"; +import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; +import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; +import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; +import {Create2} from "@openzeppelin/contracts/utils/Create2.sol"; /** * @dev Only for testing purpose. Account factory that creates the TestCircleMSCA with a set of plugins to be installed. diff --git a/test/msca/6900/v0.8/TestPermittedCallPlugin.sol b/test/msca/6900/v0.8/TestPermittedCallPlugin.sol index 7fb6214..3dbfb76 100644 --- a/test/msca/6900/v0.8/TestPermittedCallPlugin.sol +++ b/test/msca/6900/v0.8/TestPermittedCallPlugin.sol @@ -18,14 +18,15 @@ */ pragma solidity 0.8.24; -import {PLUGIN_VERSION_1, PLUGIN_AUTHOR} from "../../../../src/common/Constants.sol"; -import {BasePlugin} from "../../../../src/msca/6900/v0.8/plugins/BasePlugin.sol"; +import {PLUGIN_AUTHOR, PLUGIN_VERSION_1} from "../../../../src/common/Constants.sol"; + import { + ManifestExecutionFunction, PluginManifest, - PluginMetadata, - ManifestExecutionFunction + PluginMetadata } from "../../../../src/msca/6900/v0.8/common/PluginManifest.sol"; import {IPlugin} from "../../../../src/msca/6900/v0.8/interfaces/IPlugin.sol"; +import {BasePlugin} from "../../../../src/msca/6900/v0.8/plugins/BasePlugin.sol"; import {FooBarPlugin} from "./FooBarPlugin.sol"; /** diff --git a/test/msca/6900/v0.8/TestTokenPlugin.sol b/test/msca/6900/v0.8/TestTokenPlugin.sol index 439073c..a2b174a 100644 --- a/test/msca/6900/v0.8/TestTokenPlugin.sol +++ b/test/msca/6900/v0.8/TestTokenPlugin.sol @@ -18,23 +18,26 @@ */ pragma solidity 0.8.24; -import {SIG_VALIDATION_SUCCEEDED, PLUGIN_VERSION_1, PLUGIN_AUTHOR} from "../../../../src/common/Constants.sol"; -import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; -import {BasePlugin} from "../../../../src/msca/6900/v0.8/plugins/BasePlugin.sol"; -import {console} from "forge-std/src/console.sol"; +import {PLUGIN_AUTHOR, PLUGIN_VERSION_1, SIG_VALIDATION_SUCCEEDED} from "../../../../src/common/Constants.sol"; + +import {NotImplementedFunction} from "../../../../src/msca/6900/shared/common/Errors.sol"; import { + ManifestExecutionFunction, + ManifestExecutionHook, + ManifestValidation, PluginManifest, PluginMetadata, - ManifestExecutionHook, - SelectorPermission, - ManifestExecutionFunction, - ManifestValidation + SelectorPermission } from "../../../../src/msca/6900/v0.8/common/PluginManifest.sol"; -import {NotImplementedFunction} from "../../../../src/msca/6900/shared/common/Errors.sol"; -import {IValidation} from "../../../../src/msca/6900/v0.8/interfaces/IValidation.sol"; + import {IExecutionHook} from "../../../../src/msca/6900/v0.8/interfaces/IExecutionHook.sol"; -import {IValidationHook} from "../../../../src/msca/6900/v0.8/interfaces/IValidationHook.sol"; + import {IPlugin} from "../../../../src/msca/6900/v0.8/interfaces/IPlugin.sol"; +import {IValidation} from "../../../../src/msca/6900/v0.8/interfaces/IValidation.sol"; +import {IValidationHook} from "../../../../src/msca/6900/v0.8/interfaces/IValidationHook.sol"; +import {BasePlugin} from "../../../../src/msca/6900/v0.8/plugins/BasePlugin.sol"; +import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; +import {console} from "forge-std/src/console.sol"; /** * @dev Plugin for tests only. This plugin implements everything in manifest. diff --git a/test/msca/6900/v0.8/TestUserOpValidator.sol b/test/msca/6900/v0.8/TestUserOpValidator.sol index 7db3c1d..10b425f 100644 --- a/test/msca/6900/v0.8/TestUserOpValidator.sol +++ b/test/msca/6900/v0.8/TestUserOpValidator.sol @@ -18,13 +18,14 @@ */ pragma solidity 0.8.24; -import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; -import {BasePlugin} from "../../../../src/msca/6900/v0.8/plugins/BasePlugin.sol"; -import {ValidationData} from "../../../../src/msca/6900/shared/common/Structs.sol"; import {NotImplementedFunction} from "../../../../src/msca/6900/shared/common/Errors.sol"; -import {IValidation} from "../../../../src/msca/6900/v0.8/interfaces/IValidation.sol"; -import {IPlugin} from "../../../../src/msca/6900/v0.8/interfaces/IPlugin.sol"; +import {ValidationData} from "../../../../src/msca/6900/shared/common/Structs.sol"; + import {PluginManifest, PluginMetadata} from "../../../../src/msca/6900/v0.8/common/PluginManifest.sol"; +import {IPlugin} from "../../../../src/msca/6900/v0.8/interfaces/IPlugin.sol"; +import {IValidation} from "../../../../src/msca/6900/v0.8/interfaces/IValidation.sol"; +import {BasePlugin} from "../../../../src/msca/6900/v0.8/plugins/BasePlugin.sol"; +import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; contract TestUserOpValidator is IValidation, BasePlugin { ValidationData private expectedValidationData; diff --git a/test/msca/6900/v0.8/TestUserOpValidatorHook.sol b/test/msca/6900/v0.8/TestUserOpValidatorHook.sol index 5d45caf..ba15dd3 100644 --- a/test/msca/6900/v0.8/TestUserOpValidatorHook.sol +++ b/test/msca/6900/v0.8/TestUserOpValidatorHook.sol @@ -18,13 +18,14 @@ */ pragma solidity 0.8.24; -import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; -import {BasePlugin} from "../../../../src/msca/6900/v0.8/plugins/BasePlugin.sol"; -import {ValidationData} from "../../../../src/msca/6900/shared/common/Structs.sol"; import {NotImplementedFunction} from "../../../../src/msca/6900/shared/common/Errors.sol"; -import {IValidationHook} from "../../../../src/msca/6900/v0.8/interfaces/IValidationHook.sol"; -import {IPlugin} from "../../../../src/msca/6900/v0.8/interfaces/IPlugin.sol"; +import {ValidationData} from "../../../../src/msca/6900/shared/common/Structs.sol"; + import {PluginManifest, PluginMetadata} from "../../../../src/msca/6900/v0.8/common/PluginManifest.sol"; +import {IPlugin} from "../../../../src/msca/6900/v0.8/interfaces/IPlugin.sol"; +import {IValidationHook} from "../../../../src/msca/6900/v0.8/interfaces/IValidationHook.sol"; +import {BasePlugin} from "../../../../src/msca/6900/v0.8/plugins/BasePlugin.sol"; +import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; contract TestUserOpValidatorHook is IValidationHook, BasePlugin { ValidationData private expectedValidationData; diff --git a/test/msca/6900/v0.8/UpgradableMSCA.t.sol b/test/msca/6900/v0.8/UpgradableMSCA.t.sol index 47e5614..ea869fe 100644 --- a/test/msca/6900/v0.8/UpgradableMSCA.t.sol +++ b/test/msca/6900/v0.8/UpgradableMSCA.t.sol @@ -20,42 +20,48 @@ pragma solidity 0.8.24; /* solhint-disable max-states-count */ -import {AccountTestUtils} from "./utils/AccountTestUtils.sol"; -import {TestERC721} from "../../../util/TestERC721.sol"; -import {TestERC1155} from "../../../util/TestERC1155.sol"; -import {UpgradableMSCA} from "../../../../src/msca/6900/v0.8/account/UpgradableMSCA.sol"; -import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; -import {TestCircleMSCA} from "./TestCircleMSCA.sol"; -import {TestUserOpValidator} from "./TestUserOpValidator.sol"; -import {TestUserOpValidatorHook} from "./TestUserOpValidatorHook.sol"; -import {TestCircleMSCAFactory} from "./TestCircleMSCAFactory.sol"; -import {SingleSignerValidationModule} from - "../../../../src/msca/6900/v0.8/plugins/v1_0_0/validation/SingleSignerValidationModule.sol"; -import {TestLiquidityPool} from "../../../util/TestLiquidityPool.sol"; import { - EMPTY_MODULE_ENTITY, + EIP1271_INVALID_SIGNATURE, EIP1271_VALID_SIGNATURE, - EIP1271_INVALID_SIGNATURE + EMPTY_MODULE_ENTITY } from "../../../../src/common/Constants.sol"; -import {ModuleEntityLib} from "../../../../src/msca/6900/v0.8/libs/thirdparty/ModuleEntityLib.sol"; -import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; -import {PluginManager} from "../../../../src/msca/6900/v0.8/managers/PluginManager.sol"; + import {ValidationData} from "../../../../src/msca/6900/shared/common/Structs.sol"; -import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; -import {TestUserOpValidatorHook} from "../v0.8/TestUserOpValidatorHook.sol"; -import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; + +import {BaseMSCA} from "../../../../src/msca/6900/v0.8/account/BaseMSCA.sol"; +import {UpgradableMSCA} from "../../../../src/msca/6900/v0.8/account/UpgradableMSCA.sol"; import { - PluginManifest, + ManifestExecutionHook, ManifestValidation, - ManifestExecutionHook + PluginManifest } from "../../../../src/msca/6900/v0.8/common/PluginManifest.sol"; -import {IStandardExecutor} from "../../../../src/msca/6900/v0.8/interfaces/IStandardExecutor.sol"; +import {ModuleEntity, ValidationConfig} from "../../../../src/msca/6900/v0.8/common/Types.sol"; import {UpgradableMSCAFactory} from "../../../../src/msca/6900/v0.8/factories/UpgradableMSCAFactory.sol"; -import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol"; import {IAccountExecute} from "../../../../src/msca/6900/v0.8/interfaces/IAccountExecute.sol"; -import {ValidationConfig, ModuleEntity} from "../../../../src/msca/6900/v0.8/common/Types.sol"; +import {IStandardExecutor} from "../../../../src/msca/6900/v0.8/interfaces/IStandardExecutor.sol"; +import {ModuleEntityLib} from "../../../../src/msca/6900/v0.8/libs/thirdparty/ModuleEntityLib.sol"; + import {ValidationConfigLib} from "../../../../src/msca/6900/v0.8/libs/thirdparty/ValidationConfigLib.sol"; -import {BaseMSCA} from "../../../../src/msca/6900/v0.8/account/BaseMSCA.sol"; +import {PluginManager} from "../../../../src/msca/6900/v0.8/managers/PluginManager.sol"; +import {SingleSignerValidationModule} from + "../../../../src/msca/6900/v0.8/plugins/v1_0_0/validation/SingleSignerValidationModule.sol"; +import {TestERC1155} from "../../../util/TestERC1155.sol"; +import {TestERC721} from "../../../util/TestERC721.sol"; + +import {TestLiquidityPool} from "../../../util/TestLiquidityPool.sol"; + +import {TestUserOpValidatorHook} from "../v0.8/TestUserOpValidatorHook.sol"; +import {TestCircleMSCA} from "./TestCircleMSCA.sol"; +import {TestCircleMSCAFactory} from "./TestCircleMSCAFactory.sol"; +import {TestUserOpValidator} from "./TestUserOpValidator.sol"; +import {TestUserOpValidatorHook} from "./TestUserOpValidatorHook.sol"; +import {AccountTestUtils} from "./utils/AccountTestUtils.sol"; +import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; + +import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; +import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; +import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; +import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol"; // We use TestCircleMSCA (that inherits from UpgradableMSCA) because it has some convenience functions contract UpgradableMSCATest is AccountTestUtils { diff --git a/test/msca/6900/v0.8/UpgradableMSCAFactory.t.sol b/test/msca/6900/v0.8/UpgradableMSCAFactory.t.sol index f2257d9..d5d9f2e 100644 --- a/test/msca/6900/v0.8/UpgradableMSCAFactory.t.sol +++ b/test/msca/6900/v0.8/UpgradableMSCAFactory.t.sol @@ -18,23 +18,26 @@ */ pragma solidity 0.8.24; -import {UpgradableMSCAFactory} from "../../../../src/msca/6900/v0.8/factories/UpgradableMSCAFactory.sol"; -import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; -import {AccountTestUtils} from "./utils/AccountTestUtils.sol"; import {UpgradableMSCA} from "../../../../src/msca/6900/v0.8/account/UpgradableMSCA.sol"; -import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; + import {ModuleEntity} from "../../../../src/msca/6900/v0.8/common/Types.sol"; + +import {ValidationConfig} from "../../../../src/msca/6900/v0.8/common/Types.sol"; +import {UpgradableMSCAFactory} from "../../../../src/msca/6900/v0.8/factories/UpgradableMSCAFactory.sol"; +import {IStandardExecutor} from "../../../../src/msca/6900/v0.8/interfaces/IStandardExecutor.sol"; +import {ModuleEntityLib} from "../../../../src/msca/6900/v0.8/libs/thirdparty/ModuleEntityLib.sol"; +import {ValidationConfigLib} from "../../../../src/msca/6900/v0.8/libs/thirdparty/ValidationConfigLib.sol"; +import {PluginManager} from "../../../../src/msca/6900/v0.8/managers/PluginManager.sol"; import {SingleSignerValidationModule} from "../../../../src/msca/6900/v0.8/plugins/v1_0_0/validation/SingleSignerValidationModule.sol"; import {TestLiquidityPool} from "../../../util/TestLiquidityPool.sol"; + +import {TestCircleMSCAFactory} from "../v0.8/TestCircleMSCAFactory.sol"; +import {AccountTestUtils} from "./utils/AccountTestUtils.sol"; +import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; -import {PluginManager} from "../../../../src/msca/6900/v0.8/managers/PluginManager.sol"; import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; -import {IStandardExecutor} from "../../../../src/msca/6900/v0.8/interfaces/IStandardExecutor.sol"; -import {ModuleEntityLib} from "../../../../src/msca/6900/v0.8/libs/thirdparty/ModuleEntityLib.sol"; -import {ValidationConfig} from "../../../../src/msca/6900/v0.8/common/Types.sol"; -import {ValidationConfigLib} from "../../../../src/msca/6900/v0.8/libs/thirdparty/ValidationConfigLib.sol"; -import {TestCircleMSCAFactory} from "../v0.8/TestCircleMSCAFactory.sol"; +import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; // TODO: move it to createAccountWithValidation when it's added to the UpgradableMSCAFactory contract UpgradableMSCAFactoryTest is AccountTestUtils { diff --git a/test/msca/6900/v0.8/helpers/TestAddressBookPlugin.sol b/test/msca/6900/v0.8/helpers/TestAddressBookPlugin.sol index 46200fd..fb66a6e 100644 --- a/test/msca/6900/v0.8/helpers/TestAddressBookPlugin.sol +++ b/test/msca/6900/v0.8/helpers/TestAddressBookPlugin.sol @@ -18,26 +18,27 @@ */ pragma solidity 0.8.24; -import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; -import {IERC165} from "@openzeppelin/contracts/interfaces/IERC165.sol"; -import { - AssociatedLinkedListSet, - AssociatedLinkedListSetLib -} from "@modular-account-libs/libraries/AssociatedLinkedListSetLib.sol"; +import {PLUGIN_AUTHOR, PLUGIN_VERSION_1, SIG_VALIDATION_SUCCEEDED} from "../../../../../src/common/Constants.sol"; import {CastLib} from "../../../../../src/libs/CastLib.sol"; + +import {RecipientAddressLib} from "../../../../../src/libs/RecipientAddressLib.sol"; import {Unsupported} from "../../../../../src/msca/6900/shared/common/Errors.sol"; import { + ManifestExecutionFunction, PluginManifest, PluginMetadata, - SelectorPermission, - ManifestExecutionFunction + SelectorPermission } from "../../../../../src/msca/6900/v0.8/common/PluginManifest.sol"; -import {SIG_VALIDATION_SUCCEEDED, PLUGIN_VERSION_1, PLUGIN_AUTHOR} from "../../../../../src/common/Constants.sol"; -import {IAddressBookPlugin} from "../../../../../src/msca/6900/v0.8/plugins/v1_0_0/addressbook/IAddressBookPlugin.sol"; import {IPlugin} from "../../../../../src/msca/6900/v0.8/interfaces/IPlugin.sol"; import {IValidationHook} from "../../../../../src/msca/6900/v0.8/interfaces/IValidationHook.sol"; import {BasePlugin} from "../../../../../src/msca/6900/v0.8/plugins/BasePlugin.sol"; -import {RecipientAddressLib} from "../../../../../src/libs/RecipientAddressLib.sol"; +import {IAddressBookPlugin} from "../../../../../src/msca/6900/v0.8/plugins/v1_0_0/addressbook/IAddressBookPlugin.sol"; +import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; +import { + AssociatedLinkedListSet, + AssociatedLinkedListSetLib +} from "@modular-account-libs/libraries/AssociatedLinkedListSetLib.sol"; +import {IERC165} from "@openzeppelin/contracts/interfaces/IERC165.sol"; /** * @dev For testing only purpose. diff --git a/test/msca/6900/v0.8/libs/thirdparty/ModuleEntityLib.t.sol b/test/msca/6900/v0.8/libs/thirdparty/ModuleEntityLib.t.sol index 23a8f06..c557dc9 100644 --- a/test/msca/6900/v0.8/libs/thirdparty/ModuleEntityLib.t.sol +++ b/test/msca/6900/v0.8/libs/thirdparty/ModuleEntityLib.t.sol @@ -18,9 +18,9 @@ */ pragma solidity 0.8.24; -import {TestUtils} from "../../../../../util/TestUtils.sol"; -import {ModuleEntityLib} from "../../../../../../src/msca/6900/v0.8/libs/thirdparty/ModuleEntityLib.sol"; import {ModuleEntity} from "../../../../../../src/msca/6900/v0.8/common/Types.sol"; +import {ModuleEntityLib} from "../../../../../../src/msca/6900/v0.8/libs/thirdparty/ModuleEntityLib.sol"; +import {TestUtils} from "../../../../../util/TestUtils.sol"; contract ModuleEntityLibTest is TestUtils { using ModuleEntityLib for ModuleEntity; diff --git a/test/msca/6900/v0.8/libs/thirdparty/SparseCalldataSegmentLib.t.sol b/test/msca/6900/v0.8/libs/thirdparty/SparseCalldataSegmentLib.t.sol index 2acddd3..8a00202 100644 --- a/test/msca/6900/v0.8/libs/thirdparty/SparseCalldataSegmentLib.t.sol +++ b/test/msca/6900/v0.8/libs/thirdparty/SparseCalldataSegmentLib.t.sol @@ -18,9 +18,9 @@ */ pragma solidity 0.8.24; -import {AccountTestUtils} from "../../utils/AccountTestUtils.sol"; import {SparseCalldataSegmentLib} from "../../../../../../src/msca/6900/v0.8/libs/thirdparty/SparseCalldataSegmentLib.sol"; +import {AccountTestUtils} from "../../utils/AccountTestUtils.sol"; // TODO: remove this till SparseCalldataSegmentLib is moved to modular account lib // https://github.com/erc6900/modular-account-libs/issues/2 diff --git a/test/msca/6900/v0.8/plugins/SingleSignerValidationModule.t.sol b/test/msca/6900/v0.8/plugins/SingleSignerValidationModule.t.sol index 85e417b..59f4dc5 100644 --- a/test/msca/6900/v0.8/plugins/SingleSignerValidationModule.t.sol +++ b/test/msca/6900/v0.8/plugins/SingleSignerValidationModule.t.sol @@ -20,26 +20,30 @@ pragma solidity 0.8.24; /* solhint-disable max-states-count */ -import {AccountTestUtils} from "../utils/AccountTestUtils.sol"; -import {console} from "forge-std/src/console.sol"; -import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; -import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; -import {TestCircleMSCA} from "../TestCircleMSCA.sol"; -import {TestCircleMSCAFactory} from "../TestCircleMSCAFactory.sol"; -import {TestLiquidityPool} from "../../../../util/TestLiquidityPool.sol"; -import {ModuleEntityLib} from "../../../../../src/msca/6900/v0.8/libs/thirdparty/ModuleEntityLib.sol"; -import {PluginManager} from "../../../../../src/msca/6900/v0.8/managers/PluginManager.sol"; +import {PLUGIN_AUTHOR, PLUGIN_VERSION_1} from "../../../../../src/common/Constants.sol"; + +import {BaseMSCA} from "../../../../../src/msca/6900/v0.8/account/BaseMSCA.sol"; import {PluginMetadata} from "../../../../../src/msca/6900/v0.8/common/PluginManifest.sol"; -import {PLUGIN_VERSION_1, PLUGIN_AUTHOR} from "../../../../../src/common/Constants.sol"; -import {IStandardExecutor} from "../../../../../src/msca/6900/v0.8/interfaces/IStandardExecutor.sol"; +import {ModuleEntity, ValidationConfig} from "../../../../../src/msca/6900/v0.8/common/Types.sol"; import {IPluginManager} from "../../../../../src/msca/6900/v0.8/interfaces/IPluginManager.sol"; -import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; -import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; -import {ValidationConfig, ModuleEntity} from "../../../../../src/msca/6900/v0.8/common/Types.sol"; +import {IStandardExecutor} from "../../../../../src/msca/6900/v0.8/interfaces/IStandardExecutor.sol"; +import {ModuleEntityLib} from "../../../../../src/msca/6900/v0.8/libs/thirdparty/ModuleEntityLib.sol"; + import {ValidationConfigLib} from "../../../../../src/msca/6900/v0.8/libs/thirdparty/ValidationConfigLib.sol"; -import {BaseMSCA} from "../../../../../src/msca/6900/v0.8/account/BaseMSCA.sol"; +import {PluginManager} from "../../../../../src/msca/6900/v0.8/managers/PluginManager.sol"; + import {SingleSignerValidationModule} from "../../../../../src/msca/6900/v0.8/plugins/v1_0_0/validation/SingleSignerValidationModule.sol"; +import {TestLiquidityPool} from "../../../../util/TestLiquidityPool.sol"; +import {TestCircleMSCA} from "../TestCircleMSCA.sol"; +import {TestCircleMSCAFactory} from "../TestCircleMSCAFactory.sol"; +import {AccountTestUtils} from "../utils/AccountTestUtils.sol"; +import {EntryPoint} from "@account-abstraction/contracts/core/EntryPoint.sol"; +import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; + +import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; +import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; +import {console} from "forge-std/src/console.sol"; contract SingleSignerValidationModuleTest is AccountTestUtils { using ModuleEntityLib for bytes21; diff --git a/test/msca/6900/v0.8/utils/AccountTestUtils.sol b/test/msca/6900/v0.8/utils/AccountTestUtils.sol index a627685..7e4a98d 100644 --- a/test/msca/6900/v0.8/utils/AccountTestUtils.sol +++ b/test/msca/6900/v0.8/utils/AccountTestUtils.sol @@ -18,14 +18,14 @@ */ pragma solidity 0.8.24; -import {TestUtils} from "../../../../util/TestUtils.sol"; -import {ModuleEntity} from "../../../../../src/msca/6900/v0.8/common/Types.sol"; import { - RESERVED_VALIDATION_DATA_INDEX, GLOBAL_VALIDATION_FLAG, - PER_SELECTOR_VALIDATION_FLAG + PER_SELECTOR_VALIDATION_FLAG, + RESERVED_VALIDATION_DATA_INDEX } from "../../../../../src/msca/6900/v0.8/common/Constants.sol"; +import {ModuleEntity} from "../../../../../src/msca/6900/v0.8/common/Types.sol"; import {ModuleEntityLib} from "../../../../../src/msca/6900/v0.8/libs/thirdparty/ModuleEntityLib.sol"; +import {TestUtils} from "../../../../util/TestUtils.sol"; contract AccountTestUtils is TestUtils { using ModuleEntityLib for ModuleEntity; diff --git a/test/util/TestERC777.sol b/test/util/TestERC777.sol index 72745c3..c0e9e93 100644 --- a/test/util/TestERC777.sol +++ b/test/util/TestERC777.sol @@ -18,10 +18,10 @@ */ pragma solidity 0.8.24; +import {NotImplemented} from "../../src/msca/6900/shared/common/Errors.sol"; +import {IERC1820Registry} from "@openzeppelin/contracts/interfaces/IERC1820Registry.sol"; import {IERC777} from "@openzeppelin/contracts/interfaces/IERC777.sol"; import {IERC777Recipient} from "@openzeppelin/contracts/interfaces/IERC777Recipient.sol"; -import {IERC1820Registry} from "@openzeppelin/contracts/interfaces/IERC1820Registry.sol"; -import {NotImplemented} from "../../src/msca/6900/shared/common/Errors.sol"; contract TestERC777 is IERC777 { bytes32 private constant _TOKENS_RECIPIENT_INTERFACE_HASH = keccak256("ERC777TokensRecipient"); diff --git a/test/util/TestUtils.sol b/test/util/TestUtils.sol index 5c2988f..5b349d2 100644 --- a/test/util/TestUtils.sol +++ b/test/util/TestUtils.sol @@ -18,12 +18,13 @@ */ pragma solidity 0.8.24; -import {Test} from "forge-std/src/Test.sol"; import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; import {PackedUserOperation} from "@account-abstraction/contracts/interfaces/PackedUserOperation.sol"; + +import {FCL_Elliptic_ZZ} from "@fcl/FCL_elliptic.sol"; import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; +import {Test} from "forge-std/src/Test.sol"; import {Vm} from "forge-std/src/Vm.sol"; -import {FCL_Elliptic_ZZ} from "@fcl/FCL_elliptic.sol"; contract TestUtils is Test { using MessageHashUtils for bytes32;