DeFiFoundrySolidity
16,653 OP
View results
Submission Details
Severity: low
Invalid

Missing validation for zero amount in _deployFunds

Summary:

  • Issue: The _deployFunds function lacks validation to ensure that the _amount passed is greater than zero before attempting a deposit.

  • Effect: This leads to wasted gas as the deposit will not change the contract's state if the amount is zero.

Affected line:
https://github.com/Cyfrin/2024-12-alchemix/blob/main/src/StrategyOp.sol#L66-L70

Vulnerability Details

function _deployFunds(uint256 _amount) internal override {
transmuter.deposit(_amount, address(this));
}

Impact:


Severity
: Low

  • Description: This issue does not pose any security risk but could lead to inefficient gas usage when the function is called with zero amounts.

Tools Used:

  • Manual code review and analysis

Recommendations:

  • Add a require statement to ensure that the _amount is greater than zero:

require(_amount > 0, "Amount must be greater than zero");

This will prevent zero deposits and save gas by avoiding unnecessary function calls.

Updates

Appeal created

inallhonesty Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
inallhonesty Lead Judge 5 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.