Closed code423n4 closed 2 years ago
In that scenario, there is 1 major point of the system that is not considered: the bonusRatio of the user is decreasing over the Lock duration, to reach a x1 multiplier on the rewards at Lock expiry. But as said in the doc and the comments, if the Lock is expired, then the BonusRatio will continue to decrease under the x1 multiplier, down to 0. This means than users which Lock expired will get a malus over the rewards, and the locked balance will effectively accrue less rewards than a simply staked balance.
Agree with the sponsor based on the code and clarification they added re: the bonusRatio
Lines of code
https://github.com/code-423n4/2022-03-paladin/blob/main/contracts/HolyPaladinToken.sol#L786
Vulnerability details
Impact
Currently contract has no check to verify if the locked amount is already expired while calculating rewards. This means users can get reward even when there locked duration has expired
Proof of Concept
Recommended Mitigation Steps
Add a check: