Liquid Staking

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

Miss Handling of Zero Deposite

Vulnerability Details

The LSTRewardsSplitter::Deposit does not have the right check that can stop the deposit of Zero amount into the contract, this can lead to unnecessary state changes or other unintended behaviors.

Impact

function deposit(uint256 _amount) external onlyController {
lst.safeTransferFrom(msg.sender, address(this), _amount);
principalDeposits += _amount;
emit Deposit(_amount);
}

The controller can mistakenly deposit Zero amount into the contract and this can lead to unnecessary state or other unintentioned behaviors

Tools Used

manual review

Recommendations

Add a check to prevent zero deposits, ensuring that the _amount is greater than zero.

function deposit(uint256 _amount) external onlyController {
// Prevent zero deposit
++ if (_amount == 0) revert InvalidDepositAmount(); // Custom error or require statement
lst.safeTransferFrom(msg.sender, address(this), _amount);
principalDeposits += _amount;
emit Deposit(_amount);
}
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.