Core Contracts

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

Incorrect Scaling of Total Supply in DebtToken Contract

Summary

The totalSupply() function in the DebtToken contract uses rayDiv to scale the total supply by the normalized debt. However, the scaling should be done using rayMul .

Vulnerability Details

https://github.com/Cyfrin/2025-02-raac/blob/89ccb062e2b175374d40d824263a4c0b601bcb7f/contracts/core/tokens/DebtToken.sol#L234

The code divides the total supply by the normalized debt using rayDiv. This may not be correct, as the normalized debt should be applied to the total supply through multiplication (rayMul), not division. Using rayDiv instead of rayMul might lead to inaccurate scaling and result in an incorrect total supply value.

Impact

Misrepresentation of the total supply, which could lead to incorrect debt tracking, interest calculations, and other protocol interactions that rely on this value.

Tools Used

Manual review

Recommendations

Update the totalSupply() function to use rayMul instead of rayDiv for proper scaling

Updates

Lead Judging Commences

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

DebtToken::totalSupply incorrectly uses rayDiv instead of rayMul, severely under-reporting total debt and causing lending protocol accounting errors

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

DebtToken::totalSupply incorrectly uses rayDiv instead of rayMul, severely under-reporting total debt and causing lending protocol accounting errors

Support

FAQs

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