> For the complete documentation index, see [llms.txt](https://docs.zestprotocol.com/start/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zestprotocol.com/start/stacks-market-smart-contracts/v2-contracts/dao-contracts/dao-executor.md).

# DAO Executor

{% hint style="info" %}
Purpose: Proposal execution engine with upgrade support. Acts as executor for approved DAO proposals.
{% endhint %}

## List of Core Functions

* **get-impl**: Returns current implementation contract
* **set-impl**: Updates implementation contract (requires impl auth)
* **init**: Initializes executor with implementation (deployer only, one-time)
* **execute-proposal**: Executes proposal script with full contract permissions

## Function Parameters

### get-impl

Returns current implementation contract address.

| Parameter | Type | Description   |
| --------- | ---- | ------------- |
| (none)    | -    | No parameters |

Returns:

```
(response (optional principal) uint)
```

* Current implementation or none

***

### set-impl

Updates implementation contract. Requires authorization from current implementation.

| Parameter | Type      | Description                            |
| --------- | --------- | -------------------------------------- |
| new-impl  | principal | Address of new implementation contract |

Returns:

```
(response bool uint)
```

* Success or error code

{% hint style="warning" %}
Authorization: Current implementation only (checked via contract-caller)
{% endhint %}

### init

Initializes executor with implementation address. Can only be called once by deployer.

| Parameter | Type      | Description                                |
| --------- | --------- | ------------------------------------------ |
| new-impl  | principal | Address of initial implementation contract |

Returns:

```
(response bool uint)
```

* Success or error code

{% hint style="warning" %}
Authorization: Deployer only, one-time initialization
{% endhint %}

### execute-proposal

Executes approved proposal script with full contract permissions.

| Parameter | Type                | Description                                          |
| --------- | ------------------- | ---------------------------------------------------- |
| script    | `<proposal-script>` | Proposal contract implementing proposal-script trait |

Returns:

```
(response bool uint)
```

* Success or error code

{% hint style="warning" %}
Authorization: Current implementation only (checked via contract-caller)
{% endhint %}

{% hint style="info" %}
Note: Executes with `as-contract` context granting full treasury access.
{% endhint %}
