Sponsored Tasks: Setting Up a Vault
This page walks a sponsor through creating a vault, funding it, authorizing a manager and preparing the manager to create tasks. The example uses Base Mainnet; the Base Sepolia addresses are in Contracts and deployments.
Contents
- Before you start
- Amounts are in base units
- Step 1: Create the vault
- Step 2: Fund the vault
- Step 3: Authorize a manager
- Step 4: Deposit fee credit
- Step 5: Check the vault
- Step 6: Ask for curation
- Step 7: Create sponsored tasks
Before you start
You need:
- The Taskmarket CLI with a keystore (
taskmarket init). The CLI keeps its keystore in~/.taskmarket, or in the directory named byTASKMARKET_HOME. TASKMARKET_RPC_URLset to an RPC endpoint for the vault's chain. Vault administration commands sign and broadcast directly from your local wallet, so they cannot be relayed. Each command checks that the endpoint's chain id matches--chain-idand stops withTASKMARKET_RPC_URL points at chain <n>, vault needs <m>if it does not.- Native gas (ETH on Base) in the wallet for every transaction.
- The project token in the wallet that will fund the vault, and USDC in the manager's wallet for fee credit.
export TASKMARKET_RPC_URL=https://<your Base Mainnet RPC endpoint>Every write command simulates the call before sending it, so a call that would revert reports the revert reason without spending gas, then waits for the receipt.
Amounts are in base units
Administration commands take amounts in the token's smallest unit. USDC has 6 decimals, so
5000000 is 5 USDC. Most project tokens have 18 decimals, so 1,000 tokens is
1000000000000000000000. The one exception is task create --sponsored-task-tokens, which takes a
whole-token amount and converts it using the vault's token decimals.
Step 1: Create the vault
taskmarket sponsored-task create \
--factory 0x92076c62558b4f77Bddd3ca8E00271128AfeD818 \
--chain-id 8453 \
--token <project token address>The vault owner defaults to your own wallet. Pass --owner <address> to make another address,
such as a Safe, the owner from the start. The response includes txHash, vault (the vault
address), vaultId, owner and token. Keep both the vault address and the vaultId:
on-chain administration commands take --vault <address>, while read commands and task creation
take the vaultId.
Step 2: Fund the vault
taskmarket sponsored-task fund \
--vault <vault address> \
--token <project token address> \
--chain-id 8453 \
--amount <base units>This sends two transactions: an ERC-20 approval for the vault, then the vault's fund. Between
them the CLI waits up to 30 seconds for TASKMARKET_RPC_URL to report the new allowance, because a
load-balanced RPC endpoint can answer from a node that has not seen the approval yet. You can fund
again at any time to top up.
Step 3: Authorize a manager
taskmarket sponsored-task managers add \
--vault <vault address> \
--chain-id 8453 \
--manager <manager address> \
--cap <base units>The manager is the wallet that will run task create --sponsored-task, and it may be your own
address. The cap is the manager's lifetime token allowance on this vault. See
Managing a vault.
Step 4: Deposit fee credit
The manager, not the owner, runs this from the manager's own wallet:
taskmarket sponsored-task fee-bank deposit \
--fee-bank 0x407852432810342e77FEd378bE6C1D3336b0913A \
--usdc 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 \
--chain-id 8453 \
--amount 5000000This approves the fee bank and deposits 5000000 base units of USDC as credit, which is US$5.
Each sponsored task draws one creation fee from this credit. Check it with taskmarket sponsored-task fee-bank balance. See Fees and the fee bank.
Step 5: Check the vault
taskmarket sponsored-task show <vaultId>
taskmarket sponsored-task balance <vaultId>
taskmarket sponsored-task managers list --vault-id <vaultId>These read Taskmarket's indexed view of the vault, so they need no RPC endpoint and no gas. A new vault can take a short while to appear.
Step 6: Ask for curation
A new vault is unverified. Its rewards still appear on tasks, but without a USD value, and it is
left out of the default vault list until a Taskmarket curator approves it. See
Curation.
Step 7: Create sponsored tasks
The manager can now create tasks funded from the vault:
taskmarket task create --description "..." --reward 5 --duration 24 \
--sponsored-task <vaultId> --sponsored-task-tokens 100