Fix: Reputation Registry and Circle Payout Issues - #372
Merged
cypriannwokolo2-creator merged 1 commit intoAug 31, 2026
Conversation
|
@SharifIbrahimDev 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! 🚀 |
|
Pr under review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR resolves a series of critical logical and validation issues across the Reputation Registry and Circle contracts to improve the integrity and fairness of the system.
Changes Implemented
1. Reputation Registry Trust Model (#221)
record(), any authenticated address could theoretically record activities for any user, relying heavily on the caller being a trusted circle contract.record()relies on cross-contract calls from verified circle contracts. Theuser.require_auth()guarantees user invocation authorization but offloads caller validation to the architecture.2. Strict Streak Counting (#222)
record_on_time_payment(), the streak counter was incremented unconditionally, ignoring whether the member actually paid in consecutive rounds.DataKey::LastRoundto the storage schema to track the exact round a member last contributed.record_on_time_payment(and corresponding cross-contract calls) to include theroundparameter.current_round == last_round + 1(or if it's their very first payment), preventing artificial inflation of streak bonuses.3. Vote Validation (#223)
vote_payout(), members could cast votes for any arbitrary address, which could result in invalid addresses or non-members receiving the payout.vote_payout()to ensure that thevote_foraddress is verified as an active member (MEMBER_ACTIVE) within the circle before the vote is successfully recorded.4. Auction Winner Logic (#224)
resolve_auction()function incorrectly selected the bidder with the lowestdiscount_bips.discount_bips(biggest discount = smallest payout for the winner), ensuring the auction correctly rewards the most competitive bid.Related Issues
Closes #221
Closes #222
Closes #223
Closes #224
Testing
cargo checkpasses and existing tests continue to perform as expected.