> For the complete documentation index, see [llms.txt](https://docs.openmesh.network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.openmesh.network/open-source-initiatives/openr-and-d/openr-and-d-smart-contracts/task-drafts.md).

# Task Drafts

### Create draft task <a href="#create-draft-task" id="create-draft-task"></a>

#### Inputs <a href="#inputs" id="inputs"></a>

**Metadata**: string; the uri for the metadata of the proposal.

**StartDate:** uint64; unix timestamp (seconds) when the proposal voting period starts.

**EndDate**: uint64; unix timestamp (seconds) when the proposal voting period ends.

**TaskInfo**: CreateTaskInfo (tuple(string, uint64, ERC20Transfer\[] (tuple(address, uint96)), address, PreapprovedApplication\[] (tuple(address, Reward\[] (tuple(bool,address,uint88)))))); information about the task you want to propose to be created.

#### Code <a href="#code" id="code"></a>

````
```solidity
function createDraftTask(
    bytes calldata _metadata,
    uint64 _startDate,
    uint64 _endDate,
    CreateTaskInfo calldata _taskInfo
) external {
    // Could also add approve ERC20's of budget here
    // Currently the DAO should approve select ERC20's in advance (once) for unlimited spending

    IDAO.Action[] memory actions = new IDAO.Action[](1);
    {
        bytes memory callData = abi.encodeWithSelector(
            tasks.createTask.selector,
            _taskInfo.metadata,
            _taskInfo.deadline,
            _taskInfo.budget,
            _taskInfo.manager,
            _taskInfo.preapproved
        );
        actions[0] = IDAO.Action(address(tasks), 0, callData);
    }

    governancePlugin.createPluginProposal(
        _metadata,
        actions,
        0,
        _startDate,
        _endDate
    );
}
```
````

### Update Addresses <a href="#update-addresses" id="update-addresses"></a>

#### Inputs <a href="#inputs-1" id="inputs-1"></a>

**Tasks**: ITasks (address); the new address of the tasks contract used to create the draft tasks.

**GovernancePlugin**: IPluginProposals (address); the new address of the governance plugin used to create proposals.

#### Code <a href="#code-1" id="code-1"></a>

````
```solidity
function updateAddresses(
    ITasks _tasks,
    IPluginProposals _governancePlugin
) external auth(UPDATE_ADDRESSES_PERMISSION_ID) {
    tasks = _tasks;
    governancePlugin = _governancePlugin;
}
```
````

### [Auto-generated documentation](https://github.com/L3A-Protocol/openrd/blob/main/docs/DAO/TaskDrafts/TaskDrafts.md) <a href="#auto-generated-documentation" id="auto-generated-documentation"></a>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.openmesh.network/open-source-initiatives/openr-and-d/openr-and-d-smart-contracts/task-drafts.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
