feat(vouching): fix #4 by adding mentor vouching contract#27
Merged
Conversation
13 tasks
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.
Closes #4
PR Description
This issues closes issue #4 by adding a standalone mentor vouching contract for StepFi learners. Verified mentors can now vouch for a learner, which stores an on-chain vouch record and calls the reputation contract to add a score boost. Mentors can also revoke an active vouch, which marks the record inactive and removes the same reputation boost.
The flow now starts with admin mentor verification through
set_mentor. A verified mentor callsvouch, the contract rejects duplicates, writes a timestampedVouchRecord, indexes it by learner for lookup, emitsMENTORVOUCHED, and callsadd_booston reputation. Revocation requires the same mentor auth, rejects missing or inactive records, callsremove_boost, persistsactive = false, and emitsVOUCHREVOKED.This matters because first-time learners now have a social trust path before loan history exists, while mentor authorization and reputation updates remain on-chain.
Changes Made
contracts/vouching-contractfor issue [4] Add mentor vouching contract #4 withlib.rs,types.rs,storage.rs,events.rs,errors.rs,tests.rs, andCargo.toml.get_vouches.MENTORVOUCHED,VOUCHREVOKED, andMENTORVERIFIED.add_boostandremove_boosttocontracts/reputation-contract/src/lib.rs.contracts/reputation-contract/src/tests.rs.vouching-contractto the workspaceCargo.toml.context/progress-tracker.mdfor issue [4] Add mentor vouching contract #4.