Skip to content

feat: add user reputation tracking to atomic swap#485

Open
dami-005 wants to merge 1 commit into
AtomicIP:mainfrom
dami-005:feature/reputation-tracking
Open

feat: add user reputation tracking to atomic swap#485
dami-005 wants to merge 1 commit into
AtomicIP:mainfrom
dami-005:feature/reputation-tracking

Conversation

@dami-005
Copy link
Copy Markdown

closes #408

  • Add DataKey::UserReputation(Address) storing score 0-100
  • Add DataKey::ReputationMultiplier(u64) for per-swap min buyer rep
  • Implement get_reputation(env, address) -> u32 (default 50)
  • Implement set_reputation_multiplier(env, swap_id, min_reputation)
  • Update reputation on swap completion: +5 seller & buyer
  • Update reputation on cancel_swap: -10 canceller
  • Update reputation on cancel_expired_swap: -10 seller (defaulted)
  • Enforce min reputation in accept_swap (InsufficientReputation error)
  • Add ContractError::InsufficientReputation = 40
  • Add reputation_tests.rs with 7 tests covering all behaviours

- Add DataKey::UserReputation(Address) storing score 0-100
- Add DataKey::ReputationMultiplier(u64) for per-swap min buyer rep
- Implement get_reputation(env, address) -> u32 (default 50)
- Implement set_reputation_multiplier(env, swap_id, min_reputation)
- Update reputation on swap completion: +5 seller & buyer
- Update reputation on cancel_swap: -10 canceller
- Update reputation on cancel_expired_swap: -10 seller (defaulted)
- Enforce min reputation in accept_swap (InsufficientReputation error)
- Add ContractError::InsufficientReputation = 40
- Add reputation_tests.rs with 7 tests covering all behaviours
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 27, 2026

@dami-005 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Swap Counterparty Reputation Tracking

1 participant