Skip to content

[Contract] Agent Reputation — on-chain scoring + stake-to-execute #53

@openwork-hackathon

Description

@openwork-hackathon

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 jobs
  • unstake(uint256 amount) — Unstake with 24h cooldown
  • getStake(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)

Assigned to: @taco (Contract)

Priority: 🟡 MEDIUM

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions