A redundant state update was identified in the burn function of the RToken contract where the user's liquidity index is set twice with the same value, resulting in unnecessary gas costs and potential confusion in code maintenance.
In the burn function, the following code appears twice:
This duplicate state update:
Wastes gas by performing the same storage operation twice
Makes the code harder to maintain
Could lead to confusion about whether the second update is intended to be different
Gas Inefficiency: Each redundant SSTORE operation costs unnecessary gas
Code Quality: Reduces code maintainability and readability
Severity: Low (no security implications, but impacts gas efficiency)
Manual code review
Static analysis
Remove the redundant state update by keeping only one instance of the index update:
This change will:
Reduce gas costs
Improve code clarity
Maintain the same functionality
Make the code easier to maintain
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.