Increase on totalStaked
via donateTokens
causes problems
donateTokens
function of StakingPool
contract increases totalStaked
amount without considering impacts. Thus, minting shares can be DoSed.
The problem arises at the beginning when total shares is 0. Ahead of any deposit operation, malicious attacker can donate any amount of token to increase totalStaked
.
At the moment, totalStaked > 0
while totalShares
remains 0. This causes problem while minting shares for receivers:
sharesToMint
will be 0 which will cause _mintShares
revert:
revert in _mintShares
would cause failure of _updateStrategyRewards
function which is called from removeStrategy
and updateStrategyRewards
functions. This means, StakingPool
contract is totally blocked and not able to recover.
Manual Review
By donating, it doens't necessarily mean increasing stake. So remove the increase actions:
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.