Closed RusseII closed 2 years ago
The only thing I could think of is naming it something different, but don't love any of my ideas. previewWithdrawWithPayment, previewWithdrawAfterPayment, previewPayment, previewPaymentAndWithdraw
Same... I didn't really like any of those ideas either. Maybe @Pet3ris will have a good idea when he does a full code review :)
Could you use the ERC4626 style pure function convertPaymentToCollateral(uint256 paymentAmount) returns (uint256 collateralAmount)
?
Problem
There is currently not a good way for a user to know much collateral with be unlocked from a payment. An issuer may wonder "if i pay 10000, how much collateral will I be able to withdraw?"
This adds that functionality to the
previewWithdraw
method. If the user is paying back 10,000 the frontend could callor... How much collateral is unlocked specifically from the payment?
previewWithdraw(10,000) - previewWithdraw(0)
Feedback plz
I'm looking for suggestions for maybe a better way to do this.
This is how I thought about doing it with the least number of code modifications.