lastRewardAmount is the amount of rewards distributed in the most recent cycle. If a cycle is skipped, the lastRewardAmount of skipped cycle won't be calculated. It May cause reward lost if asset balance is high and cause reward to be higher than expected if asset balance is low.
Recommended Mitigation Steps
Ensure that this function will always run on every cycle.
Lines of code
https://github.com/corddry/ERC4626/blob/643cd044fac34bcbf64e1c3790a5126fec0dbec1/src/xERC4626.sol#L78-L97
Vulnerability details
Impact
syncRewards must be called on all cycles. If one cycle is missed, the reward may be miscalculated.
Proof of Concept
lastRewardAmount is the amount of rewards distributed in the most recent cycle. If a cycle is skipped, the lastRewardAmount of skipped cycle won't be calculated. It May cause reward lost if asset balance is high and cause reward to be higher than expected if asset balance is low.
Recommended Mitigation Steps
Ensure that this function will always run on every cycle.