Category: Coding Mistakes
Incorrect check for claimable amount
Low Impact
Low Severity
Low Likelihood
Description
The extract_claimable_for function checks if the claimable amount is greater than the DURATION. The DURATION is set to 7 * 86400, which is irrelevant to the claimable amount.
fun extract_claimable_for<T>(self: &mut Voter<T>, gauger_id: ID): Balance<T> {
let gauger_id = into_gauge_id(gauger_id);
self.update_for_internal<T>(gauger_id); // should set claimable to 0 if killed
let claimable = *self.claimable.borrow(gauger_id);
// TODO: check if this assert is rigid enough
assert!(claimable > DURATION);
// [...]
}Impact
Rewards below the DURATION value cannot be claimed, which may prevent reward distribution in certain scenarios.
Recommendations
We recommend removing the check for the claimable amount.
Remediation
This issue has been acknowledged by Magma Finance, and a fix was implemented in commit a4a7a6d8↗.