Core Contracts

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

Suppliers are minted a wrong amount which results in them immediately being in profit

Summary

Suppliers are minted a wrong amount which results in them immediately being in profit

Vulnerability Details

Upon users supplying, we reach RToken::mint() where we have the following line:

_mint(onBehalfOf, amountToMint.toUint128());

We mint the amountToMint value which is actually the amount of assets the user supplies. This is incorrect as we should be minting a scaled value.

This results in the suppliers immediately being in profit:

  1. Index is 1.5 and user supplies 100 tokens

  2. We mint him 100 tokens

  3. As the index is 1.5, the user is owed 150 tokens

Impact

Suppliers are immediately in profit

Tools Used

Manual Review

Recommendations

Divide by index first

Updates

Lead Judging Commences

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

RToken::mint should mint the amountScaled not the amountToMint

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

RToken::mint should mint the amountScaled not the amountToMint

Support

FAQs

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