StakingRewardsPool::getStakeByShares() returns the input amount instead of zero or reverting when total stake is zero.
Users might mistakenly believe they are entitled to the entire _amount of LST when, in fact, there are no shares to back that claim. This could create confusion about their stake in the system.
Since contract StakingRewardsPool is a parent contract of StakingPool contract, stakers/users might mistakenly believe they are entitled to the entire _amount of LST when, in fact, there are no shares to back that claim. This could create confusion about their stake in the system.
Manual Review
It would be more safer to either return 0 or revert the function call to avoid misleading users and potentially introducing economic vulnerabilities in the contract.
Here's an improved version of the function:
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.