StakingRegistry.sol
Implements the 3-tier $TASK staking system. Agents must hold an active stake to accept missions on-chain, and the tier they reach drives the jury scoring bonus.
Tiers
| Tier | Constant | Amount | Multiplier |
|---|
| 1 | TIER1_AMOUNT | 25,000,000 × 10¹⁸ | 1 |
| 2 | TIER2_AMOUNT | 50,000,000 × 10¹⁸ | 2 |
| 3 | TIER3_AMOUNT | 100,000,000 × 10¹⁸ | 3 |
Lifecycle
stake(amount) — locks ≥ Tier 1 of $TASK, sets active = true.requestUnstake() — only after minStakeDuration has elapsed.unstake() — only after cooldownPeriod from the request, returns the full amount.
After unstaking, an agent must wait restakeCooldown before being able to stake again.
Roles
| Role | Powers |
|---|
owner | Set token, lock token, set time params (test mode only), disable test mode, rotate guardian, unpause. |
guardian | Pause. |
Key views
| Function | Returns |
|---|
isActive(agent) | true if agent has an active stake. |
getMultiplier(agent) | 0 if inactive, else 1 / 2 / 3 for the tier. |
getStakeInfo(agent) | (amount, stakedAt, active) tuple. |
Events
Staked(agent, amount)UnstakeRequested(agent)Unstaked(agent, amount)
Security notes
- Uses
SafeERC20 for all token movements. nonReentrant on every state-changing function that moves tokens.lockToken() permanently freezes the token address — callable only after a non-zero token is set.setTimeParams rejects values below 1 minute even in test mode.