Core Contracts

Regnum Aurum Acquisition Corp
HardhatReal World AssetsNFT
77,280 USDC
View results
Submission Details
Severity: low
Valid

Incorrect Return Values in `ReserveLibrary.withdraw` function

Summary

A discrepancy in the return values of the ReserveLibrary.withdraw function results in incorrect data being returned to the LendingPool.withdraw function.

Vulnerability Details

The ReserveLibrary.withdraw function is expected to return three values: amountWithdrawn, amountScaled, and amountUnderlying. However, due to an implementation error, amountUnderlying is returned twice instead of amountWithdrawn. Specifically, the return statement incorrectly assigns amountUnderlying in place of amountWithdrawn:

return (amountUnderlying, burnedScaledAmount, amountUnderlying);

Instead, it should return:

return (amountWithdrawn, burnedScaledAmount, amountUnderlying);

Impact

Incorrect Withdrawal Accounting: Since amountWithdrawn is never correctly assigned, users and the protocol itself may misinterpret the actual amount withdrawn.

Tools Used

Manual Review

Recommendations

Fix the Return Statement: Modify the return values in ReserveLibrary.withdraw to correctly return amountWithdrawn:

return (amountWithdrawn, burnedScaledAmount, amountUnderlying);
Updates

Lead Judging Commences

inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Validated
Assigned finding tags:

ReserveLibrary::withdraw returns amountUnderlying instead of amountWithdrawn, causing incorrect event emissions and potential calculation errors in LendingPool

inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Validated
Assigned finding tags:

ReserveLibrary::withdraw returns amountUnderlying instead of amountWithdrawn, causing incorrect event emissions and potential calculation errors in LendingPool

Support

FAQs

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

Give us feedback!