Core Contracts

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

Incorrect Comparison in the `RToken::burn` Function

Vulnerability Details

In the RToken::burn function, the amount variable represents the amount of crvUSD that the user wants to withdraw, while userBalance refers to the balance of RToken that the user possesses. These two values are not comparable because the RToken amount and the crvUSD amount do not have a 1:1 ratio.

Impact

This leads to incorrect calculations.

Tools Used

Manual review.

Recommendations

Convert userBalance to a non-scaled amount by multiplying it by the index before making the comparison.

- if(amount > userBalance){
- amount = userBalance;
- }
+ if(amount > userBalance.rayMul(index)){
+ amount = userBalance.rayMul(index);
+ }
Updates

Lead Judging Commences

inallhonesty Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement
Assigned finding tags:

Wrong balance check in RToken::burn

It's underlying vs underlying

Support

FAQs

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