-
Notifications
You must be signed in to change notification settings - Fork 5
NexusAccountFactory
Inherits: AbstractNexusFactory
Manages the creation of Modular Smart Accounts compliant with ERC-7579 and ERC-4337 using a factory pattern.
Constructor to set the smart account implementation address and owner.
constructor(address implementation_, address owner_) AbstractNexusFactory(implementation_, owner_);
Parameters
Name | Type | Description |
---|---|---|
implementation_ |
address |
The address of the Nexus implementation to be used for all deployments. |
owner_ |
address |
The address of the owner of the factory. |
Important
constructor: The constructor sets critical state variables that define the behavior and ownership of the factory. Ensure that the addresses provided are accurate.
Creates a new Nexus account with the provided initialization data.
function createAccount(bytes calldata initData, bytes32 salt) external payable override returns (address payable);
Parameters
Name | Type | Description |
---|---|---|
initData |
bytes |
Initialization data to be called on the new Smart Account. |
salt |
bytes32 |
Unique salt for the Smart Account creation. |
Returns
Name | Type | Description |
---|---|---|
<none> |
address payable |
The address of the newly created Nexus account. |
Caution
createAccount: Ensure that the initData and salt are correctly specified to avoid deploying multiple accounts at the same address or creating unintended behavior.
Computes the expected address of a Nexus contract using the factory's deterministic deployment algorithm.
function computeAccountAddress(bytes calldata, bytes32) external view override returns (address payable expectedAddress);
Parameters
Name | Type | Description |
---|---|---|
<none> |
bytes |
N/A (read from the calldata directly from the assembly code). |
<none> |
bytes32 |
N/A (read from the calldata directly from the assembly code). |
Returns
Name | Type | Description |
---|---|---|
expectedAddress |
address payable |
The expected address at which the Nexus contract will be deployed if the provided parameters are used. |
Note
computeAccountAddress: The function reads from the calldata directly using assembly code, ensuring deterministic address computation.
- 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