The repayment process contains a critical mismatch between the DebtToken::burn() function return values and their handling in the LendingPool::_repay(). The return tuple order is inverted between scaled/unscaled amounts, leading to:
Incorrect Asset Transfers
Scaled amount (protocol's internal accounting units) used instead of actual asset amount
Wrong Debt Balance Updates
Scaled values treated as raw amounts, permanently corrupting user positions
Protocol Insolvency Risk
Mismatch between actual assets and accounting records
Permanent loss of repaid funds
Users unable to reduce actual debt
Protocol accounting becomes unreliable
Liquidation mechanisms break completely
Protocol insolvency within hours of exploitation
DebtToken::burn() Return Values :
LendingPool::_repay() Incorrect Assignment :
Example Scenario
User repays 100 crvUSD (raw amount)2. Scaled amount = 100 / 1.1e27 = ~90.9e-273. DebtToken returns:
BurnedAmount = 100
scaledAmount = 90.9e-27
LendingPool incorrectly:
Transfers 100 crvUSD (should transfer 90.9e-27)
Records debt reduction as 90.9e-27 (should reduce by 100)
Result:
Protocol loses 99.999...% of repaid amount
User debt remains nearly unchanged
Total supply becomes inconsistent
Fix Return Value Handling
Interest IS applied through the balanceOf() mechanism. The separate balanceIncrease calculation is redundant/wrong. Users pay full debt including interest via userBalance capping.
Interest IS applied through the balanceOf() mechanism. The separate balanceIncrease calculation is redundant/wrong. Users pay full debt including interest via userBalance capping.
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.