In FjordStaking
contract
In FjordStaking::_redeem
when calculateReward
function is called, last parameter - _toEpoch
is set to be currentEpoch - 1
:
As currentEpoch
is set to 1 in the constructor that makes function calculateReward
to be called with a 0 as last parameter.
As 0 is not a valid epoch function will either calculate wrong value or most probably revert as uint cannot be negative. That causes bigger issue as redeemPendingRewards
modifier also reverts and currentEpoch
is never changed as the only function that changes it is checkEpochRollover
which changes are not saved as it is used always with redeemPendingRewards
which will revert.
The whole contract will become unusable.
Manual Review
Add checks to ensure that currentEpoch - 1 > 0
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.