Problem Statement
course-registry::complete_module hardcodes let base_reward: i128 = 10_0000000; (line 329). Every course pays the same reward on completion. There's no field on Course to specify its reward amount, despite the constant BASE_REWARD_AMOUNT: i128 = 10_0000000 existing at the crate level.
Why It Matters
- Every course paying the same amount kills curriculum differentiation.
- A premium tier of courses cannot pay more without a contract upgrade.
Expected Outcome
- Add
reward_amount: i128 to the Course struct.
create_course accepts a reward amount and validates it (> 0, < MAX_*).
complete_module reads course.reward_amount instead of constant.
- New admin-only
set_course_reward(env, admin, id, new_reward) (with safeguards).
- Migration: existing courses get a default zero reward; admin must call
set_course_reward to enable.
Acceptance Criteria
- Different courses can have different reward amounts.
- Migration is non-destructive.
- Tests for the new fields and setter.
Implementation Notes
Files / Modules Affected
contracts/course-registry/src/types.rs
contracts/course-registry/src/lib.rs
contracts/course-registry/src/test.rs
contracts/course-registry/Cargo.toml (version bump).
Dependencies
Issue #35.
Difficulty
Medium.
Estimated Effort
1–2 days.
Suggested Labels
feature, breaking-change, P2, course-registry
Problem Statement
course-registry::complete_modulehardcodeslet base_reward: i128 = 10_0000000;(line 329). Every course pays the same reward on completion. There's no field onCourseto specify its reward amount, despite the constantBASE_REWARD_AMOUNT: i128 = 10_0000000existing at the crate level.Why It Matters
Expected Outcome
reward_amount: i128to theCoursestruct.create_courseaccepts a reward amount and validates it (> 0,< MAX_*).complete_modulereadscourse.reward_amountinstead of constant.set_course_reward(env, admin, id, new_reward)(with safeguards).set_course_rewardto enable.Acceptance Criteria
Implementation Notes
ContractVersioninstance key as a marker.Files / Modules Affected
contracts/course-registry/src/types.rscontracts/course-registry/src/lib.rscontracts/course-registry/src/test.rscontracts/course-registry/Cargo.toml(version bump).Dependencies
Issue #35.
Difficulty
Medium.
Estimated Effort
1–2 days.
Suggested Labels
feature,breaking-change,P2,course-registry