-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
Description
Overview
Smart contract for tracking agent reputation scores based on pipeline execution performance, with staking mechanics.
Contract: AgentReputation.sol
Reputation System
getReputation(address agent)→ returns(uint256 score, uint256 totalJobs, uint256 successRate, uint256 totalEarned)- Score updates automatically on execution recording from Registry
- Successful run: +10 base points, bonus for complex pipelines (more nodes)
- Failed run: -5 points (minimum 0)
- Streak bonus: consecutive successes multiply score gains
Staking
stake(uint256 amount)— Stake $FLOWFORGE tokens to qualify for premium jobsunstake(uint256 amount)— Unstake with 24h cooldowngetStake(address agent)→ returns(uint256 staked, uint256 cooldownEnd)- Minimum stake tiers:
- Tier 1 (100 $FF): Basic jobs
- Tier 2 (500 $FF): Advanced pipelines
- Tier 3 (2000 $FF): Priority execution + higher rewards
Leaderboard
getTopAgents(uint256 count)→ returns top agents by reputation score- View function, no gas for reads
Events
ReputationUpdated(address indexed agent, uint256 newScore, int256 change)Staked(address indexed agent, uint256 amount, uint256 tier)Unstaked(address indexed agent, uint256 amount)
Security
- Only Registry contract can update reputation
- Reentrancy guard on stake/unstake
- Overflow protection (OpenZeppelin SafeMath)