Skip to content
Socket

Catalog / module / rewards

Task weight

v1

Complete tasks to raise your NFT's share of the rewards.

What it does

task-weight v1: complete tasks to raise your share

A weight plugin for `staking-vault`. Each completed task adds `perTaskBps` (up to `maxBonusBps`, and never above 5.00x in total). The vault's own ceiling still applies. Progress is keyed by token id, so it moves with the NFT when it is sold.

Ported from ENTITY's `TaskBoard`.

Completing a task

`complete(tokenId, taskId, nonce, deadline, signature)` needs an EIP-712 signature from the configured `signer` over `Complete(uint256 tokenId,bytes32 taskId,address claimant,uint256 nonce,uint256 deadline)`. The domain is `("Blocksmith TaskWeight", "1", chainid, address(this))`. It is accepted only if:

- the claimant is `msg.sender` and controls the token (its owner, or its staker while it sits in the vault); - the per-token nonce matches (it is spent); - the deadline has not passed; - the task exists, is active, its window is open and its completion cap is not reached; - this token has not completed this task before.

Phase 1: the signer is a key the creator controls (no hosted signer). `curatorComplete(tokenId, taskId, reason)` lets the owner or a curator award by hand. It requires a written reason (emitted) and still applies the duplicate guard, window and cap.

When a multiplier changes, the plugin calls `vault.sync(tokenId)` in try/catch. The vault settles at the old weight first, so a bonus never reaches backwards. If the sync fails, the award still stands (`SyncDeferred`) and anyone can sync later.

Roles

| Who | Can | |---|---| | Owner | `setTask`, `setCurator`, `setSigner`, `setMultiplier` (per task 0.01%..+4.00x, ceiling ≤ +4.00x), `pause` (blocks completions), ownership handover | | Curator | `curatorComplete` with a reason | | Token controller | `complete` with a valid attestation |

**Locked:** `vault`. **Value flows / fee lanes:** none. It holds no value.

Risks

The signer key, the owner and the curators decide who gets bonuses. `setMultiplier` re-prices future accrual for every token once it is synced, but never the past.

What if…

- **…someone copies my signed completion?** It only works for the named wallet and token, once, before the deadline, on this exact contract and chain. - **…I complete a task right before claiming?** Everything earned so far is settled at the old rate first. - **…I sell my NFT?** Its tasks and multiplier go with it.

Risks in plain English

  • Whoever holds the signer key, the owner and the curators decide who gets a bonus. Trust them, or don't stake here.
  • Progress belongs to the NFT, not the wallet: it moves with the NFT when it is sold.
  • The owner can change the bonus per task and the ceiling (always within 1.00x to 5.00x, and the vault's ceiling still applies).
  • If the vault sync fails after a task, the NFT keeps earning at its old, lower rate until anyone syncs it.

What if…

What if someone copies my signed completion?
It only works for the wallet it names, for that NFT, once, before its deadline, on this exact contract and chain.
What if I complete a task just before claiming?
The vault settles everything you earned so far at your old rate first. The bonus only applies from that moment on.
What if I sell my NFT?
The buyer gets its completed tasks and multiplier. Tasks cannot be completed twice for the same NFT.

Fees

No protocol fee on this module.

Evidence

Form check
Built from the source files
Implementation
—
Code hash
—

Settings you choose at deploy

  • Staking vaultFilled in automatically by recipes. Can never change.Locked forever
  • Task signer keyThe only key whose signed completions are accepted. Use a key you control.Changeable
  • Bonus per completed task1000 = +0.10x.Changeable
  • Largest total bonus15000 = up to 2.50x in all. The vault's own ceiling still applies.Changeable