Core Contracts

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

If `amountToMint == 0` the return values are wrong

overview

It is expected that when a user tries to send amount as O, the function returns thhe following values

if (amountToMint == 0) {
return (false, 0, 0, 0);
}

the return values should be

(bool isFirstMint, uint256 amountScaled, uint256 newTotalSupply, uint256 amountUnderlying) = IRToken(reserve.reserveRTokenAddress).mint(
address(this), // caller
depositor, // onBehalfOf
amount, // amount
reserve.liquidityIndex // index
);

it includes values like newTotalSupply which are all set to 0. This means a total Supply of 0 could be sent which is wrong

Impact

wrong return values

Recommendation

Return the actual total Supply totalSupply() and also check the other values and ensure you return accurate values.

Updates

Lead Judging Commences

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

RToken::mint returns 0 instead of actual totalSupply() when amountToMint is 0, causing incorrect data for off-chain systems relying on return values

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

RToken::mint returns 0 instead of actual totalSupply() when amountToMint is 0, causing incorrect data for off-chain systems relying on return values

Support

FAQs

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