Feat/sc 008 sc 032 reputation update engine and economic simulation - #328
Open
Muyideen-js wants to merge 3 commits into
Open
Conversation
added 3 commits
July 28, 2026 16:13
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.
SC-008: Reputation Update Engine
Overview
Implements the Reputation Update Engine — the sole authorised mechanism for modifying verifier reputation within the protocol. Every completed claim resolution produces a transparent, deterministic, and reproducible reputation update that rewards accurate participation while penalising inaccurate or malicious behaviour.
Changes
New Contracts
contracts/IReputationUpdateEngine.sol— Interface defining the reputation update API, types (ReputationUpdate,ReputationUpdateRecord,UpdateReasonenum), events, governance parameters, and view functions.contracts/ReputationUpdateEngine.sol— Implementation of the reputation update engine with:updateReputation()— Deterministic reputation mutation viaUPDATE_ROLE-gated function(verifier, claimId)pairCORRECT_VERIFICATION:+rewardIncrement(default: +10)INCORRECT_VERIFICATION:-penaltyAmount(default: -10)MALICIOUS_BEHAVIOUR:-(penaltyAmount × maliciousMultiplier)(default: -50)DISPUTED_CLAIM:±disputeAdjustment(default: 0)minimumReputationFloor) and cap (maximumReputationCap) enforcementGovernanceOwnablemixinPAUSER_ROLEUPDATE_ROLE— only authorised protocol contracts may callupdateReputation()New Tests
test/ReputationUpdateEngine.t.sol— Unit tests:test/ReputationUpdateEngineAccess.t.sol— Access control and integration tests:test/invariant/ReputationUpdateEngineInvariant.t.sol— Invariant tests:Architecture
Security Considerations
UPDATE_ROLEholders may mutate reputation — EOAs and external contracts are blocked(verifier, claimId)are preventedupdateReputation()isnonReentrantGas Benchmarks
⛓ Dependencies
✅ Acceptance Checklist
Closes #288