OpenR&D Documentation
  • About
    • OpenR&D
      • Vision
      • Problem Statement & Innovation
      • Task progression
      • Supported chains
      • Glossary
      • Contact Us
    • Verified Contributors
  • Getting Started - Create Tasks
    • Create a task
      • Connect Wallet
    • Accept an application
    • Review a submission
    • Additional management
  • Getting Started - Perform tasks
    • Apply to task
      • Edit Profile
    • Take a task
    • Create a submission
    • Dispute Resolution
  • Verified Contributors Guide
    • Apply as Verified Contributor
    • Verified Contributor Score
      • Claiming
    • Governance
    • Departments
      • Dispute Department
      • Expert Department
  • Technical
    • Smart contracts
      • OpenR&D
        • Tasks
        • Escrow
        • Task Disputes
          • Smart Account Task Disputes Installer
        • Task Drafts
          • Smart Account Task Drafts Installer
        • RFPs
        • RFPEscrow
      • Verified Contributors
        • Verified Contributor
        • Tag Manager
        • Tag Voting
        • Trustless Management
        • Open Claiming
        • Departments
          • Department Factory
          • Smart Account Department Installer
      • Others
        • Smart Account
        • Crosschain Account
        • Trustless Actions
          • Optimistic Actions
          • Pessimistic Actions
    • Web interface
      • Indexer
      • Frontend
    • Audits
  • FAQs
  • Join Community
Powered by GitBook
On this page
  • Create draft task
  • Inputs
  • Code
  • Update Addresses
  • Inputs
  • Code
  • Auto-generated documentation
  1. Technical
  2. Smart contracts
  3. OpenR&D

Task Drafts

Create draft task

Inputs

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

```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

Inputs

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

```solidity
function updateAddresses(
    ITasks _tasks,
    IPluginProposals _governancePlugin
) external auth(UPDATE_ADDRESSES_PERMISSION_ID) {
    tasks = _tasks;
    governancePlugin = _governancePlugin;
}
```
PreviousSmart Account Task Disputes InstallerNextSmart Account Task Drafts Installer

Last updated 1 year ago

Auto-generated documentation