Describe the bug
A user tryied to lend around 500 DoC to the LoanToken protocol. Htting the MAX button of the UI the transaction prepared by the web interface roud up the amount of funds to be lent to 500.235088485414500000 DOC, but the user's balanceOf in DoC is only: 500.235088485414498161 causing a reverting error.
Describe the bug A user tryied to lend around 500 DoC to the LoanToken protocol. Htting the MAX button of the UI the transaction prepared by the web interface roud up the amount of funds to be lent to 500.235088485414500000 DOC, but the user's balanceOf in DoC is only: 500.235088485414498161 causing a reverting error.
To Reproduce Steps to reproduce the behavior:
Error Message: SafeMath: subtraction overflow
Expected behavior All transactions should succeed.
Screenshots
Desktop (please complete the following information):
OS: Linux Ubuntu 18.04.5 LTS Browser: Chrome 90.0.4430.212 (Official Build) (64-bit) Wallet: Nifty 5.2.5