The variable amountScaled is calculated using amount.rayMul(index), but it is never actually used in the function. This leads to a potential issue where scaled token balances are not properly reduced upon burning, which could cause inconsistencies in the accounting system.
Unused Calculation
The function computes amountScaled = amount.rayMul(index);, which converts the amount from underlying tokens to scaled tokens.
However, amountScaled is never used in the actual burn operation. Instead, _burn(from, amount.toUint128()); burns the raw amount.
Potential Accounting Issues
If the protocol tracks balances in scaled form, the incorrect burn method could lead to inconsistencies in the accounting system.
This could create unexpected balance discrepancies, especially in interest-bearing token models where scaling is critical.
Incorrect Token Burning: The function may not reduce the correct amount of scaled tokens, leading to inaccurate supply tracking.
Potential Accounting Inconsistencies: If scaled tokens are meant to be burned, but raw tokens are burned instead, it could desynchronize token balances from expected values.
Hidden Logical Error: Even if this doesn't immediately break functionality, it may cause long-term imbalances in the reserve system.
Manual Review
Use amountScaled in the _burn() Function
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.