Andamio Logo
Protocol/Protocol V2/Transactions/Project/Manager/Tasks

Tasks Manage

Add or remove project tasks, optionally fund treasury

Project Manager Tasks Manage

Add or remove project tasks. Managers can batch multiple operations in a single transaction, optionally funding the project treasury at the same time.

API Endpoint

POST /v2/tx/project/manager/tasks/manage

Cost Summary

Cost TypeAmountNotes
Transaction Fee~0.43 ADANetwork fee (scales with task count)
Protocol Fee0 ADANo service fee
Task EscrowvariesHolds the task reward amount

Request Body

{
  "alias": "james",
  "project_id": "1454468edf80c69f84314b689f56e2fc25aca385aecb037a912a5aba",
  "contributor_state_id": "7c542d1ee32de598727b1fae859afa08d4eafcab9eadfcdcbb22bd97",
  "tasks_to_add": [
    {
      "project_content": "somearbitraryhashletsfigureitout",
      "expiration_time": 1768577592000,
      "lovelace_amount": 12500000,
      "native_assets": []
    }
  ],
  "tasks_to_remove": [],
  "deposit_value": [
    ["lovelace", 175000000],
    ["fe8efd6bb0dfafd5c7ed9764c9ee11d0580bfab2553f94743d8ef48e.7457696e64736f72", 4]
  ]
}
FieldTypeRequiredDescription
aliasstringYesManager's access token alias
project_idstringYesProject NFT policy ID (56 char hex)
contributor_state_idstringYesPrerequisite credential policy ID
tasks_to_addobject[]YesTasks to create (empty = none)
tasks_to_removeobject[]YesTasks to remove (empty = none)
deposit_valuearrayNoOptional treasury deposit

Task Definition Fields

Each task in tasks_to_add has the following structure:

FieldTypeRequiredDescription
project_contentstringYesTask content hash or identifier
expiration_timeintegerYesExpiration timestamp (milliseconds since epoch)
lovelace_amountintegerYesADA reward in lovelace (e.g., 12500000 = 12.5 ADA)
native_assetsarrayYesAdditional token rewards (empty = ADA only)

Transaction Pattern

Spend and Recreate with Observer - Unlike course modules, tasks do NOT mint new tokens!

┌─────────────────────────────────────────────────────────────────┐
│                    TASKS MANAGE TRANSACTION                      │
├─────────────────────────────────────────────────────────────────┤
│                                                                  │
│  INPUTS                           OUTPUTS                        │
│  ──────                           ───────                        │
│  ┌─────────────────┐             ┌─────────────────┐            │
│  │ Task Escrow     │────────────▶│ Task Escrow     │            │
│  │ (treasury-token │   SPEND     │ (updated datum) │            │
│  │  + task datum)  │             └─────────────────┘            │
│  └─────────────────┘                                            │
│                                   ┌─────────────────┐            │
│  ┌─────────────────┐             │ Treasury Deposit│  OPTIONAL  │
│  │ Wallet          │────────────▶│ (if deposit_    │            │
│  │ (u-token + ADA) │             │  value provided)│            │
│  └─────────────────┘             └─────────────────┘            │
│                                                                  │
│  MINTS: NONE                      ┌─────────────────┐            │
│  ─────────────                    │ User Wallet     │            │
│  Treasury-tokens were             │ (u-token +      │            │
│  minted during project.create     │  change)        │            │
│                                   └─────────────────┘            │
│                                                                  │
│  OBSERVER VALIDATION                                             │
│  ───────────────────                                            │
│  task-escrow-observer validates add/remove operations            │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘

Critical Design: Treasury-tokens are NOT minted per-task. They were minted during project.create and are reused across all task operations. This is fundamentally different from course modules which mint a new token per module.

Key Concepts

Token Naming: Treasury-Token = Prerequisite

The treasury-token name equals the contributor_state_id:

Treasury-token: b3c8215a....{contributor_state_id}
                            └─────────────────────┘
                            Token name = prerequisite policy ID

This links each task escrow to its prerequisite requirements directly in the token itself.

Reward Structure: lovelace_amount vs native_assets

Task rewards are defined in two separate fields:

  • lovelace_amount: The ADA portion of the reward (in lovelace)
  • native_assets: Additional tokens beyond ADA (can be empty)

Important: native_assets should never include lovelace. ADA is always specified separately in lovelace_amount.

{
  "lovelace_amount": 50000000,
  "native_assets": [
    ["fe8efd6bb0dfafd5c7ed9764c9ee11d0580bfab2553f94743d8ef48e.7457696e64736f72", 10]
  ]
}

Prerequisites: contributor_state_id

The contributor_state_id defines who can commit to tasks. This is a policy ID that represents the credential a contributor must hold.

Design Optimization: Rather than embedding a long list of SLT hashes (like course modules do with prerequisite_slts), projects use contributor_state_id as a compact reference. This single policy ID encapsulates "contributor has completed course X" - the on-chain logic verifies they hold the appropriate course-state credential.

{
  "contributor_state_id": "7c542d1ee32de598727b1fae859afa08d4eafcab9eadfcdcbb22bd97"
}

This means: "Only contributors holding a token from policy 7c542d... can commit to tasks in this escrow."

Task Datum Structure

The task escrow datum is a list of task hashes:

Datum: [task_hash_1, task_hash_2, ...]

Each hash is computed from the task parameters (content, expiration, rewards). Adding a task appends its hash; removing a task removes its hash.

Optional Treasury Funding: deposit_value

Managers can optionally fund the project treasury when creating tasks:

{
  "deposit_value": [
    ["lovelace", 175000000],
    ["fe8efd6bb0dfafd5c7ed9764c9ee11d0580bfab2553f94743d8ef48e.7457696e64736f72", 4]
  ]
}

This deposits 175 ADA + 4 tokens into the treasury alongside the task operations. If not funding, use an empty array: "deposit_value": []

UX Recommendation: Any interface built on this transaction should encourage (or require) that deposit_value covers at least the sum of all task rewards being created. For example, if creating 3 tasks with rewards of 50, 75, and 100 ADA, the deposit should be at least 225 ADA.

This is not enforced on-chain - tasks can be created without sufficient treasury funds. However, requiring adequate funding upfront provides a better user experience: contributors can trust that rewards are available when they complete work, rather than discovering an underfunded treasury after submission.

Ignored Field: aliases_to_remove

The aliases_to_remove field exists in the schema but is not used. It can be safely ignored.

Inputs

InputTypeValidatorDescription
Task EscrowScripttask-escrow-validatorExisting task escrow UTxO
Access TokenWallet-Manager's u-token
Wallet UTxOsWallet-ADA for fees and deposits

Outputs

OutputValidatorValueDescription
Task Escrowtask-escrow-validatorreward + treasury-tokenUpdated task list
Treasury Deposittask-escrow-validatordeposit_valueOptional deposit (no datum)
User Walletwalletu-token + changeAccess token returned

Observer Validation

The task-escrow-observer validates all task operations:

Redeemer: {
  constructor: 1,  // Add tasks
  fields: [
    [  // List of tasks
      {
        content: "somearbitraryhashletsfigureitout",
        expiration: 1768577592000,
        lovelace: 12500000,
        native_assets: []
      }
    ],
    "james"  // Manager alias
  ]
}

Reference Inputs

UTxODescription
bf7de...#3Script reference for task-escrow-validator
bf7de...#4Script reference for task-escrow-observer

Key Notes

  • No minting - Treasury-tokens were minted at project creation
  • No protocol fee - Only network transaction fee applies
  • Batch operations - Add and remove multiple tasks in one transaction
  • Combined deposit - Fund treasury while managing tasks

See Also