Skip to content

Commit

Permalink
Update imports and renaming files
Browse files Browse the repository at this point in the history
  • Loading branch information
Aboudjem committed Apr 25, 2024
1 parent bfaadfe commit d7625e9
Show file tree
Hide file tree
Showing 34 changed files with 93 additions and 92 deletions.
9 changes: 5 additions & 4 deletions contracts/Nexus.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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";
Expand All @@ -33,7 +33,7 @@ import { ModeLib, ExecutionMode, ExecType, CallType, CALLTYPE_BATCH, CALLTYPE_SI
/// @author @filmakarov | Biconomy | [email protected]
/// @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;

Expand Down Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions contracts/base/BaseAccount.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -25,7 +25,7 @@ import { IExecutionManagerEventsAndErrors } from "../interfaces/base/IExecutionM
/// @author @filmakarov | Biconomy | [email protected]
/// @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.
Expand Down
12 changes: 6 additions & 6 deletions contracts/base/ModuleManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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";

Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
}

Expand All @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions contracts/base/Storage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
4 changes: 2 additions & 2 deletions contracts/factory/AccountFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
4 changes: 2 additions & 2 deletions contracts/interfaces/IERC4337Account.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
10 changes: 5 additions & 5 deletions contracts/interfaces/IERC7579Account.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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 | [email protected]
/// @author @aboudjem | Biconomy | [email protected]
/// @author @filmakarov | Biconomy | [email protected]
/// @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.
Expand Down
4 changes: 2 additions & 2 deletions contracts/interfaces/INexus.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
4 changes: 2 additions & 2 deletions contracts/interfaces/INexusEventsAndErrors.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
4 changes: 2 additions & 2 deletions contracts/interfaces/base/IAccountConfig.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
4 changes: 2 additions & 2 deletions contracts/interfaces/base/IBaseAccount.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
4 changes: 2 additions & 2 deletions contracts/interfaces/base/IBaseAccountEventsAndErrors.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 | [email protected]
/// @author @aboudjem | Biconomy | [email protected]
/// @author @filmakarov | Biconomy | [email protected]
/// @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.
Expand Down
Loading

0 comments on commit d7625e9

Please sign in to comment.