The RToken's burn() function returns incorrect values in its return tuple, not matching the expected return signature used by the ReserveLibrary. This creates inconsistencies between what integrating contracts expect to receive and what they actually get.
Vulnerability Details:
The RToken.burn() function returns values but not in the expected format, according the comments it should return
The function should return:
First value: amountScaled (scaled amount being burned)
Second value: totalSupply
Third value: amount (underlying tokens)
But instead returns:
First value: amount (raw amount)
Second value: totalSupply
Third value: amount (same raw amount)
This impacts ReserveLibrary which expects to receive the scaled amount:
This propagates to lendingPool.withdraw
Impact:
MEDIUM. This causes:
Wrong values being used in ReserveLibrary calculations
Incorrect tracking of scaled vs unscaled amounts
Potential accounting inconsistencies in the broader protocol
Tools Used:
Manual code review
Recommendations:
Fix return values in RToken.burn():
This ensures consistency between what the RToken returns and what integrating contracts expect to receive.
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.