# 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 %}


---

# 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://docs.zestprotocol.com/start/stacks-market-v2-smart-contracts-overview/v2-contracts/dao-contracts/dao-executor.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.
