-
Notifications
You must be signed in to change notification settings - Fork 1
Factories
Factories in the Nexus framework are responsible for creating and managing smart accounts compliant with ERC-7579 and ERC-4337 standards. They ensure deterministic deployment of accounts and handle initialization processes, guaranteeing modular and secure account creation. Below, we explain the purpose and flow of each factory within the Nexus framework.
Factories in the Nexus framework are specialized contracts that manage the creation of modular smart accounts. They provide a standardized way to deploy accounts with specific configurations, ensuring compliance with ERC-7579 and ERC-4337 standards. Each factory handles different aspects of account creation, from module whitelisting to validator integration, ensuring the robustness and flexibility of the Nexus smart accounts.
- Deterministic Deployment: Ensures that the deployed account addresses are predictable and consistent across different environments.
- Module Management: Integrates and manages various modules within the smart accounts to enhance functionality and security.
- Compliance and Security: Adheres to industry standards and implements stringent security measures to protect user accounts.
BiconomyMetaFactory manages the deployment of Nexus accounts using approved factories. It ensures only whitelisted factories can be used, preventing unauthorized deployments and enhancing security.
- Factory Whitelisting: Ensures that only authorized factories can deploy accounts.
- Secure Deployment: Verifies the success of the deployment call and returns the created account address.
- Input Factory Address and Data
- Check if Factory is Whitelisted
- Call Factory with Data
- Check if Call was Successful
- Deploy Account if Call Successful
- Return Created Account Address
Tip
Ensure the factory whitelist is regularly updated to include only trusted factories. This prevents unauthorized access and potential security breaches.
ModuleWhitelistFactory ensures that only whitelisted modules are used during the Nexus account creation. This factory provides an additional layer of security by validating the modules before deployment.
- Module Validation: Ensures only approved modules are integrated into the accounts.
- Secure Initialization: Initializes the account with whitelisted modules, ensuring compliance and security.
- Input Init Data and Salt
- Extract Modules from Init Data
- Check if Modules are Whitelisted
- Compute Deterministic Salt
- Deploy Nexus with Salt
- Initialize Account with Whitelisted Modules if Not Deployed
- Emit Account Created Event
- Return Created Account Address
Warning
Always verify the integrity and security of modules before adding them to the whitelist. Regularly review and update the whitelist to ensure only secure modules are used.
K1ValidatorFactory is designed for creating Nexus accounts with K1 validators, ensuring that each account is associated with a validated owner and follows secure initialization procedures.
- Validator Integration: Incorporates K1 validators into the account initialization process.
- Deterministic Deployment: Uses a unique salt and validator information for predictable deployments.
- Input EOA Owner and Index
- Compute Deterministic Salt
- Deploy Nexus with Salt
- Check if Already Deployed
- Initialize Account with K1 Validator if Not Deployed
- Emit Account Created Event
- Return Created Account Address
[!INFO] Ensure the K1 validator address is correctly set and immutable to maintain the integrity of the validation process.
NexusAccountFactory handles the general creation of Nexus smart accounts using a deterministic deployment pattern, ensuring consistency and predictability.
- Deterministic Deployment: Uses a unique salt and initialization data for predictable account creation.
- General Account Initialization: Handles the basic initialization of Nexus accounts, making it a versatile factory for various deployment needs.
- Input Init Data and Salt
- Compute Deterministic Salt
- Deploy Nexus with Salt
- Check if Already Deployed
- Initialize Account if Not Deployed
- Emit Account Created Event
- Return Created Account Address
Tip
Regularly audit the initialization data and deployment process to ensure compliance with security standards and best practices.
- Home
- Nexus Architecture
- Access Control
- Execution Framework
- Modules
- Factories
- Migration Guide
- Testing Documentation
- Configuration and Security
- Libraries
- FAQ
- Biconomy Solidity Style Guide
- Security Considerations
- Team
-
Contracts
- Nexus
- Base
- Common
- Factory
- AbstractNexusFactory
- BiconomyMetaFactory
- K1ValidatorFactory
- ModuleWhitelistFactory
- NexusAccountFactory
- Modules
- Utils