aave / protocol-v2

Aave Protocol V2
https://aave.com
Other
662 stars 754 forks source link

Misleading error message when withdrawing insolvent asset #289

Open FredCoen opened 2 years ago

FredCoen commented 2 years ago

When depositing 10 WETH and trying to withdraw 10 WETH after tome time on kovan where available liquidity is very thin and WETH is so to say insolvent quite often, the error message for a failing withdrawal is "Subtraction overflow". This is very confusing and shouldn't be the case. Aave front end validates the max amount able to withdraw. However when interacting from a smart contract this validation would have to be explicitly made in order to avoid a confusing error message. Why is the error message not more explicit here? What view methods can be used in the aave protocol to read the max withdrawable amount before submitting it to a withdraw?

Thanks