Context & Impact
Contributors need recognition for their work, and guilds need data to identify reliable talent. A reputation system creates long-term incentives, increases platform stickiness, and helps match the right contributors with the right tasks.
Why this matters:
- Incentivizes quality work over time
- Helps guilds identify top contributors
- Creates progression paths for contributors
- Enables reputation-gated opportunities (premium bounties)
- Builds a merit-based ecosystem
Scope
Implement a Soroban smart contract that tracks contributor reputation, awards achievements, and manages reputation-based incentives.
What's included:
- Reputation score tracking per contributor
- Achievement/badge system
- Reputation gain from completed tasks
- Reputation decay for failures/disputes
- Reputation tiers (Bronze, Silver, Gold, Platinum)
- Query functions for reputation-based filtering
- Incentive multipliers based on reputation
What's NOT included:
- NFT badge minting (this would be future enhancement)
- Cross-guild reputation (for future)
- Reputation marketplace (for future)
Implementation Guidelines
File Structure
Create the following files in the contract/ directory:
contract/
├── src/
│ ├── reputation/
│ │ ├── mod.rs
│ │ ├── scoring.rs
│ │ ├── achievements.rs
│ │ ├── types.rs
│ │ └── storage.rs
Key Data Structures
Define:
ReputationProfile struct (address, score, tier, tasks_completed, success_rate, achievements)
ReputationTier enum (Bronze, Silver, Gold, Platinum, Diamond)
Achievement struct (id, name, description, points, criteria)
ReputationEvent enum (TaskCompleted, TaskFailed, DisputeWon, DisputeLost, MilestoneAchieved)
- Storage for profiles and achievements
Core Functions to Implement
initialize_profile(env, address) → Profile
update_reputation(env, address, event, value) → new_score
award_achievement(env, address, achievement_id) → bool
get_reputation(env, address) → ReputationProfile
get_tier(env, address) → ReputationTier
calculate_incentive_multiplier(env, address) → u32 (e.g., 100 = 1.0x, 150 = 1.5x)
get_top_contributors(env, guild_id, limit) → Vec
check_achievement_eligibility(env, address, achievement_id) → bool
get_achievements(env, address) → Vec
Reputation Calculation Logic
Define scoring rules:
- Task completion: +10 to +50 (based on complexity)
- Milestone completion: +20 to +100
- Dispute won: +5
- Dispute lost: -20
- Task failed/cancelled: -10
- Time decay: -1% per month of inactivity
- Success rate bonus: up to +50% for >95% success
Tier Thresholds
- Bronze: 0-99 points
- Silver: 100-499 points
- Gold: 500-1499 points
- Platinum: 1500-4999 points
- Diamond: 5000+ points
Incentive Multipliers
- Bronze: 1.0x
- Silver: 1.1x
- Gold: 1.25x
- Platinum: 1.5x
- Diamond: 2.0x
Constraints & Requirements
- Reputation cannot go below 0
- Only authorized contracts can update reputation
- Achievement awards must be verifiable
- Tier changes trigger events
- Efficient querying for large contributor sets
- Prevent reputation gaming
Edge Cases to Handle
- First-time contributors (initial reputation)
- Negative reputation overflow
- Rapid tier changes
- Achievement spam prevention
- Inactive contributor handling
- Reputation reset requests
- Invalid event types
✅ Definition of Done
Your PR should include:
Testing Requirements
Provide tests that cover:
- Profile initialization
- Reputation updates from various events
- Tier calculation and upgrades
- Achievement eligibility and awards
- Incentive multiplier calculation
- Leaderboard queries
- Edge cases (overflow, underflow, gaming attempts)
- Time decay simulation
- Success rate calculations
- Integration with task completion
Context & Impact
Contributors need recognition for their work, and guilds need data to identify reliable talent. A reputation system creates long-term incentives, increases platform stickiness, and helps match the right contributors with the right tasks.
Why this matters:
Scope
Implement a Soroban smart contract that tracks contributor reputation, awards achievements, and manages reputation-based incentives.
What's included:
What's NOT included:
Implementation Guidelines
File Structure
Create the following files in the
contract/directory:Key Data Structures
Define:
ReputationProfilestruct (address, score, tier, tasks_completed, success_rate, achievements)ReputationTierenum (Bronze, Silver, Gold, Platinum, Diamond)Achievementstruct (id, name, description, points, criteria)ReputationEventenum (TaskCompleted, TaskFailed, DisputeWon, DisputeLost, MilestoneAchieved)Core Functions to Implement
initialize_profile(env, address)→ Profileupdate_reputation(env, address, event, value)→ new_scoreaward_achievement(env, address, achievement_id)→ boolget_reputation(env, address)→ ReputationProfileget_tier(env, address)→ ReputationTiercalculate_incentive_multiplier(env, address)→ u32 (e.g., 100 = 1.0x, 150 = 1.5x)get_top_contributors(env, guild_id, limit)→ Veccheck_achievement_eligibility(env, address, achievement_id)→ boolget_achievements(env, address)→ VecReputation Calculation Logic
Define scoring rules:
Tier Thresholds
Incentive Multipliers
Constraints & Requirements
Edge Cases to Handle
✅ Definition of Done
Your PR should include:
Testing Requirements
Provide tests that cover: