Skip to content

feat(vouching): fix #4 by adding mentor vouching contract#27

Merged
EmeditWeb merged 1 commit into
StepFi-app:mainfrom
Dopezapha:feat-4-mentor-vouching
Jun 17, 2026
Merged

feat(vouching): fix #4 by adding mentor vouching contract#27
EmeditWeb merged 1 commit into
StepFi-app:mainfrom
Dopezapha:feat-4-mentor-vouching

Conversation

@Dopezapha

Copy link
Copy Markdown
Contributor

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 calls vouch, the contract rejects duplicates, writes a timestamped VouchRecord, indexes it by learner for lookup, emits MENTORVOUCHED, and calls add_boost on reputation. Revocation requires the same mentor auth, rejects missing or inactive records, calls remove_boost, persists active = false, and emits VOUCHREVOKED.

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

  • Added contracts/vouching-contract for issue [4] Add mentor vouching contract #4 with lib.rs, types.rs, storage.rs, events.rs, errors.rs, tests.rs, and Cargo.toml.
  • Added verified mentor storage and mentor/learner vouch records for issue [4] Add mentor vouching contract #4.
  • Added learner-indexed vouch lookup through get_vouches.
  • Added exact issue [4] Add mentor vouching contract #4 event topics: MENTORVOUCHED, VOUCHREVOKED, and MENTORVERIFIED.
  • Added duplicate-vouch, unverified-mentor, revoke, admin, event, and mock reputation cross-contract tests.
  • Added add_boost and remove_boost to contracts/reputation-contract/src/lib.rs.
  • Added reputation boost tests in contracts/reputation-contract/src/tests.rs.
  • Added vouching-contract to the workspace Cargo.toml.
  • Updated context/progress-tracker.md for issue [4] Add mentor vouching contract #4.

@EmeditWeb EmeditWeb merged commit a3a4867 into StepFi-app:main Jun 17, 2026
1 check passed
@grantfox-oss grantfox-oss Bot mentioned this pull request Jun 17, 2026
13 tasks
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.

[4] Add mentor vouching contract

2 participants