# DelegationWalletFactory

The DelegationWalletFactory contract is responsible for deploying and configuring new instances of the Delegation Wallet components. It acts as the entry point for creating a new wallet and ensures all necessary contracts are correctly initialized.&#x20;

## Key Functions:

```solidity
function deploy(address _delegationController) 
external 
returns (
    address, 
    address, 
    address, 
    address
)
```

Deploys a new Delegation Wallet with the `msg.sender` as the owner.

### Parameters:

`_delegationController` (address): The address of the delegation controller.

### Returns:

The addresses of the deployed GnosisSafe, DelegationOwner, ProtocolOwner, and GuardOwner contracts.

***

```solidity
function deployFor(address _owner, address _delegationController) 
public 
returns (
    address, 
    address, 
    address, 
    address
    )
```

Deploys a new Delegation Wallet for a specified owner.

### Parameters:

`_owner` (address): The address of the wallet owner.

`_delegationController` (address): The address of the delegation controller.

### Returns:

The addresses of the deployed GnosisSafe, DelegationOwner, ProtocolOwner, and GuardOwner contracts.

***

## Interactions:

* Interacts with the GnosisSafeProxyFactory to deploy a new GnosisSafe contract.
* Interacts with the beacon proxies to deploy new instances of the GuardOwner, DelegationOwner, and ProtocolOwner contracts.
* Registers the deployed wallet components in the DelegationWalletRegistry.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://devs.unlockd.finance/unlockd-account-wallet/delegationwalletfactory.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
