The LibTokenSilo:removeDepositFromAccount
is intended to return the Bean Derived Value (BDV) of the deposit being removed. However, the function's implementation causes a discrepancy in the return value when dealing with partial removals. Specifically, the function signature indicates that it returns crateBDV
, but in the case of a partial removal, it returns removedBDV
. This inconsistency can lead to confusion and potential errors in how the return value is used in the broader contract or by external callers.
See the following code:
The misleading return value can cause significant issues. Developers interacting with this function might incorrectly assume the function always returns the crateBDV
, leading to incorrect logic in the calling functions. Any code relying on the return value for subsequent calculations or decisions might behave unexpectedly if it does not account for the actual return value being removedBDV
in partial removals. Incorrect handling of return values could lead to vulnerabilities, especially in a financial context where accurate value tracking is crucial.
Manual Review
To resolve this issue, the function should be modified to always return uint256
, whether the removal is partial or full. This ensures consistency and clarity in the function's behavior.
Invalid as per docs https://docs.codehawks.com/hawks-auditors/how-to-determine-a-finding-validity
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.