Liquid Staking

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

First Depositor Incurs Loss in StakingPool

Summary

The first depositor in the staking pool incurs a loss of some tokens due to dead shares.

Vulnerability Details

The StakingPool implements the concept of dead shares to protect against inflation attacks, but the dead shares are being subtracted from the first depositor's shares, resulting in a small loss of shares for the first depositor.

function _mintShares(address _recipient, uint256 _amount) internal {
require(_recipient != address(0), "Mint to the zero address");
if (totalShares == 0) {
shares[address(0)] = DEAD_SHARES;
totalShares = DEAD_SHARES;
@>> _amount -= DEAD_SHARES;
}
totalShares += _amount;
shares[_recipient] += _amount;
}

Impact

A small loss for the first depositor due to the subtraction of dead shares.

Recommendations

Implement the concept of virtual shares as used in ERC4626 Vaults.

Updates

Lead Judging Commences

inallhonesty Lead Judge 7 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.