Core Contracts

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

`amountWithdrawn` is never returned

https://github.com/Cyfrin/2025-02-raac/blob/main/contracts/libraries/pools/ReserveLibrary.sol#L383

From our withdraw function we expect it to return an amountWithdrawn from the function signature

function withdraw(
ReserveData storage reserve,
ReserveRateData storage rateData,
uint256 amount,
address recipient
) internal returns (uint256 amountWithdrawn, uint256 amountScaled, uint256 amountUnderlying) {} // logic omitted for simplicity

As shown we expect an amount withdrawn to be returned.
The amountWithdrawn is later assigned to the burned scaled amount below

amountWithdrawn = burnedScaledAmount;

However, looking at the return values

return (amountUnderlying, burnedScaledAmount, amountUnderlying);

amountWithdrawn is never returned as expected.

Impact

Wrong amountWithdrawn value

Recommendation

Return values should contain an amountWithdrawn

Updates

Lead Judging Commences

inallhonesty Lead Judge 3 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 3 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.