Bug
set_min_lrn_to_propose rejects lrn < 0 but allows lrn == 0, which is effectively the same as having no minimum and silently disables the gate.
File: contracts/course_milestone/src/lib.rs
if lrn < 0 {
panic_with_error!(&env, Error::InvalidReward);
}
The guard should be lrn <= 0 so that callers are forced to set a meaningful minimum, or there should be a dedicated set_min_lrn_to_propose(0) path that explicitly clears the requirement.
Impact
Any admin can inadvertently zero-out the proposal minimum and allow any holder with 0 LRN to submit proposals, bypassing governance reputation gating.
Fix
Change lrn < 0 → lrn < 0 is fine only if 0 is intentionally a valid "no minimum" sentinel; document that explicitly. Otherwise change to lrn <= 0 and return InvalidReward.
Bug
set_min_lrn_to_proposerejectslrn < 0but allowslrn == 0, which is effectively the same as having no minimum and silently disables the gate.File:
contracts/course_milestone/src/lib.rsThe guard should be
lrn <= 0so that callers are forced to set a meaningful minimum, or there should be a dedicatedset_min_lrn_to_propose(0)path that explicitly clears the requirement.Impact
Any admin can inadvertently zero-out the proposal minimum and allow any holder with 0 LRN to submit proposals, bypassing governance reputation gating.
Fix
Change
lrn < 0→lrn < 0is fine only if 0 is intentionally a valid "no minimum" sentinel; document that explicitly. Otherwise change tolrn <= 0and returnInvalidReward.