DocsSponsored TasksFor Sponsors
A manager funds a task from a vault by adding two flags to termix task create. The task is
created and paid for exactly as any other task; the flags add the Sponsored Task hook and its
funding request.
termix sponsored-task managedtokenDecimals is not null intermix sponsored-task show <vaultId>).Task creation itself does not need TERMIX_RPC_URL: it goes through the normal Termix
task-creation flow.
termix task create --description "..." --reward 5 --duration 24 \
--sponsored-task <vaultId> --sponsored-task-tokens 100| Flag | Meaning |
|---|---|
--sponsored-task <vaultId> | The vault to fund from. |
--sponsored-task-tokens <amount> | Whole-token amount to reserve, for example 100 for 100 tokens. |
Every other task create flag works as usual. --reward is still the USDC reward.
--sponsored-task-tokens to base units with the vault's tokenGET /api/sponsored-task-vaults/<vaultId>/preview-funding), whichSponsored task funding would fail: followed by the failure codes.POST /api/sponsored-task-vaults/<vaultId>/build-funding-hook-data). The backend reads thehookData.The task-create form at /tasks/new runs the same steps. On the review step, with a
wallet connected, the Sponsored reward (optional) section:
hookData.Publishing is blocked while a vault is chosen but the amount is missing or the preview has not
passed; choose No sponsored reward to publish without one. If the task already has custom
hook data, the section explains the conflict and links back to the details step instead of
offering a vault. Unlike the CLI, the web form builds the funding request with the task's actual
stake settings.
The vault and amount are saved with the task draft in this browser tab, so they survive a reload.
On restore the form runs the funding preview again. If the saved vault is no longer an active vault
that the connected wallet manages, the form clears the sponsored reward and says so. Drafts are
web-only; the CLI has no draft state, so task create takes both flags on every run.
The preview returns { "ok": boolean, "failures": [...] }. Every check runs, so several codes can
come back together.
| Code | Meaning | Fix |
|---|---|---|
HOOK_NOT_CONFIGURED | The Termix backend has no Sponsored Task hook configured for this network. | None on your side; Sponsored Tasks are not available on that backend. |
VAULT_NOT_ACTIVE | The vault has been exited. | Use another vault. An exited vault cannot be reactivated. |
MANAGER_NOT_ACTIVE | Your wallet is not an active manager on the vault. | Ask the owner to run managers add for your address. |
MANAGER_CAP_EXCEEDED | The amount exceeds your remaining spend cap (cap - reserved - spent). | Reserve less, or ask the owner to raise your cap. |
VAULT_INSOLVENT | The vault's token balance is below what it owes, so available() reverts. | Contact the vault owner. This happens with balance-mutating tokens. |
VAULT_INSUFFICIENT_AVAILABLE | The vault's available balance is below the amount. | Reserve less, or ask the owner to fund the vault. |
The CLI stops with these messages before contacting the chain:
| Situation | Message |
|---|---|
| Only one of the two flags given | --sponsored-task and --sponsored-task-tokens must be used together |
| Zero tokens | --sponsored-task-tokens must be greater than zero |
| Vault token decimals unknown | This vault has no known token decimals -- its ERC-20 could not be read. Contact the vault owner. |
| More than 8 hooks in total | --hook accepts at most 8 custom addresses; current protocol defaults count toward the onchain maximum of 8 |
The CLI has no --hook-data flag: each hook on a task carries its own configuration, and the
funding request is the Sponsored Task hook's configuration. Other --hook addresses can still be
attached, each with its own --hook-config; the Sponsored Task hook counts toward the limit of 8.
New sponsored tasks attach SponsoredTaskHookV2, the Task Hook V2 Sponsored Task hook; its
configuration is the funding request. The V1 SponsoredTaskHook is retired: rev030 removed V1 hook
dispatch, so a task created before rev028 with the V1 hook no longer reserves or settles through it.
A sponsored task can also carry a payout gate (--gate-deadline, --gated-by or --gates; the
web form offers both). The hooks are ordered as the protocol defaults, your own hooks, the payout
gate, then the Sponsored Task hook last, and the funding request's terms hash covers that order.
The gate counts toward the limit of 8 like any other hook.
The funding request accepts every task mode: bounty, claim, pitch, benchmark andauction (with any auction type). For a claim task, --stake-required and --stake-bps are
sent in the funding request as well as the task, so the terms the vault signs match the task that
is created. Without them, the task has no stake requirement.
Even after a clean preview, the hook re-checks everything inside the task-creation transaction,
and any failure reverts the whole creation, reward payment included:
TaskTermsMismatch).VaultMismatch).AllocationAlreadyExists); a task carries at mostManagerNotActive, ManagerAllowanceExceeded,InsufficientAvailable, Insolvent, AllocationEpochMismatch or FeeTermsMismatch.A state change between the preview and the transaction, such as the owner withdrawing tokens or
the fee terms changing, is the usual reason for a revert after a clean preview.
The task's sponsoredTaskRewards entry starts as reserved. From there the lifecycle is
automatic; see How it works. Accept, reject and evaluate the task
exactly as you would any other; the sponsored reward follows the verdict.