Closed rayeaster closed 1 year ago
Mostly trying to understand if:
It may be worth getting more eyes on this specific change and this flow
This merge will prob have conflicts since this doesn't use shares
everywhere
great, will merge it down and track this as an issue
The issue is found during Medusa invariant run and failure-analysis https://gist.github.com/GalloDaSballo/68046d8b089c4d29af40f31d197cc53a?permalink_comment_id=4714393#gistcomment-4714393
When a CDP is fully liquidated with some bad debt distributed (in recovery mode), there should be zero collateral as surplus for CDP owner to claim.
In previous implementation depending on Solidity multiplication and division, it might end with some rounding error that CDP ower got
1 wei
collateral as surplus.Now the issue is fixed by this PR