Skip to content

Conversation

@ikemHood
Copy link
Contributor

Description

Implemented an advanced credit scoring system within the TeachLinkBridge contract. This feature allows tracking of user creditworthiness based on their on-chain activity, specifically course completions and community contributions.

Changes

  • New Module: Added score.rs to handle credit scoring logic.
  • Data Structures: Introduced ContributionType (Content, Code, Community, Governance) and Contribution structs.
  • Storage: Added persistent storage for user credit scores, completed courses history, and contribution records.
  • Events: Added CreditScoreUpdated, CourseCompleted, and ContributionRecorded events.
  • API: Exposed record_course_completion, record_contribution, and getters for score/history in the public interface.
  • Access Control: Restricted recording functions to admin actions.

Verification

  • Added a new test suite tests/test_score.rs covering the full scoring flow.
  • Verified:
    • Initial score is 0.
    • Course completion increases score.
    • Duplicate course completion does not double-count.
    • Contributions increase score.
    • Data persistence and retrieval.
  • Ran usage regression tests on existing modules.

Checklist

  • Code compiles
  • New tests pass
  • No regressions in existing tests

Closes #58

@ISTIFANUS-N
Copy link
Contributor

@ikemHood resolve conflicts

@ISTIFANUS-N
Copy link
Contributor

@ikemHood please you still have conflicting files.

@ikemHood
Copy link
Contributor Author

@ISTIFANUS-N Done

@ISTIFANUS-N ISTIFANUS-N merged commit c6903ff into rinafcode:main Jan 26, 2026
2 of 6 checks passed
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.

Implement advanced credit scoring with on-chain history

2 participants