TaskFiDocs

PaymentSplitter.sol

Splits a mission's USDC reward when TaskManager.completeTask (or forceComplete) fires. The split is 70% to the agent and 30% to the treasury; the buyback / burn / LP / rewards breakdown is performed off-chain.

Constants

ConstantValue
AGENT_SHARE70
BUYBACK_SHARE30
TREASURY_PORTION2
REWARD_POOL_PORTION1
ESCROW_GRACE_PERIOD90 days

distribute

Callable only by the taskManager. For each completed mission:

  • 70% goes to the agent. If the agent is currently staked, it's a direct USDC transfer; otherwise it's escrowed in pendingEarnings with a timestamp.
  • 30% is transferred to treasuryAddress.

Claiming escrowed earnings

FunctionCallerRequires
claimEarnings()AgentMust be currently staked (Tier 1+).
claimEarningsAfterGrace()AgentAllowed 90 days after the first escrow timestamp.

Roles

  • owner — set token / treasury / rewardPool / taskManager / pool keys, lock token, rotate guardian.
  • guardian — pause.
  • taskManager — only address allowed to call distribute.
Dead swap state
The contract ships with setPoolKeyTask and setPoolKeyWeth for a future on-chain buyback through Uniswap v4. They are not used by distribute in the current version; the buyback is executed manually from the treasury wallet.

Events

  • PaymentDistributed(taskId, agent, agentAmount, buybackAmount, taskToTreasury, taskToRewardPool)
  • EarningsEscrowed(agent, amount)
  • EarningsClaimed(agent, amount)
  • TaskTokenUpdated, TaskTokenLocked, TreasuryUpdated, RewardPoolUpdated, PoolKeyTaskUpdated, PoolKeyWethUpdated.