DeFiHardhat
35,000 USDC
View results
Submission Details
Severity: low
Invalid

LibEvaluate::getBeanstalkState returns nothing which has undesirable effects

Summary

https://github.com/Cyfrin/2024-04-beanstalk-2/blob/27ff8c87c9164c1fbff054be5f22e56f86cdf127/protocol/contracts/libraries/LibEvaluate.sol#L274C5-L299C6
The function is defined to return multiple values (deltaPodDemand, lpToSupplyRatio, podRate, largestLiqWell), but there is no explicit return statement at the end of the function. LibEvaluate::getBeanstalkState returns nothing which has undesirable effects in other calling functions like evaluateBeanstalk, calcCaseIdandUpdate etc

Vulnerability Details

https://github.com/Cyfrin/2024-04-beanstalk-2/blob/27ff8c87c9164c1fbff054be5f22e56f86cdf127/protocol/contracts/libraries/LibEvaluate.sol#L274C5-L299C6
The function is defined to return multiple values (deltaPodDemand, lpToSupplyRatio, podRate, largestLiqWell), but there is no explicit return statement at the end of the function. LibEvaluate::getBeanstalkState returns nothing which has undesirable effects in other calling functions like evaluateBeanstalk, calcCaseIdandUpdate etc

Impact

Function calls from evaluateBeanstalk, calcCaseIdandUpdate will lead to errors which is undersirable consequence.

Tools Used

Manual Review

Recommendations

add this to end of the current code implementation
return (deltaPodDemand, lpToSupplyRatio, podRate, largestLiqWell);

Updates

Lead Judging Commences

giovannidisiena Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Informational/Invalid

Support

FAQs

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