> For the complete documentation index, see [llms.txt](https://0xshiven.gitbook.io/guardian-smart-wallet-contracts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://0xshiven.gitbook.io/guardian-smart-wallet-contracts/guides/smart-account-account-factory.md).

# Smart Account (Account Factory)

The **Account Factory** contract deploys non-upgradeable, [ERC-4337](https://eips.ethereum.org/EIPS/eip-4337) compatible smart wallet accounts for your dApp users. The smart wallet comes with all the basic **benefits of account abstraction** like no private key handling, gasless transactions, etc, along with the **social account locking and recovery features** provided by Guardian Smart Wallet Contracts.&#x20;

{% hint style="info" %}
The `Account` smart contract is non-upgradeable. Developers should use this wallet only if they do not anticipate making any future upgrades to their users' smart wallets.
{% endhint %}

### **Usage**

#### On the client side:

Use the AccountFactory address directly on the client side to interact with the deployed factory contract.

#### In smart-contract projects:

```solidity
import {AccountFactory} from "@guardian-wallet/contracts/non-upgradeable/AccountFactory.sol;
```

### Functions

```solidity
function createAccount(address _admin, bytes calldata _email) -> address
```

Deploys a new smart wallet for your dApp user.

**Params:**

1. `address _admin`: The public address of the user's EOA/Embedded wallet, powering the smart-wallet account.
2. `bytes calldata _email`: The user's email in encoded form. This email ID should have been verified by the client and will be used in the account locking and recovery operations.

**Returns:**

`address` : The address of the smart wallet account created for the user.

***

```solidity
function execute(
        address _target,
        uint256 _value,
        bytes calldata _calldata
    ) external virtual onlyAdminOrEntrypoint whenNotPaused {}
```

Executes a single transaction. Can only be called directly by the owner or the [entry point contract.](https://portal.thirdweb.com/wallets/smart-wallet/how-it-works#terminology)

{% hint style="warning" %}
`whenNotPaused` is a modifier, which only allows transactions to go through if the smart wallet account is not locked.
{% endhint %}

**Params**

`address _target`: The address of the contract against which the transaction should execute.

`uint256 _value`: The value of native tokens, if any, that should be transferred to the `_target` contract.

`bytes calldata _calldata`: Any call data to be sent.

***

```solidity
function executeBatch(
        address[] calldata _target,
        uint256[] calldata _value,
        bytes[] calldata _calldata
    ) external virtual onlyAdminOrEntrypoint whenNotPaused {}
```

Executes a batch of transactions. Can only be called directly by the owner or the [entry point contract.](https://portal.thirdweb.com/wallets/smart-wallet/how-it-works#terminology)

{% hint style="warning" %}
`whenNotPaused` is a modifier, which only allows transactions to go through if the smart wallet account is not locked.
{% endhint %}

#### Params

`address[] calldata _target`: The addresses of the contracts against which the transactions should execute.

`uint256[] calldata _value`: The values of native tokens, if any, that should be transferred to the `_target` contracts. The indexes of `_target` and `_value` arrays should correspond.

`bytes[] calldata _calldata`: Bytes of call data, if any, that need to be sent to the respective `_target` contracts. The indexes of `_target` and `_calldata` arrays should correspond.
