The burn
function in RToken.sol
incorrectly returns two identical amounts instead of the scaled amount (excluding interest) and the original amount (excluding interest), potentially causing user interest losses and discrepancies in interest distribution.
Core issue:
The burn
function currently returns the same value for both the scaled amount and the original amount:
contracts/core/tokens/RToken.sol:burn#L184
Here, both amount
values are identical, which is incorrect because one should represent the underlying amount (without interest) and the other should be the scaled amount (with interest) according to the withdraw function in the ReserveLibrary.sol
contract:
contracts/libraries/pools/ReserveLibrary.sol:withdraw#L377
Incorrect Financial Calculations: The return values do not align with the expectations of the ReserveLibrary.sol
contract. For instance, withdrawing funds may result in miscalculations of how much the user should receive, potentially resulting in asset imbalances.
Inconsistent Protocol Vulnerabilities: Returning the same value for both amounts could disrupt the integrity of the protocol's internal state, particularly in calculations relating to interest accrual, token balances, and total supply.
Manual Code Review
It is recommended to correct return values in the burn function of the RToken.sol
contract. According to the ReserveLibrary.sol
contract, the withdraw
function expects to receive two distinct amounts: one representing the scaled amount (including interest) and the other representing the original amount (without interest). The correct return value should be:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.