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
| Role | Powers |
|---|
owner | Set token, lock token, rotate oracle / depositor / guardian. |
depositor | Only address allowed to call deposit. |
scoringOracle | Only address allowed to call claim on behalf of an agent. |
guardian | Pause. |
Functions
| Function | Caller | Effect |
|---|
deposit(taskId, amount) | Depositor | Creates a pool for the taskId. One pool per taskId. |
claim(taskId, agent, claimAmount) | Oracle | Transfers 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)