canRemoveCollateral(ITokenManager.Token, uint256) function incorrectly calculates collateral eligible to remove. To be more specific, it calculates the amount to be smaller than really available to remove.
Calculations in the function are done incorrectly.
Check on line 132 is incorrect:
currentMintable
variable is old information in this check. To assess correct information should include the calculation of maxMintable() but without the eurValueToRemove
User is disincentivized to use platform and has to submit more transactions than he would like to in order to remove his collateral. Furthermore, the amount of collateral he can remove directs users' behavior with funds on platform and can lead to faulty decision being made based on wrong information that are retrieved from on-chain.
Manual review
Function and some other contract logic should be rewritten to check maxMintable() after the removal of the wanted amount. Then the contract would know how much the user can mint based on new information and can he really remove the wanted amount of collateral.
Line 132:
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.