20,000 USDC
View results
Submission Details
Severity: high
Valid

Accounting error in function `refinance` updates the `poolBalance` twice

Summary

In the function refinance we are updating the poolBalance with -= debt twice.

Vulnerability Details

The first time we are doing this is in the middle of the function, the second time is at the end of the function. They are both essentially doing the same thing, so we are deducting debt out of the poolBalance twice instead of once.

Impact

Accounting error and possible loss of funds.

Tools Used

Manual review

Recommendations

Remove one of them from the code.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!