_getPromotion() doesn't revert on invalid _promotionId #2
Labels
1 (Low Risk)
Assets are not at risk. State handling, function incorrect as to spec, issues with comments
bug
Something isn't working
disagree with severity
Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments)
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Handle
johnnycash
Vulnerability details
Impact
_getPromotion()
doesn't revert if the specified_promotionId
doesn't exist. It can lead to unexpected behaviors in callers of this function.For instance, claimRewards will continue its execution and call
_calculateRewardAmount()
and eventually_promotion.token.safeTransfer()
(probably with_rewardsAmount
equal to 0).Analysis
In contrary to the following comment:
_getPromotion() doesn't revert if the specified
_promotionId
doesn't exist, but return aPromotion
structure with all fields set to 0.Tools Used
Text editor.
Recommended Mitigation Steps
Fix suggestion:
The text was updated successfully, but these errors were encountered: