DistributedCollective / Sovryn-frontend

Frontend DApp for Sovryn trading and lending platform.
https://alpha.sovryn.app
MIT License
79 stars 65 forks source link

MAX BUTTON TO LEND DOC FUNDS IS CAUSING A ROUNDING UP ERROR #1222

Closed jjmr007 closed 3 years ago

jjmr007 commented 3 years ago

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:

  1. Go to 'https://live.sovryn.app/lend'
  2. Click on 'LEND -> DEPOSIT -> MAX'
  3. Hit "Deposit DOC"
  4. Approve/Confirm the transaction on your wallet. In some cases the transaction reverts with an error: Error Message: SafeMath: subtraction overflow

Expected behavior All transactions should succeed.

Screenshots 1_1 2_1

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

soulBit commented 3 years ago

Duplicate of #1110