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

`beanToBDV` doesn't calculate and return BDV, returns just the same amount sent as param.

Summary

The name beanToBDV suggests that the function should convert or calculate the BDV from the given amount of Beans. However, the function simply returns the same amount without any transformation or calculation, which is misleading.

Vulnerability Details

The beanToBDV function in the BDVFacet contract simply returns the same amount of Beans without any transformation or calculation. This indicates a discrepancy between the function name and its actual behavior. It seems like the intention might have been to calculate or derive a BDV from the given amount of Beans, but the implementation does not reflect that.

See the following code:

/**
* @dev Returns the BDV of a given `amount` of Beans.
*/
function beanToBDV(uint256 amount) public pure returns (uint256) {
return amount;
}

Impact

The impact of this issue depends on how the beanToBDV function is intended to be used within the protocol:

  • Misleading Behavior: Developers and users relying on this function may expect it to calculate the BDV of a given amount of Beans. If they use this function based on its name without reviewing the implementation, it may lead to incorrect assumptions about the value returned.

  • Potential Bug Introduction: If other parts of the protocol or smart contracts interact with this function expecting BDV calculation, they may encounter unexpected behavior or errors due to the function's incorrect implementation.

Tools Used

Manual Review

Recommendations

To address this issue, the beanToBDV function should be updated to actually calculate or derive the BDV from the given amount of Beans. Depending on the protocol's requirements, this calculation could involve various factors such as token prices, liquidity, or other metrics. The function should accurately reflect its intended behavior and provide meaningful results based on the input parameters.

Updates

Lead Judging Commences

giovannidisiena Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement
Assigned finding tags:

Informational/Invalid

Support

FAQs

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