getRewardsAmount
might return wrong result
#80
Labels
1 (Low Risk)
Assets are not at risk. State handling, function incorrect as to spec, issues with comments
bug
Something isn't working
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Handle
certora
Vulnerability details
getRewardsAmount gets epochs ids as uint256[]. However, it should be uint8[].
In _calculateRewardAmount, the epoch start time and end time are calculated:
and then are casted to uint64 for the rest of the function.
if it's greater than 2**64, it will be truncated.
Impact
getRewardsAmount
might return wrong resultTools Used
manual review
Recommended Mitigation Steps
get _epochIds as uint8[] instead uint256[]
The text was updated successfully, but these errors were encountered: