# Getting Started

### Install

```javascript
forge install alfheimrShiven/guardian-smart-wallet-contracts
```

{% hint style="info" %}
Add `@guardian-wallet/contracts=lib/guardian-smart-wallet-contracts/contracts/prebuilts/account`in the remappings.txt or remappings list of your foundry.toml file.
{% endhint %}

### **Deploy**

#### On Anvil (Locally):

{% hint style="info" %}
Please make sure that the Anvil chain is running locally on your system. Run `anvil` in your terminal to run the Anvil chain.
{% endhint %}

```
make deploy_smart_wallet_factory
```

Deploying `AccountFactory.sol` will auto-deploy the following contracts along with it to enable the default features of the Guardian Smart wallet:

1. `AccountFactory.sol`
2. `Guardian.sol`
3. `AccountGuardian.sol`
4. `AccountLock.sol`
5. `AccountRecovery.sol`

{% hint style="info" %}
You can capture the deployed contract addresses from the console logs or the events emitted.
{% endhint %}

To know more about the util contracts deployed by the factory and their scope, visit the [Architecture page.](../architecture#contracts)

### **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;
import {Guardian} from "@guardian-wallet/contracts/utils/Guardian.sol;
import {AccountGuardian} from "@guardian-wallet/contracts/utils/AccountGuardian.sol;
import {AccountLock} from "@guardian-wallet/contracts/utils/AccountLock.sol;
import {AccountRecovery} from "@guardian-wallet/contracts/utils/AccountRecovery.sol;
```
