Liquid Staking

Stakelink
DeFiHardhatOracle
50,000 USDC
View results
Submission Details
Severity: low
Invalid

Missing Check for `shares != 0` in `StakingPool::deposit`

Summary

The deposit function mints shares to depositors proportional to the LINK tokens deposited into the StakingPool. It should always be mandatory to check that the number of shares minted is never equal to 0.

Vulnerability Details

When minting shares to the depositor, it is safe to ensure that the shares minted are not equal to 0. This prevents small depositors (e.g., 1000 wei) from receiving 0 shares minted against their staked value, which can protect against inflation or donation attacks. By implementing a check to ensure that the shares minted are not equal to 0, small deposits like the above can be prevented.

Impact

Allowing the minting of 0 shares to depositors makes the StakingPool contract prone to attacks.

Tools Used

Manual Review

Recommendations

Add the check below:

require(sharesMinted != 0);
Updates

Lead Judging Commences

inallhonesty Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.