Core Contracts

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

Unsafe casting will cause serious troubles in burn functions in edge case

Summary

Both RToken and DebtToken contracts cast to uint128 in burning tokens, which will result in faulty burnings in the case that a user has more tokens than uint128 for that specific operation.

Vulnerability Details

Both RToken and DebtToken contracts have the same _burn call:

_burn(from, amount.toUint128());

Both of these tokens accrue value over time. In the case that a user has immense amount of tokens that surpass uint128, this call will fail to account for all of the user's tokens.

Imagine the scenario where the user (whose debt surpasses uint128) pays all their debt, but since this call casts uint256 into uint128, their debt will not be paid as it should be, the user would lose money. This would be unacceptable.

The same applies to RToken and its own burn function.

Impact

Burning functionality is impaired, it won't work as expected in all cases.

Tools Used

Manual review.

Recommendations

Do not cast burn amount to uint128.

Updates

Lead Judging Commences

inallhonesty Lead Judge 3 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
inallhonesty Lead Judge 3 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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