Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Sponsored Tasks: CLI Reference

Every taskmarket sponsored-task subcommand, plus the task create flags for sponsored tasks. Install the CLI as described in the CLI reference; these commands ship in CLI 1.14.0 and later.

Contents

Requirements by command

CommandKeystoreTASKMARKET_RPC_URLNative gasCaller
createYesYesYesAnyone
fundYesYesYesAnyone
managers add, managers removeYesYesYesVault owner
managers listNoNoNoAnyone
fee-bank deposit, fee-bank withdrawYesYesYesThe manager
fee-bank balanceYesYesNoThe manager
list, show, balanceNoNoNoAnyone
withdraw, exitYesYesYesVault owner
claimYesNoNoThe worker

Commands that use TASKMARKET_RPC_URL stop with TASKMARKET_RPC_URL must be set to a chain RPC endpoint for vault administration commands when it is unset, and check that the endpoint's chain matches --chain-id. Write commands simulate first, then send and wait for the receipt; a reverted receipt fails with <function> reverted: <txHash>. Commands that need a keystore tell you to run taskmarket init when there is none. Address flags must be 0x-prefixed 40-hex-digit addresses.

All amounts below are base units unless stated otherwise.

sponsored-task create

Create a new vault for a project token.

taskmarket sponsored-task create --factory <address> --chain-id <id> --token <address> [--owner <address>]
OptionRequiredMeaning
--factory <address>YesSponsoredTaskFactory address.
--chain-id <id>YesChain the factory is on.
--token <address>YesProject ERC-20 token.
--owner <address>NoVault owner. Defaults to your wallet.

Output: txHash, vault, vaultId, owner, token.

sponsored-task fund

Approve the vault and fund it with project tokens (two transactions).

taskmarket sponsored-task fund --vault <address> --token <address> --chain-id <id> --amount <baseUnits>
OptionRequiredMeaning
--vault <address>YesVault address.
--token <address>YesThe vault's project token.
--chain-id <id>YesChain the vault is on.
--amount <baseUnits>YesAmount in the token's base units.

After the approval, the CLI waits up to 30 seconds for the RPC endpoint to report the allowance. Output: txHash, vault, amount.

sponsored-task managers add

Authorize a manager, or change an existing manager's cap, and set it active.

taskmarket sponsored-task managers add --vault <address> --chain-id <id> --manager <address> --cap <baseUnits>
OptionRequiredMeaning
--vault <address>YesVault address.
--chain-id <id>YesChain the vault is on.
--manager <address>YesManager to authorize.
--cap <baseUnits>YesLifetime spend cap in the token's base units. Must be at least the manager's current reserved plus spent.

Output: txHash, manager, spendCap, active.

sponsored-task managers remove

Deactivate a manager. Does not reclaim tokens already reserved.

taskmarket sponsored-task managers remove --vault <address> --chain-id <id> --manager <address>

The cap is pinned to the manager's current reserved plus spent. Output: txHash, manager, spendCap, active.

sponsored-task managers list

taskmarket sponsored-task managers list --vault-id <vaultId>

Output: an array of { vaultId, managerAddress, spendCap, spent, active }.

sponsored-task fee-bank deposit

Approve the fee bank and deposit USDC credit for creating sponsored tasks.

taskmarket sponsored-task fee-bank deposit --fee-bank <address> --usdc <address> --chain-id <id> --amount <baseUnits>
OptionRequiredMeaning
--fee-bank <address>YesSponsoredTaskFeeBank address.
--usdc <address>YesUSDC address on that chain.
--chain-id <id>YesChain the fee bank is on.
--amount <baseUnits>YesUSDC base units (6 decimals).

Output: txHash, feeBank, deposited.

sponsored-task fee-bank balance

taskmarket sponsored-task fee-bank balance --fee-bank <address> --chain-id <id>

Output: feeBank, manager (your wallet), creditBaseUnits.

sponsored-task fee-bank withdraw

Withdraw unused USDC credit.

taskmarket sponsored-task fee-bank withdraw --fee-bank <address> --chain-id <id> --amount <baseUnits> [--recipient <address>]

--recipient defaults to your wallet. Output: txHash, recipient, withdrawn.

sponsored-task list

taskmarket sponsored-task list [--limit <n>] [--cursor <vaultId>] [--include-unverified]
OptionDefaultMeaning
--limit <n>50Maximum vaults to return.
--cursor <vaultId>nonePagination cursor from a previous nextCursor.
--include-unverifiedoffInclude vaults not yet curator-approved.

Output: { vaults, nextCursor }.

sponsored-task show

taskmarket sponsored-task show <vaultId>

Output: the vault object (see API reference).

sponsored-task balance

taskmarket sponsored-task balance <vaultId>

Output: fundedTotal, availableBalance, reservedBalance.

sponsored-task withdraw

Withdraw unreserved project tokens (owner only).

taskmarket sponsored-task withdraw --vault <address> --chain-id <id> --amount <baseUnits> [--recipient <address>]

--recipient defaults to your wallet. Output: txHash, recipient, withdrawn.

sponsored-task exit

Terminally exit a vault. Sweeps every token, including reserved and unclaimed ones, to the recipient and voids every outstanding reservation, claim signature and Merkle proof. There is no undo.

taskmarket sponsored-task exit --vault <address> --chain-id <id> --yes [--recipient <address>]
OptionRequiredMeaning
--vault <address>YesVault address.
--chain-id <id>YesChain the vault is on.
--yesYes in practiceWithout it the command stops with This is irreversible. Re-run with --yes to confirm the exit.
--recipient <address>NoDefaults to your wallet.

Output: txHash, recipient, status (exited).

sponsored-task claim

Claim your unclaimed sponsored reward in a vault, gaslessly.

taskmarket sponsored-task claim <vaultId> [--task-id <id>]
OptionMeaning
--task-id <id>Claim the entitlement for this task. Defaults to the first unclaimed one.

Requires a registered withdrawal address. Output: txHash, destination, amount. See Claiming rewards.

task create sponsored flags

taskmarket task create ... --sponsored-task <vaultId> --sponsored-task-tokens <amount>
OptionMeaning
--sponsored-task <vaultId>Fund this task from the vault, reserving --sponsored-task-tokens alongside the ordinary --reward.
--sponsored-task-tokens <amount>Whole-token amount to reserve, for example 100 for 100 tokens. Required with --sponsored-task.

Cannot be combined with --hook-data. See Creating sponsored tasks.