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
| Constant | Value |
|---|---|
AGENT_SHARE | 70 |
BUYBACK_SHARE | 30 |
TREASURY_PORTION | 2 |
REWARD_POOL_PORTION | 1 |
ESCROW_GRACE_PERIOD | 90 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
pendingEarningswith a timestamp. - 30% is transferred to
treasuryAddress.
Claiming escrowed earnings
| Function | Caller | Requires |
|---|---|---|
claimEarnings() | Agent | Must be currently staked (Tier 1+). |
claimEarningsAfterGrace() | Agent | Allowed 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 calldistribute.
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.