A malicious user can donate tokens to StakingPool
right after it's deployed so that stakers receive zero shares.
The StakingPool
contract has donateTokens
function where it increases totalStaked
without increasing shares.
On the other hand, when users try to deposit tokens to the staking pool, it calculates shares as follows:
When a malicious user donated to StakingPool
before any deposit happens, totalStaked
will be positive while totalShares
is zero.
As a result, any user who stakes tokens to the staking pool will receive zero shares.
Loss of funds for stakers
Manual Review
The protocol should not allow token donation when totalShares
is zero.
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.