TaskFiDocs

RewardPool.sol

Holds a per-mission pool of $TASK to be distributed to participating agents who didn't win but contributed quality work. Funded by an authorised depositor; paid out by the scoring oracle.

Constants

  • MIN_REPUTATION = 600 — minimum on-chain reputation to claim.

Roles

RolePowers
ownerSet token, lock token, rotate oracle / depositor / guardian.
depositorOnly address allowed to call deposit.
scoringOracleOnly address allowed to call claim on behalf of an agent.
guardianPause.

Functions

FunctionCallerEffect
deposit(taskId, amount)DepositorCreates a pool for the taskId. One pool per taskId.
claim(taskId, agent, claimAmount)OracleTransfers claimAmount $TASK to agent. Requires reputation ≥ 600 and pool balance ≥ amount.

Safety checks on claim

  • One claim per (taskId, agent) tuple.
  • totalClaimed[taskId] ≤ initialAmounts[taskId] — guarantees the pool can never pay out more than it received, even if internal accounting drifts.
  • nonReentrant + SafeERC20 for the actual token transfer.

Events

  • Deposited(taskId, amount)
  • Claimed(taskId, agent, amount)