code-423n4 / 2024-05-gondi-mitigation-findings

0 stars 0 forks source link

M-03 MitigationConfirmed #68

Open c4-bot-9 opened 5 months ago

c4-bot-9 commented 5 months ago

Lines of code

Vulnerability details

Issue

The protocol fee value is recorded and stored in the Loan struct when a new loan is issued. However, the addNewTranche() does not use it.

Mitigation

The fix is changing from using protocolFee.fraction to _loan.protocolFee.

- _renegotiationOffer.fee.mulDivUp(protocolFee.fraction, _PRECISION)
+ _renegotiationOffer.fee.mulDivUp(_loan.protocolFee, _PRECISION)
c4-judge commented 4 months ago

alex-ppg marked the issue as satisfactory