From d7625e96e9326341578345f91bdaaac779b099ab Mon Sep 17 00:00:00 2001 From: aboudjem Date: Thu, 25 Apr 2024 16:37:17 +0400 Subject: [PATCH] Update imports and renaming files --- contracts/Nexus.sol | 9 +++++---- contracts/base/BaseAccount.sol | 4 ++-- .../{ExecutionManager.sol => ExecutionHelper.sol} | 10 +++++----- contracts/base/ModuleManager.sol | 12 ++++++------ contracts/base/Storage.sol | 4 ++-- contracts/factory/AccountFactory.sol | 4 ++-- contracts/interfaces/IERC4337Account.sol | 4 ++-- contracts/interfaces/IERC7579Account.sol | 10 +++++----- contracts/interfaces/INexus.sol | 4 ++-- contracts/interfaces/INexusEventsAndErrors.sol | 4 ++-- contracts/interfaces/base/IAccountConfig.sol | 4 ++-- contracts/interfaces/base/IBaseAccount.sol | 4 ++-- .../interfaces/base/IBaseAccountEventsAndErrors.sol | 4 ++-- .../{IExecutionManager.sol => IExecutionHelper.sol} | 12 ++++++------ ...rrors.sol => IExecutionHelperEventsAndErrors.sol} | 6 +++--- contracts/interfaces/base/IModuleManager.sol | 4 ++-- .../base/IModuleManagerEventsAndErrors.sol | 4 ++-- contracts/interfaces/base/IStorage.sol | 4 ++-- contracts/interfaces/factory/IAccountFactory.sol | 4 ++-- contracts/interfaces/modules/IExecutor.sol | 10 +++++----- contracts/interfaces/modules/IFallback.sol | 10 +++++----- contracts/interfaces/modules/IHook.sol | 8 ++++---- .../modules/{IERC7579ModuleBase.sol => IModule.sol} | 6 +++--- contracts/interfaces/modules/IValidator.sol | 8 ++++---- contracts/mocks/Imports.sol | 4 ++-- contracts/mocks/MockToken.sol | 4 ++-- contracts/modules/validators/K1Validator.sol | 4 ++-- contracts/types/Constants.sol | 4 ++-- contracts/types/DataTypes.sol | 4 ++-- test/foundry/mocks/MockExecutor.sol | 2 +- test/foundry/mocks/MockHandler.sol | 2 +- test/foundry/mocks/MockHook.sol | 4 ++-- test/foundry/mocks/MockValidator.sol | 2 +- test/foundry/utils/Imports.sol | 2 +- 34 files changed, 93 insertions(+), 92 deletions(-) rename contracts/base/{ExecutionManager.sol => ExecutionHelper.sol} (95%) rename contracts/interfaces/base/{IExecutionManager.sol => IExecutionHelper.sol} (85%) rename contracts/interfaces/base/{IExecutionManagerEventsAndErrors.sol => IExecutionHelperEventsAndErrors.sol} (90%) rename contracts/interfaces/modules/{IERC7579ModuleBase.sol => IModule.sol} (94%) diff --git a/contracts/Nexus.sol b/contracts/Nexus.sol index 881f6baf..5e35221b 100644 --- a/contracts/Nexus.sol +++ b/contracts/Nexus.sol @@ -9,8 +9,8 @@ pragma solidity ^0.8.24; // /_/ |_/\___/_/|_\__,_/____/ // // ────────────────────────────────────────────────────────────────────────────── -// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, -// using Entrypoint version 0.7.0, developed by Biconomy. Learn more at https://biconomy.io/ +// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, developed by Biconomy. +// Learn more at https://biconomy.io/ import { UUPSUpgradeable } from "solady/src/utils/UUPSUpgradeable.sol"; import { PackedUserOperation } from "account-abstraction/contracts/interfaces/PackedUserOperation.sol"; @@ -20,7 +20,7 @@ import { Execution } from "./types/DataTypes.sol"; import { INexus } from "./interfaces/INexus.sol"; import { BaseAccount } from "./base/BaseAccount.sol"; import { ModuleManager } from "./base/ModuleManager.sol"; -import { ExecutionManager } from "./base/ExecutionManager.sol"; +import { ExecutionHelper } from "./base/ExecutionHelper.sol"; import { IValidator } from "./interfaces/modules/IValidator.sol"; import { MODULE_TYPE_VALIDATOR, MODULE_TYPE_EXECUTOR, MODULE_TYPE_FALLBACK, MODULE_TYPE_HOOK, VALIDATION_FAILED } from "./types/Constants.sol"; import { ModeLib, ExecutionMode, ExecType, CallType, CALLTYPE_BATCH, CALLTYPE_SINGLE, EXECTYPE_DEFAULT, EXECTYPE_TRY } from "./lib/ModeLib.sol"; @@ -33,7 +33,7 @@ import { ModeLib, ExecutionMode, ExecType, CallType, CALLTYPE_BATCH, CALLTYPE_SI /// @author @filmakarov | Biconomy | filipp.makarov@biconomy.io /// @author @zeroknots | Rhinestone.wtf | zeroknots.eth /// Special thanks to the Solady team for foundational contributions: https://github.com/Vectorized/solady -contract Nexus is INexus, BaseAccount, ExecutionManager, ModuleManager, UUPSUpgradeable { +contract Nexus is INexus, BaseAccount, ExecutionHelper, ModuleManager, UUPSUpgradeable { using ModeLib for ExecutionMode; using ExecLib for bytes; @@ -204,6 +204,7 @@ contract Nexus is INexus, BaseAccount, ExecutionManager, ModuleManager, UUPSUpgr /// @param firstValidator The first validator to install upon initialization. /// @param initData Initialization data for setting up the validator. /// @dev This function sets the foundation for the smart account's operational logic and security. + /// @notice Implementation details may be adjusted based on factory requirements. function initialize(address firstValidator, bytes calldata initData) external payable virtual { // checks if already initialized and reverts before setting the state to initialized _initModuleManager(); diff --git a/contracts/base/BaseAccount.sol b/contracts/base/BaseAccount.sol index db86dd94..1bfab317 100644 --- a/contracts/base/BaseAccount.sol +++ b/contracts/base/BaseAccount.sol @@ -9,8 +9,8 @@ pragma solidity ^0.8.24; // /_/ |_/\___/_/|_\__,_/____/ // // ────────────────────────────────────────────────────────────────────────────── -// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, -// using Entrypoint version 0.7.0, developed by Biconomy. Learn more at https://biconomy.io/ +// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, developed by Biconomy. +// Learn more at https://biconomy.io/ import { IEntryPoint } from "account-abstraction/contracts/interfaces/IEntryPoint.sol"; import { IBaseAccount } from "../interfaces/base/IBaseAccount.sol"; diff --git a/contracts/base/ExecutionManager.sol b/contracts/base/ExecutionHelper.sol similarity index 95% rename from contracts/base/ExecutionManager.sol rename to contracts/base/ExecutionHelper.sol index 8ef8f5e6..836feecb 100644 --- a/contracts/base/ExecutionManager.sol +++ b/contracts/base/ExecutionHelper.sol @@ -9,13 +9,13 @@ pragma solidity ^0.8.24; // /_/ |_/\___/_/|_\__,_/____/ // // ────────────────────────────────────────────────────────────────────────────── -// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, -// using Entrypoint version 0.7.0, developed by Biconomy. Learn more at https://biconomy.io/ +// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, developed by Biconomy. +// Learn more at https://biconomy.io/ import { Execution } from "../types/DataTypes.sol"; -import { IExecutionManagerEventsAndErrors } from "../interfaces/base/IExecutionManager.sol"; +import { IExecutionHelperEventsAndErrors } from "../interfaces/base/IExecutionHelper.sol"; -/// @title Nexus - ExecutionManager +/// @title Nexus - ExecutionHelper /// @notice Implements execution management within the Nexus suite, facilitating transaction execution strategies and /// error handling. /// @dev Provides mechanisms for direct and batched transactions with both committed and tentative execution strategies @@ -25,7 +25,7 @@ import { IExecutionManagerEventsAndErrors } from "../interfaces/base/IExecutionM /// @author @filmakarov | Biconomy | filipp.makarov@biconomy.io /// @author @zeroknots | Rhinestone.wtf | zeroknots.eth /// Special thanks to the Solady team for foundational contributions: https://github.com/Vectorized/solady -contract ExecutionManager is IExecutionManagerEventsAndErrors { +contract ExecutionHelper is IExecutionHelperEventsAndErrors { /// @notice Executes a call to a target address with specified value and data. /// @param target The address to execute the call on. /// @param value The amount of wei to send with the call. diff --git a/contracts/base/ModuleManager.sol b/contracts/base/ModuleManager.sol index afc38b3a..81707bfd 100644 --- a/contracts/base/ModuleManager.sol +++ b/contracts/base/ModuleManager.sol @@ -9,8 +9,8 @@ pragma solidity ^0.8.24; // /_/ |_/\___/_/|_\__,_/____/ // // ────────────────────────────────────────────────────────────────────────────── -// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, -// using Entrypoint version 0.7.0, developed by Biconomy. Learn more at https://biconomy.io/ +// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, developed by Biconomy. +// Learn more at https://biconomy.io/ import { Receiver } from "solady/src/accounts/Receiver.sol"; import { SentinelListLib } from "sentinellist/src/SentinelList.sol"; @@ -21,7 +21,7 @@ import { IExecutor } from "../interfaces/modules/IExecutor.sol"; import { IFallback } from "../interfaces/modules/IFallback.sol"; import { IValidator } from "../interfaces/modules/IValidator.sol"; import { CallType, CALLTYPE_SINGLE, CALLTYPE_STATIC } from "../lib/ModeLib.sol"; -import { IERC7579ModuleBase } from "../interfaces/modules/IERC7579ModuleBase.sol"; +import { IModule } from "../interfaces/modules/IModule.sol"; import { IModuleManagerEventsAndErrors } from "../interfaces/base/IModuleManagerEventsAndErrors.sol"; import { MODULE_TYPE_VALIDATOR, MODULE_TYPE_EXECUTOR, MODULE_TYPE_HOOK } from "../types/Constants.sol"; @@ -161,7 +161,7 @@ contract ModuleManager is Storage, Receiver, IModuleManagerEventsAndErrors { /// @param data Initialization data to configure the validator upon installation. function _installValidator(address validator, bytes calldata data) internal virtual { // Note: Idea is should be able to check supported interface and module type - eligible validator - if (!IERC7579ModuleBase(validator).isModuleType(MODULE_TYPE_VALIDATOR)) { + if (!IModule(validator).isModuleType(MODULE_TYPE_VALIDATOR)) { revert IncompatibleValidatorModule(validator); } @@ -193,7 +193,7 @@ contract ModuleManager is Storage, Receiver, IModuleManagerEventsAndErrors { /// @param data Initialization data to configure the executor upon installation. function _installExecutor(address executor, bytes calldata data) internal virtual { // Note: Idea is should be able to check supported interface and module type - eligible validator - if (!IERC7579ModuleBase(executor).isModuleType(MODULE_TYPE_EXECUTOR)) { + if (!IModule(executor).isModuleType(MODULE_TYPE_EXECUTOR)) { revert IncompatibleExecutorModule(executor); } @@ -220,7 +220,7 @@ contract ModuleManager is Storage, Receiver, IModuleManagerEventsAndErrors { if (currentHook != address(0)) { revert HookAlreadyInstalled(currentHook); } - if (!IERC7579ModuleBase(hook).isModuleType(MODULE_TYPE_HOOK)) revert IncompatibleHookModule(hook); + if (!IModule(hook).isModuleType(MODULE_TYPE_HOOK)) revert IncompatibleHookModule(hook); _setHook(hook); IHook(hook).onInstall(data); } diff --git a/contracts/base/Storage.sol b/contracts/base/Storage.sol index 98a4340e..260ce9fb 100644 --- a/contracts/base/Storage.sol +++ b/contracts/base/Storage.sol @@ -9,8 +9,8 @@ pragma solidity ^0.8.24; // /_/ |_/\___/_/|_\__,_/____/ // // ────────────────────────────────────────────────────────────────────────────── -// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, -// using Entrypoint version 0.7.0, developed by Biconomy. Learn more at https://biconomy.io/ +// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, developed by Biconomy. +// Learn more at https://biconomy.io/ import { IStorage } from "../interfaces/base/IStorage.sol"; diff --git a/contracts/factory/AccountFactory.sol b/contracts/factory/AccountFactory.sol index 4014d637..7b11e069 100644 --- a/contracts/factory/AccountFactory.sol +++ b/contracts/factory/AccountFactory.sol @@ -9,8 +9,8 @@ pragma solidity ^0.8.24; // /_/ |_/\___/_/|_\__,_/____/ // // ────────────────────────────────────────────────────────────────────────────── -// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, -// using Entrypoint version 0.7.0, developed by Biconomy. Learn more at https://biconomy.io/ +// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, developed by Biconomy. +// Learn more at https://biconomy.io/ import { LibClone } from "solady/src/utils/LibClone.sol"; import { StakeManager } from "account-abstraction/contracts/core/StakeManager.sol"; diff --git a/contracts/interfaces/IERC4337Account.sol b/contracts/interfaces/IERC4337Account.sol index d0d6b7db..5a3cda46 100644 --- a/contracts/interfaces/IERC4337Account.sol +++ b/contracts/interfaces/IERC4337Account.sol @@ -9,8 +9,8 @@ pragma solidity ^0.8.24; // /_/ |_/\___/_/|_\__,_/____/ // // ────────────────────────────────────────────────────────────────────────────── -// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, -// using Entrypoint version 0.7.0, developed by Biconomy. Learn more at https://biconomy.io/ +// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, developed by Biconomy. +// Learn more at https://biconomy.io/ import { PackedUserOperation } from "account-abstraction/contracts/interfaces/PackedUserOperation.sol"; diff --git a/contracts/interfaces/IERC7579Account.sol b/contracts/interfaces/IERC7579Account.sol index 9625e2d1..74b4efb1 100644 --- a/contracts/interfaces/IERC7579Account.sol +++ b/contracts/interfaces/IERC7579Account.sol @@ -9,23 +9,23 @@ pragma solidity ^0.8.24; // /_/ |_/\___/_/|_\__,_/____/ // // ────────────────────────────────────────────────────────────────────────────── -// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, -// using Entrypoint version 0.7.0, developed by Biconomy. Learn more at https://biconomy.io/ +// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, developed by Biconomy. +// Learn more at https://biconomy.io/ import { IAccountConfig } from "./base/IAccountConfig.sol"; -import { IExecutionManager } from "./base/IExecutionManager.sol"; +import { IExecutionHelper } from "./base/IExecutionHelper.sol"; import { IModuleManager } from "./base/IModuleManager.sol"; /// @title Nexus - IERC7579Account /// @notice This interface integrates the functionalities required for a modular smart account compliant with ERC-7579 and ERC-4337 standards. -/// @dev Combines configurations and operational management for smart accounts, bridging IAccountConfig, IExecutionManager, and IModuleManager. +/// @dev Combines configurations and operational management for smart accounts, bridging IAccountConfig, IExecutionHelper, and IModuleManager. /// Interfaces designed to support the comprehensive management of smart account operations including execution management and modular configurations. /// @author @livingrockrises | Biconomy | chirag@biconomy.io /// @author @aboudjem | Biconomy | adam.boudjemaa@biconomy.io /// @author @filmakarov | Biconomy | filipp.makarov@biconomy.io /// @author @zeroknots | Rhinestone.wtf | zeroknots.eth /// Special thanks to the Solady team for foundational contributions: https://github.com/Vectorized/solady -interface IERC7579Account is IAccountConfig, IExecutionManager, IModuleManager { +interface IERC7579Account is IAccountConfig, IExecutionHelper, IModuleManager { /// @dev Validates a smart account signature according to ERC-1271 standards. /// This method may delegate the call to a validator module to check the signature. /// @param hash The hash of the data being validated. diff --git a/contracts/interfaces/INexus.sol b/contracts/interfaces/INexus.sol index a0f4ac26..b539cc34 100644 --- a/contracts/interfaces/INexus.sol +++ b/contracts/interfaces/INexus.sol @@ -9,8 +9,8 @@ pragma solidity ^0.8.24; // /_/ |_/\___/_/|_\__,_/____/ // // ────────────────────────────────────────────────────────────────────────────── -// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, -// using Entrypoint version 0.7.0, developed by Biconomy. Learn more at https://biconomy.io/ +// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, developed by Biconomy. +// Learn more at https://biconomy.io/ import { IERC4337Account } from "./IERC4337Account.sol"; import { IERC7579Account } from "./IERC7579Account.sol"; diff --git a/contracts/interfaces/INexusEventsAndErrors.sol b/contracts/interfaces/INexusEventsAndErrors.sol index b02cb06e..fe56806f 100644 --- a/contracts/interfaces/INexusEventsAndErrors.sol +++ b/contracts/interfaces/INexusEventsAndErrors.sol @@ -9,8 +9,8 @@ pragma solidity ^0.8.24; // /_/ |_/\___/_/|_\__,_/____/ // // ────────────────────────────────────────────────────────────────────────────── -// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, -// using Entrypoint version 0.7.0, developed by Biconomy. Learn more at https://biconomy.io/ +// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, developed by Biconomy. +// Learn more at https://biconomy.io/ import { CallType, ExecType } from "../lib/ModeLib.sol"; diff --git a/contracts/interfaces/base/IAccountConfig.sol b/contracts/interfaces/base/IAccountConfig.sol index a3d51f3b..766a395b 100644 --- a/contracts/interfaces/base/IAccountConfig.sol +++ b/contracts/interfaces/base/IAccountConfig.sol @@ -9,8 +9,8 @@ pragma solidity ^0.8.24; // /_/ |_/\___/_/|_\__,_/____/ // // ────────────────────────────────────────────────────────────────────────────── -// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, -// using Entrypoint version 0.7.0, developed by Biconomy. Learn more at https://biconomy.io/ +// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, developed by Biconomy. +// Learn more at https://biconomy.io/ import { ExecutionMode } from "../../lib/ModeLib.sol"; diff --git a/contracts/interfaces/base/IBaseAccount.sol b/contracts/interfaces/base/IBaseAccount.sol index 5edad2d1..40144143 100644 --- a/contracts/interfaces/base/IBaseAccount.sol +++ b/contracts/interfaces/base/IBaseAccount.sol @@ -9,8 +9,8 @@ pragma solidity ^0.8.24; // /_/ |_/\___/_/|_\__,_/____/ // // ────────────────────────────────────────────────────────────────────────────── -// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, -// using Entrypoint version 0.7.0, developed by Biconomy. Learn more at https://biconomy.io/ +// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, developed by Biconomy. +// Learn more at https://biconomy.io/ import { IBaseAccountEventsAndErrors } from "./IBaseAccountEventsAndErrors.sol"; diff --git a/contracts/interfaces/base/IBaseAccountEventsAndErrors.sol b/contracts/interfaces/base/IBaseAccountEventsAndErrors.sol index 660df6b7..a38d0bd1 100644 --- a/contracts/interfaces/base/IBaseAccountEventsAndErrors.sol +++ b/contracts/interfaces/base/IBaseAccountEventsAndErrors.sol @@ -9,8 +9,8 @@ pragma solidity ^0.8.24; // /_/ |_/\___/_/|_\__,_/____/ // // ────────────────────────────────────────────────────────────────────────────── -// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, -// using Entrypoint version 0.7.0, developed by Biconomy. Learn more at https://biconomy.io/ +// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, developed by Biconomy. +// Learn more at https://biconomy.io/ /// @title Execution Manager Events and Errors Interface /// @notice Interface for defining events and errors related to transaction execution processes within smart accounts. diff --git a/contracts/interfaces/base/IExecutionManager.sol b/contracts/interfaces/base/IExecutionHelper.sol similarity index 85% rename from contracts/interfaces/base/IExecutionManager.sol rename to contracts/interfaces/base/IExecutionHelper.sol index 9c3f556b..e81ca2f5 100644 --- a/contracts/interfaces/base/IExecutionManager.sol +++ b/contracts/interfaces/base/IExecutionHelper.sol @@ -9,22 +9,22 @@ pragma solidity ^0.8.24; // /_/ |_/\___/_/|_\__,_/____/ // // ────────────────────────────────────────────────────────────────────────────── -// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, -// using Entrypoint version 0.7.0, developed by Biconomy. Learn more at https://biconomy.io/ +// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, developed by Biconomy. +// Learn more at https://biconomy.io/ import { ExecutionMode } from "../../lib/ModeLib.sol"; -import { IExecutionManagerEventsAndErrors } from "./IExecutionManagerEventsAndErrors.sol"; +import { IExecutionHelperEventsAndErrors } from "./IExecutionHelperEventsAndErrors.sol"; -/// @title Nexus - IExecutionManager +/// @title Nexus - IExecutionHelper /// @notice Interface for executing transactions on behalf of smart accounts within the Nexus system. -/// @dev Extends functionality for transaction execution with error handling as defined in IExecutionManagerEventsAndErrors. +/// @dev Extends functionality for transaction execution with error handling as defined in IExecutionHelperEventsAndErrors. /// @author @livingrockrises | Biconomy | chirag@biconomy.io /// @author @aboudjem | Biconomy | adam.boudjemaa@biconomy.io /// @author @filmakarov | Biconomy | filipp.makarov@biconomy.io /// @author @zeroknots | Rhinestone.wtf | zeroknots.eth /// Special thanks to the Solady team for foundational contributions: https://github.com/Vectorized/solady -interface IExecutionManager is IExecutionManagerEventsAndErrors { +interface IExecutionHelper is IExecutionHelperEventsAndErrors { /// @notice Executes a transaction with specified execution mode and calldata. /// @param mode The execution mode, defining how the transaction is processed. /// @param executionCalldata The calldata to execute. diff --git a/contracts/interfaces/base/IExecutionManagerEventsAndErrors.sol b/contracts/interfaces/base/IExecutionHelperEventsAndErrors.sol similarity index 90% rename from contracts/interfaces/base/IExecutionManagerEventsAndErrors.sol rename to contracts/interfaces/base/IExecutionHelperEventsAndErrors.sol index 4c435372..183a1f73 100644 --- a/contracts/interfaces/base/IExecutionManagerEventsAndErrors.sol +++ b/contracts/interfaces/base/IExecutionHelperEventsAndErrors.sol @@ -9,8 +9,8 @@ pragma solidity ^0.8.24; // /_/ |_/\___/_/|_\__,_/____/ // // ────────────────────────────────────────────────────────────────────────────── -// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, -// using Entrypoint version 0.7.0, developed by Biconomy. Learn more at https://biconomy.io/ +// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, developed by Biconomy. +// Learn more at https://biconomy.io/ /// @title Execution Manager Events and Errors Interface /// @notice Interface for defining events and errors related to transaction execution processes within smart accounts. @@ -21,7 +21,7 @@ pragma solidity ^0.8.24; /// @author @filmakarov | Biconomy | filipp.makarov@biconomy.io /// @author @zeroknots | Rhinestone.wtf | zeroknots.eth /// Special thanks to the Solady team for foundational contributions: https://github.com/Vectorized/solady -interface IExecutionManagerEventsAndErrors { +interface IExecutionHelperEventsAndErrors { /// @notice Event emitted when a transaction fails to execute successfully. event TryExecuteUnsuccessful(uint256 batchExecutionindex, bytes result); } diff --git a/contracts/interfaces/base/IModuleManager.sol b/contracts/interfaces/base/IModuleManager.sol index 819e4259..c6940492 100644 --- a/contracts/interfaces/base/IModuleManager.sol +++ b/contracts/interfaces/base/IModuleManager.sol @@ -9,8 +9,8 @@ pragma solidity ^0.8.24; // /_/ |_/\___/_/|_\__,_/____/ // // ────────────────────────────────────────────────────────────────────────────── -// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, -// using Entrypoint version 0.7.0, developed by Biconomy. Learn more at https://biconomy.io/ +// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, developed by Biconomy. +// Learn more at https://biconomy.io/ import { IModuleManagerEventsAndErrors } from "./IModuleManagerEventsAndErrors.sol"; diff --git a/contracts/interfaces/base/IModuleManagerEventsAndErrors.sol b/contracts/interfaces/base/IModuleManagerEventsAndErrors.sol index 8007b973..90d9fe8f 100644 --- a/contracts/interfaces/base/IModuleManagerEventsAndErrors.sol +++ b/contracts/interfaces/base/IModuleManagerEventsAndErrors.sol @@ -9,8 +9,8 @@ pragma solidity ^0.8.24; // /_/ |_/\___/_/|_\__,_/____/ // // ────────────────────────────────────────────────────────────────────────────── -// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, -// using Entrypoint version 0.7.0, developed by Biconomy. Learn more at https://biconomy.io/ +// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, developed by Biconomy. +// Learn more at https://biconomy.io/ /// @title ERC-7579 Module Manager Events and Errors Interface /// @notice Provides event and error definitions for actions related to module management in smart accounts. diff --git a/contracts/interfaces/base/IStorage.sol b/contracts/interfaces/base/IStorage.sol index 3256e22e..74c3d6e1 100644 --- a/contracts/interfaces/base/IStorage.sol +++ b/contracts/interfaces/base/IStorage.sol @@ -9,8 +9,8 @@ pragma solidity ^0.8.24; // /_/ |_/\___/_/|_\__,_/____/ // // ────────────────────────────────────────────────────────────────────────────── -// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, -// using Entrypoint version 0.7.0, developed by Biconomy. Learn more at https://biconomy.io/ +// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, developed by Biconomy. +// Learn more at https://biconomy.io/ import { SentinelListLib } from "sentinellist/src/SentinelList.sol"; diff --git a/contracts/interfaces/factory/IAccountFactory.sol b/contracts/interfaces/factory/IAccountFactory.sol index 01a41f19..7eae0c65 100644 --- a/contracts/interfaces/factory/IAccountFactory.sol +++ b/contracts/interfaces/factory/IAccountFactory.sol @@ -9,8 +9,8 @@ pragma solidity ^0.8.24; // /_/ |_/\___/_/|_\__,_/____/ // // ────────────────────────────────────────────────────────────────────────────── -// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, -// using Entrypoint version 0.7.0, developed by Biconomy. Learn more at https://biconomy.io/ +// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, developed by Biconomy. +// Learn more at https://biconomy.io/ /// @title Nexus - IAccountFactory Interface /// @notice Interface for creating Smart Accounts within the Nexus suite, compliant with ERC-4337 and ERC-7579. diff --git a/contracts/interfaces/modules/IExecutor.sol b/contracts/interfaces/modules/IExecutor.sol index 85080e64..1612b870 100644 --- a/contracts/interfaces/modules/IExecutor.sol +++ b/contracts/interfaces/modules/IExecutor.sol @@ -9,20 +9,20 @@ pragma solidity ^0.8.24; // /_/ |_/\___/_/|_\__,_/____/ // // ────────────────────────────────────────────────────────────────────────────── -// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, -// using Entrypoint version 0.7.0, developed by Biconomy. Learn more at https://biconomy.io/ +// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, developed by Biconomy. +// Learn more at https://biconomy.io/ -import { IERC7579ModuleBase } from "./IERC7579ModuleBase.sol"; +import { IModule } from "./IModule.sol"; /// @title Nexus - IExecutor Interface /// @notice Defines the interface for Executor modules within the Nexus Smart Account framework, compliant with the ERC-7579 standard. -/// @dev Extends IERC7579ModuleBase to include functionalities specific to execution modules. +/// @dev Extends IModule to include functionalities specific to execution modules. /// This interface is future-proof, allowing for expansion and integration of advanced features in subsequent versions. /// @author @livingrockrises | Biconomy | chirag@biconomy.io /// @author @aboudjem | Biconomy | adam.boudjemaa@biconomy.io /// @author @filmakarov | Biconomy | filipp.makarov@biconomy.io /// @author @zeroknots | Rhinestone.wtf | zeroknots.eth /// Special thanks to the Solady team for foundational contributions: https://github.com/Vectorized/solady -interface IExecutor is IERC7579ModuleBase { +interface IExecutor is IModule { // Future methods for execution management will be defined here to accommodate evolving requirements. } diff --git a/contracts/interfaces/modules/IFallback.sol b/contracts/interfaces/modules/IFallback.sol index 445bebe5..d8b1f1d2 100644 --- a/contracts/interfaces/modules/IFallback.sol +++ b/contracts/interfaces/modules/IFallback.sol @@ -9,20 +9,20 @@ pragma solidity ^0.8.24; // /_/ |_/\___/_/|_\__,_/____/ // // ────────────────────────────────────────────────────────────────────────────── -// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, -// using Entrypoint version 0.7.0, developed by Biconomy. Learn more at https://biconomy.io/ +// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, developed by Biconomy. +// Learn more at https://biconomy.io/ -import { IERC7579ModuleBase } from "./IERC7579ModuleBase.sol"; +import { IModule } from "./IModule.sol"; /// @title Nexus - IFallback Interface /// @notice Defines the interface for Fallback modules within the Nexus Smart Account framework, compliant with the ERC-7579 standard. -/// @dev Extends IERC7579ModuleBase to include functionalities specific to fallback modules. +/// @dev Extends IModule to include functionalities specific to fallback modules. /// This interface is future-proof, allowing for expansion and integration of advanced features in subsequent versions. /// @author @livingrockrises | Biconomy | chirag@biconomy.io /// @author @aboudjem | Biconomy | adam.boudjemaa@biconomy.io /// @author @filmakarov | Biconomy | filipp.makarov@biconomy.io /// @author @zeroknots | Rhinestone.wtf | zeroknots.eth /// Special thanks to the Solady team for foundational contributions: https://github.com/Vectorized/solady -interface IFallback is IERC7579ModuleBase { +interface IFallback is IModule { // Future methods for fallback management will be defined here to accommodate evolving blockchain technologies. } diff --git a/contracts/interfaces/modules/IHook.sol b/contracts/interfaces/modules/IHook.sol index a690c4cb..28cd6393 100644 --- a/contracts/interfaces/modules/IHook.sol +++ b/contracts/interfaces/modules/IHook.sol @@ -9,16 +9,16 @@ pragma solidity ^0.8.24; // /_/ |_/\___/_/|_\__,_/____/ // // ────────────────────────────────────────────────────────────────────────────── -// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, -// using Entrypoint version 0.7.0, developed by Biconomy. Learn more at https://biconomy.io/ +// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, developed by Biconomy. +// Learn more at https://biconomy.io/ -import { IERC7579ModuleBase } from "./IERC7579ModuleBase.sol"; +import { IModule } from "./IModule.sol"; /// @title Hook Management Interface /// @notice Provides methods for pre-checks and post-checks of transactions to ensure conditions and state consistency. /// @dev Defines two critical lifecycle hooks in the transaction process: `preCheck` and `postCheck`. /// These methods facilitate validating conditions prior to execution and verifying state changes afterwards, respectively. -interface IHook is IERC7579ModuleBase { +interface IHook is IModule { /// @notice Performs checks before a transaction is executed, potentially modifying the transaction context. /// @dev This method is called before the execution of a transaction to validate and possibly adjust execution context. /// @param msgSender The original sender of the transaction. diff --git a/contracts/interfaces/modules/IERC7579ModuleBase.sol b/contracts/interfaces/modules/IModule.sol similarity index 94% rename from contracts/interfaces/modules/IERC7579ModuleBase.sol rename to contracts/interfaces/modules/IModule.sol index 1e6a16bd..7c0860b0 100644 --- a/contracts/interfaces/modules/IERC7579ModuleBase.sol +++ b/contracts/interfaces/modules/IModule.sol @@ -9,8 +9,8 @@ pragma solidity ^0.8.24; // /_/ |_/\___/_/|_\__,_/____/ // // ────────────────────────────────────────────────────────────────────────────── -// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, -// using Entrypoint version 0.7.0, developed by Biconomy. Learn more at https://biconomy.io/ +// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, developed by Biconomy. +// Learn more at https://biconomy.io/ /// @title Nexus - ERC-7579 Module Base Interface /// @notice Interface for module management in smart accounts, complying with ERC-7579 specifications. @@ -21,7 +21,7 @@ pragma solidity ^0.8.24; /// @author @filmakarov | Biconomy | filipp.makarov@biconomy.io /// @author @zeroknots | Rhinestone.wtf | zeroknots.eth /// Special thanks to the Solady team for foundational contributions: https://github.com/Vectorized/solady -interface IERC7579ModuleBase { +interface IModule { /// @notice Installs the module with necessary initialization data. /// @dev Reverts if the module is already initialized. /// @param data Arbitrary data required for initializing the module during `onInstall`. diff --git a/contracts/interfaces/modules/IValidator.sol b/contracts/interfaces/modules/IValidator.sol index 769c3ee3..0a690da4 100644 --- a/contracts/interfaces/modules/IValidator.sol +++ b/contracts/interfaces/modules/IValidator.sol @@ -9,19 +9,19 @@ pragma solidity ^0.8.24; // /_/ |_/\___/_/|_\__,_/____/ // // ────────────────────────────────────────────────────────────────────────────── -// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, -// using Entrypoint version 0.7.0, developed by Biconomy. Learn more at https://biconomy.io/ +// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, developed by Biconomy. +// Learn more at https://biconomy.io/ import { PackedUserOperation } from "account-abstraction/contracts/interfaces/PackedUserOperation.sol"; -import { IERC7579ModuleBase } from "./IERC7579ModuleBase.sol"; +import { IModule } from "./IModule.sol"; /// @author @livingrockrises | Biconomy | chirag@biconomy.io /// @author @aboudjem | Biconomy | adam.boudjemaa@biconomy.io /// @author @filmakarov | Biconomy | filipp.makarov@biconomy.io /// @author @zeroknots | Rhinestone.wtf | zeroknots.eth /// Special thanks to the Solady team for foundational contributions: https://github.com/Vectorized/solady -interface IValidator is IERC7579ModuleBase { +interface IValidator is IModule { /// @notice Validates a user operation as per ERC-4337 standard requirements. /// @dev Should ensure that the signature and nonce are verified correctly before the transaction is allowed to proceed. /// The function returns a status code indicating validation success or failure. diff --git a/contracts/mocks/Imports.sol b/contracts/mocks/Imports.sol index 714b419d..4eebb211 100644 --- a/contracts/mocks/Imports.sol +++ b/contracts/mocks/Imports.sol @@ -9,8 +9,8 @@ pragma solidity ^0.8.24; // /_/ |_/\___/_/|_\__,_/____/ // // ────────────────────────────────────────────────────────────────────────────── -// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, -// using Entrypoint version 0.7.0, developed by Biconomy. Learn more at https://biconomy.io/ +// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, developed by Biconomy. +// Learn more at https://biconomy.io/ // Note: // To be able to compile foundry/mocks for typechain and use in hardhat tests diff --git a/contracts/mocks/MockToken.sol b/contracts/mocks/MockToken.sol index 5b765d67..880e2420 100644 --- a/contracts/mocks/MockToken.sol +++ b/contracts/mocks/MockToken.sol @@ -9,8 +9,8 @@ pragma solidity ^0.8.24; // /_/ |_/\___/_/|_\__,_/____/ // // ────────────────────────────────────────────────────────────────────────────── -// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, -// using Entrypoint version 0.7.0, developed by Biconomy. Learn more at https://biconomy.io/ +// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, developed by Biconomy. +// Learn more at https://biconomy.io/ import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; diff --git a/contracts/modules/validators/K1Validator.sol b/contracts/modules/validators/K1Validator.sol index cbacf2b8..8c151b76 100644 --- a/contracts/modules/validators/K1Validator.sol +++ b/contracts/modules/validators/K1Validator.sol @@ -9,8 +9,8 @@ pragma solidity ^0.8.24; // /_/ |_/\___/_/|_\__,_/____/ // // ────────────────────────────────────────────────────────────────────────────── -// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, -// using Entrypoint version 0.7.0, developed by Biconomy. Learn more at https://biconomy.io/ +// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, developed by Biconomy. +// Learn more at https://biconomy.io/ import { ECDSA } from "solady/src/utils/ECDSA.sol"; import { SignatureCheckerLib } from "solady/src/utils/SignatureCheckerLib.sol"; diff --git a/contracts/types/Constants.sol b/contracts/types/Constants.sol index 1ee876e2..88d781d1 100644 --- a/contracts/types/Constants.sol +++ b/contracts/types/Constants.sol @@ -9,8 +9,8 @@ pragma solidity ^0.8.24; // /_/ |_/\___/_/|_\__,_/____/ // // ────────────────────────────────────────────────────────────────────────────── -// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, -// using Entrypoint version 0.7.0, developed by Biconomy. Learn more at https://biconomy.io/ +// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, developed by Biconomy. +// Learn more at https://biconomy.io/ bytes4 constant ERC1271_MAGICVALUE = 0x1626ba7e; bytes4 constant ERC1271_INVALID = 0xFFFFFFFF; diff --git a/contracts/types/DataTypes.sol b/contracts/types/DataTypes.sol index f9dad33d..479792ce 100644 --- a/contracts/types/DataTypes.sol +++ b/contracts/types/DataTypes.sol @@ -9,8 +9,8 @@ pragma solidity ^0.8.24; // /_/ |_/\___/_/|_\__,_/____/ // // ────────────────────────────────────────────────────────────────────────────── -// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, -// using Entrypoint version 0.7.0, developed by Biconomy. Learn more at https://biconomy.io/ +// Nexus: A suite of contracts for Modular Smart Account compliant with ERC-7579 and ERC-4337, developed by Biconomy. +// Learn more at https://biconomy.io/ struct Execution { address target; diff --git a/test/foundry/mocks/MockExecutor.sol b/test/foundry/mocks/MockExecutor.sol index 0506bc98..94856df5 100644 --- a/test/foundry/mocks/MockExecutor.sol +++ b/test/foundry/mocks/MockExecutor.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.23; -import { IERC7579ModuleBase } from "contracts/interfaces/modules/IERC7579ModuleBase.sol"; +import { IModule } from "contracts/interfaces/modules/IModule.sol"; import { EncodedModuleTypes } from "contracts/lib/ModuleTypeLib.sol"; import { INexus } from "contracts/interfaces/INexus.sol"; import { ModeLib } from "contracts/lib/ModeLib.sol"; diff --git a/test/foundry/mocks/MockHandler.sol b/test/foundry/mocks/MockHandler.sol index 62d3cc82..3ed50746 100644 --- a/test/foundry/mocks/MockHandler.sol +++ b/test/foundry/mocks/MockHandler.sol @@ -5,7 +5,7 @@ pragma solidity ^0.8.23; import { IERC721Receiver } from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import { IERC165 } from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; -import { IERC7579ModuleBase } from "contracts/interfaces/modules/IERC7579ModuleBase.sol"; +import { IModule } from "contracts/interfaces/modules/IModule.sol"; import { IFallback } from "contracts/interfaces/modules/IFallback.sol"; import { EncodedModuleTypes } from "contracts/lib/ModuleTypeLib.sol"; import "../utils/EventsAndErrors.sol"; diff --git a/test/foundry/mocks/MockHook.sol b/test/foundry/mocks/MockHook.sol index e61d43ff..201dd49b 100644 --- a/test/foundry/mocks/MockHook.sol +++ b/test/foundry/mocks/MockHook.sol @@ -1,11 +1,11 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.23; -import { IERC7579ModuleBase } from "contracts/interfaces/modules/IERC7579ModuleBase.sol"; +import { IModule } from "contracts/interfaces/modules/IModule.sol"; import { EncodedModuleTypes } from "contracts/lib/ModuleTypeLib.sol"; import "contracts/types/Constants.sol"; -contract MockHook is IERC7579ModuleBase { +contract MockHook is IModule { event PreCheckCalled(); event PostCheckCalled(); diff --git a/test/foundry/mocks/MockValidator.sol b/test/foundry/mocks/MockValidator.sol index b8ae5579..20acddee 100644 --- a/test/foundry/mocks/MockValidator.sol +++ b/test/foundry/mocks/MockValidator.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.24; -import { IERC7579ModuleBase } from "../../../contracts/interfaces/modules/IERC7579ModuleBase.sol"; +import { IModule } from "../../../contracts/interfaces/modules/IModule.sol"; import { IValidator } from "../../../contracts/interfaces/modules/IValidator.sol"; import { VALIDATION_SUCCESS, VALIDATION_FAILED, MODULE_TYPE_VALIDATOR } from "../../../contracts/types/Constants.sol"; import { EncodedModuleTypes } from "../../../contracts/lib/ModuleTypeLib.sol"; diff --git a/test/foundry/utils/Imports.sol b/test/foundry/utils/Imports.sol index c278be30..3b18b870 100644 --- a/test/foundry/utils/Imports.sol +++ b/test/foundry/utils/Imports.sol @@ -25,7 +25,7 @@ import "../../../contracts/lib/ModuleTypeLib.sol"; // Interface imports import "../../../contracts/interfaces/base/IAccountConfig.sol"; import "../../../contracts/interfaces/base/IModuleManager.sol"; -import "../../../contracts/interfaces/modules/IERC7579ModuleBase.sol"; +import "../../../contracts/interfaces/modules/IModule.sol"; import "../../../contracts/interfaces/base/IStorage.sol"; import "../../../contracts/interfaces/factory/IAccountFactory.sol"; import "../../../contracts/interfaces/INexus.sol";